backstory/frontend/deployed/static/js/main.b1c48cdf.js

103 lines
5.4 MiB

/*! For license information please see main.b1c48cdf.js.LICENSE.txt */
(()=>{var t={4:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(1954),i=r(3101);const a=function(t,e,r,a){var o=!r;r||(r={});for(var s=-1,l=e.length;++s<l;){var c=e[s],u=a?a(r[c],t[c],c,r,t):void 0;void 0===u&&(u=t[c]),o?(0,i.A)(r,c,u):(0,n.A)(r,c,u)}return r}},53:(t,e,r)=>{"use strict";r.d(e,{XX:()=>u,q7:()=>h,sO:()=>c});var n=r(1580),i=r(958),a=r(634),o=r(3759),s={common:o.Y2,getConfig:o.zj,insertCluster:i.U,insertEdge:n.Jo,insertEdgeLabel:n.jP,insertMarkers:n.g0,insertNode:i.on,interpolateToCurve:a.Ib,labelHelper:i.Zk,log:o.Rm,positionEdgeLabel:n.T_},l={},c=(0,o.K2)((t=>{for(const e of t)l[e.name]=e}),"registerLayoutLoaders");(0,o.K2)((()=>{c([{name:"dagre",loader:(0,o.K2)((async()=>await Promise.all([r.e(854),r.e(62),r.e(626)]).then(r.bind(r,5626))),"loader")}])}),"registerDefaultLayoutLoaders")();var u=(0,o.K2)((async(t,e)=>{if(!(t.layoutAlgorithm in l))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=l[t.layoutAlgorithm];return(await r.loader()).render(t,e,s,{algorithm:r.algorithm})}),"render"),h=(0,o.K2)((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",{fallback:e="dagre"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t in l)return t;if(e in l)return o.Rm.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)}),"getRegisteredLayoutAlgorithm")},191:(t,e)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case i:case o:case a:case u:case h:case f:return t;default:switch(t=t&&t.$$typeof){case l:case c:case p:case d:case s:return t;default:return e}}case n:return e}}}e.Hy=function(t){return"string"===typeof t||"function"===typeof t||t===i||t===o||t===a||t===u||t===h||"object"===typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===l||t.$$typeof===s||t.$$typeof===c||t.$$typeof===m||void 0!==t.getModuleId)}},219:(t,e,r)=>{"use strict";var n=r(3763),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(t){return n.isMemo(t)?o:s[t.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;t.exports=function t(e,r,n){if("string"!==typeof r){if(f){var i=p(r);i&&i!==f&&t(e,i,n)}var o=u(r);h&&(o=o.concat(h(r)));for(var s=l(e),m=l(r),g=0;g<o.length;++g){var y=o[g];if(!a[y]&&(!n||!n[y])&&(!m||!m[y])&&(!s||!s[y])){var v=d(r,y);try{c(e,y,v)}catch(x){}}}}return e}},286:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=Object.prototype;const i=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},446:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",o="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},y=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},v={s:y,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,c),a=r-i<0,o=e.clone().add(n+(a?-1:1),c);return+(-(n+(r-i)/(a?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:l,d:s,D:d,h:o,m:a,s:i,ms:n,Q:u}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},x="en",b={};b[x]=g;var _="$isDayjsObject",w=function(t){return t instanceof A||!(!t||!t[_])},k=function t(e,r,n){var i;if(!e)return x;if("string"==typeof e){var a=e.toLowerCase();b[a]&&(i=a),r&&(b[a]=r,i=a);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var s=e.name;b[s]=e,i=s}return!n&&i&&(x=i),i||!n&&x},T=function(t,e){if(w(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new A(r)},S=v;S.l=k,S.i=w,S.w=function(t,e){return T(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[_]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(t,e){var r=T(t);return this.startOf(e)<=r&&r<=this.endOf(e)},y.isAfter=function(t,e){return T(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<T(t)},y.$g=function(t,e,r){return S.u(t)?this[e]:this.set(r,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var r=this,n=!!S.u(e)||e,u=S.p(t),p=function(t,e){var i=S.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?i:i.endOf(s)},f=function(t,e){return S.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case h:return n?p(1,0):p(31,11);case c:return n?p(1,g):p(0,g+1);case l:var x=this.$locale().weekStart||0,b=(m<x?m+7:m)-x;return p(n?y-b:y+(6-b),g);case s:case d:return f(v+"Hours",0);case o:return f(v+"Minutes",1);case a:return f(v+"Seconds",2);case i:return f(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var r,l=S.p(t),u="set"+(this.$u?"UTC":""),p=(r={},r[s]=u+"Date",r[d]=u+"Date",r[c]=u+"Month",r[h]=u+"FullYear",r[o]=u+"Hours",r[a]=u+"Minutes",r[i]=u+"Seconds",r[n]=u+"Milliseconds",r)[l],f=l===s?this.$D+(e-this.$W):e;if(l===c||l===h){var m=this.clone().set(d,1);m.$d[p](f),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[S.p(t)]()},y.add=function(n,u){var d,p=this;n=Number(n);var f=S.p(u),m=function(t){var e=T(p);return S.w(e.date(e.date()+Math.round(t*n)),p)};if(f===c)return this.set(c,this.$M+n);if(f===h)return this.set(h,this.$y+n);if(f===s)return m(1);if(f===l)return m(7);var g=(d={},d[a]=e,d[o]=r,d[i]=t,d)[f]||1,y=this.$d.getTime()+n*g;return S.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=S.z(this),a=this.$H,o=this.$m,s=this.$M,l=r.weekdays,c=r.months,u=r.meridiem,h=function(t,r,i,a){return t&&(t[r]||t(e,n))||i[r].slice(0,a)},d=function(t){return S.s(a%12||12,t,"0")},f=u||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(m,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return s+1;case"MM":return S.s(s+1,2,"0");case"MMM":return h(r.monthsShort,s,c,3);case"MMMM":return h(c,s);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(r.weekdaysMin,e.$W,l,2);case"ddd":return h(r.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(a);case"HH":return S.s(a,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return f(a,o,!0);case"A":return f(a,o,!1);case"m":return String(o);case"mm":return S.s(o,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,d,p){var f,m=this,g=S.p(d),y=T(n),v=(y.utcOffset()-this.utcOffset())*e,x=this-y,b=function(){return S.m(m,y)};switch(g){case h:f=b()/12;break;case c:f=b();break;case u:f=b()/3;break;case l:f=(x-v)/6048e5;break;case s:f=(x-v)/864e5;break;case o:f=x/r;break;case a:f=x/e;break;case i:f=x/t;break;default:f=x}return p?f:S.a(f)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return b[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=k(t,e,!0);return n&&(r.$L=n),r},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),M=A.prototype;return T.prototype=M,[["$ms",n],["$s",i],["$m",a],["$H",o],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(t){M[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),T.extend=function(t,e){return t.$i||(t(e,A,T),t.$i=!0),T},T.locale=k,T.isDayjs=w,T.unix=function(t){return T(1e3*t)},T.en=b[x],T.Ls=b,T.p={},T}()},522:(t,e,r)=>{"use strict";r.d(e,{H:()=>rr,r:()=>er});var n=r(3759);function i(t){return"undefined"===typeof t||null===t}function a(t){return"object"===typeof t&&null!==t}function o(t){return Array.isArray(t)?t:i(t)?[]:[t]}function s(t,e){var r,n,i,a;if(e)for(r=0,n=(a=Object.keys(e)).length;r<n;r+=1)t[i=a[r]]=e[i];return t}function l(t,e){var r,n="";for(r=0;r<e;r+=1)n+=t;return n}function c(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}(0,n.K2)(i,"isNothing"),(0,n.K2)(a,"isObject"),(0,n.K2)(o,"toArray"),(0,n.K2)(s,"extend"),(0,n.K2)(l,"repeat"),(0,n.K2)(c,"isNegativeZero");var u={isNothing:i,isObject:a,toArray:o,repeat:l,isNegativeZero:c,extend:s};function h(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+="\n\n"+t.mark.snippet),n+" "+r):n}function d(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=h(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}(0,n.K2)(h,"formatError"),(0,n.K2)(d,"YAMLException$1"),d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.toString=(0,n.K2)((function(t){return this.name+": "+h(this,t)}),"toString");var p=d;function f(t,e,r,n,i){var a="",o="",s=Math.floor(i/2)-1;return n-e>s&&(e=n-s+(a=" ... ").length),r-n>s&&(r=n+s-(o=" ...").length),{str:a+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+a.length}}function m(t,e){return u.repeat(" ",e-t.length)+t}function g(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!==typeof e.indent&&(e.indent=1),"number"!==typeof e.linesBefore&&(e.linesBefore=3),"number"!==typeof e.linesAfter&&(e.linesAfter=2);for(var r,n=/\r?\n|\r|\0/g,i=[0],a=[],o=-1;r=n.exec(t.buffer);)a.push(r.index),i.push(r.index+r[0].length),t.position<=r.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s,l,c="",h=Math.min(t.line+e.linesAfter,a.length).toString().length,d=e.maxLength-(e.indent+h+3);for(s=1;s<=e.linesBefore&&!(o-s<0);s++)l=f(t.buffer,i[o-s],a[o-s],t.position-(i[o]-i[o-s]),d),c=u.repeat(" ",e.indent)+m((t.line-s+1).toString(),h)+" | "+l.str+"\n"+c;for(l=f(t.buffer,i[o],a[o],t.position,d),c+=u.repeat(" ",e.indent)+m((t.line+1).toString(),h)+" | "+l.str+"\n",c+=u.repeat("-",e.indent+h+3+l.pos)+"^\n",s=1;s<=e.linesAfter&&!(o+s>=a.length);s++)l=f(t.buffer,i[o+s],a[o+s],t.position-(i[o]-i[o+s]),d),c+=u.repeat(" ",e.indent)+m((t.line+s+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}(0,n.K2)(f,"getLine"),(0,n.K2)(m,"padStart"),(0,n.K2)(g,"makeSnippet");var y=g,v=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],x=["scalar","sequence","mapping"];function b(t){var e={};return null!==t&&Object.keys(t).forEach((function(r){t[r].forEach((function(t){e[String(t)]=r}))})),e}function _(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===v.indexOf(e))throw new p('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=b(e.styleAliases||null),-1===x.indexOf(this.kind))throw new p('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}(0,n.K2)(b,"compileStyleAliases"),(0,n.K2)(_,"Type$1");var w=_;function k(t,e){var r=[];return t[e].forEach((function(t){var e=r.length;r.forEach((function(r,n){r.tag===t.tag&&r.kind===t.kind&&r.multi===t.multi&&(e=n)})),r[e]=t})),r}function T(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for((0,n.K2)(i,"collectType"),t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(i);return r}function S(t){return this.extend(t)}(0,n.K2)(k,"compileList"),(0,n.K2)(T,"compileMap"),(0,n.K2)(S,"Schema$1"),S.prototype.extend=(0,n.K2)((function(t){var e=[],r=[];if(t instanceof w)r.push(t);else if(Array.isArray(t))r=r.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new p("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof w))throw new p("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new p("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new p("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(t){if(!(t instanceof w))throw new p("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(S.prototype);return n.implicit=(this.implicit||[]).concat(e),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=k(n,"implicit"),n.compiledExplicit=k(n,"explicit"),n.compiledTypeMap=T(n.compiledImplicit,n.compiledExplicit),n}),"extend");var A=new S({explicit:[new w("tag:yaml.org,2002:str",{kind:"scalar",construct:(0,n.K2)((function(t){return null!==t?t:""}),"construct")}),new w("tag:yaml.org,2002:seq",{kind:"sequence",construct:(0,n.K2)((function(t){return null!==t?t:[]}),"construct")}),new w("tag:yaml.org,2002:map",{kind:"mapping",construct:(0,n.K2)((function(t){return null!==t?t:{}}),"construct")})]});function M(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function C(){return null}function E(t){return null===t}(0,n.K2)(M,"resolveYamlNull"),(0,n.K2)(C,"constructYamlNull"),(0,n.K2)(E,"isNull");var L=new w("tag:yaml.org,2002:null",{kind:"scalar",resolve:M,construct:C,predicate:E,represent:{canonical:(0,n.K2)((function(){return"~"}),"canonical"),lowercase:(0,n.K2)((function(){return"null"}),"lowercase"),uppercase:(0,n.K2)((function(){return"NULL"}),"uppercase"),camelcase:(0,n.K2)((function(){return"Null"}),"camelcase"),empty:(0,n.K2)((function(){return""}),"empty")},defaultStyle:"lowercase"});function P(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function I(t){return"true"===t||"True"===t||"TRUE"===t}function z(t){return"[object Boolean]"===Object.prototype.toString.call(t)}(0,n.K2)(P,"resolveYamlBoolean"),(0,n.K2)(I,"constructYamlBoolean"),(0,n.K2)(z,"isBoolean");var O=new w("tag:yaml.org,2002:bool",{kind:"scalar",resolve:P,construct:I,predicate:z,represent:{lowercase:(0,n.K2)((function(t){return t?"true":"false"}),"lowercase"),uppercase:(0,n.K2)((function(t){return t?"TRUE":"FALSE"}),"uppercase"),camelcase:(0,n.K2)((function(t){return t?"True":"False"}),"camelcase")},defaultStyle:"lowercase"});function D(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function R(t){return 48<=t&&t<=55}function F(t){return 48<=t&&t<=57}function B(t){if(null===t)return!1;var e,r=t.length,n=0,i=!1;if(!r)return!1;if("-"!==(e=t[n])&&"+"!==e||(e=t[++n]),"0"===e){if(n+1===r)return!0;if("b"===(e=t[++n])){for(n++;n<r;n++)if("_"!==(e=t[n])){if("0"!==e&&"1"!==e)return!1;i=!0}return i&&"_"!==e}if("x"===e){for(n++;n<r;n++)if("_"!==(e=t[n])){if(!D(t.charCodeAt(n)))return!1;i=!0}return i&&"_"!==e}if("o"===e){for(n++;n<r;n++)if("_"!==(e=t[n])){if(!R(t.charCodeAt(n)))return!1;i=!0}return i&&"_"!==e}}if("_"===e)return!1;for(;n<r;n++)if("_"!==(e=t[n])){if(!F(t.charCodeAt(n)))return!1;i=!0}return!(!i||"_"===e)}function j(t){var e,r=t,n=1;if(-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(n=-1),e=(r=r.slice(1))[0]),"0"===r)return 0;if("0"===e){if("b"===r[1])return n*parseInt(r.slice(2),2);if("x"===r[1])return n*parseInt(r.slice(2),16);if("o"===r[1])return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function N(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1===0&&!u.isNegativeZero(t)}(0,n.K2)(D,"isHexCode"),(0,n.K2)(R,"isOctCode"),(0,n.K2)(F,"isDecCode"),(0,n.K2)(B,"resolveYamlInteger"),(0,n.K2)(j,"constructYamlInteger"),(0,n.K2)(N,"isInteger");var U=new w("tag:yaml.org,2002:int",{kind:"scalar",resolve:B,construct:j,predicate:N,represent:{binary:(0,n.K2)((function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:(0,n.K2)((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:(0,n.K2)((function(t){return t.toString(10)}),"decimal"),hexadecimal:(0,n.K2)((function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}),"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),V=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function q(t){return null!==t&&!(!V.test(t)||"_"===t[t.length-1])}function $(t){var e,r;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:r*parseFloat(e,10)}(0,n.K2)(q,"resolveYamlFloat"),(0,n.K2)($,"constructYamlFloat");var H=/^[-+]?[0-9]+e/;function W(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(u.isNegativeZero(t))return"-0.0";return r=t.toString(10),H.test(r)?r.replace("e",".e"):r}function G(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!==0||u.isNegativeZero(t))}(0,n.K2)(W,"representYamlFloat"),(0,n.K2)(G,"isFloat");var Y=new w("tag:yaml.org,2002:float",{kind:"scalar",resolve:q,construct:$,predicate:G,represent:W,defaultStyle:"lowercase"}),Z=A.extend({implicit:[L,O,U,Y]}),X=Z,K=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),J=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Q(t){return null!==t&&(null!==K.exec(t)||null!==J.exec(t))}function tt(t){var e,r,n,i,a,o,s,l,c=0,u=null;if(null===(e=K.exec(t))&&(e=J.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],o=+e[5],s=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(u=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(u=-u)),l=new Date(Date.UTC(r,n,i,a,o,s,c)),u&&l.setTime(l.getTime()-u),l}function et(t){return t.toISOString()}(0,n.K2)(Q,"resolveYamlTimestamp"),(0,n.K2)(tt,"constructYamlTimestamp"),(0,n.K2)(et,"representYamlTimestamp");var rt=new w("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q,construct:tt,instanceOf:Date,represent:et});function nt(t){return"<<"===t||null===t}(0,n.K2)(nt,"resolveYamlMerge");var it=new w("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nt}),at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function ot(t){if(null===t)return!1;var e,r,n=0,i=t.length,a=at;for(r=0;r<i;r++)if(!((e=a.indexOf(t.charAt(r)))>64)){if(e<0)return!1;n+=6}return n%8===0}function st(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=at,o=0,s=[];for(e=0;e<i;e++)e%4===0&&e&&(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)),o=o<<6|a.indexOf(n.charAt(e));return 0===(r=i%4*6)?(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)):18===r?(s.push(o>>10&255),s.push(o>>2&255)):12===r&&s.push(o>>4&255),new Uint8Array(s)}function lt(t){var e,r,n="",i=0,a=t.length,o=at;for(e=0;e<a;e++)e%3===0&&e&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+t[e];return 0===(r=a%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2===r?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1===r&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function ct(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}(0,n.K2)(ot,"resolveYamlBinary"),(0,n.K2)(st,"constructYamlBinary"),(0,n.K2)(lt,"representYamlBinary"),(0,n.K2)(ct,"isBinary");var ut=new w("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ot,construct:st,predicate:ct,represent:lt}),ht=Object.prototype.hasOwnProperty,dt=Object.prototype.toString;function pt(t){if(null===t)return!0;var e,r,n,i,a,o=[],s=t;for(e=0,r=s.length;e<r;e+=1){if(n=s[e],a=!1,"[object Object]"!==dt.call(n))return!1;for(i in n)if(ht.call(n,i)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==o.indexOf(i))return!1;o.push(i)}return!0}function ft(t){return null!==t?t:[]}(0,n.K2)(pt,"resolveYamlOmap"),(0,n.K2)(ft,"constructYamlOmap");var mt=new w("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pt,construct:ft}),gt=Object.prototype.toString;function yt(t){if(null===t)return!0;var e,r,n,i,a,o=t;for(a=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(n=o[e],"[object Object]"!==gt.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;a[e]=[i[0],n[i[0]]]}return!0}function vt(t){if(null===t)return[];var e,r,n,i,a,o=t;for(a=new Array(o.length),e=0,r=o.length;e<r;e+=1)n=o[e],i=Object.keys(n),a[e]=[i[0],n[i[0]]];return a}(0,n.K2)(yt,"resolveYamlPairs"),(0,n.K2)(vt,"constructYamlPairs");var xt=new w("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yt,construct:vt}),bt=Object.prototype.hasOwnProperty;function _t(t){if(null===t)return!0;var e,r=t;for(e in r)if(bt.call(r,e)&&null!==r[e])return!1;return!0}function wt(t){return null!==t?t:{}}(0,n.K2)(_t,"resolveYamlSet"),(0,n.K2)(wt,"constructYamlSet");var kt=new w("tag:yaml.org,2002:set",{kind:"mapping",resolve:_t,construct:wt}),Tt=X.extend({implicit:[rt,it],explicit:[ut,mt,xt,kt]}),St=Object.prototype.hasOwnProperty,At=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mt=/[\x85\u2028\u2029]/,Ct=/[,\[\]\{\}]/,Et=/^(?:!|!!|![a-z\-]+!)$/i,Lt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Pt(t){return Object.prototype.toString.call(t)}function It(t){return 10===t||13===t}function zt(t){return 9===t||32===t}function Ot(t){return 9===t||32===t||10===t||13===t}function Dt(t){return 44===t||91===t||93===t||123===t||125===t}function Rt(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function Ft(t){return 120===t?2:117===t?4:85===t?8:0}function Bt(t){return 48<=t&&t<=57?t-48:-1}function jt(t){return 48===t?"\0":97===t?"\x07":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"\x1b":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"\x85":95===t?"\xa0":76===t?"\u2028":80===t?"\u2029":""}function Nt(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}(0,n.K2)(Pt,"_class"),(0,n.K2)(It,"is_EOL"),(0,n.K2)(zt,"is_WHITE_SPACE"),(0,n.K2)(Ot,"is_WS_OR_EOL"),(0,n.K2)(Dt,"is_FLOW_INDICATOR"),(0,n.K2)(Rt,"fromHexCode"),(0,n.K2)(Ft,"escapedHexLen"),(0,n.K2)(Bt,"fromDecimalCode"),(0,n.K2)(jt,"simpleEscapeSequence"),(0,n.K2)(Nt,"charFromCodepoint");var Ut,Vt=new Array(256),qt=new Array(256);for(Ut=0;Ut<256;Ut++)Vt[Ut]=jt(Ut)?1:0,qt[Ut]=jt(Ut);function $t(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Tt,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ht(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=y(r),new p(e,r)}function Wt(t,e){throw Ht(t,e)}function Gt(t,e){t.onWarning&&t.onWarning.call(null,Ht(t,e))}(0,n.K2)($t,"State$1"),(0,n.K2)(Ht,"generateError"),(0,n.K2)(Wt,"throwError"),(0,n.K2)(Gt,"throwWarning");var Yt={YAML:(0,n.K2)((function(t,e,r){var n,i,a;null!==t.version&&Wt(t,"duplication of %YAML directive"),1!==r.length&&Wt(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&Wt(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),1!==i&&Wt(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&Gt(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:(0,n.K2)((function(t,e,r){var n,i;2!==r.length&&Wt(t,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],Et.test(n)||Wt(t,"ill-formed tag handle (first argument) of the TAG directive"),St.call(t.tagMap,n)&&Wt(t,'there is a previously declared suffix for "'+n+'" tag handle'),Lt.test(i)||Wt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(a){Wt(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}),"handleTagDirective")};function Zt(t,e,r,n){var i,a,o,s;if(e<r){if(s=t.input.slice(e,r),n)for(i=0,a=s.length;i<a;i+=1)9===(o=s.charCodeAt(i))||32<=o&&o<=1114111||Wt(t,"expected valid JSON character");else At.test(s)&&Wt(t,"the stream contains non-printable characters");t.result+=s}}function Xt(t,e,r,n){var i,a,o,s;for(u.isObject(r)||Wt(t,"cannot merge mappings; the provided source object is unacceptable"),o=0,s=(i=Object.keys(r)).length;o<s;o+=1)a=i[o],St.call(e,a)||(e[a]=r[a],n[a]=!0)}function Kt(t,e,r,n,i,a,o,s,l){var c,u;if(Array.isArray(i))for(c=0,u=(i=Array.prototype.slice.call(i)).length;c<u;c+=1)Array.isArray(i[c])&&Wt(t,"nested arrays are not supported inside keys"),"object"===typeof i&&"[object Object]"===Pt(i[c])&&(i[c]="[object Object]");if("object"===typeof i&&"[object Object]"===Pt(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(a))for(c=0,u=a.length;c<u;c+=1)Xt(t,e,a[c],r);else Xt(t,e,a,r);else t.json||St.call(r,i)||!St.call(e,i)||(t.line=o||t.line,t.lineStart=s||t.lineStart,t.position=l||t.position,Wt(t,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[i]=a,delete r[i];return e}function Jt(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):Wt(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Qt(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);0!==i;){for(;zt(i);)9===i&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!It(i))break;for(Jt(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==r&&0!==n&&t.lineIndent<r&&Gt(t,"deficient indentation"),n}function te(t){var e,r=t.position;return!(45!==(e=t.input.charCodeAt(r))&&46!==e||e!==t.input.charCodeAt(r+1)||e!==t.input.charCodeAt(r+2)||(r+=3,0!==(e=t.input.charCodeAt(r))&&!Ot(e)))}function ee(t,e){1===e?t.result+=" ":e>1&&(t.result+=u.repeat("\n",e-1))}function re(t,e,r){var n,i,a,o,s,l,c,u,h=t.kind,d=t.result;if(Ot(u=t.input.charCodeAt(t.position))||Dt(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(Ot(n=t.input.charCodeAt(t.position+1))||r&&Dt(n)))return!1;for(t.kind="scalar",t.result="",i=a=t.position,o=!1;0!==u;){if(58===u){if(Ot(n=t.input.charCodeAt(t.position+1))||r&&Dt(n))break}else if(35===u){if(Ot(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&te(t)||r&&Dt(u))break;if(It(u)){if(s=t.line,l=t.lineStart,c=t.lineIndent,Qt(t,!1,-1),t.lineIndent>=e){o=!0,u=t.input.charCodeAt(t.position);continue}t.position=a,t.line=s,t.lineStart=l,t.lineIndent=c;break}}o&&(Zt(t,i,a,!1),ee(t,t.line-s),i=a=t.position,o=!1),zt(u)||(a=t.position+1),u=t.input.charCodeAt(++t.position)}return Zt(t,i,a,!1),!!t.result||(t.kind=h,t.result=d,!1)}function ne(t,e){var r,n,i;if(39!==(r=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(r=t.input.charCodeAt(t.position));)if(39===r){if(Zt(t,n,t.position,!0),39!==(r=t.input.charCodeAt(++t.position)))return!0;n=t.position,t.position++,i=t.position}else It(r)?(Zt(t,n,i,!0),ee(t,Qt(t,!1,e)),n=i=t.position):t.position===t.lineStart&&te(t)?Wt(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Wt(t,"unexpected end of the stream within a single quoted scalar")}function ie(t,e){var r,n,i,a,o,s;if(34!==(s=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;0!==(s=t.input.charCodeAt(t.position));){if(34===s)return Zt(t,r,t.position,!0),t.position++,!0;if(92===s){if(Zt(t,r,t.position,!0),It(s=t.input.charCodeAt(++t.position)))Qt(t,!1,e);else if(s<256&&Vt[s])t.result+=qt[s],t.position++;else if((o=Ft(s))>0){for(i=o,a=0;i>0;i--)(o=Rt(s=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+o:Wt(t,"expected hexadecimal character");t.result+=Nt(a),t.position++}else Wt(t,"unknown escape sequence");r=n=t.position}else It(s)?(Zt(t,r,n,!0),ee(t,Qt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&te(t)?Wt(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Wt(t,"unexpected end of the stream within a double quoted scalar")}function ae(t,e){var r,n,i,a,o,s,l,c,u,h,d,p,f=!0,m=t.tag,g=t.anchor,y=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))o=93,c=!1,a=[];else{if(123!==p)return!1;o=125,c=!0,a={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),p=t.input.charCodeAt(++t.position);0!==p;){if(Qt(t,!0,e),(p=t.input.charCodeAt(t.position))===o)return t.position++,t.tag=m,t.anchor=g,t.kind=c?"mapping":"sequence",t.result=a,!0;f?44===p&&Wt(t,"expected the node content, but found ','"):Wt(t,"missed comma between flow collection entries"),d=null,s=l=!1,63===p&&Ot(t.input.charCodeAt(t.position+1))&&(s=l=!0,t.position++,Qt(t,!0,e)),r=t.line,n=t.lineStart,i=t.position,de(t,e,1,!1,!0),h=t.tag,u=t.result,Qt(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==r||58!==p||(s=!0,p=t.input.charCodeAt(++t.position),Qt(t,!0,e),de(t,e,1,!1,!0),d=t.result),c?Kt(t,a,y,h,u,d,r,n,i):s?a.push(Kt(t,null,y,h,u,d,r,n,i)):a.push(u),Qt(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(f=!0,p=t.input.charCodeAt(++t.position)):f=!1}Wt(t,"unexpected end of the stream within a flow collection")}function oe(t,e){var r,n,i,a,o=1,s=!1,l=!1,c=e,h=0,d=!1;if(124===(a=t.input.charCodeAt(t.position)))n=!1;else{if(62!==a)return!1;n=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)1===o?o=43===a?3:2:Wt(t,"repeat of a chomping mode identifier");else{if(!((i=Bt(a))>=0))break;0===i?Wt(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Wt(t,"repeat of an indentation width identifier"):(c=e+i-1,l=!0)}if(zt(a)){do{a=t.input.charCodeAt(++t.position)}while(zt(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!It(a)&&0!==a)}for(;0!==a;){for(Jt(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndent<c)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>c&&(c=t.lineIndent),It(a))h++;else{if(t.lineIndent<c){3===o?t.result+=u.repeat("\n",s?1+h:h):1===o&&s&&(t.result+="\n");break}for(n?zt(a)?(d=!0,t.result+=u.repeat("\n",s?1+h:h)):d?(d=!1,t.result+=u.repeat("\n",h+1)):0===h?s&&(t.result+=" "):t.result+=u.repeat("\n",h):t.result+=u.repeat("\n",s?1+h:h),s=!0,l=!0,h=0,r=t.position;!It(a)&&0!==a;)a=t.input.charCodeAt(++t.position);Zt(t,r,t.position,!1)}}return!0}function se(t,e){var r,n,i=t.tag,a=t.anchor,o=[],s=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),n=t.input.charCodeAt(t.position);0!==n&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,Wt(t,"tab characters must not be used in indentation")),45===n)&&Ot(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,Qt(t,!0,-1)&&t.lineIndent<=e)o.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,de(t,e,3,!1,!0),o.push(t.result),Qt(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)Wt(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!s&&(t.tag=i,t.anchor=a,t.kind="sequence",t.result=o,!0)}function le(t,e,r){var n,i,a,o,s,l,c,u=t.tag,h=t.anchor,d={},p=Object.create(null),f=null,m=null,g=null,y=!1,v=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=d),c=t.input.charCodeAt(t.position);0!==c;){if(y||-1===t.firstTabInLine||(t.position=t.firstTabInLine,Wt(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),a=t.line,63!==c&&58!==c||!Ot(n)){if(o=t.line,s=t.lineStart,l=t.position,!de(t,r,2,!1,!0))break;if(t.line===a){for(c=t.input.charCodeAt(t.position);zt(c);)c=t.input.charCodeAt(++t.position);if(58===c)Ot(c=t.input.charCodeAt(++t.position))||Wt(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Kt(t,d,p,f,m,null,o,s,l),f=m=g=null),v=!0,y=!1,i=!1,f=t.tag,m=t.result;else{if(!v)return t.tag=u,t.anchor=h,!0;Wt(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return t.tag=u,t.anchor=h,!0;Wt(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(y&&(Kt(t,d,p,f,m,null,o,s,l),f=m=g=null),v=!0,y=!0,i=!0):y?(y=!1,i=!0):Wt(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=n;if((t.line===a||t.lineIndent>e)&&(y&&(o=t.line,s=t.lineStart,l=t.position),de(t,e,4,!0,i)&&(y?m=t.result:g=t.result),y||(Kt(t,d,p,f,m,g,o,s,l),f=m=g=null),Qt(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)Wt(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&Kt(t,d,p,f,m,null,o,s,l),v&&(t.tag=u,t.anchor=h,t.kind="mapping",t.result=d),v}function ce(t){var e,r,n,i,a=!1,o=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&Wt(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(a=!0,i=t.input.charCodeAt(++t.position)):33===i?(o=!0,r="!!",i=t.input.charCodeAt(++t.position)):r="!",e=t.position,a){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(n=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):Wt(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!Ot(i);)33===i&&(o?Wt(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),Et.test(r)||Wt(t,"named tag handle cannot contain such characters"),o=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),Ct.test(n)&&Wt(t,"tag suffix cannot contain flow indicator characters")}n&&!Lt.test(n)&&Wt(t,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(s){Wt(t,"tag name is malformed: "+n)}return a?t.tag=n:St.call(t.tagMap,r)?t.tag=t.tagMap[r]+n:"!"===r?t.tag="!"+n:"!!"===r?t.tag="tag:yaml.org,2002:"+n:Wt(t,'undeclared tag handle "'+r+'"'),!0}function ue(t){var e,r;if(38!==(r=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&Wt(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!Ot(r)&&!Dt(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Wt(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function he(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!Ot(n)&&!Dt(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&Wt(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),St.call(t.anchorMap,r)||Wt(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Qt(t,!0,-1),!0}function de(t,e,r,n,i){var a,o,s,l,c,u,h,d,p,f=1,m=!1,g=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=o=s=4===r||3===r,n&&Qt(t,!0,-1)&&(m=!0,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)),1===f)for(;ce(t)||ue(t);)Qt(t,!0,-1)?(m=!0,s=a,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)):s=!1;if(s&&(s=m||i),1!==f&&4!==r||(d=1===r||2===r?e:e+1,p=t.position-t.lineStart,1===f?s&&(se(t,p)||le(t,p,d))||ae(t,d)?g=!0:(o&&oe(t,d)||ne(t,d)||ie(t,d)?g=!0:he(t)?(g=!0,null===t.tag&&null===t.anchor||Wt(t,"alias node should not have any properties")):re(t,d,1===r)&&(g=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===f&&(g=s&&se(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&Wt(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l<c;l+=1)if((h=t.implicitTypes[l]).resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(St.call(t.typeMap[t.kind||"fallback"],t.tag))h=t.typeMap[t.kind||"fallback"][t.tag];else for(h=null,l=0,c=(u=t.typeMap.multi[t.kind||"fallback"]).length;l<c;l+=1)if(t.tag.slice(0,u[l].tag.length)===u[l].tag){h=u[l];break}h||Wt(t,"unknown tag !<"+t.tag+">"),null!==t.result&&h.kind!==t.kind&&Wt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result,t.tag)?(t.result=h.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):Wt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||g}function pe(t){var e,r,n,i,a=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(Qt(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(o=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!Ot(i);)i=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&Wt(t,"directive name must not be less than one character in length");0!==i;){for(;zt(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!It(i));break}if(It(i))break;for(e=t.position;0!==i&&!Ot(i);)i=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==i&&Jt(t),St.call(Yt,r)?Yt[r](t,r,n):Gt(t,'unknown document directive "'+r+'"')}Qt(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Qt(t,!0,-1)):o&&Wt(t,"directives end mark is expected"),de(t,t.lineIndent-1,4,!1,!0),Qt(t,!0,-1),t.checkLineBreaks&&Mt.test(t.input.slice(a,t.position))&&Gt(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&te(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Qt(t,!0,-1)):t.position<t.length-1&&Wt(t,"end of the stream or a document separator is expected")}function fe(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var r=new $t(t,e),n=t.indexOf("\0");for(-1!==n&&(r.position=n,Wt(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)pe(r);return r.documents}function me(t,e,r){null!==e&&"object"===typeof e&&"undefined"===typeof r&&(r=e,e=null);var n=fe(t,r);if("function"!==typeof e)return n;for(var i=0,a=n.length;i<a;i+=1)e(n[i])}function ge(t,e){var r=fe(t,e);if(0!==r.length){if(1===r.length)return r[0];throw new p("expected a single document in the stream, but found more")}}(0,n.K2)(Zt,"captureSegment"),(0,n.K2)(Xt,"mergeMappings"),(0,n.K2)(Kt,"storeMappingPair"),(0,n.K2)(Jt,"readLineBreak"),(0,n.K2)(Qt,"skipSeparationSpace"),(0,n.K2)(te,"testDocumentSeparator"),(0,n.K2)(ee,"writeFoldedLines"),(0,n.K2)(re,"readPlainScalar"),(0,n.K2)(ne,"readSingleQuotedScalar"),(0,n.K2)(ie,"readDoubleQuotedScalar"),(0,n.K2)(ae,"readFlowCollection"),(0,n.K2)(oe,"readBlockScalar"),(0,n.K2)(se,"readBlockSequence"),(0,n.K2)(le,"readBlockMapping"),(0,n.K2)(ce,"readTagProperty"),(0,n.K2)(ue,"readAnchorProperty"),(0,n.K2)(he,"readAlias"),(0,n.K2)(de,"composeNode"),(0,n.K2)(pe,"readDocument"),(0,n.K2)(fe,"loadDocuments"),(0,n.K2)(me,"loadAll$1"),(0,n.K2)(ge,"load$1");var ye={loadAll:me,load:ge},ve=Object.prototype.toString,xe=Object.prototype.hasOwnProperty,be=65279,_e={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},we=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ke=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Te(t,e){var r,n,i,a,o,s,l;if(null===e)return{};for(r={},i=0,a=(n=Object.keys(e)).length;i<a;i+=1)o=n[i],s=String(e[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(l=t.compiledTypeMap.fallback[o])&&xe.call(l.styleAliases,s)&&(s=l.styleAliases[s]),r[o]=s;return r}function Se(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else{if(!(t<=4294967295))throw new p("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+u.repeat("0",n-e.length)+e}(0,n.K2)(Te,"compileStyleMap"),(0,n.K2)(Se,"encodeHex");function Ae(t){this.schema=t.schema||Tt,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=u.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Te(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"===typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Me(t,e){for(var r,n=u.repeat(" ",e),i=0,a=-1,o="",s=t.length;i<s;)-1===(a=t.indexOf("\n",i))?(r=t.slice(i),i=s):(r=t.slice(i,a+1),i=a+1),r.length&&"\n"!==r&&(o+=n),o+=r;return o}function Ce(t,e){return"\n"+u.repeat(" ",t.indent*e)}function Ee(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Le(t){return 32===t||9===t}function Pe(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&t!==be||65536<=t&&t<=1114111}function Ie(t){return Pe(t)&&t!==be&&13!==t&&10!==t}function ze(t,e,r){var n=Ie(t),i=n&&!Le(t);return(r?n:n&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!i)||Ie(e)&&!Le(e)&&35===t||58===e&&i}function Oe(t){return Pe(t)&&t!==be&&!Le(t)&&45!==t&&63!==t&&58!==t&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t&&35!==t&&38!==t&&42!==t&&33!==t&&124!==t&&61!==t&&62!==t&&39!==t&&34!==t&&37!==t&&64!==t&&96!==t}function De(t){return!Le(t)&&58!==t}function Re(t,e){var r,n=t.charCodeAt(e);return n>=55296&&n<=56319&&e+1<t.length&&(r=t.charCodeAt(e+1))>=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function Fe(t){return/^\n* /.test(t)}(0,n.K2)(Ae,"State"),(0,n.K2)(Me,"indentString"),(0,n.K2)(Ce,"generateNextLine"),(0,n.K2)(Ee,"testImplicitResolving"),(0,n.K2)(Le,"isWhitespace"),(0,n.K2)(Pe,"isPrintable"),(0,n.K2)(Ie,"isNsCharOrWhitespace"),(0,n.K2)(ze,"isPlainSafe"),(0,n.K2)(Oe,"isPlainSafeFirst"),(0,n.K2)(De,"isPlainSafeLast"),(0,n.K2)(Re,"codePointAt"),(0,n.K2)(Fe,"needIndentIndicator");function Be(t,e,r,n,i,a,o,s){var l,c=0,u=null,h=!1,d=!1,p=-1!==n,f=-1,m=Oe(Re(t,0))&&De(Re(t,t.length-1));if(e||o)for(l=0;l<t.length;c>=65536?l+=2:l++){if(!Pe(c=Re(t,l)))return 5;m=m&&ze(c,u,s),u=c}else{for(l=0;l<t.length;c>=65536?l+=2:l++){if(10===(c=Re(t,l)))h=!0,p&&(d=d||l-f-1>n&&" "!==t[f+1],f=l);else if(!Pe(c))return 5;m=m&&ze(c,u,s),u=c}d=d||p&&l-f-1>n&&" "!==t[f+1]}return h||d?r>9&&Fe(t)?5:o?2===a?5:2:d?4:3:!m||o||i(t)?2===a?5:2:1}function je(t,e,r,i,a){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==we.indexOf(e)||ke.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var o=t.indent*Math.max(1,r),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),l=i||t.flowLevel>-1&&r>=t.flowLevel;function c(e){return Ee(t,e)}switch((0,n.K2)(c,"testAmbiguity"),Be(e,l,t.indent,s,c,t.quotingType,t.forceQuotes&&!i,a)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+Ne(e,t.indent)+Ue(Me(e,o));case 4:return">"+Ne(e,t.indent)+Ue(Me(Ve(e,s),o));case 5:return'"'+$e(e)+'"';default:throw new p("impossible error: invalid scalar style")}}()}function Ne(t,e){var r=Fe(t)?String(e):"",n="\n"===t[t.length-1];return r+(n&&("\n"===t[t.length-2]||"\n"===t)?"+":n?"":"-")+"\n"}function Ue(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Ve(t,e){for(var r,n,i=/(\n+)([^\n]*)/g,a=function(){var r=t.indexOf("\n");return r=-1!==r?r:t.length,i.lastIndex=r,qe(t.slice(0,r),e)}(),o="\n"===t[0]||" "===t[0];n=i.exec(t);){var s=n[1],l=n[2];r=" "===l[0],a+=s+(o||r||""===l?"":"\n")+qe(l,e),o=r}return a}function qe(t,e){if(""===t||" "===t[0])return t;for(var r,n,i=/ [^ ]/g,a=0,o=0,s=0,l="";r=i.exec(t);)(s=r.index)-a>e&&(n=o>a?o:s,l+="\n"+t.slice(a,n),a=n+1),o=s;return l+="\n",t.length-a>e&&o>a?l+=t.slice(a,o)+"\n"+t.slice(o+1):l+=t.slice(a),l.slice(1)}function $e(t){for(var e,r="",n=0,i=0;i<t.length;n>=65536?i+=2:i++)n=Re(t,i),!(e=_e[n])&&Pe(n)?(r+=t[i],n>=65536&&(r+=t[i+1])):r+=e||Se(n);return r}function He(t,e,r){var n,i,a,o="",s=t.tag;for(n=0,i=r.length;n<i;n+=1)a=r[n],t.replacer&&(a=t.replacer.call(r,String(n),a)),(Xe(t,e,a,!1,!1)||"undefined"===typeof a&&Xe(t,e,null,!1,!1))&&(""!==o&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=s,t.dump="["+o+"]"}function We(t,e,r,n){var i,a,o,s="",l=t.tag;for(i=0,a=r.length;i<a;i+=1)o=r[i],t.replacer&&(o=t.replacer.call(r,String(i),o)),(Xe(t,e+1,o,!0,!0,!1,!0)||"undefined"===typeof o&&Xe(t,e+1,null,!0,!0,!1,!0))&&(n&&""===s||(s+=Ce(t,e)),t.dump&&10===t.dump.charCodeAt(0)?s+="-":s+="- ",s+=t.dump);t.tag=l,t.dump=s||"[]"}function Ge(t,e,r){var n,i,a,o,s,l="",c=t.tag,u=Object.keys(r);for(n=0,i=u.length;n<i;n+=1)s="",""!==l&&(s+=", "),t.condenseFlow&&(s+='"'),o=r[a=u[n]],t.replacer&&(o=t.replacer.call(r,a,o)),Xe(t,e,a,!1,!1)&&(t.dump.length>1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Xe(t,e,o,!1,!1)&&(l+=s+=t.dump));t.tag=c,t.dump="{"+l+"}"}function Ye(t,e,r,n){var i,a,o,s,l,c,u="",h=t.tag,d=Object.keys(r);if(!0===t.sortKeys)d.sort();else if("function"===typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new p("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)c="",n&&""===u||(c+=Ce(t,e)),s=r[o=d[i]],t.replacer&&(s=t.replacer.call(r,o,s)),Xe(t,e+1,o,!0,!0,!0)&&((l=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=Ce(t,e)),Xe(t,e+1,s,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=t.dump));t.tag=h,t.dump=u||"{}"}function Ze(t,e,r){var n,i,a,o,s,l;for(a=0,o=(i=r?t.explicitTypes:t.implicitTypes).length;a<o;a+=1)if(((s=i[a]).instanceOf||s.predicate)&&(!s.instanceOf||"object"===typeof e&&e instanceof s.instanceOf)&&(!s.predicate||s.predicate(e))){if(r?s.multi&&s.representName?t.tag=s.representName(e):t.tag=s.tag:t.tag="?",s.represent){if(l=t.styleMap[s.tag]||s.defaultStyle,"[object Function]"===ve.call(s.represent))n=s.represent(e,l);else{if(!xe.call(s.represent,l))throw new p("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');n=s.represent[l](e,l)}t.dump=n}return!0}return!1}function Xe(t,e,r,n,i,a,o){t.tag=null,t.dump=r,Ze(t,r,!1)||Ze(t,r,!0);var s,l=ve.call(t.dump),c=n;n&&(n=t.flowLevel<0||t.flowLevel>e);var u,h,d="[object Object]"===l||"[object Array]"===l;if(d&&(h=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||h||2!==t.indent&&e>0)&&(i=!1),h&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(d&&h&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===l)n&&0!==Object.keys(t.dump).length?(Ye(t,e,t.dump,i),h&&(t.dump="&ref_"+u+t.dump)):(Ge(t,e,t.dump),h&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===l)n&&0!==t.dump.length?(t.noArrayIndent&&!o&&e>0?We(t,e-1,t.dump,i):We(t,e,t.dump,i),h&&(t.dump="&ref_"+u+t.dump)):(He(t,e,t.dump),h&&(t.dump="&ref_"+u+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new p("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&je(t,t.dump,e,a,c)}null!==t.tag&&"?"!==t.tag&&(s=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),s="!"===t.tag[0]?"!"+s:"tag:yaml.org,2002:"===s.slice(0,18)?"!!"+s.slice(18):"!<"+s+">",t.dump=s+" "+t.dump)}return!0}function Ke(t,e){var r,n,i=[],a=[];for(Je(t,i,a),r=0,n=a.length;r<n;r+=1)e.duplicates.push(i[a[r]]);e.usedDuplicates=new Array(n)}function Je(t,e,r){var n,i,a;if(null!==t&&"object"===typeof t)if(-1!==(i=e.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)Je(t[i],e,r);else for(i=0,a=(n=Object.keys(t)).length;i<a;i+=1)Je(t[n[i]],e,r)}function Qe(t,e){var r=new Ae(e=e||{});r.noRefs||Ke(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Xe(r,0,n,!0,!0)?r.dump+"\n":""}(0,n.K2)(Be,"chooseScalarStyle"),(0,n.K2)(je,"writeScalar"),(0,n.K2)(Ne,"blockHeader"),(0,n.K2)(Ue,"dropEndingNewline"),(0,n.K2)(Ve,"foldString"),(0,n.K2)(qe,"foldLine"),(0,n.K2)($e,"escapeString"),(0,n.K2)(He,"writeFlowSequence"),(0,n.K2)(We,"writeBlockSequence"),(0,n.K2)(Ge,"writeFlowMapping"),(0,n.K2)(Ye,"writeBlockMapping"),(0,n.K2)(Ze,"detectType"),(0,n.K2)(Xe,"writeNode"),(0,n.K2)(Ke,"getDuplicateReferences"),(0,n.K2)(Je,"inspectNode"),(0,n.K2)(Qe,"dump$1");function tr(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}(0,n.K2)(tr,"renamed");var er=Z,rr=ye.load;tr("safeLoad","load"),tr("safeLoadAll","loadAll"),tr("safeDump","dump")},537:(t,e,r)=>{"use strict";e.A=void 0;var n=a(r(2805)),i=a(r(8096));function a(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)(i.default);e.A=o},579:(t,e,r)=>{"use strict";t.exports=r(2799)},634:(t,e,r)=>{"use strict";r.d(e,{$C:()=>M,$t:()=>q,C4:()=>H,I5:()=>V,Ib:()=>m,KL:()=>Y,Sm:()=>W,Un:()=>D,_K:()=>$,bH:()=>I,dq:()=>N,pe:()=>l,rY:()=>G,ru:()=>O,sM:()=>S,vU:()=>p,yT:()=>E});var n=r(3759),i=r(3755),a=r(700),o=r(2863),s=r(7697),l="\u200b",c={curveBasis:a.qrM,curveBasisClosed:a.Yu4,curveBasisOpen:a.IA3,curveBumpX:a.Wi0,curveBumpY:a.PGM,curveBundle:a.OEq,curveCardinalClosed:a.olC,curveCardinalOpen:a.IrU,curveCardinal:a.y8u,curveCatmullRomClosed:a.Q7f,curveCatmullRomOpen:a.cVp,curveCatmullRom:a.oDi,curveLinear:a.lUB,curveLinearClosed:a.Lx9,curveMonotoneX:a.nVG,curveMonotoneY:a.uxU,curveNatural:a.Xf2,curveStep:a.GZz,curveStepAfter:a.UPb,curveStepBefore:a.dyv},u=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,h=(0,n.K2)((function(t,e){const r=d(t,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const t=r.map((t=>t.args));(0,n.$i)(t),i=(0,n.hH)(i,[...t])}else i=r.args;if(!i)return;let a=(0,n.Ch)(t,e);const o="config";return void 0!==i[o]&&("flowchart-v2"===a&&(a="flowchart"),i[a]=i[o],delete i[o]),i}),"detectInit"),d=(0,n.K2)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{const r=new RegExp(`[%]{2}(?![{]${u.source})(?=[}][%]{2}).*\n`,"ig");let i;t=t.trim().replace(r,"").replace(/'/gm,'"'),n.Rm.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const a=[];for(;null!==(i=n.DB.exec(t));)if(i.index===n.DB.lastIndex&&n.DB.lastIndex++,i&&!e||e&&i[1]?.match(e)||e&&i[2]?.match(e)){const t=i[1]?i[1]:i[2],e=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;a.push({type:t,args:e})}return 0===a.length?{type:t,args:null}:1===a.length?a[0]:a}catch(r){return n.Rm.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),p=(0,n.K2)((function(t){return t.replace(n.DB,"")}),"removeDirectives"),f=(0,n.K2)((function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1}),"isSubstringInArray");function m(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return c[r]??e}function g(t,e){const r=t.trim();if(r)return"loose"!==e.securityLevel?(0,i.J)(r):r}(0,n.K2)(m,"interpolateToCurve"),(0,n.K2)(g,"formatUrl");var y=(0,n.K2)((function(t){const e=t.split("."),r=e.length-1,i=e[r];let a=window;for(let c=0;c<r;c++)if(a=a[e[c]],!a)return void n.Rm.error(`Function name: ${t} not found in window`);for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];a[i](...s)}),"runFunc");function v(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function x(t){let e,r=0;t.forEach((t=>{r+=v(t,e),e=t}));return w(t,r/2)}function b(t){return 1===t.length?t[0]:x(t)}(0,n.K2)(v,"distance"),(0,n.K2)(x,"traverseEdge"),(0,n.K2)(b,"calcLabelPosition");var _=(0,n.K2)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const r=Math.pow(10,e);return Math.round(t*r)/r}),"roundNumber"),w=(0,n.K2)(((t,e)=>{let r,n=e;for(const i of t){if(r){const t=v(i,r);if(0===t)return r;if(t<n)n-=t;else{const e=n/t;if(e<=0)return r;if(e>=1)return{x:i.x,y:i.y};if(e>0&&e<1)return{x:_((1-e)*r.x+e*i.x,5),y:_((1-e)*r.y+e*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),k=(0,n.K2)(((t,e,r)=>{n.Rm.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=w(e,25),a=t?10:5,o=Math.atan2(e[0].y-i.y,e[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(e[0].x+i.x)/2,s.y=-Math.cos(o)*a+(e[0].y+i.y)/2,s}),"calcCardinalityPosition");function T(t,e,r){const i=structuredClone(r);n.Rm.info("our points",i),"start_left"!==e&&"start_right"!==e&&i.reverse();const a=w(i,25+t),o=10+.5*t,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return"start_left"===e?(l.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,l.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):"end_right"===e?(l.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2-5,l.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2-5):"end_left"===e?(l.x=Math.sin(s)*o+(i[0].x+a.x)/2-5,l.y=-Math.cos(s)*o+(i[0].y+a.y)/2-5):(l.x=Math.sin(s)*o+(i[0].x+a.x)/2,l.y=-Math.cos(s)*o+(i[0].y+a.y)/2),l}function S(t){let e="",r="";for(const n of t)void 0!==n&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}(0,n.K2)(T,"calcTerminalLabelPosition"),(0,n.K2)(S,"getStylesFromArray");var A=0,M=(0,n.K2)((()=>(A++,"id-"+Math.random().toString(36).substr(2,12)+"-"+A)),"generateId");function C(t){let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(16*Math.random()));return e}(0,n.K2)(C,"makeRandomHex");var E=(0,n.K2)((t=>C(t.length)),"random"),L=(0,n.K2)((function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}}),"getTextObj"),P=(0,n.K2)((function(t,e){const r=e.text.replace(n.Y2.lineBreakRegex," "),[,i]=V(e.fontSize),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.style("font-family",e.fontFamily),a.style("font-size",i),a.style("font-weight",e.fontWeight),a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class);const o=a.append("tspan");return o.attr("x",e.x+2*e.textMargin),o.attr("fill",e.fill),o.text(r),a}),"drawSimpleText"),I=(0,o.A)(((t,e,r)=>{if(!t)return t;if(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),n.Y2.lineBreakRegex.test(t))return t;const i=t.split(" ").filter(Boolean),a=[];let o="";return i.forEach(((t,n)=>{const s=D(`${t} `,r),l=D(o,r);if(s>e){const{hyphenatedStrings:n,remainingWord:i}=z(t,e,"-",r);a.push(o,...n),o=i}else l+s>=e?(a.push(o),o=t):o=[o,t].filter(Boolean).join(" ");n+1===i.length&&a.push(o)})),a.filter((t=>""!==t)).join(r.joinWith)}),((t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`)),z=(0,o.A)((function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"-",n=arguments.length>3?arguments[3]:void 0;n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let o="";return i.forEach(((t,s)=>{const l=`${o}${t}`;if(D(l,n)>=e){const t=s+1,e=i.length===t,n=`${l}${r}`;a.push(e?l:n),o=""}else o=l})),{hyphenatedStrings:a,remainingWord:o}}),(function(t,e){let r=arguments.length>3?arguments[3]:void 0;return`${t}${e}${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"-"}${r.fontSize}${r.fontWeight}${r.fontFamily}`}));function O(t,e){return F(t,e).height}function D(t,e){return F(t,e).width}(0,n.K2)(O,"calculateTextHeight"),(0,n.K2)(D,"calculateTextWidth");var R,F=(0,o.A)(((t,e)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=e;if(!t)return{width:0,height:0};const[,s]=V(r),c=["sans-serif",i],u=t.split(n.Y2.lineBreakRegex),h=[],d=(0,a.Ltv)("body");if(!d.remove)return{width:0,height:0,lineHeight:0};const p=d.append("svg");for(const n of c){let t=0;const e={width:0,height:0,lineHeight:0};for(const r of u){const i=L();i.text=r||l;const a=P(p,i).style("font-size",s).style("font-weight",o).style("font-family",n),c=(a._groups||a)[0][0].getBBox();if(0===c.width&&0===c.height)throw new Error("svg element not in render tree");e.width=Math.round(Math.max(e.width,c.width)),t=Math.round(c.height),e.height+=t,e.lineHeight=Math.round(Math.max(e.lineHeight,t))}h.push(e)}p.remove();return h[isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`)),B=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0;this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static#t=(()=>(0,n.K2)(this,"InitIDGenerator"))()},j=(0,n.K2)((function(t){return R=R||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),R.innerHTML=t,unescape(R.textContent)}),"entityDecode");function N(t){return"str"in t}(0,n.K2)(N,"isDetailedError");var U=(0,n.K2)(((t,e,r,n)=>{if(!n)return;const i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)}),"insertTitle"),V=(0,n.K2)((t=>{if("number"===typeof t)return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]}),"parseFontSize");function q(t,e){return(0,s.A)({},t,e)}(0,n.K2)(q,"cleanAndMerge");var $={assignWithDepth:n.hH,wrapLabel:I,calculateTextHeight:O,calculateTextWidth:D,calculateTextDimensions:F,cleanAndMerge:q,detectInit:h,detectDirective:d,isSubstringInArray:f,interpolateToCurve:m,calcLabelPosition:b,calcCardinalityPosition:k,calcTerminalLabelPosition:T,formatUrl:g,getStylesFromArray:S,generateId:M,random:E,runFunc:y,entityDecode:j,insertTitle:U,parseFontSize:V,InitIDGenerator:B},H=(0,n.K2)((function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"\ufb02\xb0\xb0"+e+"\xb6\xdf":"\ufb02\xb0"+e+"\xb6\xdf"})),e}),"encodeEntities"),W=(0,n.K2)((function(t){return t.replace(/\ufb02\xb0\xb0/g,"&#").replace(/\ufb02\xb0/g,"&").replace(/\xb6\xdf/g,";")}),"decodeEntities"),G=(0,n.K2)(((t,e,r,n)=>{let{counter:i=0,prefix:a,suffix:o}=r;return n||`${a?`${a}_`:""}${t}_${e}_${i}${o?`_${o}`:""}`}),"getEdgeId");function Y(t){return t??null}(0,n.K2)(Y,"handleUndefinedAttr")},700:(t,e,r)=>{"use strict";function n(t,e){let r;if(void 0===e)for(const n of t)null!=n&&(r<n||void 0===r&&n>=n)&&(r=n);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function i(t,e){let r;if(void 0===e)for(const n of t)null!=n&&(r>n||void 0===r&&n>=n)&&(r=n);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function a(t){return t}r.d(e,{JLW:()=>Ss,l78:()=>v,tlR:()=>y,qrM:()=>Bs,Yu4:()=>Ns,IA3:()=>Vs,Wi0:()=>$s,PGM:()=>Hs,OEq:()=>Gs,y8u:()=>Xs,olC:()=>Js,IrU:()=>tl,oDi:()=>nl,Q7f:()=>al,cVp:()=>sl,lUB:()=>Cs,Lx9:()=>cl,nVG:()=>yl,uxU:()=>vl,Xf2:()=>_l,GZz:()=>kl,UPb:()=>Sl,dyv:()=>Tl,bEH:()=>rn,n8j:()=>Ps,T9B:()=>n,jkA:()=>i,rLf:()=>Os,WH:()=>dn,m4Y:()=>ii,UMr:()=>hn,w7C:()=>Xo,zt:()=>Ko,Ltv:()=>Jo,UAC:()=>Nl,DCK:()=>pc,TUC:()=>Zl,Agd:()=>Bl,t6C:()=>El,wXd:()=>Rl,ABi:()=>Hl,Ui6:()=>ac,rGn:()=>Xl,ucG:()=>Dl,YPH:()=>$l,Mol:()=>Yl,PGu:()=>Wl,GuW:()=>Gl});var o=1,s=2,l=3,c=4,u=1e-6;function h(t){return"translate("+t+",0)"}function d(t){return"translate(0,"+t+")"}function p(t){return e=>+t(e)}function f(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function m(){return!this.__axis}function g(t,e){var r=[],n=null,i=null,g=6,y=6,v=3,x="undefined"!==typeof window&&window.devicePixelRatio>1?0:.5,b=t===o||t===c?-1:1,_=t===c||t===s?"x":"y",w=t===o||t===l?h:d;function k(h){var d=null==n?e.ticks?e.ticks.apply(e,r):e.domain():n,k=null==i?e.tickFormat?e.tickFormat.apply(e,r):a:i,T=Math.max(g,0)+v,S=e.range(),A=+S[0]+x,M=+S[S.length-1]+x,C=(e.bandwidth?f:p)(e.copy(),x),E=h.selection?h.selection():h,L=E.selectAll(".domain").data([null]),P=E.selectAll(".tick").data(d,e).order(),I=P.exit(),z=P.enter().append("g").attr("class","tick"),O=P.select("line"),D=P.select("text");L=L.merge(L.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),P=P.merge(z),O=O.merge(z.append("line").attr("stroke","currentColor").attr(_+"2",b*g)),D=D.merge(z.append("text").attr("fill","currentColor").attr(_,b*T).attr("dy",t===o?"0em":t===l?"0.71em":"0.32em")),h!==E&&(L=L.transition(h),P=P.transition(h),O=O.transition(h),D=D.transition(h),I=I.transition(h).attr("opacity",u).attr("transform",(function(t){return isFinite(t=C(t))?w(t+x):this.getAttribute("transform")})),z.attr("opacity",u).attr("transform",(function(t){var e=this.parentNode.__axis;return w((e&&isFinite(e=e(t))?e:C(t))+x)}))),I.remove(),L.attr("d",t===c||t===s?y?"M"+b*y+","+A+"H"+x+"V"+M+"H"+b*y:"M"+x+","+A+"V"+M:y?"M"+A+","+b*y+"V"+x+"H"+M+"V"+b*y:"M"+A+","+x+"H"+M),P.attr("opacity",1).attr("transform",(function(t){return w(C(t)+x)})),O.attr(_+"2",b*g),D.attr(_,b*T).text(k),E.filter(m).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===s?"start":t===c?"end":"middle"),E.each((function(){this.__axis=C}))}return k.scale=function(t){return arguments.length?(e=t,k):e},k.ticks=function(){return r=Array.from(arguments),k},k.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.from(t),k):r.slice()},k.tickValues=function(t){return arguments.length?(n=null==t?null:Array.from(t),k):n&&n.slice()},k.tickFormat=function(t){return arguments.length?(i=t,k):i},k.tickSize=function(t){return arguments.length?(g=y=+t,k):g},k.tickSizeInner=function(t){return arguments.length?(g=+t,k):g},k.tickSizeOuter=function(t){return arguments.length?(y=+t,k):y},k.tickPadding=function(t){return arguments.length?(v=+t,k):v},k.offset=function(t){return arguments.length?(x=+t,k):x},k}function y(t){return g(o,t)}function v(t){return g(l,t)}function x(){}function b(t){return null==t?x:function(){return this.querySelector(t)}}function _(){return[]}function w(t){return null==t?_:function(){return this.querySelectorAll(t)}}function k(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function T(t){return function(){return this.matches(t)}}function S(t){return function(e){return e.matches(t)}}var A=Array.prototype.find;function M(){return this.firstElementChild}var C=Array.prototype.filter;function E(){return Array.from(this.children)}function L(t){return new Array(t.length)}function P(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function I(t,e,r,n,i,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],n[s]=o):r[s]=new P(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function z(t,e,r,n,i,a,o){var s,l,c,u=new Map,h=e.length,d=a.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=c=o.call(l,l.__data__,s,e)+"",u.has(c)?i[s]=l:u.set(c,l));for(s=0;s<d;++s)c=o.call(t,a[s],s,a)+"",(l=u.get(c))?(n[s]=l,l.__data__=a[s],u.delete(c)):r[s]=new P(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u.get(p[s])===l&&(i[s]=l)}function O(t){return t.__data__}function D(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function R(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}P.prototype={constructor:P,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var F="http://www.w3.org/1999/xhtml";const B={svg:"http://www.w3.org/2000/svg",xhtml:F,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function j(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),B.hasOwnProperty(e)?{space:B[e],local:t}:t}function N(t){return function(){this.removeAttribute(t)}}function U(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V(t,e){return function(){this.setAttribute(t,e)}}function q(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function $(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function H(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function W(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function G(t){return function(){this.style.removeProperty(t)}}function Y(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Z(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function X(t,e){return t.style.getPropertyValue(e)||W(t).getComputedStyle(t,null).getPropertyValue(e)}function K(t){return function(){delete this[t]}}function J(t,e){return function(){this[t]=e}}function Q(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function tt(t){return t.trim().split(/^|\s+/)}function et(t){return t.classList||new rt(t)}function rt(t){this._node=t,this._names=tt(t.getAttribute("class")||"")}function nt(t,e){for(var r=et(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function it(t,e){for(var r=et(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function at(t){return function(){nt(this,t)}}function ot(t){return function(){it(this,t)}}function st(t,e){return function(){(e.apply(this,arguments)?nt:it)(this,t)}}function lt(){this.textContent=""}function ct(t){return function(){this.textContent=t}}function ut(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ht(){this.innerHTML=""}function dt(t){return function(){this.innerHTML=t}}function pt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ft(){this.nextSibling&&this.parentNode.appendChild(this)}function mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gt(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===F&&e.documentElement.namespaceURI===F?e.createElement(t):e.createElementNS(r,t)}}function yt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vt(t){var e=j(t);return(e.local?yt:gt)(e)}function xt(){return null}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function _t(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function kt(t){return function(){var e=this.__on;if(e){for(var r,n=0,i=-1,a=e.length;n<a;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++i]=r:this.removeEventListener(r.type,r.listener,r.options);++i?e.length=i:delete this.__on}}}function Tt(t,e,r){return function(){var n,i=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var o=0,s=i.length;o<s;++o)if((n=i[o]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),void(n.value=e);this.addEventListener(t.type,a,r),n={type:t.type,name:t.name,value:e,listener:a,options:r},i?i.push(n):this.__on=[n]}}function St(t,e,r){var n=W(t),i=n.CustomEvent;"function"===typeof i?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function At(t,e){return function(){return St(this,t,e)}}function Mt(t,e){return function(){return St(this,t,e.apply(this,arguments))}}rt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Ct=[null];function Et(t,e){this._groups=t,this._parents=e}function Lt(){return new Et([[document.documentElement]],Ct)}Et.prototype=Lt.prototype={constructor:Et,select:function(t){"function"!==typeof t&&(t=b(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,o,s=e[i],l=s.length,c=n[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new Et(n,this._parents)},selectAll:function(t){t="function"===typeof t?k(t):w(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a<r;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(n.push(t.call(o,o.__data__,c,s)),i.push(o));return new Et(n,i)},selectChild:function(t){return this.select(null==t?M:function(t){return function(){return A.call(this.children,t)}}("function"===typeof t?t:S(t)))},selectChildren:function(t){return this.selectAll(null==t?E:function(t){return function(){return C.call(this.children,t)}}("function"===typeof t?t:S(t)))},filter:function(t){"function"!==typeof t&&(t=T(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,o=e[i],s=o.length,l=n[i]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Et(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,O);var r,n=e?z:I,i=this._parents,a=this._groups;"function"!==typeof t&&(r=t,t=function(){return r});for(var o=a.length,s=new Array(o),l=new Array(o),c=new Array(o),u=0;u<o;++u){var h=i[u],d=a[u],p=d.length,f=D(t.call(h,h&&h.__data__,u,i)),m=f.length,g=l[u]=new Array(m),y=s[u]=new Array(m);n(h,d,g,y,c[u]=new Array(p),f,e);for(var v,x,b=0,_=0;b<m;++b)if(v=g[b]){for(b>=_&&(_=b+1);!(x=y[_])&&++_<m;);v._next=x||null}}return(s=new Et(s,i))._enter=l,s._exit=c,s},enter:function(){return new Et(this._enter||this._groups.map(L),this._parents)},exit:function(){return new Et(this._exit||this._groups.map(L),this._parents)},join:function(t,e,r){var n=this.enter(),i=this,a=this.exit();return"function"===typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==r?a.remove():r(a),n&&i?n.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var c,u=r[l],h=n[l],d=u.length,p=s[l]=new Array(d),f=0;f<d;++f)(c=u[f]||h[f])&&(p[f]=c);for(;l<i;++l)s[l]=r[l];return new Et(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,i=t[e],a=i.length-1,o=i[a];--a>=0;)(n=i[a])&&(o&&4^n.compareDocumentPosition(o)&&o.parentNode.insertBefore(n,o),o=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=R);for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var o,s=r[a],l=s.length,c=i[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new Et(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i,a=e[r],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var r=j(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?U:N:"function"===typeof e?r.local?H:$:r.local?q:V)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?G:"function"===typeof e?Z:Y)(t,e,null==r?"":r)):X(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?K:"function"===typeof e?Q:J)(t,e)):this.node()[t]},classed:function(t,e){var r=tt(t+"");if(arguments.length<2){for(var n=et(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each(("function"===typeof e?st:e?at:ot)(r,e))},text:function(t){return arguments.length?this.each(null==t?lt:("function"===typeof t?ut:ct)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ht:("function"===typeof t?pt:dt)(t)):this.node().innerHTML},raise:function(){return this.each(ft)},lower:function(){return this.each(mt)},append:function(t){var e="function"===typeof t?t:vt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var r="function"===typeof t?t:vt(t),n=null==e?xt:"function"===typeof e?e:b(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)}))},remove:function(){return this.each(bt)},clone:function(t){return this.select(t?wt:_t)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var n,i,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?Tt:kt,n=0;n<o;++n)this.each(s(a[n],e,r));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(n=0,l=s[c];n<o;++n)if((i=a[n]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"===typeof e?Mt:At)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n,i=t[e],a=0,o=i.length;a<o;++a)(n=i[a])&&(yield n)}};const Pt=Lt;var It={value:function(){}};function zt(){for(var t,e=0,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new Ot(n)}function Ot(t){this._=t}function Dt(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function Rt(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=It,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}Ot.prototype=zt.prototype={constructor:Ot,on:function(t,e){var r,n,i=this._,a=(n=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(r=(t=a[o]).type)i[r]=Rt(i[r],t.name,e);else if(null==e)for(r in i)i[r]=Rt(i[r],t.name,null);return this}for(;++o<s;)if((r=(t=a[o]).type)&&(r=Dt(i[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new Ot(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}};const Ft=zt;var Bt,jt,Nt=0,Ut=0,Vt=0,qt=0,$t=0,Ht=0,Wt="object"===typeof performance&&performance.now?performance:Date,Gt="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Yt(){return $t||(Gt(Zt),$t=Wt.now()+Ht)}function Zt(){$t=0}function Xt(){this._call=this._time=this._next=null}function Kt(t,e,r){var n=new Xt;return n.restart(t,e,r),n}function Jt(){$t=(qt=Wt.now())+Ht,Nt=Ut=0;try{!function(){Yt(),++Nt;for(var t,e=Bt;e;)(t=$t-e._time)>=0&&e._call.call(null,t),e=e._next;--Nt}()}finally{Nt=0,function(){var t,e,r=Bt,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Bt=e);jt=t,te(n)}(),$t=0}}function Qt(){var t=Wt.now(),e=t-qt;e>1e3&&(Ht-=e,qt=t)}function te(t){Nt||(Ut&&(Ut=clearTimeout(Ut)),t-$t>24?(t<1/0&&(Ut=setTimeout(Jt,t-Wt.now()-Ht)),Vt&&(Vt=clearInterval(Vt))):(Vt||(qt=Wt.now(),Vt=setInterval(Qt,1e3)),Nt=1,Gt(Jt)))}function ee(t,e,r){var n=new Xt;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n}Xt.prototype=Kt.prototype={constructor:Xt,restart:function(t,e,r){if("function"!==typeof t)throw new TypeError("callback is not a function");r=(null==r?Yt():+r)+(null==e?0:+e),this._next||jt===this||(jt?jt._next=this:Bt=this,jt=this),this._call=t,this._time=r,te()},stop:function(){this._call&&(this._call=null,this._time=1/0,te())}};var re=Ft("start","end","cancel","interrupt"),ne=[];function ie(t,e,r,n,i,a){var o=t.__transition;if(o){if(r in o)return}else t.__transition={};!function(t,e,r){var n,i=t.__transition;function a(t){r.state=1,r.timer.restart(o,r.delay,r.time),r.delay<=t&&o(t-r.delay)}function o(a){var c,u,h,d;if(1!==r.state)return l();for(c in i)if((d=i[c]).name===r.name){if(3===d.state)return ee(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[c]):+c<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[c])}if(ee((function(){3===r.state&&(r.state=4,r.timer.restart(s,r.delay,r.time),s(a))})),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,n=new Array(h=r.tween.length),c=0,u=-1;c<h;++c)(d=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(n[++u]=d);n.length=u+1}}function s(e){for(var i=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(l),r.state=5,1),a=-1,o=n.length;++a<o;)n[a].call(t,i);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){for(var n in r.state=6,r.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=r,r.timer=Kt(a,0,r.time)}(t,r,{name:e,index:n,group:i,on:re,tween:ne,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ae(t,e){var r=se(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function oe(t,e){var r=se(t,e);if(r.state>3)throw new Error("too late; already running");return r}function se(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function le(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var ce,ue=180/Math.PI,he={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function de(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*ue,skewX:Math.atan(l)*ue,scaleX:o,scaleY:s}}function pe(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:le(t,i)},{i:l-2,x:le(n,a)})}else(i||a)&&o.push("translate("+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:le(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:le(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:le(t,r)},{i:s-2,x:le(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var fe=pe((function(t){const e=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?he:de(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),me=pe((function(t){return null==t?he:(ce||(ce=document.createElementNS("http://www.w3.org/2000/svg","g")),ce.setAttribute("transform",t),(t=ce.transform.baseVal.consolidate())?de((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):he)}),", ",")",")");function ge(t,e){var r,n;return function(){var i=oe(this,t),a=i.tween;if(a!==r)for(var o=0,s=(n=r=a).length;o<s;++o)if(n[o].name===e){(n=n.slice()).splice(o,1);break}i.tween=n}}function ye(t,e,r){var n,i;if("function"!==typeof r)throw new Error;return function(){var a=oe(this,t),o=a.tween;if(o!==n){i=(n=o).slice();for(var s={name:e,value:r},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=s;break}l===c&&i.push(s)}a.tween=i}}function ve(t,e,r){var n=t._id;return t.each((function(){var t=oe(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return se(t,n).value[e]}}function xe(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function be(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function _e(){}var we=.7,ke=1/we,Te="\\s*([+-]?\\d+)\\s*",Se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Me=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`),Ee=new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),Le=new RegExp(`^rgba\\(${Te},${Te},${Te},${Se}\\)$`),Pe=new RegExp(`^rgba\\(${Ae},${Ae},${Ae},${Se}\\)$`),Ie=new RegExp(`^hsl\\(${Se},${Ae},${Ae}\\)$`),ze=new RegExp(`^hsla\\(${Se},${Ae},${Ae},${Se}\\)$`),Oe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function De(){return this.rgb().formatHex()}function Re(){return this.rgb().formatRgb()}function Fe(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Me.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Be(e):3===r?new Ve(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?je(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?je(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ce.exec(t))?new Ve(e[1],e[2],e[3],1):(e=Ee.exec(t))?new Ve(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Le.exec(t))?je(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?je(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ie.exec(t))?Ye(e[1],e[2]/100,e[3]/100,1):(e=ze.exec(t))?Ye(e[1],e[2]/100,e[3]/100,e[4]):Oe.hasOwnProperty(t)?Be(Oe[t]):"transparent"===t?new Ve(NaN,NaN,NaN,0):null}function Be(t){return new Ve(t>>16&255,t>>8&255,255&t,1)}function je(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ve(t,e,r,n)}function Ne(t){return t instanceof _e||(t=Fe(t)),t?new Ve((t=t.rgb()).r,t.g,t.b,t.opacity):new Ve}function Ue(t,e,r,n){return 1===arguments.length?Ne(t):new Ve(t,e,r,null==n?1:n)}function Ve(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function qe(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function $e(){const t=He(this.opacity);return`${1===t?"rgb(":"rgba("}${We(this.r)}, ${We(this.g)}, ${We(this.b)}${1===t?")":`, ${t})`}`}function He(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function We(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=We(t))<16?"0":"")+t.toString(16)}function Ye(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Xe(t,e,r,n)}function Ze(t){if(t instanceof Xe)return new Xe(t.h,t.s,t.l,t.opacity);if(t instanceof _e||(t=Fe(t)),!t)return new Xe;if(t instanceof Xe)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r<n):r===a?(n-e)/s+2:(e-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Xe(o,s,l,t.opacity)}function Xe(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ke(t){return(t=(t||0)%360)<0?t+360:t}function Je(t){return Math.max(0,Math.min(1,t||0))}function Qe(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function tr(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}xe(_e,Fe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:De,formatHex:De,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ze(this).formatHsl()},formatRgb:Re,toString:Re}),xe(Ve,Ue,be(_e,{brighter(t){return t=null==t?ke:Math.pow(ke,t),new Ve(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?we:Math.pow(we,t),new Ve(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ve(We(this.r),We(this.g),We(this.b),He(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qe,formatHex:qe,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$e,toString:$e})),xe(Xe,(function(t,e,r,n){return 1===arguments.length?Ze(t):new Xe(t,e,r,null==n?1:n)}),be(_e,{brighter(t){return t=null==t?ke:Math.pow(ke,t),new Xe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?we:Math.pow(we,t),new Xe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Ve(Qe(t>=240?t-240:t+120,i,n),Qe(t,i,n),Qe(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Xe(Ke(this.h),Je(this.s),Je(this.l),He(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=He(this.opacity);return`${1===t?"hsl(":"hsla("}${Ke(this.h)}, ${100*Je(this.s)}%, ${100*Je(this.l)}%${1===t?")":`, ${t})`}`}}));const er=t=>()=>t;function rr(t,e){return function(r){return t+r*e}}function nr(t){return 1===(t=+t)?ir:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):er(isNaN(e)?r:e)}}function ir(t,e){var r=e-t;return r?rr(t,r):er(isNaN(t)?e:t)}const ar=function t(e){var r=nr(e);function n(t,e){var n=r((t=Ue(t)).r,(e=Ue(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=ir(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return n.gamma=t,n}(1);function or(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=Ue(e[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=t(a),o=t(o),s=t(s),n.opacity=1,function(t){return n.r=a(t),n.g=o(t),n.b=s(t),n+""}}}or((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n<e-1?t[n+2]:2*a-i;return tr((r-n/e)*e,o,i,a,s)}})),or((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],o=t[(n+1)%e],s=t[(n+2)%e];return tr((r-n/e)*e,i,a,o,s)}}));var sr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lr=new RegExp(sr.source,"g");function cr(t,e){var r,n,i,a=sr.lastIndex=lr.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=sr.exec(t))&&(n=lr.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:le(r,n)})),a=lr.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}function ur(t,e){var r;return("number"===typeof e?le:e instanceof Fe?ar:(r=Fe(e))?(e=r,ar):cr)(t,e)}function hr(t){return function(){this.removeAttribute(t)}}function dr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pr(t,e,r){var n,i,a=r+"";return function(){var o=this.getAttribute(t);return o===a?null:o===n?i:i=e(n=o,r)}}function fr(t,e,r){var n,i,a=r+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===n?i:i=e(n=o,r)}}function mr(t,e,r){var n,i,a;return function(){var o,s,l=r(this);if(null!=l)return(o=this.getAttribute(t))===(s=l+"")?null:o===n&&s===i?a:(i=s,a=e(n=o,l));this.removeAttribute(t)}}function gr(t,e,r){var n,i,a;return function(){var o,s,l=r(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:o===n&&s===i?a:(i=s,a=e(n=o,l));this.removeAttributeNS(t.space,t.local)}}function yr(t,e){var r,n;function i(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,i)),r}return i._value=e,i}function vr(t,e){var r,n;function i(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,i)),r}return i._value=e,i}function xr(t,e){return function(){ae(this,t).delay=+e.apply(this,arguments)}}function br(t,e){return e=+e,function(){ae(this,t).delay=e}}function _r(t,e){return function(){oe(this,t).duration=+e.apply(this,arguments)}}function wr(t,e){return e=+e,function(){oe(this,t).duration=e}}var kr=Pt.prototype.constructor;function Tr(t){return function(){this.style.removeProperty(t)}}var Sr=0;function Ar(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Mr(){return++Sr}var Cr=Pt.prototype;Ar.prototype=function(t){return Pt().transition(t)}.prototype={constructor:Ar,select:function(t){var e=this._name,r=this._id;"function"!==typeof t&&(t=b(t));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s,l,c=n[o],u=c.length,h=a[o]=new Array(u),d=0;d<u;++d)(s=c[d])&&(l=t.call(s,s.__data__,d,c))&&("__data__"in s&&(l.__data__=s.__data__),h[d]=l,ie(h[d],e,r,d,h,se(s,r)));return new Ar(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!==typeof t&&(t=w(t));for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var l,c=n[s],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var d,p=t.call(l,l.__data__,h,c),f=se(l,r),m=0,g=p.length;m<g;++m)(d=p[m])&&ie(d,e,r,m,p,f);a.push(p),o.push(l)}return new Ar(a,o,e,r)},selectChild:Cr.selectChild,selectChildren:Cr.selectChildren,filter:function(t){"function"!==typeof t&&(t=T(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,o=e[i],s=o.length,l=n[i]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Ar(n,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s<a;++s)for(var l,c=e[s],u=r[s],h=c.length,d=o[s]=new Array(h),p=0;p<h;++p)(l=c[p]||u[p])&&(d[p]=l);for(;s<n;++s)o[s]=e[s];return new Ar(o,this._parents,this._name,this._id)},selection:function(){return new kr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=Mr(),n=this._groups,i=n.length,a=0;a<i;++a)for(var o,s=n[a],l=s.length,c=0;c<l;++c)if(o=s[c]){var u=se(o,e);ie(o,t,r,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ar(n,this._parents,t,r)},call:Cr.call,nodes:Cr.nodes,node:Cr.node,size:Cr.size,empty:Cr.empty,each:Cr.each,on:function(t,e){var r=this._id;return arguments.length<2?se(this.node(),r).on.on(t):this.each(function(t,e,r){var n,i,a=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ae:oe;return function(){var o=a(this,t),s=o.on;s!==n&&(i=(n=s).copy()).on(e,r),o.on=i}}(r,t,e))},attr:function(t,e){var r=j(t),n="transform"===r?me:ur;return this.attrTween(t,"function"===typeof e?(r.local?gr:mr)(r,n,ve(this,"attr."+t,e)):null==e?(r.local?dr:hr)(r):(r.local?fr:pr)(r,n,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!==typeof e)throw new Error;var n=j(t);return this.tween(r,(n.local?yr:vr)(n,e))},style:function(t,e,r){var n="transform"===(t+="")?fe:ur;return null==e?this.styleTween(t,function(t,e){var r,n,i;return function(){var a=X(this,t),o=(this.style.removeProperty(t),X(this,t));return a===o?null:a===r&&o===n?i:i=e(r=a,n=o)}}(t,n)).on("end.style."+t,Tr(t)):"function"===typeof e?this.styleTween(t,function(t,e,r){var n,i,a;return function(){var o=X(this,t),s=r(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=X(this,t)),o===l?null:o===n&&l===i?a:(i=l,a=e(n=o,s))}}(t,n,ve(this,"style."+t,e))).each(function(t,e){var r,n,i,a,o="style."+e,s="end."+o;return function(){var l=oe(this,t),c=l.on,u=null==l.value[o]?a||(a=Tr(e)):void 0;c===r&&i===u||(n=(r=c).copy()).on(s,i=u),l.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,i,a=r+"";return function(){var o=X(this,t);return o===a?null:o===n?i:i=e(n=o,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!==typeof e)throw new Error;return this.tween(n,function(t,e,r){var n,i;function a(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,a,r)),n}return a._value=e,a}(t,e,null==r?"":r))},text:function(t){return this.tween("text","function"===typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ve(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!==typeof t)throw new Error;return this.tween(e,function(t){var e,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,i=se(this.node(),r).tween,a=0,o=i.length;a<o;++a)if((n=i[a]).name===t)return n.value;return null}return this.each((null==e?ge:ye)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"===typeof t?xr:br)(e,t)):se(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"===typeof t?_r:wr)(e,t)):se(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!==typeof e)throw new Error;return function(){oe(this,t).ease=e}}(e,t)):se(this.node(),e).ease},easeVarying:function(t){if("function"!==typeof t)throw new Error;return this.each(function(t,e){return function(){var r=e.apply(this,arguments);if("function"!==typeof r)throw new Error;oe(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,n=r._id,i=r.size();return new Promise((function(a,o){var s={value:o},l={value:function(){0===--i&&a()}};r.each((function(){var r=oe(this,n),i=r.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),r.on=e})),0===i&&a()}))},[Symbol.iterator]:Cr[Symbol.iterator]};var Er={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Lr(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}Pt.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var r,n,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(r=a[i]).name===e?(n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete a[i]):o=!1;o&&delete t.__transition}}(this,t)}))},Pt.prototype.transition=function(t){var e,r;t instanceof Ar?(e=t._id,t=t._name):(e=Mr(),(r=Er).time=Yt(),t=null==t?null:t+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var o,s=n[a],l=s.length,c=0;c<l;++c)(o=s[c])&&ie(o,t,e,c,s,r||Lr(o,e));return new Ar(n,this._parents,t,e)};const{abs:Pr,max:Ir,min:zr}=Math;function Or(t){return[+t[0],+t[1]]}function Dr(t){return[Or(t[0]),Or(t[1])]}["w","e"].map(Rr),["n","s"].map(Rr),["n","w","e","s","nw","ne","sw","se"].map(Rr);function Rr(t){return{type:t}}const Fr=Math.PI/180,Br=180/Math.PI,jr=.96422,Nr=.82521,Ur=4/29,Vr=6/29,qr=3*Vr*Vr,$r=Vr*Vr*Vr;function Hr(t){if(t instanceof Wr)return new Wr(t.l,t.a,t.b,t.opacity);if(t instanceof Qr)return tn(t);t instanceof Ve||(t=Ne(t));var e,r,n=Xr(t.r),i=Xr(t.g),a=Xr(t.b),o=Gr((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=o:(e=Gr((.4360747*n+.3850649*i+.1430804*a)/jr),r=Gr((.0139322*n+.0971045*i+.7141733*a)/Nr)),new Wr(116*o-16,500*(e-o),200*(o-r),t.opacity)}function Wr(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Gr(t){return t>$r?Math.pow(t,1/3):t/qr+Ur}function Yr(t){return t>Vr?t*t*t:qr*(t-Ur)}function Zr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Xr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Kr(t){if(t instanceof Qr)return new Qr(t.h,t.c,t.l,t.opacity);if(t instanceof Wr||(t=Hr(t)),0===t.a&&0===t.b)return new Qr(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Br;return new Qr(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Jr(t,e,r,n){return 1===arguments.length?Kr(t):new Qr(t,e,r,null==n?1:n)}function Qr(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function tn(t){if(isNaN(t.h))return new Wr(t.l,0,0,t.opacity);var e=t.h*Fr;return new Wr(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function en(t){return function(e,r){var n=t((e=Jr(e)).h,(r=Jr(r)).h),i=ir(e.c,r.c),a=ir(e.l,r.l),o=ir(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}xe(Wr,(function(t,e,r,n){return 1===arguments.length?Hr(t):new Wr(t,e,r,null==n?1:n)}),be(_e,{brighter(t){return new Wr(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Wr(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new Ve(Zr(3.1338561*(e=jr*Yr(e))-1.6168667*(t=1*Yr(t))-.4906146*(r=Nr*Yr(r))),Zr(-.9787684*e+1.9161415*t+.033454*r),Zr(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),xe(Qr,Jr,be(_e,{brighter(t){return new Qr(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Qr(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return tn(this).rgb()}}));const rn=en((function(t,e){var r=e-t;return r?rr(t,r>180||r<-180?r-360*Math.round(r/360):r):er(isNaN(t)?e:t)}));en(ir);function nn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}class an extends Map{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cn;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[r,n]of t)this.set(r,n)}get(t){return super.get(on(this,t))}has(t){return super.has(on(this,t))}set(t,e){return super.set(sn(this,t),e)}delete(t){return super.delete(ln(this,t))}}Set;function on(t,e){let{_intern:r,_key:n}=t;const i=n(e);return r.has(i)?r.get(i):e}function sn(t,e){let{_intern:r,_key:n}=t;const i=n(e);return r.has(i)?r.get(i):(r.set(i,e),e)}function ln(t,e){let{_intern:r,_key:n}=t;const i=n(e);return r.has(i)&&(e=r.get(i),r.delete(i)),e}function cn(t){return null!==t&&"object"===typeof t?t.valueOf():t}const un=Symbol("implicit");function hn(){var t=new an,e=[],r=[],n=un;function i(i){let a=t.get(i);if(void 0===a){if(n!==un)return n;t.set(i,a=e.push(i)-1)}return r[a%r.length]}return i.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new an;for(const n of r)t.has(n)||t.set(n,e.push(n)-1);return i},i.range=function(t){return arguments.length?(r=Array.from(t),i):r.slice()},i.unknown=function(t){return arguments.length?(n=t,i):n},i.copy=function(){return hn(e,r).unknown(n)},nn.apply(i,arguments),i}function dn(){var t,e,r=hn().unknown(void 0),n=r.domain,i=r.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var r=n().length,h=o<a,d=h?o:a,p=h?a:o;t=(p-d)/Math.max(1,r-l+2*c),s&&(t=Math.floor(t)),d+=(p-d-t*(r-l))*u,e=t*(1-l),s&&(d=Math.round(d),e=Math.round(e));var f=function(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a}(r).map((function(e){return d+t*e}));return i(h?f.reverse():f)}return delete r.unknown,r.domain=function(t){return arguments.length?(n(t),h()):n()},r.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,h()):[a,o]},r.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,s=!0,h()},r.bandwidth=function(){return e},r.step=function(){return t},r.round=function(t){return arguments.length?(s=!!t,h()):s},r.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},r.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},r.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},r.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},r.copy=function(){return dn(n(),[a,o]).round(s).paddingInner(l).paddingOuter(c).align(u)},nn.apply(h(),arguments)}const pn=Math.sqrt(50),fn=Math.sqrt(10),mn=Math.sqrt(2);function gn(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=pn?10:a>=fn?5:a>=mn?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=r&&r<2?gn(t,e,2*r):[s,l,c]}function yn(t,e,r){return gn(t=+t,e=+e,r=+r)[2]}function vn(t,e,r){r=+r;const n=(e=+e)<(t=+t),i=n?yn(e,t,r):yn(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function xn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _n(t){let e,r,n;function i(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i<a){if(0!==e(n,n))return a;do{const e=i+a>>>1;r(t[e],n)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=xn,r=(e,r)=>xn(t(e),r),n=(e,r)=>t(e)-r):(e=t===xn||t===bn?t:wn,r=t,n=t),{left:i,center:function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=i(t,e,r,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length)-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i<a){if(0!==e(n,n))return a;do{const e=i+a>>>1;r(t[e],n)<=0?i=e+1:a=e}while(i<a)}return i}}}function wn(){return 0}const kn=_n(xn),Tn=kn.right,Sn=(kn.left,_n((function(t){return null===t?NaN:+t})).center,Tn);function An(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=Ln(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}}function Mn(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Cn(t,e){var r,n={},i={};for(r in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)r in t?n[r]=Ln(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}function En(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function Ln(t,e){var r,n,i=typeof e;return null==e||"boolean"===i?er(e):("number"===i?le:"string"===i?(r=Fe(e))?(e=r,ar):cr:e instanceof Fe?ar:e instanceof Date?Mn:(n=e,!ArrayBuffer.isView(n)||n instanceof DataView?Array.isArray(e)?An:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?Cn:le:En))(t,e)}function Pn(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function In(t){return+t}var zn=[0,1];function On(t){return t}function Dn(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:(r=isNaN(e)?NaN:.5,function(){return r});var r}function Rn(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Dn(i,n),a=r(o,a)):(n=Dn(n,i),a=r(a,o)),function(t){return a(n(t))}}function Fn(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)i[o]=Dn(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(e){var r=Sn(t,e,1,n)-1;return a[r](i[r](e))}}function Bn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function jn(){var t,e,r,n,i,a,o=zn,s=zn,l=Ln,c=On;function u(){var t=Math.min(o.length,s.length);return c!==On&&(c=function(t,e){var r;return t>e&&(r=t,t=e,e=r),function(r){return Math.max(t,Math.min(e,r))}}(o[0],o[t-1])),n=t>2?Fn:Rn,i=a=null,h}function h(e){return null==e||isNaN(e=+e)?r:(i||(i=n(o.map(t),s,l)))(t(c(e)))}return h.invert=function(r){return c(e((a||(a=n(s,o.map(t),le)))(r)))},h.domain=function(t){return arguments.length?(o=Array.from(t,In),u()):o.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Pn,u()},h.clamp=function(t){return arguments.length?(c=!!t||On,u()):c!==On},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(r=t,h):r},function(r,n){return t=r,e=n,u()}}function Nn(){return jn()(On,On)}var Un,Vn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qn(t){if(!(e=Vn.exec(t)))throw new Error("invalid format: "+t);var e;return new $n({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function $n(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Hn(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Wn(t){return(t=Hn(Math.abs(t)))?t[1]:NaN}function Gn(t,e){var r=Hn(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}qn.prototype=$n.prototype,$n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Yn={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Gn(100*t,e)},r:Gn,s:function(t,e){var r=Hn(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(Un=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Hn(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Zn(t){return t}var Xn,Kn,Jn,Qn=Array.prototype.map,ti=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function ei(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Zn:(e=Qn.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(r)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Zn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Qn.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=qn(t)).fill,r=t.align,h=t.sign,d=t.symbol,p=t.zero,f=t.width,m=t.comma,g=t.precision,y=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Yn[v]||(void 0===g&&(g=12),y=!0,v="g"),(p||"0"===e&&"="===r)&&(p=!0,e="0",r="=");var x="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===d?a:/[%p]/.test(v)?l:"",_=Yn[v],w=/[defgprs%]/.test(v);function k(t){var i,a,l,d=x,k=b;if("c"===v)k=_(t)+k,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:_(Math.abs(t),g),y&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n<r;++n)switch(t[n]){case".":i=e=n;break;case"0":0===i&&(i=n),e=n;break;default:if(!+t[n])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),T&&0===+t&&"+"!==h&&(T=!1),d=(T?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===v?ti[8+Un/3]:"")+k+(T&&"("===h?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(l=t.charCodeAt(i))||l>57){k=(46===l?o+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}m&&!p&&(t=n(t,1/0));var S=d.length+t.length+k.length,A=S<f?new Array(f-S+1).join(e):"";switch(m&&p&&(t=n(A+t,A.length?f-k.length:1/0),A=""),r){case"<":t=d+t+k+A;break;case"=":t=d+A+t+k;break;case"^":t=A.slice(0,S=A.length>>1)+d+t+k+A.slice(S);break;default:t=A+d+t+k}return s(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var r=h(((t=qn(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(Wn(e)/3))),i=Math.pow(10,-n),a=ti[8+n/3];return function(t){return r(i*t)+a}}}}function ri(t,e,r,n){var i,a=vn(t,e,r);switch((n=qn(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Wn(e)/3)))-Wn(Math.abs(t)))}(a,o))||(n.precision=i),Jn(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Wn(e)-Wn(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(t){return Math.max(0,-Wn(Math.abs(t)))}(a))||(n.precision=i-2*("%"===n.type))}return Kn(n)}function ni(t){var e=t.domain;return t.ticks=function(t){var r=e();return function(t,e,r){if(!((r=+r)>0))return[];if((t=+t)===(e=+e))return[t];const n=e<t,[i,a,o]=n?gn(e,t,r):gn(t,e,r);if(!(a>=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let c=0;c<s;++c)l[c]=(a-c)/-o;else for(let c=0;c<s;++c)l[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)l[c]=(i+c)/-o;else for(let c=0;c<s;++c)l[c]=(i+c)*o;return l}(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return ri(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,i,a=e(),o=0,s=a.length-1,l=a[o],c=a[s],u=10;for(c<l&&(i=l,l=c,c=i,i=o,o=s,s=i);u-- >0;){if((i=yn(l,c,r))===n)return a[o]=l,a[s]=c,e(a);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}n=i}return t},t}function ii(){var t=Nn();return t.copy=function(){return Bn(t,ii())},nn.apply(t,arguments),ni(t)}Xn=ei({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Kn=Xn.format,Jn=Xn.formatPrefix;const ai=1e3,oi=6e4,si=36e5,li=864e5,ci=6048e5,ui=2592e6,hi=31536e6,di=new Date,pi=new Date;function fi(t,e,r,n){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),i.round=t=>{const e=i(t),r=i.ceil(t);return t-e<r-t?e:r},i.offset=(t,r)=>(e(t=new Date(+t),null==r?1:Math.floor(r)),t),i.range=(r,n,a)=>{const o=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r<n)||!(a>0))return o;let s;do{o.push(s=new Date(+r)),e(r,a),t(r)}while(s<r&&r<n);return o},i.filter=r=>fi((e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),((t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})),r&&(i.count=(e,n)=>(di.setTime(+e),pi.setTime(+n),t(di),t(pi),Math.floor(r(di,pi))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?e=>n(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const mi=fi((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));mi.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?fi((e=>{e.setTime(Math.floor(e/t)*t)}),((e,r)=>{e.setTime(+e+r*t)}),((e,r)=>(r-e)/t)):mi:null);mi.range;const gi=fi((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*ai)}),((t,e)=>(e-t)/ai),(t=>t.getUTCSeconds())),yi=(gi.range,fi((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ai)}),((t,e)=>{t.setTime(+t+e*oi)}),((t,e)=>(e-t)/oi),(t=>t.getMinutes()))),vi=(yi.range,fi((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*oi)}),((t,e)=>(e-t)/oi),(t=>t.getUTCMinutes()))),xi=(vi.range,fi((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ai-t.getMinutes()*oi)}),((t,e)=>{t.setTime(+t+e*si)}),((t,e)=>(e-t)/si),(t=>t.getHours()))),bi=(xi.range,fi((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*si)}),((t,e)=>(e-t)/si),(t=>t.getUTCHours()))),_i=(bi.range,fi((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*oi)/li),(t=>t.getDate()-1))),wi=(_i.range,fi((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/li),(t=>t.getUTCDate()-1))),ki=(wi.range,fi((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/li),(t=>Math.floor(t/li))));ki.range;function Ti(t){return fi((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*oi)/ci))}const Si=Ti(0),Ai=Ti(1),Mi=Ti(2),Ci=Ti(3),Ei=Ti(4),Li=Ti(5),Pi=Ti(6);Si.range,Ai.range,Mi.range,Ci.range,Ei.range,Li.range,Pi.range;function Ii(t){return fi((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/ci))}const zi=Ii(0),Oi=Ii(1),Di=Ii(2),Ri=Ii(3),Fi=Ii(4),Bi=Ii(5),ji=Ii(6),Ni=(zi.range,Oi.range,Di.range,Ri.range,Fi.range,Bi.range,ji.range,fi((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()))),Ui=(Ni.range,fi((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),Vi=(Ui.range,fi((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));Vi.every=t=>isFinite(t=Math.floor(t))&&t>0?fi((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,r)=>{e.setFullYear(e.getFullYear()+r*t)})):null;Vi.range;const qi=fi((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));qi.every=t=>isFinite(t=Math.floor(t))&&t>0?fi((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null;qi.range;function $i(t,e,r,n,i,a){const o=[[gi,1,ai],[gi,5,5e3],[gi,15,15e3],[gi,30,3e4],[a,1,oi],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,si],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,li],[n,2,1728e5],[r,1,ci],[e,1,ui],[e,3,7776e6],[t,1,hi]];function s(e,r,n){const i=Math.abs(r-e)/n,a=_n((t=>{let[,,e]=t;return e})).right(o,i);if(a===o.length)return t.every(vn(e/hi,r/hi,n));if(0===a)return mi.every(Math.max(vn(e,r,n),1));const[s,l]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(l)}return[function(t,e,r){const n=e<t;n&&([t,e]=[e,t]);const i=r&&"function"===typeof r.range?r:s(t,e,r),a=i?i.range(t,+e+1):[];return n?a.reverse():a},s]}const[Hi,Wi]=$i(qi,Ui,zi,ki,bi,vi),[Gi,Yi]=$i(Vi,Ni,Si,_i,xi,yi);var Zi=new Date,Xi=new Date;function Ki(t,e,r,n){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},i.round=function(t){var e=i(t),r=i.ceil(t);return t-e<r-t?e:r},i.offset=function(t,r){return e(t=new Date(+t),null==r?1:Math.floor(r)),t},i.range=function(r,n,a){var o,s=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r<n)||!(a>0))return s;do{s.push(o=new Date(+r)),e(r,a),t(r)}while(o<r&&r<n);return s},i.filter=function(r){return Ki((function(e){if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(i.count=function(e,n){return Zi.setTime(+e),Xi.setTime(+n),t(Zi),t(Xi),Math.floor(r(Zi,Xi))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?function(e){return n(e)%t===0}:function(e){return i.count(0,e)%t===0}):i:null}),i}var Ji=864e5,Qi=6048e5;function ta(t){return Ki((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Qi}))}var ea=ta(0),ra=ta(1),na=ta(2),ia=ta(3),aa=ta(4),oa=ta(5),sa=ta(6),la=(ea.range,ra.range,na.range,ia.range,aa.range,oa.range,sa.range,Ki((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Ji}),(function(t){return t.getUTCDate()-1})));const ca=la;la.range;function ua(t){return Ki((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/Qi}))}var ha=ua(0),da=ua(1),pa=ua(2),fa=ua(3),ma=ua(4),ga=ua(5),ya=ua(6),va=(ha.range,da.range,pa.range,fa.range,ma.range,ga.range,ya.range,Ki((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/Ji}),(function(t){return t.getDate()-1})));const xa=va;va.range;var ba=Ki((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));ba.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ki((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};const _a=ba;ba.range;var wa=Ki((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));wa.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ki((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};const ka=wa;wa.range;function Ta(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Sa(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Aa(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var Ma,Ca,Ea={"-":"",_:" ",0:"0"},La=/^\s*\d+/,Pa=/^%/,Ia=/[\\^$*+?|[\]().{}]/g;function za(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function Oa(t){return t.replace(Ia,"\\$&")}function Da(t){return new RegExp("^(?:"+t.map(Oa).join("|")+")","i")}function Ra(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function Fa(t,e,r){var n=La.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ba(t,e,r){var n=La.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function ja(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Na(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Ua(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Va(t,e,r){var n=La.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function qa(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function $a(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Ha(t,e,r){var n=La.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function Wa(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ga(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ya(t,e,r){var n=La.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Za(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Xa(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Ka(t,e,r){var n=La.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Ja(t,e,r){var n=La.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Qa(t,e,r){var n=La.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function to(t,e,r){var n=Pa.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function eo(t,e,r){var n=La.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function ro(t,e,r){var n=La.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function no(t,e){return za(t.getDate(),e,2)}function io(t,e){return za(t.getHours(),e,2)}function ao(t,e){return za(t.getHours()%12||12,e,2)}function oo(t,e){return za(1+xa.count(_a(t),t),e,3)}function so(t,e){return za(t.getMilliseconds(),e,3)}function lo(t,e){return so(t,e)+"000"}function co(t,e){return za(t.getMonth()+1,e,2)}function uo(t,e){return za(t.getMinutes(),e,2)}function ho(t,e){return za(t.getSeconds(),e,2)}function po(t){var e=t.getDay();return 0===e?7:e}function fo(t,e){return za(ha.count(_a(t)-1,t),e,2)}function mo(t){var e=t.getDay();return e>=4||0===e?ma(t):ma.ceil(t)}function go(t,e){return t=mo(t),za(ma.count(_a(t),t)+(4===_a(t).getDay()),e,2)}function yo(t){return t.getDay()}function vo(t,e){return za(da.count(_a(t)-1,t),e,2)}function xo(t,e){return za(t.getFullYear()%100,e,2)}function bo(t,e){return za((t=mo(t)).getFullYear()%100,e,2)}function _o(t,e){return za(t.getFullYear()%1e4,e,4)}function wo(t,e){var r=t.getDay();return za((t=r>=4||0===r?ma(t):ma.ceil(t)).getFullYear()%1e4,e,4)}function ko(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+za(e/60|0,"0",2)+za(e%60,"0",2)}function To(t,e){return za(t.getUTCDate(),e,2)}function So(t,e){return za(t.getUTCHours(),e,2)}function Ao(t,e){return za(t.getUTCHours()%12||12,e,2)}function Mo(t,e){return za(1+ca.count(ka(t),t),e,3)}function Co(t,e){return za(t.getUTCMilliseconds(),e,3)}function Eo(t,e){return Co(t,e)+"000"}function Lo(t,e){return za(t.getUTCMonth()+1,e,2)}function Po(t,e){return za(t.getUTCMinutes(),e,2)}function Io(t,e){return za(t.getUTCSeconds(),e,2)}function zo(t){var e=t.getUTCDay();return 0===e?7:e}function Oo(t,e){return za(ea.count(ka(t)-1,t),e,2)}function Do(t){var e=t.getUTCDay();return e>=4||0===e?aa(t):aa.ceil(t)}function Ro(t,e){return t=Do(t),za(aa.count(ka(t),t)+(4===ka(t).getUTCDay()),e,2)}function Fo(t){return t.getUTCDay()}function Bo(t,e){return za(ra.count(ka(t)-1,t),e,2)}function jo(t,e){return za(t.getUTCFullYear()%100,e,2)}function No(t,e){return za((t=Do(t)).getUTCFullYear()%100,e,2)}function Uo(t,e){return za(t.getUTCFullYear()%1e4,e,4)}function Vo(t,e){var r=t.getUTCDay();return za((t=r>=4||0===r?aa(t):aa.ceil(t)).getUTCFullYear()%1e4,e,4)}function qo(){return"+0000"}function $o(){return"%"}function Ho(t){return+t}function Wo(t){return Math.floor(+t/1e3)}function Go(t){return new Date(t)}function Yo(t){return t instanceof Date?+t:+new Date(+t)}function Zo(t,e,r,n,i,a,o,s,l,c){var u=Nn(),h=u.invert,d=u.domain,p=c(".%L"),f=c(":%S"),m=c("%I:%M"),g=c("%I %p"),y=c("%a %d"),v=c("%b %d"),x=c("%B"),b=c("%Y");function _(t){return(l(t)<t?p:s(t)<t?f:o(t)<t?m:a(t)<t?g:n(t)<t?i(t)<t?y:v:r(t)<t?x:b)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?d(Array.from(t,Yo)):d().map(Go)},u.ticks=function(e){var r=d();return t(r[0],r[r.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?_:c(e)},u.nice=function(t){var r=d();return t&&"function"===typeof t.range||(t=e(r[0],r[r.length-1],null==t?10:t)),t?d(function(t,e){var r,n=0,i=(t=t.slice()).length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}(r,t)):u},u.copy=function(){return Bn(u,Zo(t,e,r,n,i,a,o,s,l,c))},u}function Xo(){return nn.apply(Zo(Gi,Yi,Vi,Ni,Si,_i,xi,yi,gi,Ca).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}!function(t){Ma=function(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,c=Da(i),u=Ra(i),h=Da(a),d=Ra(a),p=Da(o),f=Ra(o),m=Da(s),g=Ra(s),y=Da(l),v=Ra(l),x={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:no,e:no,f:lo,g:bo,G:wo,H:io,I:ao,j:oo,L:so,m:co,M:uo,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Ho,s:Wo,S:ho,u:po,U:fo,V:go,w:yo,W:vo,x:null,X:null,y:xo,Y:_o,Z:ko,"%":$o},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:To,e:To,f:Eo,g:No,G:Vo,H:So,I:Ao,j:Mo,L:Co,m:Lo,M:Po,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Ho,s:Wo,S:Io,u:zo,U:Oo,V:Ro,w:Fo,W:Bo,x:null,X:null,y:jo,Y:Uo,Z:qo,"%":$o},_={a:function(t,e,r){var n=p.exec(e.slice(r));return n?(t.w=f[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=d[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.m=v[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=g[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return T(t,e,r,n)},d:Ga,e:Ga,f:Qa,g:qa,G:Va,H:Za,I:Za,j:Ya,L:Ja,m:Wa,M:Xa,p:function(t,e,r){var n=c.exec(e.slice(r));return n?(t.p=u[n[0].toLowerCase()],r+n[0].length):-1},q:Ha,Q:eo,s:ro,S:Ka,u:Ba,U:ja,V:Na,w:Fa,W:Ua,x:function(t,e,n){return T(t,r,e,n)},X:function(t,e,r){return T(t,n,e,r)},y:qa,Y:Va,Z:$a,"%":to};function w(t,e){return function(r){var n,i,a,o=[],s=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++s<c;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=Ea[n=t.charAt(++s)])?n=t.charAt(++s):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}}function k(t,e){return function(r){var n,i,a=Aa(1900,void 0,1);if(T(a,t,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(e&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(n=Sa(Aa(a.y,0,1))).getUTCDay(),n=i>4||0===i?ra.ceil(n):ra(n),n=ca.offset(n,7*(a.V-1)),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(i=(n=Ta(Aa(a.y,0,1))).getDay(),n=i>4||0===i?da.ceil(n):da(n),n=xa.offset(n,7*(a.V-1)),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Sa(Aa(a.y,0,1)).getUTCDay():Ta(Aa(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Sa(a)):Ta(a)}}function T(t,e,r,n){for(var i,a,o=0,s=e.length,l=r.length;o<s;){if(n>=l)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=_[i in Ea?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return x.x=w(r,x),x.X=w(n,x),x.c=w(e,x),b.x=w(r,b),b.X=w(n,b),b.c=w(e,b),{format:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}(t),Ca=Ma.format,Ma.parse,Ma.utcFormat,Ma.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const Ko=function(t){for(var e=t.length/6|0,r=new Array(e),n=0;n<e;)r[n]="#"+t.slice(6*n,6*++n);return r}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Jo(t){return"string"===typeof t?new Et([[document.querySelector(t)]],[document.documentElement]):new Et([[t]],Ct)}function Qo(t){return function(){return t}}const ts=Math.abs,es=Math.atan2,rs=Math.cos,ns=Math.max,is=Math.min,as=Math.sin,os=Math.sqrt,ss=1e-12,ls=Math.PI,cs=ls/2,us=2*ls;function hs(t){return t>=1?cs:t<=-1?-cs:Math.asin(t)}const ds=Math.PI,ps=2*ds,fs=1e-6,ms=ps-fs;function gs(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}class ys{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?gs:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return gs;const r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,r,n){this._append`Q${+t},${+e},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(t,e,r,n,i,a){this._append`C${+t},${+e},${+r},${+n},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,r,n,i){if(t=+t,e=+e,r=+r,n=+n,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=r-t,l=n-e,c=a-t,u=o-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>fs)if(Math.abs(u*s-l*c)>fs&&i){let d=r-a,p=n-o,f=s*s+l*l,m=d*d+p*p,g=Math.sqrt(f),y=Math.sqrt(h),v=i*Math.tan((ds-Math.acos((f+h-m)/(2*g*y)))/2),x=v/y,b=v/g;Math.abs(x-1)>fs&&this._append`L${t+x*c},${e+x*u}`,this._append`A${i},${i},0,0,${+(u*d>c*p)},${this._x1=t+b*s},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,r,n,i,a){if(t=+t,e=+e,a=!!a,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(n),s=r*Math.sin(n),l=t+o,c=e+s,u=1^a,h=a?n-i:i-n;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>fs||Math.abs(this._y1-c)>fs)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%ps+ps),h>ms?this._append`A${r},${r},0,1,${u},${t-o},${e-s}A${r},${r},0,1,${u},${this._x1=l},${this._y1=c}`:h>fs&&this._append`A${r},${r},0,${+(h>=ds)},${u},${this._x1=t+r*Math.cos(i)},${this._y1=e+r*Math.sin(i)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function vs(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{const t=Math.floor(r);if(!(t>=0))throw new RangeError(`invalid digits: ${r}`);e=t}return t},()=>new ys(e)}function xs(t){return t.innerRadius}function bs(t){return t.outerRadius}function _s(t){return t.startAngle}function ws(t){return t.endAngle}function ks(t){return t&&t.padAngle}function Ts(t,e,r,n,i,a,o){var s=t-r,l=e-n,c=(o?a:-a)/os(s*s+l*l),u=c*l,h=-c*s,d=t+u,p=e+h,f=r+u,m=n+h,g=(d+f)/2,y=(p+m)/2,v=f-d,x=m-p,b=v*v+x*x,_=i-a,w=d*m-f*p,k=(x<0?-1:1)*os(ns(0,_*_*b-w*w)),T=(w*x-v*k)/b,S=(-w*v-x*k)/b,A=(w*x+v*k)/b,M=(-w*v+x*k)/b,C=T-g,E=S-y,L=A-g,P=M-y;return C*C+E*E>L*L+P*P&&(T=A,S=M),{cx:T,cy:S,x01:-u,y01:-h,x11:T*(i/_-1),y11:S*(i/_-1)}}function Ss(){var t=xs,e=bs,r=Qo(0),n=null,i=_s,a=ws,o=ks,s=null,l=vs(c);function c(){var c,u,h,d=+t.apply(this,arguments),p=+e.apply(this,arguments),f=i.apply(this,arguments)-cs,m=a.apply(this,arguments)-cs,g=ts(m-f),y=m>f;if(s||(s=c=l()),p<d&&(u=p,p=d,d=u),p>ss)if(g>us-ss)s.moveTo(p*rs(f),p*as(f)),s.arc(0,0,p,f,m,!y),d>ss&&(s.moveTo(d*rs(m),d*as(m)),s.arc(0,0,d,m,f,y));else{var v,x,b=f,_=m,w=f,k=m,T=g,S=g,A=o.apply(this,arguments)/2,M=A>ss&&(n?+n.apply(this,arguments):os(d*d+p*p)),C=is(ts(p-d)/2,+r.apply(this,arguments)),E=C,L=C;if(M>ss){var P=hs(M/d*as(A)),I=hs(M/p*as(A));(T-=2*P)>ss?(w+=P*=y?1:-1,k-=P):(T=0,w=k=(f+m)/2),(S-=2*I)>ss?(b+=I*=y?1:-1,_-=I):(S=0,b=_=(f+m)/2)}var z=p*rs(b),O=p*as(b),D=d*rs(k),R=d*as(k);if(C>ss){var F,B=p*rs(_),j=p*as(_),N=d*rs(w),U=d*as(w);if(g<ls)if(F=function(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,u=o-i,h=s-a,d=h*l-u*c;if(!(d*d<ss))return[t+(d=(u*(e-a)-h*(t-i))/d)*l,e+d*c]}(z,O,N,U,B,j,D,R)){var V=z-F[0],q=O-F[1],$=B-F[0],H=j-F[1],W=1/as(((h=(V*$+q*H)/(os(V*V+q*q)*os($*$+H*H)))>1?0:h<-1?ls:Math.acos(h))/2),G=os(F[0]*F[0]+F[1]*F[1]);E=is(C,(d-G)/(W-1)),L=is(C,(p-G)/(W+1))}else E=L=0}S>ss?L>ss?(v=Ts(N,U,z,O,p,L,y),x=Ts(B,j,D,R,p,L,y),s.moveTo(v.cx+v.x01,v.cy+v.y01),L<C?s.arc(v.cx,v.cy,L,es(v.y01,v.x01),es(x.y01,x.x01),!y):(s.arc(v.cx,v.cy,L,es(v.y01,v.x01),es(v.y11,v.x11),!y),s.arc(0,0,p,es(v.cy+v.y11,v.cx+v.x11),es(x.cy+x.y11,x.cx+x.x11),!y),s.arc(x.cx,x.cy,L,es(x.y11,x.x11),es(x.y01,x.x01),!y))):(s.moveTo(z,O),s.arc(0,0,p,b,_,!y)):s.moveTo(z,O),d>ss&&T>ss?E>ss?(v=Ts(D,R,B,j,d,-E,y),x=Ts(z,O,N,U,d,-E,y),s.lineTo(v.cx+v.x01,v.cy+v.y01),E<C?s.arc(v.cx,v.cy,E,es(v.y01,v.x01),es(x.y01,x.x01),!y):(s.arc(v.cx,v.cy,E,es(v.y01,v.x01),es(v.y11,v.x11),!y),s.arc(0,0,d,es(v.cy+v.y11,v.cx+v.x11),es(x.cy+x.y11,x.cx+x.x11),y),s.arc(x.cx,x.cy,E,es(x.y11,x.x11),es(x.y01,x.x01),!y))):s.arc(0,0,d,k,w,y):s.lineTo(D,R)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-ls/2;return[rs(n)*r,as(n)*r]},c.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:Qo(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:Qo(+t),c):e},c.cornerRadius=function(t){return arguments.length?(r="function"===typeof t?t:Qo(+t),c):r},c.padRadius=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:Qo(+t),c):n},c.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:Qo(+t),c):i},c.endAngle=function(t){return arguments.length?(a="function"===typeof t?t:Qo(+t),c):a},c.padAngle=function(t){return arguments.length?(o="function"===typeof t?t:Qo(+t),c):o},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}ys.prototype;Array.prototype.slice;function As(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function Ms(t){this._context=t}function Cs(t){return new Ms(t)}function Es(t){return t[0]}function Ls(t){return t[1]}function Ps(t,e){var r=Qo(!0),n=null,i=Cs,a=null,o=vs(s);function s(s){var l,c,u,h=(s=As(s)).length,d=!1;for(null==n&&(a=i(u=o())),l=0;l<=h;++l)!(l<h&&r(c=s[l],l,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(c,l,s),+e(c,l,s));if(u)return a=null,u+""||null}return t="function"===typeof t?t:void 0===t?Es:Qo(t),e="function"===typeof e?e:void 0===e?Ls:Qo(e),s.x=function(e){return arguments.length?(t="function"===typeof e?e:Qo(+e),s):t},s.y=function(t){return arguments.length?(e="function"===typeof t?t:Qo(+t),s):e},s.defined=function(t){return arguments.length?(r="function"===typeof t?t:Qo(!!t),s):r},s.curve=function(t){return arguments.length?(i=t,null!=n&&(a=i(n)),s):i},s.context=function(t){return arguments.length?(null==t?n=a=null:a=i(n=t),s):n},s}function Is(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function zs(t){return t}function Os(){var t=zs,e=Is,r=null,n=Qo(0),i=Qo(us),a=Qo(0);function o(o){var s,l,c,u,h,d=(o=As(o)).length,p=0,f=new Array(d),m=new Array(d),g=+n.apply(this,arguments),y=Math.min(us,Math.max(-us,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/d,a.apply(this,arguments)),x=v*(y<0?-1:1);for(s=0;s<d;++s)(h=m[f[s]=s]=+t(o[s],s,o))>0&&(p+=h);for(null!=e?f.sort((function(t,r){return e(m[t],m[r])})):null!=r&&f.sort((function(t,e){return r(o[t],o[e])})),s=0,c=p?(y-d*x)/p:0;s<d;++s,g=u)l=f[s],u=g+((h=m[l])>0?h*c:0)+x,m[l]={data:o[l],index:s,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return o.value=function(e){return arguments.length?(t="function"===typeof e?e:Qo(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,r=null,o):e},o.sort=function(t){return arguments.length?(r=t,e=null,o):r},o.startAngle=function(t){return arguments.length?(n="function"===typeof t?t:Qo(+t),o):n},o.endAngle=function(t){return arguments.length?(i="function"===typeof t?t:Qo(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:Qo(+t),o):a},o}function Ds(){}function Rs(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Fs(t){this._context=t}function Bs(t){return new Fs(t)}function js(t){this._context=t}function Ns(t){return new js(t)}function Us(t){this._context=t}function Vs(t){return new Us(t)}Ms.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},Fs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},js.prototype={areaStart:Ds,areaEnd:Ds,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Rs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Us.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Rs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class qs{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function $s(t){return new qs(t,!0)}function Hs(t){return new qs(t,!1)}function Ws(t,e){this._basis=new Fs(t),this._beta=e}Ws.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Gs=function t(e){function r(t){return 1===e?new Fs(t):new Ws(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function Ys(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Zs(t,e){this._context=t,this._k=(1-e)/6}Zs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ys(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ys(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xs=function t(e){function r(t){return new Zs(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Ks(t,e){this._context=t,this._k=(1-e)/6}Ks.prototype={areaStart:Ds,areaEnd:Ds,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ys(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Js=function t(e){function r(t){return new Ks(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Qs(t,e){this._context=t,this._k=(1-e)/6}Qs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ys(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tl=function t(e){function r(t){return new Qs(t,e)}return r.tension=function(e){return t(+e)},r}(0);function el(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>ss){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ss){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function rl(t,e){this._context=t,this._alpha=e}rl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:el(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const nl=function t(e){function r(t){return e?new rl(t,e):new Zs(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function il(t,e){this._context=t,this._alpha=e}il.prototype={areaStart:Ds,areaEnd:Ds,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:el(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const al=function t(e){function r(t){return e?new il(t,e):new Ks(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function ol(t,e){this._context=t,this._alpha=e}ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:el(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sl=function t(e){function r(t){return e?new ol(t,e):new Qs(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function ll(t){this._context=t}function cl(t){return new ll(t)}function ul(t){return t<0?-1:1}function hl(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(ul(a)+ul(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function dl(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function pl(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function fl(t){this._context=t}function ml(t){this._context=new gl(t)}function gl(t){this._context=t}function yl(t){return new fl(t)}function vl(t){return new ml(t)}function xl(t){this._context=t}function bl(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,o[e]-=r*o[e-1];for(i[n-1]=o[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function _l(t){return new xl(t)}function wl(t,e){this._context=t,this._t=e}function kl(t){return new wl(t,.5)}function Tl(t){return new wl(t,0)}function Sl(t){return new wl(t,1)}ll.prototype={areaStart:Ds,areaEnd:Ds,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},fl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pl(this,this._t0,dl(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,pl(this,dl(this,r=hl(this,t,e)),r);break;default:pl(this,this._t0,r=hl(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(ml.prototype=Object.create(fl.prototype)).point=function(t,e){fl.prototype.point.call(this,e,t)},gl.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}},xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=bl(t),i=bl(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},wl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}};const Al=new Date,Ml=new Date;function Cl(t,e,r,n){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),i.round=t=>{const e=i(t),r=i.ceil(t);return t-e<r-t?e:r},i.offset=(t,r)=>(e(t=new Date(+t),null==r?1:Math.floor(r)),t),i.range=(r,n,a)=>{const o=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r<n)||!(a>0))return o;let s;do{o.push(s=new Date(+r)),e(r,a),t(r)}while(s<r&&r<n);return o},i.filter=r=>Cl((e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),((t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})),r&&(i.count=(e,n)=>(Al.setTime(+e),Ml.setTime(+n),t(Al),t(Ml),Math.floor(r(Al,Ml))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?e=>n(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const El=Cl((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));El.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Cl((e=>{e.setTime(Math.floor(e/t)*t)}),((e,r)=>{e.setTime(+e+r*t)}),((e,r)=>(r-e)/t)):El:null);El.range;const Ll=1e3,Pl=6e4,Il=36e5,zl=864e5,Ol=6048e5,Dl=Cl((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Ll)}),((t,e)=>(e-t)/Ll),(t=>t.getUTCSeconds())),Rl=(Dl.range,Cl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ll)}),((t,e)=>{t.setTime(+t+e*Pl)}),((t,e)=>(e-t)/Pl),(t=>t.getMinutes()))),Fl=(Rl.range,Cl((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*Pl)}),((t,e)=>(e-t)/Pl),(t=>t.getUTCMinutes()))),Bl=(Fl.range,Cl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ll-t.getMinutes()*Pl)}),((t,e)=>{t.setTime(+t+e*Il)}),((t,e)=>(e-t)/Il),(t=>t.getHours()))),jl=(Bl.range,Cl((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Il)}),((t,e)=>(e-t)/Il),(t=>t.getUTCHours()))),Nl=(jl.range,Cl((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Pl)/zl),(t=>t.getDate()-1))),Ul=(Nl.range,Cl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/zl),(t=>t.getUTCDate()-1))),Vl=(Ul.range,Cl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/zl),(t=>Math.floor(t/zl))));Vl.range;function ql(t){return Cl((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Pl)/Ol))}const $l=ql(0),Hl=ql(1),Wl=ql(2),Gl=ql(3),Yl=ql(4),Zl=ql(5),Xl=ql(6);$l.range,Hl.range,Wl.range,Gl.range,Yl.range,Zl.range,Xl.range;function Kl(t){return Cl((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Ol))}const Jl=Kl(0),Ql=Kl(1),tc=Kl(2),ec=Kl(3),rc=Kl(4),nc=Kl(5),ic=Kl(6),ac=(Jl.range,Ql.range,tc.range,ec.range,rc.range,nc.range,ic.range,Cl((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()))),oc=(ac.range,Cl((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),sc=(oc.range,Cl((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));sc.every=t=>isFinite(t=Math.floor(t))&&t>0?Cl((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,r)=>{e.setFullYear(e.getFullYear()+r*t)})):null;sc.range;const lc=Cl((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));lc.every=t=>isFinite(t=Math.floor(t))&&t>0?Cl((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null;lc.range;function cc(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function uc(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var dc,pc,fc={"-":"",_:" ",0:"0"},mc=/^\s*\d+/,gc=/^%/,yc=/[\\^$*+?|[\]().{}]/g;function vc(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function xc(t){return t.replace(yc,"\\$&")}function bc(t){return new RegExp("^(?:"+t.map(xc).join("|")+")","i")}function _c(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function wc(t,e,r){var n=mc.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kc(t,e,r){var n=mc.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Tc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Sc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Ac(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Mc(t,e,r){var n=mc.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Cc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Ec(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Lc(t,e,r){var n=mc.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function Pc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ic(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function zc(t,e,r){var n=mc.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Oc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Dc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Rc(t,e,r){var n=mc.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Fc(t,e,r){var n=mc.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Bc(t,e,r){var n=mc.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function jc(t,e,r){var n=gc.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Nc(t,e,r){var n=mc.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Uc(t,e,r){var n=mc.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Vc(t,e){return vc(t.getDate(),e,2)}function qc(t,e){return vc(t.getHours(),e,2)}function $c(t,e){return vc(t.getHours()%12||12,e,2)}function Hc(t,e){return vc(1+Nl.count(sc(t),t),e,3)}function Wc(t,e){return vc(t.getMilliseconds(),e,3)}function Gc(t,e){return Wc(t,e)+"000"}function Yc(t,e){return vc(t.getMonth()+1,e,2)}function Zc(t,e){return vc(t.getMinutes(),e,2)}function Xc(t,e){return vc(t.getSeconds(),e,2)}function Kc(t){var e=t.getDay();return 0===e?7:e}function Jc(t,e){return vc($l.count(sc(t)-1,t),e,2)}function Qc(t){var e=t.getDay();return e>=4||0===e?Yl(t):Yl.ceil(t)}function tu(t,e){return t=Qc(t),vc(Yl.count(sc(t),t)+(4===sc(t).getDay()),e,2)}function eu(t){return t.getDay()}function ru(t,e){return vc(Hl.count(sc(t)-1,t),e,2)}function nu(t,e){return vc(t.getFullYear()%100,e,2)}function iu(t,e){return vc((t=Qc(t)).getFullYear()%100,e,2)}function au(t,e){return vc(t.getFullYear()%1e4,e,4)}function ou(t,e){var r=t.getDay();return vc((t=r>=4||0===r?Yl(t):Yl.ceil(t)).getFullYear()%1e4,e,4)}function su(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+vc(e/60|0,"0",2)+vc(e%60,"0",2)}function lu(t,e){return vc(t.getUTCDate(),e,2)}function cu(t,e){return vc(t.getUTCHours(),e,2)}function uu(t,e){return vc(t.getUTCHours()%12||12,e,2)}function hu(t,e){return vc(1+Ul.count(lc(t),t),e,3)}function du(t,e){return vc(t.getUTCMilliseconds(),e,3)}function pu(t,e){return du(t,e)+"000"}function fu(t,e){return vc(t.getUTCMonth()+1,e,2)}function mu(t,e){return vc(t.getUTCMinutes(),e,2)}function gu(t,e){return vc(t.getUTCSeconds(),e,2)}function yu(t){var e=t.getUTCDay();return 0===e?7:e}function vu(t,e){return vc(Jl.count(lc(t)-1,t),e,2)}function xu(t){var e=t.getUTCDay();return e>=4||0===e?rc(t):rc.ceil(t)}function bu(t,e){return t=xu(t),vc(rc.count(lc(t),t)+(4===lc(t).getUTCDay()),e,2)}function _u(t){return t.getUTCDay()}function wu(t,e){return vc(Ql.count(lc(t)-1,t),e,2)}function ku(t,e){return vc(t.getUTCFullYear()%100,e,2)}function Tu(t,e){return vc((t=xu(t)).getUTCFullYear()%100,e,2)}function Su(t,e){return vc(t.getUTCFullYear()%1e4,e,4)}function Au(t,e){var r=t.getUTCDay();return vc((t=r>=4||0===r?rc(t):rc.ceil(t)).getUTCFullYear()%1e4,e,4)}function Mu(){return"+0000"}function Cu(){return"%"}function Eu(t){return+t}function Lu(t){return Math.floor(+t/1e3)}function Pu(t,e,r){this.k=t,this.x=e,this.y=r}!function(t){dc=function(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,c=bc(i),u=_c(i),h=bc(a),d=_c(a),p=bc(o),f=_c(o),m=bc(s),g=_c(s),y=bc(l),v=_c(l),x={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Vc,e:Vc,f:Gc,g:iu,G:ou,H:qc,I:$c,j:Hc,L:Wc,m:Yc,M:Zc,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Eu,s:Lu,S:Xc,u:Kc,U:Jc,V:tu,w:eu,W:ru,x:null,X:null,y:nu,Y:au,Z:su,"%":Cu},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:lu,e:lu,f:pu,g:Tu,G:Au,H:cu,I:uu,j:hu,L:du,m:fu,M:mu,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Eu,s:Lu,S:gu,u:yu,U:vu,V:bu,w:_u,W:wu,x:null,X:null,y:ku,Y:Su,Z:Mu,"%":Cu},_={a:function(t,e,r){var n=p.exec(e.slice(r));return n?(t.w=f.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=g.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,r,n){return T(t,e,r,n)},d:Ic,e:Ic,f:Bc,g:Cc,G:Mc,H:Oc,I:Oc,j:zc,L:Fc,m:Pc,M:Dc,p:function(t,e,r){var n=c.exec(e.slice(r));return n?(t.p=u.get(n[0].toLowerCase()),r+n[0].length):-1},q:Lc,Q:Nc,s:Uc,S:Rc,u:kc,U:Tc,V:Sc,w:wc,W:Ac,x:function(t,e,n){return T(t,r,e,n)},X:function(t,e,r){return T(t,n,e,r)},y:Cc,Y:Mc,Z:Ec,"%":jc};function w(t,e){return function(r){var n,i,a,o=[],s=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++s<c;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=fc[n=t.charAt(++s)])?n=t.charAt(++s):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}}function k(t,e){return function(r){var n,i,a=hc(1900,void 0,1);if(T(a,t,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(e&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(n=uc(hc(a.y,0,1))).getUTCDay(),n=i>4||0===i?Ql.ceil(n):Ql(n),n=Ul.offset(n,7*(a.V-1)),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(i=(n=cc(hc(a.y,0,1))).getDay(),n=i>4||0===i?Hl.ceil(n):Hl(n),n=Nl.offset(n,7*(a.V-1)),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?uc(hc(a.y,0,1)).getUTCDay():cc(hc(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,uc(a)):cc(a)}}function T(t,e,r,n){for(var i,a,o=0,s=e.length,l=r.length;o<s;){if(n>=l)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=_[i in fc?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return x.x=w(r,x),x.X=w(n,x),x.c=w(e,x),b.x=w(r,b),b.X=w(n,b),b.c=w(e,b),{format:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}(t),pc=dc.format,dc.parse,dc.utcFormat,dc.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Pu.prototype={constructor:Pu,scale:function(t){return 1===t?this:new Pu(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pu(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};new Pu(1,0,0);Pu.prototype},958:(t,e,r)=>{"use strict";r.d(e,{DA:()=>b,IU:()=>D,KX:()=>S,U:()=>O,U7:()=>Me,U_:()=>Ee,Zk:()=>u,aP:()=>Te,gh:()=>Ce,lC:()=>d,on:()=>Ae});var n=r(8434),i=r(9711),a=r(2596),o=r(634),s=r(3759),l=r(700),c=r(8205),u=(0,s.K2)((async(t,e,r)=>{let n;const i=e.useHtmlLabels||(0,s._3)((0,s.D7)()?.htmlLabels);n=r||"node default";const c=t.insert("g").attr("class",n).attr("id",e.domId||e.id),u=c.insert("g").attr("class","label").attr("style",(0,o.KL)(e.labelStyle));let h;h=void 0===e.label?"":"string"===typeof e.label?e.label:e.label[0];const d=await(0,a.GZ)(u,(0,s.jZ)((0,o.Sm)(h),(0,s.D7)()),{useHtmlLabels:i,width:e.width||(0,s.D7)().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let p=d.getBBox();const f=(e?.padding??0)/2;if(i){const t=d.children[0],e=(0,l.Ltv)(d),r=t.getElementsByTagName("img");if(r){const t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=(0,s.D7)().fontSize?(0,s.D7)().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[n=s.UI.fontSize]=(0,o.I5)(t),i=n*r+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";r(e)}(0,s.K2)(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return i?u.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):u.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&u.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),u.insert("rect",":first-child"),{shapeSvg:c,bbox:p,halfPadding:f,label:u}}),"labelHelper"),h=(0,s.K2)((async(t,e,r)=>{const n=r.useHtmlLabels||(0,s._3)((0,s.D7)()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),c=await(0,a.GZ)(i,(0,s.jZ)((0,o.Sm)(e),(0,s.D7)()),{useHtmlLabels:n,width:r.width||(0,s.D7)()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let u=c.getBBox();const h=r.padding/2;if((0,s._3)((0,s.D7)()?.flowchart?.htmlLabels)){const t=c.children[0],e=(0,l.Ltv)(c);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}return n?i.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):i.attr("transform","translate(0, "+-u.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:u,halfPadding:h,label:i}}),"insertLabel"),d=(0,s.K2)(((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height}),"updateNodeBounds"),p=(0,s.K2)(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function f(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function m(t,e,r,n,i,a){const o=[],s=r-t,l=n-e,c=s/a,u=2*Math.PI/c,h=e+l/2;for(let d=0;d<=50;d++){const e=t+d/50*s,r=h+i*Math.sin(u*(e-t));o.push({x:e,y:r})}return o}function g(t,e,r,n,i,a){const o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(n-1);for(let c=0;c<n;c++){const n=s+c*l,i=t+r*Math.cos(n),a=e+r*Math.sin(n);o.push({x:-i,y:-a})}return o}(0,s.K2)(f,"createPathFromPoints"),(0,s.K2)(m,"generateFullSineWavePoints"),(0,s.K2)(g,"generateCirclePoints");var y=(0,s.K2)(((t,e)=>{var r,n,i=t.x,a=t.y,o=e.x-i,s=e.y-a,l=t.width/2,c=t.height/2;return Math.abs(s)*l>Math.abs(o)*c?(s<0&&(c=-c),r=0===s?0:c*o/s,n=c):(o<0&&(l=-l),r=l,n=0===o?0:l*s/o),{x:i+r,y:a+n}}),"intersectRect");function v(t,e){e&&t.attr("style",e)}async function x(t){const e=(0,l.Ltv)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div");let n=t.label;t.label&&(0,s.Wi)(t.label)&&(n=await(0,s.VJ)(t.label.replace(s.Y2.lineBreakRegex,"\n"),(0,s.D7)()));const i=t.isNode?"nodeLabel":"edgeLabel";return r.html('<span class="'+i+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+n+"</span>"),v(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.K2)(v,"applyStyle"),(0,s.K2)(x,"addHtmlLabel");var b=(0,s.K2)((async(t,e,r,n)=>{let i=t||"";if("object"===typeof i&&(i=i[0]),(0,s._3)((0,s.D7)().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),s.Rm.info("vertexText"+i);const t={isNode:n,label:(0,o.Sm)(i).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`)),labelStyle:e?e.replace("fill:","color:"):e};return await x(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let n=[];n="string"===typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[];for(const e of n){const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),r?n.setAttribute("class","title-row"):n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}return t}}),"createLabel"),_=(0,s.K2)(((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" ")),"createRoundedRectPathD"),w=(0,s.K2)((t=>{const{handDrawnSeed:e}=(0,s.D7)();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),k=(0,s.K2)((t=>{const e=T([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),T=(0,s.K2)((t=>{const e=new Map;return t.forEach((t=>{const[r,n]=t.split(":");e.set(r.trim(),n?.trim())})),e}),"styles2Map"),S=(0,s.K2)((t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t),"isLabelStyle"),A=(0,s.K2)((t=>{const{stylesArray:e}=k(t),r=[],n=[],i=[],a=[];return e.forEach((t=>{const e=t[0];S(e)?r.push(t.join(":")+" !important"):(n.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))})),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}}),"styles2String"),M=(0,s.K2)(((t,e)=>{const{themeVariables:r,handDrawnSeed:n}=(0,s.D7)(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=k(t);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),C=(0,s.K2)((async(t,e)=>{s.Rm.info("Creating subgraph rect for ",e.id,e);const r=(0,s.D7)(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:u,clusterBorder:h}=i,{labelStyles:d,nodeStyles:p,borderStyles:f,backgroundStyles:m}=A(e),g=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),v=(0,s._3)(r.flowchart.htmlLabels),x=g.insert("g").attr("class","cluster-label "),b=await(0,a.GZ)(x,e.label,{style:e.labelStyle,useHtmlLabels:v,isNode:!0});let w=b.getBBox();if((0,s._3)(r.flowchart.htmlLabels)){const t=b.children[0],e=(0,l.Ltv)(b);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}const k=e.width<=w.width+e.padding?w.width+e.padding:e.width;e.width<=w.width+e.padding?e.diff=(k-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height,S=e.x-k/2,C=e.y-T/2;let E;if(s.Rm.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=c.A.svg(g),r=M(e,{roughness:.7,fill:u,stroke:h,fillWeight:3,seed:o}),n=t.path(_(S,C,k,T,0),r);E=g.insert((()=>(s.Rm.debug("Rough node insert CXC",n),n)),":first-child"),E.select("path:nth-child(2)").attr("style",f.join(";")),E.select("path").attr("style",m.join(";").replace("fill","stroke"))}else E=g.insert("rect",":first-child"),E.attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",S).attr("y",C).attr("width",k).attr("height",T);const{subGraphTitleTopMargin:L}=(0,n.O)(r);if(x.attr("transform",`translate(${e.x-w.width/2}, ${e.y-e.height/2+L})`),d){const t=x.select("span");t&&t.attr("style",d)}const P=E.node().getBBox();return e.offsetX=0,e.width=P.width,e.height=P.height,e.offsetY=w.height-e.padding/2,e.intersect=function(t){return y(e,t)},{cluster:g,labelBBox:w}}),"rect"),E=(0,s.K2)(((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(t){return y(e,t)},{cluster:r,labelBBox:{width:0,height:0}}}),"noteGroup"),L=(0,s.K2)((async(t,e)=>{const r=(0,s.D7)(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:u,nodeBorder:h}=n,d=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),p=d.insert("g",":first-child"),f=d.insert("g").attr("class","cluster-label");let m=d.append("rect");const g=f.node().appendChild(await b(e.label,e.labelStyle,void 0,!0));let v=g.getBBox();if((0,s._3)(r.flowchart.htmlLabels)){const t=g.children[0],e=(0,l.Ltv)(g);v=t.getBoundingClientRect(),e.attr("width",v.width),e.attr("height",v.height)}const x=0*e.padding,w=x/2,k=(e.width<=v.width+e.padding?v.width+e.padding:e.width)+x;e.width<=v.width+e.padding?e.diff=(k-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+x,S=e.height+x-v.height-6,A=e.x-k/2,M=e.y-T/2;e.width=k;const C=e.y-e.height/2-w+v.height+2;let E;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),r=c.A.svg(d),n=e.rx||e.ry?r.path(_(A,M,k,T,10),{roughness:.7,fill:u,fillStyle:"solid",stroke:h,seed:i}):r.rectangle(A,M,k,T,{seed:i});E=d.insert((()=>n),":first-child");const s=r.rectangle(A,C,k,S,{fill:t?a:o,fillStyle:t?"hachure":"solid",stroke:h,seed:i});E=d.insert((()=>n),":first-child"),m=d.insert((()=>s))}else{E=p.insert("rect",":first-child");const t="outer";E.attr("class",t).attr("x",A).attr("y",M).attr("width",k).attr("height",T).attr("data-look",e.look),m.attr("class","inner").attr("x",A).attr("y",C).attr("width",k).attr("height",S)}f.attr("transform",`translate(${e.x-v.width/2}, ${M+1-((0,s._3)(r.flowchart.htmlLabels)?0:3)})`);const L=E.node().getBBox();return e.height=L.height,e.offsetX=0,e.offsetY=v.height-e.padding/2,e.labelBBox=v,e.intersect=function(t){return y(e,t)},{cluster:d,labelBBox:v}}),"roundedWithTitle"),P=(0,s.K2)((async(t,e)=>{s.Rm.info("Creating subgraph rect for ",e.id,e);const r=(0,s.D7)(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:u,clusterBorder:h}=i,{labelStyles:d,nodeStyles:p,borderStyles:f,backgroundStyles:m}=A(e),g=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),v=(0,s._3)(r.flowchart.htmlLabels),x=g.insert("g").attr("class","cluster-label "),b=await(0,a.GZ)(x,e.label,{style:e.labelStyle,useHtmlLabels:v,isNode:!0,width:e.width});let w=b.getBBox();if((0,s._3)(r.flowchart.htmlLabels)){const t=b.children[0],e=(0,l.Ltv)(b);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}const k=e.width<=w.width+e.padding?w.width+e.padding:e.width;e.width<=w.width+e.padding?e.diff=(k-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height,S=e.x-k/2,C=e.y-T/2;let E;if(s.Rm.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=c.A.svg(g),r=M(e,{roughness:.7,fill:u,stroke:h,fillWeight:4,seed:o}),n=t.path(_(S,C,k,T,e.rx),r);E=g.insert((()=>(s.Rm.debug("Rough node insert CXC",n),n)),":first-child"),E.select("path:nth-child(2)").attr("style",f.join(";")),E.select("path").attr("style",m.join(";").replace("fill","stroke"))}else E=g.insert("rect",":first-child"),E.attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",S).attr("y",C).attr("width",k).attr("height",T);const{subGraphTitleTopMargin:L}=(0,n.O)(r);if(x.attr("transform",`translate(${e.x-w.width/2}, ${e.y-e.height/2+L})`),d){const t=x.select("span");t&&t.attr("style",d)}const P=E.node().getBBox();return e.offsetX=0,e.width=P.width,e.height=P.height,e.offsetY=w.height-e.padding/2,e.intersect=function(t){return y(e,t)},{cluster:g,labelBBox:w}}),"kanbanSection"),I={rect:C,squareRect:C,roundedWithTitle:L,noteGroup:E,divider:(0,s.K2)(((t,e)=>{const r=(0,s.D7)(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),l=o.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;const d=e.height+u,p=e.x-h/2,f=e.y-d/2;let m;if(e.width=h,"handDrawn"===e.look){const t=c.A.svg(o).rectangle(p,f,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});m=o.insert((()=>t),":first-child")}else{m=l.insert("rect",":first-child");const t="divider";m.attr("class",t).attr("x",p).attr("y",f).attr("width",h).attr("height",d).attr("data-look",e.look)}const g=m.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return y(e,t)},{cluster:o,labelBBox:{}}}),"divider"),kanbanSection:P},z=new Map,O=(0,s.K2)((async(t,e)=>{const r=e.shape||"rect",n=await I[r](t,e);return z.set(e.id,n),n}),"insertCluster"),D=(0,s.K2)((()=>{z=new Map}),"clear");function R(t,e){return t.intersect(e)}(0,s.K2)(R,"intersectNode");var F=R;function B(t,e,r,n){var i=t.x,a=t.y,o=i-n.x,s=a-n.y,l=Math.sqrt(e*e*s*s+r*r*o*o),c=Math.abs(e*r*o/l);n.x<i&&(c=-c);var u=Math.abs(e*r*s/l);return n.y<a&&(u=-u),{x:i+c,y:a+u}}(0,s.K2)(B,"intersectEllipse");var j=B;function N(t,e,r){return j(t,e,e,r)}(0,s.K2)(N,"intersectCircle");var U=N;function V(t,e,r,n){var i,a,o,s,l,c,u,h,d,p,f,m,g;if(i=e.y-t.y,o=t.x-e.x,l=e.x*t.y-t.x*e.y,d=i*r.x+o*r.y+l,p=i*n.x+o*n.y+l,(0===d||0===p||!q(d,p))&&(a=n.y-r.y,s=r.x-n.x,c=n.x*r.y-r.x*n.y,u=a*t.x+s*t.y+c,h=a*e.x+s*e.y+c,(0===u||0===h||!q(u,h))&&0!==(f=i*s-a*o)))return m=Math.abs(f/2),{x:(g=o*c-s*l)<0?(g-m)/f:(g+m)/f,y:(g=a*l-i*c)<0?(g-m)/f:(g+m)/f}}function q(t,e){return t*e>0}(0,s.K2)(V,"intersectLine"),(0,s.K2)(q,"sameSign");var $=V;function H(t,e,r){let n=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"===typeof e.forEach?e.forEach((function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)})):(o=Math.min(o,e.x),s=Math.min(s,e.y));let l=n-t.width/2-o,c=i-t.height/2-s;for(let u=0;u<e.length;u++){let n=e[u],i=e[u<e.length-1?u+1:0],o=$(t,r,{x:l+n.x,y:c+n.y},{x:l+i.x,y:c+i.y});o&&a.push(o)}return a.length?(a.length>1&&a.sort((function(t,e){let n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),o=e.x-r.x,s=e.y-r.y,l=Math.sqrt(o*o+s*s);return a<l?-1:a===l?0:1})),a[0]):t}(0,s.K2)(H,"intersectPolygon");var W={node:F,circle:U,ellipse:j,polygon:H,rect:y};function G(t,e){const{labelStyles:r}=A(e);e.labelStyle=r;const n=p(e);let i=n;n||(i="anchor");const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:l}=e,u=c.A.svg(a),h=M(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(h.roughness=0);const f=u.circle(0,0,2,h),m=a.insert((()=>f),":first-child");return m.attr("class","anchor").attr("style",(0,o.KL)(l)),d(e,m),e.intersect=function(t){return s.Rm.info("Circle intersect",e,1,t),W.circle(e,1,t)},a}function Y(t,e,r,n,i,a,o){const s=(t+r)/2,l=(e+n)/2,c=Math.atan2(n-e,r-t),u=(r-t)/2/i,h=(n-e)/2/a,d=Math.sqrt(u**2+h**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-d**2),f=s+p*a*Math.sin(c)*(o?-1:1),m=l-p*i*Math.cos(c)*(o?-1:1),g=Math.atan2((e-m)/a,(t-f)/i);let y=Math.atan2((n-m)/a,(r-f)/i)-g;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);const v=[];for(let x=0;x<20;x++){const t=g+x/19*y,e=f+i*Math.cos(t),r=m+a*Math.sin(t);v.push({x:e,y:r})}return v}async function Z(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=a.width+e.padding+20,s=a.height+e.padding,l=s/2,h=l/(2.5+s/50),{cssStyles:m}=e,g=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...Y(-o/2,-s/2,-o/2,s/2,h,l,!1),{x:o/2,y:s/2},...Y(o/2,s/2,o/2,-s/2,h,l,!0)],y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=f(g),b=y.path(x,v),_=i.insert((()=>b),":first-child");return _.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${h/2}, 0)`),d(e,_),e.intersect=function(t){return W.polygon(e,g,t)},i}function X(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}async function K(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=a.height+e.padding,s=a.width+e.padding+12,l=-o,h=[{x:12,y:l},{x:s,y:l},{x:s,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let m;const{cssStyles:g}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=f(h),a=t.path(n,r);m=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),g&&m.attr("style",g)}else m=X(i,s,o,h);return n&&m.attr("style",n),d(e,m),e.intersect=function(t){return W.polygon(e,h,t)},i}function J(t,e){const{nodeStyles:r}=A(e);e.label="";const n=t.insert("g").attr("class",p(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=c.A.svg(n),l=M(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const u=f(o),h=s.path(u,l),d=n.insert((()=>h),":first-child");return i&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",i),r&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(t){return W.polygon(e,o,t)},n}async function Q(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:l}=await u(t,e,p(e)),h=a.width/2+l;let f;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=t.circle(0,0,2*h,r);f=i.insert((()=>n),":first-child"),f.attr("class","basic label-container").attr("style",(0,o.KL)(m))}else f=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0);return d(e,f),e.intersect=function(t){return s.Rm.info("Circle intersect",e,h,t),W.circle(e,h,t)},i}function tt(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=2*t;return`M ${-n/2*e},${n/2*r} L ${n/2*e},${-n/2*r}\n M ${n/2*e},${n/2*r} L ${-n/2*e},${-n/2*r}`}function et(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",p(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:o}=e,l=c.A.svg(i),u=M(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");const h=l.circle(0,0,2*a,u),f=tt(a),m=l.path(f,u),g=i.insert((()=>h),":first-child");return g.insert((()=>m)),o&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",o),n&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",n),d(e,g),e.intersect=function(t){s.Rm.info("crossedCircle intersect",e,{radius:a,point:t});return W.circle(e,a,t)},i}function rt(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:180;const a=[],o=(arguments.length>4&&void 0!==arguments[4]?arguments[4]:0)*Math.PI/180,s=(i*Math.PI/180-o)/(n-1);for(let l=0;l<n;l++){const n=o+l*s,i=t+r*Math.cos(n),c=e+r*Math.sin(n);a.push({x:-i,y:-c})}return a}async function nt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,.1*l),{cssStyles:m}=e,g=[...rt(s/2,-l/2,h,30,-90,0),{x:-s/2-h,y:h},...rt(s/2+2*h,-h,h,20,-180,-270),...rt(s/2+2*h,h,h,20,-90,-180),{x:-s/2-h,y:-l/2},...rt(s/2,l/2,h,20,0,90)],y=[{x:s/2,y:-l/2-h},{x:-s/2,y:-l/2-h},...rt(s/2,-l/2,h,20,-90,0),{x:-s/2-h,y:-h},...rt(s/2+.1*s,-h,h,20,-180,-270),...rt(s/2+.1*s,h,h,20,-90,-180),{x:-s/2-h,y:l/2},...rt(s/2,l/2,h,20,0,90),{x:-s/2,y:l/2+h},{x:s/2,y:l/2+h}],v=c.A.svg(i),x=M(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=f(g).replace("Z",""),_=v.path(b,x),w=f(y),k=v.path(w,{...x}),T=i.insert("g",":first-child");return T.insert((()=>k),":first-child").attr("stroke-opacity",0),T.insert((()=>_),":first-child"),T.attr("class","text"),m&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${h}, 0)`),o.attr("transform",`translate(${-s/2+h-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),d(e,T),e.intersect=function(t){return W.polygon(e,y,t)},i}function it(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:180;const a=[],o=(arguments.length>4&&void 0!==arguments[4]?arguments[4]:0)*Math.PI/180,s=(i*Math.PI/180-o)/(n-1);for(let l=0;l<n;l++){const n=o+l*s,i=t+r*Math.cos(n),c=e+r*Math.sin(n);a.push({x:i,y:c})}return a}async function at(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,.1*l),{cssStyles:m}=e,g=[...it(s/2,-l/2,h,20,-90,0),{x:s/2+h,y:-h},...it(s/2+2*h,-h,h,20,-180,-270),...it(s/2+2*h,h,h,20,-90,-180),{x:s/2+h,y:l/2},...it(s/2,l/2,h,20,0,90)],y=[{x:-s/2,y:-l/2-h},{x:s/2,y:-l/2-h},...it(s/2,-l/2,h,20,-90,0),{x:s/2+h,y:-h},...it(s/2+2*h,-h,h,20,-180,-270),...it(s/2+2*h,h,h,20,-90,-180),{x:s/2+h,y:l/2},...it(s/2,l/2,h,20,0,90),{x:s/2,y:l/2+h},{x:-s/2,y:l/2+h}],v=c.A.svg(i),x=M(e,{fill:"none"});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=f(g).replace("Z",""),_=v.path(b,x),w=f(y),k=v.path(w,{...x}),T=i.insert("g",":first-child");return T.insert((()=>k),":first-child").attr("stroke-opacity",0),T.insert((()=>_),":first-child"),T.attr("class","text"),m&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${-h}, 0)`),o.attr("transform",`translate(${-s/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),d(e,T),e.intersect=function(t){return W.polygon(e,y,t)},i}function ot(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:180;const a=[],o=(arguments.length>4&&void 0!==arguments[4]?arguments[4]:0)*Math.PI/180,s=(i*Math.PI/180-o)/(n-1);for(let l=0;l<n;l++){const n=o+l*s,i=t+r*Math.cos(n),c=e+r*Math.sin(n);a.push({x:-i,y:-c})}return a}async function st(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,.1*l),{cssStyles:m}=e,g=[...ot(s/2,-l/2,h,30,-90,0),{x:-s/2-h,y:h},...ot(s/2+2*h,-h,h,20,-180,-270),...ot(s/2+2*h,h,h,20,-90,-180),{x:-s/2-h,y:-l/2},...ot(s/2,l/2,h,20,0,90)],y=[...ot(-s/2+h+h/2,-l/2,h,20,-90,-180),{x:s/2-h/2,y:h},...ot(-s/2-h/2,-h,h,20,0,90),...ot(-s/2-h/2,h,h,20,-90,0),{x:s/2-h/2,y:-h},...ot(-s/2+h+h/2,l/2,h,30,-180,-270)],v=[{x:s/2,y:-l/2-h},{x:-s/2,y:-l/2-h},...ot(s/2,-l/2,h,20,-90,0),{x:-s/2-h,y:-h},...ot(s/2+2*h,-h,h,20,-180,-270),...ot(s/2+2*h,h,h,20,-90,-180),{x:-s/2-h,y:l/2},...ot(s/2,l/2,h,20,0,90),{x:-s/2,y:l/2+h},{x:s/2-h-h/2,y:l/2+h},...ot(-s/2+h+h/2,-l/2,h,20,-90,-180),{x:s/2-h/2,y:h},...ot(-s/2-h/2,-h,h,20,0,90),...ot(-s/2-h/2,h,h,20,-90,0),{x:s/2-h/2,y:-h},...ot(-s/2+h+h/2,l/2,h,30,-180,-270)],x=c.A.svg(i),b=M(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const _=f(g).replace("Z",""),w=x.path(_,b),k=f(y).replace("Z",""),T=x.path(k,b),S=f(v),C=x.path(S,{...b}),E=i.insert("g",":first-child");return E.insert((()=>C),":first-child").attr("stroke-opacity",0),E.insert((()=>w),":first-child"),E.insert((()=>T),":first-child"),E.attr("class","text"),m&&"handDrawn"!==e.look&&E.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${h-h/4}, 0)`),o.attr("transform",`translate(${-s/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),d(e,E),e.intersect=function(t){return W.polygon(e,v,t)},i}async function lt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(80,1.25*(a.width+2*(e.padding??0)),e?.width??0),s=Math.max(20,a.height+2*(e.padding??0),e?.height??0),l=s/2,{cssStyles:h}=e,m=c.A.svg(i),y=M(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const v=o-l,x=s/4,b=[{x:v,y:0},{x:x,y:0},{x:0,y:s/2},{x:x,y:s},{x:v,y:s},...g(-v,-s/2,l,50,270,90)],_=f(b),w=m.path(_,y),k=i.insert((()=>w),":first-child");return k.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",h),n&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",n),k.attr("transform",`translate(${-o/2}, ${-s/2})`),d(e,k),e.intersect=function(t){return W.polygon(e,b,t)},i}(0,s.K2)(G,"anchor"),(0,s.K2)(Y,"generateArcPoints"),(0,s.K2)(Z,"bowTieRect"),(0,s.K2)(X,"insertPolygonShape"),(0,s.K2)(K,"card"),(0,s.K2)(J,"choice"),(0,s.K2)(Q,"circle"),(0,s.K2)(tt,"createLine"),(0,s.K2)(et,"crossedCircle"),(0,s.K2)(rt,"generateCirclePoints"),(0,s.K2)(nt,"curlyBraceLeft"),(0,s.K2)(it,"generateCirclePoints"),(0,s.K2)(at,"curlyBraceRight"),(0,s.K2)(ot,"generateCirclePoints"),(0,s.K2)(st,"curlyBraces"),(0,s.K2)(lt,"curvedTrapezoid");var ct=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createCylinderPathD"),ut=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createOuterCylinderPathD"),ht=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function dt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await u(t,e,p(e)),l=Math.max(a.width+e.padding,e.width??0),h=l/2,f=h/(2.5+l/50),m=Math.max(a.height+f+e.padding,e.height??0);let g;const{cssStyles:y}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=ut(0,0,l,m,h,f),n=ht(0,f,l,m,h,f),a=t.path(r,M(e,{})),o=t.path(n,M(e,{fill:"none"}));g=i.insert((()=>o),":first-child"),g=i.insert((()=>a),":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else{const t=ct(0,0,l,m,h,f);g=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,o.KL)(y)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-l/2}, ${-(m/2+f)})`),d(e,g),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(t){const r=W.rect(e,t),n=r.x-(e.x??0);if(0!=h&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-f)){let i=f*f*(1-n*n/(h*h));i>0&&(i=Math.sqrt(i)),i=f-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function pt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=a.width+e.padding,l=a.height+e.padding,h=.2*l,f=-s/2,m=-l/2-h/2,{cssStyles:g}=e,y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=[{x:f,y:m+h},{x:-f,y:m+h},{x:-f,y:-m},{x:f,y:-m},{x:f,y:m},{x:-f,y:m},{x:-f,y:m+h}],b=y.polygon(x.map((t=>[t.x,t.y])),v),_=i.insert((()=>b),":first-child");return _.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",g),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),o.attr("transform",`translate(${f+(e.padding??0)/2-(a.x-(a.left??0))}, ${m+h+(e.padding??0)/2-(a.y-(a.top??0))})`),d(e,_),e.intersect=function(t){return W.rect(e,t)},i}async function ft(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:l}=await u(t,e,p(e)),h=a.width/2+l+5,f=a.width/2+l;let m;const{cssStyles:g}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{roughness:.2,strokeWidth:2.5}),n=M(e,{roughness:.2,strokeWidth:1.5}),a=t.circle(0,0,2*h,r),s=t.circle(0,0,2*f,n);m=i.insert("g",":first-child"),m.attr("class",(0,o.KL)(e.cssClasses)).attr("style",(0,o.KL)(g)),m.node()?.appendChild(a),m.node()?.appendChild(s)}else{m=i.insert("g",":first-child");const t=m.insert("circle",":first-child"),e=m.insert("circle");m.attr("class","basic label-container").attr("style",n),t.attr("class","outer-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",n).attr("r",f).attr("cx",0).attr("cy",0)}return d(e,m),e.intersect=function(t){return s.Rm.info("DoubleCircle intersect",e,h,t),W.circle(e,h,t)},i}function mt(t,e,r){let{config:{themeVariables:n}}=r;const{labelStyles:i,nodeStyles:a}=A(e);e.label="",e.labelStyle=i;const o=t.insert("g").attr("class",p(e)).attr("id",e.domId??e.id),{cssStyles:l}=e,u=c.A.svg(o),{nodeBorder:h}=n,f=M(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);const m=u.circle(0,0,14,f),g=o.insert((()=>m),":first-child");return g.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",l),a&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",a),d(e,g),e.intersect=function(t){s.Rm.info("filledCircle intersect",e,{radius:7,point:t});return W.circle(e,7,t)},o}async function gt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),l=a.width+(e.padding??0),h=l+a.height,m=l+a.height,g=[{x:0,y:-h},{x:m,y:-h},{x:m/2,y:0}],{cssStyles:y}=e,v=c.A.svg(i),x=M(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=f(g),_=v.path(b,x),w=i.insert((()=>_),":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return y&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",y),n&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",n),e.width=l,e.height=h,d(e,w),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-h/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(t){return s.Rm.info("Triangle intersect",e,g,t),W.polygon(e,g,t)},i}function yt(t,e,r){let{dir:n,config:{state:i,themeVariables:a}}=r;const{nodeStyles:o}=A(e);e.label="";const s=t.insert("g").attr("class",p(e)).attr("id",e.domId??e.id),{cssStyles:l}=e;let u=Math.max(70,e?.width??0),h=Math.max(10,e?.height??0);"LR"===n&&(u=Math.max(10,e?.width??0),h=Math.max(70,e?.height??0));const f=-1*u/2,m=-1*h/2,g=c.A.svg(s),y=M(e,{stroke:a.lineColor,fill:a.lineColor});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const v=g.rectangle(f,m,u,h,y),x=s.insert((()=>v),":first-child");l&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",l),o&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",o),d(e,x);const b=i?.padding??0;return e.width&&e.height&&(e.width+=b/2||0,e.height+=b/2||0),e.intersect=function(t){return W.rect(e,t)},s}async function vt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(80,a.width+2*(e.padding??0),e?.width??0),l=Math.max(50,a.height+2*(e.padding??0),e?.height??0),h=l/2,{cssStyles:m}=e,y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=[{x:-o/2,y:-l/2},{x:o/2-h,y:-l/2},...g(-o/2+h,0,h,50,90,270),{x:o/2-h,y:l/2},{x:-o/2,y:l/2}],b=f(x),_=y.path(b,v),w=i.insert((()=>_),":first-child");return w.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",m),n&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",n),d(e,w),e.intersect=function(t){s.Rm.info("Pill intersect",e,{radius:h,point:t});return W.polygon(e,x,t)},i}(0,s.K2)(dt,"cylinder"),(0,s.K2)(pt,"dividedRectangle"),(0,s.K2)(ft,"doublecircle"),(0,s.K2)(mt,"filledCircle"),(0,s.K2)(gt,"flippedTriangle"),(0,s.K2)(yt,"forkJoin"),(0,s.K2)(vt,"halfRoundedRectangle");var xt=(0,s.K2)(((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" ")),"createHexagonPathD");async function bt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=a.height+e.padding,s=o/4,l=a.width+2*s+e.padding,h=[{x:s,y:0},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:s,y:-o},{x:0,y:-o/2}];let f;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=xt(0,0,l,o,s),a=t.path(n,r);f=i.insert((()=>a),":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),m&&f.attr("style",m)}else f=X(i,l,o,h);return n&&f.attr("style",n),e.width=l,e.height=o,d(e,f),e.intersect=function(t){return W.polygon(e,h,t)},i}async function _t(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await u(t,e,p(e)),a=Math.max(30,e?.width??0),o=Math.max(30,e?.height??0),{cssStyles:l}=e,h=c.A.svg(i),m=M(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");const g=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],y=f(g),v=h.path(y,m),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),n&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",n),x.attr("transform",`translate(${-a/2}, ${-o/2})`),d(e,x),e.intersect=function(t){s.Rm.info("Pill intersect",e,{points:g});return W.polygon(e,g,t)},i}async function wt(t,e,r){let{config:{themeVariables:n,flowchart:a}}=r;const{labelStyles:o}=A(e);e.labelStyle=o;const l=e.assetHeight??48,h=e.assetWidth??48,p=Math.max(l,h),f=a?.wrappingWidth;e.width=Math.max(p,f??0);const{shapeSvg:m,bbox:g,label:y}=await u(t,e,"icon-shape default"),v="t"===e.pos,x=p,b=p,{nodeBorder:_}=n,{stylesMap:w}=k(e),T=-b/2,S=-x/2,C=e.label?8:0,E=c.A.svg(m),L=M(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(L.roughness=0,L.fillStyle="solid");const P=E.rectangle(T,S,b,x,L),I=Math.max(b,g.width),z=x+g.height+C,O=E.rectangle(-I/2,-z/2,I,z,{...L,fill:"transparent",stroke:"none"}),D=m.insert((()=>P),":first-child"),R=m.insert((()=>O));if(e.icon){const t=m.append("g");t.html(`<g>${await(0,i.WY)(e.icon,{height:p,width:p,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,a=r.height,o=r.x,s=r.y;t.attr("transform",`translate(${-n/2-o},${v?g.height/2+C/2-a/2-s:-g.height/2-C/2-a/2-s})`),t.attr("style",`color: ${w.get("stroke")??_};`)}return y.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${v?-z/2:z/2-g.height})`),D.attr("transform",`translate(0,${v?g.height/2+C/2:-g.height/2-C/2})`),d(e,R),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return W.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=v?[{x:r-g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2+g.height+C},{x:r+b/2,y:n-i/2+g.height+C},{x:r+b/2,y:n+i/2},{x:r-b/2,y:n+i/2},{x:r-b/2,y:n-i/2+g.height+C},{x:r-g.width/2,y:n-i/2+g.height+C}]:[{x:r-b/2,y:n-i/2},{x:r+b/2,y:n-i/2},{x:r+b/2,y:n-i/2+x},{x:r+g.width/2,y:n-i/2+x},{x:r+g.width/2/2,y:n+i/2},{x:r-g.width/2,y:n+i/2},{x:r-g.width/2,y:n-i/2+x},{x:r-b/2,y:n-i/2+x}];return W.polygon(e,a,t)},m}async function kt(t,e,r){let{config:{themeVariables:n,flowchart:a}}=r;const{labelStyles:o}=A(e);e.labelStyle=o;const l=e.assetHeight??48,h=e.assetWidth??48,p=Math.max(l,h),f=a?.wrappingWidth;e.width=Math.max(p,f??0);const{shapeSvg:m,bbox:g,label:y}=await u(t,e,"icon-shape default"),v=e.label?8:0,x="t"===e.pos,{nodeBorder:b,mainBkg:_}=n,{stylesMap:w}=k(e),T=c.A.svg(m),S=M(e,{});"handDrawn"!==e.look&&(S.roughness=0,S.fillStyle="solid");const C=w.get("fill");S.stroke=C??_;const E=m.append("g");e.icon&&E.html(`<g>${await(0,i.WY)(e.icon,{height:p,width:p,fallbackPrefix:""})}</g>`);const L=E.node().getBBox(),P=L.width,I=L.height,z=L.x,O=L.y,D=Math.max(P,I)*Math.SQRT2+40,R=T.circle(0,0,D,S),F=Math.max(D,g.width),B=D+g.height+v,j=T.rectangle(-F/2,-B/2,F,B,{...S,fill:"transparent",stroke:"none"}),N=m.insert((()=>R),":first-child"),U=m.insert((()=>j));return E.attr("transform",`translate(${-P/2-z},${x?g.height/2+v/2-I/2-O:-g.height/2-v/2-I/2-O})`),E.attr("style",`color: ${w.get("stroke")??b};`),y.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${x?-B/2:B/2-g.height})`),N.attr("transform",`translate(0,${x?g.height/2+v/2:-g.height/2-v/2})`),d(e,U),e.intersect=function(t){s.Rm.info("iconSquare intersect",e,t);return W.rect(e,t)},m}async function Tt(t,e,r){let{config:{themeVariables:n,flowchart:a}}=r;const{labelStyles:o}=A(e);e.labelStyle=o;const l=e.assetHeight??48,h=e.assetWidth??48,p=Math.max(l,h),f=a?.wrappingWidth;e.width=Math.max(p,f??0);const{shapeSvg:m,bbox:g,halfPadding:y,label:v}=await u(t,e,"icon-shape default"),x="t"===e.pos,b=p+2*y,w=p+2*y,{nodeBorder:T,mainBkg:S}=n,{stylesMap:C}=k(e),E=-w/2,L=-b/2,P=e.label?8:0,I=c.A.svg(m),z=M(e,{});"handDrawn"!==e.look&&(z.roughness=0,z.fillStyle="solid");const O=C.get("fill");z.stroke=O??S;const D=I.path(_(E,L,w,b,5),z),R=Math.max(w,g.width),F=b+g.height+P,B=I.rectangle(-R/2,-F/2,R,F,{...z,fill:"transparent",stroke:"none"}),j=m.insert((()=>D),":first-child").attr("class","icon-shape2"),N=m.insert((()=>B));if(e.icon){const t=m.append("g");t.html(`<g>${await(0,i.WY)(e.icon,{height:p,width:p,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,a=r.height,o=r.x,s=r.y;t.attr("transform",`translate(${-n/2-o},${x?g.height/2+P/2-a/2-s:-g.height/2-P/2-a/2-s})`),t.attr("style",`color: ${C.get("stroke")??T};`)}return v.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${x?-F/2:F/2-g.height})`),j.attr("transform",`translate(0,${x?g.height/2+P/2:-g.height/2-P/2})`),d(e,N),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return W.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=x?[{x:r-g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2+g.height+P},{x:r+w/2,y:n-i/2+g.height+P},{x:r+w/2,y:n+i/2},{x:r-w/2,y:n+i/2},{x:r-w/2,y:n-i/2+g.height+P},{x:r-g.width/2,y:n-i/2+g.height+P}]:[{x:r-w/2,y:n-i/2},{x:r+w/2,y:n-i/2},{x:r+w/2,y:n-i/2+b},{x:r+g.width/2,y:n-i/2+b},{x:r+g.width/2/2,y:n+i/2},{x:r-g.width/2,y:n+i/2},{x:r-g.width/2,y:n-i/2+b},{x:r-w/2,y:n-i/2+b}];return W.polygon(e,a,t)},m}async function St(t,e,r){let{config:{themeVariables:n,flowchart:a}}=r;const{labelStyles:o}=A(e);e.labelStyle=o;const l=e.assetHeight??48,h=e.assetWidth??48,p=Math.max(l,h),f=a?.wrappingWidth;e.width=Math.max(p,f??0);const{shapeSvg:m,bbox:g,halfPadding:y,label:v}=await u(t,e,"icon-shape default"),x="t"===e.pos,b=p+2*y,w=p+2*y,{nodeBorder:T,mainBkg:S}=n,{stylesMap:C}=k(e),E=-w/2,L=-b/2,P=e.label?8:0,I=c.A.svg(m),z=M(e,{});"handDrawn"!==e.look&&(z.roughness=0,z.fillStyle="solid");const O=C.get("fill");z.stroke=O??S;const D=I.path(_(E,L,w,b,.1),z),R=Math.max(w,g.width),F=b+g.height+P,B=I.rectangle(-R/2,-F/2,R,F,{...z,fill:"transparent",stroke:"none"}),j=m.insert((()=>D),":first-child"),N=m.insert((()=>B));if(e.icon){const t=m.append("g");t.html(`<g>${await(0,i.WY)(e.icon,{height:p,width:p,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,a=r.height,o=r.x,s=r.y;t.attr("transform",`translate(${-n/2-o},${x?g.height/2+P/2-a/2-s:-g.height/2-P/2-a/2-s})`),t.attr("style",`color: ${C.get("stroke")??T};`)}return v.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${x?-F/2:F/2-g.height})`),j.attr("transform",`translate(0,${x?g.height/2+P/2:-g.height/2-P/2})`),d(e,N),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return W.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=x?[{x:r-g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2},{x:r+g.width/2,y:n-i/2+g.height+P},{x:r+w/2,y:n-i/2+g.height+P},{x:r+w/2,y:n+i/2},{x:r-w/2,y:n+i/2},{x:r-w/2,y:n-i/2+g.height+P},{x:r-g.width/2,y:n-i/2+g.height+P}]:[{x:r-w/2,y:n-i/2},{x:r+w/2,y:n-i/2},{x:r+w/2,y:n-i/2+b},{x:r+g.width/2,y:n-i/2+b},{x:r+g.width/2/2,y:n+i/2},{x:r-g.width/2,y:n+i/2},{x:r-g.width/2,y:n-i/2+b},{x:r-w/2,y:n-i/2+b}];return W.polygon(e,a,t)},m}async function At(t,e,r){let{config:{flowchart:n}}=r;const i=new Image;i.src=e?.img??"",await i.decode();const a=Number(i.naturalWidth.toString().replace("px","")),o=Number(i.naturalHeight.toString().replace("px",""));e.imageAspectRatio=a/o;const{labelStyles:l}=A(e);e.labelStyle=l;const h=n?.wrappingWidth;e.defaultWidth=n?.wrappingWidth;const p=Math.max(e.label?h??0:0,e?.assetWidth??a),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:p,m="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??o;e.width=Math.max(f,h??0);const{shapeSvg:g,bbox:y,label:v}=await u(t,e,"image-shape default"),x="t"===e.pos,b=-f/2,_=-m/2,w=e.label?8:0,k=c.A.svg(g),T=M(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid");const S=k.rectangle(b,_,f,m,T),C=Math.max(f,y.width),E=m+y.height+w,L=k.rectangle(-C/2,-E/2,C,E,{...T,fill:"none",stroke:"none"}),P=g.insert((()=>S),":first-child"),I=g.insert((()=>L));if(e.img){const t=g.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",m),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${x?E/2-m:-E/2})`)}return v.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${x?-m/2-y.height/2-w/2:m/2-y.height/2+w/2})`),P.attr("transform",`translate(0,${x?y.height/2+w/2:-y.height/2-w/2})`),d(e,I),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return W.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=x?[{x:r-y.width/2,y:n-i/2},{x:r+y.width/2,y:n-i/2},{x:r+y.width/2,y:n-i/2+y.height+w},{x:r+f/2,y:n-i/2+y.height+w},{x:r+f/2,y:n+i/2},{x:r-f/2,y:n+i/2},{x:r-f/2,y:n-i/2+y.height+w},{x:r-y.width/2,y:n-i/2+y.height+w}]:[{x:r-f/2,y:n-i/2},{x:r+f/2,y:n-i/2},{x:r+f/2,y:n-i/2+m},{x:r+y.width/2,y:n-i/2+m},{x:r+y.width/2/2,y:n+i/2},{x:r-y.width/2,y:n+i/2},{x:r-y.width/2,y:n-i/2+m},{x:r-f/2,y:n-i/2+m}];return W.polygon(e,a,t)},g}async function Mt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),s=Math.max(a.height+2*(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let h;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=f(l),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),m&&h.attr("style",m)}else h=X(i,o,s,l);return n&&h.attr("style",n),e.width=o,e.height=s,d(e,h),e.intersect=function(t){return W.polygon(e,l,t)},i}async function Ct(t,e,r){const{labelStyles:n,nodeStyles:i}=A(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await u(t,e,p(e)),l=Math.max(s.width+2*r.labelPaddingX,e?.width||0),h=Math.max(s.height+2*r.labelPaddingY,e?.height||0),f=-l/2,m=-h/2;let g,{rx:y,ry:v}=e;const{cssStyles:x}=e;if(r?.rx&&r.ry&&(y=r.rx,v=r.ry),"handDrawn"===e.look){const t=c.A.svg(a),r=M(e,{}),n=y||v?t.path(_(f,m,l,h,y||0),r):t.rectangle(f,m,l,h,r);g=a.insert((()=>n),":first-child"),g.attr("class","basic label-container").attr("style",(0,o.KL)(x))}else g=a.insert("rect",":first-child"),g.attr("class","basic label-container").attr("style",i).attr("rx",(0,o.KL)(y)).attr("ry",(0,o.KL)(v)).attr("x",f).attr("y",m).attr("width",l).attr("height",h);return d(e,g),e.intersect=function(t){return W.rect(e,t)},a}async function Et(t,e){const{shapeSvg:r,bbox:n,label:i}=await u(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-n.height/2-(n.y-(n.top??0))})`),d(e,a),e.intersect=function(t){return W.rect(e,t)},r}async function Lt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+(e.padding??0),e?.width??0),s=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-3*s/6,y:-s}];let h;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=f(l),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),m&&h.attr("style",m)}else h=X(i,o,s,l);return n&&h.attr("style",n),e.width=o,e.height=s,d(e,h),e.intersect=function(t){return W.polygon(e,l,t)},i}async function Pt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+(e.padding??0),e?.width??0),s=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let h;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=f(l),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),m&&h.attr("style",m)}else h=X(i,o,s,l);return n&&h.attr("style",n),e.width=o,e.height=s,d(e,h),e.intersect=function(t){return W.polygon(e,l,t)},i}function It(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",p(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=Math.max(35,e?.width??0),l=Math.max(35,e?.height??0),u=[{x:o,y:0},{x:0,y:l+3.5},{x:o-14,y:l+3.5},{x:0,y:2*l},{x:o,y:l-3.5},{x:14,y:l-3.5}],h=c.A.svg(i),m=M(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");const g=f(u),y=h.path(g,m),v=i.insert((()=>y),":first-child");return a&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",a),n&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(-${o/2},${-l})`),d(e,v),e.intersect=function(t){s.Rm.info("lightningBolt intersect",e,t);return W.polygon(e,u,t)},i}(0,s.K2)(bt,"hexagon"),(0,s.K2)(_t,"hourglass"),(0,s.K2)(wt,"icon"),(0,s.K2)(kt,"iconCircle"),(0,s.K2)(Tt,"iconRounded"),(0,s.K2)(St,"iconSquare"),(0,s.K2)(At,"imageSquare"),(0,s.K2)(Mt,"inv_trapezoid"),(0,s.K2)(Ct,"drawRect"),(0,s.K2)(Et,"labelRect"),(0,s.K2)(Lt,"lean_left"),(0,s.K2)(Pt,"lean_right"),(0,s.K2)(It,"lightningBolt");var zt=(0,s.K2)(((t,e,r,n,i,a,o)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createCylinderPathD"),Ot=(0,s.K2)(((t,e,r,n,i,a,o)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createOuterCylinderPathD"),Dt=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function Rt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await u(t,e,p(e)),l=Math.max(a.width+(e.padding??0),e.width??0),h=l/2,f=h/(2.5+l/50),m=Math.max(a.height+f+(e.padding??0),e.height??0),g=.1*m;let y;const{cssStyles:v}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=Ot(0,0,l,m,h,f,g),n=Dt(0,f,l,m,h,f),a=M(e,{}),o=t.path(r,a),s=t.path(n,a);i.insert((()=>s),":first-child").attr("class","line"),y=i.insert((()=>o),":first-child"),y.attr("class","basic label-container"),v&&y.attr("style",v)}else{const t=zt(0,0,l,m,h,f,g);y=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,o.KL)(v)).attr("style",n)}return y.attr("label-offset-y",f),y.attr("transform",`translate(${-l/2}, ${-(m/2+f)})`),d(e,y),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2+f-(a.y-(a.top??0))})`),e.intersect=function(t){const r=W.rect(e,t),n=r.x-(e.x??0);if(0!=h&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-f)){let i=f*f*(1-n*n/(h*h));i>0&&(i=Math.sqrt(i)),i=f-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function Ft(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=l/4,f=l+h,{cssStyles:g}=e,y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=[{x:-s/2-s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:f/2},...m(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,h,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2},{x:-s/2,y:-f/2},{x:-s/2,y:f/2*1.1},{x:-s/2,y:-f/2}],b=y.polygon(x.map((t=>[t.x,t.y])),v),_=i.insert((()=>b),":first-child");return _.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",g),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),d(e,_),e.intersect=function(t){return W.polygon(e,x,t)},i}async function Bt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-s/2,m=-l/2,{cssStyles:g}=e,y=c.A.svg(i),v=M(e,{}),x=[{x:h-5,y:m+5},{x:h-5,y:m+l+5},{x:h+s-5,y:m+l+5},{x:h+s-5,y:m+l},{x:h+s,y:m+l},{x:h+s,y:m+l-5},{x:h+s+5,y:m+l-5},{x:h+s+5,y:m-5},{x:h+5,y:m-5},{x:h+5,y:m},{x:h,y:m},{x:h,y:m+5}],b=[{x:h,y:m+5},{x:h+s-5,y:m+5},{x:h+s-5,y:m+l},{x:h+s,y:m+l},{x:h+s,y:m},{x:h,y:m}];"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const _=f(x),w=y.path(_,v),k=f(b),T=y.path(k,{...v,fill:"none"}),S=i.insert((()=>T),":first-child");return S.insert((()=>w),":first-child"),S.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",g),n&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",n),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),d(e,S),e.intersect=function(t){return W.polygon(e,x,t)},i}async function jt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=l/4,g=l+h,y=-s/2,v=-g/2,{cssStyles:x}=e,b=m(y-5,v+g+5,y+s-5,v+g+5,h,.8),_=b?.[b.length-1],w=[{x:y-5,y:v+5},{x:y-5,y:v+g+5},...b,{x:y+s-5,y:_.y-5},{x:y+s,y:_.y-5},{x:y+s,y:_.y-10},{x:y+s+5,y:_.y-10},{x:y+s+5,y:v-5},{x:y+5,y:v-5},{x:y+5,y:v},{x:y,y:v},{x:y,y:v+5}],k=[{x:y,y:v+5},{x:y+s-5,y:v+5},{x:y+s-5,y:_.y-5},{x:y+s,y:_.y-5},{x:y+s,y:v},{x:y,y:v}],T=c.A.svg(i),S=M(e,{});"handDrawn"!==e.look&&(S.roughness=0,S.fillStyle="solid");const C=f(w),E=T.path(C,S),L=f(k),P=T.path(L,S),I=i.insert((()=>E),":first-child");return I.insert((()=>P)),I.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&I.selectAll("path").attr("style",x),n&&"handDrawn"!==e.look&&I.selectAll("path").attr("style",n),I.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-h/2-(a.y-(a.top??0))})`),d(e,I),e.intersect=function(t){return W.polygon(e,w,t)},i}async function Nt(t,e,r){let{config:{themeVariables:n}}=r;const{labelStyles:i,nodeStyles:a}=A(e);e.labelStyle=i;e.useHtmlLabels||!1!==(0,s.zj)().flowchart?.htmlLabels||(e.centerLabel=!0);const{shapeSvg:o,bbox:l}=await u(t,e,p(e)),h=Math.max(l.width+2*(e.padding??0),e?.width??0),f=Math.max(l.height+2*(e.padding??0),e?.height??0),m=-h/2,g=-f/2,{cssStyles:y}=e,v=c.A.svg(o),x=M(e,{fill:n.noteBkgColor,stroke:n.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=v.rectangle(m,g,h,f,x),_=o.insert((()=>b),":first-child");return _.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",y),a&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",a),d(e,_),e.intersect=function(t){return W.rect(e,t)},o}(0,s.K2)(Rt,"linedCylinder"),(0,s.K2)(Ft,"linedWaveEdgedRect"),(0,s.K2)(Bt,"multiRect"),(0,s.K2)(jt,"multiWaveEdgedRectangle"),(0,s.K2)(Nt,"note");var Ut=(0,s.K2)(((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function Vt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=a.width+e.padding+(a.height+e.padding),l=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];let h;const{cssStyles:f}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=Ut(0,0,o),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${o/2})`),f&&h.attr("style",f)}else h=X(i,o,o,l);return n&&h.attr("style",n),d(e,h),e.intersect=function(t){return s.Rm.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",W.polygon(e,l,t)),W.polygon(e,l,t)},i}async function qt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=-Math.max(a.width+(e.padding??0),e?.width??0)/2,l=-Math.max(a.height+(e.padding??0),e?.height??0)/2,h=l/2,m=[{x:s+h,y:l},{x:s,y:0},{x:s+h,y:-l},{x:-s,y:-l},{x:-s,y:l}],{cssStyles:g}=e,y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=f(m),b=y.path(x,v),_=i.insert((()=>b),":first-child");return _.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",g),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${-h/2},0)`),o.attr("transform",`translate(${-h/2-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),d(e,_),e.intersect=function(t){return W.polygon(e,m,t)},i}async function $t(t,e){const{labelStyles:r,nodeStyles:n}=A(e);let i;e.labelStyle=r,i=e.cssClasses?"node "+e.cssClasses:"node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),o=a.insert("g"),u=a.insert("g").attr("class","label").attr("style",n),h=e.description,p=e.label,f=u.node().appendChild(await b(p,e.labelStyle,!0,!0));let m={width:0,height:0};if((0,s._3)((0,s.D7)()?.flowchart?.htmlLabels)){const t=f.children[0],e=(0,l.Ltv)(f);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}s.Rm.info("Text 2",h);const g=h||[],y=f.getBBox(),v=u.node().appendChild(await b(g.join?g.join("<br/>"):g,e.labelStyle,!0,!0)),x=v.children[0],w=(0,l.Ltv)(v);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height);const k=(e.padding||0)/2;(0,l.Ltv)(v).attr("transform","translate( "+(m.width>y.width?0:(y.width-m.width)/2)+", "+(y.height+k+5)+")"),(0,l.Ltv)(f).attr("transform","translate( "+(m.width<y.width?0:-(y.width-m.width)/2)+", 0)"),m=u.node().getBBox(),u.attr("transform","translate("+-m.width/2+", "+(-m.height/2-k+3)+")");const T=m.width+(e.padding||0),S=m.height+(e.padding||0),C=-m.width/2-k,E=-m.height/2-k;let L,P;if("handDrawn"===e.look){const t=c.A.svg(a),r=M(e,{}),n=t.path(_(C,E,T,S,e.rx||0),r),i=t.line(-m.width/2-k,-m.height/2-k+y.height+k,m.width/2+k,-m.height/2-k+y.height+k,r);P=a.insert((()=>(s.Rm.debug("Rough node insert CXC",n),i)),":first-child"),L=a.insert((()=>(s.Rm.debug("Rough node insert CXC",n),n)),":first-child")}else L=o.insert("rect",":first-child"),P=o.insert("line"),L.attr("class","outer title-state").attr("style",n).attr("x",-m.width/2-k).attr("y",-m.height/2-k).attr("width",m.width+(e.padding||0)).attr("height",m.height+(e.padding||0)),P.attr("class","divider").attr("x1",-m.width/2-k).attr("x2",m.width/2+k).attr("y1",-m.height/2-k+y.height+k).attr("y2",-m.height/2-k+y.height+k);return d(e,L),e.intersect=function(t){return W.rect(e,t)},a}async function Ht(t,e){return Ct(t,e,{rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function Wt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await u(t,e,p(e)),l=e?.padding??0,h=Math.max(a.width+2*(e.padding??0),e?.width??0),f=Math.max(a.height+2*(e.padding??0),e?.height??0),m=-a.width/2-l,g=-a.height/2-l,{cssStyles:y}=e,v=c.A.svg(i),x=M(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=[{x:m,y:g},{x:m+h+8,y:g},{x:m+h+8,y:g+f},{x:m-8,y:g+f},{x:m-8,y:g},{x:m,y:g},{x:m,y:g+f}],_=v.polygon(b.map((t=>[t.x,t.y])),x),w=i.insert((()=>_),":first-child");return w.attr("class","basic label-container").attr("style",(0,o.KL)(y)),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),y&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),s.attr("transform",`translate(${-h/2+4+(e.padding??0)-(a.x-(a.left??0))},${-f/2+(e.padding??0)-(a.y-(a.top??0))})`),d(e,w),e.intersect=function(t){return W.rect(e,t)},i}async function Gt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-s/2,m=-l/2,{cssStyles:g}=e,y=c.A.svg(i),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=[{x:h,y:m},{x:h,y:m+l},{x:h+s,y:m+l},{x:h+s,y:m-l/2}],b=f(x),_=y.path(b,v),w=i.insert((()=>_),":first-child");return w.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",g),n&&"handDrawn"!==e.look&&w.selectChildren("path").attr("style",n),w.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))}, ${-l/4+(e.padding??0)-(a.y-(a.top??0))})`),d(e,w),e.intersect=function(t){return W.polygon(e,x,t)},i}async function Yt(t,e){return Ct(t,e,{rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function Zt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),s=a.height+e.padding,l=a.width+s/4+e.padding;let h;const{cssStyles:f}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=_(-l/2,-s/2,l,s,s/2),a=t.path(n,r);h=i.insert((()=>a),":first-child"),h.attr("class","basic label-container").attr("style",(0,o.KL)(f))}else h=i.insert("rect",":first-child"),h.attr("class","basic label-container").attr("style",n).attr("rx",s/2).attr("ry",s/2).attr("x",-l/2).attr("y",-s/2).attr("width",l).attr("height",s);return d(e,h),e.intersect=function(t){return W.rect(e,t)},i}async function Xt(t,e){return Ct(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function Kt(t,e,r){let{config:{themeVariables:n}}=r;const{labelStyles:i,nodeStyles:a}=A(e);e.labelStyle=i;const{cssStyles:o}=e,{lineColor:s,stateBorder:l,nodeBorder:u}=n,h=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),p=c.A.svg(h),f=M(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=p.circle(0,0,14,{...f,stroke:s,strokeWidth:2}),g=l??u,y=p.circle(0,0,5,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert((()=>m),":first-child");return v.insert((()=>y)),o&&v.selectAll("path").attr("style",o),a&&v.selectAll("path").attr("style",a),d(e,v),e.intersect=function(t){return W.circle(e,7,t)},h}function Jt(t,e,r){let{config:{themeVariables:n}}=r;const{lineColor:i}=n,a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let o;if("handDrawn"===e.look){const t=c.A.svg(a).circle(0,0,14,w(i));o=a.insert((()=>t)),o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else o=a.insert("circle",":first-child"),o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return d(e,o),e.intersect=function(t){return W.circle(e,7,t)},a}async function Qt(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),s=(e?.padding||0)/2,l=a.width+e.padding,h=a.height+e.padding,f=-a.width/2-s,m=-a.height/2-s,g=[{x:0,y:0},{x:l,y:0},{x:l,y:-h},{x:0,y:-h},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-h},{x:-8,y:-h},{x:-8,y:0}];if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=t.rectangle(f-8,m,l+16,h,r),a=t.line(f,m,f,m+h,r),s=t.line(f+l,m,f+l,m+h,r);i.insert((()=>a),":first-child"),i.insert((()=>s),":first-child");const u=i.insert((()=>n),":first-child"),{cssStyles:p}=e;u.attr("class","basic label-container").attr("style",(0,o.KL)(p)),d(e,u)}else{const t=X(i,l,h,g);n&&t.attr("style",n),d(e,t)}return e.intersect=function(t){return W.polygon(e,g,t)},i}async function te(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),s=Math.max(a.height+2*(e.padding??0),e?.height??0),l=-o/2,h=-s/2,m=.2*s,g=.2*s,{cssStyles:y}=e,v=c.A.svg(i),x=M(e,{}),b=[{x:l-m/2,y:h},{x:l+o+m/2,y:h},{x:l+o+m/2,y:h+s},{x:l-m/2,y:h+s}],_=[{x:l+o-m/2,y:h+s},{x:l+o+m/2,y:h+s},{x:l+o+m/2,y:h+s-g}];"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const w=f(b),k=v.path(w,x),T=f(_),S=v.path(T,{...x,fillStyle:"solid"}),C=i.insert((()=>S),":first-child");return C.insert((()=>k),":first-child"),C.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",y),n&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",n),d(e,C),e.intersect=function(t){return W.polygon(e,b,t)},i}async function ee(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=l/4,g=.2*s,y=.2*l,v=l+h,{cssStyles:x}=e,b=c.A.svg(i),_=M(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const w=[{x:-s/2-s/2*.1,y:v/2},...m(-s/2-s/2*.1,v/2,s/2+s/2*.1,v/2,h,.8),{x:s/2+s/2*.1,y:-v/2},{x:-s/2-s/2*.1,y:-v/2}],k=-s/2+s/2*.1,T=-v/2-.4*y,S=[{x:k+s-g,y:1.4*(T+l)},{x:k+s,y:T+l-y},{x:k+s,y:.9*(T+l)},...m(k+s,1.3*(T+l),k+s-g,1.5*(T+l),.03*-l,.5)],C=f(w),E=b.path(C,_),L=f(S),P=b.path(L,{..._,fillStyle:"solid"}),I=i.insert((()=>P),":first-child");return I.insert((()=>E),":first-child"),I.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&I.selectAll("path").attr("style",x),n&&"handDrawn"!==e.look&&I.selectAll("path").attr("style",n),I.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),d(e,I),e.intersect=function(t){return W.polygon(e,w,t)},i}async function re(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+e.padding,e?.width||0),s=Math.max(a.height+e.padding,e?.height||0),l=-o/2,c=-s/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",o).attr("height",s),d(e,h),e.intersect=function(t){return W.rect(e,t)},i}(0,s.K2)(Vt,"question"),(0,s.K2)(qt,"rect_left_inv_arrow"),(0,s.K2)($t,"rectWithTitle"),(0,s.K2)(Ht,"roundedRect"),(0,s.K2)(Wt,"shadedProcess"),(0,s.K2)(Gt,"slopedRect"),(0,s.K2)(Yt,"squareRect"),(0,s.K2)(Zt,"stadium"),(0,s.K2)(Xt,"state"),(0,s.K2)(Kt,"stateEnd"),(0,s.K2)(Jt,"stateStart"),(0,s.K2)(Qt,"subroutine"),(0,s.K2)(te,"taggedRect"),(0,s.K2)(ee,"taggedWaveEdgedRectangle"),(0,s.K2)(re,"text");var ne=(0,s.K2)(((t,e,r,n,i,a)=>`M${t},${e}\n a${i},${a} 0,0,1 0,${-n}\n l${r},0\n a${i},${a} 0,0,1 0,${n}\n M${r},${-n}\n a${i},${a} 0,0,0 0,${n}\n l${-r},0`),"createCylinderPathD"),ie=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" ")),"createOuterCylinderPathD"),ae=(0,s.K2)(((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" ")),"createInnerCylinderPathD");async function oe(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s,halfPadding:l}=await u(t,e,p(e)),h="neo"===e.look?2*l:l,f=a.height+h,m=f/2,g=m/(2.5+f/50),y=a.width+g+h,{cssStyles:v}=e;let x;if("handDrawn"===e.look){const t=c.A.svg(i),r=ie(0,0,y,f,g,m),n=ae(0,0,y,f,g,m),a=t.path(r,M(e,{})),o=t.path(n,M(e,{fill:"none"}));x=i.insert((()=>o),":first-child"),x=i.insert((()=>a),":first-child"),x.attr("class","basic label-container"),v&&x.attr("style",v)}else{const t=ne(0,0,y,f,g,m);x=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,o.KL)(v)).attr("style",n),x.attr("class","basic label-container"),v&&x.selectAll("path").attr("style",v),n&&x.selectAll("path").attr("style",n)}return x.attr("label-offset-x",g),x.attr("transform",`translate(${-y/2}, ${f/2} )`),s.attr("transform",`translate(${-a.width/2-g-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),d(e,x),e.intersect=function(t){const r=W.rect(e,t),n=r.y-(e.y??0);if(0!=m&&(Math.abs(n)<(e.height??0)/2||Math.abs(n)==(e.height??0)/2&&Math.abs(r.x-(e.x??0))>(e.width??0)/2-g)){let i=g*g*(1-n*n/(m*m));0!=i&&(i=Math.sqrt(Math.abs(i))),i=g-i,t.x-(e.x??0)>0&&(i=-i),r.x+=i}return r},i}async function se(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=a.width+e.padding,s=a.height+e.padding,l=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let h;const{cssStyles:m}=e;if("handDrawn"===e.look){const t=c.A.svg(i),r=M(e,{}),n=f(l),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),m&&h.attr("style",m)}else h=X(i,o,s,l);return n&&h.attr("style",n),e.width=o,e.height=s,d(e,h),e.intersect=function(t){return W.polygon(e,l,t)},i}async function le(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(60,a.width+2*(e.padding??0),e?.width??0),s=Math.max(20,a.height+2*(e.padding??0),e?.height??0),{cssStyles:l}=e,h=c.A.svg(i),m=M(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");const g=[{x:-o/2*.8,y:-s/2},{x:o/2*.8,y:-s/2},{x:o/2,y:-s/2*.6},{x:o/2,y:s/2},{x:-o/2,y:s/2},{x:-o/2,y:-s/2*.6}],y=f(g),v=h.path(y,m),x=i.insert((()=>v),":first-child");return x.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",l),n&&"handDrawn"!==e.look&&x.selectChildren("path").attr("style",n),d(e,x),e.intersect=function(t){return W.polygon(e,g,t)},i}async function ce(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),l=(0,s._3)((0,s.D7)().flowchart?.htmlLabels),h=a.width+(e.padding??0),m=h+a.height,g=h+a.height,y=[{x:0,y:0},{x:g,y:0},{x:g/2,y:-m}],{cssStyles:v}=e,x=c.A.svg(i),b=M(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const _=f(y),w=x.path(_,b),k=i.insert((()=>w),":first-child").attr("transform",`translate(${-m/2}, ${m/2})`);return v&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",v),n&&"handDrawn"!==e.look&&k.selectChildren("path").attr("style",n),e.width=h,e.height=m,d(e,k),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${m/2-(a.height+(e.padding??0)/(l?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(t){return s.Rm.info("Triangle intersect",e,y,t),W.polygon(e,y,t)},i}async function ue(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=l/8,g=l+h,{cssStyles:y}=e,v=70-s,x=v>0?v/2:0,b=c.A.svg(i),_=M(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const w=[{x:-s/2-x,y:g/2},...m(-s/2-x,g/2,s/2+x,g/2,h,.8),{x:s/2+x,y:-g/2},{x:-s/2-x,y:-g/2}],k=f(w),T=b.path(k,_),S=i.insert((()=>T),":first-child");return S.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",y),n&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h-(a.y-(a.top??0))})`),d(e,S),e.intersect=function(t){return W.polygon(e,w,t)},i}async function he(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await u(t,e,p(e)),o=Math.max(a.width+2*(e.padding??0),e?.width??0),s=Math.max(a.height+2*(e.padding??0),e?.height??0),l=o/s;let h=o,g=s;h>g*l?g=h/l:h=g*l,h=Math.max(h,100),g=Math.max(g,50);const y=Math.min(.2*g,g/4),v=g+2*y,{cssStyles:x}=e,b=c.A.svg(i),_=M(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const w=[{x:-h/2,y:v/2},...m(-h/2,v/2,h/2,v/2,y,1),{x:h/2,y:-v/2},...m(h/2,-v/2,-h/2,-v/2,y,-1)],k=f(w),T=b.path(k,_),S=i.insert((()=>T),":first-child");return S.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",x),n&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",n),d(e,S),e.intersect=function(t){return W.polygon(e,w,t)},i}async function de(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await u(t,e,p(e)),s=Math.max(a.width+2*(e.padding??0),e?.width??0),l=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-s/2,f=-l/2,{cssStyles:m}=e,g=c.A.svg(i),y=M(e,{}),v=[{x:h-5,y:f-5},{x:h-5,y:f+l},{x:h+s,y:f+l},{x:h+s,y:f-5}],x=`M${h-5},${f-5} L${h+s},${f-5} L${h+s},${f+l} L${h-5},${f+l} L${h-5},${f-5}\n M${h-5},${f} L${h+s},${f}\n M${h},${f-5} L${h},${f+l}`;"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const b=g.path(x,y),_=i.insert((()=>b),":first-child");return _.attr("transform","translate(2.5, 2.5)"),_.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),o.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),d(e,_),e.intersect=function(t){return W.polygon(e,v,t)},i}async function pe(t,e){const r=e;if(r.alias&&(e.label=r.alias),"handDrawn"===e.look){const{themeVariables:r}=(0,s.zj)(),{background:n}=r,i={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${n}`]};await pe(t,i)}const n=(0,s.zj)();e.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,a=n.er?.entityPadding??6;const{cssStyles:u}=e,{labelStyles:h}=A(e);if(0===r.attributes.length&&e.label){const r={rx:0,ry:0,labelPaddingX:i,labelPaddingY:1.5*i,classes:""};(0,o.Un)(e.label,n)+2*r.labelPaddingX<n.er.minEntityWidth&&(e.width=n.er.minEntityWidth);const a=await Ct(t,e,r);if(!(0,s._3)(n.htmlLabels)){const t=a.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return a}n.htmlLabels||(i*=1.25,a*=1.25);let f=p(e);f||(f="node default");const m=t.insert("g").attr("class",f).attr("id",e.domId||e.id),g=await fe(m,e.label??"",n,0,0,["name"],h);g.height+=a;let y=0;const v=[];let x=0,b=0,_=0,w=0,k=!0,T=!0;for(const o of r.attributes){const t=await fe(m,o.type,n,0,y,["attribute-type"],h);x=Math.max(x,t.width+i);const e=await fe(m,o.name,n,0,y,["attribute-name"],h);b=Math.max(b,e.width+i);const r=await fe(m,o.keys.join(),n,0,y,["attribute-keys"],h);_=Math.max(_,r.width+i);const s=await fe(m,o.comment,n,0,y,["attribute-comment"],h);w=Math.max(w,s.width+i),y+=Math.max(t.height,e.height,r.height,s.height)+a,v.push(y)}v.pop();let S=4;_<=i&&(k=!1,_=0,S--),w<=i&&(T=!1,w=0,S--);const C=m.node().getBBox();if(g.width+2*i-(x+b+_+w)>0){const t=g.width+2*i-(x+b+_+w);x+=t/S,b+=t/S,_>0&&(_+=t/S),w>0&&(w+=t/S)}const E=x+b+_+w,L=c.A.svg(m),P=M(e,{});"handDrawn"!==e.look&&(P.roughness=0,P.fillStyle="solid");const I=Math.max(C.width+2*i,e?.width||0,E),z=Math.max(C.height+(v[0]||y)+a,e?.height||0),O=-I/2,D=-z/2;m.selectAll("g:not(:first-child)").each(((t,e,r)=>{const n=(0,l.Ltv)(r[e]),o=n.attr("transform");let s=0,c=0;if(o){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);t&&(s=parseFloat(t[1]),c=parseFloat(t[2]),n.attr("class").includes("attribute-name")?s+=x:n.attr("class").includes("attribute-keys")?s+=x+b:n.attr("class").includes("attribute-comment")&&(s+=x+b+_))}n.attr("transform",`translate(${O+i/2+s}, ${c+D+g.height+a/2})`)})),m.select(".name").attr("transform","translate("+-g.width/2+", "+(D+a/2)+")");const R=L.rectangle(O,D,I,z,P),F=m.insert((()=>R),":first-child").attr("style",u.join("")),{themeVariables:B}=(0,s.zj)(),{rowEven:j,rowOdd:N,nodeBorder:U}=B;v.push(0);for(const[o,s]of v.entries()){if(0===o&&v.length>1)continue;const t=o%2===0&&0!==s,e=L.rectangle(O,g.height+D+s,I,g.height,{...P,fill:t?j:N,stroke:U});m.insert((()=>e),"g.label").attr("style",u.join("")).attr("class","row-rect-"+(o%2===0?"even":"odd"))}let V=L.line(O,g.height+D,I+O,g.height+D,P);m.insert((()=>V)).attr("class","divider"),V=L.line(x+O,g.height+D,x+O,z+D,P),m.insert((()=>V)).attr("class","divider"),k&&(V=L.line(x+b+O,g.height+D,x+b+O,z+D,P),m.insert((()=>V)).attr("class","divider")),T&&(V=L.line(x+b+_+O,g.height+D,x+b+_+O,z+D,P),m.insert((()=>V)).attr("class","divider"));for(const o of v)V=L.line(O,g.height+D+o,I+O,g.height+D+o,P),m.insert((()=>V)).attr("class","divider");return d(e,F),e.intersect=function(t){return W.rect(e,t)},m}async function fe(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";const h=t.insert("g").attr("class",`label ${c.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",u);e!==(0,s.QO)(e)&&(e=(e=(0,s.QO)(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));const d=h.node().appendChild(await(0,a.GZ)(h,e,{width:(0,o.Un)(e,r)+100,style:u,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let t=d.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)t=t.childNodes[0],t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let p=d.getBBox();if((0,s._3)(r.htmlLabels)){const t=d.children[0];t.style.textAlign="start";const e=(0,l.Ltv)(d);p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return p}async function me(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:r.class.padding??12;const a=n?0:3,o=t.insert("g").attr("class",p(e)).attr("id",e.domId||e.id);let s=null,l=null,c=null,u=null,h=0,d=0,f=0;if(s=o.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await ge(s,{text:`\xab${t}\xbb`},0);h=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await ge(l,e,0,["font-weight: bolder"]);const m=l.node().getBBox();d=m.height,c=o.insert("g").attr("class","members-group text");let g=0;for(const p of e.members){g+=await ge(c,p,g,[p.parseClassifier()])+a}f=c.node().getBBox().height,f<=0&&(f=i/2),u=o.insert("g").attr("class","methods-group text");let y=0;for(const p of e.methods){y+=await ge(u,p,y,[p.parseClassifier()])+a}let v=o.node().getBBox();if(null!==s){const t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-m.width/2}, ${h})`),v=o.node().getBBox(),c.attr("transform",`translate(0, ${h+d+2*i})`),v=o.node().getBBox(),u.attr("transform",`translate(0, ${h+d+(f?f+4*i:2*i)})`),v=o.node().getBBox(),{shapeSvg:o,bbox:v}}async function ge(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),c=(0,s.zj)();let u="useHtmlLabels"in e?e.useHtmlLabels:(0,s._3)(c.htmlLabels)??!0,h="";h="text"in e?e.text:e.label,!u&&h.startsWith("\\")&&(h=h.substring(1)),(0,s.Wi)(h)&&(u=!0);const d=await(0,a.GZ)(i,(0,s.oB)((0,o.Sm)(h)),{width:(0,o.Un)(h,c)+50,classes:"markdown-node-label",useHtmlLabels:u},c);let p,f=1;if(u){const t=d.children[0],e=(0,l.Ltv)(d);f=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(f+=t.innerHTML.split("<mrow>").length-1);const r=t.getElementsByTagName("img");if(r){const t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=c.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,r=5,n=parseInt(t,10)*r+"px";e.style.minWidth=n,e.style.maxWidth=n}else e.style.width="100%";r(e)}(0,s.K2)(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}else{n.includes("font-weight: bolder")&&(0,l.Ltv)(d).selectAll("tspan").attr("font-weight",""),f=d.children.length;const t=d.children[0];if(""===d.textContent||d.textContent.includes("&gt")){t.textContent=h[0]+h.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim();" "===h[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))}"undefined"===t.textContent&&(t.textContent=""),p=d.getBBox()}return i.attr("transform","translate(0,"+(-p.height/(2*f)+r)+")"),p.height}async function ye(t,e){const r=(0,s.D7)(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??(0,s._3)(r.htmlLabels)??!0,o=e;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:u,bbox:h}=await me(t,e,r,a,i),{labelStyles:p,nodeStyles:f}=A(e);e.labelStyle=p,e.cssStyles=o.styles||"";const m=o.styles?.join(";")||f||"";e.cssStyles||(e.cssStyles=m.replaceAll("!important","").split(";"));const g=0===o.members.length&&0===o.methods.length&&!r.class?.hideEmptyMembersBox,y=c.A.svg(u),v=M(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const x=h.width;let b=h.height;0===o.members.length&&0===o.methods.length?b+=i:o.members.length>0&&0===o.methods.length&&(b+=2*i);const _=-x/2,w=-b/2,k=y.rectangle(_-n,w-n-(g?n:0===o.members.length&&0===o.methods.length?-n/2:0),x+2*n,b+2*n+(g?2*n:0===o.members.length&&0===o.methods.length?-n:0),v),T=u.insert((()=>k),":first-child");T.attr("class","basic label-container");const S=T.node().getBBox();u.selectAll(".text").each(((t,e,r)=>{const i=(0,l.Ltv)(r[e]),s=i.attr("transform");let c=0;if(s){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);t&&(c=parseFloat(t[2]))}let h=c+w+n-(g?n:0===o.members.length&&0===o.methods.length?-n/2:0);a||(h-=4);let d=_;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(d=-i.node()?.getBBox().width/2||0,u.selectAll("text").each((function(t,e,r){"middle"===window.getComputedStyle(r[e]).textAnchor&&(d=0)}))),i.attr("transform",`translate(${d}, ${h})`)}));const C=u.select(".annotation-group").node().getBBox().height-(g?n/2:0)||0,E=u.select(".label-group").node().getBBox().height-(g?n/2:0)||0,L=u.select(".members-group").node().getBBox().height-(g?n/2:0)||0;if(o.members.length>0||o.methods.length>0||g){const t=y.line(S.x,C+E+w+n,S.x+S.width,C+E+w+n,v);u.insert((()=>t)).attr("class","divider").attr("style",m)}if(g||o.members.length>0||o.methods.length>0){const t=y.line(S.x,C+E+L+w+2*i+n,S.x+S.width,C+E+L+w+n+2*i,v);u.insert((()=>t)).attr("class","divider").attr("style",m)}if("handDrawn"!==o.look&&u.selectAll("path").attr("style",m),T.select(":nth-child(2)").attr("style",m),u.selectAll(".divider").select("path").attr("style",m),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",m),!a){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(m);if(e){const t=e[0].replace("color","fill");u.selectAll("tspan").attr("style",t)}else if(p){const e=t.exec(p);if(e){const t=e[0].replace("color","fill");u.selectAll("tspan").attr("style",t)}}}return d(e,T),e.intersect=function(t){return W.rect(e,t)},u}async function ve(t,e){const{labelStyles:r,nodeStyles:n}=A(e);e.labelStyle=r;const i=e,a=e,o="verifyMethod"in e,s=p(e),u=t.insert("g").attr("class",s).attr("id",e.domId??e.id);let h;h=o?await xe(u,`&lt;&lt;${i.type}&gt;&gt;`,0,e.labelStyle):await xe(u,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let f=h;const m=await xe(u,i.name,f,e.labelStyle+"; font-weight: bold;");if(f+=m+20,o){f+=await xe(u,""+(i.requirementId?`Id: ${i.requirementId}`:""),f,e.labelStyle);f+=await xe(u,""+(i.text?`Text: ${i.text}`:""),f,e.labelStyle);f+=await xe(u,""+(i.risk?`Risk: ${i.risk}`:""),f,e.labelStyle),await xe(u,""+(i.verifyMethod?`Verification: ${i.verifyMethod}`:""),f,e.labelStyle)}else{f+=await xe(u,""+(a.type?`Type: ${a.type}`:""),f,e.labelStyle),await xe(u,""+(a.docRef?`Doc Ref: ${a.docRef}`:""),f,e.labelStyle)}const g=(u.node()?.getBBox().width??200)+20,y=(u.node()?.getBBox().height??200)+20,v=-g/2,x=-y/2,b=c.A.svg(u),_=M(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const w=b.rectangle(v,x,g,y,_),k=u.insert((()=>w),":first-child");if(k.attr("class","basic label-container").attr("style",n),u.selectAll(".label").each(((t,e,r)=>{const n=(0,l.Ltv)(r[e]),i=n.attr("transform");let a=0,o=0;if(i){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);t&&(a=parseFloat(t[1]),o=parseFloat(t[2]))}const s=o-y/2;let c=v+10;0!==e&&1!==e||(c=a),n.attr("transform",`translate(${c}, ${s+20})`)})),f>h+m+20){const t=b.line(v,x+h+m+20,v+g,x+h+m+20,_);u.insert((()=>t)).attr("style",n)}return d(e,k),e.intersect=function(t){return W.rect(e,t)},u}async function xe(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(""===e)return 0;const i=t.insert("g").attr("class","label").attr("style",n),c=(0,s.D7)(),u=c.htmlLabels??!0,h=await(0,a.GZ)(i,(0,s.oB)((0,o.Sm)(e)),{width:(0,o.Un)(e,c)+50,classes:"markdown-node-label",useHtmlLabels:u,style:n},c);let d;if(u){const t=h.children[0],e=(0,l.Ltv)(h);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}else{const t=h.children[0];for(const e of t.children)e.textContent=e.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&e.setAttribute("style",n);d=h.getBBox(),d.height+=6}return i.attr("transform",`translate(${-d.width/2},${-d.height/2+r})`),d.height}(0,s.K2)(oe,"tiltedCylinder"),(0,s.K2)(se,"trapezoid"),(0,s.K2)(le,"trapezoidalPentagon"),(0,s.K2)(ce,"triangle"),(0,s.K2)(ue,"waveEdgedRectangle"),(0,s.K2)(he,"waveRectangle"),(0,s.K2)(de,"windowPane"),(0,s.K2)(pe,"erBox"),(0,s.K2)(fe,"addText"),(0,s.K2)(me,"textHelper"),(0,s.K2)(ge,"addText"),(0,s.K2)(ye,"classBox"),(0,s.K2)(ve,"requirementBox"),(0,s.K2)(xe,"addText");var be=(0,s.K2)((t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}}),"colorFromPriority");async function _e(t,e,r){let{config:n}=r;const{labelStyles:i,nodeStyles:a}=A(e);e.labelStyle=i||"";const o=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:l,label:f}=await u(t,e,p(e)),m=e.padding||10;let g,y="";"ticket"in e&&e.ticket&&n?.kanban?.ticketBaseUrl&&(y=n?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),g=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",y).attr("target","_blank"));const v={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let x,b;({label:x,bbox:b}=g?await h(g,"ticket"in e&&e.ticket||"",v):await h(s,"ticket"in e&&e.ticket||"",v));const{label:w,bbox:k}=await h(s,"assigned"in e&&e.assigned||"",v);e.width=o;const T=e?.width||0,S=Math.max(b.height,k.height)/2,C=Math.max(l.height+20,e?.height||0)+S,E=-T/2,L=-C/2;let P;f.attr("transform","translate("+(m-T/2)+", "+(-S-l.height/2)+")"),x.attr("transform","translate("+(m-T/2)+", "+(-S+l.height/2)+")"),w.attr("transform","translate("+(m+T/2-k.width-20)+", "+(-S+l.height/2)+")");const{rx:I,ry:z}=e,{cssStyles:O}=e;if("handDrawn"===e.look){const t=c.A.svg(s),r=M(e,{}),n=I||z?t.path(_(E,L,T,C,I||0),r):t.rectangle(E,L,T,C,r);P=s.insert((()=>n),":first-child"),P.attr("class","basic label-container").attr("style",O||null)}else{P=s.insert("rect",":first-child"),P.attr("class","basic label-container __APA__").attr("style",a).attr("rx",I??5).attr("ry",z??5).attr("x",E).attr("y",L).attr("width",T).attr("height",C);const t="priority"in e&&e.priority;if(t){const e=s.append("line"),r=E+2,n=L+Math.floor((I??0)/2),i=L+C-Math.floor((I??0)/2);e.attr("x1",r).attr("y1",n).attr("x2",r).attr("y2",i).attr("stroke-width","4").attr("stroke",be(t))}}return d(e,P),e.height=C,e.intersect=function(t){return W.rect(e,t)},s}(0,s.K2)(_e,"kanbanItem");var we=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Yt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ht},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Zt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Qt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:dt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Q},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Vt},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:bt},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Pt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Lt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:se},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Mt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ft},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:re},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:K},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Wt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Jt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Kt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:yt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:_t},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:nt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:at},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:st},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:It},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ue},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:vt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:oe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Rt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:lt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:pt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:ce},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:de},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:mt},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:le},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:gt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Gt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:jt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Bt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Z},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:et},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ee},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:te},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:he},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:qt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ft}],ke=(0,s.K2)((()=>{const t={state:Xt,choice:J,note:Nt,rectWithTitle:$t,labelRect:Et,iconSquare:St,iconCircle:kt,icon:wt,iconRounded:Tt,imageSquare:At,anchor:G,kanbanItem:_e,classBox:ye,erBox:pe,requirementBox:ve},e=[...Object.entries(t),...we.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap")();function Te(t){return t in ke}(0,s.K2)(Te,"isValidShape");var Se=new Map;async function Ae(t,e,r){let n,i;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?ke[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let o;"sandbox"===r.config.securityLevel?o="_top":e.linkTarget&&(o=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",o??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),Se.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}(0,s.K2)(Ae,"insertNode");var Me=(0,s.K2)(((t,e)=>{Se.set(e.id,t)}),"setNodeElem"),Ce=(0,s.K2)((()=>{Se.clear()}),"clear"),Ee=(0,s.K2)((t=>{const e=Se.get(t.id);s.Rm.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode")},1375:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(4306);const i=function(){return!1};var a="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=a&&"object"==typeof module&&module&&!module.nodeType&&module,s=o&&o.exports===a?n.A.Buffer:void 0;const l=(s?s.isBuffer:void 0)||i},1458:(t,e,r)=>{"use strict";r.d(e,{A:()=>m});var n=r(4186),i=r(5481);const a={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;const e=t.match(a.re);if(!e)return;const r=e[1],i=parseInt(r,16),o=r.length,s=o%4===0,l=o>4,c=l?1:17,u=l?8:4,h=s?0:-1,d=l?255:15;return n.A.set({r:(i>>u*(h+3)&d)*c,g:(i>>u*(h+2)&d)*c,b:(i>>u*(h+1)&d)*c,a:s?(i&d)*c/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:a}=t;return a<1?`#${i.Y[Math.round(e)]}${i.Y[Math.round(r)]}${i.Y[Math.round(n)]}${i.Y[Math.round(255*a)]}`:`#${i.Y[Math.round(e)]}${i.Y[Math.round(r)]}${i.Y[Math.round(n)]}`}},o=a;var s=r(7170);const l={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(l.hueRe);if(e){const[,t,r]=e;switch(r){case"grad":return s.A.channel.clamp.h(.9*parseFloat(t));case"rad":return s.A.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return s.A.channel.clamp.h(360*parseFloat(t))}}return s.A.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const r=t.match(l.re);if(!r)return;const[,i,a,o,c,u]=r;return n.A.set({h:l._hue2deg(i),s:s.A.channel.clamp.s(parseFloat(a)),l:s.A.channel.clamp.l(parseFloat(o)),a:c?s.A.channel.clamp.a(u?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${s.A.lang.round(e)}, ${s.A.lang.round(r)}%, ${s.A.lang.round(n)}%, ${i})`:`hsl(${s.A.lang.round(e)}, ${s.A.lang.round(r)}%, ${s.A.lang.round(n)}%)`}},c=l,u={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=u.colors[t];if(e)return o.parse(e)},stringify:t=>{const e=o.stringify(t);for(const r in u.colors)if(u.colors[r]===e)return r}},h=u,d={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const r=t.match(d.re);if(!r)return;const[,i,a,o,l,c,u,h,p]=r;return n.A.set({r:s.A.channel.clamp.r(a?2.55*parseFloat(i):parseFloat(i)),g:s.A.channel.clamp.g(l?2.55*parseFloat(o):parseFloat(o)),b:s.A.channel.clamp.b(u?2.55*parseFloat(c):parseFloat(c)),a:h?s.A.channel.clamp.a(p?parseFloat(h)/100:parseFloat(h)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${s.A.lang.round(e)}, ${s.A.lang.round(r)}, ${s.A.lang.round(n)}, ${s.A.lang.round(i)})`:`rgb(${s.A.lang.round(e)}, ${s.A.lang.round(r)}, ${s.A.lang.round(n)})`}},p=d,f={format:{keyword:u,hex:o,rgb:d,rgba:d,hsl:l,hsla:l},parse:t=>{if("string"!==typeof t)return t;const e=o.parse(t)||p.parse(t)||c.parse(t)||h.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(i.Z.HSL)||void 0===t.data.r?c.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?p.stringify(t):o.stringify(t)},m=f},1497:(t,e,r)=>{"use strict";var n=r(3218);function i(){}function a(){}a.resetWarningCache=i,t.exports=function(){function t(t,e,r,i,a,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},1499:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=r(4306).A.Uint8Array},1580:(t,e,r)=>{"use strict";r.d(e,{IU:()=>g,Jo:()=>M,T_:()=>b,g0:()=>L,jP:()=>v});var n=r(2598),i=r(958),a=r(8434),o=r(2596),s=r(634),l=r(3759),c=r(700),u=r(8205),h=(0,l.K2)(((t,e,r,n,i,a)=>{e.arrowTypeStart&&p(t,"start",e.arrowTypeStart,r,n,i,a),e.arrowTypeEnd&&p(t,"end",e.arrowTypeEnd,r,n,i,a)}),"addEdgeMarkers"),d={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},p=(0,l.K2)(((t,e,r,n,i,a,o)=>{const s=d[r];if(!s)return void l.Rm.warn(`Unknown arrow type: ${r}`);const c=`${i}_${a}-${s.type}${"start"===e?"Start":"End"}`;if(o&&""!==o.trim()){const r=`${c}_${o.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(r)){const t=document.getElementById(c);if(t){const e=t.cloneNode(!0);e.id=r;e.querySelectorAll("path, circle, line").forEach((t=>{t.setAttribute("stroke",o),s.fill&&t.setAttribute("fill",o)})),t.parentNode?.appendChild(e)}}t.attr(`marker-${e}`,`url(${n}#${r})`)}else t.attr(`marker-${e}`,`url(${n}#${c})`)}),"addEdgeMarker"),f=new Map,m=new Map,g=(0,l.K2)((()=>{f.clear(),m.clear()}),"clear"),y=(0,l.K2)((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),v=(0,l.K2)((async(t,e)=>{let r=(0,l._3)((0,l.D7)().flowchart.htmlLabels);const n=await(0,o.GZ)(t,e.label,{style:y(e.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});l.Rm.info("abc82",e,e.labelType);const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(n);let u,h=n.getBBox();if(r){const t=n.children[0],e=(0,c.Ltv)(n);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}if(s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),f.set(e.id,a),e.width=h.width,e.height=h.height,e.startLabelLeft){const r=await(0,i.DA)(e.startLabelLeft,y(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),a=n.insert("g").attr("class","inner");u=a.node().appendChild(r);const o=r.getBBox();a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),m.get(e.id)||m.set(e.id,{}),m.get(e.id).startLeft=n,x(u,e.startLabelLeft)}if(e.startLabelRight){const r=await(0,i.DA)(e.startLabelRight,y(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),a=n.insert("g").attr("class","inner");u=n.node().appendChild(r),a.node().appendChild(r);const o=r.getBBox();a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),m.get(e.id)||m.set(e.id,{}),m.get(e.id).startRight=n,x(u,e.startLabelRight)}if(e.endLabelLeft){const r=await(0,i.DA)(e.endLabelLeft,y(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),a=n.insert("g").attr("class","inner");u=a.node().appendChild(r);const o=r.getBBox();a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),n.node().appendChild(r),m.get(e.id)||m.set(e.id,{}),m.get(e.id).endLeft=n,x(u,e.endLabelLeft)}if(e.endLabelRight){const r=await(0,i.DA)(e.endLabelRight,y(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),a=n.insert("g").attr("class","inner");u=a.node().appendChild(r);const o=r.getBBox();a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),n.node().appendChild(r),m.get(e.id)||m.set(e.id,{}),m.get(e.id).endRight=n,x(u,e.endLabelRight)}return n}),"insertEdgeLabel");function x(t,e){(0,l.D7)().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}(0,l.K2)(x,"setTerminalWidth");var b=(0,l.K2)(((t,e)=>{l.Rm.debug("Moving label abc88 ",t.id,t.label,f.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=(0,l.D7)(),{subGraphTitleTotalMargin:i}=(0,a.O)(n);if(t.label){const n=f.get(t.id);let a=t.x,o=t.y;if(r){const n=s._K.calcLabelPosition(r);l.Rm.debug("Moving label "+t.label+" from (",a,",",o,") to (",n.x,",",n.y,") abc88"),e.updatedPath&&(a=n.x,o=n.y)}n.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const e=m.get(t.id).startLeft;let n=t.x,i=t.y;if(r){const e=s._K.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.startLabelRight){const e=m.get(t.id).startRight;let n=t.x,i=t.y;if(r){const e=s._K.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelLeft){const e=m.get(t.id).endLeft;let n=t.x,i=t.y;if(r){const e=s._K.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelRight){const e=m.get(t.id).endRight;let n=t.x,i=t.y;if(r){const e=s._K.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}}),"positionEdgeLabel"),_=(0,l.K2)(((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),o=t.width/2,s=t.height/2;return i>=o||a>=s}),"outsideNode"),w=(0,l.K2)(((t,e,r)=>{l.Rm.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),o=t.width/2;let s=r.x<e.x?o-a:o+a;const c=t.height/2,u=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*o>Math.abs(n-e.x)*c){let t=r.y<e.y?e.y-c-i:i-c-e.y;s=h*t/u;const n={x:r.x<e.x?r.x+s:r.x-h+s,y:r.y<e.y?r.y+u-t:r.y-u+t};return 0===s&&(n.x=e.x,n.y=e.y),0===h&&(n.x=e.x),0===u&&(n.y=e.y),l.Rm.debug(`abc89 top/bottom calc, Q ${u}, q ${t}, R ${h}, r ${s}`,n),n}{s=r.x<e.x?e.x-o-n:n-o-e.x;let t=u*s/h,i=r.x<e.x?r.x+h-s:r.x-h+s,a=r.y<e.y?r.y+t:r.y-t;return l.Rm.debug(`sides calc abc89, Q ${u}, q ${t}, R ${h}, r ${s}`,{_x:i,_y:a}),0===s&&(i=e.x,a=e.y),0===h&&(i=e.x),0===u&&(a=e.y),{x:i,y:a}}}),"intersection"),k=(0,l.K2)(((t,e)=>{l.Rm.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach((t=>{if(l.Rm.info("abc88 checking point",t,e),_(e,t)||i)l.Rm.warn("abc88 outside",t,n),n=t,i||r.push(t);else{const a=w(e,n,t);l.Rm.debug("abc88 inside",t,n,a),l.Rm.debug("abc88 intersection",a,e);let o=!1;r.forEach((t=>{o=o||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))?l.Rm.warn("abc88 no intersect",a,r):r.push(a),i=!0}})),l.Rm.debug("returning points",r),r}),"cutPathAtIntersect");function T(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],a=t[n],o=t[n+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}(0,l.K2)(T,"extractCornerPoints");var S=(0,l.K2)((function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=r/Math.sqrt(n*n+i*i);return{x:e.x-a*n,y:e.y-a*i}}),"findAdjacentPoint"),A=(0,l.K2)((function(t){const{cornerPointPositions:e}=T(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const e=t[n-1],i=t[n+1],a=t[n],o=S(e,a,5),s=S(i,a,5),c=s.x-o.x,u=s.y-o.y;r.push(o);const h=2*Math.sqrt(2);let d={x:a.x,y:a.y};if(Math.abs(i.x-e.x)>10&&Math.abs(i.y-e.y)>=10){l.Rm.debug("Corner point fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));const t=5;d=a.x===o.x?{x:c<0?o.x-t+h:o.x+t-h,y:u<0?o.y-h:o.y+h}:{x:c<0?o.x-h:o.x+h,y:u<0?o.y-t+h:o.y+t-h}}else l.Rm.debug("Corner point skipping fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));r.push(d,s)}else r.push(t[n]);return r}),"fixCorners"),M=(0,l.K2)((function(t,e,r,a,o,s,d){const{handDrawnSeed:p}=(0,l.D7)();let f=e.points,m=!1;const g=o;var y=s;const v=[];for(const n in e.cssCompiledStyles)(0,i.KX)(n)||v.push(e.cssCompiledStyles[n]);y.intersect&&g.intersect&&(f=f.slice(1,e.points.length-1),f.unshift(g.intersect(f[0])),l.Rm.debug("Last point APA12",e.start,"--\x3e",e.end,f[f.length-1],y,y.intersect(f[f.length-1])),f.push(y.intersect(f[f.length-1]))),e.toCluster&&(l.Rm.info("to cluster abc88",r.get(e.toCluster)),f=k(e.points,r.get(e.toCluster).node),m=!0),e.fromCluster&&(l.Rm.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(f,null,2)),f=k(f.reverse(),r.get(e.fromCluster).node).reverse(),m=!0);let x=f.filter((t=>!Number.isNaN(t.y)));x=A(x);let b=c.qrM;switch(b=c.lUB,e.curve){case"linear":b=c.lUB;break;case"basis":default:b=c.qrM;break;case"cardinal":b=c.y8u;break;case"bumpX":b=c.Wi0;break;case"bumpY":b=c.PGM;break;case"catmullRom":b=c.oDi;break;case"monotoneX":b=c.nVG;break;case"monotoneY":b=c.uxU;break;case"natural":b=c.Xf2;break;case"step":b=c.GZz;break;case"stepAfter":b=c.UPb;break;case"stepBefore":b=c.dyv}const{x:_,y:w}=(0,n.R)(e),T=(0,c.n8j)().x(_).y(w).curve(b);let S,M;switch(e.thickness){case"normal":default:S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible"}switch(e.pattern){case"solid":default:S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed"}let C=T(x);const E=Array.isArray(e.style)?e.style:[e.style];let L=E.find((t=>t?.startsWith("stroke:")));if("handDrawn"===e.look){const r=u.A.svg(t);Object.assign([],x);const n=r.path(C,{roughness:.3,seed:p});S+=" transition",M=(0,c.Ltv)(n).select("path").attr("id",e.id).attr("class"," "+S+(e.classes?" "+e.classes:"")).attr("style",E?E.reduce(((t,e)=>t+";"+e),""):"");let i=M.attr("d");M.attr("d",i),t.node().appendChild(M.node())}else{const r=v.join(";"),n=E?E.reduce(((t,e)=>t+e+";"),""):"";let i="";e.animate&&(i=" edge-animation-fast"),e.animation&&(i=" edge-animation-"+e.animation);const a=r?r+";"+n+";":n;M=t.append("path").attr("d",C).attr("id",e.id).attr("class"," "+S+(e.classes?" "+e.classes:"")+(i??"")).attr("style",a),L=a.match(/stroke:([^;]+)/)?.[1]}let P="";((0,l.D7)().flowchart.arrowMarkerAbsolute||(0,l.D7)().state.arrowMarkerAbsolute)&&(P=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,P=P.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),l.Rm.info("arrowTypeStart",e.arrowTypeStart),l.Rm.info("arrowTypeEnd",e.arrowTypeEnd),h(M,e,P,d,a,L);let I={};return m&&(I.updatedPath=f),I.originalPath=e.points,I}),"insertEdge"),C=(0,l.K2)(((t,e,r,n)=>{e.forEach((e=>{E[e](t,r,n)}))}),"insertMarkers"),E={extension:(0,l.K2)(((t,e,r)=>{l.Rm.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),composition:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),aggregation:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),dependency:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),lollipop:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),point:(0,l.K2)(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),circle:(0,l.K2)(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),cross:(0,l.K2)(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),barb:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),only_one:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")}),"only_one"),zero_or_one:(0,l.K2)(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")}),"zero_or_one"),one_or_more:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")}),"one_or_more"),zero_or_more:(0,l.K2)(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"zero_or_more"),requirement_arrow:(0,l.K2)(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")}),"requirement_arrow"),requirement_contains:(0,l.K2)(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)}),"requirement_contains")},L=C},1744:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;e.createAnimation=function(t,e,r){var n="react-spinners-".concat(t,"-").concat(r);if("undefined"==typeof window||!window.document)return n;var i=document.createElement("style");document.head.appendChild(i);var a=i.sheet,o="\n @keyframes ".concat(n," {\n ").concat(e,"\n }\n ");return a&&a.insertRule(o,0),n}},1869:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(2041),i=r(7858),a=r(7515);const o=function(t,e){return(0,a.A)((0,i.A)(t,e,n.A),t+"")}},1954:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(3101),i=r(5009),a=Object.prototype.hasOwnProperty;const o=function(t,e,r){var o=t[e];a.call(t,e)&&(0,i.A)(o,r)&&(void 0!==r||e in t)||(0,n.A)(t,e,r)}},2041:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return t}},2476:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});const n=function(){this.__data__=[],this.size=0};var i=r(5009);const a=function(t,e){for(var r=t.length;r--;)if((0,i.A)(t[r][0],e))return r;return-1};var o=Array.prototype.splice;const s=function(t){var e=this.__data__,r=a(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)};const l=function(t){var e=this.__data__,r=a(e,t);return r<0?void 0:e[r][1]};const c=function(t){return a(this.__data__,t)>-1};const u=function(t,e){var r=this.__data__,n=a(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function h(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}h.prototype.clear=n,h.prototype.delete=s,h.prototype.get=l,h.prototype.has=c,h.prototype.set=u;const d=h},2596:(t,e,r)=>{"use strict";r.d(e,{W6:()=>Lt,GZ:()=>Ot,hE:()=>zt});var n=r(634),i=r(3759),a=r(700);function o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let s={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function l(t){s=t}const c={exec:()=>null};function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="string"===typeof t?t:t.source;const n={replace:(t,e)=>{let i="string"===typeof e?e:e.source;return i=i.replace(h.caret,"$1"),r=r.replace(t,i),n},getRegex:()=>new RegExp(r,e)};return n}const h={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p=/(?:[*+-]|\d{1,9}[.)])/,f=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,m=u(f).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g=u(f).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v=/(?!\s*\])(?:\\.|[^\[\]\\])+/,x=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",v).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),b=u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,p).getRegex(),_="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",w=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",w).replace("tag",_).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),T=u(y).replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex(),S={blockquote:u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",T).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:x,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:d,html:k,lheading:m,list:b,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:T,table:c,text:/^[^\n]+/},A=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex(),M={...S,lheading:g,table:A,paragraph:u(y).replace("hr",d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",A).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_).getRegex()},C={...S,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",w).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:c,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(y).replace("hr",d).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},E=/^( {2,}|\\)\n(?!\s*$)/,L=/[\p{P}\p{S}]/u,P=/[\s\p{P}\p{S}]/u,I=/[^\s\p{P}\p{S}]/u,z=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,P).getRegex(),O=/(?!~)[\p{P}\p{S}]/u,D=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,R=u(D,"u").replace(/punct/g,L).getRegex(),F=u(D,"u").replace(/punct/g,O).getRegex(),B="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",j=u(B,"gu").replace(/notPunctSpace/g,I).replace(/punctSpace/g,P).replace(/punct/g,L).getRegex(),N=u(B,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,O).getRegex(),U=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,I).replace(/punctSpace/g,P).replace(/punct/g,L).getRegex(),V=u(/\\(punct)/,"gu").replace(/punct/g,L).getRegex(),q=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$=u(w).replace("(?:--\x3e|$)","--\x3e").getRegex(),H=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Y=u(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",v).getRegex(),Z=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",v).getRegex(),X={_backpedal:c,anyPunctuation:V,autolink:q,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:E,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:c,emStrongLDelim:R,emStrongRDelimAst:j,emStrongRDelimUnd:U,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:G,nolink:Z,punctuation:z,reflink:Y,reflinkSearch:u("reflink|nolink(?!\\()","g").replace("reflink",Y).replace("nolink",Z).getRegex(),tag:H,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:c},K={...X,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},J={...X,emStrongRDelimAst:N,emStrongLDelim:F,url:u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Q={...J,br:u(E).replace("{2,}","*").getRegex(),text:u(J.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tt={normal:S,gfm:M,pedantic:C},et={normal:X,gfm:J,breaks:Q,pedantic:K},rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nt=t=>rt[t];function it(t,e){if(e){if(h.escapeTest.test(t))return t.replace(h.escapeReplace,nt)}else if(h.escapeTestNoEncode.test(t))return t.replace(h.escapeReplaceNoEncode,nt);return t}function at(t){try{t=encodeURI(t).replace(h.percentDecode,"%")}catch{return null}return t}function ot(t,e){const r=t.replace(h.findPipe,((t,e,r)=>{let n=!1,i=e;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(h.splitPipe);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(h.slashPipe,"|");return r}function st(t,e,r){const n=t.length;if(0===n)return"";let i=0;for(;i<n;){if(t.charAt(n-i-1)!==e)break;i++}return t.slice(0,n-i)}function lt(t,e,r,n,i){const a=e.href,o=e.title||null,s=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:"!"===t[0].charAt(0)?"image":"link",raw:r,href:a,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}class ct{options;rules;lexer;constructor(t){this.options=t||s}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:st(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],r=function(t,e,r){const n=t.match(r.other.indentCodeCompensation);if(null===n)return e;const i=n[1];return e.split("\n").map((t=>{const e=t.match(r.other.beginningSpace);if(null===e)return t;const[n]=e;return n.length>=i.length?t.slice(i.length):t})).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=st(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:st(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=st(e[0],"\n").split("\n"),r="",n="";const i=[];for(;t.length>0;){let e=!1;const a=[];let o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))a.push(t[o]),e=!0;else{if(e)break;a.push(t[o])}t=t.slice(o);const s=a.join("\n"),l=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${s}`:s,n=n?`${n}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===t.length)break;const u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){const e=u,a=e.raw+"\n"+t.join("\n"),o=this.blockquote(a);i[i.length-1]=o,r=r.substring(0,r.length-e.raw.length)+o.raw,n=n.substring(0,n.length-e.text.length)+o.text;break}if("list"!==u?.type);else{const e=u,a=e.raw+"\n"+t.join("\n"),o=this.list(a);i[i.length-1]=o,r=r.substring(0,r.length-u.raw.length)+o.raw,n=n.substring(0,n.length-e.raw.length)+o.raw,t=a.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let o=!1;for(;t;){let r=!1,n="",s="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;n=e[0],t=t.substring(n.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],u=!l.trim(),h=0;if(this.options.pedantic?(h=2,s=l.trimStart()):u?h=e[1].length+1:(h=e[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,s=l.slice(h),h+=e[1].length),u&&this.rules.other.blankLine.test(c)&&(n+=c+"\n",t=t.substring(c.length+1),r=!0),!r){const e=this.rules.other.nextBulletRegex(h),r=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),a=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h);for(;t;){const d=t.split("\n",1)[0];let p;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(a.test(c))break;if(o.test(c))break;if(e.test(c))break;if(r.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=h||!c.trim())s+="\n"+p.slice(h);else{if(u)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(a.test(l))break;if(r.test(l))break;s+="\n"+c}u||c.trim()||(u=!0),n+=d+"\n",t=t.substring(d.length+1),l=p.slice(h)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(o=!0));let d,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(d="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:n,task:!!p,checked:d,loose:!1,text:s,tokens:[]}),i.raw+=n}const s=i.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++)if(this.lexer.state.top=!1,i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]),!i.loose){const e=i.items[t].tokens.filter((t=>"space"===t.type)),r=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));i.loose=r}if(i.loose)for(let t=0;t<i.items.length;t++)i.items[t].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e){return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:n}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const r=ot(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const t of n)this.rules.other.tableAlignRight.test(t)?a.align.push("right"):this.rules.other.tableAlignCenter.test(t)?a.align.push("center"):this.rules.other.tableAlignLeft.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t<r.length;t++)a.header.push({text:r[t],tokens:this.lexer.inline(r[t]),header:!0,align:a.align[t]});for(const t of i)a.rows.push(ot(t,a.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=st(t.slice(0,-1),"\\");if((t.length-e.length)%2===0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let r=0;for(let n=0;n<t.length;n++)if("\\"===t[n])n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}(e[2],"()");if(-2===t)return;if(t>-1){const r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],n=t[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),lt(e,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return lt(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=this.rules.inline.emStrongLDelim.exec(t);if(!n)return;if(n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const r=[...n[0]].length-1;let i,a,o=r,s=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+r);null!=(n=l.exec(e));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){o+=a;continue}if((n[5]||n[6])&&r%3&&!((r+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const e=[...n[0]][0].length,l=t.slice(0,r+n.index+e+a);if(Math.min(r,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let n;do{n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(n!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}}class ut{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||s,this.options.tokenizer=this.options.tokenizer||new ct,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:h,block:tt.normal,inline:et.normal};this.options.pedantic?(e.block=tt.pedantic,e.inline=et.pedantic):this.options.gfm&&(e.block=tt.gfm,this.options.breaks?e.inline=et.breaks:e.inline=et.gfm),this.tokenizer.rules=e}static get rules(){return{block:tt,inline:et}}static lex(t,e){return new ut(e).lex(t)}static lexInline(t,e){return new ut(e).inlineTokens(t)}lex(t){t=t.replace(h.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.options.pedantic&&(t=t.replace(h.tabCharGlobal," ").replace(h.spaceLine,""));t;){let n;if(this.options.extensions?.block?.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);const r=e.at(-1);1===n.raw.length&&void 0!==r?r.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.at(-1).src=r.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}let i=t;if(this.options.extensions?.startBlock){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startBlock.forEach((t=>{n=t.call({lexer:this},r),"number"===typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){const a=e.at(-1);r&&"paragraph"===a?.type?(a.raw+="\n"+n.raw,a.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(n),r=i.length!==t.length,t=t.substring(n.raw.length)}else if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):e.push(n)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t,n=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(r));)t.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){let n;if(i||(a=""),i=!1,this.options.extensions?.inline?.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,r,a)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}let o=t;if(this.options.extensions?.startInline){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startInline.forEach((t=>{n=t.call({lexer:this},r),"number"===typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(o=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(o)){t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0;const r=e.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):e.push(n)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}}class ht{options;parser;constructor(t){this.options=t||s}space(t){return""}code(t){let{text:e,lang:r,escaped:n}=t;const i=(r||"").match(h.notSpaceStart)?.[0],a=e.replace(h.endingNewline,"")+"\n";return i?'<pre><code class="language-'+it(i)+'">'+(n?a:it(a,!0))+"</code></pre>\n":"<pre><code>"+(n?a:it(a,!0))+"</code></pre>\n"}blockquote(t){let{tokens:e}=t;return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html(t){let{text:e}=t;return e}heading(t){let{tokens:e,depth:r}=t;return`<h${r}>${this.parser.parseInline(e)}</h${r}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,r=t.start;let n="";for(let a=0;a<t.items.length;a++){const e=t.items[a];n+=this.listitem(e)}const i=e?"ol":"ul";return"<"+i+(e&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(t){let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=r+" "+it(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox(t){let{checked:e}=t;return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){let{tokens:e}=t;return`<p>${this.parser.parseInline(e)}</p>\n`}table(t){let e="",r="";for(let i=0;i<t.header.length;i++)r+=this.tablecell(t.header[i]);e+=this.tablerow({text:r});let n="";for(let i=0;i<t.rows.length;i++){const e=t.rows[i];r="";for(let t=0;t<e.length;t++)r+=this.tablecell(e[t]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+n+"</table>\n"}tablerow(t){let{text:e}=t;return`<tr>\n${e}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong(t){let{tokens:e}=t;return`<strong>${this.parser.parseInline(e)}</strong>`}em(t){let{tokens:e}=t;return`<em>${this.parser.parseInline(e)}</em>`}codespan(t){let{text:e}=t;return`<code>${it(e,!0)}</code>`}br(t){return"<br>"}del(t){let{tokens:e}=t;return`<del>${this.parser.parseInline(e)}</del>`}link(t){let{href:e,title:r,tokens:n}=t;const i=this.parser.parseInline(n),a=at(e);if(null===a)return i;e=a;let o='<a href="'+e+'"';return r&&(o+=' title="'+it(r)+'"'),o+=">"+i+"</a>",o}image(t){let{href:e,title:r,text:n,tokens:i}=t;i&&(n=this.parser.parseInline(i,this.parser.textRenderer));const a=at(e);if(null===a)return it(n);e=a;let o=`<img src="${e}" alt="${n}"`;return r&&(o+=` title="${it(r)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:it(t.text)}}class dt{strong(t){let{text:e}=t;return e}em(t){let{text:e}=t;return e}codespan(t){let{text:e}=t;return e}del(t){let{text:e}=t;return e}html(t){let{text:e}=t;return e}text(t){let{text:e}=t;return e}link(t){let{text:e}=t;return""+e}image(t){let{text:e}=t;return""+e}br(){return""}}class pt{options;renderer;textRenderer;constructor(t){this.options=t||s,this.options.renderer=this.options.renderer||new ht,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dt}static parse(t,e){return new pt(e).parse(t)}static parseInline(t,e){return new pt(e).parseInline(t)}parse(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";for(let n=0;n<t.length;n++){const i=t[n];if(this.options.extensions?.renderers?.[i.type]){const t=i,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){r+=e||"";continue}}const a=i;switch(a.type){case"space":r+=this.renderer.space(a);continue;case"hr":r+=this.renderer.hr(a);continue;case"heading":r+=this.renderer.heading(a);continue;case"code":r+=this.renderer.code(a);continue;case"table":r+=this.renderer.table(a);continue;case"blockquote":r+=this.renderer.blockquote(a);continue;case"list":r+=this.renderer.list(a);continue;case"html":r+=this.renderer.html(a);continue;case"paragraph":r+=this.renderer.paragraph(a);continue;case"text":{let i=a,o=this.renderer.text(i);for(;n+1<t.length&&"text"===t[n+1].type;)i=t[++n],o+="\n"+this.renderer.text(i);r+=e?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}parseInline(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.renderer,r="";for(let n=0;n<t.length;n++){const i=t[n];if(this.options.extensions?.renderers?.[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=t||"";continue}}const a=i;switch(a.type){case"escape":case"text":r+=e.text(a);break;case"html":r+=e.html(a);break;case"link":r+=e.link(a);break;case"image":r+=e.image(a);break;case"strong":r+=e.strong(a);break;case"em":r+=e.em(a);break;case"codespan":r+=e.codespan(a);break;case"br":r+=e.br(a);break;case"del":r+=e.del(a);break;default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}}class ft{options;block;constructor(t){this.options=t||s}static passThroughHooks=(()=>new Set(["preprocess","postprocess","processAllTokens"]))();preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ut.lex:ut.lexInline}provideParser(){return this.block?pt.parse:pt.parseInline}}const mt=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=(()=>pt)();Renderer=(()=>ht)();TextRenderer=(()=>dt)();Lexer=(()=>ut)();Tokenizer=(()=>ct)();Hooks=(()=>ft)();constructor(){this.use(...arguments)}walkTokens(t,e){let r=[];for(const n of t)switch(r=r.concat(e.call(this,n)),n.type){case"table":{const t=n;for(const n of t.header)r=r.concat(this.walkTokens(n.tokens,e));for(const n of t.rows)for(const t of n)r=r.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=n;r=r.concat(this.walkTokens(t.items,e));break}default:{const t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((n=>{const i=t[n].flat(1/0);r=r.concat(this.walkTokens(i,e))})):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(){const t=this.defaults.extensions||{renderers:{},childTokens:{}};for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.forEach((e=>{const r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const r=t.renderers[e.name];t.renderers[e.name]=r?function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];let a=e.renderer.apply(this,n);return!1===a&&(a=r.apply(this,n)),a}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=this.defaults.renderer||new ht(this.defaults);for(const r in e.renderer){if(!(r in t))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=e.renderer[n],a=t[n];t[n]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];let o=i.apply(t,r);return!1===o&&(o=a.apply(t,r)),o||""}}r.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ct(this.defaults);for(const r in e.tokenizer){if(!(r in t))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=e.tokenizer[n],a=t[n];t[n]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];let o=i.apply(t,r);return!1===o&&(o=a.apply(t,r)),o}}r.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ft;for(const r in e.hooks){if(!(r in t))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const n=r,i=e.hooks[n],a=t[n];ft.passThroughHooks.has(r)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>a.call(t,e)));const r=i.call(t,e);return a.call(t,r)}:t[n]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];let o=i.apply(t,r);return!1===o&&(o=a.apply(t,r)),o}}r.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ut.lex(t,e??this.defaults)}parser(t,e){return pt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{const n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===n.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if("undefined"===typeof e||null===e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!==typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const o=i.hooks?i.hooks.provideLexer():t?ut.lex:ut.lexInline,s=i.hooks?i.hooks.provideParser():t?pt.parse:pt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then((t=>o(t,i))).then((t=>i.hooks?i.hooks.processAllTokens(t):t)).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>s(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let t=o(e,i);i.hooks&&(t=i.hooks.processAllTokens(t)),i.walkTokens&&this.walkTokens(t,i.walkTokens);let r=s(t,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(l){return a(l)}}}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+it(r.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}};function gt(t,e){return mt.parse(t,e)}gt.options=gt.setOptions=function(t){return mt.setOptions(t),gt.defaults=mt.defaults,l(gt.defaults),gt},gt.getDefaults=o,gt.defaults=s,gt.use=function(){return mt.use(...arguments),gt.defaults=mt.defaults,l(gt.defaults),gt},gt.walkTokens=function(t,e){return mt.walkTokens(t,e)},gt.parseInline=mt.parseInline,gt.Parser=pt,gt.parser=pt.parse,gt.Renderer=ht,gt.TextRenderer=dt,gt.Lexer=ut,gt.lexer=ut.lex,gt.Tokenizer=ct,gt.Hooks=ft,gt.parse=gt;gt.options,gt.setOptions,gt.use,gt.walkTokens,gt.parseInline,pt.parse,ut.lex;var yt=r(7330);function vt(t,e){let{markdownAutoWrap:r}=e;const n=t.replace(/<br\/>/g,"\n").replace(/\n{2,}/g,"\n"),i=(0,yt.T)(n);return!1===r?i.replace(/ /g,"&nbsp;"):i}function xt(t){const e=vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=gt.lexer(e),n=[[]];let a=0;function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";if("text"===t.type){t.text.split("\n").forEach(((t,r)=>{0!==r&&(a++,n.push([])),t.split(" ").forEach((t=>{(t=t.replace(/&#39;/g,"'"))&&n[a].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{o(e,t.type)})):"html"===t.type&&n[a].push({content:t.text,type:"normal"})}return(0,i.K2)(o,"processNode"),r.forEach((t=>{"paragraph"===t.type?t.tokens?.forEach((t=>{o(t)})):"html"===t.type&&n[a].push({content:t.text,type:"normal"})})),n}function bt(t){let{markdownAutoWrap:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=gt.lexer(t);function n(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):"strong"===t.type?`<strong>${t.tokens?.map(n).join("")}</strong>`:"em"===t.type?`<em>${t.tokens?.map(n).join("")}</em>`:"paragraph"===t.type?`<p>${t.tokens?.map(n).join("")}</p>`:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return(0,i.K2)(n,"output"),r.map(n).join("")}function _t(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function wt(t,e){return kt(t,[],_t(e.content),e.type)}function kt(t,e,r,n){if(0===r.length)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,o=[...e,i];return t([{content:o.join(""),type:n}])?kt(t,o,a,n):(0===e.length&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}function Tt(t,e){if(t.some((t=>{let{content:e}=t;return e.includes("\n")})))throw new Error("splitLineToFitWidth does not support newlines in the line");return St(t,e)}function St(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(0===t.length)return n.length>0&&r.push(n),r.length>0?r:[];let i="";" "===t[0].content&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},o=[...n];if(""!==i&&o.push({content:i,type:"normal"}),o.push(a),e(o))return St(t,e,r,o);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[n,i]=wt(e,a);r.push([n]),i.content&&t.unshift(i)}return St(t,e,r)}function At(t,e){e&&t.attr("style",e)}async function Mt(t,e,r,n){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=t.append("foreignObject");o.attr("width",10*r+"px"),o.attr("height",10*r+"px");const s=o.append("xhtml:div");let l=e.label;e.label&&(0,i.Wi)(e.label)&&(l=await(0,i.VJ)(e.label.replace(i.Y2.lineBreakRegex,"\n"),(0,i.D7)()));const c=e.isNode?"nodeLabel":"edgeLabel",u=s.append("span");u.html(l),At(u,e.labelStyle),u.attr("class",`${c} ${n}`),At(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&s.attr("class","labelBkg");let h=s.node().getBoundingClientRect();return h.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),h=s.node().getBoundingClientRect()),o.node()}function Ct(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function Et(t,e,r){const n=t.append("text"),i=Ct(n,1,e);It(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}function Lt(t,e,r){const n=t.append("text"),i=Ct(n,1,e);It(i,[{content:r,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function Pt(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=e.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),s=a.append("text").attr("y","-10.1");let l=0;for(const c of r){const e=(0,i.K2)((e=>Et(a,1.1,e)<=t),"checkWidth"),r=e(c)?[c]:Tt(c,e);for(const t of r){It(Ct(s,l,1.1),t),l++}}if(n){const t=s.node().getBBox(),e=2;return o.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),a.node()}return s.node()}function It(t,e){t.text(""),e.forEach(((e,r)=>{const n=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===r?n.text(e.content):n.text(" "+e.content)}))}function zt(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`))}(0,i.K2)(vt,"preprocessMarkdown"),(0,i.K2)(xt,"markdownToLines"),(0,i.K2)(bt,"markdownToHTML"),(0,i.K2)(_t,"splitTextToChars"),(0,i.K2)(wt,"splitWordToFitWidth"),(0,i.K2)(kt,"splitWordToFitWidthRecursion"),(0,i.K2)(Tt,"splitLineToFitWidth"),(0,i.K2)(St,"splitLineToFitWidthRecursion"),(0,i.K2)(At,"applyStyle"),(0,i.K2)(Mt,"addHtmlSpan"),(0,i.K2)(Ct,"createTspan"),(0,i.K2)(Et,"computeWidthOfText"),(0,i.K2)(Lt,"computeDimensionOfText"),(0,i.K2)(Pt,"createFormattedText"),(0,i.K2)(It,"updateTextContentAndStyles"),(0,i.K2)(zt,"replaceIconSubstring");var Ot=(0,i.K2)((async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{style:r="",isTitle:o=!1,classes:s="",useHtmlLabels:l=!0,isNode:c=!0,width:u=200,addSvgBackground:h=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(i.Rm.debug("XYZ createText",e,r,o,s,l,c,"addSvgBackground: ",h),l){const a=bt(e,d),o=zt((0,n.Sm)(a)),l=e.replace(/\\\\/g,"\\"),p={isNode:c,label:(0,i.Wi)(e)?l:o,labelStyle:r.replace("fill:","color:")};return await Mt(t,p,u,s,h)}{const n=Pt(u,t,xt(e.replace(/<br\s*\/?>/g,"<br/>").replace("<br>","<br/>"),d),!!e&&h);if(c){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");(0,a.Ltv)(n).attr("style",t)}else{const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");(0,a.Ltv)(n).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");(0,a.Ltv)(n).select("text").attr("style",e)}return n}}),"createText")},2598:(t,e,r)=>{"use strict";r.d(e,{R:()=>s});var n=r(3759),i={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function a(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=o(t),e=o(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,l=a-n;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}(0,n.K2)(a,"calculateDeltaAndAngle");var o=(0,n.K2)((t=>Array.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),s=(0,n.K2)((t=>({x:(0,n.K2)((function(e,r,n){let s=0;const l=o(n[0]).x<o(n[n.length-1]).x?"left":"right";if(0===r&&Object.hasOwn(i,t.arrowTypeStart)){const{angle:e,deltaX:r}=a(n[0],n[1]);s=i[t.arrowTypeStart]*Math.cos(e)*(r>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(i,t.arrowTypeEnd)){const{angle:e,deltaX:r}=a(n[n.length-1],n[n.length-2]);s=i[t.arrowTypeEnd]*Math.cos(e)*(r>=0?1:-1)}const c=Math.abs(o(e).x-o(n[n.length-1]).x),u=Math.abs(o(e).y-o(n[n.length-1]).y),h=Math.abs(o(e).x-o(n[0]).x),d=Math.abs(o(e).y-o(n[0]).y),p=i[t.arrowTypeStart],f=i[t.arrowTypeEnd];if(c<f&&c>0&&u<f){let t=f+1-c;t*="right"===l?-1:1,s-=t}if(h<p&&h>0&&d<p){let t=p+1-h;t*="right"===l?-1:1,s+=t}return o(e).x+s}),"x"),y:(0,n.K2)((function(e,r,n){let s=0;const l=o(n[0]).y<o(n[n.length-1]).y?"down":"up";if(0===r&&Object.hasOwn(i,t.arrowTypeStart)){const{angle:e,deltaY:r}=a(n[0],n[1]);s=i[t.arrowTypeStart]*Math.abs(Math.sin(e))*(r>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(i,t.arrowTypeEnd)){const{angle:e,deltaY:r}=a(n[n.length-1],n[n.length-2]);s=i[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(r>=0?1:-1)}const c=Math.abs(o(e).y-o(n[n.length-1]).y),u=Math.abs(o(e).x-o(n[n.length-1]).x),h=Math.abs(o(e).y-o(n[0]).y),d=Math.abs(o(e).x-o(n[0]).x),p=i[t.arrowTypeStart],f=i[t.arrowTypeEnd];if(c<f&&c>0&&u<f){let t=f+1-c;t*="up"===l?-1:1,s-=t}if(h<p&&h>0&&d<p){let t=p+1-h;t*="up"===l?-1:1,s+=t}return o(e).y+s}),"y")})),"getLineFunctionsWithOffset")},2799:(t,e)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(t,e,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==e.key&&(i=""+e.key),"key"in e)for(var a in n={},e)"key"!==a&&(n[a]=e[a]);else n=e;return e=n.ref,{$$typeof:r,type:t,key:i,ref:void 0!==e?e:null,props:n}}e.Fragment=n,e.jsx=i,e.jsxs=i},2805:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=function(e){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(i,e);var r=function(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=h(t);if(e){var a=h(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return function(t,e){if(e&&("object"===n(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}(this,r)}}(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this,t)).p=Promise.resolve(),e.resizeHandler=null,e.handlers={},e.syncWindowResize=e.syncWindowResize.bind(u(e)),e.syncEventHandlers=e.syncEventHandlers.bind(u(e)),e.attachUpdateEvents=e.attachUpdateEvents.bind(u(e)),e.getRef=e.getRef.bind(u(e)),e.handleUpdate=e.handleUpdate.bind(u(e)),e.figureCallback=e.figureCallback.bind(u(e)),e.updatePlotly=e.updatePlotly.bind(u(e)),e}return function(t,e,r){e&&l(t.prototype,e);r&&l(t,r);Object.defineProperty(t,"prototype",{writable:!1})}(i,[{key:"updatePlotly",value:function(e,r,n){var i=this;this.p=this.p.then((function(){if(!i.unmounting){if(!i.el)throw new Error("Missing element reference");return t.react(i.el,{data:i.props.data,layout:i.props.layout,config:i.props.config,frames:i.props.frames})}})).then((function(){i.unmounting||(i.syncWindowResize(e),i.syncEventHandlers(),i.figureCallback(r),n&&i.attachUpdateEvents())})).catch((function(t){i.props.onError&&i.props.onError(t)}))}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(t){this.unmounting=!1;var e=t.frames&&t.frames.length?t.frames.length:0,r=this.props.frames&&this.props.frames.length?this.props.frames.length:0,n=!(t.layout===this.props.layout&&t.data===this.props.data&&t.config===this.props.config&&r===e),i=void 0!==t.revision,a=t.revision!==this.props.revision;(n||i&&(!i||a))&&this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&f&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),t.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var t=this;this.el&&this.el.removeListener&&p.forEach((function(e){t.el.on(e,t.handleUpdate)}))}},{key:"removeUpdateEvents",value:function(){var t=this;this.el&&this.el.removeListener&&p.forEach((function(e){t.el.removeListener(e,t.handleUpdate)}))}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(t){if("function"===typeof t){var e=this.el;t({data:e.data,layout:e.layout,frames:this.el._transitionData?this.el._transitionData._frames:null},this.el)}}},{key:"syncWindowResize",value:function(e){var r=this;f&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return t.Plots.resize(r.el)},window.addEventListener("resize",this.resizeHandler),e&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(t){this.el=t,this.props.debug&&f&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var t=this;d.forEach((function(e){var r=t.props["on"+e],n=t.handlers[e],i=Boolean(n);r&&!i?t.addEventHandler(e,r):!r&&i?t.removeEventHandler(e):r&&i&&r!==n&&(t.removeEventHandler(e),t.addEventHandler(e,r))}))}},{key:"addEventHandler",value:function(t,e){this.handlers[t]=e,this.el.on(this.getPlotlyEventName(t),this.handlers[t])}},{key:"removeEventHandler",value:function(t){this.el.removeListener(this.getPlotlyEventName(t),this.handlers[t]),delete this.handlers[t]}},{key:"getPlotlyEventName",value:function(t){return"plotly_"+t.toLowerCase()}},{key:"render",value:function(){return a.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),i}(a.Component);return e.propTypes={data:o.default.arrayOf(o.default.object),config:o.default.object,layout:o.default.object,frames:o.default.arrayOf(o.default.object),revision:o.default.number,onInitialized:o.default.func,onPurge:o.default.func,onError:o.default.func,onUpdate:o.default.func,debug:o.default.bool,style:o.default.object,className:o.default.string,useResizeHandler:o.default.bool,divId:o.default.string},d.forEach((function(t){e.propTypes["on"+t]=o.default.func})),e.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},e};var i,a=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==n(t)&&"function"!==typeof t)return{default:t};var r=s(e);if(r&&r.has(t))return r.get(t);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var l=a?Object.getOwnPropertyDescriptor(t,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):i[o]=t[o]}i.default=t,r&&r.set(t,i);return i}(r(5043)),o=(i=r(5173))&&i.__esModule?i:{default:i};function s(t){if("function"!==typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(s=function(t){return t?r:e})(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}var d=["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"],p=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],f="undefined"!==typeof window},2863:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(7840);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n.A),r}i.Cache=n.A;const a=i},2880:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseLengthAndUnit=n,e.cssValue=function(t){var e=n(t);return"".concat(e.value).concat(e.unit)};var r={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function n(t){if("number"===typeof t)return{value:t,unit:"px"};var e,n=(t.match(/^[0-9.]*/)||"").toString();e=n.includes(".")?parseFloat(n):parseInt(n,10);var i=(t.match(/[^0-9]*$/)||"").toString();return r[i]?{value:e,unit:i}:(console.warn("React Spinners: ".concat(t," is not a valid css value. Defaulting to ").concat(e,"px.")),{value:e,unit:"px"})}},3084:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=(0,r(5674).A)(Object.getPrototypeOf,Object)},3101:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5920);const i=function(t,e,r){"__proto__"==e&&n.A?(0,n.A)(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},3218:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3239:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return null!=t&&"object"==typeof t}},3460:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(7790);const i=function(t,e){var r=e?(0,n.A)(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},3493:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(4067),i=r(3903);const a=function(t){return null!=t&&(0,i.A)(t.length)&&!(0,n.A)(t)}},3755:(t,e,r)=>{"use strict";e.J=void 0;var n=r(4830);function i(t){try{return decodeURIComponent(t)}catch(e){return t}}e.J=function(t){if(!t)return n.BLANK_URL;var e,r,a=i(t.trim());do{e=(a=i(a=(r=a,r.replace(n.ctrlCharactersRegex,"").replace(n.htmlEntitiesRegex,(function(t,e){return String.fromCharCode(e)}))).replace(n.htmlCtrlEntityRegex,"").replace(n.ctrlCharactersRegex,"").replace(n.whitespaceEscapeCharsRegex,"").trim())).match(n.ctrlCharactersRegex)||a.match(n.htmlEntitiesRegex)||a.match(n.htmlCtrlEntityRegex)||a.match(n.whitespaceEscapeCharsRegex)}while(e&&e.length>0);var o=a;if(!o)return n.BLANK_URL;if(function(t){return n.relativeFirstCharacters.indexOf(t[0])>-1}(o))return o;var s=o.trimStart(),l=s.match(n.urlSchemeRegex);if(!l)return o;var c=l[0].toLowerCase().trim();if(n.invalidProtocolRegex.test(c))return n.BLANK_URL;var u=s.replace(/\\/g,"/");if("mailto:"===c||c.includes("://"))return u;if("http:"===c||"https:"===c){if(!function(t){return URL.canParse(t)}(u))return n.BLANK_URL;var h=new URL(u);return h.protocol=h.protocol.toLowerCase(),h.hostname=h.hostname.toLowerCase(),h.toString()}return u}},3759:(t,e,r)=>{"use strict";r.d(e,{C0:()=>S,VA:()=>y,K2:()=>g,xA:()=>ht,hH:()=>I,Dl:()=>Nt,IU:()=>re,Wt:()=>Kt,Y2:()=>Vt,a$:()=>Ht,sb:()=>Q,ME:()=>pe,UI:()=>X,Ch:()=>M,mW:()=>A,DB:()=>k,_3:()=>Lt,EJ:()=>w,m7:()=>oe,iN:()=>ie,zj:()=>ct,D7:()=>he,Gs:()=>xe,J$:()=>L,ab:()=>le,Q2:()=>st,P$:()=>U,Wi:()=>jt,H1:()=>yt,Rm:()=>x,QO:()=>zt,Js:()=>ve,Xd:()=>C,VJ:()=>Ut,cL:()=>dt,$i:()=>K,jZ:()=>kt,oB:()=>fe,wZ:()=>at,EI:()=>ae,SV:()=>ne,Nk:()=>lt,XV:()=>de,ke:()=>se,He:()=>b,UU:()=>it,ot:()=>Wt,mj:()=>me,tM:()=>Xt,H$:()=>H,B6:()=>ot});var n=r(446),i=r(1458),a=r(6453);const o=(t,e)=>{const r=i.A.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return(0,a.A)(t,n)};var s=r(6471);const l=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;const{r:n,g:a,b:o,a:l}=i.A.parse(t),{r:c,g:u,b:h,a:d}=i.A.parse(e),p=r/100,f=2*p-1,m=l-d,g=((f*m===-1?f:(f+m)/(1+f*m))+1)/2,y=1-g,v=n*g+c*y,x=a*g+u*y,b=o*g+h*y,_=l*p+d*(1-p);return(0,s.A)(v,x,b,_)},c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const r=i.A.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,l(r,t,e)};var u,h=r(5554),d=r(6362),p=r(8194),f=r(7977),m=Object.defineProperty,g=(t,e)=>m(t,"name",{value:e,configurable:!0}),y=(t,e)=>{for(var r in e)m(t,r,{get:e[r],enumerable:!0})},v={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},x={trace:g((function(){}),"trace"),debug:g((function(){}),"debug"),info:g((function(){}),"info"),warn:g((function(){}),"warn"),error:g((function(){}),"error"),fatal:g((function(){}),"fatal")},b=g((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"fatal",e=v.fatal;"string"===typeof t?t.toLowerCase()in v&&(e=v[t]):"number"===typeof t&&(e=t),x.trace=()=>{},x.debug=()=>{},x.info=()=>{},x.warn=()=>{},x.error=()=>{},x.fatal=()=>{},e<=v.fatal&&(x.fatal=console.error?console.error.bind(console,_("FATAL"),"color: orange"):console.log.bind(console,"\x1b[35m",_("FATAL"))),e<=v.error&&(x.error=console.error?console.error.bind(console,_("ERROR"),"color: orange"):console.log.bind(console,"\x1b[31m",_("ERROR"))),e<=v.warn&&(x.warn=console.warn?console.warn.bind(console,_("WARN"),"color: orange"):console.log.bind(console,"\x1b[33m",_("WARN"))),e<=v.info&&(x.info=console.info?console.info.bind(console,_("INFO"),"color: lightblue"):console.log.bind(console,"\x1b[34m",_("INFO"))),e<=v.debug&&(x.debug=console.debug?console.debug.bind(console,_("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1b[32m",_("DEBUG"))),e<=v.trace&&(x.trace=console.debug?console.debug.bind(console,_("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1b[32m",_("TRACE")))}),"setLogLevel"),_=g((t=>`%c${n().format("ss.SSS")} : ${t} : `),"format"),w=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,k=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,T=/\s*%%.*\n/gm,S=class extends Error{static#t=(()=>g(this,"UnknownDiagramError"))();constructor(t){super(t),this.name="UnknownDiagramError"}},A={},M=g((function(t,e){t=t.replace(w,"").replace(k,"").replace(T,"\n");for(const[r,{detector:n}]of Object.entries(A)){if(n(t,e))return r}throw new S(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),C=g((function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(const{id:n,detector:i,loader:a}of e)E(n,i,a)}),"registerLazyLoadedDiagrams"),E=g(((t,e,r)=>{A[t]&&x.warn(`Detector with key ${t} already exists. Overwriting.`),A[t]={detector:e,loader:r},x.debug(`Detector with key ${t} added${r?" with loader":""}`)}),"addDetector"),L=g((t=>A[t].loader),"getDiagramLoader"),P=g((function(t,e){let{depth:r=2,clobber:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>P(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||r<=0?void 0!==t&&null!==t&&"object"===typeof t&&"object"===typeof e?Object.assign(t,e):e:(void 0!==e&&"object"===typeof t&&"object"===typeof e&&Object.keys(e).forEach((i=>{"object"!==typeof e[i]||void 0!==t[i]&&"object"!==typeof t[i]?(n||"object"!==typeof t[i]&&"object"!==typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=P(t[i],e[i],{depth:r-1,clobber:n}))})),t)}),"assignWithDepth"),I=P,z="#ffffff",O="#f2f2f2",D=g(((t,e)=>o(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),R=class{static#t=(()=>g(this,"Theme"))();constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||o(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||o(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||D(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||D(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||D(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||D(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||c(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||c(this.tertiaryColor),this.lineColor=this.lineColor||c(this.background),this.arrowheadColor=this.arrowheadColor||c(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?(0,h.A)(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||(0,h.A)(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||c(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||(0,d.A)(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||(0,h.A)(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||(0,h.A)(this.mainBkg,10)):(this.rowOdd=this.rowOdd||(0,d.A)(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||(0,d.A)(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||o(this.primaryColor,{h:30}),this.cScale4=this.cScale4||o(this.primaryColor,{h:60}),this.cScale5=this.cScale5||o(this.primaryColor,{h:90}),this.cScale6=this.cScale6||o(this.primaryColor,{h:120}),this.cScale7=this.cScale7||o(this.primaryColor,{h:150}),this.cScale8=this.cScale8||o(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||o(this.primaryColor,{h:270}),this.cScale10=this.cScale10||o(this.primaryColor,{h:300}),this.cScale11=this.cScale11||o(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=(0,h.A)(this["cScale"+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=(0,h.A)(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||c(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||(0,d.A)(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||(0,h.A)(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||o(this.mainBkg,{h:180,s:-15,l:t*(5+3*e)}),this["surfacePeer"+e]=this["surfacePeer"+e]||o(this.mainBkg,{h:180,s:-15,l:t*(8+3*e)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||o(this.primaryColor,{h:64}),this.fillType3=this.fillType3||o(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||o(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||o(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||o(this.primaryColor,{h:128}),this.fillType7=this.fillType7||o(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||o(this.primaryColor,{l:-10}),this.pie5=this.pie5||o(this.secondaryColor,{l:-10}),this.pie6=this.pie6||o(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||o(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||o(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||o(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||o(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||o(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||o(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||o(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||o(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||o(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||o(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||o(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||o(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||(0,p.A)(this.quadrant1Fill)?(0,d.A)(this.quadrant1Fill):(0,h.A)(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?(0,h.A)(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||o(this.primaryColor,{h:-30}),this.git4=this.git4||o(this.primaryColor,{h:-60}),this.git5=this.git5||o(this.primaryColor,{h:-90}),this.git6=this.git6||o(this.primaryColor,{h:60}),this.git7=this.git7||o(this.primaryColor,{h:120}),this.darkMode?(this.git0=(0,d.A)(this.git0,25),this.git1=(0,d.A)(this.git1,25),this.git2=(0,d.A)(this.git2,25),this.git3=(0,d.A)(this.git3,25),this.git4=(0,d.A)(this.git4,25),this.git5=(0,d.A)(this.git5,25),this.git6=(0,d.A)(this.git6,25),this.git7=(0,d.A)(this.git7,25)):(this.git0=(0,h.A)(this.git0,25),this.git1=(0,h.A)(this.git1,25),this.git2=(0,h.A)(this.git2,25),this.git3=(0,h.A)(this.git3,25),this.git4=(0,h.A)(this.git4,25),this.git5=(0,h.A)(this.git5,25),this.git6=(0,h.A)(this.git6,25),this.git7=(0,h.A)(this.git7,25)),this.gitInv0=this.gitInv0||c(this.git0),this.gitInv1=this.gitInv1||c(this.git1),this.gitInv2=this.gitInv2||c(this.git2),this.gitInv3=this.gitInv3||c(this.git3),this.gitInv4=this.gitInv4||c(this.git4),this.gitInv5=this.gitInv5||c(this.git5),this.gitInv6=this.gitInv6||c(this.git6),this.gitInv7=this.gitInv7||c(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||z,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O}calculate(t){if("object"!==typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},F=g((t=>{const e=new R;return e.calculate(t),e}),"getThemeVariables"),B=class{static#t=(()=>g(this,"Theme"))();constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=(0,d.A)(this.primaryColor,16),this.tertiaryColor=o(this.primaryColor,{h:-160}),this.primaryBorderColor=c(this.background),this.secondaryBorderColor=D(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=D(this.tertiaryColor,this.darkMode),this.primaryTextColor=c(this.primaryColor),this.secondaryTextColor=c(this.secondaryColor),this.tertiaryTextColor=c(this.tertiaryColor),this.lineColor=c(this.background),this.textColor=c(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=(0,d.A)(c("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=(0,s.A)(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=(0,h.A)("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=(0,h.A)(this.sectionBkgColor,10),this.taskBorderColor=(0,s.A)(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=(0,s.A)(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||(0,d.A)(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||(0,h.A)(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=(0,d.A)(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=(0,d.A)(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=(0,d.A)(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=o(this.primaryColor,{h:64}),this.fillType3=o(this.secondaryColor,{h:64}),this.fillType4=o(this.primaryColor,{h:-64}),this.fillType5=o(this.secondaryColor,{h:-64}),this.fillType6=o(this.primaryColor,{h:128}),this.fillType7=o(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||o(this.primaryColor,{h:30}),this.cScale4=this.cScale4||o(this.primaryColor,{h:60}),this.cScale5=this.cScale5||o(this.primaryColor,{h:90}),this.cScale6=this.cScale6||o(this.primaryColor,{h:120}),this.cScale7=this.cScale7||o(this.primaryColor,{h:150}),this.cScale8=this.cScale8||o(this.primaryColor,{h:210}),this.cScale9=this.cScale9||o(this.primaryColor,{h:270}),this.cScale10=this.cScale10||o(this.primaryColor,{h:300}),this.cScale11=this.cScale11||o(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||c(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||(0,d.A)(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||o(this.mainBkg,{h:30,s:-30,l:-(4*t-10)}),this["surfacePeer"+t]=this["surfacePeer"+t]||o(this.mainBkg,{h:30,s:-30,l:-(4*t-7)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||o(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||o(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||o(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||o(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||o(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||o(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||(0,p.A)(this.quadrant1Fill)?(0,d.A)(this.quadrant1Fill):(0,h.A)(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?(0,h.A)(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=(0,d.A)(this.secondaryColor,20),this.git1=(0,d.A)(this.pie2||this.secondaryColor,20),this.git2=(0,d.A)(this.pie3||this.tertiaryColor,20),this.git3=(0,d.A)(this.pie4||o(this.primaryColor,{h:-30}),20),this.git4=(0,d.A)(this.pie5||o(this.primaryColor,{h:-60}),20),this.git5=(0,d.A)(this.pie6||o(this.primaryColor,{h:-90}),10),this.git6=(0,d.A)(this.pie7||o(this.primaryColor,{h:60}),10),this.git7=(0,d.A)(this.pie8||o(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||c(this.git0),this.gitInv1=this.gitInv1||c(this.git1),this.gitInv2=this.gitInv2||c(this.git2),this.gitInv3=this.gitInv3||c(this.git3),this.gitInv4=this.gitInv4||c(this.git4),this.gitInv5=this.gitInv5||c(this.git5),this.gitInv6=this.gitInv6||c(this.git6),this.gitInv7=this.gitInv7||c(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||c(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||c(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||(0,d.A)(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||(0,d.A)(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if("object"!==typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},j=g((t=>{const e=new B;return e.calculate(t),e}),"getThemeVariables"),N=class{static#t=(()=>g(this,"Theme"))();constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=o(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=o(this.primaryColor,{h:-160}),this.primaryBorderColor=D(this.primaryColor,this.darkMode),this.secondaryBorderColor=D(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=D(this.tertiaryColor,this.darkMode),this.primaryTextColor=c(this.primaryColor),this.secondaryTextColor=c(this.secondaryColor),this.tertiaryTextColor=c(this.tertiaryColor),this.lineColor=c(this.background),this.textColor=c(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.sectionBkgColor=(0,s.A)(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||o(this.primaryColor,{h:30}),this.cScale4=this.cScale4||o(this.primaryColor,{h:60}),this.cScale5=this.cScale5||o(this.primaryColor,{h:90}),this.cScale6=this.cScale6||o(this.primaryColor,{h:120}),this.cScale7=this.cScale7||o(this.primaryColor,{h:150}),this.cScale8=this.cScale8||o(this.primaryColor,{h:210}),this.cScale9=this.cScale9||o(this.primaryColor,{h:270}),this.cScale10=this.cScale10||o(this.primaryColor,{h:300}),this.cScale11=this.cScale11||o(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||(0,h.A)(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||(0,h.A)(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=(0,h.A)(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||(0,h.A)(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||o(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||o(this.mainBkg,{h:30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||o(this.mainBkg,{h:30,l:-(7+5*t)});if(this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,"calculated"!==this.labelTextColor){this.cScaleLabel0=this.cScaleLabel0||c(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||c(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=(0,d.A)(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||(0,d.A)(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||(0,d.A)(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=o(this.primaryColor,{h:64}),this.fillType3=o(this.secondaryColor,{h:64}),this.fillType4=o(this.primaryColor,{h:-64}),this.fillType5=o(this.secondaryColor,{h:-64}),this.fillType6=o(this.primaryColor,{h:128}),this.fillType7=o(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||o(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||o(this.primaryColor,{l:-10}),this.pie5=this.pie5||o(this.secondaryColor,{l:-30}),this.pie6=this.pie6||o(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||o(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||o(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||o(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||o(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||o(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||o(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||o(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||o(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||o(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||o(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||o(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||o(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||(0,p.A)(this.quadrant1Fill)?(0,d.A)(this.quadrant1Fill):(0,h.A)(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||o(this.primaryColor,{h:-30}),this.git4=this.git4||o(this.primaryColor,{h:-60}),this.git5=this.git5||o(this.primaryColor,{h:-90}),this.git6=this.git6||o(this.primaryColor,{h:60}),this.git7=this.git7||o(this.primaryColor,{h:120}),this.darkMode?(this.git0=(0,d.A)(this.git0,25),this.git1=(0,d.A)(this.git1,25),this.git2=(0,d.A)(this.git2,25),this.git3=(0,d.A)(this.git3,25),this.git4=(0,d.A)(this.git4,25),this.git5=(0,d.A)(this.git5,25),this.git6=(0,d.A)(this.git6,25),this.git7=(0,d.A)(this.git7,25)):(this.git0=(0,h.A)(this.git0,25),this.git1=(0,h.A)(this.git1,25),this.git2=(0,h.A)(this.git2,25),this.git3=(0,h.A)(this.git3,25),this.git4=(0,h.A)(this.git4,25),this.git5=(0,h.A)(this.git5,25),this.git6=(0,h.A)(this.git6,25),this.git7=(0,h.A)(this.git7,25)),this.gitInv0=this.gitInv0||(0,h.A)(c(this.git0),25),this.gitInv1=this.gitInv1||c(this.git1),this.gitInv2=this.gitInv2||c(this.git2),this.gitInv3=this.gitInv3||c(this.git3),this.gitInv4=this.gitInv4||c(this.git4),this.gitInv5=this.gitInv5||c(this.git5),this.gitInv6=this.gitInv6||c(this.git6),this.gitInv7=this.gitInv7||c(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||c(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||c(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||z,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O}calculate(t){if(Object.keys(this).forEach((t=>{"calculated"===this[t]&&(this[t]=void 0)})),"object"!==typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},U=g((t=>{const e=new N;return e.calculate(t),e}),"getThemeVariables"),V=class{static#t=(()=>g(this,"Theme"))();constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=(0,d.A)("#cde498",10),this.primaryBorderColor=D(this.primaryColor,this.darkMode),this.secondaryBorderColor=D(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=D(this.tertiaryColor,this.darkMode),this.primaryTextColor=c(this.primaryColor),this.secondaryTextColor=c(this.secondaryColor),this.tertiaryTextColor=c(this.primaryColor),this.lineColor=c(this.background),this.textColor=c(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=(0,h.A)(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||o(this.primaryColor,{h:30}),this.cScale4=this.cScale4||o(this.primaryColor,{h:60}),this.cScale5=this.cScale5||o(this.primaryColor,{h:90}),this.cScale6=this.cScale6||o(this.primaryColor,{h:120}),this.cScale7=this.cScale7||o(this.primaryColor,{h:150}),this.cScale8=this.cScale8||o(this.primaryColor,{h:210}),this.cScale9=this.cScale9||o(this.primaryColor,{h:270}),this.cScale10=this.cScale10||o(this.primaryColor,{h:300}),this.cScale11=this.cScale11||o(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||(0,h.A)(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||(0,h.A)(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=(0,h.A)(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||(0,h.A)(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||o(this["cScale"+t],{h:180});this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||o(this.mainBkg,{h:30,s:-30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||o(this.mainBkg,{h:30,s:-30,l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||(0,d.A)(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||(0,d.A)(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=o(this.primaryColor,{h:64}),this.fillType3=o(this.secondaryColor,{h:64}),this.fillType4=o(this.primaryColor,{h:-64}),this.fillType5=o(this.secondaryColor,{h:-64}),this.fillType6=o(this.primaryColor,{h:128}),this.fillType7=o(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||o(this.primaryColor,{l:-30}),this.pie5=this.pie5||o(this.secondaryColor,{l:-30}),this.pie6=this.pie6||o(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||o(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||o(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||o(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||o(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||o(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||o(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||o(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||o(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||o(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||o(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||o(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||o(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||(0,p.A)(this.quadrant1Fill)?(0,d.A)(this.quadrant1Fill):(0,h.A)(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||o(this.primaryColor,{h:-30}),this.git4=this.git4||o(this.primaryColor,{h:-60}),this.git5=this.git5||o(this.primaryColor,{h:-90}),this.git6=this.git6||o(this.primaryColor,{h:60}),this.git7=this.git7||o(this.primaryColor,{h:120}),this.darkMode?(this.git0=(0,d.A)(this.git0,25),this.git1=(0,d.A)(this.git1,25),this.git2=(0,d.A)(this.git2,25),this.git3=(0,d.A)(this.git3,25),this.git4=(0,d.A)(this.git4,25),this.git5=(0,d.A)(this.git5,25),this.git6=(0,d.A)(this.git6,25),this.git7=(0,d.A)(this.git7,25)):(this.git0=(0,h.A)(this.git0,25),this.git1=(0,h.A)(this.git1,25),this.git2=(0,h.A)(this.git2,25),this.git3=(0,h.A)(this.git3,25),this.git4=(0,h.A)(this.git4,25),this.git5=(0,h.A)(this.git5,25),this.git6=(0,h.A)(this.git6,25),this.git7=(0,h.A)(this.git7,25)),this.gitInv0=this.gitInv0||c(this.git0),this.gitInv1=this.gitInv1||c(this.git1),this.gitInv2=this.gitInv2||c(this.git2),this.gitInv3=this.gitInv3||c(this.git3),this.gitInv4=this.gitInv4||c(this.git4),this.gitInv5=this.gitInv5||c(this.git5),this.gitInv6=this.gitInv6||c(this.git6),this.gitInv7=this.gitInv7||c(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||c(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||c(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||z,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O}calculate(t){if("object"!==typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},q=g((t=>{const e=new V;return e.calculate(t),e}),"getThemeVariables"),$=class{static#t=(()=>g(this,"Theme"))();constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=(0,d.A)(this.contrast,55),this.background="#ffffff",this.tertiaryColor=o(this.primaryColor,{h:-160}),this.primaryBorderColor=D(this.primaryColor,this.darkMode),this.secondaryBorderColor=D(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=D(this.tertiaryColor,this.darkMode),this.primaryTextColor=c(this.primaryColor),this.secondaryTextColor=c(this.secondaryColor),this.tertiaryTextColor=c(this.tertiaryColor),this.lineColor=c(this.background),this.textColor=c(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||(0,d.A)(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=(0,d.A)(this.contrast,55),this.border2=this.contrast,this.actorBorder=(0,d.A)(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||c(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||(0,d.A)(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||(0,h.A)(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||o(this.mainBkg,{l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||o(this.mainBkg,{l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=(0,d.A)(this.contrast,30),this.sectionBkgColor2=(0,d.A)(this.contrast,30),this.taskBorderColor=(0,h.A)(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=(0,d.A)(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=(0,h.A)(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=o(this.primaryColor,{h:64}),this.fillType3=o(this.secondaryColor,{h:64}),this.fillType4=o(this.primaryColor,{h:-64}),this.fillType5=o(this.secondaryColor,{h:-64}),this.fillType6=o(this.primaryColor,{h:128}),this.fillType7=o(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||o(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||o(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||o(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||o(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||o(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||o(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||(0,p.A)(this.quadrant1Fill)?(0,d.A)(this.quadrant1Fill):(0,h.A)(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=(0,h.A)(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||o(this.primaryColor,{h:-30}),this.git4=this.pie5||o(this.primaryColor,{h:-60}),this.git5=this.pie6||o(this.primaryColor,{h:-90}),this.git6=this.pie7||o(this.primaryColor,{h:60}),this.git7=this.pie8||o(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||c(this.git0),this.gitInv1=this.gitInv1||c(this.git1),this.gitInv2=this.gitInv2||c(this.git2),this.gitInv3=this.gitInv3||c(this.git3),this.gitInv4=this.gitInv4||c(this.git4),this.gitInv5=this.gitInv5||c(this.git5),this.gitInv6=this.gitInv6||c(this.git6),this.gitInv7=this.gitInv7||c(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||z,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O}calculate(t){if("object"!==typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},H={base:{getThemeVariables:F},dark:{getThemeVariables:j},default:{getThemeVariables:U},forest:{getThemeVariables:q},neutral:{getThemeVariables:g((t=>{const e=new $;return e.calculate(t),e}),"getThemeVariables")}},W={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},G={...W,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:H.default.getThemeVariables(),sequence:{...W.sequence,messageFont:g((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:g((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:g((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...W.gantt,tickInterval:void 0,useWidth:void 0},c4:{...W.c4,useWidth:void 0,personFont:g((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:g((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:g((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:g((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:g((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:g((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:g((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:g((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:g((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:g((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:g((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:g((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:g((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:g((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:g((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:g((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:g((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:g((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:g((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:g((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:g((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:g((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...W.pie,useWidth:984},xyChart:{...W.xyChart,useWidth:void 0},requirement:{...W.requirement,useWidth:void 0},packet:{...W.packet},radar:{...W.radar}},Y=g((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).reduce(((r,n)=>Array.isArray(t[n])?r:"object"===typeof t[n]&&null!==t[n]?[...r,e+n,...Y(t[n],"")]:[...r,e+n]),[])}),"keyify"),Z=new Set(Y(G,"")),X=G,K=g((t=>{if(x.debug("sanitizeDirective called with",t),"object"===typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>K(t)));else{for(const e of Object.keys(t)){if(x.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Z.has(e)||null==t[e]){x.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"===typeof t[e]){x.debug("sanitizing object",e),K(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(x.debug("sanitizing css option",e),t[e]=J(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}x.debug("After sanitization",t)}}),"sanitizeDirective"),J=g((t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";"{"===n?e++:"}"===n&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t}),"sanitizeCss"),Q=Object.freeze(X),tt=I({},Q),et=[],rt=I({},Q),nt=g(((t,e)=>{let r=I({},t),n={};for(const i of e)ut(i),n=I(n,i);if(r=I(r,n),n.theme&&n.theme in H){const t=I({},u),e=I(t.themeVariables||{},n.themeVariables);r.theme&&r.theme in H&&(r.themeVariables=H[r.theme].getThemeVariables(e))}return gt(rt=r),rt}),"updateCurrentConfig"),it=g((t=>(tt=I({},Q),tt=I(tt,t),t.theme&&H[t.theme]&&(tt.themeVariables=H[t.theme].getThemeVariables(t.themeVariables)),nt(tt,et),tt)),"setSiteConfig"),at=g((t=>{u=I({},t)}),"saveConfigFromInitialize"),ot=g((t=>(tt=I(tt,t),nt(tt,et),tt)),"updateSiteConfig"),st=g((()=>I({},tt)),"getSiteConfig"),lt=g((t=>(gt(t),I(rt,t),ct())),"setConfig"),ct=g((()=>I({},rt)),"getConfig"),ut=g((t=>{t&&(["secure",...tt.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(x.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{e.startsWith("__")&&delete t[e]})),Object.keys(t).forEach((e=>{"string"===typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"===typeof t[e]&&ut(t[e])})))}),"sanitize"),ht=g((t=>{K(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),et.push(t),nt(tt,et)}),"addDirective"),dt=g((function(){nt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:tt,et=[])}),"reset"),pt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},ft={},mt=g((t=>{ft[t]||(x.warn(pt[t]),ft[t]=!0)}),"issueWarning"),gt=g((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&mt("LAZY_LOAD_DEPRECATED")}),"checkConfig"),yt=/<br\s*\/?>/gi,vt=g((t=>{if(!t)return[""];return Ct(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),xt=(()=>{let t=!1;return()=>{t||(bt(),t=!0)}})();function bt(){const t="data-temp-href-target";f.A.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),f.A.addHook("afterSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))}))}g(bt,"setupDompurifyHooks");var _t=g((t=>{xt();return f.A.sanitize(t)}),"removeScript"),wt=g(((t,e)=>{if(!1!==e.flowchart?.htmlLabels){const r=e.securityLevel;"antiscript"===r||"strict"===r?t=_t(t):"loose"!==r&&(t=(t=(t=Ct(t)).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/=/g,"&equals;"),t=Mt(t))}return t}),"sanitizeMore"),kt=g(((t,e)=>t?t=e.dompurifyConfig?f.A.sanitize(wt(t,e),e.dompurifyConfig).toString():f.A.sanitize(wt(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),Tt=g(((t,e)=>"string"===typeof t?kt(t,e):t.flat().map((t=>kt(t,e)))),"sanitizeTextOrArray"),St=g((t=>yt.test(t)),"hasBreaks"),At=g((t=>t.split(yt)),"splitBreaks"),Mt=g((t=>t.replace(/#br#/g,"<br/>")),"placeholderToBreak"),Ct=g((t=>t.replace(yt,"#br#")),"breakToPlaceholder"),Et=g((t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e}),"getUrl"),Lt=g((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Pt=g((function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e.filter((t=>!isNaN(t)));return Math.max(...n)}),"getMax"),It=g((function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e.filter((t=>!isNaN(t)));return Math.min(...n)}),"getMin"),zt=g((function(t){const e=t.split(/(,)/),r=[];for(let n=0;n<e.length;n++){let t=e[n];if(","===t&&n>0&&n+1<e.length){const i=e[n-1],a=e[n+1];Dt(i,a)&&(t=i+","+a,n++,r.pop())}r.push(Rt(t))}return r.join("")}),"parseGenericTypes"),Ot=g(((t,e)=>Math.max(0,t.split(e).length-1)),"countOccurrence"),Dt=g(((t,e)=>{const r=Ot(t,"~"),n=Ot(e,"~");return 1===r&&1===n}),"shouldCombineSets"),Rt=g((t=>{const e=Ot(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")}),"processSet"),Ft=g((()=>void 0!==window.MathMLElement),"isMathMLSupported"),Bt=/\$\$(.*)\$\$/g,jt=g((t=>(t.match(Bt)?.length??0)>0),"hasKatex"),Nt=g((async(t,e)=>{t=await Ut(t,e);const r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n?.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i}),"calculateMathMLDimensions"),Ut=g((async(t,e)=>{if(!jt(t))return t;if(!(Ft()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Bt,"MathML is unsupported in this environment.");const{default:n}=await r.e(349).then(r.bind(r,349)),i=e.forceLegacyMathML||!Ft()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(yt).map((t=>jt(t)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${t}</div>`:`<div>${t}</div>`)).join("").replace(Bt,((t,e)=>n.renderToString(e,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,"")))}),"renderKatex"),Vt={getRows:vt,sanitizeText:kt,sanitizeTextOrArray:Tt,hasBreaks:St,splitBreaks:At,lineBreakRegex:yt,removeScript:_t,getUrl:Et,evaluate:Lt,getMax:Pt,getMin:It},qt=g((function(t,e){for(let r of e)t.attr(r[0],r[1])}),"d3Attrs"),$t=g((function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n}),"calculateSvgSizeAttrs"),Ht=g((function(t,e,r,n){const i=$t(e,r,n);qt(t,i)}),"configureSvgSize"),Wt=g((function(t,e,r,n){const i=e.node().getBBox(),a=i.width,o=i.height;x.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;x.info(`Graph bounds: ${s}x${l}`,t),s=a+2*r,l=o+2*r,x.info(`Calculated bounds: ${s}x${l}`),Ht(e,l,s,n);const c=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Gt={},Yt=g(((t,e,r)=>{let n="";return t in Gt&&Gt[t]?n=Gt[t](r):x.warn(`No theme found for ${t}`),` & {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n fill: ${r.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\n }\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${r.errorBkgColor};\n }\n & .error-text {\n fill: ${r.errorTextColor};\n stroke: ${r.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 1px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n & .edge-thickness-invisible {\n stroke-width: 0;\n fill: none;\n }\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${r.lineColor};\n stroke: ${r.lineColor};\n }\n & .marker.cross {\n stroke: ${r.lineColor};\n }\n\n & svg {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${n}\n\n ${e}\n`}),"getStyles"),Zt=g(((t,e)=>{void 0!==e&&(Gt[t]=e)}),"addStylesForDiagram"),Xt=Yt,Kt={};y(Kt,{clear:()=>re,getAccDescription:()=>oe,getAccTitle:()=>ie,getDiagramTitle:()=>le,setAccDescription:()=>ae,setAccTitle:()=>ne,setDiagramTitle:()=>se});var Jt="",Qt="",te="",ee=g((t=>kt(t,ct())),"sanitizeText"),re=g((()=>{Jt="",te="",Qt=""}),"clear"),ne=g((t=>{Jt=ee(t).replace(/^\s+/g,"")}),"setAccTitle"),ie=g((()=>Jt),"getAccTitle"),ae=g((t=>{te=ee(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),oe=g((()=>te),"getAccDescription"),se=g((t=>{Qt=ee(t)}),"setDiagramTitle"),le=g((()=>Qt),"getDiagramTitle"),ce=x,ue=b,he=ct,de=lt,pe=Q,fe=g((t=>kt(t,he())),"sanitizeText"),me=Wt,ge=g((()=>Kt),"getCommonDb"),ye={},ve=g(((t,e,r)=>{ye[t]&&ce.warn(`Diagram with id ${t} already registered. Overwriting.`),ye[t]=e,r&&E(t,r),Zt(t,e.styles),e.injectUtils?.(ce,ue,he,fe,me,ge(),(()=>{}))}),"registerDiagram"),xe=g((t=>{if(t in ye)return ye[t];throw new be(t)}),"getDiagram"),be=class extends Error{static#t=(()=>g(this,"DiagramNotFoundError"))();constructor(t){super(`Diagram ${t} not found.`)}}},3763:(t,e,r)=>{"use strict";t.exports=r(4983)},3903:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3957:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var n=r(3759),i=r(700),a=(0,n.K2)((t=>{const{securityLevel:e}=(0,n.D7)();let r=(0,i.Ltv)("body");if("sandbox"===e){const e=(0,i.Ltv)(`#i${t}`),n=e.node()?.contentDocument??document;r=(0,i.Ltv)(n.body)}return r.select(`#${t}`)}),"selectSvgElement")},4067:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(4802),i=r(7664);const a=function(t){if(!(0,i.A)(t))return!1;var e=(0,n.A)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},4186:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(7170),i=r(5481);const a=class{constructor(){this.type=i.Z.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=i.Z.ALL}is(t){return this.type===t}};const o=new class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new a}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=i.Z.ALL,this}_ensureHSL(){const t=this.data,{h:e,s:r,l:i}=t;void 0===e&&(t.h=n.A.channel.rgb2hsl(t,"h")),void 0===r&&(t.s=n.A.channel.rgb2hsl(t,"s")),void 0===i&&(t.l=n.A.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:r,b:i}=t;void 0===e&&(t.r=n.A.channel.hsl2rgb(t,"r")),void 0===r&&(t.g=n.A.channel.hsl2rgb(t,"g")),void 0===i&&(t.b=n.A.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(i.Z.HSL)||void 0===e?(this._ensureHSL(),n.A.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(i.Z.HSL)||void 0===e?(this._ensureHSL(),n.A.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(i.Z.HSL)||void 0===e?(this._ensureHSL(),n.A.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(i.Z.RGB)||void 0===e?(this._ensureRGB(),n.A.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(i.Z.RGB)||void 0===e?(this._ensureRGB(),n.A.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(i.Z.RGB)||void 0===e?(this._ensureRGB(),n.A.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(i.Z.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(i.Z.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(i.Z.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(i.Z.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(i.Z.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(i.Z.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}({r:0,g:0,b:0,a:0},"transparent")},4288:(t,e)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||f}function v(){}function x(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||f}y.prototype.isReactComponent={},y.prototype.setState=function(t,e){if("object"!==typeof t&&"function"!==typeof t&&null!=t)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},v.prototype=y.prototype;var b=x.prototype=new v;b.constructor=x,m(b,y.prototype),b.isPureReactComponent=!0;var _=Array.isArray,w={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function T(t,e,n,i,a,o){return n=o.ref,{$$typeof:r,type:t,key:e,ref:void 0!==n?n:null,props:o}}function S(t){return"object"===typeof t&&null!==t&&t.$$typeof===r}var A=/\/+/g;function M(t,e){return"object"===typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function C(){}function E(t,e,i,a,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l,c,u=!1;if(null===t)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case r:case n:u=!0;break;case d:return E((u=t._init)(t._payload),e,i,a,o)}}if(u)return o=o(t),u=""===a?"."+M(t,0):a,_(o)?(i="",null!=u&&(i=u.replace(A,"$&/")+"/"),E(o,e,i,"",(function(t){return t}))):null!=o&&(S(o)&&(l=o,c=i+(null==o.key||t&&t.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+u,o=T(l.type,c,void 0,0,0,l.props)),e.push(o)),1;u=0;var h,f=""===a?".":a+":";if(_(t))for(var m=0;m<t.length;m++)u+=E(a=t[m],e,i,s=f+M(a,m),o);else if("function"===typeof(m=null===(h=t)||"object"!==typeof h?null:"function"===typeof(h=p&&h[p]||h["@@iterator"])?h:null))for(t=m.call(t),m=0;!(a=t.next()).done;)u+=E(a=a.value,e,i,s=f+M(a,m++),o);else if("object"===s){if("function"===typeof t.then)return E(function(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch("string"===typeof t.status?t.then(C,C):(t.status="pending",t.then((function(e){"pending"===t.status&&(t.status="fulfilled",t.value=e)}),(function(e){"pending"===t.status&&(t.status="rejected",t.reason=e)}))),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}(t),e,i,a,o);throw e=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return u}function L(t,e,r){if(null==t)return t;var n=[],i=0;return E(t,n,"","",(function(t){return e.call(r,t,i++)})),n}function P(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var I="function"===typeof reportError?reportError:function(t){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof t&&null!==t&&"string"===typeof t.message?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)};function z(){}e.Children={map:L,forEach:function(t,e,r){L(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return L(t,(function(){e++})),e},toArray:function(t){return L(t,(function(t){return t}))||[]},only:function(t){if(!S(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},e.Component=y,e.Fragment=i,e.Profiler=o,e.PureComponent=x,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.act=function(){throw Error("act(...) is not supported in production builds of React.")},e.cache=function(t){return function(){return t.apply(null,arguments)}},e.cloneElement=function(t,e,r){if(null===t||void 0===t)throw Error("The argument must be a React element, but you passed "+t+".");var n=m({},t.props),i=t.key;if(null!=e)for(a in void 0!==e.ref&&void 0,void 0!==e.key&&(i=""+e.key),e)!k.call(e,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===e.ref||(n[a]=e[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];n.children=o}return T(t.type,i,void 0,0,0,n)},e.createContext=function(t){return(t={$$typeof:l,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider=t,t.Consumer={$$typeof:s,_context:t},t},e.createElement=function(t,e,r){var n,i={},a=null;if(null!=e)for(n in void 0!==e.key&&(a=""+e.key),e)k.call(e,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(i[n]=e[n]);var o=arguments.length-2;if(1===o)i.children=r;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(t&&t.defaultProps)for(n in o=t.defaultProps)void 0===i[n]&&(i[n]=o[n]);return T(t,a,void 0,0,0,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:c,render:t}},e.isValidElement=S,e.lazy=function(t){return{$$typeof:d,_payload:{_status:-1,_result:t},_init:P}},e.memo=function(t,e){return{$$typeof:h,type:t,compare:void 0===e?null:e}},e.startTransition=function(t){var e=w.T,r={};w.T=r;try{var n=t(),i=w.S;null!==i&&i(r,n),"object"===typeof n&&null!==n&&"function"===typeof n.then&&n.then(z,I)}catch(a){I(a)}finally{w.T=e}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(t){return w.H.use(t)},e.useActionState=function(t,e,r){return w.H.useActionState(t,e,r)},e.useCallback=function(t,e){return w.H.useCallback(t,e)},e.useContext=function(t){return w.H.useContext(t)},e.useDebugValue=function(){},e.useDeferredValue=function(t,e){return w.H.useDeferredValue(t,e)},e.useEffect=function(t,e){return w.H.useEffect(t,e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(t,e,r){return w.H.useImperativeHandle(t,e,r)},e.useInsertionEffect=function(t,e){return w.H.useInsertionEffect(t,e)},e.useLayoutEffect=function(t,e){return w.H.useLayoutEffect(t,e)},e.useMemo=function(t,e){return w.H.useMemo(t,e)},e.useOptimistic=function(t,e){return w.H.useOptimistic(t,e)},e.useReducer=function(t,e,r){return w.H.useReducer(t,e,r)},e.useRef=function(t){return w.H.useRef(t)},e.useState=function(t){return w.H.useState(t)},e.useSyncExternalStore=function(t,e,r){return w.H.useSyncExternalStore(t,e,r)},e.useTransition=function(){return w.H.useTransition()},e.version="19.0.0"},4306:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(8187),i="object"==typeof self&&self&&self.Object===Object&&self;const a=n.A||i||Function("return this")()},4391:(t,e,r)=>{"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}(),t.exports=r(7004)},4431:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return function(){return t}}},4586:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(3493),i=r(3239);const a=function(t){return(0,i.A)(t)&&(0,n.A)(t)}},4766:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},4802:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var n=r(5622),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n.A?n.A.toStringTag:void 0;const l=function(t){var e=a.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(l){}var i=o.call(t);return n&&(e?t[s]=r:delete t[s]),i};var c=Object.prototype.toString;const u=function(t){return c.call(t)};var h=n.A?n.A.toStringTag:void 0;const d=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":h&&h in Object(t)?l(t):u(t)}},4830:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[".","/"],e.BLANK_URL="about:blank"},4910:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var n=r(4802),i=r(3903),a=r(3239),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1;const s=function(t){return(0,a.A)(t)&&(0,i.A)(t.length)&&!!o[(0,n.A)(t)]};var l=r(7328),c=r(6662),u=c.A&&c.A.isTypedArray;const h=u?(0,l.A)(u):s},4943:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(4306),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&"object"==typeof module&&module&&!module.nodeType&&module,o=a&&a.exports===i?n.A.Buffer:void 0,s=o?o.allocUnsafe:void 0;const l=function(t,e){if(e)return t.slice();var r=t.length,n=s?s(r):new t.constructor(r);return t.copy(n),n}},4962:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(7170),i=r(1458);const a=(t,e,r)=>{const a=i.A.parse(t),o=a[e],s=n.A.channel.clamp[e](o+r);return o!==s&&(a[e]=s),i.A.stringify(a)}},4983:(t,e)=>{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function _(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case u:case h:case a:case s:case o:case p:return t;default:switch(t=t&&t.$$typeof){case c:case d:case g:case m:case l:return t;default:return e}}case i:return e}}}function w(t){return _(t)===h}e.AsyncMode=u,e.ConcurrentMode=h,e.ContextConsumer=c,e.ContextProvider=l,e.Element=n,e.ForwardRef=d,e.Fragment=a,e.Lazy=g,e.Memo=m,e.Portal=i,e.Profiler=s,e.StrictMode=o,e.Suspense=p,e.isAsyncMode=function(t){return w(t)||_(t)===u},e.isConcurrentMode=w,e.isContextConsumer=function(t){return _(t)===c},e.isContextProvider=function(t){return _(t)===l},e.isElement=function(t){return"object"===typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return _(t)===d},e.isFragment=function(t){return _(t)===a},e.isLazy=function(t){return _(t)===g},e.isMemo=function(t){return _(t)===m},e.isPortal=function(t){return _(t)===i},e.isProfiler=function(t){return _(t)===s},e.isStrictMode=function(t){return _(t)===o},e.isSuspense=function(t){return _(t)===p},e.isValidElementType=function(t){return"string"===typeof t||"function"===typeof t||t===a||t===h||t===s||t===o||t===p||t===f||"object"===typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===m||t.$$typeof===l||t.$$typeof===c||t.$$typeof===d||t.$$typeof===v||t.$$typeof===x||t.$$typeof===b||t.$$typeof===y)},e.typeOf=_},5009:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return t===e||t!==t&&e!==e}},5043:(t,e,r)=>{"use strict";t.exports=r(4288)},5140:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var n=r(2476);const i=function(){this.__data__=new n.A,this.size=0};const a=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};const o=function(t){return this.__data__.get(t)};const s=function(t){return this.__data__.has(t)};var l=r(8438),c=r(7840);const u=function(t,e){var r=this.__data__;if(r instanceof n.A){var i=r.__data__;if(!l.A||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new c.A(i)}return r.set(t,e),this.size=r.size,this};function h(t){var e=this.__data__=new n.A(t);this.size=e.size}h.prototype.clear=i,h.prototype.delete=a,h.prototype.get=o,h.prototype.has=s,h.prototype.set=u;const d=h},5172:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(9885),i=r(4306);const a=(0,n.A)(i.A,"Set")},5173:(t,e,r)=>{t.exports=r(1497)()},5386:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=Array.isArray},5481:(t,e,r)=>{"use strict";r.d(e,{Y:()=>i,Z:()=>a});var n=r(7170);const i={};for(let o=0;o<=255;o++)i[o]=n.A.unit.dec2hex(o);const a={ALL:0,RGB:1,HSL:2}},5554:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(4962);const i=(t,e)=>(0,n.A)(t,"l",-e)},5622:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=r(4306).A.Symbol},5674:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t,e){return function(r){return t(e(r))}}},5869:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});const n=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var i=r(9500),a=r(5386),o=r(1375),s=r(5884),l=r(4910),c=Object.prototype.hasOwnProperty;const u=function(t,e){var r=(0,a.A)(t),u=!r&&(0,i.A)(t),h=!r&&!u&&(0,o.A)(t),d=!r&&!u&&!h&&(0,l.A)(t),p=r||u||h||d,f=p?n(t.length,String):[],m=f.length;for(var g in t)!e&&!c.call(t,g)||p&&("length"==g||h&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||(0,s.A)(g,m))||f.push(g);return f}},5884:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=/^(?:0|[1-9]\d*)$/;const i=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},5896:(t,e)=>{"use strict";function r(t,e){var r=t.length;t.push(e);t:for(;0<r;){var n=r-1>>>1,i=t[n];if(!(0<a(i,e)))break t;t[n]=e,t[r]=i,r=n}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],r=t.pop();if(r!==e){t[0]=r;t:for(var n=0,i=t.length,o=i>>>1;n<o;){var s=2*(n+1)-1,l=t[s],c=s+1,u=t[c];if(0>a(l,r))c<i&&0>a(u,l)?(t[n]=u,t[c]=r,n=c):(t[n]=l,t[s]=r,n=s);else{if(!(c<i&&0>a(u,r)))break t;t[n]=u,t[c]=r,n=c}}}return e}function a(t,e){var r=t.sortIndex-e.sortIndex;return 0!==r?r:t.id-e.id}if(e.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],h=1,d=null,p=3,f=!1,m=!1,g=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function b(t){for(var e=n(u);null!==e;){if(null===e.callback)i(u);else{if(!(e.startTime<=t))break;i(u),e.sortIndex=e.expirationTime,r(c,e)}e=n(u)}}function _(t){if(g=!1,b(t),!m)if(null!==n(c))m=!0,P();else{var e=n(u);null!==e&&I(_,e.startTime-t)}}var w,k=!1,T=-1,S=5,A=-1;function M(){return!(e.unstable_now()-A<S)}function C(){if(k){var t=e.unstable_now();A=t;var r=!0;try{t:{m=!1,g&&(g=!1,v(T),T=-1),f=!0;var a=p;try{e:{for(b(t),d=n(c);null!==d&&!(d.expirationTime>t&&M());){var o=d.callback;if("function"===typeof o){d.callback=null,p=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"===typeof s){d.callback=s,b(t),r=!0;break e}d===n(c)&&i(c),b(t)}else i(c);d=n(c)}if(null!==d)r=!0;else{var l=n(u);null!==l&&I(_,l.startTime-t),r=!1}}break t}finally{d=null,p=a,f=!1}r=void 0}}finally{r?w():k=!1}}}if("function"===typeof x)w=function(){x(C)};else if("undefined"!==typeof MessageChannel){var E=new MessageChannel,L=E.port2;E.port1.onmessage=C,w=function(){L.postMessage(null)}}else w=function(){y(C,0)};function P(){k||(k=!0,w())}function I(t,r){T=y((function(){t(e.unstable_now())}),r)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){m||f||(m=!0,P())},e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<t?Math.floor(1e3/t):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(t){switch(p){case 1:case 2:case 3:var e=3;break;default:e=p}var r=p;p=e;try{return t()}finally{p=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=p;p=t;try{return e()}finally{p=r}},e.unstable_scheduleCallback=function(t,i,a){var o=e.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?o+a:o:a=o,t){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return t={id:h++,callback:i,priorityLevel:t,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(t.sortIndex=a,r(u,t),null===n(c)&&t===n(u)&&(g?(v(T),T=-1):g=!0,I(_,a-o))):(t.sortIndex=s,r(c,t),m||f||(m=!0,P())),t},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(t){var e=p;return function(){var r=p;p=e;try{return t.apply(this,arguments)}finally{p=r}}}},5920:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(9885);const i=function(){try{var t=(0,n.A)(Object,"defineProperty");return t({},"",{}),t}catch(e){}}()},6166:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=Function.prototype.toString;const i=function(t){if(null!=t){try{return n.call(t)}catch(e){}try{return t+""}catch(e){}}return""}},6356:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(1869),i=r(8635);const a=function(t){return(0,n.A)((function(e,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(a--,o):void 0,s&&(0,i.A)(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),e=Object(e);++n<a;){var l=r[n];l&&t(e,l,n,o)}return e}))}},6362:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(4962);const i=(t,e)=>(0,n.A)(t,"l",e)},6453:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(7170),i=r(1458);const a=(t,e)=>{const r=i.A.parse(t);for(const i in e)r[i]=n.A.channel.clamp[i](e[i]);return i.A.stringify(r)}},6471:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(7170),i=r(4186),a=r(1458),o=r(6453);const s=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if("number"!==typeof t)return(0,o.A)(t,{a:e});const l=i.A.set({r:n.A.channel.clamp.r(t),g:n.A.channel.clamp.g(e),b:n.A.channel.clamp.b(r),a:n.A.channel.clamp.a(s)});return a.A.stringify(l)}},6662:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(8187),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,a=i&&"object"==typeof module&&module&&!module.nodeType&&module,o=a&&a.exports===i&&n.A.process;const s=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(e){}}()},6672:(t,e,r)=>{"use strict";var n=r(5043);function i(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(t,e){return"font"===t?"":"string"===typeof e?"use-credentials"===e?e:"":void 0}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,e.createPortal=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)throw Error(i(299));return function(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==n?null:""+n,children:t,containerInfo:e,implementation:r}}(t,e,null,r)},e.flushSync=function(t){var e=l.T,r=o.p;try{if(l.T=null,o.p=2,t)return t()}finally{l.T=e,o.p=r,o.d.f()}},e.preconnect=function(t,e){"string"===typeof t&&(e?e="string"===typeof(e=e.crossOrigin)?"use-credentials"===e?e:"":void 0:e=null,o.d.C(t,e))},e.prefetchDNS=function(t){"string"===typeof t&&o.d.D(t)},e.preinit=function(t,e){if("string"===typeof t&&e&&"string"===typeof e.as){var r=e.as,n=c(r,e.crossOrigin),i="string"===typeof e.integrity?e.integrity:void 0,a="string"===typeof e.fetchPriority?e.fetchPriority:void 0;"style"===r?o.d.S(t,"string"===typeof e.precedence?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):"script"===r&&o.d.X(t,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:"string"===typeof e.nonce?e.nonce:void 0})}},e.preinitModule=function(t,e){if("string"===typeof t)if("object"===typeof e&&null!==e){if(null==e.as||"script"===e.as){var r=c(e.as,e.crossOrigin);o.d.M(t,{crossOrigin:r,integrity:"string"===typeof e.integrity?e.integrity:void 0,nonce:"string"===typeof e.nonce?e.nonce:void 0})}}else null==e&&o.d.M(t)},e.preload=function(t,e){if("string"===typeof t&&"object"===typeof e&&null!==e&&"string"===typeof e.as){var r=e.as,n=c(r,e.crossOrigin);o.d.L(t,r,{crossOrigin:n,integrity:"string"===typeof e.integrity?e.integrity:void 0,nonce:"string"===typeof e.nonce?e.nonce:void 0,type:"string"===typeof e.type?e.type:void 0,fetchPriority:"string"===typeof e.fetchPriority?e.fetchPriority:void 0,referrerPolicy:"string"===typeof e.referrerPolicy?e.referrerPolicy:void 0,imageSrcSet:"string"===typeof e.imageSrcSet?e.imageSrcSet:void 0,imageSizes:"string"===typeof e.imageSizes?e.imageSizes:void 0,media:"string"===typeof e.media?e.media:void 0})}},e.preloadModule=function(t,e){if("string"===typeof t)if(e){var r=c(e.as,e.crossOrigin);o.d.m(t,{as:"string"===typeof e.as&&"script"!==e.as?e.as:void 0,crossOrigin:r,integrity:"string"===typeof e.integrity?e.integrity:void 0})}else o.d.m(t)},e.requestFormReset=function(t){o.d.r(t)},e.unstable_batchedUpdates=function(t,e){return t(e)},e.useFormState=function(t,e,r){return l.H.useFormState(t,e,r)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version="19.0.0"},7004:(t,e,r)=>{"use strict";var n=r(8853),i=r(5043),a=r(7950);function o(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)}var l=Symbol.for("react.element"),c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var w=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var k=Symbol.for("react.memo_cache_sentinel"),T=Symbol.iterator;function S(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=T&&t[T]||t["@@iterator"])?t:null}var A=Symbol.for("react.client.reference");function M(t){if(null==t)return null;if("function"===typeof t)return t.$$typeof===A?null:t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case h:return"Fragment";case u:return"Portal";case p:return"Profiler";case d:return"StrictMode";case v:return"Suspense";case x:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case g:return(t.displayName||"Context")+".Provider";case m:return(t._context.displayName||"Context")+".Consumer";case y:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case b:return null!==(e=t.displayName||null)?e:M(t.type)||"Memo";case _:e=t._payload,t=t._init;try{return M(t(e))}catch(r){}}return null}var C,E,L=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.assign;function I(t){if(void 0===C)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);C=e&&e[1]||"",E=-1<r.stack.indexOf("\n at")?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+C+t+E}var z=!1;function O(t,e){if(!t||z)return"";z=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(e){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(i){var n=i}Reflect.construct(t,[],r)}else{try{r.call()}catch(a){n=a}t.call(r.prototype)}}else{try{throw Error()}catch(o){n=o}(r=t())&&"function"===typeof r.catch&&r.catch((function(){}))}}catch(s){if(s&&n&&"string"===typeof s.stack)return[s.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=n.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(i=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(n===l.length||i===c.length)for(n=l.length-1,i=c.length-1;1<=n&&0<=i&&l[n]!==c[i];)i--;for(;1<=n&&0<=i;n--,i--)if(l[n]!==c[i]){if(1!==n||1!==i)do{if(n--,0>--i||l[n]!==c[i]){var u="\n"+l[n].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}}while(1<=n&&0<=i);break}}}finally{z=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?I(r):""}function D(t){switch(t.tag){case 26:case 27:case 5:return I(t.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return t=O(t.type,!1);case 11:return t=O(t.type.render,!1);case 1:return t=O(t.type,!0);default:return""}}function R(t){try{var e="";do{e+=D(t),t=t.return}while(t);return e}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}function F(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!==(4098&(e=t).flags)&&(r=e.return),t=e.return}while(t)}return 3===e.tag?r:null}function B(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&(null!==(t=t.alternate)&&(e=t.memoizedState)),null!==e)return e.dehydrated}return null}function j(t){if(F(t)!==t)throw Error(o(188))}function N(t){var e=t.tag;if(5===e||26===e||27===e||6===e)return t;for(t=t.child;null!==t;){if(null!==(e=N(t)))return e;t=t.sibling}return null}var U=Array.isArray,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},$=[],H=-1;function W(t){return{current:t}}function G(t){0>H||(t.current=$[H],$[H]=null,H--)}function Y(t,e){H++,$[H]=t.current,t.current=e}var Z=W(null),X=W(null),K=W(null),J=W(null);function Q(t,e){switch(Y(K,e),Y(X,t),Y(Z,null),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)&&(e=e.namespaceURI)?Xu(e):0;break;default:if(e=(t=8===t?e.parentNode:e).tagName,t=t.namespaceURI)e=Ku(t=Xu(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(Z),Y(Z,e)}function tt(){G(Z),G(X),G(K)}function et(t){null!==t.memoizedState&&Y(J,t);var e=Z.current,r=Ku(e,t.type);e!==r&&(Y(X,t),Y(Z,r))}function rt(t){X.current===t&&(G(Z),G(X)),J.current===t&&(G(J),Rh._currentValue=q)}var nt=Object.prototype.hasOwnProperty,it=n.unstable_scheduleCallback,at=n.unstable_cancelCallback,ot=n.unstable_shouldYield,st=n.unstable_requestPaint,lt=n.unstable_now,ct=n.unstable_getCurrentPriorityLevel,ut=n.unstable_ImmediatePriority,ht=n.unstable_UserBlockingPriority,dt=n.unstable_NormalPriority,pt=n.unstable_LowPriority,ft=n.unstable_IdlePriority,mt=n.log,gt=n.unstable_setDisableYieldValue,yt=null,vt=null;function xt(t){if("function"===typeof mt&&gt(t),vt&&"function"===typeof vt.setStrictMode)try{vt.setStrictMode(yt,t)}catch(e){}}var bt=Math.clz32?Math.clz32:function(t){return 0===(t>>>=0)?32:31-(_t(t)/wt|0)|0},_t=Math.log,wt=Math.LN2;var kt=128,Tt=4194304;function St(t){var e=42&t;if(0!==e)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&t;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&t;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function At(t,e){var r=t.pendingLanes;if(0===r)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,o=t.warmLanes;t=0!==t.finishedLanes;var s=134217727&r;return 0!==s?0!==(r=s&~i)?n=St(r):0!==(a&=s)?n=St(a):t||0!==(o=s&~o)&&(n=St(o)):0!==(s=r&~i)?n=St(s):0!==a?n=St(a):t||0!==(o=r&~o)&&(n=St(o)),0===n?0:0!==e&&e!==n&&0===(e&i)&&((i=n&-n)>=(o=e&-e)||32===i&&0!==(4194176&o))?e:n}function Mt(t,e){return 0===(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)}function Ct(t,e){switch(t){case 1:case 2:case 4:case 8:return e+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function Et(){var t=kt;return 0===(4194176&(kt<<=1))&&(kt=128),t}function Lt(){var t=Tt;return 0===(62914560&(Tt<<=1))&&(Tt=4194304),t}function Pt(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function It(t,e){t.pendingLanes|=e,268435456!==e&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function zt(t,e,r){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-bt(e);t.entangledLanes|=e,t.entanglements[n]=1073741824|t.entanglements[n]|4194218&r}function Ot(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-bt(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}function Dt(t){return 2<(t&=-t)?8<t?0!==(134217727&t)?32:268435456:8:2}function Rt(){var t=V.p;return 0!==t?t:void 0===(t=window.event)?32:Kh(t.type)}var Ft=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Ft,jt="__reactProps$"+Ft,Nt="__reactContainer$"+Ft,Ut="__reactEvents$"+Ft,Vt="__reactListeners$"+Ft,qt="__reactHandles$"+Ft,$t="__reactResources$"+Ft,Ht="__reactMarker$"+Ft;function Wt(t){delete t[Bt],delete t[jt],delete t[Ut],delete t[Vt],delete t[qt]}function Gt(t){var e=t[Bt];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Nt]||r[Bt]){if(r=e.alternate,null!==e.child||null!==r&&null!==r.child)for(t=lh(t);null!==t;){if(r=t[Bt])return r;t=lh(t)}return e}r=(t=r).parentNode}return null}function Yt(t){if(t=t[Bt]||t[Nt]){var e=t.tag;if(5===e||6===e||13===e||26===e||27===e||3===e)return t}return null}function Zt(t){var e=t.tag;if(5===e||26===e||27===e||6===e)return t.stateNode;throw Error(o(33))}function Xt(t){var e=t[$t];return e||(e=t[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Kt(t){t[Ht]=!0}var Jt=new Set,Qt={};function te(t,e){ee(t,e),ee(t+"Capture",e)}function ee(t,e){for(Qt[t]=e,t=0;t<e.length;t++)Jt.add(e[t])}var re=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),ne=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ie={},ae={};function oe(t,e,r){if(i=e,nt.call(ae,i)||!nt.call(ie,i)&&(ne.test(i)?ae[i]=!0:(ie[i]=!0,0)))if(null===r)t.removeAttribute(e);else{switch(typeof r){case"undefined":case"function":case"symbol":return void t.removeAttribute(e);case"boolean":var n=e.toLowerCase().slice(0,5);if("data-"!==n&&"aria-"!==n)return void t.removeAttribute(e)}t.setAttribute(e,""+r)}var i}function se(t,e,r){if(null===r)t.removeAttribute(e);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void t.removeAttribute(e)}t.setAttribute(e,""+r)}}function le(t,e,r,n){if(null===n)t.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void t.removeAttribute(r)}t.setAttributeNS(e,r,""+n)}}function ce(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function ue(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function he(t){t._valueTracker||(t._valueTracker=function(t){var e=ue(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){n=""+t,a.call(this,t)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(t){n=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function de(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=ue(t)?t.checked?"true":"false":t.value),(t=n)!==r&&(e.setValue(t),!0)}function pe(t){if("undefined"===typeof(t=t||("undefined"!==typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}var fe=/[\n"\\]/g;function me(t){return t.replace(fe,(function(t){return"\\"+t.charCodeAt(0).toString(16)+" "}))}function ge(t,e,r,n,i,a,o,s){t.name="",null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?t.type=o:t.removeAttribute("type"),null!=e?"number"===o?(0===e&&""===t.value||t.value!=e)&&(t.value=""+ce(e)):t.value!==""+ce(e)&&(t.value=""+ce(e)):"submit"!==o&&"reset"!==o||t.removeAttribute("value"),null!=e?ve(t,o,ce(e)):null!=r?ve(t,o,ce(r)):null!=n&&t.removeAttribute("value"),null==i&&null!=a&&(t.defaultChecked=!!a),null!=i&&(t.checked=i&&"function"!==typeof i&&"symbol"!==typeof i),null!=s&&"function"!==typeof s&&"symbol"!==typeof s&&"boolean"!==typeof s?t.name=""+ce(s):t.removeAttribute("name")}function ye(t,e,r,n,i,a,o,s){if(null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(t.type=a),null!=e||null!=r){if(!("submit"!==a&&"reset"!==a||void 0!==e&&null!==e))return;r=null!=r?""+ce(r):"",e=null!=e?""+ce(e):r,s||e===t.value||(t.value=e),t.defaultValue=e}n="function"!==typeof(n=null!=n?n:i)&&"symbol"!==typeof n&&!!n,t.checked=s?t.checked:!!n,t.defaultChecked=!!n,null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o&&(t.name=o)}function ve(t,e,r){"number"===e&&pe(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function xe(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+ce(r),e=null,i=0;i<t.length;i++){if(t[i].value===r)return t[i].selected=!0,void(n&&(t[i].defaultSelected=!0));null!==e||t[i].disabled||(e=t[i])}null!==e&&(e.selected=!0)}}function be(t,e,r){null==e||((e=""+ce(e))!==t.value&&(t.value=e),null!=r)?t.defaultValue=null!=r?""+ce(r):"":t.defaultValue!==e&&(t.defaultValue=e)}function _e(t,e,r,n){if(null==e){if(null!=n){if(null!=r)throw Error(o(92));if(U(n)){if(1<n.length)throw Error(o(93));n=n[0]}r=n}null==r&&(r=""),e=r}r=ce(e),t.defaultValue=r,(n=t.textContent)===r&&""!==n&&null!==n&&(t.value=n)}function we(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&3===r.nodeType)return void(r.nodeValue=e)}t.textContent=e}var ke=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Te(t,e,r){var n=0===e.indexOf("--");null==r||"boolean"===typeof r||""===r?n?t.setProperty(e,""):"float"===e?t.cssFloat="":t[e]="":n?t.setProperty(e,r):"number"!==typeof r||0===r||ke.has(e)?"float"===e?t.cssFloat=r:t[e]=(""+r).trim():t[e]=r+"px"}function Se(t,e,r){if(null!=e&&"object"!==typeof e)throw Error(o(62));if(t=t.style,null!=r){for(var n in r)!r.hasOwnProperty(n)||null!=e&&e.hasOwnProperty(n)||(0===n.indexOf("--")?t.setProperty(n,""):"float"===n?t.cssFloat="":t[n]="");for(var i in e)n=e[i],e.hasOwnProperty(i)&&r[i]!==n&&Te(t,i,n)}else for(var a in e)e.hasOwnProperty(a)&&Te(t,a,e[a])}function Ae(t){if(-1===t.indexOf("-"))return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Me=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ce=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ee(t){return Ce.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Le=null;function Pe(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var Ie=null,ze=null;function Oe(t){var e=Yt(t);if(e&&(t=e.stateNode)){var r=t[jt]||null;t:switch(t=e.stateNode,e.type){case"input":if(ge(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),e=r.name,"radio"===r.type&&null!=e){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+me(""+e)+'"][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=n[jt]||null;if(!i)throw Error(o(90));ge(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(e=0;e<r.length;e++)(n=r[e]).form===t.form&&de(n)}break t;case"textarea":be(t,r.value,r.defaultValue);break t;case"select":null!=(e=r.value)&&xe(t,!!r.multiple,e,!1)}}}var De=!1;function Re(t,e,r){if(De)return t(e,r);De=!0;try{return t(e)}finally{if(De=!1,(null!==Ie||null!==ze)&&(Bc(),Ie&&(e=Ie,t=ze,ze=Ie=null,Oe(e),t)))for(e=0;e<t.length;e++)Oe(t[e])}}function Fe(t,e){var r=t.stateNode;if(null===r)return null;var n=r[jt]||null;if(null===n)return null;r=n[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!n;break t;default:t=!1}if(t)return null;if(r&&"function"!==typeof r)throw Error(o(231,e,typeof r));return r}var Be=!1;if(re)try{var je={};Object.defineProperty(je,"passive",{get:function(){Be=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch(_d){Be=!1}var Ne=null,Ue=null,Ve=null;function qe(){if(Ve)return Ve;var t,e,r=Ue,n=r.length,i="value"in Ne?Ne.value:Ne.textContent,a=i.length;for(t=0;t<n&&r[t]===i[t];t++);var o=n-t;for(e=1;e<=o&&r[n-e]===i[a-e];e++);return Ve=i.slice(t,1<e?1-e:void 0)}function $e(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,10===t&&(t=13),32<=t||13===t?t:0}function He(){return!0}function We(){return!1}function Ge(t){function e(e,r,n,i,a){for(var o in this._reactName=e,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null,t)t.hasOwnProperty(o)&&(e=t[o],this[o]=e?e(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?He:We,this.isPropagationStopped=We,this}return P(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!==typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=He)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!==typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=He)},persist:function(){},isPersistent:He}),e}var Ye,Ze,Xe,Ke={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Je=Ge(Ke),Qe=P({},Ke,{view:0,detail:0}),tr=Ge(Qe),er=P({},Qe,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dr,button:0,buttons:0,relatedTarget:function(t){return void 0===t.relatedTarget?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Xe&&(Xe&&"mousemove"===t.type?(Ye=t.screenX-Xe.screenX,Ze=t.screenY-Xe.screenY):Ze=Ye=0,Xe=t),Ye)},movementY:function(t){return"movementY"in t?t.movementY:Ze}}),rr=Ge(er),nr=Ge(P({},er,{dataTransfer:0})),ir=Ge(P({},Qe,{relatedTarget:0})),ar=Ge(P({},Ke,{animationName:0,elapsedTime:0,pseudoElement:0})),or=Ge(P({},Ke,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),sr=Ge(P({},Ke,{data:0})),lr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ur={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hr(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):!!(t=ur[t])&&!!e[t]}function dr(){return hr}var pr=Ge(P({},Qe,{key:function(t){if(t.key){var e=lr[t.key]||t.key;if("Unidentified"!==e)return e}return"keypress"===t.type?13===(t=$e(t))?"Enter":String.fromCharCode(t):"keydown"===t.type||"keyup"===t.type?cr[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dr,charCode:function(t){return"keypress"===t.type?$e(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?$e(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}})),fr=Ge(P({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mr=Ge(P({},Qe,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dr})),gr=Ge(P({},Ke,{propertyName:0,elapsedTime:0,pseudoElement:0})),yr=Ge(P({},er,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),vr=Ge(P({},Ke,{newState:0,oldState:0})),xr=[9,13,27,32],br=re&&"CompositionEvent"in window,_r=null;re&&"documentMode"in document&&(_r=document.documentMode);var wr=re&&"TextEvent"in window&&!_r,kr=re&&(!br||_r&&8<_r&&11>=_r),Tr=String.fromCharCode(32),Sr=!1;function Ar(t,e){switch(t){case"keyup":return-1!==xr.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mr(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var Cr=!1;var Er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Er[t.type]:"textarea"===e}function Pr(t,e,r,n){Ie?ze?ze.push(n):ze=[n]:Ie=n,0<(e=Ru(e,"onChange")).length&&(r=new Je("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Ir=null,zr=null;function Or(t){Cu(t,0)}function Dr(t){if(de(Zt(t)))return t}function Rr(t,e){if("change"===t)return e}var Fr=!1;if(re){var Br;if(re){var jr="oninput"in document;if(!jr){var Nr=document.createElement("div");Nr.setAttribute("oninput","return;"),jr="function"===typeof Nr.oninput}Br=jr}else Br=!1;Fr=Br&&(!document.documentMode||9<document.documentMode)}function Ur(){Ir&&(Ir.detachEvent("onpropertychange",Vr),zr=Ir=null)}function Vr(t){if("value"===t.propertyName&&Dr(zr)){var e=[];Pr(e,zr,t,Pe(t)),Re(Or,e)}}function qr(t,e,r){"focusin"===t?(Ur(),zr=r,(Ir=e).attachEvent("onpropertychange",Vr)):"focusout"===t&&Ur()}function $r(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return Dr(zr)}function Hr(t,e){if("click"===t)return Dr(e)}function Wr(t,e){if("input"===t||"change"===t)return Dr(e)}var Gr="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e};function Yr(t,e){if(Gr(t,e))return!0;if("object"!==typeof t||null===t||"object"!==typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!nt.call(e,i)||!Gr(t[i],e[i]))return!1}return!0}function Zr(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Xr(t,e){var r,n=Zr(t);for(t=0;n;){if(3===n.nodeType){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Zr(n)}}function Kr(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?Kr(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function Jr(t){for(var e=pe((t=null!=t&&null!=t.ownerDocument&&null!=t.ownerDocument.defaultView?t.ownerDocument.defaultView:window).document);e instanceof t.HTMLIFrameElement;){try{var r="string"===typeof e.contentWindow.location.href}catch(n){r=!1}if(!r)break;e=pe((t=e.contentWindow).document)}return e}function Qr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}function tn(t,e){var r=Jr(e);e=t.focusedElem;var n=t.selectionRange;if(r!==e&&e&&e.ownerDocument&&Kr(e.ownerDocument.documentElement,e)){if(null!==n&&Qr(e))if(t=n.start,void 0===(r=n.end)&&(r=t),"selectionStart"in e)e.selectionStart=t,e.selectionEnd=Math.min(r,e.value.length);else if((r=(t=e.ownerDocument||document)&&t.defaultView||window).getSelection){r=r.getSelection();var i=e.textContent.length,a=Math.min(n.start,i);n=void 0===n.end?a:Math.min(n.end,i),!r.extend&&a>n&&(i=n,n=a,a=i),i=Xr(e,a);var o=Xr(e,n);i&&o&&(1!==r.rangeCount||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),r.removeAllRanges(),a>n?(r.addRange(t),r.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),r.addRange(t)))}for(t=[],r=e;r=r.parentNode;)1===r.nodeType&&t.push({element:r,left:r.scrollLeft,top:r.scrollTop});for("function"===typeof e.focus&&e.focus(),e=0;e<t.length;e++)(r=t[e]).element.scrollLeft=r.left,r.element.scrollTop=r.top}}var en=re&&"documentMode"in document&&11>=document.documentMode,rn=null,nn=null,an=null,on=!1;function sn(t,e,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;on||null==rn||rn!==pe(n)||("selectionStart"in(n=rn)&&Qr(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},an&&Yr(an,n)||(an=n,0<(n=Ru(nn,"onSelect")).length&&(e=new Je("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=rn)))}function ln(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var cn={animationend:ln("Animation","AnimationEnd"),animationiteration:ln("Animation","AnimationIteration"),animationstart:ln("Animation","AnimationStart"),transitionrun:ln("Transition","TransitionRun"),transitionstart:ln("Transition","TransitionStart"),transitioncancel:ln("Transition","TransitionCancel"),transitionend:ln("Transition","TransitionEnd")},un={},hn={};function dn(t){if(un[t])return un[t];if(!cn[t])return t;var e,r=cn[t];for(e in r)if(r.hasOwnProperty(e)&&e in hn)return un[t]=r[e];return t}re&&(hn=document.createElement("div").style,"AnimationEvent"in window||(delete cn.animationend.animation,delete cn.animationiteration.animation,delete cn.animationstart.animation),"TransitionEvent"in window||delete cn.transitionend.transition);var pn=dn("animationend"),fn=dn("animationiteration"),mn=dn("animationstart"),gn=dn("transitionrun"),yn=dn("transitionstart"),vn=dn("transitioncancel"),xn=dn("transitionend"),bn=new Map,_n="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function wn(t,e){bn.set(t,e),te(e,[t])}var kn=[],Tn=0,Sn=0;function An(){for(var t=Tn,e=Sn=Tn=0;e<t;){var r=kn[e];kn[e++]=null;var n=kn[e];kn[e++]=null;var i=kn[e];kn[e++]=null;var a=kn[e];if(kn[e++]=null,null!==n&&null!==i){var o=n.pending;null===o?i.next=i:(i.next=o.next,o.next=i),n.pending=i}0!==a&&Ln(r,i,a)}}function Mn(t,e,r,n){kn[Tn++]=t,kn[Tn++]=e,kn[Tn++]=r,kn[Tn++]=n,Sn|=n,t.lanes|=n,null!==(t=t.alternate)&&(t.lanes|=n)}function Cn(t,e,r,n){return Mn(t,e,r,n),Pn(t)}function En(t,e){return Mn(t,null,null,e),Pn(t)}function Ln(t,e,r){t.lanes|=r;var n=t.alternate;null!==n&&(n.lanes|=r);for(var i=!1,a=t.return;null!==a;)a.childLanes|=r,null!==(n=a.alternate)&&(n.childLanes|=r),22===a.tag&&(null===(t=a.stateNode)||1&t._visibility||(i=!0)),t=a,a=a.return;i&&null!==e&&3===t.tag&&(a=t.stateNode,i=31-bt(r),null===(t=(a=a.hiddenUpdates)[i])?a[i]=[e]:t.push(e),e.lane=536870912|r)}function Pn(t){if(50<Cc)throw Cc=0,Ec=null,Error(o(185));for(var e=t.return;null!==e;)e=(t=e).return;return 3===t.tag?t.stateNode:null}var In={},zn=new WeakMap;function On(t,e){if("object"===typeof t&&null!==t){var r=zn.get(t);return void 0!==r?r:(e={value:t,source:e,stack:R(e)},zn.set(t,e),e)}return{value:t,source:e,stack:R(e)}}var Dn=[],Rn=0,Fn=null,Bn=0,jn=[],Nn=0,Un=null,Vn=1,qn="";function $n(t,e){Dn[Rn++]=Bn,Dn[Rn++]=Fn,Fn=t,Bn=e}function Hn(t,e,r){jn[Nn++]=Vn,jn[Nn++]=qn,jn[Nn++]=Un,Un=t;var n=Vn;t=qn;var i=32-bt(n)-1;n&=~(1<<i),r+=1;var a=32-bt(e)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Vn=1<<32-bt(e)+i|r<<i|n,qn=a+t}else Vn=1<<a|r<<i|n,qn=t}function Wn(t){null!==t.return&&($n(t,1),Hn(t,1,0))}function Gn(t){for(;t===Fn;)Fn=Dn[--Rn],Dn[Rn]=null,Bn=Dn[--Rn],Dn[Rn]=null;for(;t===Un;)Un=jn[--Nn],jn[Nn]=null,qn=jn[--Nn],jn[Nn]=null,Vn=jn[--Nn],jn[Nn]=null}var Yn=null,Zn=null,Xn=!1,Kn=null,Jn=!1,Qn=Error(o(519));function ti(t){throw ai(On(Error(o(418,"")),t)),Qn}function ei(t){var e=t.stateNode,r=t.type,n=t.memoizedProps;switch(e[Bt]=t,e[jt]=n,r){case"dialog":Eu("cancel",e),Eu("close",e);break;case"iframe":case"object":case"embed":Eu("load",e);break;case"video":case"audio":for(r=0;r<Au.length;r++)Eu(Au[r],e);break;case"source":Eu("error",e);break;case"img":case"image":case"link":Eu("error",e),Eu("load",e);break;case"details":Eu("toggle",e);break;case"input":Eu("invalid",e),ye(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),he(e);break;case"select":Eu("invalid",e);break;case"textarea":Eu("invalid",e),_e(e,n.value,n.defaultValue,n.children),he(e)}"string"!==typeof(r=n.children)&&"number"!==typeof r&&"bigint"!==typeof r||e.textContent===""+r||!0===n.suppressHydrationWarning||Vu(e.textContent,r)?(null!=n.popover&&(Eu("beforetoggle",e),Eu("toggle",e)),null!=n.onScroll&&Eu("scroll",e),null!=n.onScrollEnd&&Eu("scrollend",e),null!=n.onClick&&(e.onclick=qu),e=!0):e=!1,e||ti(t)}function ri(t){for(Yn=t.return;Yn;)switch(Yn.tag){case 3:case 27:return void(Jn=!0);case 5:case 13:return void(Jn=!1);default:Yn=Yn.return}}function ni(t){if(t!==Yn)return!1;if(!Xn)return ri(t),Xn=!0,!1;var e,r=!1;if((e=3!==t.tag&&27!==t.tag)&&((e=5===t.tag)&&(e=!("form"!==(e=t.type)&&"button"!==e)||Ju(t.type,t.memoizedProps)),e=!e),e&&(r=!0),r&&Zn&&ti(t),ri(t),13===t.tag){if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(o(317));t:{for(t=t.nextSibling,r=0;t;){if(8===t.nodeType)if("/$"===(e=t.data)){if(0===r){Zn=sh(t.nextSibling);break t}r--}else"$"!==e&&"$!"!==e&&"$?"!==e||r++;t=t.nextSibling}Zn=null}}else Zn=Yn?sh(t.stateNode.nextSibling):null;return!0}function ii(){Zn=Yn=null,Xn=!1}function ai(t){null===Kn?Kn=[t]:Kn.push(t)}var oi=Error(o(460)),si=Error(o(474)),li={then:function(){}};function ci(t){return"fulfilled"===(t=t.status)||"rejected"===t}function ui(){}function hi(t,e,r){switch(void 0===(r=t[r])?t.push(e):r!==e&&(e.then(ui,ui),e=r),e.status){case"fulfilled":return e.value;case"rejected":if((t=e.reason)===oi)throw Error(o(483));throw t;default:if("string"===typeof e.status)e.then(ui,ui);else{if(null!==(t=ec)&&100<t.shellSuspendCounter)throw Error(o(482));(t=e).status="pending",t.then((function(t){if("pending"===e.status){var r=e;r.status="fulfilled",r.value=t}}),(function(t){if("pending"===e.status){var r=e;r.status="rejected",r.reason=t}}))}switch(e.status){case"fulfilled":return e.value;case"rejected":if((t=e.reason)===oi)throw Error(o(483));throw t}throw di=e,oi}}var di=null;function pi(){if(null===di)throw Error(o(459));var t=di;return di=null,t}var fi=null,mi=0;function gi(t){var e=mi;return mi+=1,null===fi&&(fi=[]),hi(fi,t,e)}function yi(t,e){e=e.props.ref,t.ref=void 0!==e?e:null}function vi(t,e){if(e.$$typeof===l)throw Error(o(525));throw t=Object.prototype.toString.call(e),Error(o(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function xi(t){return(0,t._init)(t._payload)}function bi(t){function e(e,r){if(t){var n=e.deletions;null===n?(e.deletions=[r],e.flags|=16):n.push(r)}}function r(r,n){if(!t)return null;for(;null!==n;)e(r,n),n=n.sibling;return null}function n(t){for(var e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(t,e){return(t=Fl(t,e)).index=0,t.sibling=null,t}function a(e,r,n){return e.index=n,t?null!==(n=e.alternate)?(n=n.index)<r?(e.flags|=33554434,r):n:(e.flags|=33554434,r):(e.flags|=1048576,r)}function s(e){return t&&null===e.alternate&&(e.flags|=33554434),e}function l(t,e,r,n){return null===e||6!==e.tag?((e=Vl(r,t.mode,n)).return=t,e):((e=i(e,r)).return=t,e)}function d(t,e,r,n){var a=r.type;return a===h?f(t,e,r.props.children,n,r.key):null!==e&&(e.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===_&&xi(a)===e.type)?(yi(e=i(e,r.props),r),e.return=t,e):(yi(e=jl(r.type,r.key,r.props,null,t.mode,n),r),e.return=t,e)}function p(t,e,r,n){return null===e||4!==e.tag||e.stateNode.containerInfo!==r.containerInfo||e.stateNode.implementation!==r.implementation?((e=ql(r,t.mode,n)).return=t,e):((e=i(e,r.children||[])).return=t,e)}function f(t,e,r,n,a){return null===e||7!==e.tag?((e=Nl(r,t.mode,n,a)).return=t,e):((e=i(e,r)).return=t,e)}function m(t,e,r){if("string"===typeof e&&""!==e||"number"===typeof e||"bigint"===typeof e)return(e=Vl(""+e,t.mode,r)).return=t,e;if("object"===typeof e&&null!==e){switch(e.$$typeof){case c:return yi(r=jl(e.type,e.key,e.props,null,t.mode,r),e),r.return=t,r;case u:return(e=ql(e,t.mode,r)).return=t,e;case _:return m(t,e=(0,e._init)(e._payload),r)}if(U(e)||S(e))return(e=Nl(e,t.mode,r,null)).return=t,e;if("function"===typeof e.then)return m(t,gi(e),r);if(e.$$typeof===g)return m(t,As(t,e),r);vi(t,e)}return null}function y(t,e,r,n){var i=null!==e?e.key:null;if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return null!==i?null:l(t,e,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case c:return r.key===i?d(t,e,r,n):null;case u:return r.key===i?p(t,e,r,n):null;case _:return y(t,e,r=(i=r._init)(r._payload),n)}if(U(r)||S(r))return null!==i?null:f(t,e,r,n,null);if("function"===typeof r.then)return y(t,e,gi(r),n);if(r.$$typeof===g)return y(t,e,As(t,r),n);vi(t,r)}return null}function v(t,e,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return l(e,t=t.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case c:return d(e,t=t.get(null===n.key?r:n.key)||null,n,i);case u:return p(e,t=t.get(null===n.key?r:n.key)||null,n,i);case _:return v(t,e,r,n=(0,n._init)(n._payload),i)}if(U(n)||S(n))return f(e,t=t.get(r)||null,n,i,null);if("function"===typeof n.then)return v(t,e,r,gi(n),i);if(n.$$typeof===g)return v(t,e,r,As(e,n),i);vi(e,n)}return null}function x(l,d,p,f){if("object"===typeof p&&null!==p&&p.type===h&&null===p.key&&(p=p.props.children),"object"===typeof p&&null!==p){switch(p.$$typeof){case c:t:{for(var b=p.key;null!==d;){if(d.key===b){if((b=p.type)===h){if(7===d.tag){r(l,d.sibling),(f=i(d,p.props.children)).return=l,l=f;break t}}else if(d.elementType===b||"object"===typeof b&&null!==b&&b.$$typeof===_&&xi(b)===d.type){r(l,d.sibling),yi(f=i(d,p.props),p),f.return=l,l=f;break t}r(l,d);break}e(l,d),d=d.sibling}p.type===h?((f=Nl(p.props.children,l.mode,f,p.key)).return=l,l=f):(yi(f=jl(p.type,p.key,p.props,null,l.mode,f),p),f.return=l,l=f)}return s(l);case u:t:{for(b=p.key;null!==d;){if(d.key===b){if(4===d.tag&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){r(l,d.sibling),(f=i(d,p.children||[])).return=l,l=f;break t}r(l,d);break}e(l,d),d=d.sibling}(f=ql(p,l.mode,f)).return=l,l=f}return s(l);case _:return x(l,d,p=(b=p._init)(p._payload),f)}if(U(p))return function(i,o,s,l){for(var c=null,u=null,h=o,d=o=0,p=null;null!==h&&d<s.length;d++){h.index>d?(p=h,h=null):p=h.sibling;var f=y(i,h,s[d],l);if(null===f){null===h&&(h=p);break}t&&h&&null===f.alternate&&e(i,h),o=a(f,o,d),null===u?c=f:u.sibling=f,u=f,h=p}if(d===s.length)return r(i,h),Xn&&$n(i,d),c;if(null===h){for(;d<s.length;d++)null!==(h=m(i,s[d],l))&&(o=a(h,o,d),null===u?c=h:u.sibling=h,u=h);return Xn&&$n(i,d),c}for(h=n(h);d<s.length;d++)null!==(p=v(h,i,d,s[d],l))&&(t&&null!==p.alternate&&h.delete(null===p.key?d:p.key),o=a(p,o,d),null===u?c=p:u.sibling=p,u=p);return t&&h.forEach((function(t){return e(i,t)})),Xn&&$n(i,d),c}(l,d,p,f);if(S(p)){if("function"!==typeof(b=S(p)))throw Error(o(150));return function(i,s,l,c){if(null==l)throw Error(o(151));for(var u=null,h=null,d=s,p=s=0,f=null,g=l.next();null!==d&&!g.done;p++,g=l.next()){d.index>p?(f=d,d=null):f=d.sibling;var x=y(i,d,g.value,c);if(null===x){null===d&&(d=f);break}t&&d&&null===x.alternate&&e(i,d),s=a(x,s,p),null===h?u=x:h.sibling=x,h=x,d=f}if(g.done)return r(i,d),Xn&&$n(i,p),u;if(null===d){for(;!g.done;p++,g=l.next())null!==(g=m(i,g.value,c))&&(s=a(g,s,p),null===h?u=g:h.sibling=g,h=g);return Xn&&$n(i,p),u}for(d=n(d);!g.done;p++,g=l.next())null!==(g=v(d,i,p,g.value,c))&&(t&&null!==g.alternate&&d.delete(null===g.key?p:g.key),s=a(g,s,p),null===h?u=g:h.sibling=g,h=g);return t&&d.forEach((function(t){return e(i,t)})),Xn&&$n(i,p),u}(l,d,p=b.call(p),f)}if("function"===typeof p.then)return x(l,d,gi(p),f);if(p.$$typeof===g)return x(l,d,As(l,p),f);vi(l,p)}return"string"===typeof p&&""!==p||"number"===typeof p||"bigint"===typeof p?(p=""+p,null!==d&&6===d.tag?(r(l,d.sibling),(f=i(d,p)).return=l,l=f):(r(l,d),(f=Vl(p,l.mode,f)).return=l,l=f),s(l)):r(l,d)}return function(t,e,r,n){try{mi=0;var i=x(t,e,r,n);return fi=null,i}catch(o){if(o===oi)throw o;var a=Dl(29,o,null,t.mode);return a.lanes=n,a.return=t,a}}}var _i=bi(!0),wi=bi(!1),ki=W(null),Ti=W(0);function Si(t,e){Y(Ti,t=cc),Y(ki,e),cc=t|e.baseLanes}function Ai(){Y(Ti,cc),Y(ki,ki.current)}function Mi(){cc=Ti.current,G(ki),G(Ti)}var Ci=W(null),Ei=null;function Li(t){var e=t.alternate;Y(Oi,1&Oi.current),Y(Ci,t),null===Ei&&(null===e||null!==ki.current||null!==e.memoizedState)&&(Ei=t)}function Pi(t){if(22===t.tag){if(Y(Oi,Oi.current),Y(Ci,t),null===Ei){var e=t.alternate;null!==e&&null!==e.memoizedState&&(Ei=t)}}else Ii()}function Ii(){Y(Oi,Oi.current),Y(Ci,Ci.current)}function zi(t){G(Ci),Ei===t&&(Ei=null),G(Oi)}var Oi=W(0);function Di(t){for(var e=t;null!==e;){if(13===e.tag){var r=e.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ri="undefined"!==typeof AbortController?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(e,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach((function(t){return t()}))}},Fi=n.unstable_scheduleCallback,Bi=n.unstable_NormalPriority,ji={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ni(){return{controller:new Ri,data:new Map,refCount:0}}function Ui(t){t.refCount--,0===t.refCount&&Fi(Bi,(function(){t.controller.abort()}))}var Vi=null,qi=0,$i=0,Hi=null;function Wi(){if(0===--qi&&null!==Vi){null!==Hi&&(Hi.status="fulfilled");var t=Vi;Vi=null,$i=0,Hi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}var Gi=L.S;L.S=function(t,e){"object"===typeof e&&null!==e&&"function"===typeof e.then&&function(t,e){if(null===Vi){var r=Vi=[];qi=0,$i=_u(),Hi={status:"pending",value:void 0,then:function(t){r.push(t)}}}qi++,e.then(Wi,Wi)}(0,e),null!==Gi&&Gi(t,e)};var Yi=W(null);function Zi(){var t=Yi.current;return null!==t?t:ec.pooledCache}function Xi(t,e){Y(Yi,null===e?Yi.current:e.pool)}function Ki(){var t=Zi();return null===t?null:{parent:ji._currentValue,pool:t}}var Ji=0,Qi=null,ta=null,ea=null,ra=!1,na=!1,ia=!1,aa=0,oa=0,sa=null,la=0;function ca(){throw Error(o(321))}function ua(t,e){if(null===e)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Gr(t[r],e[r]))return!1;return!0}function ha(t,e,r,n,i,a){return Ji=a,Qi=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,L.H=null===t||null===t.memoizedState?Ao:Mo,ia=!1,a=r(n,i),ia=!1,na&&(a=pa(e,r,n,i)),da(t),a}function da(t){L.H=So;var e=null!==ta&&null!==ta.next;if(Ji=0,ea=ta=Qi=null,ra=!1,oa=0,sa=null,e)throw Error(o(300));null===t||$o||null!==(t=t.dependencies)&&ks(t)&&($o=!0)}function pa(t,e,r,n){Qi=t;var i=0;do{if(na&&(sa=null),oa=0,na=!1,25<=i)throw Error(o(301));if(i+=1,ea=ta=null,null!=t.updateQueue){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}L.H=Co,a=e(r,n)}while(na);return a}function fa(){var t=L.H,e=t.useState()[0];return e="function"===typeof e.then?ba(e):e,t=t.useState()[0],(null!==ta?ta.memoizedState:null)!==t&&(Qi.flags|=1024),e}function ma(){var t=0!==aa;return aa=0,t}function ga(t,e,r){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r}function ya(t){if(ra){for(t=t.memoizedState;null!==t;){var e=t.queue;null!==e&&(e.pending=null),t=t.next}ra=!1}Ji=0,ea=ta=Qi=null,na=!1,oa=aa=0,sa=null}function va(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ea?Qi.memoizedState=ea=t:ea=ea.next=t,ea}function xa(){if(null===ta){var t=Qi.alternate;t=null!==t?t.memoizedState:null}else t=ta.next;var e=null===ea?Qi.memoizedState:ea.next;if(null!==e)ea=e,ta=t;else{if(null===t){if(null===Qi.alternate)throw Error(o(467));throw Error(o(310))}t={memoizedState:(ta=t).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===ea?Qi.memoizedState=ea=t:ea=ea.next=t}return ea}function ba(t){var e=oa;return oa+=1,null===sa&&(sa=[]),t=hi(sa,t,e),e=Qi,null===(null===ea?e.memoizedState:ea.next)&&(e=e.alternate,L.H=null===e||null===e.memoizedState?Ao:Mo),t}function _a(t){if(null!==t&&"object"===typeof t){if("function"===typeof t.then)return ba(t);if(t.$$typeof===g)return Ss(t)}throw Error(o(438,String(t)))}function wa(t){var e=null,r=Qi.updateQueue;if(null!==r&&(e=r.memoCache),null==e){var n=Qi.alternate;null!==n&&(null!==(n=n.updateQueue)&&(null!=(n=n.memoCache)&&(e={data:n.data.map((function(t){return t.slice()})),index:0})))}if(null==e&&(e={data:[],index:0}),null===r&&(r={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=r),r.memoCache=e,void 0===(r=e.data[e.index]))for(r=e.data[e.index]=Array(t),n=0;n<t;n++)r[n]=k;return e.index++,r}function ka(t,e){return"function"===typeof e?e(t):e}function Ta(t){return Sa(xa(),ta,t)}function Sa(t,e,r){var n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=r;var i=t.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}e.baseQueue=i=a,n.pending=null}if(a=t.baseState,null===i)t.memoizedState=a;else{var l=s=null,c=null,u=e=i.next,h=!1;do{var d=-536870913&u.lane;if(d!==u.lane?(nc&d)===d:(Ji&d)===d){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===$i&&(h=!0);else{if((Ji&p)===p){u=u.next,p===$i&&(h=!0);continue}d={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=d,s=a):c=c.next=d,Qi.lanes|=p,hc|=p}d=u.action,ia&&r(a,d),a=u.hasEagerState?u.eagerState:r(a,d)}else p={lane:d,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,s=a):c=c.next=p,Qi.lanes|=d,hc|=d;u=u.next}while(null!==u&&u!==e);if(null===c?s=a:c.next=l,!Gr(a,t.memoizedState)&&($o=!0,h&&null!==(r=Hi)))throw r;t.memoizedState=a,t.baseState=s,t.baseQueue=c,n.lastRenderedState=a}return null===i&&(n.lanes=0),[t.memoizedState,n.dispatch]}function Aa(t){var e=xa(),r=e.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,a=e.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=t(a,s.action),s=s.next}while(s!==i);Gr(a,e.memoizedState)||($o=!0),e.memoizedState=a,null===e.baseQueue&&(e.baseState=a),r.lastRenderedState=a}return[a,n]}function Ma(t,e,r){var n=Qi,i=xa(),a=Xn;if(a){if(void 0===r)throw Error(o(407));r=r()}else r=e();var s=!Gr((ta||i).memoizedState,r);if(s&&(i.memoizedState=r,$o=!0),i=i.queue,Ja(La.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||null!==ea&&1&ea.memoizedState.tag){if(n.flags|=2048,Ga(9,Ea.bind(null,n,i,r,e),{destroy:void 0},null),null===ec)throw Error(o(349));a||0!==(60&Ji)||Ca(n,e,r)}return r}function Ca(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},null===(e=Qi.updateQueue)?(e={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=e,e.stores=[t]):null===(r=e.stores)?e.stores=[t]:r.push(t)}function Ea(t,e,r,n){e.value=r,e.getSnapshot=n,Pa(e)&&Ia(t)}function La(t,e,r){return r((function(){Pa(e)&&Ia(t)}))}function Pa(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Gr(t,r)}catch(n){return!0}}function Ia(t){var e=En(t,2);null!==e&&Ic(e,t,2)}function za(t){var e=va();if("function"===typeof t){var r=t;if(t=r(),ia){xt(!0);try{r()}finally{xt(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:t},e}function Oa(t,e,r,n){return t.baseState=r,Sa(t,ta,"function"===typeof n?n:ka)}function Da(t,e,r,n,i){if(wo(t))throw Error(o(485));if(null!==(t=e.action)){var a={payload:i,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(t){a.listeners.push(t)}};null!==L.T?r(!0):a.isTransition=!1,n(a),null===(r=e.pending)?(a.next=e.pending=a,Ra(e,a)):(a.next=r.next,e.pending=r.next=a)}}function Ra(t,e){var r=e.action,n=e.payload,i=t.state;if(e.isTransition){var a=L.T,o={};L.T=o;try{var s=r(i,n),l=L.S;null!==l&&l(o,s),Fa(t,e,s)}catch(c){ja(t,e,c)}finally{L.T=a}}else try{Fa(t,e,a=r(i,n))}catch(u){ja(t,e,u)}}function Fa(t,e,r){null!==r&&"object"===typeof r&&"function"===typeof r.then?r.then((function(r){Ba(t,e,r)}),(function(r){return ja(t,e,r)})):Ba(t,e,r)}function Ba(t,e,r){e.status="fulfilled",e.value=r,Na(e),t.state=r,null!==(e=t.pending)&&((r=e.next)===e?t.pending=null:(r=r.next,e.next=r,Ra(t,r)))}function ja(t,e,r){var n=t.pending;if(t.pending=null,null!==n){n=n.next;do{e.status="rejected",e.reason=r,Na(e),e=e.next}while(e!==n)}t.action=null}function Na(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Ua(t,e){return e}function Va(t,e){if(Xn){var r=ec.formState;if(null!==r){t:{var n=Qi;if(Xn){if(Zn){e:{for(var i=Zn,a=Jn;8!==i.nodeType;){if(!a){i=null;break e}if(null===(i=sh(i.nextSibling))){i=null;break e}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){Zn=sh(i.nextSibling),n="F!"===i.data;break t}}ti(n)}n=!1}n&&(e=r[0])}}return(r=va()).memoizedState=r.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:e},r.queue=n,r=xo.bind(null,Qi,n),n.dispatch=r,n=za(!1),a=_o.bind(null,Qi,!1,n.queue),i={state:e,dispatch:null,action:t,pending:null},(n=va()).queue=i,r=Da.bind(null,Qi,i,a,r),i.dispatch=r,n.memoizedState=t,[e,r,!1]}function qa(t){return $a(xa(),ta,t)}function $a(t,e,r){e=Sa(t,e,Ua)[0],t=Ta(ka)[0],e="object"===typeof e&&null!==e&&"function"===typeof e.then?ba(e):e;var n=xa(),i=n.queue,a=i.dispatch;return r!==n.memoizedState&&(Qi.flags|=2048,Ga(9,Ha.bind(null,i,r),{destroy:void 0},null)),[e,a,t]}function Ha(t,e){t.action=e}function Wa(t){var e=xa(),r=ta;if(null!==r)return $a(e,r,t);xa(),e=e.memoizedState;var n=(r=xa()).queue.dispatch;return r.memoizedState=t,[e,n,!1]}function Ga(t,e,r,n){return t={tag:t,create:e,inst:r,deps:n,next:null},null===(e=Qi.updateQueue)&&(e={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=e),null===(r=e.lastEffect)?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t),t}function Ya(){return xa().memoizedState}function Za(t,e,r,n){var i=va();Qi.flags|=t,i.memoizedState=Ga(1|e,r,{destroy:void 0},void 0===n?null:n)}function Xa(t,e,r,n){var i=xa();n=void 0===n?null:n;var a=i.memoizedState.inst;null!==ta&&null!==n&&ua(n,ta.memoizedState.deps)?i.memoizedState=Ga(e,r,a,n):(Qi.flags|=t,i.memoizedState=Ga(1|e,r,a,n))}function Ka(t,e){Za(8390656,8,t,e)}function Ja(t,e){Xa(2048,8,t,e)}function Qa(t,e){return Xa(4,2,t,e)}function to(t,e){return Xa(4,4,t,e)}function eo(t,e){if("function"===typeof e){t=t();var r=e(t);return function(){"function"===typeof r?r():e(null)}}if(null!==e&&void 0!==e)return t=t(),e.current=t,function(){e.current=null}}function ro(t,e,r){r=null!==r&&void 0!==r?r.concat([t]):null,Xa(4,4,eo.bind(null,e,t),r)}function no(){}function io(t,e){var r=xa();e=void 0===e?null:e;var n=r.memoizedState;return null!==e&&ua(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function ao(t,e){var r=xa();e=void 0===e?null:e;var n=r.memoizedState;if(null!==e&&ua(e,n[1]))return n[0];if(n=t(),ia){xt(!0);try{t()}finally{xt(!1)}}return r.memoizedState=[n,e],n}function oo(t,e,r){return void 0===r||0!==(1073741824&Ji)?t.memoizedState=e:(t.memoizedState=r,t=Pc(),Qi.lanes|=t,hc|=t,r)}function so(t,e,r,n){return Gr(r,e)?r:null!==ki.current?(t=oo(t,r,n),Gr(t,e)||($o=!0),t):0===(42&Ji)?($o=!0,t.memoizedState=r):(t=Pc(),Qi.lanes|=t,hc|=t,e)}function lo(t,e,r,n,i){var a=V.p;V.p=0!==a&&8>a?a:8;var o=L.T,s={};L.T=s,_o(t,!1,e,r);try{var l=i(),c=L.S;if(null!==c&&c(s,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)bo(t,e,function(t,e){var r=[],n={status:"pending",value:null,reason:null,then:function(t){r.push(t)}};return t.then((function(){n.status="fulfilled",n.value=e;for(var t=0;t<r.length;t++)(0,r[t])(e)}),(function(t){for(n.status="rejected",n.reason=t,t=0;t<r.length;t++)(0,r[t])(void 0)})),n}(l,n),Lc());else bo(t,e,n,Lc())}catch(u){bo(t,e,{then:function(){},status:"rejected",reason:u},Lc())}finally{V.p=a,L.T=o}}function co(){}function uo(t,e,r,n){if(5!==t.tag)throw Error(o(476));var i=ho(t).queue;lo(t,i,e,q,null===r?co:function(){return po(t),r(n)})}function ho(t){var e=t.memoizedState;if(null!==e)return e;var r={};return(e={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:q},next:null}).next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:r},next:null},t.memoizedState=e,null!==(t=t.alternate)&&(t.memoizedState=e),e}function po(t){bo(t,ho(t).next.queue,{},Lc())}function fo(){return Ss(Rh)}function mo(){return xa().memoizedState}function go(){return xa().memoizedState}function yo(t){for(var e=t.return;null!==e;){switch(e.tag){case 24:case 3:var r=Lc(),n=Is(e,t=Ps(r),r);return null!==n&&(Ic(n,e,r),zs(n,e,r)),e={cache:Ni()},void(t.payload=e)}e=e.return}}function vo(t,e,r){var n=Lc();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},wo(t)?ko(e,r):null!==(r=Cn(t,e,r,n))&&(Ic(r,t,n),To(r,e,n))}function xo(t,e,r){bo(t,e,r,Lc())}function bo(t,e,r,n){var i={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(wo(t))ko(e,i);else{var a=t.alternate;if(0===t.lanes&&(null===a||0===a.lanes)&&null!==(a=e.lastRenderedReducer))try{var o=e.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,Gr(s,o))return Mn(t,e,i,0),null===ec&&An(),!1}catch(l){}if(null!==(r=Cn(t,e,i,n)))return Ic(r,t,n),To(r,e,n),!0}return!1}function _o(t,e,r,n){if(n={lane:2,revertLane:_u(),action:n,hasEagerState:!1,eagerState:null,next:null},wo(t)){if(e)throw Error(o(479))}else null!==(e=Cn(t,r,n,2))&&Ic(e,t,2)}function wo(t){var e=t.alternate;return t===Qi||null!==e&&e===Qi}function ko(t,e){na=ra=!0;var r=t.pending;null===r?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function To(t,e,r){if(0!==(4194176&r)){var n=e.lanes;r|=n&=t.pendingLanes,e.lanes=r,Ot(t,r)}}var So={readContext:Ss,use:_a,useCallback:ca,useContext:ca,useEffect:ca,useImperativeHandle:ca,useLayoutEffect:ca,useInsertionEffect:ca,useMemo:ca,useReducer:ca,useRef:ca,useState:ca,useDebugValue:ca,useDeferredValue:ca,useTransition:ca,useSyncExternalStore:ca,useId:ca};So.useCacheRefresh=ca,So.useMemoCache=ca,So.useHostTransitionStatus=ca,So.useFormState=ca,So.useActionState=ca,So.useOptimistic=ca;var Ao={readContext:Ss,use:_a,useCallback:function(t,e){return va().memoizedState=[t,void 0===e?null:e],t},useContext:Ss,useEffect:Ka,useImperativeHandle:function(t,e,r){r=null!==r&&void 0!==r?r.concat([t]):null,Za(4194308,4,eo.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Za(4194308,4,t,e)},useInsertionEffect:function(t,e){Za(4,2,t,e)},useMemo:function(t,e){var r=va();e=void 0===e?null:e;var n=t();if(ia){xt(!0);try{t()}finally{xt(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=va();if(void 0!==r){var i=r(e);if(ia){xt(!0);try{r(e)}finally{xt(!1)}}}else i=e;return n.memoizedState=n.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},n.queue=t,t=t.dispatch=vo.bind(null,Qi,t),[n.memoizedState,t]},useRef:function(t){return t={current:t},va().memoizedState=t},useState:function(t){var e=(t=za(t)).queue,r=xo.bind(null,Qi,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:no,useDeferredValue:function(t,e){return oo(va(),t,e)},useTransition:function(){var t=za(!1);return t=lo.bind(null,Qi,t.queue,!0,!1),va().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=Qi,i=va();if(Xn){if(void 0===r)throw Error(o(407));r=r()}else{if(r=e(),null===ec)throw Error(o(349));0!==(60&nc)||Ca(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,Ka(La.bind(null,n,a,t),[t]),n.flags|=2048,Ga(9,Ea.bind(null,n,a,r,e),{destroy:void 0},null),r},useId:function(){var t=va(),e=ec.identifierPrefix;if(Xn){var r=qn;e=":"+e+"R"+(r=(Vn&~(1<<32-bt(Vn)-1)).toString(32)+r),0<(r=aa++)&&(e+="H"+r.toString(32)),e+=":"}else e=":"+e+"r"+(r=la++).toString(32)+":";return t.memoizedState=e},useCacheRefresh:function(){return va().memoizedState=yo.bind(null,Qi)}};Ao.useMemoCache=wa,Ao.useHostTransitionStatus=fo,Ao.useFormState=Va,Ao.useActionState=Va,Ao.useOptimistic=function(t){var e=va();e.memoizedState=e.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=r,e=_o.bind(null,Qi,!0,r),r.dispatch=e,[t,e]};var Mo={readContext:Ss,use:_a,useCallback:io,useContext:Ss,useEffect:Ja,useImperativeHandle:ro,useInsertionEffect:Qa,useLayoutEffect:to,useMemo:ao,useReducer:Ta,useRef:Ya,useState:function(){return Ta(ka)},useDebugValue:no,useDeferredValue:function(t,e){return so(xa(),ta.memoizedState,t,e)},useTransition:function(){var t=Ta(ka)[0],e=xa().memoizedState;return["boolean"===typeof t?t:ba(t),e]},useSyncExternalStore:Ma,useId:mo};Mo.useCacheRefresh=go,Mo.useMemoCache=wa,Mo.useHostTransitionStatus=fo,Mo.useFormState=qa,Mo.useActionState=qa,Mo.useOptimistic=function(t,e){return Oa(xa(),0,t,e)};var Co={readContext:Ss,use:_a,useCallback:io,useContext:Ss,useEffect:Ja,useImperativeHandle:ro,useInsertionEffect:Qa,useLayoutEffect:to,useMemo:ao,useReducer:Aa,useRef:Ya,useState:function(){return Aa(ka)},useDebugValue:no,useDeferredValue:function(t,e){var r=xa();return null===ta?oo(r,t,e):so(r,ta.memoizedState,t,e)},useTransition:function(){var t=Aa(ka)[0],e=xa().memoizedState;return["boolean"===typeof t?t:ba(t),e]},useSyncExternalStore:Ma,useId:mo};function Eo(t,e,r,n){r=null===(r=r(n,e=t.memoizedState))||void 0===r?e:P({},e,r),t.memoizedState=r,0===t.lanes&&(t.updateQueue.baseState=r)}Co.useCacheRefresh=go,Co.useMemoCache=wa,Co.useHostTransitionStatus=fo,Co.useFormState=Wa,Co.useActionState=Wa,Co.useOptimistic=function(t,e){var r=xa();return null!==ta?Oa(r,0,t,e):(r.baseState=t,[t,r.queue.dispatch])};var Lo={isMounted:function(t){return!!(t=t._reactInternals)&&F(t)===t},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Lc(),i=Ps(n);i.payload=e,void 0!==r&&null!==r&&(i.callback=r),null!==(e=Is(t,i,n))&&(Ic(e,t,n),zs(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Lc(),i=Ps(n);i.tag=1,i.payload=e,void 0!==r&&null!==r&&(i.callback=r),null!==(e=Is(t,i,n))&&(Ic(e,t,n),zs(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Lc(),n=Ps(r);n.tag=2,void 0!==e&&null!==e&&(n.callback=e),null!==(e=Is(t,n,r))&&(Ic(e,t,r),zs(e,t,r))}};function Po(t,e,r,n,i,a,o){return"function"===typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(n,a,o):!e.prototype||!e.prototype.isPureReactComponent||(!Yr(r,n)||!Yr(i,a))}function Io(t,e,r,n){t=e.state,"function"===typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(r,n),"function"===typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&Lo.enqueueReplaceState(e,e.state,null)}function zo(t,e){var r=e;if("ref"in e)for(var n in r={},e)"ref"!==n&&(r[n]=e[n]);if(t=t.defaultProps)for(var i in r===e&&(r=P({},r)),t)void 0===r[i]&&(r[i]=t[i]);return r}var Oo="function"===typeof reportError?reportError:function(t){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof t&&null!==t&&"string"===typeof t.message?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)};function Do(t){Oo(t)}function Ro(t){console.error(t)}function Fo(t){Oo(t)}function Bo(t,e){try{(0,t.onUncaughtError)(e.value,{componentStack:e.stack})}catch(r){setTimeout((function(){throw r}))}}function jo(t,e,r){try{(0,t.onCaughtError)(r.value,{componentStack:r.stack,errorBoundary:1===e.tag?e.stateNode:null})}catch(n){setTimeout((function(){throw n}))}}function No(t,e,r){return(r=Ps(r)).tag=3,r.payload={element:null},r.callback=function(){Bo(t,e)},r}function Uo(t){return(t=Ps(t)).tag=3,t}function Vo(t,e,r,n){var i=r.type.getDerivedStateFromError;if("function"===typeof i){var a=n.value;t.payload=function(){return i(a)},t.callback=function(){jo(e,r,n)}}var o=r.stateNode;null!==o&&"function"===typeof o.componentDidCatch&&(t.callback=function(){jo(e,r,n),"function"!==typeof i&&(null===wc?wc=new Set([this]):wc.add(this));var t=n.stack;this.componentDidCatch(n.value,{componentStack:null!==t?t:""})})}var qo=Error(o(461)),$o=!1;function Ho(t,e,r,n){e.child=null===t?wi(e,null,r,n):_i(e,t.child,r,n)}function Wo(t,e,r,n,i){r=r.render;var a=e.ref;if("ref"in n){var o={};for(var s in n)"ref"!==s&&(o[s]=n[s])}else o=n;return Ts(e),n=ha(t,e,r,o,a,i),s=ma(),null===t||$o?(Xn&&s&&Wn(e),e.flags|=1,Ho(t,e,n,i),e.child):(ga(t,e,i),ds(t,e,i))}function Go(t,e,r,n,i){if(null===t){var a=r.type;return"function"!==typeof a||Rl(a)||void 0!==a.defaultProps||null!==r.compare?((t=jl(r.type,null,n,e,e.mode,i)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=a,Yo(t,e,a,n,i))}if(a=t.child,!ps(t,i)){var o=a.memoizedProps;if((r=null!==(r=r.compare)?r:Yr)(o,n)&&t.ref===e.ref)return ds(t,e,i)}return e.flags|=1,(t=Fl(a,n)).ref=e.ref,t.return=e,e.child=t}function Yo(t,e,r,n,i){if(null!==t){var a=t.memoizedProps;if(Yr(a,n)&&t.ref===e.ref){if($o=!1,e.pendingProps=n=a,!ps(t,i))return e.lanes=t.lanes,ds(t,e,i);0!==(131072&t.flags)&&($o=!0)}}return Jo(t,e,r,n,i)}function Zo(t,e,r){var n=e.pendingProps,i=n.children,a=0!==(2&e.stateNode._pendingVisibility),o=null!==t?t.memoizedState:null;if(Ko(t,e),"hidden"===n.mode||a){if(0!==(128&e.flags)){if(n=null!==o?o.baseLanes|r:r,null!==t){for(i=e.child=t.child,a=0;null!==i;)a=a|i.lanes|i.childLanes,i=i.sibling;e.childLanes=a&~n}else e.childLanes=0,e.child=null;return Xo(t,e,n,r)}if(0===(536870912&r))return e.lanes=e.childLanes=536870912,Xo(t,e,null!==o?o.baseLanes|r:r,r);e.memoizedState={baseLanes:0,cachePool:null},null!==t&&Xi(0,null!==o?o.cachePool:null),null!==o?Si(e,o):Ai(),Pi(e)}else null!==o?(Xi(0,o.cachePool),Si(e,o),Ii(),e.memoizedState=null):(null!==t&&Xi(0,null),Ai(),Ii());return Ho(t,e,i,r),e.child}function Xo(t,e,r,n){var i=Zi();return i=null===i?null:{parent:ji._currentValue,pool:i},e.memoizedState={baseLanes:r,cachePool:i},null!==t&&Xi(0,null),Ai(),Pi(e),null!==t&&ws(t,e,n,!0),null}function Ko(t,e){var r=e.ref;if(null===r)null!==t&&null!==t.ref&&(e.flags|=2097664);else{if("function"!==typeof r&&"object"!==typeof r)throw Error(o(284));null!==t&&t.ref===r||(e.flags|=2097664)}}function Jo(t,e,r,n,i){return Ts(e),r=ha(t,e,r,n,void 0,i),n=ma(),null===t||$o?(Xn&&n&&Wn(e),e.flags|=1,Ho(t,e,r,i),e.child):(ga(t,e,i),ds(t,e,i))}function Qo(t,e,r,n,i,a){return Ts(e),e.updateQueue=null,r=pa(e,n,r,i),da(t),n=ma(),null===t||$o?(Xn&&n&&Wn(e),e.flags|=1,Ho(t,e,r,a),e.child):(ga(t,e,a),ds(t,e,a))}function ts(t,e,r,n,i){if(Ts(e),null===e.stateNode){var a=In,o=r.contextType;"object"===typeof o&&null!==o&&(a=Ss(o)),a=new r(n,a),e.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=Lo,e.stateNode=a,a._reactInternals=e,(a=e.stateNode).props=n,a.state=e.memoizedState,a.refs={},Es(e),o=r.contextType,a.context="object"===typeof o&&null!==o?Ss(o):In,a.state=e.memoizedState,"function"===typeof(o=r.getDerivedStateFromProps)&&(Eo(e,r,o,n),a.state=e.memoizedState),"function"===typeof r.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(o=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&Lo.enqueueReplaceState(a,a.state,null),Fs(e,n,a,i),Rs(),a.state=e.memoizedState),"function"===typeof a.componentDidMount&&(e.flags|=4194308),n=!0}else if(null===t){a=e.stateNode;var s=e.memoizedProps,l=zo(r,s);a.props=l;var c=a.context,u=r.contextType;o=In,"object"===typeof u&&null!==u&&(o=Ss(u));var h=r.getDerivedStateFromProps;u="function"===typeof h||"function"===typeof a.getSnapshotBeforeUpdate,s=e.pendingProps!==s,u||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s||c!==o)&&Io(e,a,n,o),Cs=!1;var d=e.memoizedState;a.state=d,Fs(e,n,a,i),Rs(),c=e.memoizedState,s||d!==c||Cs?("function"===typeof h&&(Eo(e,r,h,n),c=e.memoizedState),(l=Cs||Po(e,r,l,n,d,c,o))?(u||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(e.flags|=4194308)):("function"===typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),a.props=n,a.state=c,a.context=o,n=l):("function"===typeof a.componentDidMount&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,Ls(t,e),u=zo(r,o=e.memoizedProps),a.props=u,h=e.pendingProps,d=a.context,c=r.contextType,l=In,"object"===typeof c&&null!==c&&(l=Ss(c)),(c="function"===typeof(s=r.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o!==h||d!==l)&&Io(e,a,n,l),Cs=!1,d=e.memoizedState,a.state=d,Fs(e,n,a,i),Rs();var p=e.memoizedState;o!==h||d!==p||Cs||null!==t&&null!==t.dependencies&&ks(t.dependencies)?("function"===typeof s&&(Eo(e,r,s,n),p=e.memoizedState),(u=Cs||Po(e,r,u,n,d,p,l)||null!==t&&null!==t.dependencies&&ks(t.dependencies))?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(n,p,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(n,p,l)),"function"===typeof a.componentDidUpdate&&(e.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!==typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),a.props=n,a.state=p,a.context=l,n=u):("function"!==typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),n=!1)}return a=n,Ko(t,e),n=0!==(128&e.flags),a||n?(a=e.stateNode,r=n&&"function"!==typeof r.getDerivedStateFromError?null:a.render(),e.flags|=1,null!==t&&n?(e.child=_i(e,t.child,null,i),e.child=_i(e,null,r,i)):Ho(t,e,r,i),e.memoizedState=a.state,t=e.child):t=ds(t,e,i),t}function es(t,e,r,n){return ii(),e.flags|=256,Ho(t,e,r,n),e.child}var rs={dehydrated:null,treeContext:null,retryLane:0};function ns(t){return{baseLanes:t,cachePool:Ki()}}function is(t,e,r){return t=null!==t?t.childLanes&~r:0,e&&(t|=fc),t}function as(t,e,r){var n,i=e.pendingProps,a=!1,s=0!==(128&e.flags);if((n=s)||(n=(null===t||null!==t.memoizedState)&&0!==(2&Oi.current)),n&&(a=!0,e.flags&=-129),n=0!==(32&e.flags),e.flags&=-33,null===t){if(Xn){if(a?Li(e):Ii(),Xn){var l,c=Zn;if(l=c){t:{for(l=c,c=Jn;8!==l.nodeType;){if(!c){c=null;break t}if(null===(l=sh(l.nextSibling))){c=null;break t}}c=l}null!==c?(e.memoizedState={dehydrated:c,treeContext:null!==Un?{id:Vn,overflow:qn}:null,retryLane:536870912},(l=Dl(18,null,null,0)).stateNode=c,l.return=e,e.child=l,Yn=e,Zn=null,l=!0):l=!1}l||ti(e)}if(null!==(c=e.memoizedState)&&null!==(c=c.dehydrated))return"$!"===c.data?e.lanes=16:e.lanes=536870912,null;zi(e)}return c=i.children,i=i.fallback,a?(Ii(),c=ss({mode:"hidden",children:c},a=e.mode),i=Nl(i,a,r,null),c.return=e,i.return=e,c.sibling=i,e.child=c,(a=e.child).memoizedState=ns(r),a.childLanes=is(t,n,r),e.memoizedState=rs,i):(Li(e),os(e,c))}if(null!==(l=t.memoizedState)&&null!==(c=l.dehydrated)){if(s)256&e.flags?(Li(e),e.flags&=-257,e=ls(t,e,r)):null!==e.memoizedState?(Ii(),e.child=t.child,e.flags|=128,e=null):(Ii(),a=i.fallback,c=e.mode,i=ss({mode:"visible",children:i.children},c),(a=Nl(a,c,r,null)).flags|=2,i.return=e,a.return=e,i.sibling=a,e.child=i,_i(e,t.child,null,r),(i=e.child).memoizedState=ns(r),i.childLanes=is(t,n,r),e.memoizedState=rs,e=a);else if(Li(e),"$!"===c.data){if(n=c.nextSibling&&c.nextSibling.dataset)var u=n.dgst;n=u,(i=Error(o(419))).stack="",i.digest=n,ai({value:i,source:null,stack:null}),e=ls(t,e,r)}else if($o||ws(t,e,r,!1),n=0!==(r&t.childLanes),$o||n){if(null!==(n=ec)){if(0!==(42&(i=r&-r)))i=1;else switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=64;break;case 268435456:i=134217728;break;default:i=0}if(0!==(i=0!==(i&(n.suspendedLanes|r))?0:i)&&i!==l.retryLane)throw l.retryLane=i,En(t,i),Ic(n,t,i),qo}"$?"===c.data||$c(),e=ls(t,e,r)}else"$?"===c.data?(e.flags|=128,e.child=t.child,e=su.bind(null,t),c._reactRetry=e,e=null):(t=l.treeContext,Zn=sh(c.nextSibling),Yn=e,Xn=!0,Kn=null,Jn=!1,null!==t&&(jn[Nn++]=Vn,jn[Nn++]=qn,jn[Nn++]=Un,Vn=t.id,qn=t.overflow,Un=e),(e=os(e,i.children)).flags|=4096);return e}return a?(Ii(),a=i.fallback,c=e.mode,u=(l=t.child).sibling,(i=Fl(l,{mode:"hidden",children:i.children})).subtreeFlags=31457280&l.subtreeFlags,null!==u?a=Fl(u,a):(a=Nl(a,c,r,null)).flags|=2,a.return=e,i.return=e,i.sibling=a,e.child=i,i=a,a=e.child,null===(c=t.child.memoizedState)?c=ns(r):(null!==(l=c.cachePool)?(u=ji._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Ki(),c={baseLanes:c.baseLanes|r,cachePool:l}),a.memoizedState=c,a.childLanes=is(t,n,r),e.memoizedState=rs,i):(Li(e),t=(r=t.child).sibling,(r=Fl(r,{mode:"visible",children:i.children})).return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r)}function os(t,e){return(e=ss({mode:"visible",children:e},t.mode)).return=t,t.child=e}function ss(t,e){return Ul(t,e,0,null)}function ls(t,e,r){return _i(e,t.child,null,r),(t=os(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function cs(t,e,r){t.lanes|=e;var n=t.alternate;null!==n&&(n.lanes|=e),bs(t.return,e,r)}function us(t,e,r,n,i){var a=t.memoizedState;null===a?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function hs(t,e,r){var n=e.pendingProps,i=n.revealOrder,a=n.tail;if(Ho(t,e,n.children,r),0!==(2&(n=Oi.current)))n=1&n|2,e.flags|=128;else{if(null!==t&&0!==(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&cs(t,r,e);else if(19===t.tag)cs(t,r,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}switch(Y(Oi,n),i){case"forwards":for(r=e.child,i=null;null!==r;)null!==(t=r.alternate)&&null===Di(t)&&(i=r),r=r.sibling;null===(r=i)?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),us(e,!1,i,r,a);break;case"backwards":for(r=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===Di(t)){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}us(e,!0,r,null,a);break;case"together":us(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ds(t,e,r){if(null!==t&&(e.dependencies=t.dependencies),hc|=e.lanes,0===(r&e.childLanes)){if(null===t)return null;if(ws(t,e,r,!1),0===(r&e.childLanes))return null}if(null!==t&&e.child!==t.child)throw Error(o(153));if(null!==e.child){for(r=Fl(t=e.child,t.pendingProps),e.child=r,r.return=e;null!==t.sibling;)t=t.sibling,(r=r.sibling=Fl(t,t.pendingProps)).return=e;r.sibling=null}return e.child}function ps(t,e){return 0!==(t.lanes&e)||!(null===(t=t.dependencies)||!ks(t))}function fs(t,e,r){if(null!==t)if(t.memoizedProps!==e.pendingProps)$o=!0;else{if(!ps(t,r)&&0===(128&e.flags))return $o=!1,function(t,e,r){switch(e.tag){case 3:Q(e,e.stateNode.containerInfo),vs(e,ji,t.memoizedState.cache),ii();break;case 27:case 5:et(e);break;case 4:Q(e,e.stateNode.containerInfo);break;case 10:vs(e,e.type,e.memoizedProps.value);break;case 13:var n=e.memoizedState;if(null!==n)return null!==n.dehydrated?(Li(e),e.flags|=128,null):0!==(r&e.child.childLanes)?as(t,e,r):(Li(e),null!==(t=ds(t,e,r))?t.sibling:null);Li(e);break;case 19:var i=0!==(128&t.flags);if((n=0!==(r&e.childLanes))||(ws(t,e,r,!1),n=0!==(r&e.childLanes)),i){if(n)return hs(t,e,r);e.flags|=128}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Y(Oi,Oi.current),n)break;return null;case 22:case 23:return e.lanes=0,Zo(t,e,r);case 24:vs(e,ji,t.memoizedState.cache)}return ds(t,e,r)}(t,e,r);$o=0!==(131072&t.flags)}else $o=!1,Xn&&0!==(1048576&e.flags)&&Hn(e,Bn,e.index);switch(e.lanes=0,e.tag){case 16:t:{t=e.pendingProps;var n=e.elementType,i=n._init;if(n=i(n._payload),e.type=n,"function"!==typeof n){if(void 0!==n&&null!==n){if((i=n.$$typeof)===y){e.tag=11,e=Wo(null,e,n,t,r);break t}if(i===b){e.tag=14,e=Go(null,e,n,t,r);break t}}throw e=M(n)||n,Error(o(306,e,""))}Rl(n)?(t=zo(n,t),e.tag=1,e=ts(null,e,n,t,r)):(e.tag=0,e=Jo(null,e,n,t,r))}return e;case 0:return Jo(t,e,e.type,e.pendingProps,r);case 1:return ts(t,e,n=e.type,i=zo(n,e.pendingProps),r);case 3:t:{if(Q(e,e.stateNode.containerInfo),null===t)throw Error(o(387));var a=e.pendingProps;n=(i=e.memoizedState).element,Ls(t,e),Fs(e,a,null,r);var s=e.memoizedState;if(a=s.cache,vs(e,ji,a),a!==i.cache&&_s(e,[ji],r,!0),Rs(),a=s.element,i.isDehydrated){if(i={element:a,isDehydrated:!1,cache:s.cache},e.updateQueue.baseState=i,e.memoizedState=i,256&e.flags){e=es(t,e,a,r);break t}if(a!==n){ai(n=On(Error(o(424)),e)),e=es(t,e,a,r);break t}for(Zn=sh(e.stateNode.containerInfo.firstChild),Yn=e,Xn=!0,Kn=null,Jn=!0,r=wi(e,null,a,r),e.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(ii(),a===n){e=ds(t,e,r);break t}Ho(t,e,a,r)}e=e.child}return e;case 26:return Ko(t,e),null===t?(r=gh(e.type,null,e.pendingProps,null))?e.memoizedState=r:Xn||(r=e.type,t=e.pendingProps,(n=Zu(K.current).createElement(r))[Bt]=e,n[jt]=t,Wu(n,r,t),Kt(n),e.stateNode=n):e.memoizedState=gh(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return et(e),null===t&&Xn&&(n=e.stateNode=ch(e.type,e.pendingProps,K.current),Yn=e,Jn=!0,Zn=sh(n.firstChild)),n=e.pendingProps.children,null!==t||Xn?Ho(t,e,n,r):e.child=_i(e,null,n,r),Ko(t,e),e.child;case 5:return null===t&&Xn&&((i=n=Zn)&&(null!==(n=function(t,e,r,n){for(;1===t.nodeType;){var i=r;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&("INPUT"!==t.nodeName||"hidden"!==t.type))break}else if(n){if(!t[Ht])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if("stylesheet"===(a=t.getAttribute("rel"))&&t.hasAttribute("data-precedence"))break;if(a!==i.rel||t.getAttribute("href")!==(null==i.href?null:i.href)||t.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||t.getAttribute("title")!==(null==i.title?null:i.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(((a=t.getAttribute("src"))!==(null==i.src?null:i.src)||t.getAttribute("type")!==(null==i.type?null:i.type)||t.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else{if("input"!==e||"hidden"!==t.type)return t;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&t.getAttribute("name")===a)return t}if(null===(t=sh(t.nextSibling)))break}return null}(n,e.type,e.pendingProps,Jn))?(e.stateNode=n,Yn=e,Zn=sh(n.firstChild),Jn=!1,i=!0):i=!1),i||ti(e)),et(e),i=e.type,a=e.pendingProps,s=null!==t?t.memoizedProps:null,n=a.children,Ju(i,a)?n=null:null!==s&&Ju(i,s)&&(e.flags|=32),null!==e.memoizedState&&(i=ha(t,e,fa,null,null,r),Rh._currentValue=i),Ko(t,e),Ho(t,e,n,r),e.child;case 6:return null===t&&Xn&&((t=r=Zn)&&(null!==(r=function(t,e,r){if(""===e)return null;for(;3!==t.nodeType;){if((1!==t.nodeType||"INPUT"!==t.nodeName||"hidden"!==t.type)&&!r)return null;if(null===(t=sh(t.nextSibling)))return null}return t}(r,e.pendingProps,Jn))?(e.stateNode=r,Yn=e,Zn=null,t=!0):t=!1),t||ti(e)),null;case 13:return as(t,e,r);case 4:return Q(e,e.stateNode.containerInfo),n=e.pendingProps,null===t?e.child=_i(e,null,n,r):Ho(t,e,n,r),e.child;case 11:return Wo(t,e,e.type,e.pendingProps,r);case 7:return Ho(t,e,e.pendingProps,r),e.child;case 8:case 12:return Ho(t,e,e.pendingProps.children,r),e.child;case 10:return n=e.pendingProps,vs(e,e.type,n.value),Ho(t,e,n.children,r),e.child;case 9:return i=e.type._context,n=e.pendingProps.children,Ts(e),n=n(i=Ss(i)),e.flags|=1,Ho(t,e,n,r),e.child;case 14:return Go(t,e,e.type,e.pendingProps,r);case 15:return Yo(t,e,e.type,e.pendingProps,r);case 19:return hs(t,e,r);case 22:return Zo(t,e,r);case 24:return Ts(e),n=Ss(ji),null===t?(null===(i=Zi())&&(i=ec,a=Ni(),i.pooledCache=a,a.refCount++,null!==a&&(i.pooledCacheLanes|=r),i=a),e.memoizedState={parent:n,cache:i},Es(e),vs(e,ji,i)):(0!==(t.lanes&r)&&(Ls(t,e),Fs(e,null,null,r),Rs()),i=t.memoizedState,a=e.memoizedState,i.parent!==n?(i={parent:n,cache:n},e.memoizedState=i,0===e.lanes&&(e.memoizedState=e.updateQueue.baseState=i),vs(e,ji,n)):(n=a.cache,vs(e,ji,n),n!==i.cache&&_s(e,[ji],r,!0))),Ho(t,e,e.pendingProps.children,r),e.child;case 29:throw e.pendingProps}throw Error(o(156,e.tag))}var ms=W(null),gs=null,ys=null;function vs(t,e,r){Y(ms,e._currentValue),e._currentValue=r}function xs(t){t._currentValue=ms.current,G(ms)}function bs(t,e,r){for(;null!==t;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==n&&(n.childLanes|=e)):null!==n&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function _s(t,e,r,n){var i=t.child;for(null!==i&&(i.return=t);null!==i;){var a=i.dependencies;if(null!==a){var s=i.child;a=a.firstContext;t:for(;null!==a;){var l=a;a=i;for(var c=0;c<e.length;c++)if(l.context===e[c]){a.lanes|=r,null!==(l=a.alternate)&&(l.lanes|=r),bs(a.return,r,t),n||(s=null);break t}a=l.next}}else if(18===i.tag){if(null===(s=i.return))throw Error(o(341));s.lanes|=r,null!==(a=s.alternate)&&(a.lanes|=r),bs(s,r,t),s=null}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===t){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}}function ws(t,e,r,n){t=null;for(var i=e,a=!1;null!==i;){if(!a)if(0!==(524288&i.flags))a=!0;else if(0!==(262144&i.flags))break;if(10===i.tag){var s=i.alternate;if(null===s)throw Error(o(387));if(null!==(s=s.memoizedProps)){var l=i.type;Gr(i.pendingProps.value,s.value)||(null!==t?t.push(l):t=[l])}}else if(i===J.current){if(null===(s=i.alternate))throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==t?t.push(Rh):t=[Rh])}i=i.return}null!==t&&_s(e,t,r,n),e.flags|=262144}function ks(t){for(t=t.firstContext;null!==t;){if(!Gr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ts(t){gs=t,ys=null,null!==(t=t.dependencies)&&(t.firstContext=null)}function Ss(t){return Ms(gs,t)}function As(t,e){return null===gs&&Ts(t),Ms(t,e)}function Ms(t,e){var r=e._currentValue;if(e={context:e,memoizedValue:r,next:null},null===ys){if(null===t)throw Error(o(308));ys=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else ys=ys.next=e;return r}var Cs=!1;function Es(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ls(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ps(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Is(t,e,r){var n=t.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&tc)){var i=n.pending;return null===i?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=Pn(t),Ln(t,null,r),e}return Mn(t,n,e,r),Pn(t)}function zs(t,e,r){if(null!==(e=e.updateQueue)&&(e=e.shared,0!==(4194176&r))){var n=e.lanes;r|=n&=t.pendingLanes,e.lanes=r,Ot(t,r)}}function Os(t,e){var r=t.updateQueue,n=t.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,a=null;if(null!==(r=r.firstBaseUpdate)){do{var o={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,r=r.next}while(null!==r);null===a?i=a=e:a=a.next=e}else i=a=e;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,callbacks:n.callbacks},void(t.updateQueue=r)}null===(t=r.lastBaseUpdate)?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}var Ds=!1;function Rs(){if(Ds){if(null!==Hi)throw Hi}}function Fs(t,e,r,n){Ds=!1;var i=t.updateQueue;Cs=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var u=t.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==o&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==a){var h=i.baseState;for(o=0,u=c=l=null,s=a;;){var d=-536870913&s.lane,p=d!==s.lane;if(p?(nc&d)===d:(n&d)===d){0!==d&&d===$i&&(Ds=!0),null!==u&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});t:{var f=t,m=s;d=e;var g=r;switch(m.tag){case 1:if("function"===typeof(f=m.payload)){h=f.call(g,h,d);break t}h=f;break t;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(d="function"===typeof(f=m.payload)?f.call(g,h,d):f)||void 0===d)break t;h=P({},h,d);break t;case 2:Cs=!0}}null!==(d=s.callback)&&(t.flags|=64,p&&(t.flags|=8192),null===(p=i.callbacks)?i.callbacks=[d]:p.push(d))}else p={lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=p,l=h):u=u.next=p,o|=d;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(p=s).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===u&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null===a&&(i.shared.lanes=0),hc|=o,t.lanes=o,t.memoizedState=h}}function Bs(t,e){if("function"!==typeof t)throw Error(o(191,t));t.call(e)}function js(t,e){var r=t.callbacks;if(null!==r)for(t.callbacks=null,t=0;t<r.length;t++)Bs(r[t],e)}function Ns(t,e){try{var r=e.updateQueue,n=null!==r?r.lastEffect:null;if(null!==n){var i=n.next;r=i;do{if((r.tag&t)===t){n=void 0;var a=r.create,o=r.inst;n=a(),o.destroy=n}r=r.next}while(r!==i)}}catch(s){nu(e,e.return,s)}}function Us(t,e,r){try{var n=e.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var a=i.next;n=a;do{if((n.tag&t)===t){var o=n.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,i=e;var l=r;try{s()}catch(c){nu(i,l,c)}}}n=n.next}while(n!==a)}}catch(c){nu(e,e.return,c)}}function Vs(t){var e=t.updateQueue;if(null!==e){var r=t.stateNode;try{js(e,r)}catch(n){nu(t,t.return,n)}}}function qs(t,e,r){r.props=zo(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){nu(t,e,n)}}function $s(t,e){try{var r=t.ref;if(null!==r){var n=t.stateNode;switch(t.tag){case 26:case 27:case 5:var i=n;break;default:i=n}"function"===typeof r?t.refCleanup=r(i):r.current=i}}catch(a){nu(t,e,a)}}function Hs(t,e){var r=t.ref,n=t.refCleanup;if(null!==r)if("function"===typeof n)try{n()}catch(i){nu(t,e,i)}finally{t.refCleanup=null,null!=(t=t.alternate)&&(t.refCleanup=null)}else if("function"===typeof r)try{r(null)}catch(a){nu(t,e,a)}else r.current=null}function Ws(t){var e=t.type,r=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break t;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(i){nu(t,t.return,i)}}function Gs(t,e,r){try{var n=t.stateNode;!function(t,e,r,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,s=null,l=null,c=null,u=null,h=null;for(f in r){var d=r[f];if(r.hasOwnProperty(f)&&null!=d)switch(f){case"checked":case"value":break;case"defaultValue":c=d;default:n.hasOwnProperty(f)||$u(t,e,f,null,n,d)}}for(var p in n){var f=n[p];if(d=r[p],n.hasOwnProperty(p)&&(null!=f||null!=d))switch(p){case"type":a=f;break;case"name":i=f;break;case"checked":u=f;break;case"defaultChecked":h=f;break;case"value":s=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,e));break;default:f!==d&&$u(t,e,p,f,n,d)}}return void ge(t,s,l,c,u,h,a,i);case"select":for(a in f=s=l=p=null,r)if(c=r[a],r.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":f=c;default:n.hasOwnProperty(a)||$u(t,e,a,null,n,c)}for(i in n)if(a=n[i],c=r[i],n.hasOwnProperty(i)&&(null!=a||null!=c))switch(i){case"value":p=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:a!==c&&$u(t,e,i,a,n,c)}return e=l,r=s,n=f,void(null!=p?xe(t,!!r,p,!1):!!n!==!!r&&(null!=e?xe(t,!!r,e,!0):xe(t,!!r,r?[]:"",!1)));case"textarea":for(l in f=p=null,r)if(i=r[l],r.hasOwnProperty(l)&&null!=i&&!n.hasOwnProperty(l))switch(l){case"value":case"children":break;default:$u(t,e,l,null,n,i)}for(s in n)if(i=n[s],a=r[s],n.hasOwnProperty(s)&&(null!=i||null!=a))switch(s){case"value":p=i;break;case"defaultValue":f=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==a&&$u(t,e,s,i,n,a)}return void be(t,p,f);case"option":for(var m in r)if(p=r[m],r.hasOwnProperty(m)&&null!=p&&!n.hasOwnProperty(m))if("selected"===m)t.selected=!1;else $u(t,e,m,null,n,p);for(c in n)if(p=n[c],f=r[c],n.hasOwnProperty(c)&&p!==f&&(null!=p||null!=f))if("selected"===c)t.selected=p&&"function"!==typeof p&&"symbol"!==typeof p;else $u(t,e,c,p,n,f);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in r)p=r[g],r.hasOwnProperty(g)&&null!=p&&!n.hasOwnProperty(g)&&$u(t,e,g,null,n,p);for(u in n)if(p=n[u],f=r[u],n.hasOwnProperty(u)&&p!==f&&(null!=p||null!=f))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,e));break;default:$u(t,e,u,p,n,f)}return;default:if(Ae(e)){for(var y in r)p=r[y],r.hasOwnProperty(y)&&void 0!==p&&!n.hasOwnProperty(y)&&Hu(t,e,y,void 0,n,p);for(h in n)p=n[h],f=r[h],!n.hasOwnProperty(h)||p===f||void 0===p&&void 0===f||Hu(t,e,h,p,n,f);return}}for(var v in r)p=r[v],r.hasOwnProperty(v)&&null!=p&&!n.hasOwnProperty(v)&&$u(t,e,v,null,n,p);for(d in n)p=n[d],f=r[d],!n.hasOwnProperty(d)||p===f||null==p&&null==f||$u(t,e,d,p,n,f)}(n,t.type,r,e),n[jt]=e}catch(i){nu(t,t.return,i)}}function Ys(t){return 5===t.tag||3===t.tag||26===t.tag||27===t.tag||4===t.tag}function Zs(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||Ys(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&27!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function Xs(t,e,r){var n=t.tag;if(5===n||6===n)t=t.stateNode,e?8===r.nodeType?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(8===r.nodeType?(e=r.parentNode).insertBefore(t,r):(e=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==e.onclick||(e.onclick=qu));else if(4!==n&&27!==n&&null!==(t=t.child))for(Xs(t,e,r),t=t.sibling;null!==t;)Xs(t,e,r),t=t.sibling}function Ks(t,e,r){var n=t.tag;if(5===n||6===n)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(4!==n&&27!==n&&null!==(t=t.child))for(Ks(t,e,r),t=t.sibling;null!==t;)Ks(t,e,r),t=t.sibling}var Js=!1,Qs=!1,tl=!1,el="function"===typeof WeakSet?WeakSet:Set,rl=null,nl=!1;function il(t,e,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:yl(t,r),4&n&&Ns(5,r);break;case 1:if(yl(t,r),4&n)if(t=r.stateNode,null===e)try{t.componentDidMount()}catch(s){nu(r,r.return,s)}else{var i=zo(r.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(i,e,t.__reactInternalSnapshotBeforeUpdate)}catch(l){nu(r,r.return,l)}}64&n&&Vs(r),512&n&&$s(r,r.return);break;case 3:if(yl(t,r),64&n&&null!==(n=r.updateQueue)){if(t=null,null!==r.child)switch(r.child.tag){case 27:case 5:case 1:t=r.child.stateNode}try{js(n,t)}catch(s){nu(r,r.return,s)}}break;case 26:yl(t,r),512&n&&$s(r,r.return);break;case 27:case 5:yl(t,r),null===e&&4&n&&Ws(r),512&n&&$s(r,r.return);break;case 12:default:yl(t,r);break;case 13:yl(t,r),4&n&&ul(t,r);break;case 22:if(!(i=null!==r.memoizedState||Js)){e=null!==e&&null!==e.memoizedState||Qs;var a=Js,o=Qs;Js=i,(Qs=e)&&!o?xl(t,r,0!==(8772&r.subtreeFlags)):yl(t,r),Js=a,Qs=o}512&n&&("manual"===r.memoizedProps.mode?$s(r,r.return):Hs(r,r.return))}}function al(t){var e=t.alternate;null!==e&&(t.alternate=null,al(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&(null!==(e=t.stateNode)&&Wt(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ol=null,sl=!1;function ll(t,e,r){for(r=r.child;null!==r;)cl(t,e,r),r=r.sibling}function cl(t,e,r){if(vt&&"function"===typeof vt.onCommitFiberUnmount)try{vt.onCommitFiberUnmount(yt,r)}catch(o){}switch(r.tag){case 26:Qs||Hs(r,e),ll(t,e,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode).parentNode.removeChild(r);break;case 27:Qs||Hs(r,e);var n=ol,i=sl;for(ol=r.stateNode,ll(t,e,r),e=(r=r.stateNode).attributes;e.length;)r.removeAttributeNode(e[0]);Wt(r),ol=n,sl=i;break;case 5:Qs||Hs(r,e);case 6:i=ol;var a=sl;if(ol=null,ll(t,e,r),sl=a,null!==(ol=i))if(sl)try{t=ol,n=r.stateNode,8===t.nodeType?t.parentNode.removeChild(n):t.removeChild(n)}catch(s){nu(r,e,s)}else try{ol.removeChild(r.stateNode)}catch(s){nu(r,e,s)}break;case 18:null!==ol&&(sl?(e=ol,r=r.stateNode,8===e.nodeType?ah(e.parentNode,r):1===e.nodeType&&ah(e,r),md(e)):ah(ol,r.stateNode));break;case 4:n=ol,i=sl,ol=r.stateNode.containerInfo,sl=!0,ll(t,e,r),ol=n,sl=i;break;case 0:case 11:case 14:case 15:Qs||Us(2,r,e),Qs||Us(4,r,e),ll(t,e,r);break;case 1:Qs||(Hs(r,e),"function"===typeof(n=r.stateNode).componentWillUnmount&&qs(r,e,n)),ll(t,e,r);break;case 21:ll(t,e,r);break;case 22:Qs||Hs(r,e),Qs=(n=Qs)||null!==r.memoizedState,ll(t,e,r),Qs=n;break;default:ll(t,e,r)}}function ul(t,e){if(null===e.memoizedState&&(null!==(t=e.alternate)&&(null!==(t=t.memoizedState)&&null!==(t=t.dehydrated))))try{md(t)}catch(r){nu(e,e.return,r)}}function hl(t,e){var r=function(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return null===e&&(e=t.stateNode=new el),e;case 22:return null===(e=(t=t.stateNode)._retryCache)&&(e=t._retryCache=new el),e;default:throw Error(o(435,t.tag))}}(t);e.forEach((function(e){var n=lu.bind(null,t,e);r.has(e)||(r.add(e),e.then(n,n))}))}function dl(t,e){var r=e.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n],a=t,s=e,l=s;t:for(;null!==l;){switch(l.tag){case 27:case 5:ol=l.stateNode,sl=!1;break t;case 3:case 4:ol=l.stateNode.containerInfo,sl=!0;break t}l=l.return}if(null===ol)throw Error(o(160));cl(a,s,i),ol=null,sl=!1,null!==(a=i.alternate)&&(a.return=null),i.return=null}if(13878&e.subtreeFlags)for(e=e.child;null!==e;)fl(e,t),e=e.sibling}var pl=null;function fl(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:dl(e,t),ml(t),4&n&&(Us(3,t,t.return),Ns(3,t),Us(5,t,t.return));break;case 1:dl(e,t),ml(t),512&n&&(Qs||null===r||Hs(r,r.return)),64&n&&Js&&(null!==(t=t.updateQueue)&&(null!==(n=t.callbacks)&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=null===r?n:r.concat(n))));break;case 26:var i=pl;if(dl(e,t),ml(t),512&n&&(Qs||null===r||Hs(r,r.return)),4&n){var a=null!==r?r.memoizedState:null;if(n=t.memoizedState,null===r)if(null===n)if(null===t.stateNode){t:{n=t.type,r=t.memoizedProps,i=i.ownerDocument||i;e:switch(n){case"title":(!(a=i.getElementsByTagName("title")[0])||a[Ht]||a[Bt]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=i.createElement(n),i.head.insertBefore(a,i.querySelector("head > title"))),Wu(a,n,r),a[Bt]=t,Kt(a),n=a;break t;case"link":var s=Mh("link","href",i).get(n+(r.href||""));if(s)for(var l=0;l<s.length;l++)if((a=s[l]).getAttribute("href")===(null==r.href?null:r.href)&&a.getAttribute("rel")===(null==r.rel?null:r.rel)&&a.getAttribute("title")===(null==r.title?null:r.title)&&a.getAttribute("crossorigin")===(null==r.crossOrigin?null:r.crossOrigin)){s.splice(l,1);break e}Wu(a=i.createElement(n),n,r),i.head.appendChild(a);break;case"meta":if(s=Mh("meta","content",i).get(n+(r.content||"")))for(l=0;l<s.length;l++)if((a=s[l]).getAttribute("content")===(null==r.content?null:""+r.content)&&a.getAttribute("name")===(null==r.name?null:r.name)&&a.getAttribute("property")===(null==r.property?null:r.property)&&a.getAttribute("http-equiv")===(null==r.httpEquiv?null:r.httpEquiv)&&a.getAttribute("charset")===(null==r.charSet?null:r.charSet)){s.splice(l,1);break e}Wu(a=i.createElement(n),n,r),i.head.appendChild(a);break;default:throw Error(o(468,n))}a[Bt]=t,Kt(a),n=a}t.stateNode=n}else Ch(i,t.type,t.stateNode);else t.stateNode=wh(i,n,t.memoizedProps);else a!==n?(null===a?null!==r.stateNode&&(r=r.stateNode).parentNode.removeChild(r):a.count--,null===n?Ch(i,t.type,t.stateNode):wh(i,n,t.memoizedProps)):null===n&&null!==t.stateNode&&Gs(t,t.memoizedProps,r.memoizedProps)}break;case 27:if(4&n&&null===t.alternate){i=t.stateNode,a=t.memoizedProps;try{for(var c=i.firstChild;c;){var u=c.nextSibling,h=c.nodeName;c[Ht]||"HEAD"===h||"BODY"===h||"SCRIPT"===h||"STYLE"===h||"LINK"===h&&"stylesheet"===c.rel.toLowerCase()||i.removeChild(c),c=u}for(var d=t.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Wu(i,d,a),i[Bt]=t,i[jt]=a}catch(m){nu(t,t.return,m)}}case 5:if(dl(e,t),ml(t),512&n&&(Qs||null===r||Hs(r,r.return)),32&t.flags){i=t.stateNode;try{we(i,"")}catch(m){nu(t,t.return,m)}}4&n&&null!=t.stateNode&&Gs(t,i=t.memoizedProps,null!==r?r.memoizedProps:i),1024&n&&(tl=!0);break;case 6:if(dl(e,t),ml(t),4&n){if(null===t.stateNode)throw Error(o(162));n=t.memoizedProps,r=t.stateNode;try{r.nodeValue=n}catch(m){nu(t,t.return,m)}}break;case 3:if(Ah=null,i=pl,pl=dh(e.containerInfo),dl(e,t),pl=i,ml(t),4&n&&null!==r&&r.memoizedState.isDehydrated)try{md(e.containerInfo)}catch(m){nu(t,t.return,m)}tl&&(tl=!1,gl(t));break;case 4:n=pl,pl=dh(t.stateNode.containerInfo),dl(e,t),ml(t),pl=n;break;case 12:dl(e,t),ml(t);break;case 13:dl(e,t),ml(t),8192&t.child.flags&&null!==t.memoizedState!==(null!==r&&null!==r.memoizedState)&&(xc=lt()),4&n&&(null!==(n=t.updateQueue)&&(t.updateQueue=null,hl(t,n)));break;case 22:if(512&n&&(Qs||null===r||Hs(r,r.return)),c=null!==t.memoizedState,u=null!==r&&null!==r.memoizedState,Js=(h=Js)||c,Qs=(d=Qs)||u,dl(e,t),Qs=d,Js=h,ml(t),(e=t.stateNode)._current=t,e._visibility&=-3,e._visibility|=2&e._pendingVisibility,8192&n&&(e._visibility=c?-2&e._visibility:1|e._visibility,c&&(e=Js||Qs,null===r||u||e||vl(t)),null===t.memoizedProps||"manual"!==t.memoizedProps.mode))t:for(r=null,e=t;;){if(5===e.tag||26===e.tag||27===e.tag){if(null===r){u=r=e;try{if(i=u.stateNode,c)"function"===typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none";else{s=u.stateNode;var f=void 0!==(l=u.memoizedProps.style)&&null!==l&&l.hasOwnProperty("display")?l.display:null;s.style.display=null==f||"boolean"===typeof f?"":(""+f).trim()}}catch(m){nu(u,u.return,m)}}}else if(6===e.tag){if(null===r){u=e;try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(m){nu(u,u.return,m)}}}else if((22!==e.tag&&23!==e.tag||null===e.memoizedState||e===t)&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;r===e&&(r=null),e=e.return}r===e&&(r=null),e.sibling.return=e.return,e=e.sibling}4&n&&(null!==(n=t.updateQueue)&&(null!==(r=n.retryQueue)&&(n.retryQueue=null,hl(t,r))));break;case 19:dl(e,t),ml(t),4&n&&(null!==(n=t.updateQueue)&&(t.updateQueue=null,hl(t,n)));break;case 21:break;default:dl(e,t),ml(t)}}function ml(t){var e=t.flags;if(2&e){try{if(27!==t.tag){t:{for(var r=t.return;null!==r;){if(Ys(r)){var n=r;break t}r=r.return}throw Error(o(160))}switch(n.tag){case 27:var i=n.stateNode;Ks(t,Zs(t),i);break;case 5:var a=n.stateNode;32&n.flags&&(we(a,""),n.flags&=-33),Ks(t,Zs(t),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Xs(t,Zs(t),s);break;default:throw Error(o(161))}}}catch(l){nu(t,t.return,l)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function gl(t){if(1024&t.subtreeFlags)for(t=t.child;null!==t;){var e=t;gl(e),5===e.tag&&1024&e.flags&&e.stateNode.reset(),t=t.sibling}}function yl(t,e){if(8772&e.subtreeFlags)for(e=e.child;null!==e;)il(t,e.alternate,e),e=e.sibling}function vl(t){for(t=t.child;null!==t;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Us(4,e,e.return),vl(e);break;case 1:Hs(e,e.return);var r=e.stateNode;"function"===typeof r.componentWillUnmount&&qs(e,e.return,r),vl(e);break;case 26:case 27:case 5:Hs(e,e.return),vl(e);break;case 22:Hs(e,e.return),null===e.memoizedState&&vl(e);break;default:vl(e)}t=t.sibling}}function xl(t,e,r){for(r=r&&0!==(8772&e.subtreeFlags),e=e.child;null!==e;){var n=e.alternate,i=t,a=e,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,r),Ns(4,a);break;case 1:if(xl(i,a,r),"function"===typeof(i=(n=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(c){nu(n,n.return,c)}if(null!==(i=(n=a).updateQueue)){var s=n.stateNode;try{var l=i.shared.hiddenCallbacks;if(null!==l)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Bs(l[i],s)}catch(c){nu(n,n.return,c)}}r&&64&o&&Vs(a),$s(a,a.return);break;case 26:case 27:case 5:xl(i,a,r),r&&null===n&&4&o&&Ws(a),$s(a,a.return);break;case 12:default:xl(i,a,r);break;case 13:xl(i,a,r),r&&4&o&&ul(i,a);break;case 22:null===a.memoizedState&&xl(i,a,r),$s(a,a.return)}e=e.sibling}}function bl(t,e){var r=null;null!==t&&null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),t=null,null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(t=e.memoizedState.cachePool.pool),t!==r&&(null!=t&&t.refCount++,null!=r&&Ui(r))}function _l(t,e){t=null,null!==e.alternate&&(t=e.alternate.memoizedState.cache),(e=e.memoizedState.cache)!==t&&(e.refCount++,null!=t&&Ui(t))}function wl(t,e,r,n){if(10256&e.subtreeFlags)for(e=e.child;null!==e;)kl(t,e,r,n),e=e.sibling}function kl(t,e,r,n){var i=e.flags;switch(e.tag){case 0:case 11:case 15:wl(t,e,r,n),2048&i&&Ns(9,e);break;case 3:wl(t,e,r,n),2048&i&&(t=null,null!==e.alternate&&(t=e.alternate.memoizedState.cache),(e=e.memoizedState.cache)!==t&&(e.refCount++,null!=t&&Ui(t)));break;case 12:if(2048&i){wl(t,e,r,n),t=e.stateNode;try{var a=e.memoizedProps,o=a.id,s=a.onPostCommit;"function"===typeof s&&s(o,null===e.alternate?"mount":"update",t.passiveEffectDuration,-0)}catch(l){nu(e,e.return,l)}}else wl(t,e,r,n);break;case 23:break;case 22:a=e.stateNode,null!==e.memoizedState?4&a._visibility?wl(t,e,r,n):Sl(t,e):4&a._visibility?wl(t,e,r,n):(a._visibility|=4,Tl(t,e,r,n,0!==(10256&e.subtreeFlags))),2048&i&&bl(e.alternate,e);break;case 24:wl(t,e,r,n),2048&i&&_l(e.alternate,e);break;default:wl(t,e,r,n)}}function Tl(t,e,r,n,i){for(i=i&&0!==(10256&e.subtreeFlags),e=e.child;null!==e;){var a=t,o=e,s=r,l=n,c=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,l,i),Ns(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?4&u._visibility?Tl(a,o,s,l,i):Sl(a,o):(u._visibility|=4,Tl(a,o,s,l,i)),i&&2048&c&&bl(o.alternate,o);break;case 24:Tl(a,o,s,l,i),i&&2048&c&&_l(o.alternate,o);break;default:Tl(a,o,s,l,i)}e=e.sibling}}function Sl(t,e){if(10256&e.subtreeFlags)for(e=e.child;null!==e;){var r=t,n=e,i=n.flags;switch(n.tag){case 22:Sl(r,n),2048&i&&bl(n.alternate,n);break;case 24:Sl(r,n),2048&i&&_l(n.alternate,n);break;default:Sl(r,n)}e=e.sibling}}var Al=8192;function Ml(t){if(t.subtreeFlags&Al)for(t=t.child;null!==t;)Cl(t),t=t.sibling}function Cl(t){switch(t.tag){case 26:Ml(t),t.flags&Al&&null!==t.memoizedState&&function(t,e,r){if(null===Lh)throw Error(o(475));var n=Lh;if("stylesheet"===e.type&&("string"!==typeof r.media||!1!==matchMedia(r.media).matches)&&0===(4&e.state.loading)){if(null===e.instance){var i=yh(r.href),a=t.querySelector(vh(i));if(a)return null!==(t=a._p)&&"object"===typeof t&&"function"===typeof t.then&&(n.count++,n=Ih.bind(n),t.then(n,n)),e.state.loading|=4,e.instance=a,void Kt(a);a=t.ownerDocument||t,r=xh(r),(i=uh.get(i))&&Th(r,i),Kt(a=a.createElement("link"));var s=a;s._p=new Promise((function(t,e){s.onload=t,s.onerror=e})),Wu(a,"link",r),e.instance=a}null===n.stylesheets&&(n.stylesheets=new Map),n.stylesheets.set(e,t),(t=e.state.preload)&&0===(3&e.state.loading)&&(n.count++,e=Ih.bind(n),t.addEventListener("load",e),t.addEventListener("error",e))}}(pl,t.memoizedState,t.memoizedProps);break;case 5:default:Ml(t);break;case 3:case 4:var e=pl;pl=dh(t.stateNode.containerInfo),Ml(t),pl=e;break;case 22:null===t.memoizedState&&(null!==(e=t.alternate)&&null!==e.memoizedState?(e=Al,Al=16777216,Ml(t),Al=e):Ml(t))}}function El(t){var e=t.alternate;if(null!==e&&null!==(t=e.child)){e.child=null;do{e=t.sibling,t.sibling=null,t=e}while(null!==t)}}function Ll(t){var e=t.deletions;if(0!==(16&t.flags)){if(null!==e)for(var r=0;r<e.length;r++){var n=e[r];rl=n,zl(n,t)}El(t)}if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Pl(t),t=t.sibling}function Pl(t){switch(t.tag){case 0:case 11:case 15:Ll(t),2048&t.flags&&Us(9,t,t.return);break;case 3:case 12:default:Ll(t);break;case 22:var e=t.stateNode;null!==t.memoizedState&&4&e._visibility&&(null===t.return||13!==t.return.tag)?(e._visibility&=-5,Il(t)):Ll(t)}}function Il(t){var e=t.deletions;if(0!==(16&t.flags)){if(null!==e)for(var r=0;r<e.length;r++){var n=e[r];rl=n,zl(n,t)}El(t)}for(t=t.child;null!==t;){switch((e=t).tag){case 0:case 11:case 15:Us(8,e,e.return),Il(e);break;case 22:4&(r=e.stateNode)._visibility&&(r._visibility&=-5,Il(e));break;default:Il(e)}t=t.sibling}}function zl(t,e){for(;null!==rl;){var r=rl;switch(r.tag){case 0:case 11:case 15:Us(8,r,e);break;case 23:case 22:if(null!==r.memoizedState&&null!==r.memoizedState.cachePool){var n=r.memoizedState.cachePool.pool;null!=n&&n.refCount++}break;case 24:Ui(r.memoizedState.cache)}if(null!==(n=r.child))n.return=r,rl=n;else t:for(r=t;null!==rl;){var i=(n=rl).sibling,a=n.return;if(al(n),n===r){rl=null;break t}if(null!==i){i.return=a,rl=i;break t}rl=a}}}function Ol(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dl(t,e,r,n){return new Ol(t,e,r,n)}function Rl(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Fl(t,e){var r=t.alternate;return null===r?((r=Dl(t.tag,e,t.key,t.mode)).elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=31457280&t.flags,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function Bl(t,e){t.flags&=31457282;var r=t.alternate;return null===r?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,e=r.dependencies,t.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function jl(t,e,r,n,i,a){var s=0;if(n=t,"function"===typeof t)Rl(t)&&(s=1);else if("string"===typeof t)s=function(t,e,r){if(1===r||null!=e.itemProp)return!1;switch(t){case"meta":case"title":return!0;case"style":if("string"!==typeof e.precedence||"string"!==typeof e.href||""===e.href)break;return!0;case"link":if("string"!==typeof e.rel||"string"!==typeof e.href||""===e.href||e.onLoad||e.onError)break;return"stylesheet"!==e.rel||(t=e.disabled,"string"===typeof e.precedence&&null==t);case"script":if(e.async&&"function"!==typeof e.async&&"symbol"!==typeof e.async&&!e.onLoad&&!e.onError&&e.src&&"string"===typeof e.src)return!0}return!1}(t,r,Z.current)?26:"html"===t||"head"===t||"body"===t?27:5;else t:switch(t){case h:return Nl(r.children,i,a,e);case d:s=8,i|=24;break;case p:return(t=Dl(12,r,e,2|i)).elementType=p,t.lanes=a,t;case v:return(t=Dl(13,r,e,i)).elementType=v,t.lanes=a,t;case x:return(t=Dl(19,r,e,i)).elementType=x,t.lanes=a,t;case w:return Ul(r,i,a,e);default:if("object"===typeof t&&null!==t)switch(t.$$typeof){case f:case g:s=10;break t;case m:s=9;break t;case y:s=11;break t;case b:s=14;break t;case _:s=16,n=null;break t}s=29,r=Error(o(130,null===t?"null":typeof t,"")),n=null}return(e=Dl(s,r,e,i)).elementType=t,e.type=n,e.lanes=a,e}function Nl(t,e,r,n){return(t=Dl(7,t,n,e)).lanes=r,t}function Ul(t,e,r,n){(t=Dl(22,t,n,e)).elementType=w,t.lanes=r;var i={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var t=i._current;if(null===t)throw Error(o(456));if(0===(2&i._pendingVisibility)){var e=En(t,2);null!==e&&(i._pendingVisibility|=2,Ic(e,t,2))}},attach:function(){var t=i._current;if(null===t)throw Error(o(456));if(0!==(2&i._pendingVisibility)){var e=En(t,2);null!==e&&(i._pendingVisibility&=-3,Ic(e,t,2))}}};return t.stateNode=i,t}function Vl(t,e,r){return(t=Dl(6,t,null,e)).lanes=r,t}function ql(t,e,r){return(e=Dl(4,null!==t.children?t.children:[],t.key,e)).lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function $l(t){t.flags|=4}function Hl(t,e){if("stylesheet"!==e.type||0!==(4&e.state.loading))t.flags&=-16777217;else if(t.flags|=16777216,!Eh(e)){if(null!==(e=Ci.current)&&((4194176&nc)===nc?null!==Ei:(62914560&nc)!==nc&&0===(536870912&nc)||e!==Ei))throw di=li,si;t.flags|=8192}}function Wl(t,e){null!==e&&(t.flags|=4),16384&t.flags&&(e=22!==t.tag?Lt():536870912,t.lanes|=e,mc|=e)}function Gl(t,e){if(!Xn)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;null!==e;)null!==e.alternate&&(r=e),e=e.sibling;null===r?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?e||null===t.tail?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Yl(t){var e=null!==t.alternate&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=31457280&i.subtreeFlags,n|=31457280&i.flags,i.return=t,i=i.sibling;else for(i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function Zl(t,e,r){var n=e.pendingProps;switch(Gn(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Yl(e),null;case 3:return r=e.stateNode,n=null,null!==t&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),xs(ji),tt(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==t&&null!==t.child||(ni(e)?$l(e):null===t||t.memoizedState.isDehydrated&&0===(256&e.flags)||(e.flags|=1024,null!==Kn&&(Oc(Kn),Kn=null))),Yl(e),null;case 26:return r=e.memoizedState,null===t?($l(e),null!==r?(Yl(e),Hl(e,r)):(Yl(e),e.flags&=-16777217)):r?r!==t.memoizedState?($l(e),Yl(e),Hl(e,r)):(Yl(e),e.flags&=-16777217):(t.memoizedProps!==n&&$l(e),Yl(e),e.flags&=-16777217),null;case 27:rt(e),r=K.current;var i=e.type;if(null!==t&&null!=e.stateNode)t.memoizedProps!==n&&$l(e);else{if(!n){if(null===e.stateNode)throw Error(o(166));return Yl(e),null}t=Z.current,ni(e)?ei(e):(t=ch(i,n,r),e.stateNode=t,$l(e))}return Yl(e),null;case 5:if(rt(e),r=e.type,null!==t&&null!=e.stateNode)t.memoizedProps!==n&&$l(e);else{if(!n){if(null===e.stateNode)throw Error(o(166));return Yl(e),null}if(t=Z.current,ni(e))ei(e);else{switch(i=Zu(K.current),t){case 1:t=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(t=i.createElement("div")).innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t="string"===typeof n.is?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?t.multiple=!0:n.size&&(t.size=n.size);break;default:t="string"===typeof n.is?i.createElement(r,{is:n.is}):i.createElement(r)}}t[Bt]=e,t[jt]=n;t:for(i=e.child;null!==i;){if(5===i.tag||6===i.tag)t.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;null===i.sibling;){if(null===i.return||i.return===e)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=t;t:switch(Wu(t,r,n),r){case"button":case"input":case"select":case"textarea":t=!!n.autoFocus;break t;case"img":t=!0;break t;default:t=!1}t&&$l(e)}}return Yl(e),e.flags&=-16777217,null;case 6:if(t&&null!=e.stateNode)t.memoizedProps!==n&&$l(e);else{if("string"!==typeof n&&null===e.stateNode)throw Error(o(166));if(t=K.current,ni(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,null!==(i=Yn))switch(i.tag){case 27:case 5:n=i.memoizedProps}t[Bt]=e,(t=!!(t.nodeValue===r||null!==n&&!0===n.suppressHydrationWarning||Vu(t.nodeValue,r)))||ti(e)}else(t=Zu(t).createTextNode(n))[Bt]=e,e.stateNode=t}return Yl(e),null;case 13:if(n=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(i=ni(e),null!==n&&null!==n.dehydrated){if(null===t){if(!i)throw Error(o(318));if(!(i=null!==(i=e.memoizedState)?i.dehydrated:null))throw Error(o(317));i[Bt]=e}else ii(),0===(128&e.flags)&&(e.memoizedState=null),e.flags|=4;Yl(e),i=!1}else null!==Kn&&(Oc(Kn),Kn=null),i=!0;if(!i)return 256&e.flags?(zi(e),e):(zi(e),null)}if(zi(e),0!==(128&e.flags))return e.lanes=r,e;if(r=null!==n,t=null!==t&&null!==t.memoizedState,r){i=null,null!==(n=e.child).alternate&&null!==n.alternate.memoizedState&&null!==n.alternate.memoizedState.cachePool&&(i=n.alternate.memoizedState.cachePool.pool);var a=null;null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048)}return r!==t&&r&&(e.child.flags|=8192),Wl(e,e.updateQueue),Yl(e),null;case 4:return tt(),null===t&&Iu(e.stateNode.containerInfo),Yl(e),null;case 10:return xs(e.type),Yl(e),null;case 19:if(G(Oi),null===(i=e.memoizedState))return Yl(e),null;if(n=0!==(128&e.flags),null===(a=i.rendering))if(n)Gl(i,!1);else{if(0!==uc||null!==t&&0!==(128&t.flags))for(t=e.child;null!==t;){if(null!==(a=Di(t))){for(e.flags|=128,Gl(i,!1),t=a.updateQueue,e.updateQueue=t,Wl(e,t),e.subtreeFlags=0,t=r,r=e.child;null!==r;)Bl(r,t),r=r.sibling;return Y(Oi,1&Oi.current|2),e.child}t=t.sibling}null!==i.tail&&lt()>bc&&(e.flags|=128,n=!0,Gl(i,!1),e.lanes=4194304)}else{if(!n)if(null!==(t=Di(a))){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,Wl(e,t),Gl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Xn)return Yl(e),null}else 2*lt()-i.renderingStartTime>bc&&536870912!==r&&(e.flags|=128,n=!0,Gl(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(null!==(t=i.last)?t.sibling=a:e.child=a,i.last=a)}return null!==i.tail?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=lt(),e.sibling=null,t=Oi.current,Y(Oi,n?1&t|2:1&t),e):(Yl(e),null);case 22:case 23:return zi(e),Mi(),n=null!==e.memoizedState,null!==t?null!==t.memoizedState!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?0!==(536870912&r)&&0===(128&e.flags)&&(Yl(e),6&e.subtreeFlags&&(e.flags|=8192)):Yl(e),null!==(r=e.updateQueue)&&Wl(e,r.retryQueue),r=null,null!==t&&null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),n=null,null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),n!==r&&(e.flags|=2048),null!==t&&G(Yi),null;case 24:return r=null,null!==t&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),xs(ji),Yl(e),null;case 25:return null}throw Error(o(156,e.tag))}function Xl(t,e){switch(Gn(e),e.tag){case 1:return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return xs(ji),tt(),0!==(65536&(t=e.flags))&&0===(128&t)?(e.flags=-65537&t|128,e):null;case 26:case 27:case 5:return rt(e),null;case 13:if(zi(e),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(o(340));ii()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return G(Oi),null;case 4:return tt(),null;case 10:return xs(e.type),null;case 22:case 23:return zi(e),Mi(),null!==t&&G(Yi),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 24:return xs(ji),null;default:return null}}function Kl(t,e){switch(Gn(e),e.tag){case 3:xs(ji),tt();break;case 26:case 27:case 5:rt(e);break;case 4:tt();break;case 13:zi(e);break;case 19:G(Oi);break;case 10:xs(e.type);break;case 22:case 23:zi(e),Mi(),null!==t&&G(Yi);break;case 24:xs(ji)}}var Jl={getCacheForType:function(t){var e=Ss(ji),r=e.data.get(t);return void 0===r&&(r=t(),e.data.set(t,r)),r}},Ql="function"===typeof WeakMap?WeakMap:Map,tc=0,ec=null,rc=null,nc=0,ic=0,ac=null,oc=!1,sc=!1,lc=!1,cc=0,uc=0,hc=0,dc=0,pc=0,fc=0,mc=0,gc=null,yc=null,vc=!1,xc=0,bc=1/0,_c=null,wc=null,kc=!1,Tc=null,Sc=0,Ac=0,Mc=null,Cc=0,Ec=null;function Lc(){if(0!==(2&tc)&&0!==nc)return nc&-nc;if(null!==L.T){return 0!==$i?$i:_u()}return Rt()}function Pc(){0===fc&&(fc=0===(536870912&nc)||Xn?Et():536870912);var t=Ci.current;return null!==t&&(t.flags|=32),fc}function Ic(t,e,r){(t===ec&&2===ic||null!==t.cancelPendingCommit)&&(Nc(t,0),Fc(t,nc,fc,!1)),It(t,r),0!==(2&tc)&&t===ec||(t===ec&&(0===(2&tc)&&(dc|=r),4===uc&&Fc(t,nc,fc,!1)),mu(t))}function zc(t,e,r){if(0!==(6&tc))throw Error(o(327));for(var n=!r&&0===(60&e)&&0===(e&t.expiredLanes)||Mt(t,e),i=n?function(t,e){var r=tc;tc|=2;var n=Vc(),i=qc();ec!==t||nc!==e?(_c=null,bc=lt()+500,Nc(t,e)):sc=Mt(t,e);t:for(;;)try{if(0!==ic&&null!==rc){e=rc;var a=ac;e:switch(ic){case 1:ic=0,ac=null,Xc(t,e,a,1);break;case 2:if(ci(a)){ic=0,ac=null,Zc(e);break}e=function(){2===ic&&ec===t&&(ic=7),mu(t)},a.then(e,e);break t;case 3:ic=7;break t;case 4:ic=5;break t;case 7:ci(a)?(ic=0,ac=null,Zc(e)):(ic=0,ac=null,Xc(t,e,a,7));break;case 5:var s=null;switch(rc.tag){case 26:s=rc.memoizedState;case 5:case 27:var l=rc;if(!s||Eh(s)){ic=0,ac=null;var c=l.sibling;if(null!==c)rc=c;else{var u=l.return;null!==u?(rc=u,Kc(u)):rc=null}break e}}ic=0,ac=null,Xc(t,e,a,5);break;case 6:ic=0,ac=null,Xc(t,e,a,6);break;case 8:jc(),uc=6;break t;default:throw Error(o(462))}}Gc();break}catch(h){Uc(t,h)}return ys=gs=null,L.H=n,L.A=i,tc=r,null!==rc?0:(ec=null,nc=0,An(),uc)}(t,e):Hc(t,e,!0),a=n;;){if(0===i){sc&&!n&&Fc(t,e,0,!1);break}if(6===i)Fc(t,e,0,!oc);else{if(r=t.current.alternate,a&&!Rc(r)){i=Hc(t,e,!1),a=!1;continue}if(2===i){if(a=e,t.errorRecoveryDisabledLanes&a)var s=0;else s=0!==(s=-536870913&t.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){e=s;t:{var l=t;i=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Nc(l,s).flags|=256),2!==(s=Hc(l,s,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=a,dc|=a,i=4;break t}a=yc,yc=i,null!==a&&Oc(a)}i=s}if(a=!1,2!==i)continue}}if(1===i){Nc(t,0),Fc(t,e,0,!0);break}t:{switch(n=t,i){case 0:case 1:throw Error(o(345));case 4:if((4194176&e)===e){Fc(n,e,fc,!oc);break t}break;case 2:yc=null;break;case 3:case 5:break;default:throw Error(o(329))}if(n.finishedWork=r,n.finishedLanes=e,(62914560&e)===e&&10<(a=xc+300-lt())){if(Fc(n,e,fc,!oc),0!==At(n,0))break t;n.timeoutHandle=th(Dc.bind(null,n,r,yc,_c,vc,e,fc,dc,mc,oc,2,-0,0),a)}else Dc(n,r,yc,_c,vc,e,fc,dc,mc,oc,0,-0,0)}}break}mu(t)}function Oc(t){null===yc?yc=t:yc.push.apply(yc,t)}function Dc(t,e,r,n,i,a,s,l,c,u,h,d,p){var f=e.subtreeFlags;if((8192&f||16785408===(16785408&f))&&(Lh={stylesheets:null,count:0,unsuspend:Ph},Cl(e),null!==(e=function(){if(null===Lh)throw Error(o(475));var t=Lh;return t.stylesheets&&0===t.count&&Oh(t,t.stylesheets),0<t.count?function(e){var r=setTimeout((function(){if(t.stylesheets&&Oh(t,t.stylesheets),t.unsuspend){var e=t.unsuspend;t.unsuspend=null,e()}}),6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(r)}}:null}())))return t.cancelPendingCommit=e(Qc.bind(null,t,r,n,i,s,l,c,1,d,p)),void Fc(t,a,s,!u);Qc(t,r,n,i,s,l,c,h,d,p)}function Rc(t){for(var e=t;;){var r=e.tag;if((0===r||11===r||15===r)&&16384&e.flags&&(null!==(r=e.updateQueue)&&null!==(r=r.stores)))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!Gr(a(),i))return!1}catch(o){return!1}}if(r=e.child,16384&e.subtreeFlags&&null!==r)r.return=e,e=r;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Fc(t,e,r,n){e&=~pc,e&=~dc,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var i=e;0<i;){var a=31-bt(i),o=1<<a;n[a]=-1,i&=~o}0!==r&&zt(t,r,e)}function Bc(){return 0!==(6&tc)||(gu(0,!1),!1)}function jc(){if(null!==rc){if(0===ic)var t=rc.return;else ys=gs=null,ya(t=rc),fi=null,mi=0,t=rc;for(;null!==t;)Kl(t.alternate,t),t=t.return;rc=null}}function Nc(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;-1!==r&&(t.timeoutHandle=-1,eh(r)),null!==(r=t.cancelPendingCommit)&&(t.cancelPendingCommit=null,r()),jc(),ec=t,rc=r=Fl(t.current,null),nc=e,ic=0,ac=null,oc=!1,sc=Mt(t,e),lc=!1,mc=fc=pc=dc=hc=uc=0,yc=gc=null,vc=!1,0!==(8&e)&&(e|=32&e);var n=t.entangledLanes;if(0!==n)for(t=t.entanglements,n&=e;0<n;){var i=31-bt(n),a=1<<i;e|=t[i],n&=~a}return cc=e,An(),r}function Uc(t,e){Qi=null,L.H=So,e===oi?(e=pi(),ic=3):e===si?(e=pi(),ic=4):ic=e===qo?8:null!==e&&"object"===typeof e&&"function"===typeof e.then?6:1,ac=e,null===rc&&(uc=1,Bo(t,On(e,t.current)))}function Vc(){var t=L.H;return L.H=So,null===t?So:t}function qc(){var t=L.A;return L.A=Jl,t}function $c(){uc=4,oc||(4194176&nc)!==nc&&null!==Ci.current||(sc=!0),0===(134217727&hc)&&0===(134217727&dc)||null===ec||Fc(ec,nc,fc,!1)}function Hc(t,e,r){var n=tc;tc|=2;var i=Vc(),a=qc();ec===t&&nc===e||(_c=null,Nc(t,e)),e=!1;var o=uc;t:for(;;)try{if(0!==ic&&null!==rc){var s=rc,l=ac;switch(ic){case 8:jc(),o=6;break t;case 3:case 2:case 6:null===Ci.current&&(e=!0);var c=ic;if(ic=0,ac=null,Xc(t,s,l,c),r&&sc){o=0;break t}break;default:c=ic,ic=0,ac=null,Xc(t,s,l,c)}}Wc(),o=uc;break}catch(u){Uc(t,u)}return e&&t.shellSuspendCounter++,ys=gs=null,tc=n,L.H=i,L.A=a,null===rc&&(ec=null,nc=0,An()),o}function Wc(){for(;null!==rc;)Yc(rc)}function Gc(){for(;null!==rc&&!ot();)Yc(rc)}function Yc(t){var e=fs(t.alternate,t,cc);t.memoizedProps=t.pendingProps,null===e?Kc(t):rc=e}function Zc(t){var e=t,r=e.alternate;switch(e.tag){case 15:case 0:e=Qo(r,e,e.pendingProps,e.type,void 0,nc);break;case 11:e=Qo(r,e,e.pendingProps,e.type.render,e.ref,nc);break;case 5:ya(e);default:Kl(r,e),e=fs(r,e=rc=Bl(e,cc),cc)}t.memoizedProps=t.pendingProps,null===e?Kc(t):rc=e}function Xc(t,e,r,n){ys=gs=null,ya(e),fi=null,mi=0;var i=e.return;try{if(function(t,e,r,n,i){if(r.flags|=32768,null!==n&&"object"===typeof n&&"function"===typeof n.then){if(null!==(e=r.alternate)&&ws(e,r,i,!0),null!==(r=Ci.current)){switch(r.tag){case 13:return null===Ei?$c():null===r.alternate&&0===uc&&(uc=3),r.flags&=-257,r.flags|=65536,r.lanes=i,n===li?r.flags|=16384:(null===(e=r.updateQueue)?r.updateQueue=new Set([n]):e.add(n),iu(t,n,i)),!1;case 22:return r.flags|=65536,n===li?r.flags|=16384:(null===(e=r.updateQueue)?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=e):null===(r=e.retryQueue)?e.retryQueue=new Set([n]):r.add(n),iu(t,n,i)),!1}throw Error(o(435,r.tag))}return iu(t,n,i),$c(),!1}if(Xn)return null!==(e=Ci.current)?(0===(65536&e.flags)&&(e.flags|=256),e.flags|=65536,e.lanes=i,n!==Qn&&ai(On(t=Error(o(422),{cause:n}),r))):(n!==Qn&&ai(On(e=Error(o(423),{cause:n}),r)),(t=t.current.alternate).flags|=65536,i&=-i,t.lanes|=i,n=On(n,r),Os(t,i=No(t.stateNode,n,i)),4!==uc&&(uc=2)),!1;var a=Error(o(520),{cause:n});if(a=On(a,r),null===gc?gc=[a]:gc.push(a),4!==uc&&(uc=2),null===e)return!0;n=On(n,r),r=e;do{switch(r.tag){case 3:return r.flags|=65536,t=i&-i,r.lanes|=t,Os(r,t=No(r.stateNode,n,t)),!1;case 1:if(e=r.type,a=r.stateNode,0===(128&r.flags)&&("function"===typeof e.getDerivedStateFromError||null!==a&&"function"===typeof a.componentDidCatch&&(null===wc||!wc.has(a))))return r.flags|=65536,i&=-i,r.lanes|=i,Vo(i=Uo(i),t,r,n),Os(r,i),!1}r=r.return}while(null!==r);return!1}(t,i,e,r,nc))return uc=1,Bo(t,On(r,t.current)),void(rc=null)}catch(a){if(null!==i)throw rc=i,a;return uc=1,Bo(t,On(r,t.current)),void(rc=null)}32768&e.flags?(Xn||1===n?t=!0:sc||0!==(536870912&nc)?t=!1:(oc=t=!0,(2===n||3===n||6===n)&&(null!==(n=Ci.current)&&13===n.tag&&(n.flags|=16384))),Jc(e,t)):Kc(e)}function Kc(t){var e=t;do{if(0!==(32768&e.flags))return void Jc(e,oc);t=e.return;var r=Zl(e.alternate,e,cc);if(null!==r)return void(rc=r);if(null!==(e=e.sibling))return void(rc=e);rc=e=t}while(null!==e);0===uc&&(uc=5)}function Jc(t,e){do{var r=Xl(t.alternate,t);if(null!==r)return r.flags&=32767,void(rc=r);if(null!==(r=t.return)&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!e&&null!==(t=t.sibling))return void(rc=t);rc=t=r}while(null!==t);uc=6,rc=null}function Qc(t,e,r,n,i,a,s,l,c,u){var h=L.T,d=V.p;try{V.p=2,L.T=null,function(t,e,r,n,i,a,s,l){do{eu()}while(null!==Tc);if(0!==(6&tc))throw Error(o(327));var c=t.finishedWork;if(n=t.finishedLanes,null===c)return null;if(t.finishedWork=null,t.finishedLanes=0,c===t.current)throw Error(o(177));t.callbackNode=null,t.callbackPriority=0,t.cancelPendingCommit=null;var u=c.lanes|c.childLanes;if(function(t,e,r,n,i,a){var o=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(r=o&~r;0<r;){var u=31-bt(r),h=1<<u;s[u]=0,l[u]=-1;var d=c[u];if(null!==d)for(c[u]=null,u=0;u<d.length;u++){var p=d[u];null!==p&&(p.lane&=-536870913)}r&=~h}0!==n&&zt(t,n,0),0!==a&&0===i&&0!==t.tag&&(t.suspendedLanes|=a&~(o&~e))}(t,n,u|=Sn,a,s,l),t===ec&&(rc=ec=null,nc=0),0===(10256&c.subtreeFlags)&&0===(10256&c.flags)||kc||(kc=!0,Ac=u,Mc=r,function(t,e){it(t,e)}(dt,(function(){return eu(),null}))),r=0!==(15990&c.flags),0!==(15990&c.subtreeFlags)||r?(r=L.T,L.T=null,a=V.p,V.p=2,s=tc,tc|=4,function(t,e){if(t=t.containerInfo,Gu=$h,Qr(t=Jr(t))){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else t:{var n=(r=(r=t.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch(g){r=null;break t}var s=0,l=-1,c=-1,u=0,h=0,d=t,p=null;e:for(;;){for(var f;d!==r||0!==i&&3!==d.nodeType||(l=s+i),d!==a||0!==n&&3!==d.nodeType||(c=s+n),3===d.nodeType&&(s+=d.nodeValue.length),null!==(f=d.firstChild);)p=d,d=f;for(;;){if(d===t)break e;if(p===r&&++u===i&&(l=s),p===a&&++h===n&&(c=s),null!==(f=d.nextSibling))break;p=(d=p).parentNode}d=f}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yu={focusedElem:t,selectionRange:r},$h=!1,rl=e;null!==rl;)if(t=(e=rl).child,0!==(1028&e.subtreeFlags)&&null!==t)t.return=e,rl=t;else for(;null!==rl;){switch(a=(e=rl).alternate,t=e.flags,e.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&t)&&null!==a){t=void 0,r=e,i=a.memoizedProps,a=a.memoizedState,n=r.stateNode;try{var m=zo(r.type,i,(r.elementType,r.type));t=n.getSnapshotBeforeUpdate(m,a),n.__reactInternalSnapshotBeforeUpdate=t}catch(y){nu(r,r.return,y)}}break;case 3:if(0!==(1024&t))if(9===(r=(t=e.stateNode.containerInfo).nodeType))oh(t);else if(1===r)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":oh(t);break;default:t.textContent=""}break;default:if(0!==(1024&t))throw Error(o(163))}if(null!==(t=e.sibling)){t.return=e.return,rl=t;break}rl=e.return}m=nl,nl=!1}(t,c),fl(c,t),tn(Yu,t.containerInfo),$h=!!Gu,Yu=Gu=null,t.current=c,il(t,c.alternate,c),st(),tc=s,V.p=a,L.T=r):t.current=c,kc?(kc=!1,Tc=t,Sc=n):tu(t,u),u=t.pendingLanes,0===u&&(wc=null),function(t){if(vt&&"function"===typeof vt.onCommitFiberRoot)try{vt.onCommitFiberRoot(yt,t,void 0,128===(128&t.current.flags))}catch(e){}}(c.stateNode),mu(t),null!==e)for(i=t.onRecoverableError,c=0;c<e.length;c++)u=e[c],i(u.value,{componentStack:u.stack});0!==(3&Sc)&&eu(),u=t.pendingLanes,0!==(4194218&n)&&0!==(42&u)?t===Ec?Cc++:(Cc=0,Ec=t):Cc=0,gu(0,!1)}(t,e,r,n,d,i,a,s)}finally{L.T=h,V.p=d}}function tu(t,e){0===(t.pooledCacheLanes&=e)&&(null!=(e=t.pooledCache)&&(t.pooledCache=null,Ui(e)))}function eu(){if(null!==Tc){var t=Tc,e=Ac;Ac=0;var r=Dt(Sc),n=L.T,i=V.p;try{if(V.p=32>r?32:r,L.T=null,null===Tc)var a=!1;else{r=Mc,Mc=null;var s=Tc,l=Sc;if(Tc=null,Sc=0,0!==(6&tc))throw Error(o(331));var c=tc;if(tc|=4,Pl(s.current),kl(s,s.current,l,r),tc=c,gu(0,!1),vt&&"function"===typeof vt.onPostCommitFiberRoot)try{vt.onPostCommitFiberRoot(yt,s)}catch(u){}a=!0}return a}finally{V.p=i,L.T=n,tu(t,e)}}return!1}function ru(t,e,r){e=On(r,e),null!==(t=Is(t,e=No(t.stateNode,e,2),2))&&(It(t,2),mu(t))}function nu(t,e,r){if(3===t.tag)ru(t,t,r);else for(;null!==e;){if(3===e.tag){ru(e,t,r);break}if(1===e.tag){var n=e.stateNode;if("function"===typeof e.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===wc||!wc.has(n))){t=On(r,t),null!==(n=Is(e,r=Uo(2),2))&&(Vo(r,n,e,t),It(n,2),mu(n));break}}e=e.return}}function iu(t,e,r){var n=t.pingCache;if(null===n){n=t.pingCache=new Ql;var i=new Set;n.set(e,i)}else void 0===(i=n.get(e))&&(i=new Set,n.set(e,i));i.has(r)||(lc=!0,i.add(r),t=au.bind(null,t,e,r),e.then(t,t))}function au(t,e,r){var n=t.pingCache;null!==n&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,ec===t&&(nc&r)===r&&(4===uc||3===uc&&(62914560&nc)===nc&&300>lt()-xc?0===(2&tc)&&Nc(t,0):pc|=r,mc===nc&&(mc=0)),mu(t)}function ou(t,e){0===e&&(e=Lt()),null!==(t=En(t,e))&&(It(t,e),mu(t))}function su(t){var e=t.memoizedState,r=0;null!==e&&(r=e.retryLane),ou(t,r)}function lu(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(o(314))}null!==n&&n.delete(e),ou(t,r)}var cu=null,uu=null,hu=!1,du=!1,pu=!1,fu=0;function mu(t){var e;t!==uu&&null===t.next&&(null===uu?cu=uu=t:uu=uu.next=t),du=!0,hu||(hu=!0,e=yu,nh((function(){0!==(6&tc)?it(ut,e):e()})))}function gu(t,e){if(!pu&&du){pu=!0;do{for(var r=!1,n=cu;null!==n;){if(!e)if(0!==t){var i=n.pendingLanes;if(0===i)var a=0;else{var o=n.suspendedLanes,s=n.pingedLanes;a=(1<<31-bt(42|t)+1)-1,a=201326677&(a&=i&~(o&~s))?201326677&a|1:a?2|a:0}0!==a&&(r=!0,bu(n,a))}else a=nc,0===(3&(a=At(n,n===ec?a:0)))||Mt(n,a)||(r=!0,bu(n,a));n=n.next}}while(r);pu=!1}}function yu(){du=hu=!1;var t=0;0!==fu&&(function(){var t=window.event;if(t&&"popstate"===t.type)return t!==Qu&&(Qu=t,!0);return Qu=null,!1}()&&(t=fu),fu=0);for(var e=lt(),r=null,n=cu;null!==n;){var i=n.next,a=vu(n,e);0===a?(n.next=null,null===r?cu=i:r.next=i,null===i&&(uu=r)):(r=n,(0!==t||0!==(3&a))&&(du=!0)),n=i}gu(t,!1)}function vu(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=-62914561&t.pendingLanes;0<a;){var o=31-bt(a),s=1<<o,l=i[o];-1===l?0!==(s&r)&&0===(s&n)||(i[o]=Ct(s,e)):l<=e&&(t.expiredLanes|=s),a&=~s}if(r=nc,r=At(t,t===(e=ec)?r:0),n=t.callbackNode,0===r||t===e&&2===ic||null!==t.cancelPendingCommit)return null!==n&&null!==n&&at(n),t.callbackNode=null,t.callbackPriority=0;if(0===(3&r)||Mt(t,r)){if((e=r&-r)===t.callbackPriority)return e;switch(null!==n&&at(n),Dt(r)){case 2:case 8:r=ht;break;case 32:default:r=dt;break;case 268435456:r=ft}return n=xu.bind(null,t),r=it(r,n),t.callbackPriority=e,t.callbackNode=r,e}return null!==n&&null!==n&&at(n),t.callbackPriority=2,t.callbackNode=null,2}function xu(t,e){var r=t.callbackNode;if(eu()&&t.callbackNode!==r)return null;var n=nc;return 0===(n=At(t,t===ec?n:0))?null:(zc(t,n,e),vu(t,lt()),null!=t.callbackNode&&t.callbackNode===r?xu.bind(null,t):null)}function bu(t,e){if(eu())return null;zc(t,e,!0)}function _u(){return 0===fu&&(fu=Et()),fu}function wu(t){return null==t||"symbol"===typeof t||"boolean"===typeof t?null:"function"===typeof t?t:Ee(""+t)}function ku(t,e){var r=e.ownerDocument.createElement("input");return r.name=e.name,r.value=e.value,t.id&&r.setAttribute("form",t.id),e.parentNode.insertBefore(r,e),t=new FormData(t),r.parentNode.removeChild(r),t}for(var Tu=0;Tu<_n.length;Tu++){var Su=_n[Tu];wn(Su.toLowerCase(),"on"+(Su[0].toUpperCase()+Su.slice(1)))}wn(pn,"onAnimationEnd"),wn(fn,"onAnimationIteration"),wn(mn,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(gn,"onTransitionRun"),wn(yn,"onTransitionStart"),wn(vn,"onTransitionCancel"),wn(xn,"onTransitionEnd"),ee("onMouseEnter",["mouseout","mouseover"]),ee("onMouseLeave",["mouseout","mouseover"]),ee("onPointerEnter",["pointerout","pointerover"]),ee("onPointerLeave",["pointerout","pointerover"]),te("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),te("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),te("onBeforeInput",["compositionend","keypress","textInput","paste"]),te("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),te("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),te("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Au));function Cu(t,e){e=0!==(4&e);for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;t:{var a=void 0;if(e)for(var o=n.length-1;0<=o;o--){var s=n[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break t;a=s,i.currentTarget=c;try{a(i)}catch(u){Oo(u)}i.currentTarget=null,a=l}else for(o=0;o<n.length;o++){if(l=(s=n[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break t;a=s,i.currentTarget=c;try{a(i)}catch(u){Oo(u)}i.currentTarget=null,a=l}}}}function Eu(t,e){var r=e[Ut];void 0===r&&(r=e[Ut]=new Set);var n=t+"__bubble";r.has(n)||(zu(e,t,2,!1),r.add(n))}function Lu(t,e,r){var n=0;e&&(n|=4),zu(r,t,n,e)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Iu(t){if(!t[Pu]){t[Pu]=!0,Jt.forEach((function(e){"selectionchange"!==e&&(Mu.has(e)||Lu(e,!1,t),Lu(e,!0,t))}));var e=9===t.nodeType?t:t.ownerDocument;null===e||e[Pu]||(e[Pu]=!0,Lu("selectionchange",!1,e))}}function zu(t,e,r,n){switch(Kh(e)){case 2:var i=Hh;break;case 8:i=Wh;break;default:i=Gh}r=i.bind(null,e,r,t),i=void 0,!Be||"touchstart"!==e&&"touchmove"!==e&&"wheel"!==e||(i=!0),n?void 0!==i?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):void 0!==i?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function Ou(t,e,r,n,i){var a=n;if(0===(1&e)&&0===(2&e)&&null!==n)t:for(;;){if(null===n)return;var o=n.tag;if(3===o||4===o){var s=n.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=n.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=Gt(s)))return;if(5===(l=o.tag)||6===l||26===l||27===l){n=a=o;continue t}s=s.parentNode}}n=n.return}Re((function(){var n=a,i=Pe(r),o=[];t:{var s=bn.get(t);if(void 0!==s){var l=Je,c=t;switch(t){case"keypress":if(0===$e(r))break t;case"keydown":case"keyup":l=pr;break;case"focusin":c="focus",l=ir;break;case"focusout":c="blur",l=ir;break;case"beforeblur":case"afterblur":l=ir;break;case"click":if(2===r.button)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=nr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=mr;break;case pn:case fn:case mn:l=ar;break;case xn:l=gr;break;case"scroll":case"scrollend":l=tr;break;case"wheel":l=yr;break;case"copy":case"cut":case"paste":l=or;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=fr;break;case"toggle":case"beforetoggle":l=vr}var u=0!==(4&e),h=!u&&("scroll"===t||"scrollend"===t),d=u?null!==s?s+"Capture":null:s;u=[];for(var p,f=n;null!==f;){var m=f;if(p=m.stateNode,5!==(m=m.tag)&&26!==m&&27!==m||null===p||null===d||null!=(m=Fe(f,d))&&u.push(Du(f,m,p)),h)break;f=f.return}0<u.length&&(s=new l(s,c,null,r,i),o.push({event:s,listeners:u}))}}if(0===(7&e)){if(l="mouseout"===t||"pointerout"===t,(!(s="mouseover"===t||"pointerover"===t)||r===Le||!(c=r.relatedTarget||r.fromElement)||!Gt(c)&&!c[Nt])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=n,null!==(c=(c=r.relatedTarget||r.toElement)?Gt(c):null)&&(h=F(c),u=c.tag,c!==h||5!==u&&27!==u&&6!==u)&&(c=null)):(l=null,c=n),l!==c)){if(u=rr,m="onMouseLeave",d="onMouseEnter",f="mouse","pointerout"!==t&&"pointerover"!==t||(u=fr,m="onPointerLeave",d="onPointerEnter",f="pointer"),h=null==l?s:Zt(l),p=null==c?s:Zt(c),(s=new u(m,f+"leave",l,r,i)).target=h,s.relatedTarget=p,m=null,Gt(i)===n&&((u=new u(d,f+"enter",c,r,i)).target=p,u.relatedTarget=h,m=u),h=m,l&&c)t:{for(d=c,f=0,p=u=l;p;p=Fu(p))f++;for(p=0,m=d;m;m=Fu(m))p++;for(;0<f-p;)u=Fu(u),f--;for(;0<p-f;)d=Fu(d),p--;for(;f--;){if(u===d||null!==d&&u===d.alternate)break t;u=Fu(u),d=Fu(d)}u=null}else u=null;null!==l&&Bu(o,s,l,u,!1),null!==c&&null!==h&&Bu(o,h,c,u,!0)}if("select"===(l=(s=n?Zt(n):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Rr;else if(Lr(s))if(Fr)g=Wr;else{g=$r;var y=qr}else!(l=s.nodeName)||"input"!==l.toLowerCase()||"checkbox"!==s.type&&"radio"!==s.type?n&&Ae(n.elementType)&&(g=Rr):g=Hr;switch(g&&(g=g(t,n))?Pr(o,g,r,i):(y&&y(t,s,n),"focusout"===t&&n&&"number"===s.type&&null!=n.memoizedProps.value&&ve(s,"number",s.value)),y=n?Zt(n):window,t){case"focusin":(Lr(y)||"true"===y.contentEditable)&&(rn=y,nn=n,an=null);break;case"focusout":an=nn=rn=null;break;case"mousedown":on=!0;break;case"contextmenu":case"mouseup":case"dragend":on=!1,sn(o,r,i);break;case"selectionchange":if(en)break;case"keydown":case"keyup":sn(o,r,i)}var v;if(br)t:{switch(t){case"compositionstart":var x="onCompositionStart";break t;case"compositionend":x="onCompositionEnd";break t;case"compositionupdate":x="onCompositionUpdate";break t}x=void 0}else Cr?Ar(t,r)&&(x="onCompositionEnd"):"keydown"===t&&229===r.keyCode&&(x="onCompositionStart");x&&(kr&&"ko"!==r.locale&&(Cr||"onCompositionStart"!==x?"onCompositionEnd"===x&&Cr&&(v=qe()):(Ue="value"in(Ne=i)?Ne.value:Ne.textContent,Cr=!0)),0<(y=Ru(n,x)).length&&(x=new sr(x,t,null,r,i),o.push({event:x,listeners:y}),v?x.data=v:null!==(v=Mr(r))&&(x.data=v))),(v=wr?function(t,e){switch(t){case"compositionend":return Mr(e);case"keypress":return 32!==e.which?null:(Sr=!0,Tr);case"textInput":return(t=e.data)===Tr&&Sr?null:t;default:return null}}(t,r):function(t,e){if(Cr)return"compositionend"===t||!br&&Ar(t,e)?(t=qe(),Ve=Ue=Ne=null,Cr=!1,t):null;switch(t){case"paste":default:return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return kr&&"ko"!==e.locale?null:e.data}}(t,r))&&(0<(x=Ru(n,"onBeforeInput")).length&&(y=new sr("onBeforeInput","beforeinput",null,r,i),o.push({event:y,listeners:x}),y.data=v)),function(t,e,r,n,i){if("submit"===e&&r&&r.stateNode===i){var a=wu((i[jt]||null).action),o=n.submitter;o&&null!==(e=(e=o[jt]||null)?wu(e.formAction):o.getAttribute("formAction"))&&(a=e,o=null);var s=new Je("action","action",null,n,i);t.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==fu){var t=o?ku(i,o):new FormData(i);uo(r,{pending:!0,data:t,method:i.method,action:a},null,t)}}else"function"===typeof a&&(s.preventDefault(),t=o?ku(i,o):new FormData(i),uo(r,{pending:!0,data:t,method:i.method,action:a},a,t))},currentTarget:i}]})}}(o,t,n,r,i)}Cu(o,e)}))}function Du(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Ru(t,e){for(var r=e+"Capture",n=[];null!==t;){var i=t,a=i.stateNode;5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=Fe(t,r))&&n.unshift(Du(t,i,a)),null!=(i=Fe(t,e))&&n.push(Du(t,i,a))),t=t.return}return n}function Fu(t){if(null===t)return null;do{t=t.return}while(t&&5!==t.tag&&27!==t.tag);return t||null}function Bu(t,e,r,n,i){for(var a=e._reactName,o=[];null!==r&&r!==n;){var s=r,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===n)break;5!==s&&26!==s&&27!==s||null===c||(l=c,i?null!=(c=Fe(r,a))&&o.unshift(Du(r,c,l)):i||null!=(c=Fe(r,a))&&o.push(Du(r,c,l))),r=r.return}0!==o.length&&t.push({event:e,listeners:o})}var ju=/\r\n?/g,Nu=/\u0000|\uFFFD/g;function Uu(t){return("string"===typeof t?t:""+t).replace(ju,"\n").replace(Nu,"")}function Vu(t,e){return e=Uu(e),Uu(t)===e}function qu(){}function $u(t,e,r,n,i,a){switch(r){case"children":"string"===typeof n?"body"===e||"textarea"===e&&""===n||we(t,n):("number"===typeof n||"bigint"===typeof n)&&"body"!==e&&we(t,""+n);break;case"className":se(t,"class",n);break;case"tabIndex":se(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":se(t,r,n);break;case"style":Se(t,n,a);break;case"data":if("object"!==e){se(t,"data",n);break}case"src":case"href":if(""===n&&("a"!==e||"href"!==r)){t.removeAttribute(r);break}if(null==n||"function"===typeof n||"symbol"===typeof n||"boolean"===typeof n){t.removeAttribute(r);break}n=Ee(""+n),t.setAttribute(r,n);break;case"action":case"formAction":if("function"===typeof n){t.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof a&&("formAction"===r?("input"!==e&&$u(t,e,"name",i.name,i,null),$u(t,e,"formEncType",i.formEncType,i,null),$u(t,e,"formMethod",i.formMethod,i,null),$u(t,e,"formTarget",i.formTarget,i,null)):($u(t,e,"encType",i.encType,i,null),$u(t,e,"method",i.method,i,null),$u(t,e,"target",i.target,i,null))),null==n||"symbol"===typeof n||"boolean"===typeof n){t.removeAttribute(r);break}n=Ee(""+n),t.setAttribute(r,n);break;case"onClick":null!=n&&(t.onclick=qu);break;case"onScroll":null!=n&&Eu("scroll",t);break;case"onScrollEnd":null!=n&&Eu("scrollend",t);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(o(61));if(null!=(r=n.__html)){if(null!=i.children)throw Error(o(60));t.innerHTML=r}}break;case"multiple":t.multiple=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"muted":t.muted=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==n||"function"===typeof n||"boolean"===typeof n||"symbol"===typeof n){t.removeAttribute("xlink:href");break}r=Ee(""+n),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=n&&"function"!==typeof n&&"symbol"!==typeof n?t.setAttribute(r,""+n):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&"function"!==typeof n&&"symbol"!==typeof n?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":!0===n?t.setAttribute(r,""):!1!==n&&null!=n&&"function"!==typeof n&&"symbol"!==typeof n?t.setAttribute(r,n):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":null!=n&&"function"!==typeof n&&"symbol"!==typeof n&&!isNaN(n)&&1<=n?t.setAttribute(r,n):t.removeAttribute(r);break;case"rowSpan":case"start":null==n||"function"===typeof n||"symbol"===typeof n||isNaN(n)?t.removeAttribute(r):t.setAttribute(r,n);break;case"popover":Eu("beforetoggle",t),Eu("toggle",t),oe(t,"popover",n);break;case"xlinkActuate":le(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":le(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":le(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":le(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":le(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":le(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":le(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":le(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":le(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":oe(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||"o"!==r[0]&&"O"!==r[0]||"n"!==r[1]&&"N"!==r[1])&&oe(t,r=Me.get(r)||r,n)}}function Hu(t,e,r,n,i,a){switch(r){case"style":Se(t,n,a);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(o(61));if(null!=(r=n.__html)){if(null!=i.children)throw Error(o(60));t.innerHTML=r}}break;case"children":"string"===typeof n?we(t,n):("number"===typeof n||"bigint"===typeof n)&&we(t,""+n);break;case"onScroll":null!=n&&Eu("scroll",t);break;case"onScrollEnd":null!=n&&Eu("scrollend",t);break;case"onClick":null!=n&&(t.onclick=qu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Qt.hasOwnProperty(r)||("o"!==r[0]||"n"!==r[1]||(i=r.endsWith("Capture"),e=r.slice(2,i?r.length-7:void 0),"function"===typeof(a=null!=(a=t[jt]||null)?a[r]:null)&&t.removeEventListener(e,a,i),"function"!==typeof n)?r in t?t[r]=n:!0===n?t.setAttribute(r,""):oe(t,r,n):("function"!==typeof a&&null!==a&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(e,n,i)))}}function Wu(t,e,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Eu("error",t),Eu("load",t);var n,i=!1,a=!1;for(n in r)if(r.hasOwnProperty(n)){var s=r[n];if(null!=s)switch(n){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,e));default:$u(t,e,n,s,r,null)}}return a&&$u(t,e,"srcSet",r.srcSet,r,null),void(i&&$u(t,e,"src",r.src,r,null));case"input":Eu("invalid",t);var l=n=s=a=null,c=null,u=null;for(i in r)if(r.hasOwnProperty(i)){var h=r[i];if(null!=h)switch(i){case"name":a=h;break;case"type":s=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":n=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(o(137,e));break;default:$u(t,e,i,h,r,null)}}return ye(t,n,l,c,u,s,a,!1),void he(t);case"select":for(a in Eu("invalid",t),i=s=n=null,r)if(r.hasOwnProperty(a)&&null!=(l=r[a]))switch(a){case"value":n=l;break;case"defaultValue":s=l;break;case"multiple":i=l;default:$u(t,e,a,l,r,null)}return e=n,r=s,t.multiple=!!i,void(null!=e?xe(t,!!i,e,!1):null!=r&&xe(t,!!i,r,!0));case"textarea":for(s in Eu("invalid",t),n=a=i=null,r)if(r.hasOwnProperty(s)&&null!=(l=r[s]))switch(s){case"value":i=l;break;case"defaultValue":a=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(o(91));break;default:$u(t,e,s,l,r,null)}return _e(t,i,a,n),void he(t);case"option":for(c in r)if(r.hasOwnProperty(c)&&null!=(i=r[c]))if("selected"===c)t.selected=i&&"function"!==typeof i&&"symbol"!==typeof i;else $u(t,e,c,i,r,null);return;case"dialog":Eu("cancel",t),Eu("close",t);break;case"iframe":case"object":Eu("load",t);break;case"video":case"audio":for(i=0;i<Au.length;i++)Eu(Au[i],t);break;case"image":Eu("error",t),Eu("load",t);break;case"details":Eu("toggle",t);break;case"embed":case"source":case"link":Eu("error",t),Eu("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in r)if(r.hasOwnProperty(u)&&null!=(i=r[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,e));default:$u(t,e,u,i,r,null)}return;default:if(Ae(e)){for(h in r)r.hasOwnProperty(h)&&(void 0!==(i=r[h])&&Hu(t,e,h,i,r,void 0));return}}for(l in r)r.hasOwnProperty(l)&&(null!=(i=r[l])&&$u(t,e,l,i,r,null))}var Gu=null,Yu=null;function Zu(t){return 9===t.nodeType?t:t.ownerDocument}function Xu(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ku(t,e){if(0===t)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return 1===t&&"foreignObject"===e?0:t}function Ju(t,e){return"textarea"===t||"noscript"===t||"string"===typeof e.children||"number"===typeof e.children||"bigint"===typeof e.children||"object"===typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var Qu=null;var th="function"===typeof setTimeout?setTimeout:void 0,eh="function"===typeof clearTimeout?clearTimeout:void 0,rh="function"===typeof Promise?Promise:void 0,nh="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof rh?function(t){return rh.resolve(null).then(t).catch(ih)}:th;function ih(t){setTimeout((function(){throw t}))}function ah(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return t.removeChild(i),void md(e);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);md(e)}function oh(t){var e=t.firstChild;for(e&&10===e.nodeType&&(e=e.nextSibling);e;){var r=e;switch(e=e.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":oh(r),Wt(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===r.rel.toLowerCase())continue}t.removeChild(r)}}function sh(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break;if(8===e){if("$"===(e=t.data)||"$!"===e||"$?"===e||"F!"===e||"F"===e)break;if("/$"===e)return null}}return t}function lh(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var r=t.data;if("$"===r||"$!"===r||"$?"===r){if(0===e)return t;e--}else"/$"===r&&e++}t=t.previousSibling}return null}function ch(t,e,r){switch(e=Zu(r),t){case"html":if(!(t=e.documentElement))throw Error(o(452));return t;case"head":if(!(t=e.head))throw Error(o(453));return t;case"body":if(!(t=e.body))throw Error(o(454));return t;default:throw Error(o(451))}}var uh=new Map,hh=new Set;function dh(t){return"function"===typeof t.getRootNode?t.getRootNode():t.ownerDocument}var ph=V.d;V.d={f:function(){var t=ph.f(),e=Bc();return t||e},r:function(t){var e=Yt(t);null!==e&&5===e.tag&&"form"===e.type?po(e):ph.r(t)},D:function(t){ph.D(t),mh("dns-prefetch",t,null)},C:function(t,e){ph.C(t,e),mh("preconnect",t,e)},L:function(t,e,r){ph.L(t,e,r);var n=fh;if(n&&t&&e){var i='link[rel="preload"][as="'+me(e)+'"]';"image"===e&&r&&r.imageSrcSet?(i+='[imagesrcset="'+me(r.imageSrcSet)+'"]',"string"===typeof r.imageSizes&&(i+='[imagesizes="'+me(r.imageSizes)+'"]')):i+='[href="'+me(t)+'"]';var a=i;switch(e){case"style":a=yh(t);break;case"script":a=bh(t)}uh.has(a)||(t=P({rel:"preload",href:"image"===e&&r&&r.imageSrcSet?void 0:t,as:e},r),uh.set(a,t),null!==n.querySelector(i)||"style"===e&&n.querySelector(vh(a))||"script"===e&&n.querySelector(_h(a))||(Wu(e=n.createElement("link"),"link",t),Kt(e),n.head.appendChild(e)))}},m:function(t,e){ph.m(t,e);var r=fh;if(r&&t){var n=e&&"string"===typeof e.as?e.as:"script",i='link[rel="modulepreload"][as="'+me(n)+'"][href="'+me(t)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=bh(t)}if(!uh.has(a)&&(t=P({rel:"modulepreload",href:t},e),uh.set(a,t),null===r.querySelector(i))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(_h(a)))return}Wu(n=r.createElement("link"),"link",t),Kt(n),r.head.appendChild(n)}}},X:function(t,e){ph.X(t,e);var r=fh;if(r&&t){var n=Xt(r).hoistableScripts,i=bh(t),a=n.get(i);a||((a=r.querySelector(_h(i)))||(t=P({src:t,async:!0},e),(e=uh.get(i))&&Sh(t,e),Kt(a=r.createElement("script")),Wu(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}},S:function(t,e,r){ph.S(t,e,r);var n=fh;if(n&&t){var i=Xt(n).hoistableStyles,a=yh(t);e=e||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=n.querySelector(vh(a)))s.loading=5;else{t=P({rel:"stylesheet",href:t,"data-precedence":e},r),(r=uh.get(a))&&Th(t,r);var l=o=n.createElement("link");Kt(l),Wu(l,"link",t),l._p=new Promise((function(t,e){l.onload=t,l.onerror=e})),l.addEventListener("load",(function(){s.loading|=1})),l.addEventListener("error",(function(){s.loading|=2})),s.loading|=4,kh(o,e,n)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}},M:function(t,e){ph.M(t,e);var r=fh;if(r&&t){var n=Xt(r).hoistableScripts,i=bh(t),a=n.get(i);a||((a=r.querySelector(_h(i)))||(t=P({src:t,async:!0,type:"module"},e),(e=uh.get(i))&&Sh(t,e),Kt(a=r.createElement("script")),Wu(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}};var fh="undefined"===typeof document?null:document;function mh(t,e,r){var n=fh;if(n&&"string"===typeof e&&e){var i=me(e);i='link[rel="'+t+'"][href="'+i+'"]',"string"===typeof r&&(i+='[crossorigin="'+r+'"]'),hh.has(i)||(hh.add(i),t={rel:t,crossOrigin:r,href:e},null===n.querySelector(i)&&(Wu(e=n.createElement("link"),"link",t),Kt(e),n.head.appendChild(e)))}}function gh(t,e,r,n){var i,a,s,l,c=(c=K.current)?dh(c):null;if(!c)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return"string"===typeof r.precedence&&"string"===typeof r.href?(e=yh(r.href),(n=(r=Xt(c).hoistableStyles).get(e))||(n={type:"style",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===r.rel&&"string"===typeof r.href&&"string"===typeof r.precedence){t=yh(r.href);var u=Xt(c).hoistableStyles,h=u.get(t);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,h),(u=c.querySelector(vh(t)))&&!u._p&&(h.instance=u,h.state.loading=5),uh.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},uh.set(t,r),u||(i=c,a=t,s=r,l=h.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=i.createElement("link"),l.preload=a,a.addEventListener("load",(function(){return l.loading|=1})),a.addEventListener("error",(function(){return l.loading|=2})),Wu(a,"link",s),Kt(a),i.head.appendChild(a))))),e&&null===n)throw Error(o(528,""));return h}if(e&&null!==n)throw Error(o(529,""));return null;case"script":return e=r.async,"string"===typeof(r=r.src)&&e&&"function"!==typeof e&&"symbol"!==typeof e?(e=bh(r),(n=(r=Xt(c).hoistableScripts).get(e))||(n={type:"script",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function yh(t){return'href="'+me(t)+'"'}function vh(t){return'link[rel="stylesheet"]['+t+"]"}function xh(t){return P({},t,{"data-precedence":t.precedence,precedence:null})}function bh(t){return'[src="'+me(t)+'"]'}function _h(t){return"script[async]"+t}function wh(t,e,r){if(e.count++,null===e.instance)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+me(r.href)+'"]');if(n)return e.instance=n,Kt(n),n;var i=P({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return Kt(n=(t.ownerDocument||t).createElement("style")),Wu(n,"style",i),kh(n,r.precedence,t),e.instance=n;case"stylesheet":i=yh(r.href);var a=t.querySelector(vh(i));if(a)return e.state.loading|=4,e.instance=a,Kt(a),a;n=xh(r),(i=uh.get(i))&&Th(n,i),Kt(a=(t.ownerDocument||t).createElement("link"));var s=a;return s._p=new Promise((function(t,e){s.onload=t,s.onerror=e})),Wu(a,"link",n),e.state.loading|=4,kh(a,r.precedence,t),e.instance=a;case"script":return a=bh(r.src),(i=t.querySelector(_h(a)))?(e.instance=i,Kt(i),i):(n=r,(i=uh.get(a))&&Sh(n=P({},r),i),Kt(i=(t=t.ownerDocument||t).createElement("script")),Wu(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(o(443,e.type))}else"stylesheet"===e.type&&0===(4&e.state.loading)&&(n=e.instance,e.state.loading|=4,kh(n,r.precedence,t));return e.instance}function kh(t,e,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,a=i,o=0;o<n.length;o++){var s=n[o];if(s.dataset.precedence===e)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=9===r.nodeType?r.head:r).insertBefore(t,e.firstChild)}function Th(t,e){null==t.crossOrigin&&(t.crossOrigin=e.crossOrigin),null==t.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),null==t.title&&(t.title=e.title)}function Sh(t,e){null==t.crossOrigin&&(t.crossOrigin=e.crossOrigin),null==t.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),null==t.integrity&&(t.integrity=e.integrity)}var Ah=null;function Mh(t,e,r){if(null===Ah){var n=new Map,i=Ah=new Map;i.set(r,n)}else(n=(i=Ah).get(r))||(n=new Map,i.set(r,n));if(n.has(t))return n;for(n.set(t,null),r=r.getElementsByTagName(t),i=0;i<r.length;i++){var a=r[i];if(!(a[Ht]||a[Bt]||"link"===t&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(e)||"";o=t+o;var s=n.get(o);s?s.push(a):n.set(o,[a])}}return n}function Ch(t,e,r){(t=t.ownerDocument||t).head.insertBefore(r,"title"===e?t.querySelector("head > title"):null)}function Eh(t){return"stylesheet"!==t.type||0!==(3&t.state.loading)}var Lh=null;function Ph(){}function Ih(){if(this.count--,0===this.count)if(this.stylesheets)Oh(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}var zh=null;function Oh(t,e){t.stylesheets=null,null!==t.unsuspend&&(t.count++,zh=new Map,e.forEach(Dh,t),zh=null,Ih.call(t))}function Dh(t,e){if(!(4&e.state.loading)){var r=zh.get(t);if(r)var n=r.get(null);else{r=new Map,zh.set(t,r);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(r.set(o.dataset.precedence,o),n=o)}n&&r.set(null,n)}o=(i=e.instance).getAttribute("data-precedence"),(a=r.get(o)||n)===n&&r.set(null,i),r.set(o,i),this.count++,n=Ih.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),a?a.parentNode.insertBefore(i,a.nextSibling):(t=9===t.nodeType?t.head:t).insertBefore(i,t.firstChild),e.state.loading|=4}}var Rh={$$typeof:g,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function Fh(t,e,r,n,i,a,o,s){this.tag=1,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pt(0),this.hiddenUpdates=Pt(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function Bh(t,e,r,n,i,a,o,s,l,c,u,h){return t=new Fh(t,e,r,o,s,l,c,h),e=1,!0===a&&(e|=24),a=Dl(3,null,null,e),t.current=a,a.stateNode=t,(e=Ni()).refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:n,isDehydrated:r,cache:e},Es(a),t}function jh(t){return t?t=In:In}function Nh(t,e,r,n,i,a){i=jh(i),null===n.context?n.context=i:n.pendingContext=i,(n=Ps(e)).payload={element:r},null!==(a=void 0===a?null:a)&&(n.callback=a),null!==(r=Is(t,n,e))&&(Ic(r,0,e),zs(r,t,e))}function Uh(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var r=t.retryLane;t.retryLane=0!==r&&r<e?r:e}}function Vh(t,e){Uh(t,e),(t=t.alternate)&&Uh(t,e)}function qh(t){if(13===t.tag){var e=En(t,67108864);null!==e&&Ic(e,0,67108864),Vh(t,67108864)}}var $h=!0;function Hh(t,e,r,n){var i=L.T;L.T=null;var a=V.p;try{V.p=2,Gh(t,e,r,n)}finally{V.p=a,L.T=i}}function Wh(t,e,r,n){var i=L.T;L.T=null;var a=V.p;try{V.p=8,Gh(t,e,r,n)}finally{V.p=a,L.T=i}}function Gh(t,e,r,n){if($h){var i=Yh(n);if(null===i)Ou(t,e,n,Zh,r),od(t,n);else if(function(t,e,r,n,i){switch(e){case"focusin":return Qh=sd(Qh,t,e,r,n,i),!0;case"dragenter":return td=sd(td,t,e,r,n,i),!0;case"mouseover":return ed=sd(ed,t,e,r,n,i),!0;case"pointerover":var a=i.pointerId;return rd.set(a,sd(rd.get(a)||null,t,e,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,nd.set(a,sd(nd.get(a)||null,t,e,r,n,i)),!0}return!1}(i,t,e,r,n))n.stopPropagation();else if(od(t,n),4&e&&-1<ad.indexOf(t)){for(;null!==i;){var a=Yt(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=St(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-bt(o);s.entanglements[1]|=l,o&=~l}mu(a),0===(6&tc)&&(bc=lt()+500,gu(0,!1))}}break;case 13:null!==(s=En(a,2))&&Ic(s,0,2),Bc(),Vh(a,2)}if(null===(a=Yh(n))&&Ou(t,e,n,Zh,r),a===i)break;i=a}null!==i&&n.stopPropagation()}else Ou(t,e,n,null,r)}}function Yh(t){return Xh(t=Pe(t))}var Zh=null;function Xh(t){if(Zh=null,null!==(t=Gt(t))){var e=F(t);if(null===e)t=null;else{var r=e.tag;if(13===r){if(null!==(t=B(e)))return t;t=null}else if(3===r){if(e.stateNode.current.memoizedState.isDehydrated)return 3===e.tag?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Zh=t,null}function Kh(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ct()){case ut:return 2;case ht:return 8;case dt:case pt:return 32;case ft:return 268435456;default:return 32}default:return 32}}var Jh=!1,Qh=null,td=null,ed=null,rd=new Map,nd=new Map,id=[],ad="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function od(t,e){switch(t){case"focusin":case"focusout":Qh=null;break;case"dragenter":case"dragleave":td=null;break;case"mouseover":case"mouseout":ed=null;break;case"pointerover":case"pointerout":rd.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":nd.delete(e.pointerId)}}function sd(t,e,r,n,i,a){return null===t||t.nativeEvent!==a?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},null!==e&&(null!==(e=Yt(e))&&qh(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,null!==i&&-1===e.indexOf(i)&&e.push(i),t)}function ld(t){var e=Gt(t.target);if(null!==e){var r=F(e);if(null!==r)if(13===(e=r.tag)){if(null!==(e=B(r)))return t.blockedOn=e,void function(t,e){var r=V.p;try{return V.p=t,e()}finally{V.p=r}}(t.priority,(function(){if(13===r.tag){var t=Lc(),e=En(r,t);null!==e&&Ic(e,0,t),Vh(r,t)}}))}else if(3===e&&r.stateNode.current.memoizedState.isDehydrated)return void(t.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}t.blockedOn=null}function cd(t){if(null!==t.blockedOn)return!1;for(var e=t.targetContainers;0<e.length;){var r=Yh(t.nativeEvent);if(null!==r)return null!==(e=Yt(r))&&qh(e),t.blockedOn=r,!1;var n=new(r=t.nativeEvent).constructor(r.type,r);Le=n,r.target.dispatchEvent(n),Le=null,e.shift()}return!0}function ud(t,e,r){cd(t)&&r.delete(e)}function hd(){Jh=!1,null!==Qh&&cd(Qh)&&(Qh=null),null!==td&&cd(td)&&(td=null),null!==ed&&cd(ed)&&(ed=null),rd.forEach(ud),nd.forEach(ud)}function dd(t,e){t.blockedOn===e&&(t.blockedOn=null,Jh||(Jh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,hd)))}var pd=null;function fd(t){pd!==t&&(pd=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,(function(){pd===t&&(pd=null);for(var e=0;e<t.length;e+=3){var r=t[e],n=t[e+1],i=t[e+2];if("function"!==typeof n){if(null===Xh(n||r))continue;break}var a=Yt(r);null!==a&&(t.splice(e,3),e-=3,uo(a,{pending:!0,data:i,method:r.method,action:n},n,i))}})))}function md(t){function e(e){return dd(e,t)}null!==Qh&&dd(Qh,t),null!==td&&dd(td,t),null!==ed&&dd(ed,t),rd.forEach(e),nd.forEach(e);for(var r=0;r<id.length;r++){var n=id[r];n.blockedOn===t&&(n.blockedOn=null)}for(;0<id.length&&null===(r=id[0]).blockedOn;)ld(r),null===r.blockedOn&&id.shift();if(null!=(r=(t.ownerDocument||t).$$reactFormReplay))for(n=0;n<r.length;n+=3){var i=r[n],a=r[n+1],o=i[jt]||null;if("function"===typeof a)o||fd(r);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[jt]||null)s=o.formAction;else if(null!==Xh(i))continue}else s=o.action;"function"===typeof s?r[n+1]=s:(r.splice(n,3),n-=3),fd(r)}}}function gd(t){this._internalRoot=t}function yd(t){this._internalRoot=t}yd.prototype.render=gd.prototype.render=function(t){var e=this._internalRoot;if(null===e)throw Error(o(409));Nh(e.current,Lc(),t,e,null,null)},yd.prototype.unmount=gd.prototype.unmount=function(){var t=this._internalRoot;if(null!==t){this._internalRoot=null;var e=t.containerInfo;0===t.tag&&eu(),Nh(t.current,2,null,t,null,null),Bc(),e[Nt]=null}},yd.prototype.unstable_scheduleHydration=function(t){if(t){var e=Rt();t={blockedOn:null,target:t,priority:e};for(var r=0;r<id.length&&0!==e&&e<id[r].priority;r++);id.splice(r,0,t),0===r&&ld(t)}};var vd=i.version;if("19.0.0"!==vd)throw Error(o(527,vd,"19.0.0"));V.findDOMNode=function(t){var e=t._reactInternals;if(void 0===e){if("function"===typeof t.render)throw Error(o(188));throw t=Object.keys(t).join(","),Error(o(268,t))}return t=function(t){var e=t.alternate;if(!e){if(null===(e=F(t)))throw Error(o(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return j(i),t;if(a===n)return j(i),e;a=a.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?t:e}(e),t=null===(t=null!==t?N(t):null)?null:t.stateNode};var xd={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:L,findFiberByHostInstance:Gt,reconcilerVersion:"19.0.0"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var bd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bd.isDisabled&&bd.supportsFiber)try{yt=bd.inject(xd),vt=bd}catch(wd){}}e.createRoot=function(t,e){if(!s(t))throw Error(o(299));var r=!1,n="",i=Do,a=Ro,l=Fo;return null!==e&&void 0!==e&&(!0===e.unstable_strictMode&&(r=!0),void 0!==e.identifierPrefix&&(n=e.identifierPrefix),void 0!==e.onUncaughtError&&(i=e.onUncaughtError),void 0!==e.onCaughtError&&(a=e.onCaughtError),void 0!==e.onRecoverableError&&(l=e.onRecoverableError),void 0!==e.unstable_transitionCallbacks&&e.unstable_transitionCallbacks),e=Bh(t,1,!1,null,0,r,n,i,a,l,0,null),t[Nt]=e.current,Iu(8===t.nodeType?t.parentNode:t),new gd(e)},e.hydrateRoot=function(t,e,r){if(!s(t))throw Error(o(299));var n=!1,i="",a=Do,l=Ro,c=Fo,u=null;return null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(n=!0),void 0!==r.identifierPrefix&&(i=r.identifierPrefix),void 0!==r.onUncaughtError&&(a=r.onUncaughtError),void 0!==r.onCaughtError&&(l=r.onCaughtError),void 0!==r.onRecoverableError&&(c=r.onRecoverableError),void 0!==r.unstable_transitionCallbacks&&r.unstable_transitionCallbacks,void 0!==r.formState&&(u=r.formState)),(e=Bh(t,1,!0,e,0,n,i,a,l,c,0,u)).context=jh(null),r=e.current,(i=Ps(n=Lc())).callback=null,Is(r,i,n),e.current.lanes=n,It(e,n),mu(e),t[Nt]=e.current,Iu(t),new yd(e)},e.version="19.0.0"},7112:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(7664),i=Object.create;const a=function(){function t(){}return function(e){if(!(0,n.A)(e))return{};if(i)return i(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var o=r(3084),s=r(286);const l=function(t){return"function"!=typeof t.constructor||(0,s.A)(t)?{}:a((0,o.A)(t))}},7170:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});const n={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:(t,e)=>{let{h:r,s:i,l:a}=t;if(!i)return 2.55*a;r/=360,i/=100,a/=100;const o=a<.5?a*(1+i):a+i-a*i,s=2*a-o;switch(e){case"r":return 255*n.hue2rgb(s,o,r+1/3);case"g":return 255*n.hue2rgb(s,o,r);case"b":return 255*n.hue2rgb(s,o,r-1/3)}},rgb2hsl:(t,e)=>{let{r:r,g:n,b:i}=t;r/=255,n/=255,i/=255;const a=Math.max(r,n,i),o=Math.min(r,n,i),s=(a+o)/2;if("l"===e)return 100*s;if(a===o)return 0;const l=a-o;if("s"===e)return 100*(s>.5?l/(2-a-o):l/(a+o));switch(a){case r:return 60*((n-i)/l+(n<i?6:0));case n:return 60*((i-r)/l+2);case i:return 60*((r-n)/l+4);default:return-1}}},i={channel:n,lang:{clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}}},7235:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(286);const i=(0,r(5674).A)(Object.keys,Object);var a=Object.prototype.hasOwnProperty;const o=function(t){if(!(0,n.A)(t))return i(t);var e=[];for(var r in Object(t))a.call(t,r)&&"constructor"!=r&&e.push(r);return e}},7280:(t,e,r)=>{"use strict";r.d(e,{A:()=>k});var n=r(9885),i=r(4306);const a=(0,n.A)(i.A,"DataView");var o=r(8438);const s=(0,n.A)(i.A,"Promise");var l=r(5172);const c=(0,n.A)(i.A,"WeakMap");var u=r(4802),h=r(6166),d="[object Map]",p="[object Promise]",f="[object Set]",m="[object WeakMap]",g="[object DataView]",y=(0,h.A)(a),v=(0,h.A)(o.A),x=(0,h.A)(s),b=(0,h.A)(l.A),_=(0,h.A)(c),w=u.A;(a&&w(new a(new ArrayBuffer(1)))!=g||o.A&&w(new o.A)!=d||s&&w(s.resolve())!=p||l.A&&w(new l.A)!=f||c&&w(new c)!=m)&&(w=function(t){var e=(0,u.A)(t),r="[object Object]"==e?t.constructor:void 0,n=r?(0,h.A)(r):"";if(n)switch(n){case y:return g;case v:return d;case x:return p;case b:return f;case _:return m}return e});const k=w},7328:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return function(e){return t(e)}}},7330:(t,e,r)=>{"use strict";function n(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from("string"===typeof t?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce((function(t,e){var r=e.match(/\n([\t ]+|(?!\s).)/g);return r?t.concat(r.map((function(t){var e,r;return null!==(r=null===(e=t.match(/[\t ]/g))||void 0===e?void 0:e.length)&&void 0!==r?r:0}))):t}),[]);if(i.length){var a=new RegExp("\n[\t ]{"+Math.min.apply(Math,i)+"}","g");n=n.map((function(t){return t.replace(a,"\n")}))}n[0]=n[0].replace(/^\r?\n/,"");var o=n[0];return e.forEach((function(t,e){var r=o.match(/(?:^|\n)( *)$/),i=r?r[1]:"",a=t;"string"===typeof t&&t.includes("\n")&&(a=String(t).split("\n").map((function(t,e){return 0===e?t:""+i+t})).join("\n")),o+=a+n[e+1]})),o}r.d(e,{T:()=>n})},7515:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(4431),i=r(5920),a=r(2041);const o=i.A?function(t,e){return(0,i.A)(t,"toString",{configurable:!0,enumerable:!1,value:(0,n.A)(e),writable:!0})}:a.A;var s=Date.now;const l=function(t){var e=0,r=0;return function(){var n=s(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(o)},7590:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var n=r(7235),i=r(7280),a=r(9500),o=r(5386),s=r(3493),l=r(1375),c=r(286),u=r(4910),h=Object.prototype.hasOwnProperty;const d=function(t){if(null==t)return!0;if((0,s.A)(t)&&((0,o.A)(t)||"string"==typeof t||"function"==typeof t.splice||(0,l.A)(t)||(0,u.A)(t)||(0,a.A)(t)))return!t.length;var e=(0,i.A)(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if((0,c.A)(t))return!(0,n.A)(t).length;for(var r in t)if(h.call(t,r))return!1;return!0}},7664:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7697:(t,e,r)=>{"use strict";r.d(e,{A:()=>O});var n=r(5140),i=r(3101),a=r(5009);const o=function(t,e,r){(void 0!==r&&!(0,a.A)(t[e],r)||void 0===r&&!(e in t))&&(0,i.A)(t,e,r)};var s=r(8093),l=r(4943),c=r(3460),u=r(4766),h=r(7112),d=r(9500),p=r(5386),f=r(4586),m=r(1375),g=r(4067),y=r(7664),v=r(4802),x=r(3084),b=r(3239),_=Function.prototype,w=Object.prototype,k=_.toString,T=w.hasOwnProperty,S=k.call(Object);const A=function(t){if(!(0,b.A)(t)||"[object Object]"!=(0,v.A)(t))return!1;var e=(0,x.A)(t);if(null===e)return!0;var r=T.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&k.call(r)==S};var M=r(4910);const C=function(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]};var E=r(4),L=r(9778);const P=function(t){return(0,E.A)(t,(0,L.A)(t))};const I=function(t,e,r,n,i,a,s){var v=C(t,r),x=C(e,r),b=s.get(x);if(b)o(t,r,b);else{var _=a?a(v,x,r+"",t,e,s):void 0,w=void 0===_;if(w){var k=(0,p.A)(x),T=!k&&(0,m.A)(x),S=!k&&!T&&(0,M.A)(x);_=x,k||T||S?(0,p.A)(v)?_=v:(0,f.A)(v)?_=(0,u.A)(v):T?(w=!1,_=(0,l.A)(x,!0)):S?(w=!1,_=(0,c.A)(x,!0)):_=[]:A(x)||(0,d.A)(x)?(_=v,(0,d.A)(v)?_=P(v):(0,y.A)(v)&&!(0,g.A)(v)||(_=(0,h.A)(x))):w=!1}w&&(s.set(x,_),i(_,x,n,a,s),s.delete(x)),o(t,r,_)}};const z=function t(e,r,i,a,l){e!==r&&(0,s.A)(r,(function(s,c){if(l||(l=new n.A),(0,y.A)(s))I(e,r,c,i,t,a,l);else{var u=a?a(C(e,c),s,c+"",e,r,l):void 0;void 0===u&&(u=s),o(e,c,u)}}),L.A)};const O=(0,r(6356).A)((function(t,e,r){z(t,e,r)}))},7790:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(1499);const i=function(t){var e=new t.constructor(t.byteLength);return new n.A(e).set(new n.A(t)),e}},7840:(t,e,r)=>{"use strict";r.d(e,{A:()=>k});const n=(0,r(9885).A)(Object,"create");const i=function(){this.__data__=n?n(null):{},this.size=0};const a=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var o=Object.prototype.hasOwnProperty;const s=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0};var l=Object.prototype.hasOwnProperty;const c=function(t){var e=this.__data__;return n?void 0!==e[t]:l.call(e,t)};const u=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this};function h(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}h.prototype.clear=i,h.prototype.delete=a,h.prototype.get=s,h.prototype.has=c,h.prototype.set=u;const d=h;var p=r(2476),f=r(8438);const m=function(){this.size=0,this.__data__={hash:new d,map:new(f.A||p.A),string:new d}};const g=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const y=function(t,e){var r=t.__data__;return g(e)?r["string"==typeof e?"string":"hash"]:r.map};const v=function(t){var e=y(this,t).delete(t);return this.size-=e?1:0,e};const x=function(t){return y(this,t).get(t)};const b=function(t){return y(this,t).has(t)};const _=function(t,e){var r=y(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function w(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}w.prototype.clear=m,w.prototype.delete=v,w.prototype.get=x,w.prototype.has=b,w.prototype.set=_;const k=w},7858:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});const n=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)};var i=Math.max;const a=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var a=arguments,o=-1,s=i(a.length-e,0),l=Array(s);++o<s;)l[o]=a[e+o];o=-1;for(var c=Array(e+1);++o<e;)c[o]=a[o];return c[e]=r(l),n(t,this,c)}}},7950:(t,e,r)=>{"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}(),t.exports=r(6672)},7977:(t,e,r)=>{"use strict";r.d(e,{A:()=>st});const{entries:n,setPrototypeOf:i,isFrozen:a,getPrototypeOf:o,getOwnPropertyDescriptor:s}=Object;let{freeze:l,seal:c,create:u}=Object,{apply:h,construct:d}="undefined"!==typeof Reflect&&Reflect;l||(l=function(t){return t}),c||(c=function(t){return t}),h||(h=function(t,e,r){return t.apply(e,r)}),d||(d=function(t,e){return new t(...e)});const p=C(Array.prototype.forEach),f=C(Array.prototype.lastIndexOf),m=C(Array.prototype.pop),g=C(Array.prototype.push),y=C(Array.prototype.splice),v=C(String.prototype.toLowerCase),x=C(String.prototype.toString),b=C(String.prototype.match),_=C(String.prototype.replace),w=C(String.prototype.indexOf),k=C(String.prototype.trim),T=C(Object.prototype.hasOwnProperty),S=C(RegExp.prototype.test),A=(M=TypeError,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return d(M,e)});var M;function C(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return h(t,e,n)}}function E(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;i&&i(t,null);let n=e.length;for(;n--;){let i=e[n];if("string"===typeof i){const t=r(i);t!==i&&(a(e)||(e[n]=t),i=t)}t[i]=!0}return t}function L(t){for(let e=0;e<t.length;e++){T(t,e)||(t[e]=null)}return t}function P(t){const e=u(null);for(const[r,i]of n(t)){T(t,r)&&(Array.isArray(i)?e[r]=L(i):i&&"object"===typeof i&&i.constructor===Object?e[r]=P(i):e[r]=i)}return e}function I(t,e){for(;null!==t;){const r=s(t,e);if(r){if(r.get)return C(r.get);if("function"===typeof r.value)return C(r.value)}t=o(t)}return function(){return null}}const z=l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),D=l(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=l(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),F=l(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),B=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),j=l(["#text"]),N=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),U=l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),V=l(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),q=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=c(/<%[\w\W]*|[\w\W]*%>/gm),W=c(/\$\{[\w\W]*/gm),G=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y=c(/^aria-[\-\w]+$/),Z=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=c(/^(?:\w+script|data):/i),K=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=c(/^html$/i),Q=c(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,ARIA_ATTR:Y,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:Q,DATA_ATTR:G,DOCTYPE_NAME:J,ERB_EXPR:H,IS_ALLOWED_URI:Z,IS_SCRIPT_OR_DATA:X,MUSTACHE_EXPR:$,TMPLIT_EXPR:W});const et=1,rt=3,nt=7,it=8,at=9,ot=function(){return"undefined"===typeof window?null:window};var st=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const r=e=>t(e);if(r.version="3.2.5",r.removed=[],!e||!e.document||e.document.nodeType!==at||!e.Element)return r.isSupported=!1,r;let{document:i}=e;const a=i,o=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:c,Node:h,Element:d,NodeFilter:M,NamedNodeMap:C=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:L,DOMParser:$,trustedTypes:H}=e,W=d.prototype,G=I(W,"cloneNode"),Y=I(W,"remove"),X=I(W,"nextSibling"),K=I(W,"childNodes"),Q=I(W,"parentNode");if("function"===typeof c){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let st,lt="";const{implementation:ct,createNodeIterator:ut,createDocumentFragment:ht,getElementsByTagName:dt}=i,{importNode:pt}=a;let ft={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"===typeof n&&"function"===typeof Q&&ct&&void 0!==ct.createHTMLDocument;const{MUSTACHE_EXPR:mt,ERB_EXPR:gt,TMPLIT_EXPR:yt,DATA_ATTR:vt,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:bt,ATTR_WHITESPACE:_t,CUSTOM_ELEMENT:wt}=tt;let{IS_ALLOWED_URI:kt}=tt,Tt=null;const St=E({},[...z,...O,...D,...F,...j]);let At=null;const Mt=E({},[...N,...U,...V,...q]);let Ct=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,Lt=null,Pt=!0,It=!0,zt=!1,Ot=!0,Dt=!1,Rt=!0,Ft=!1,Bt=!1,jt=!1,Nt=!1,Ut=!1,Vt=!1,qt=!0,$t=!1,Ht=!0,Wt=!1,Gt={},Yt=null;const Zt=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xt=null;const Kt=E({},["audio","video","img","source","image","track"]);let Jt=null;const Qt=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),te="http://www.w3.org/1998/Math/MathML",ee="http://www.w3.org/2000/svg",re="http://www.w3.org/1999/xhtml";let ne=re,ie=!1,ae=null;const oe=E({},[te,ee,re],x);let se=E({},["mi","mo","mn","ms","mtext"]),le=E({},["annotation-xml"]);const ce=E({},["title","style","font","a","script"]);let ue=null;const he=["application/xhtml+xml","text/html"];let de=null,pe=null;const fe=i.createElement("form"),me=function(t){return t instanceof RegExp||t instanceof Function},ge=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!pe||pe!==t){if(t&&"object"===typeof t||(t={}),t=P(t),ue=-1===he.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,de="application/xhtml+xml"===ue?x:v,Tt=T(t,"ALLOWED_TAGS")?E({},t.ALLOWED_TAGS,de):St,At=T(t,"ALLOWED_ATTR")?E({},t.ALLOWED_ATTR,de):Mt,ae=T(t,"ALLOWED_NAMESPACES")?E({},t.ALLOWED_NAMESPACES,x):oe,Jt=T(t,"ADD_URI_SAFE_ATTR")?E(P(Qt),t.ADD_URI_SAFE_ATTR,de):Qt,Xt=T(t,"ADD_DATA_URI_TAGS")?E(P(Kt),t.ADD_DATA_URI_TAGS,de):Kt,Yt=T(t,"FORBID_CONTENTS")?E({},t.FORBID_CONTENTS,de):Zt,Et=T(t,"FORBID_TAGS")?E({},t.FORBID_TAGS,de):{},Lt=T(t,"FORBID_ATTR")?E({},t.FORBID_ATTR,de):{},Gt=!!T(t,"USE_PROFILES")&&t.USE_PROFILES,Pt=!1!==t.ALLOW_ARIA_ATTR,It=!1!==t.ALLOW_DATA_ATTR,zt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Dt=t.SAFE_FOR_TEMPLATES||!1,Rt=!1!==t.SAFE_FOR_XML,Ft=t.WHOLE_DOCUMENT||!1,Nt=t.RETURN_DOM||!1,Ut=t.RETURN_DOM_FRAGMENT||!1,Vt=t.RETURN_TRUSTED_TYPE||!1,jt=t.FORCE_BODY||!1,qt=!1!==t.SANITIZE_DOM,$t=t.SANITIZE_NAMED_PROPS||!1,Ht=!1!==t.KEEP_CONTENT,Wt=t.IN_PLACE||!1,kt=t.ALLOWED_URI_REGEXP||Z,ne=t.NAMESPACE||re,se=t.MATHML_TEXT_INTEGRATION_POINTS||se,le=t.HTML_INTEGRATION_POINTS||le,Ct=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&me(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ct.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&me(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ct.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ct.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Dt&&(It=!1),Ut&&(Nt=!0),Gt&&(Tt=E({},j),At=[],!0===Gt.html&&(E(Tt,z),E(At,N)),!0===Gt.svg&&(E(Tt,O),E(At,U),E(At,q)),!0===Gt.svgFilters&&(E(Tt,D),E(At,U),E(At,q)),!0===Gt.mathMl&&(E(Tt,F),E(At,V),E(At,q))),t.ADD_TAGS&&(Tt===St&&(Tt=P(Tt)),E(Tt,t.ADD_TAGS,de)),t.ADD_ATTR&&(At===Mt&&(At=P(At)),E(At,t.ADD_ATTR,de)),t.ADD_URI_SAFE_ATTR&&E(Jt,t.ADD_URI_SAFE_ATTR,de),t.FORBID_CONTENTS&&(Yt===Zt&&(Yt=P(Yt)),E(Yt,t.FORBID_CONTENTS,de)),Ht&&(Tt["#text"]=!0),Ft&&E(Tt,["html","head","body"]),Tt.table&&(E(Tt,["tbody"]),delete Et.tbody),t.TRUSTED_TYPES_POLICY){if("function"!==typeof t.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');st=t.TRUSTED_TYPES_POLICY,lt=st.createHTML("")}else void 0===st&&(st=function(t,e){if("object"!==typeof t||"function"!==typeof t.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(r=e.getAttribute(n));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(a){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(H,o)),null!==st&&"string"===typeof lt&&(lt=st.createHTML(""));l&&l(t),pe=t}},ye=E({},[...O,...D,...R]),ve=E({},[...F,...B]),xe=function(t){g(r.removed,{element:t});try{Q(t).removeChild(t)}catch(e){Y(t)}},be=function(t,e){try{g(r.removed,{attribute:e.getAttributeNode(t),from:e})}catch(n){g(r.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Nt||Ut)try{xe(e)}catch(n){}else try{e.setAttribute(t,"")}catch(n){}},_e=function(t){let e=null,r=null;if(jt)t="<remove></remove>"+t;else{const e=b(t,/^[\r\n\t ]+/);r=e&&e[0]}"application/xhtml+xml"===ue&&ne===re&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const n=st?st.createHTML(t):t;if(ne===re)try{e=(new $).parseFromString(n,ue)}catch(o){}if(!e||!e.documentElement){e=ct.createDocument(ne,"template",null);try{e.documentElement.innerHTML=ie?lt:n}catch(o){}}const a=e.body||e.documentElement;return t&&r&&a.insertBefore(i.createTextNode(r),a.childNodes[0]||null),ne===re?dt.call(e,Ft?"html":"body")[0]:Ft?e.documentElement:a},we=function(t){return ut.call(t.ownerDocument||t,t,M.SHOW_ELEMENT|M.SHOW_COMMENT|M.SHOW_TEXT|M.SHOW_PROCESSING_INSTRUCTION|M.SHOW_CDATA_SECTION,null)},ke=function(t){return t instanceof L&&("string"!==typeof t.nodeName||"string"!==typeof t.textContent||"function"!==typeof t.removeChild||!(t.attributes instanceof C)||"function"!==typeof t.removeAttribute||"function"!==typeof t.setAttribute||"string"!==typeof t.namespaceURI||"function"!==typeof t.insertBefore||"function"!==typeof t.hasChildNodes)},Te=function(t){return"function"===typeof h&&t instanceof h};function Se(t,e,n){p(t,(t=>{t.call(r,e,n,pe)}))}const Ae=function(t){let e=null;if(Se(ft.beforeSanitizeElements,t,null),ke(t))return xe(t),!0;const n=de(t.nodeName);if(Se(ft.uponSanitizeElement,t,{tagName:n,allowedTags:Tt}),t.hasChildNodes()&&!Te(t.firstElementChild)&&S(/<[/\w!]/g,t.innerHTML)&&S(/<[/\w!]/g,t.textContent))return xe(t),!0;if(t.nodeType===nt)return xe(t),!0;if(Rt&&t.nodeType===it&&S(/<[/\w]/g,t.data))return xe(t),!0;if(!Tt[n]||Et[n]){if(!Et[n]&&Ce(n)){if(Ct.tagNameCheck instanceof RegExp&&S(Ct.tagNameCheck,n))return!1;if(Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(n))return!1}if(Ht&&!Yt[n]){const e=Q(t)||t.parentNode,r=K(t)||t.childNodes;if(r&&e){for(let n=r.length-1;n>=0;--n){const i=G(r[n],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,X(t))}}}return xe(t),!0}return t instanceof d&&!function(t){let e=Q(t);e&&e.tagName||(e={namespaceURI:ne,tagName:"template"});const r=v(t.tagName),n=v(e.tagName);return!!ae[t.namespaceURI]&&(t.namespaceURI===ee?e.namespaceURI===re?"svg"===r:e.namespaceURI===te?"svg"===r&&("annotation-xml"===n||se[n]):Boolean(ye[r]):t.namespaceURI===te?e.namespaceURI===re?"math"===r:e.namespaceURI===ee?"math"===r&&le[n]:Boolean(ve[r]):t.namespaceURI===re?!(e.namespaceURI===ee&&!le[n])&&!(e.namespaceURI===te&&!se[n])&&!ve[r]&&(ce[r]||!ye[r]):!("application/xhtml+xml"!==ue||!ae[t.namespaceURI]))}(t)?(xe(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,t.innerHTML)?(Dt&&t.nodeType===rt&&(e=t.textContent,p([mt,gt,yt],(t=>{e=_(e,t," ")})),t.textContent!==e&&(g(r.removed,{element:t.cloneNode()}),t.textContent=e)),Se(ft.afterSanitizeElements,t,null),!1):(xe(t),!0)},Me=function(t,e,r){if(qt&&("id"===e||"name"===e)&&(r in i||r in fe))return!1;if(It&&!Lt[e]&&S(vt,e));else if(Pt&&S(xt,e));else if(!At[e]||Lt[e]){if(!(Ce(t)&&(Ct.tagNameCheck instanceof RegExp&&S(Ct.tagNameCheck,t)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(t))&&(Ct.attributeNameCheck instanceof RegExp&&S(Ct.attributeNameCheck,e)||Ct.attributeNameCheck instanceof Function&&Ct.attributeNameCheck(e))||"is"===e&&Ct.allowCustomizedBuiltInElements&&(Ct.tagNameCheck instanceof RegExp&&S(Ct.tagNameCheck,r)||Ct.tagNameCheck instanceof Function&&Ct.tagNameCheck(r))))return!1}else if(Jt[e]);else if(S(kt,_(r,_t,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==w(r,"data:")||!Xt[t]){if(zt&&!S(bt,_(r,_t,"")));else if(r)return!1}else;return!0},Ce=function(t){return"annotation-xml"!==t&&b(t,wt)},Ee=function(t){Se(ft.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||ke(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:At,forceKeepAttr:void 0};let i=e.length;for(;i--;){const o=e[i],{name:s,namespaceURI:l,value:c}=o,u=de(s);let h="value"===s?c:k(c);if(n.attrName=u,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Se(ft.uponSanitizeAttribute,t,n),h=n.attrValue,!$t||"id"!==u&&"name"!==u||(be(s,t),h="user-content-"+h),Rt&&S(/((--!?|])>)|<\/(style|title)/i,h)){be(s,t);continue}if(n.forceKeepAttr)continue;if(be(s,t),!n.keepAttr)continue;if(!Ot&&S(/\/>/i,h)){be(s,t);continue}Dt&&p([mt,gt,yt],(t=>{h=_(h,t," ")}));const d=de(t.nodeName);if(Me(d,u,h)){if(st&&"object"===typeof H&&"function"===typeof H.getAttributeType)if(l);else switch(H.getAttributeType(d,u)){case"TrustedHTML":h=st.createHTML(h);break;case"TrustedScriptURL":h=st.createScriptURL(h)}try{l?t.setAttributeNS(l,s,h):t.setAttribute(s,h),ke(t)?xe(t):m(r.removed)}catch(a){}}}Se(ft.afterSanitizeAttributes,t,null)},Le=function t(e){let r=null;const n=we(e);for(Se(ft.beforeSanitizeShadowDOM,e,null);r=n.nextNode();)Se(ft.uponSanitizeShadowNode,r,null),Ae(r),Ee(r),r.content instanceof s&&t(r.content);Se(ft.afterSanitizeShadowDOM,e,null)};return r.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,o=null,l=null;if(ie=!t,ie&&(t="\x3c!--\x3e"),"string"!==typeof t&&!Te(t)){if("function"!==typeof t.toString)throw A("toString is not a function");if("string"!==typeof(t=t.toString()))throw A("dirty is not a string, aborting")}if(!r.isSupported)return t;if(Bt||ge(e),r.removed=[],"string"===typeof t&&(Wt=!1),Wt){if(t.nodeName){const e=de(t.nodeName);if(!Tt[e]||Et[e])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof h)n=_e("\x3c!----\x3e"),i=n.ownerDocument.importNode(t,!0),i.nodeType===et&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Nt&&!Dt&&!Ft&&-1===t.indexOf("<"))return st&&Vt?st.createHTML(t):t;if(n=_e(t),!n)return Nt?null:Vt?lt:""}n&&jt&&xe(n.firstChild);const c=we(Wt?t:n);for(;o=c.nextNode();)Ae(o),Ee(o),o.content instanceof s&&Le(o.content);if(Wt)return t;if(Nt){if(Ut)for(l=ht.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(At.shadowroot||At.shadowrootmode)&&(l=pt.call(a,l,!0)),l}let u=Ft?n.outerHTML:n.innerHTML;return Ft&&Tt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(J,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Dt&&p([mt,gt,yt],(t=>{u=_(u,t," ")})),st&&Vt?st.createHTML(u):u},r.setConfig=function(){ge(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Bt=!0},r.clearConfig=function(){pe=null,Bt=!1},r.isValidAttribute=function(t,e,r){pe||ge({});const n=de(t),i=de(e);return Me(n,i,r)},r.addHook=function(t,e){"function"===typeof e&&g(ft[t],e)},r.removeHook=function(t,e){if(void 0!==e){const r=f(ft[t],e);return-1===r?void 0:y(ft[t],r,1)[0]}return m(ft[t])},r.removeHooks=function(t){ft[t]=[]},r.removeAllHooks=function(){ft={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}()},8093:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n=function(t){return function(e,r,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var l=o[t?s:++i];if(!1===r(a[l],l,a))break}return e}}()},8096:function(t){var e,r;e="undefined"!==typeof self?self:this,r=()=>{"use strict";var t=(()=>{var t=Object.create,e=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,h=(t,e)=>function(){return t&&(e=(0,t[a(t)[0]])(t=0)),e},d=(t,e)=>function(){return e||(0,t[a(t)[0]])((e={exports:{}}).exports,e),e.exports},p=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},f=(t,r,i,o)=>{if(r&&"object"===typeof r||"function"===typeof r)for(let s of a(r))l.call(t,s)||s===i||e(t,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return t},m=t=>f(e({},"__esModule",{value:!0}),t),g=d({"src/version.js"(t){t.version="3.0.1"}}),y=d({"node_modules/native-promise-only/lib/npo.src.js"(t,e){var r,n,i;r="Promise",n="undefined"!=typeof window?window:t,i=function(){var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(g){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t<this.chain.length;t++)l(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function l(t,e,r){var n,i;try{!1===e?r.reject(t.msg):(n=!0===e?t.msg:e.call(void 0,t.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=o(n))?i.call(n,r.resolve,r.reject):r.resolve(n)}catch(g){r.reject(g)}}function c(t){var e,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(e=o(t))?a((function(){var n=new d(r);try{e.call(t,(function(){c.apply(n,arguments)}),(function(){u.apply(n,arguments)}))}catch(g){u.call(n,g)}})):(r.msg=t,r.state=1,r.chain.length>0&&a(s,r))}catch(g){u.call(new d(r),g)}}}function u(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function h(t,e,r,n){for(var i=0;i<e.length;i++)!function(i){t.resolve(e[i]).then((function(t){r(i,t)}),n)}(i)}function d(t){this.def=t,this.triggered=!1}function p(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function f(t){if("function"!=typeof t)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var e=new p(this);this.then=function(t,r){var n={success:"function"!=typeof t||t,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(t,e){if("function"!=typeof t||"function"!=typeof e)throw TypeError("Not a function");n.resolve=t,n.reject=e})),e.chain.push(n),0!==e.state&&a(s,e),n.promise},this.catch=function(t){return this.then(void 0,t)};try{t.call(void 0,(function(t){c.call(e,t)}),(function(t){u.call(e,t)}))}catch(g){u.call(e,g)}}r=function(){var t,r,n;function i(t,e){this.fn=t,this.self=e,this.next=void 0}return{add:function(e,a){n=new i(e,a),r?r.next=n:t=n,r=n,n=void 0},drain:function(){var n=t;for(t=r=e=void 0;n;)n.fn.call(n.self),n=n.next}}}();var m=t({},"constructor",f,!1);return f.prototype=m,t(m,"__NPO__",0,!1),t(f,"resolve",(function(t){return t&&"object"==typeof t&&1===t.__NPO__?t:new this((function(e,r){if("function"!=typeof e||"function"!=typeof r)throw TypeError("Not a function");e(t)}))})),t(f,"reject",(function(t){return new this((function(e,r){if("function"!=typeof e||"function"!=typeof r)throw TypeError("Not a function");r(t)}))})),t(f,"all",(function(t){var e=this;return"[object Array]"!=n.call(t)?e.reject(TypeError("Not an array")):0===t.length?e.resolve([]):new e((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var i=t.length,a=Array(i),o=0;h(e,t,(function(t,e){a[t]=e,++o===i&&r(a)}),n)}))})),t(f,"race",(function(t){var e=this;return"[object Array]"!=n.call(t)?e.reject(TypeError("Not an array")):new e((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");h(e,t,(function(t,e){r(e)}),n)}))})),f},n[r]=n[r]||i(),"undefined"!=typeof e&&e.exports&&(e.exports=n[r])}}),v=d({"node_modules/@plotly/d3/d3.js"(t,e){(function(){var t={version:"3.8.2"},r=[].slice,n=function(t){return r.call(t)},i=self.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(ha){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(da){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function f(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)f(r=+t[a])&&(n+=r);else for(;++a<i;)f(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)f(r=p(t[a]))?n+=r:--o;else for(;++a<i;)f(r=p(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)f(n=p(e[o]))&&i.push(n);else for(;++o<a;)f(n=p(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(d),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)f(r=p(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)f(r=p(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(d);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,y),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}function _(t){return"__proto__"===(t+="")||"\0"===t[0]?"\0"+t:t}function w(t){return"\0"===(t+="")[0]?t.slice(1):t}function k(t){return _(t)in this._}function T(t){return(t=_(t))in this._&&delete this._[t]}function S(){var t=[];for(var e in this._)t.push(w(e));return t}function A(){var t=0;for(var e in this._)++t;return t}function M(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function E(t){return t}function L(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function P(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=I.length;r<n;++r){var i=I[r]+e;if(i in t)return i}}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(v(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new b;if(t instanceof b)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r},x(b,{has:k,get:function(t){return this._[_(t)]},set:function(t,e){return this._[_(t)]=e},remove:T,keys:S,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:w(e),value:this._[e]});return t},size:A,empty:M,forEach:function(t){for(var e in this._)t.call(this,w(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,h,d=-1,p=a.length,f=i[s++],m=new b;++d<p;)(h=m.get(l=f(c=a[d])))?h.push(c):m.set(l,[c]);return t?(c=t(),u=function(e,r){c.set(e,o(t,r,s))}):(c={},u=function(e,r){c[e]=o(t,r,s)}),m.forEach(u),c}function s(t,e){if(e>=i.length)return t;var r=[],n=a[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),n?r.sort((function(t,e){return n(t.key,e.key)})):r}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return s(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(C,{has:k,add:function(t){return this._[_(t+="")]=!0,t},remove:T,values:S,size:A,empty:M,forEach:function(t){for(var e in this._)t.call(this,w(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=L(t,e,e[r]);return t};var I=["webkit","ms","moz","Moz","o","O"];function z(){}function O(){}function D(t){var e=[],r=new b;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function R(){t.event.preventDefault()}function F(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new O,n=0,i=arguments.length;++n<i;)r[arguments[n]]=D(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new O,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=D(t);return t},O.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return N(t,H),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},$=function(t,e){var r=t.matches||t[P(t,"matchesSelector")];return($=function(t,e){return r.call(t,e)})(t,e)};"function"===typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,$=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var H=t.selection.prototype=[];function W(t){return"function"===typeof t?t:function(){return V(t,this)}}function G(t){return"function"===typeof t?t:function(){return q(t,this)}}H.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return U(a)},H.selectAll=function(t){var e,r,i=[];t=G(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return U(i)};var Y="http://www.w3.org/1999/xhtml",Z={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function X(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"===typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function K(t){return t.trim().replace(/\s+/g," ")}function J(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function Q(t){return(t+"").trim().split(/^|\s+/)}function tt(t,e){var r=(t=Q(t).map(et)).length;return"function"===typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function et(t){var e=J(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",K(i+" "+t))):r.setAttribute("class",K(i.replace(e," ")))}}function rt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"===typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function nt(t,e){return null==e?function(){delete this[t]}:"function"===typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function it(e){return"function"===typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(r,e)}}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ot(t){return{__data__:t}}function st(t){return function(){return $(this,t)}}function lt(t){return arguments.length||(t=d),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ct(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function ut(t){return N(t,ht),t}t.ns={prefix:Z,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Z.hasOwnProperty(r)?{space:Z[r],local:t}:t}},H.attr=function(e,r){if(arguments.length<2){if("string"===typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(X(r,e[r]));return this}return this.each(X(e,r))},H.classed=function(t,e){if(arguments.length<2){if("string"===typeof t){var r=this.node(),n=(t=Q(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!J(t[i]).test(e))return!1;return!0}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},H.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!==typeof t){for(r in n<2&&(e=""),t)this.each(rt(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(rt(t,e,r))},H.property=function(t,e){if(arguments.length<2){if("string"===typeof t)return this.node()[t];for(e in t)this.each(nt(e,t[e]));return this}return this.each(nt(t,e))},H.text=function(t){return arguments.length?this.each("function"===typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},H.html=function(t){return arguments.length?this.each("function"===typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},H.append=function(t){return t=it(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},H.insert=function(t,e){return t=it(t),e=W(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},H.remove=function(){return this.each(at)},H.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,u=r.length,h=Math.min(o,u),d=new Array(u),p=new Array(u),f=new Array(o);if(e){var m,g=new b,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(g.has(m=e.call(i,i.__data__,n))?f[n]=i:g.set(m,i),y[n]=m);for(n=-1;++n<u;)(i=g.get(m=e.call(r,a=r[n],n)))?!0!==i&&(d[n]=i,i.__data__=a):p[n]=ot(a),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(f[n]=t[n])}else{for(n=-1;++n<h;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=ot(a);for(;n<u;++n)p[n]=ot(r[n]);for(;n<o;++n)f[n]=t[n]}p.update=d,p.parentNode=d.parentNode=f.parentNode=t.parentNode,s.push(p),l.push(d),c.push(f)}var s=ut([]),l=U([]),c=U([]);if("function"===typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return c},l},H.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},H.filter=function(t){var e,r,n,i=[];"function"!==typeof t&&(t=st(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return U(i)},H.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},H.sort=function(t){t=lt.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},H.each=function(t){return ct(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},H.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},H.empty=function(){return!this.node()},H.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},H.size=function(){var t=0;return ct(this,(function(){++t})),t};var ht=[];function dt(e,r,i){var a="__on"+e,o=e.indexOf("."),s=ft;o>0&&(e=e.slice(0,o));var l=pt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ut,t.selection.enter.prototype=ht,ht.append=H.append,ht.empty=H.empty,ht.node=H.node,ht.call=H.call,ht.size=H.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var c=-1,u=i.length;++c<u;)(a=i[c])?(e.push(n[c]=r=t.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):e.push(null)}return U(o)},ht.insert=function(t,e){return arguments.length<2&&(e=function(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}(this)),H.insert.call(this,t,e)},t.select=function(t){var e;return"string"===typeof t?(e=[V(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),U([e])},t.selectAll=function(t){var e;return"string"===typeof t?(e=n(q(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,U([e])},H.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!==typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var pt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ft(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function mt(t,e){var r=ft(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}i&&pt.forEach((function(t){"on"+t in i&&pt.remove(t)}));var gt,yt=0;function vt(e){var r=".dragsuppress-"+ ++yt,n="click"+r,i=t.select(o(e)).on("touchmove"+r,R).on("dragstart"+r,R).on("selectstart"+r,R);if(null==gt&&(gt=!("onselectstart"in e)&&P(e.style,"userSelect")),gt){var s=a(e).style,l=s[gt];s[gt]="none"}return function(t){if(i.on(r,null),gt&&(s[gt]=l),t){var e=function(){i.on(n,null)};i.on(n,(function(){R(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return bt(t,F())};var xt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function bt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(xt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xt=!(s.f||s.e),n.remove()}}return xt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function _t(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=F().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return bt(t,n)},t.behavior.drag=function(){var e=B(a,"drag","dragstart","dragend"),r=null,n=s(z,t.mouse,o,"mousemove","mouseup"),i=s(_t,t.touch,E,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,c=this,u=t.event.target.correspondingElement||t.event.target,h=c.parentNode,d=e.of(c,arguments),p=0,f=n(),m=".drag"+(null==f?"":"-"+f),g=t.select(a(u)).on(o+m,(function(){var t,e,r=i(h,f);r&&(t=r[0]-v[0],e=r[1]-v[1],p|=t|e,v=r,d({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))})).on(s+m,(function(){i(h,f)&&(g.on(o+m,null).on(s+m,null),y(p),d({type:"dragend"}))})),y=vt(u),v=i(h,f);l=r?[(l=r.apply(c,arguments)).x-v[0],l.y-v[1]]:[0,0],d({type:"dragstart"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=F().touches),e?n(e).map((function(e){var r=bt(t,e);return r.identifier=e.identifier,r})):[]};var wt=1e-6,kt=wt*wt,Tt=Math.PI,St=2*Tt,At=St-wt,Mt=Tt/2,Ct=Tt/180,Et=180/Tt;function Lt(t){return t>1?Mt:t<-1?-Mt:Math.asin(t)}function Pt(t){return((t=Math.exp(t))+1/t)/2}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,d=u*u+h*h;if(d<kt)n=Math.log(c/o)/It,r=function(t){return[i+t*u,a+t*h,o*Math.exp(It*t*n)]};else{var p=Math.sqrt(d),f=(c*c-o*o+4*d)/(2*o*2*p),m=(c*c-o*o-4*d)/(2*c*2*p),g=Math.log(Math.sqrt(f*f+1)-f),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/It,r=function(t){var e,r=t*n,s=Pt(g),l=o/(2*p)*(s*(e=It*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+l*u,a+l*h,o*s/Pt(It*r+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,h,d={x:0,y:0,k:1},p=[960,500],f=Dt,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,P).on(Ot+".zoom",z).on("dblclick.zoom",O).on(b,I)}function k(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function T(t){d.k=Math.max(f[0],Math.min(f[1],t))}function S(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function A(e,n,i,a){e.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,a)),S(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function M(){c&&c.domain(l.range().map((function(t){return(t-d.x)/d.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-d.y)/d.k})).map(u.invert))}function C(t){g++||t({type:"zoomstart"})}function E(t){M(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function L(t){--g||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(v,(function(){n=1,S(t.mouse(e),a),E(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),L(r)})),a=k(t.mouse(e)),s=vt(e);Wi.call(e),C(r)}function I(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),p=vt(r);function f(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=k(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(c,v),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o<h;++o)i[n[o].identifier]=null;var p=f(),m=Date.now();if(1===p.length){if(m-s<500){var y=p[0];A(r,y,i[y.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),R()}s=m}else if(p.length>1){y=p[0];var x=p[1],b=y[0]-x[0],_=y[1]-x[1];a=b*b+_*_}}function g(){var o,l,c,u,h=t.touches(r);Wi.call(r);for(var d=0,p=h.length;d<p;++d,u=null)if(c=h[d],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var f=(f=c[0]-o[0])*f+(f=c[1]-o[1])*f,m=a&&Math.sqrt(f/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],T(m*e)}s=null,S(o,l),E(n)}function v(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void f()}t.selectAll(u).on(o,null),h.on(y,P).on(b,I),p(),L(n)}m(),C(n),h.on(y,null).on(b,m)}function z(){var i=_.of(this,arguments);a?clearTimeout(a):(Wi.call(this),e=k(r=n||t.mouse(this)),C(i)),a=setTimeout((function(){a=null,L(i)}),50),R(),T(Math.pow(2,.002*zt())*d.k),S(r,e),E(i)}function O(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,e,k(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Ot||(Ot="onwheel"in i?(zt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(zt=function(){return t.event.wheelDelta},"mousewheel"):(zt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),n=d;Zi?t.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},C(e)})).tween("zoom:zoom",(function(){var i=p[0],a=p[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-d.x)/d.k,(s-d.y)/d.k,i/d.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=d={x:o-r[0]*n,y:s-r[1]*n,k:n},E(e)}})).each("interrupt.zoom",(function(){L(e)})).each("end.zoom",(function(){L(e)})):(this.__chart__=d,C(e),E(e),L(e))}))},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},M(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+t),M(),w):d.k},w.scaleExtent=function(t){return arguments.length?(f=null==t?Dt:[+t[0],+t[1]],w):f},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],w):p},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(c=t,l=t.copy(),d={x:0,y:0,k:1},w):c},w.y=function(t){return arguments.length?(h=t,u=t.copy(),d={x:0,y:0,k:1},w):h},t.rebind(w,_,"on")};var zt,Ot,Dt=[0,1/0];function Rt(){}function Ft(t,e,r){return this instanceof Ft?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Ft?new Ft(t.h,t.s,t.l):ae(""+t,oe,Ft):new Ft(t,e,r)}t.color=Rt,Rt.prototype.toString=function(){return this.rgb()+""},t.hsl=Ft;var Bt=Ft.prototype=new Rt;function jt(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new te(a(t+120),a(t),a(t-120))}function Nt(e,r,n){return this instanceof Nt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Nt?new Nt(e.h,e.c,e.l):Xt(e instanceof qt?e.l:(e=se((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Nt(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Nt;var Ut=Nt.prototype=new Rt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new qt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function qt(t,e,r){return this instanceof qt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof qt?new qt(t.l,t.a,t.b):t instanceof Nt?Vt(t.h,t.c,t.l):se((t=te(t)).r,t.g,t.b):new qt(t,e,r)}Ut.brighter=function(t){return new Nt(this.h,this.c,Math.min(100,this.l+$t*(arguments.length?t:1)))},Ut.darker=function(t){return new Nt(this.h,this.c,Math.max(0,this.l-$t*(arguments.length?t:1)))},Ut.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=qt;var $t=18,Ht=.95047,Wt=1,Gt=1.08883,Yt=qt.prototype=new Rt;function Zt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new te(Qt(3.2404542*(i=Kt(i)*Ht)-1.5371385*(n=Kt(n)*Wt)-.4985314*(a=Kt(a)*Gt)),Qt(-.969266*i+1.8760108*n+.041556*a),Qt(.0556434*i-.2040259*n+1.0572252*a))}function Xt(t,e,r){return t>0?new Nt(Math.atan2(r,e)*Et,Math.sqrt(e*e+r*r),t):new Nt(NaN,NaN,t)}function Kt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Jt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Qt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function te(t,e,r){return this instanceof te?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof te?new te(t.r,t.g,t.b):ae(""+t,te,jt):new te(t,e,r)}function ee(t){return new te(t>>16,t>>8&255,255&t)}function re(t){return ee(t)+""}Yt.brighter=function(t){return new qt(Math.min(100,this.l+$t*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new qt(Math.max(0,this.l-$t*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Zt(this.l,this.a,this.b)},t.rgb=te;var ne=te.prototype=new Rt;function ie(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ae(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ce(i[0]),ce(i[1]),ce(i[2]))}return(a=ue.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function oe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Ft(n,i,l)}function se(t,e,r){var n=Jt((.4124564*(t=le(t))+.3575761*(e=le(e))+.1804375*(r=le(r)))/Ht),i=Jt((.2126729*t+.7151522*e+.072175*r)/Wt);return qt(116*i-16,500*(n-i),200*(i-Jt((.0193339*t+.119192*e+.9503041*r)/Gt)))}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ce(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ne.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new te(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new te(i,i,i)},ne.darker=function(t){return new te((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},ne.hsl=function(){return oe(this.r,this.g,this.b)},ne.toString=function(){return"#"+ie(this.r)+ie(this.g)+ie(this.b)};var ue=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function he(t){return"function"===typeof t?t:function(){return t}}function de(t){return function(e,r,n){return 2===arguments.length&&"function"===typeof r&&(n=r,r=null),pe(e,r,t,n)}}function pe(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function h(){var t,e=c.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(c)||e>=200&&e<300||304===e){try{t=i.call(o,c)}catch(ha){return void s.error.call(o,ha)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"===typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ue.forEach((function(t,e){ue.set(t,ee(e))})),t.functor=he,t.xhr=de(E),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=pe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i<n;++i)r[t[i]]=e[i];return r};r=e?function(t,r){return e(i(t),r)}:i}))},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,c=0,u=0;function h(){if(c>=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return c=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++c):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=t.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return t.slice(e,c-u)}return t.slice(e)}for(;(r=h())!==o;){for(var d=[];r!==a&&r!==o;)d.push(r),r=h();e&&null==(d=e(d,u++))||s.push(d)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new C,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join("\n")},i.formatRows=function(t){return t.map(s).join("\n")},i},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var fe,me,ge,ye,ve=this[P(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function xe(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return me?me.n=i:fe=i,me=i,ge||(ye=clearTimeout(ye),ge=1,ve(be)),i}function be(){var t=_e(),e=we()-t;e>24?(isFinite(e)&&(clearTimeout(ye),ye=setTimeout(be,e)),ge=0):(ge=1,ve(be))}function _e(){for(var t=Date.now(),e=fe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function we(){for(var t,e=fe,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:fe=e.n;return me=t,r}function ke(t){return t[0]}function Te(t){return t[1]}function Se(t){for(var e,r,n,i=t.length,a=[0,1],o=2,s=2;s<i;s++){for(;o>1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Ae(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){xe.apply(this,arguments)},t.timer.flush=function(){_e(),we()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=ke,r=Te;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=he(e),a=he(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(Ae),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=Se(s),u=Se(l),h=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;n<u.length-d;++n)p.push(t[s[u[n]][2]]);return p}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return N(t,Me),t};var Me=t.geom.polygon.prototype=[];function Ce(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Ee(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,h=n[1]-c,d=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+d*o,l+d*u]}function Le(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}Me.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},Me.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},Me.clip=function(t){for(var e,r,n,i,a,o,s=Le(t),l=-1,c=this.length-Le(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)Ce(o=e[r],u,i)?(Ce(a,u,i)||t.push(Ee(a,o,u,i)),t.push(o)):Ce(a,u,i)&&t.push(Ee(a,o,u,i)),a=o;s&&t.push(t[0]),u=i}return t};var Pe,Ie,ze,Oe,De,Re=[],Fe=[];function Be(){nr(this),this.edge=this.site=this.circle=null}function je(t){var e=Re.pop()||new Be;return e.site=t,e}function Ne(t){Ze(t),ze.remove(t),Re.push(t),nr(t)}function Ue(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Ne(t);for(var l=a;l.circle&&v(r-l.circle.x)<wt&&v(n-l.circle.cy)<wt;)a=l.P,s.unshift(l),Ne(l),l=a;s.unshift(l),Ze(l);for(var c=o;c.circle&&v(r-c.circle.x)<wt&&v(n-c.circle.cy)<wt;)o=c.N,s.push(c),Ne(c),c=o;s.push(c),Ze(c);var u,h=s.length;for(u=1;u<h;++u)c=s[u],l=s[u-1],tr(c.edge,l.site,c.site,i);l=s[0],(c=s[h-1]).edge=Je(l.site,c.site,null,i),Ye(l),Ye(c)}function Ve(t){for(var e,r,n,i,a=t.x,o=t.y,s=ze._;s;)if((n=qe(s,o)-a)>wt)s=s.L;else{if(!((i=a-$e(s,o))>wt)){n>-wt?(e=s.P,r=s):i>-wt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=je(t);if(ze.insert(e,l),e||r){if(e===r)return Ze(e),r=je(e.site),ze.insert(l,r),l.edge=r.edge=Je(e.site,l.site),Ye(e),void Ye(r);if(r){Ze(e),Ze(r);var c=e.site,u=c.x,h=c.y,d=t.x-u,p=t.y-h,f=r.site,m=f.x-u,g=f.y-h,y=2*(d*g-p*m),v=d*d+p*p,x=m*m+g*g,b={x:(g*v-p*x)/y+u,y:(d*x-m*v)/y+h};tr(r.edge,c,f,b),l.edge=Je(c,t,null,b),r.edge=Je(t,f,null,b),Ye(e),Ye(r)}else l.edge=Je(e.site,l.site)}}function qe(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,d=u/c;return h?(-d+Math.sqrt(d*d-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function $e(t,e){var r=t.N;if(r)return qe(r,e);var n=t.site;return n.y===e?n.x:1/0}function He(t){this.site=t,this.edges=[]}function We(t,e){return e.angle-t.angle}function Ge(){nr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-kt)){var d=l*l+c*c,p=u*u+g*g,f=(g*d-c*p)/h,m=(l*p-u*d)/h,g=m+s,y=Fe.pop()||new Ge;y.arc=t,y.site=i,y.x=f+o,y.y=g+Math.sqrt(f*f+m*m),y.cy=g,t.circle=y;for(var v=null,x=De._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){v=x.P;break}x=x.L}else{if(!x.R){v=x;break}x=x.R}De.insert(v,y),v||(Oe=y)}}}}function Ze(t){var e=t.circle;e&&(e.P||(Oe=e.N),De.remove(e),Fe.push(e),nr(e),t.circle=null)}function Xe(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],c=e[1][1],u=t.l,h=t.r,d=u.x,p=u.y,f=h.x,m=h.y,g=(d+f)/2,y=(p+m)/2;if(m===p){if(g<o||g>=s)return;if(d>f){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y<l)return}else a={x:g,y:c};r={x:g,y:l}}}else if(i=y-(n=(d-f)/(m-p))*g,n<-1||n>1)if(d>f){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};r={x:(l-i)/n,y:l}}else if(p<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Ke(t,e){this.l=t,this.r=e,this.a=this.b=null}function Je(t,e,r,n){var i=new Ke(t,e);return Pe.push(i),r&&tr(i,t,e,r),n&&tr(i,e,t,n),Ie[t.i].edges.push(new er(i,t,e)),Ie[e.i].edges.push(new er(i,e,t)),i}function Qe(t,e,r){var n=new Ke(t,null);return n.a=e,n.b=r,Pe.push(n),n}function tr(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function er(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function rr(){this._=null}function nr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ir(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ar(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function or(t){for(;t.L;)t=t.L;return t}function sr(t,e){var r,n,i,a=t.sort(lr).pop();for(Pe=[],Ie=new Array(t.length),ze=new rr,De=new rr;;)if(i=Oe,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(Ie[a.i]=new He(a),Ve(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Ue(i.arc)}e&&(function(t){for(var e,r,n,i,a,o=Pe,s=(r=t[0][0],n=t[0][1],i=t[1][0],a=t[1][1],function(t){var e,o=t.a,s=t.b,l=o.x,c=o.y,u=0,h=1,d=s.x-l,p=s.y-c;if(e=r-l,d||!(e>0)){if(e/=d,d<0){if(e<u)return;e<h&&(h=e)}else if(d>0){if(e>h)return;e>u&&(u=e)}if(e=i-l,d||!(e<0)){if(e/=d,d<0){if(e>h)return;e>u&&(u=e)}else if(d>0){if(e<u)return;e<h&&(h=e)}if(e=n-c,p||!(e>0)){if(e/=p,p<0){if(e<u)return;e<h&&(h=e)}else if(p>0){if(e>h)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>h)return;e>u&&(u=e)}else if(p>0){if(e<u)return;e<h&&(h=e)}return u>0&&(t.a={x:l+u*d,y:c+u*p}),h<1&&(t.b={x:l+h*d,y:c+h*p}),t}}}}}),l=o.length;l--;)(!Xe(e=o[l],t)||!s(e)||v(e.a.x-e.b.x)<wt&&v(e.a.y-e.b.y)<wt)&&(e.a=e.b=null,o.splice(l,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,c,u,h=t[0][0],d=t[1][0],p=t[0][1],f=t[1][1],m=Ie,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,e=(c=s[++o%l].start()).x,r=c.y,(v(n-e)>wt||v(i-r)>wt)&&(s.splice(o,0,new er(Qe(a.site,u,v(n-h)<wt&&f-i>wt?{x:h,y:v(e-h)<wt?r:f}:v(i-f)<wt&&d-n>wt?{x:v(r-f)<wt?e:d,y:f}:v(n-d)<wt&&i-p>wt?{x:d,y:v(e-d)<wt?r:p}:v(i-p)<wt&&n-h>wt?{x:v(r-p)<wt?e:h,y:p}:null),a.site,null)),++l)}(e));var o={cells:Ie,edges:Pe};return ze=De=Pe=Ie=null,o}function lr(t,e){return e.y-t.y||e.x-t.x}He.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(We),e.length},er.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rr.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=or(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(ir(this,r),r=(t=r).U),r.C=!1,n.C=!0,ar(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(ar(this,r),r=(t=r).U),r.C=!1,n.C=!0,ir(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?or(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,ir(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ar(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,ir(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,ar(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,ir(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,ar(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ke,r=Te,n=e,i=r,a=cr;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return sr(s(t),a).cells.forEach((function(a,s){var l=a.edges,c=a.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/wt)*wt,y:Math.round(i(t,e)/wt)*wt,i:e}}))}return o.links=function(t){return sr(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return sr(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(We),u=-1,h=c.length,d=c[h-1].edge,p=d.l===l?d.r:d.l;++u<h;)i=p,p=(d=c[u].edge).l===l?d.r:d.l,n<i.i&&n<p.i&&(o=i,s=p,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[p.i]])})),e},o.x=function(t){return arguments.length?(n=he(e=t),o):e},o.y=function(t){return arguments.length?(i=he(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?cr:t,o):a===cr?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===cr?null:a&&a[1]},o};var cr=[[-1e6,-1e6],[1e6,1e6]];function ur(t){return t.x}function hr(t){return t.y}function dr(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&dr(t,l[0],r,n,o,s),l[1]&&dr(t,l[1],o,n,i,s),l[2]&&dr(t,l[2],r,s,o,a),l[3]&&dr(t,l[3],o,s,i,a)}}function pr(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return"#"+ie(Math.round(n+o*t))+ie(Math.round(i+s*t))+ie(Math.round(a+l*t))}}function fr(t,e){var r,n={},i={};for(r in t)r in e?n[r]=xr(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function mr(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function gr(t,e){var r,n,i,a=yr.lastIndex=vr.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=yr.exec(t))&&(n=vr.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=ke,s=Te;if(a=arguments.length)return o=ur,s=hr,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,c,u,h,d,p,f,m,g,y=he(o),x=he(s);if(null!=e)p=e,f=r,m=n,g=i;else if(m=g=-(p=f=1/0),c=[],u=[],d=t.length,a)for(h=0;h<d;++h)(l=t[h]).x<p&&(p=l.x),l.y<f&&(f=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;h<d;++h){var b=+y(l=t[h],h),_=+x(l,h);b<p&&(p=b),_<f&&(f=_),b>m&&(m=b),_>g&&(g=_),c.push(b),u.push(_)}var w=m-p,k=g-f;function T(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(v(l-r)+v(c-n)<.01)S(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,S(t,u,l,c,i,a,o,s),S(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else S(t,e,r,n,i,a,o,s)}function S(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,d=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,T(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>k?g=f+w:m=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(A,t,+y(t,++h),+x(t,h),p,f,m,g)},visit:function(t){dr(t,A,p,f,m,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,d,p){if(!(u>a||h>o||d<n||p<i)){if(f=c.point){var f,m=e-c.x,g=r-c.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=e-v,i=r-v,a=e+v,o=r+v,s=f}}for(var x=c.nodes,b=.5*(u+d),_=.5*(h+p),w=(r>=_)<<1|e>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:t(c,u,h,b,_);break;case 1:t(c,b,h,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,i,a,o),s}(A,t[0],t[1],p,f,m,g)}};if(h=-1,null==e){for(;++h<d;)T(A,t[h],c[h],u[h],p,f,m,g);--h}else t.forEach(A.add);return c=u=t=l=null,A}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=pr,t.interpolateObject=fr,t.interpolateNumber=mr,t.interpolateString=gr;var yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vr=new RegExp(yr.source,"g");function xr(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function br(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(xr(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=xr,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?ue.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?pr:gr:e instanceof Rt?pr:Array.isArray(e)?br:"object"===r&&isNaN(e)?fr:mr)(t,e)}],t.interpolateArray=br;var _r=function(){return E},wr=t.map({linear:_r,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return Ar},cubic:function(){return Mr},sin:function(){return Er},exp:function(){return Lr},circle:function(){return Pr},elastic:function(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/St*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*St/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return Ir}}),kr=t.map({in:E,out:Tr,"in-out":Sr,"out-in":function(t){return Sr(Tr(t))}});function Tr(t){return function(e){return 1-t(1-e)}}function Sr(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Ar(t){return t*t}function Mr(t){return t*t*t}function Cr(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Er(t){return 1-Math.cos(t*Mt)}function Lr(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Ir(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function zr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Or(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Rr(i),s=Dr(i,a),l=Rr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Et,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Et:0}function Dr(t,e){return t[0]*e[0]+t[1]*e[1]}function Rr(t){var e=Math.sqrt(Dr(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),i=n>=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=wr.get(i)||_r,a=kr.get(a)||E,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Vt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return jt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Zt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=zr,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Or(e?e.matrix:Fr)})(e)},Or.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function jr(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:mr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:mr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}function Nr(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Ur(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Vr(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;for(var r=qr(t),n=qr(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function qr(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function $r(t){t.fixed|=2}function Hr(t){t.fixed&=-7}function Wr(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Gr(t){t.fixed&=-5}function Yr(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(Yr(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,i+=c*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}t.interpolateTransform=jr,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Vr(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},c=0;function u(){var l,u,d,p,f,m={},g=[],y=t.range(i),v=[];for(e=[],r=[],l=0,p=-1;++p<i;){for(u=0,f=-1;++f<i;)u+=n[p][f];g.push(u),v.push(t.range(i)),l+=u}for(a&&y.sort((function(t,e){return a(g[t],g[e])})),o&&v.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(St-c*i)/l,u=0,p=-1;++p<i;){for(d=u,f=-1;++f<i;){var x=y[p],b=v[x][f],_=n[x][b],w=u,k=u+=_*l;m[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:d,endAngle:u,value:g[x]},u+=c}for(p=-1;++p<i;)for(f=p-1;++f<i;){var T=m[p+"-"+f],S=m[f+"-"+p];(T.value||S.value)&&e.push(T.value<S.value?{source:S,target:T}:{source:T,target:S})}s&&h()}function h(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&h(),l):s},l.chords=function(){return e||u(),e},l.groups=function(){return r||u(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),c=[1,1],u=.9,h=Zr,d=Xr,p=-30,f=Kr,m=.1,g=.64,y=[],v=[];function x(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/g<l){if(l<f){var c=e.charge/l;t.px-=a*c,t.py-=o*c}return!0}e.point&&l&&l<f&&(c=e.pointCharge/l,t.px-=a*c,t.py-=o*c)}return!e.charge}}function b(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,d,f,g,b,_,w,k=y.length,T=v.length;for(s=0;s<T;++s)d=(h=v[s]).source,(g=(_=(f=h.target).x-d.x)*_+(w=f.y-d.y)*w)&&(_*=g=n*a[s]*((g=Math.sqrt(g))-i[s])/g,w*=g,f.x-=_*(b=d.weight+f.weight?d.weight/(d.weight+f.weight):.5),f.y-=w*b,d.x+=_*(b=1-b),d.y+=w*b);if((b=n*m)&&(_=c[0]/2,w=c[1]/2,s=-1,b))for(;++s<k;)(h=y[s]).x+=(_-h.x)*b,h.y+=(w-h.y)*b;if(p)for(Yr(r=t.geom.quadtree(y),n,o),s=-1;++s<k;)(h=y[s]).fixed||r.visit(x(h));for(s=-1;++s<k;)(h=y[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*u,h.y-=(h.py-(h.py=h.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(v=t,s):v},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(h="function"===typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(d="function"===typeof t?t:+t,s):d},s.friction=function(t){return arguments.length?(u=+t,s):u},s.charge=function(t){return arguments.length?(p="function"===typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(f=t*t,s):Math.sqrt(f)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=xe(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,u=c[0],f=c[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=v[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=m("x",u)),isNaN(r.y)&&(r.y=m("y",f)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"===typeof h)for(t=0;t<l;++t)i[t]=+h.call(this,v[t],t);else for(t=0;t<l;++t)i[t]=h;if(a=[],"function"===typeof d)for(t=0;t<l;++t)a[t]=+d.call(this,v[t],t);else for(t=0;t<l;++t)a[t]=d;if(o=[],"function"===typeof p)for(t=0;t<n;++t)o[t]=+p.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=p;function m(r,i){if(!e){for(e=new Array(n),c=0;c<n;++c)e[c]=[];for(c=0;c<l;++c){var a=v[c];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(E).on("dragstart.force",$r).on("drag.force",b).on("dragend.force",Hr)),!arguments.length)return r;this.on("mouseover.force",Wr).on("mouseout.force",Gr).call(r)},t.rebind(s,l,"on")};var Zr=20,Xr=1,Kr=1/0;function Jr(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=an,e}function Qr(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function tn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function en(t){return t.children}function rn(t){return t.value}function nn(t,e){return e.value-t.value}function an(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=nn,e=en,r=rn;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=e.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return tn(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),tn(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,e,r,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(s=a[c],e,l=s.value*r,i),e+=l}}function i(t){var e=t.children,r=0;if(e&&(n=e.length))for(var n,a=-1;++a<n;)r=Math.max(r,i(e[a]));return 1+r}function a(t,a){var o=e.call(this,t,a);return n(o[0],0,r[0],r[1]/i(o[0])),o}return a.size=function(t){return arguments.length?(r=t,a):r},Jr(a,e)},t.layout.pie=function(){var e=Number,r=on,n=0,i=St,a=0;function o(s){var l,c=s.length,u=s.map((function(t,r){return+e.call(o,t,r)})),h=+("function"===typeof n?n.apply(this,arguments):n),d=("function"===typeof i?i.apply(this,arguments):i)-h,p=Math.min(Math.abs(d)/c,+("function"===typeof a?a.apply(this,arguments):a)),f=p*(d<0?-1:1),m=t.sum(u),g=m?(d-c*f)/m:0,y=t.range(c),v=[];return null!=r&&y.sort(r===on?function(t,e){return u[e]-u[t]}:function(t,e){return r(s[t],s[e])}),y.forEach((function(t){v[t]={data:s[t],value:l=u[t],startAngle:h,endAngle:h+=l*g+f,padAngle:p}})),v}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var on={};function sn(t){return t.x}function ln(t){return t.y}function cn(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=E,r=dn,n=pn,i=cn,a=sn,o=ln;function s(l,c){if(!(p=l.length))return l;var u=l.map((function(t,r){return e.call(s,t,r)})),h=u.map((function(t){return t.map((function(t,e){return[a.call(s,t,e),o.call(s,t,e)]}))})),d=r.call(s,h,c);u=t.permute(u,d),h=t.permute(h,d);var p,f,m,g,y=n.call(s,h,c),v=u[0].length;for(m=0;m<v;++m)for(i.call(s,u[0][m],g=y[m],h[0][m][1]),f=1;f<p;++f)i.call(s,u[f][m],g+=h[f-1][m][1],h[f][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"===typeof t?t:un.get(t)||dn,s):r},s.offset=function(t){return arguments.length?(n="function"===typeof t?t:hn.get(t)||pn,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var un=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(fn),o=e.map(mn),s=t.range(i).sort((function(t,e){return a[t]-a[e]})),l=0,c=0,u=[],h=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],h.push(n));return h.reverse().concat(u)},reverse:function(e){return t.range(e.length).reverse()},default:dn}),hn=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,c,u=t.length,h=t[0],d=h.length,p=[];for(p[0]=l=c=0,r=1;r<d;++r){for(e=0,i=0;e<u;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}p[r]=l-=i?a/i*s:0,l<c&&(c=l)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:pn});function dn(e){return t.range(e.length)}function pn(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function fn(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function mn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function yn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function xn(e){return[t.min(e),t.max(e)]}function bn(t,e){return t.value-e.value}function _n(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function wn(t,e){t._pack_next=e,e._pack_prev=t}function kn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,d=-1/0;if(e.forEach(Sn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(Cn(r,n,i=e[2]),x(i),_n(r,i),r._pack_prev=i,_n(i,n),n=r._pack_next,a=3;a<l;a++){Cn(r,n,i=e[a]);var p=0,f=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,f++)if(kn(o,i)){p=1;break}if(1==p)for(s=r._pack_prev;s!==o._pack_prev&&!kn(s,i);s=s._pack_prev,m++);p?(f<m||f==m&&n.r<r.r?wn(r,n=o):wn(r=s,n),a--):(_n(r,i),n=i,x(i))}var g=(c+u)/2,y=(h+d)/2,v=0;for(a=0;a<l;a++)(i=e[a]).x-=g,i.y-=y,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=v,e.forEach(An)}function x(t){c=Math.min(t.x-t.r,c),u=Math.max(t.x+t.r,u),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}}function Sn(t){t._pack_next=t._pack_prev=t}function An(t){delete t._pack_next,delete t._pack_prev}function Mn(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)Mn(i[a],e,r,n)}function Cn(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+c*a,r.y=t.y+l*a-c*i}else r.x=t.x+n,r.y=t.y}function En(t,e){return t.parent==e.parent?1:2}function Ln(t){var e=t.children;return e.length?e[0]:t.t}function Pn(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function In(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function zn(t,e,r){return t.a.parent===e.parent?t.a:r}function On(t){var e=t.children;return e&&e.length?On(e[0]):t}function Dn(t){var e,r=t.children;return r&&(e=r.length)?Dn(r[e-1]):t}function Rn(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fn(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Bn(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function jn(t){return t.rangeExtent?t.rangeExtent():Bn(t.range())}function Nn(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function Un(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function Vn(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:qn}t.layout.histogram=function(){var e=!0,r=Number,n=xn,i=yn;function a(a,o){for(var s,l,c=[],u=a.map(r,this),h=n.call(this,u,o),d=i.call(this,h,u,o),p=(o=-1,u.length),f=d.length-1,m=e?1:1/p;++o<f;)(s=c[o]=[]).dx=d[o+1]-(s.x=d[o]),s.y=0;if(f>0)for(o=-1;++o<p;)(l=u[o])>=h[0]&&l<=h[1]&&((s=c[t.bisect(d,l,1,f)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=he(t),a):n},a.bins=function(t){return arguments.length?(i="number"===typeof t?function(e){return vn(e,t)}:he(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(bn),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,tn(s,(function(t){t.r=+u(t.value)})),tn(s,Tn),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;tn(s,(function(t){t.r+=h})),tn(s,Tn),tn(s,(function(t){t.r-=h}))}return Mn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Jr(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=En,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(u);if(tn(h,o),h.parent.m=-h.z,Qr(h,s),i)Qr(u,l);else{var d=u,p=u,f=u;Qr(u,(function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>f.depth&&(f=t)}));var m=r(d,p)/2-d.x,g=n[0]/(p.x+r(p,d)/2+m),y=n[1]/(f.depth||1);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,d=l.m;s=Pn(s),a=Ln(a),s&&a;)l=Ln(l),(o=Pn(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(In(zn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,d+=l.m,u+=o.m;s&&!Pn(o)&&(o.t=s,o.m+=h-u),a&&!Ln(l)&&(l.t=a,l.m+=c-d,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Jr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=En,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;tn(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var h=On(c),d=Dn(c),p=h.x-r(h,d)/2,f=d.x+r(d,h)/2;return tn(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(f-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Jr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Rn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function h(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],c=e.slice(),d=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/t.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=d?(c.pop(),d=n):(s.area-=s.pop().area,f(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,d=1/0);s.length&&(f(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(f(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(d)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function f(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=t[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=t[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),u([a],a.dx*a.dy/a.value),(e?d:h)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){if(!arguments.length)return a;function e(e){return Fn(e,t)}var r;return o=null==(a=t)?Rn:"function"===(r=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?Rn(e):Fn(e,"number"===typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(c=t,m):c},m.mode=function(t){return arguments.length?(l=t+"",m):l},Jr(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var qn={floor:E,ceil:E};function $n(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function Hn(t,e,r,n){var i,a;function o(){var o=Math.min(t.length,e.length)>2?$n:Nn,l=n?Ur:Nr;return i=o(t,e,l,r),a=o(e,t,l,xr),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(zr)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return Zn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Gn(t,e),o()},s.copy=function(){return Hn(t,e,r,n)},o()}function Wn(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Gn(t,e){return Un(t,Vn(Yn(t,e)[2])),Un(t,Vn(Yn(t,e)[2])),t}function Yn(t,e){null==e&&(e=10);var r=Bn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Zn(e,r){return t.range.apply(t,Yn(e,r))}function Xn(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Un(n.map(i),r?Math:Kn);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Bn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var d=1;d<h;d++)o.push(a(c)*d);o.push(a(c))}else for(o.push(a(c));c++<u;)for(d=h-1;d>0;d--)o.push(a(c)*d);for(c=0;o[c]<s;c++);for(u=o.length;o[u-1]>l;u--);o=o.slice(c,u)}return o},o.copy=function(){return Xn(t.copy(),e,r,n)},Wn(o,t)}t.scale.linear=function(){return Hn([0,1],[0,1],xr,!1)},t.scale.log=function(){return Xn(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Jn(t,e,r){var n=Qn(e),i=Qn(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return Zn(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Gn(r,t))},a.exponent=function(o){return arguments.length?(n=Qn(e=o),i=Qn(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return Jn(t.copy(),e,r)},Wn(a,t)}function Qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ti(e,r){var n,i,a;function o(t){return i[((n.get(t)||("range"===r.t?n.set(t,e.push(t)):NaN))-1)%i.length]}function s(r,n){return t.range(e.length).map((function(t){return r+n*t}))}return o.domain=function(t){if(!arguments.length)return e;e=[],n=new b;for(var i,a=-1,s=t.length;++a<s;)n.has(i=t[a])||n.set(i,e.push(i));return o[r.t].apply(o,r.a)},o.range=function(t){return arguments.length?(i=t,a=0,r={t:"range",a:arguments},o):i},o.rangePoints=function(t,n){arguments.length<2&&(n=0);var l=t[0],c=t[1],u=e.length<2?(l=(l+c)/2,0):(c-l)/(e.length-1+n);return i=s(l+u*n/2,u),a=0,r={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(t,n){arguments.length<2&&(n=0);var l=t[0],c=t[1],u=e.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(e.length-1+n)|0;return i=s(l+Math.round(u*n/2+(c-l-(e.length-1+n)*u)/2),u),a=0,r={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(t,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=t[1]<t[0],u=t[c-0],h=(t[1-c]-u)/(e.length-n+2*l);return i=s(u+h*l,h),c&&i.reverse(),a=h*(1-n),r={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(t,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=t[1]<t[0],u=t[c-0],h=t[1-c],d=Math.floor((h-u)/(e.length-n+2*l));return i=s(u+Math.round((h-u-(e.length-n)*d)/2),d),c&&i.reverse(),a=Math.round(d*(1-n)),r={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return Bn(r.a[0])},o.copy=function(){return ti(e,r)},o.domain(e)}t.scale.pow=function(){return Jn(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return ti([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(ei)},t.scale.category20=function(){return t.scale.ordinal().range(ri)},t.scale.category20b=function(){return t.scale.ordinal().range(ni)},t.scale.category20c=function(){return t.scale.ordinal().range(ii)};var ei=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(re),ri=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(re),ni=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(re),ii=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(re);function ai(e,r){var n;function i(){var i=0,o=r.length;for(n=[];++i<o;)n[i-1]=t.quantile(e,i/o);return a}function a(e){if(!isNaN(e=+e))return r[t.bisect(n,e)]}return a.domain=function(t){return arguments.length?(e=t.map(p).filter(f).sort(d),i()):e},a.range=function(t){return arguments.length?(r=t,i()):r},a.quantiles=function(){return n},a.invertExtent=function(t){return(t=r.indexOf(t))<0?[NaN,NaN]:[t>0?n[t-1]:e[0],t<n.length?n[t]:e[e.length-1]]},a.copy=function(){return ai(e,r)},i()}function oi(t,e,r){var n,i;function a(e){return r[Math.max(0,Math.min(i,Math.floor(n*(e-t))))]}function o(){return n=r.length/(e-t),i=r.length-1,a}return a.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],o()):[t,e]},a.range=function(t){return arguments.length?(r=t,o()):r},a.invertExtent=function(e){return[e=(e=r.indexOf(e))<0?NaN:e/n+t,e+1/n]},a.copy=function(){return oi(t,e,r)},o()}function si(e,r){function n(n){if(n<=n)return r[t.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=t,n):r},n.invertExtent=function(t){return t=r.indexOf(t),[e[t-1],e[t]]},n.copy=function(){return si(e,r)},n}function li(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return Zn(t,e)},e.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},e.copy=function(){return li(t)},e}function ci(){return 0}t.scale.quantile=function(){return ai([],[])},t.scale.quantize=function(){return oi(0,1,[0,1])},t.scale.threshold=function(){return si([.5],[0,1])},t.scale.identity=function(){return li([0,1])},t.svg={},t.svg.arc=function(){var t=hi,e=di,r=ci,n=ui,i=pi,a=fi,o=mi;function s(){var s=Math.max(0,+t.apply(this,arguments)),c=Math.max(0,+e.apply(this,arguments)),u=i.apply(this,arguments)-Mt,h=a.apply(this,arguments)-Mt,d=Math.abs(h-u),p=u>h?0:1;if(c<s&&(f=c,c=s,s=f),d>=At)return l(c,p)+(s?l(s,1-p):"")+"Z";var f,m,g,y,v,x,b,_,w,k,T,S,A=0,M=0,C=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(M*=-1),c&&(M=Lt(g/c*Math.sin(y))),s&&(A=Lt(g/s*Math.sin(y)))),c){v=c*Math.cos(u+M),x=c*Math.sin(u+M),b=c*Math.cos(h-M),_=c*Math.sin(h-M);var E=Math.abs(h-u-2*M)<=Tt?0:1;if(M&&gi(v,x,b,_)===p^E){var L=(u+h)/2;v=c*Math.cos(L),x=c*Math.sin(L),b=_=null}}else v=x=0;if(s){w=s*Math.cos(h-A),k=s*Math.sin(h-A),T=s*Math.cos(u+A),S=s*Math.sin(u+A);var P=Math.abs(u-h+2*A)<=Tt?0:1;if(A&&gi(w,k,T,S)===1-p^P){var I=(u+h)/2;w=s*Math.cos(I),k=s*Math.sin(I),T=S=null}}else w=k=0;if(d>wt&&(f=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^p?0:1;var z=f,O=f;if(d<Tt){var D=null==T?[w,k]:null==b?[v,x]:Ee([v,x],[T,S],[b,_],[w,k]),R=v-D[0],F=x-D[1],B=b-D[0],j=_-D[1],N=1/Math.sin(Math.acos((R*B+F*j)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+j*j)))/2),U=Math.sqrt(D[0]*D[0]+D[1]*D[1]);O=Math.min(f,(s-U)/(N-1)),z=Math.min(f,(c-U)/(N+1))}if(null!=b){var V=yi(null==T?[w,k]:[T,S],[v,x],c,z,p),q=yi([b,_],[w,k],c,z,p);f===z?C.push("M",V[0],"A",z,",",z," 0 0,",m," ",V[1],"A",c,",",c," 0 ",1-p^gi(V[1][0],V[1][1],q[1][0],q[1][1]),",",p," ",q[1],"A",z,",",z," 0 0,",m," ",q[0]):C.push("M",V[0],"A",z,",",z," 0 1,",m," ",q[0])}else C.push("M",v,",",x);if(null!=T){var $=yi([v,x],[T,S],s,-O,p),H=yi([w,k],null==b?[v,x]:[b,_],s,-O,p);f===O?C.push("L",H[0],"A",O,",",O," 0 0,",m," ",H[1],"A",s,",",s," 0 ",p^gi(H[1][0],H[1][1],$[1][0],$[1][1]),",",1-p," ",$[1],"A",O,",",O," 0 0,",m," ",$[0]):C.push("L",H[0],"A",O,",",O," 0 0,",m," ",$[0])}else C.push("L",w,",",k)}else C.push("M",v,",",x),null!=b&&C.push("A",c,",",c," 0 ",E,",",p," ",b,",",_),C.push("L",w,",",k),null!=T&&C.push("A",s,",",s," 0 ",P,",",1-p," ",T,",",S);return C.push("Z"),C.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=he(e),s):t},s.outerRadius=function(t){return arguments.length?(e=he(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=he(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==ui?ui:he(t),s):n},s.startAngle=function(t){return arguments.length?(i=he(t),s):i},s.endAngle=function(t){return arguments.length?(a=he(t),s):a},s.padAngle=function(t){return arguments.length?(o=he(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Mt;return[Math.cos(n)*r,Math.sin(n)*r]},s};var ui="auto";function hi(t){return t.innerRadius}function di(t){return t.outerRadius}function pi(t){return t.startAngle}function fi(t){return t.endAngle}function mi(t){return t&&t.padAngle}function gi(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function yi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,h=t[1]+c,d=e[0]+l,p=e[1]+c,f=(u+d)/2,m=(h+p)/2,g=d-u,y=p-h,v=g*g+y*y,x=r-n,b=u*p-d*h,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-b*b)),w=(b*y-g*_)/v,k=(-b*g-y*_)/v,T=(b*y+g*_)/v,S=(-b*g+y*_)/v,A=w-f,M=k-m,C=T-f,E=S-m;return A*A+M*M>C*C+E*E&&(w=T,k=S),[[w-l,k-c],[w*r/x,k*r/x]]}function vi(){return!0}function xi(t){var e=ke,r=Te,n=vi,i=_i,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,d=he(e),p=he(r);function f(){l.push("M",i(t(c),o))}for(;++u<h;)n.call(this,s=a[u],u)?c.push([+d.call(this,s,u),+p.call(this,s,u)]):c.length&&(f(),c=[]);return c.length&&f(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a="function"===typeof t?i=t:(i=bi.get(t)||_i).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return xi(E)};var bi=t.map({linear:_i,"linear-closed":wi,step:function(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ti,basis:Mi,"basis-open":function(t){if(t.length<4)return _i(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ci(Pi,a)+","+Ci(Pi,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Ii(r,a,o);return r.join("")},"basis-closed":function(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[Ci(Pi,o),",",Ci(Pi,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Ii(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,c=-1;++c<=r;)i=c/r,(n=t[c])[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Mi(t)},cardinal:function(t,e){return t.length<3?_i(t):t[0]+Si(t,Ai(t,e))},"cardinal-open":function(t,e){return t.length<4?_i(t):t[1]+Si(t.slice(1,-1),Ai(t,e))},"cardinal-closed":function(t,e){return t.length<3?wi(t):t[0]+Si((t.push(t[0]),t),Ai([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?_i(t):t[0]+Si(t,function(t){for(var e,r,n,i,a=[],o=function(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=zi(i,a);++e<r;)n[e]=(o+(o=zi(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;++s<l;)e=zi(t[s],t[s+1]),v(e)<wt?o[s]=o[s+1]=0:(i=(r=o[s]/e)*r+(n=o[s+1]/e)*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function _i(t){return t.length>1?t.join("L"):t+"Z"}function wi(t){return t.join("L")+"Z"}function ki(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Ti(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Si(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return _i(t);var r=t.length!=e.length,n="",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;c<e.length;c++,l++)a=t[l],s=e[c],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var u=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function Ai(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Mi(t){if(t.length<3)return _i(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Ci(Pi,o),",",Ci(Pi,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Ii(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Ci(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}bi.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var Ei=[0,2/3,1/3,0],Li=[0,1/3,2/3,0],Pi=[0,1/6,2/3,1/6];function Ii(t,e,r){t.push("C",Ci(Ei,e),",",Ci(Ei,r),",",Ci(Li,e),",",Ci(Li,r),",",Ci(Pi,e),",",Ci(Pi,r))}function zi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Oi(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Mt,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Di(t){var e=ke,r=ke,n=0,i=Te,a=vi,o=_i,s=o.key,l=o,c="L",u=.7;function h(s){var h,d,p,f=[],m=[],g=[],y=-1,v=s.length,x=he(e),b=he(n),_=e===r?function(){return d}:he(r),w=n===i?function(){return p}:he(i);function k(){f.push("M",o(t(g),u),c,l(t(m.reverse()),u),"Z")}for(;++y<v;)a.call(this,h=s[y],y)?(m.push([d=+x.call(this,h,y),p=+b.call(this,h,y)]),g.push([+_.call(this,h,y),+w.call(this,h,y)])):m.length&&(k(),m=[],g=[]);return m.length&&k(),f.length?f.join(""):null}return h.x=function(t){return arguments.length?(e=r=t,h):r},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(n=i=t,h):i},h.y0=function(t){return arguments.length?(n=t,h):n},h.y1=function(t){return arguments.length?(i=t,h):i},h.defined=function(t){return arguments.length?(a=t,h):a},h.interpolate=function(t){return arguments.length?(s="function"===typeof t?o=t:(o=bi.get(t)||_i).key,l=o.reverse||o,c=o.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(u=t,h):u},h}function Ri(t){return t.source}function Fi(t){return t.target}function Bi(t){return t.radius}function ji(t){return[t.x,t.y]}function Ni(){return 64}function Ui(){return"circle"}function Vi(t){var e=Math.sqrt(t/Tt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=xi(Oi);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ki.reverse=Ti,Ti.reverse=ki,t.svg.area=function(){return Di(E)},t.svg.area.radial=function(){var t=Di(Oi);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Ri,e=Fi,r=Bi,n=pi,i=fi;function a(r,n){var i,a,c=o(this,t,r,n),u=o(this,e,r,n);return"M"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(a=u,((i=c).a0==a.a0&&i.a1==a.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+"Z")}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),c=n.call(t,s,o)-Mt,u=i.call(t,s,o)-Mt;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Tt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=he(t),a):r},a.source=function(e){return arguments.length?(t=he(e),a):t},a.target=function(t){return arguments.length?(e=he(t),a):e},a.startAngle=function(t){return arguments.length?(n=he(t),a):n},a.endAngle=function(t){return arguments.length?(i=he(t),a):i},a},t.svg.diagonal=function(){var t=Ri,e=Fi,r=ji;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=he(e),n):t},n.target=function(t){return arguments.length?(e=he(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=ji,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Mt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=Ui,e=Ni;function r(r,n){return(qi.get(t.call(this,r,n))||Vi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=he(e),r):t},r.size=function(t){return arguments.length?(e=he(t),r):e},r};var qi=t.map({circle:Vi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Hi)),r=e*Hi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/$i),r=e*$i/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/$i),r=e*$i/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=qi.keys();var $i=Math.sqrt(3),Hi=Math.tan(30*Ct);H.transition=function(t){for(var e,r,n=Zi||++Ji,i=ea(t),a=[],o=Xi||{time:Date.now(),ease:Cr,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(r=c[u])&&ra(r,u,i,n,o),e.push(r)}return Yi(a,i,n)},H.interrupt=function(t){return this.each(null==t?Wi:Gi(ea(t)))};var Wi=Gi(ea());function Gi(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Yi(t,e,r){return N(t,Ki),t.namespace=e,t.id=r,t}var Zi,Xi,Ki=[],Ji=0;function Qi(t,e,r,n){var i=t.id,a=t.namespace;return ct(t,"function"===typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function ta(t){return null==t&&(t=""),function(){this.textContent=t}}function ea(t){return null==t?"__transition__":"__transition_"+t+"__"}function ra(t,e,r,n,i){var a,o,s,l,c,u=t[r]||(t[r]={active:0,count:0}),h=u[n];function d(r){var i=u.active,d=u[i];for(var f in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[i],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),u)if(+f<n){var m=u[f];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[f]}o.c=p,xe((function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1}),0,a),u.active=n,h.event&&h.event.start.call(t,t.__data__,e),c=[],h.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&c.push(n)})),l=h.ease,s=h.duration}function p(i){for(var a=i/s,o=l(a),d=c.length;d>0;)c[--d].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=xe((function(t){var e=h.delay;if(o.t=e+a,e<=t)return d(t-e);o.c=d}),0,a),h=u[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}Ki.call=H.call,Ki.empty=H.empty,Ki.node=H.node,Ki.size=H.size,t.transition=function(e,r){return e&&e.transition?Zi?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Ki,Ki.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(n=c[u])&&(r=t.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),ra(r,u,a,i,n[a][i]),e.push(r)):e.push(null)}return Yi(o,a,i)},Ki.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=G(t);for(var c=-1,u=this.length;++c<u;)for(var h=this[c],d=-1,p=h.length;++d<p;)if(n=h[d]){a=n[s][o],r=t.call(n,n.__data__,d,c),l.push(e=[]);for(var f=-1,m=r.length;++f<m;)(i=r[f])&&ra(i,f,s,o,a),e.push(i)}return Yi(l,s,o)},Ki.filter=function(t){var e,r,n=[];"function"!==typeof t&&(t=st(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return Yi(n,this.namespace,this.id)},Ki.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ct(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Ki.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?jr:xr,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return Qi(this,"attr."+e,r,i.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+="",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},Ki.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},Ki.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!==typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function i(){this.style.removeProperty(t)}return Qi(this,"style."+t,e,(function(e){return null==e?i:(e+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=xr(i,e),function(e){this.style.setProperty(t,n(e),r)})})}))},Ki.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,(function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}))},Ki.text=function(t){return Qi(this,"text",t,ta)},Ki.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},Ki.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!==typeof e&&(e=t.ease.apply(t,arguments)),ct(this,(function(t){t[n][r].ease=e})))},Ki.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ct(this,"function"===typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},Ki.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ct(this,"function"===typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},Ki.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=Xi,o=Zi;try{Zi=n,ct(this,(function(t,r,a){Xi=t[i][n],e.call(t,t.__data__,r,a)}))}finally{Xi=a,Zi=o}}else ct(this,(function(a){var o=a[i][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},Ki.transition=function(){for(var t,e,r,n=this.id,i=++Ji,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var c,u=0,h=(c=this[s]).length;u<h;u++)(e=c[u])&&ra(e,u,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return Yi(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=na,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=t.select(this),h=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,l):d.domain():c,f=null==e?d.tickFormat?d.tickFormat.apply(d,l):E:e,m=u.selectAll(".tick").data(p,d),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",wt),y=t.transition(m.exit()).style("opacity",wt).remove(),v=t.transition(m.order()).style("opacity",1),x=Math.max(a,0)+s,b=jn(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));g.append("line"),g.append("text");var k,T,S,A,M=g.select("line"),C=v.select("line"),L=m.select("text").text(f),P=g.select("text"),I=v.select("text"),z="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=aa,k="x",S="y",T="x2",A="y2",L.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*o+"V0H"+b[1]+"V"+z*o)):(n=oa,k="y",S="x",T="y2",A="x2",L.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+b[0]+"H0V"+b[1]+"H"+z*o)),M.attr(A,z*a),P.attr(S,z*x),C.attr(T,0).attr(A,z*a),I.attr(k,0).attr(S,z*x),d.rangeBand){var O=d,D=O.rangeBand()/2;h=d=function(t){return O(t)+D}}else h.rangeBand?h=d:y.call(n,d,h);g.call(n,h,d),v.call(n,d,d)}))}return u.scale=function(t){return arguments.length?(r=t,u):r},u.orient=function(t){return arguments.length?(i=t in ia?t+"":na,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(t){return arguments.length?(c=t,u):c},u.tickFormat=function(t){return arguments.length?(e=t,u):e},u.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],u):a},u.innerTickSize=function(t){return arguments.length?(a=+t,u):a},u.outerTickSize=function(t){return arguments.length?(o=+t,u):o},u.tickPadding=function(t){return arguments.length?(s=+t,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var na="bottom",ia={top:1,right:1,bottom:1,left:1};function aa(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function oa(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=B(d,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,h=la[0];function d(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(h,E);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return sa[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=jn(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),f(s)),a&&(o=jn(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),p(s)}))}function p(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"}))}function f(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=t.select(t.event.target),x=n.of(y,arguments),b=t.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,T=v.classed("extent"),S=vt(y),A=t.mouse(y),M=t.select(o(y)).on("keydown.brush",(function(){32==t.event.keyCode&&(T||(h=null,A[0]-=s[1],A[1]-=l[1],T=2),R())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==T&&(A[0]+=s[1],A[1]+=l[1],T=0,R())}));if(t.event.changedTouches?M.on("touchmove.brush",L).on("touchend.brush",I):M.on("mousemove.brush",L).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),T)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var C=+/w$/.test(_),E=+/^n/.test(_);g=[s[1-C]-A[0],l[1-E]-A[1]],A[0]=s[C],A[1]=l[E]}else t.event.altKey&&(h=A.slice());function L(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),T||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(e[0]<h[0])],A[1]=l[+(e[1]<h[1])]):h=null),w&&P(e,i,0)&&(f(b),r=!0),k&&P(e,a,1)&&(m(b),r=!0),r&&(p(b),x({type:"brush",mode:T?"move":"resize"}))}function P(t,n,i){var a,o,d=jn(n),p=d[0],f=d[1],m=A[i],g=i?l:s,y=g[1]-g[0];if(T&&(p-=m,f-=y+m),a=(i?u:c)?Math.max(p,Math.min(f,t[i])):t[i],T?o=(a+=m)+y:(h&&(m=Math.max(p,Math.min(f,2*h[i]-a))),m<a?(o=a,a=m):o=m),g[0]!=a||g[1]!=o)return i?r=null:e=null,g[0]=a,g[1]=o,!0}function I(){L(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),M.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),S(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",v.style("cursor")),x({type:"brushstart"}),L()}return d.event=function(i){i.each((function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,Zi?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})})).tween("brush:brush",(function(){var t=br(s,a.x),n=br(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})})):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))}))},d.x=function(t){return arguments.length?(h=la[!(i=t)<<1|!a],d):i},d.y=function(t){return arguments.length?(h=la[!i<<1|!(a=t)],d):a},d.clamp=function(t){return arguments.length?(i&&a?(c=!!t[0],u=!!t[1]):i?c=!!t:a&&(u=!!t),d):i&&a?[c,u]:i?c:a?u:null},d.extent=function(t){var n,o,c,u,h;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(h=n,n=o,o=h),n==s[0]&&o==s[1]||(s=[n,o])),a&&(c=t[0],u=t[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(h=c,c=u,u=h),c==l[0]&&u==l[1]||(l=[c,u])),d):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(h=n,n=o,o=h))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(h=c,c=u,u=h))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},d.clear=function(){return d.empty()||(s=[0,0],l=[0,0],e=r=null),d},d.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(d,n,"on")};var sa={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},la=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function ca(t){return JSON.parse(t.responseText)}function ua(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}t.text=de((function(t){return t.responseText})),t.json=function(t,e){return pe(t,"application/json",ca,e)},t.html=function(t,e){return pe(t,"text/html",ua,e)},t.xml=de((function(t){return t.responseXML})),"object"===typeof e&&e.exports?e.exports=t:this.d3=t}).apply(self)}}),x=d({"node_modules/d3-time/dist/d3-time.js"(t,e){var r,n;r=t,n=function(t){var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e<r-t?e:r},s.offset=function(t,e){return i(t=new Date(+t),null==e?1:Math.floor(e)),t},s.range=function(e,r,n){var a,o=[];if(e=s.ceil(e),n=null==n?1:Math.floor(n),!(e<r)||!(n>0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a<e&&e<r);return o},s.filter=function(e){return n((function(r){if(r>=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t===0}:function(e){return s.count(0,e)%t===0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*o)}),(function(t,e){return(e-t)/o}),(function(t){return t.getUTCSeconds()})),d=h.range,p=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getMinutes()})),f=p.range,m=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o-t.getMinutes()*s)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getHours()})),g=m.range,y=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/c}),(function(t){return t.getDate()-1})),v=y.range;function x(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/u}))}var b=x(0),_=x(1),w=x(2),k=x(3),T=x(4),S=x(5),A=x(6),M=b.range,C=_.range,E=w.range,L=k.range,P=T.range,I=S.range,z=A.range,O=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),D=O.range,R=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var F=R.range,B=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCMinutes()})),j=B.range,N=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getUTCHours()})),U=N.range,V=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCDate()-1})),q=V.range;function $(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/u}))}var H=$(0),W=$(1),G=$(2),Y=$(3),Z=$(4),X=$(5),K=$(6),J=H.range,Q=W.range,tt=G.range,et=Y.range,rt=Z.range,nt=X.range,it=K.range,at=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ot=at.range,st=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));st.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var lt=st.range;t.timeDay=y,t.timeDays=v,t.timeFriday=S,t.timeFridays=I,t.timeHour=m,t.timeHours=g,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=p,t.timeMinutes=f,t.timeMonday=_,t.timeMondays=C,t.timeMonth=O,t.timeMonths=D,t.timeSaturday=A,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=d,t.timeSunday=b,t.timeSundays=M,t.timeThursday=T,t.timeThursdays=P,t.timeTuesday=w,t.timeTuesdays=E,t.timeWednesday=k,t.timeWednesdays=L,t.timeWeek=b,t.timeWeeks=M,t.timeYear=R,t.timeYears=F,t.utcDay=V,t.utcDays=q,t.utcFriday=X,t.utcFridays=nt,t.utcHour=N,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=B,t.utcMinutes=j,t.utcMonday=W,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=K,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=d,t.utcSunday=H,t.utcSundays=J,t.utcThursday=Z,t.utcThursdays=rt,t.utcTuesday=G,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=H,t.utcWeeks=J,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),b=d({"node_modules/d3-time-format/dist/d3-time-format.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,c=t.periods,u=t.days,h=t.shortDays,d=t.months,vt=t.shortMonths,xt=p(c),bt=f(c),_t=p(u),wt=f(u),kt=p(h),Tt=f(h),St=p(d),At=f(d),Mt=p(vt),Ct=f(vt),Et={a:function(t){return h[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return d[t.getMonth()]},c:null,d:D,e:D,f:N,H:R,I:F,j:B,L:j,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:$,U:H,V:W,w:G,W:Y,x:null,X:null,y:Z,Y:X,Z:K,"%":mt},Lt={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:J,e:J,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ct,w:ut,W:ht,x:null,X:null,y:dt,Y:pt,Z:ft,"%":mt},Pt={a:function(t,e,r){var n=kt.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Mt.exec(e.slice(r));return n?(t.m=Ct[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=At[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Ot(t,a,e,r)},d:S,e:S,f:P,H:M,I:M,j:A,L:L,m:T,M:C,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=bt[n[0].toLowerCase()],r+n[0].length):-1},q:k,Q:z,s:O,S:E,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Ot(t,o,e,r)},X:function(t,e,r){return Ot(t,l,e,r)},y:_,Y:b,Z:w,"%":I};function It(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===t.charCodeAt(l)&&(o.push(t.slice(c,l)),null!=(i=s[n=t.charAt(++l)])?n=t.charAt(++l):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),o.push(n),c=l+1);return o.push(t.slice(c,l)),o.join("")}}function zt(t,a){return function(o){var s,l,c=i(1900,void 0,1);if(Ot(c,t,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(a&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Ot(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o<l;){if(n>=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Et.x=It(o,Et),Et.X=It(l,Et),Et.c=It(a,Et),Lt.x=It(o,Lt),Lt.X=It(l,Lt),Lt.c=It(a,Lt),{format:function(t){var e=It(t+="",Et);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Lt);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function d(t){return t.replace(u,"\\$&")}function p(t){return new RegExp("^(?:"+t.map(d).join("|")+")","i")}function f(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function m(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function g(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function y(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function v(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function x(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function b(t,e,r){var n=l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function _(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function P(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function D(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function B(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function j(t,e){return h(t.getMilliseconds(),e,3)}function N(t,e){return j(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function $(t){var e=t.getDay();return 0===e?7:e}function H(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function W(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function G(t){return t.getDay()}function Y(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return h(t.getFullYear()%100,e,2)}function X(t,e){return h(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function J(t,e){return h(t.getUTCDate(),e,2)}function Q(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function dt(t,e){return h(t.getUTCFullYear()%100,e,2)}function pt(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function ft(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt="%Y-%m-%dT%H:%M:%S.%LZ",bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(xt),_t=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(xt);t.isoFormat=bt,t.isoParse=_t,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,x()):n((r=r||self).d3=r.d3||{},r.d3)}}),_=d({"node_modules/d3-format/dist/d3-format.js"(t,e){var r;r=t,function(t){function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,h=Array.prototype.map,d=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=h.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",f=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(h.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",y=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,h=t.zero,v=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(h||"0"===e&&"="===r)&&(h=!0,e="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?u:/[%p]/.test(w)?m:"",S=l[w],A=/[defgprs%]/.test(w);function M(t){var a,s,l,c=k,u=T;if("c"===w)u=S(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?y:S(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n<r;++n)switch(t[n]){case".":i=e=n;break;case"0":0===i&&(i=n),e=n;break;default:if(!+t[n])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0===+t&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?d[8+n/3]:"")+u+(m&&"("===i?")":""),A)for(a=-1,s=t.length;++a<s;)if(48>(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!h&&(t=o(t,1/0));var M=c.length+t.length+u.length,C=M<v?new Array(v-M+1).join(e):"";switch(x&&h&&(t=o(C+t,C.length?v-u.length:1/0),C=""),r){case"<":t=c+t+u+C;break;case"=":t=c+C+t+u;break;case"^":t=C.slice(0,M=C.length>>1)+c+t+u+C.slice(M);break;default:t=C+c+t+u}return f(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),M.toString=function(){return t+""},M}return{format:v,formatPrefix:function(t,e){var n=v(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=d[8+i/3];return function(t){return n(o*t)+s}}}}function f(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}f({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=f,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}("object"===typeof t&&"undefined"!==typeof e?t:(r="undefined"!==typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),w=d({"node_modules/is-string-blank/index.js"(t,e){e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}}}),k=d({"node_modules/fast-isnumeric/index.js"(t,e){var r=w();e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0===(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}}}),T=d({"src/constants/numerical.js"(t,e){e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),S=d({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,e){var r;r=t,function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"===typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[e.charCodeAt(n)]=n;t.decode=function(t){var e,n,i,a,o,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e<l;e+=4)n=r[t.charCodeAt(e)],i=r[t.charCodeAt(e+1)],a=r[t.charCodeAt(e+2)],o=r[t.charCodeAt(e+3)],h[c++]=n<<2|i>>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r<i;r+=3)a+=e[n[r]>>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(t,"__esModule",{value:!0})}("object"===typeof t&&"undefined"!==typeof e?t:(r="undefined"!==typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}}),A=d({"src/lib/is_plain_object.js"(t,e){e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}}),M=d({"src/lib/array.js"(t){var e=S().decode,r=A(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}t.isTypedArray=o,t.isArrayOrTypedArray=s,t.isArray1D=function(t){return!s(t[0])},t.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t};var l={u1c:"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"===typeof Int8Array?void 0:Int8Array,u1:"undefined"===typeof Uint8Array?void 0:Uint8Array,i2:"undefined"===typeof Int16Array?void 0:Int16Array,u2:"undefined"===typeof Uint16Array?void 0:Uint16Array,i4:"undefined"===typeof Int32Array?void 0:Int32Array,u4:"undefined"===typeof Uint32Array?void 0:Uint32Array,f4:"undefined"===typeof Float32Array?void 0:Float32Array,f8:"undefined"===typeof Float64Array?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function u(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i<t.length;i++)n=e(n,t[i].length);return n}return t.length}return 0}l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8,t.isArrayBuffer=c,t.decodeTypedArraySpec=function(t){var r=[],n=function(t){return{bdata:t.bdata,dtype:t.dtype,shape:t.shape}}(t),i=n.dtype,a=l[i];if(!a)throw new Error('Error in dtype: "'+i+'"');var o=a.BYTES_PER_ELEMENT,s=n.bdata;c(s)||(s=e(s));var u=void 0===n.shape?[s.byteLength/o]:(""+n.shape).split(",");u.reverse();var h,d,p=u.length,f=+u[0],m=o*f,g=0;if(1===p)r=new a(s);else if(2===p)for(h=+u[1],d=0;d<h;d++)r[d]=new a(s,g,f),g+=m;else{if(3!==p)throw new Error("ndim: "+p+'is not supported with the shape:"'+n.shape+'"');h=+u[1];for(var y=+u[2],v=0;v<y;v++)for(r[v]=[],d=0;d<h;d++)r[v][d]=new a(s,g,f),g+=m}return r.bdata=n.bdata,r.dtype=n.dtype,r.shape=u.reverse().join(","),t._inputArray=r,r},t.isTypedArraySpec=function(t){return r(t)&&t.hasOwnProperty("dtype")&&"string"===typeof t.dtype&&t.hasOwnProperty("bdata")&&("string"===typeof t.bdata||c(t.bdata))&&(void 0===t.shape||t.hasOwnProperty("shape")&&("string"===typeof t.shape||"number"===typeof t.shape))},t.concat=function(){var t,e,r,i,a,o,s,l,c=[],u=!0,h=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(e?c.push(i):(e=i,a=o),n(i)?t=!1:(u=!1,h?t!==i.constructor&&(t=!1):t=i.constructor),h+=o);if(!h)return[];if(!c.length)return e;if(u)return e.concat.apply(e,c);if(t){for((s=new t(h)).set(e),r=0;r<c.length;r++)i=c[r],s.set(i,a),a+=i.length;return s}for(s=new Array(h),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<c.length;r++){for(i=c[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},t.maxRowLength=function(t){return u(t,Math.max,0)},t.minRowLength=function(t){return u(t,Math.min,1/0)}}}),C=d({"src/lib/nested_property.js"(t,e){var r=k(),n=M().isArrayOrTypedArray;function i(t,e){return function(r){var a,o,s,l,c,u=t;for(l=0;l<e.length-1;l++){if(-1===(a=e[l])){for(o=!0,s=[],c=0;c<u.length;c++)s[c]=i(u[c],e.slice(l+1))(r),s[c]!==s[0]&&(o=!1);return o?s[0]:s}if("number"===typeof a&&!n(u))return;if("object"!==typeof(u=u[a])||null===u)return}if("object"===typeof u&&null!==u&&(s=u[e[l]],r||null!==s))return s}}e.exports=function(t,e){if(r(e))e=String(e);else if("string"!==typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";var n,a,o,l,c=e.split(".");for(l=0;l<c.length;l++)if("__"===String(c[l]).slice(0,2))throw"bad property string";for(l=0;l<c.length;){if(n=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(n[1])c[l]=n[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=n[2].substr(1,n[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[o]))}l++}return"object"!==typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,c):{set:s(t,c,e),get:i(t,c),astr:e,parts:c,obj:t}};var a=/(^|\.)args\[/;function o(t,e){return void 0===t||null===t&&!e.match(a)}function s(t,e,r){return function(i){var a,s,h=t,d="",p=[[t,d]],f=o(i,r);for(s=0;s<e.length-1;s++){if("number"===typeof(a=e[s])&&!n(h))throw"array index but container is not an array";if(-1===a){if(f=!c(h,e.slice(s+1),i,r))break;return}if(!u(h,a,e[s+1],f))break;if("object"!==typeof(h=h[a])||null===h)throw"container is not an object";d=l(d,a),p.push([h,d])}if(f){if(s===e.length-1&&(delete h[e[s]],Array.isArray(h)&&+e[s]===h.length-1))for(;h.length&&void 0===h[h.length-1];)h.pop()}else h[e[s]]=i}}function l(t,e){var n=e;return r(e)?n="["+e+"]":t&&(n="."+e),t+n}function c(t,e,r,i){var a,l=n(r),c=!0,h=r,d=i.replace("-1",0),p=!l&&o(r,d),f=e[0];for(a=0;a<t.length;a++)d=i.replace("-1",a),l&&(p=o(h=r[a%r.length],d)),p&&(c=!1),u(t,a,f,p)&&s(t[a],e,i.replace("-1",a))(h);return c}function u(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"===typeof r?[]:{}}return!0}}}),E=d({"src/lib/keyed_container.js"(t,e){var r=C(),n=/^\w*$/;e.exports=function(t,e,i,a){var o,s,l;i=i||"name",a=a||"value";var c={};e&&e.length?(l=r(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o<s.length;o++)u[s[o][i]]=o;var h=n.test(a),d={set:function(t,e){var n=null===e?4:0;if(!s){if(!l||4===n)return;s=[],l.set(s)}var o=u[t];if(void 0===o){if(4===n)return;n|=3,o=s.length,u[t]=o}else e!==(h?s[o][a]:r(s[o],a).get())&&(n|=2);var p=s[o]=s[o]||{};return p[i]=t,h?p[a]=e:r(p,a).set(e),null!==e&&(n&=-5),c[o]=c[o]|n,d},get:function(t){if(s){var e=u[t];return void 0===e?void 0:h?s[e][a]:r(s[e],a).get()}},rename:function(t,e){var r=u[t];return void 0===r||(c[r]=1|c[r],u[e]=r,delete u[t],s[r][i]=e),d},remove:function(t){var e=u[t];if(void 0===e)return d;var n=s[e];if(Object.keys(n).length>2)return c[e]=2|c[e],d.set(t,null);if(h){for(o=e;o<s.length;o++)c[o]=3|c[o];for(o=e;o<s.length;o++)u[s[o][i]]--;s.splice(e,1),delete u[t]}else r(n,a).set(null),c[e]=6|c[e];return d},constructUpdate:function(){for(var t,n,o={},l=Object.keys(c),u=0;u<l.length;u++)n=l[u],t=e+"["+n+"]",s[n]?(1&c[n]&&(o[t+"."+i]=s[n][i]),2&c[n]&&(o[t+"."+a]=h?4&c[n]?null:s[n][a]:4&c[n]?null:r(s[n],a).get())):o[t]=null;return o}};return d}}}),L=d({"src/lib/relative_attr.js"(t,e){var r=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,n=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var i=t.match(r);if(i)t=i[1];else{if(!t.match(n))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}}}),P=d({"src/lib/to_log_range.js"(t,e){var r=k();e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}}}),I=d({"src/lib/relink_private.js"(t,e){var r=M().isArrayOrTypedArray,n=A();e.exports=function t(e,i){for(var a in i){var o=i[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"===typeof o){if(a in e)continue;e[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;c<l;c++)s[c]!==o[c]&&n(o[c])&&n(s[c])&&t(s[c],o[c])}else n(o)&&n(s)&&(t(s,o),Object.keys(s).length||delete e[a])}}}}),z=d({"src/lib/mod.js"(t,e){e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}}}),O=d({"node_modules/tinycolor2/tinycolor.js"(t,e){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i,a,l,c={r:0,g:0,b:0},u=1,h=null,d=null,p=null,f=!1,m=!1;return"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(M[t])t=M[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=F.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=F.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=F.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=F.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=F.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=F.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=F.hex8.exec(t))?{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"}:(e=F.hex6.exec(t))?{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"}:(e=F.hex4.exec(t))?{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=F.hex3.exec(t))&&{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"}}(e)),"object"==typeof e&&(B(e.r)&&B(e.g)&&B(e.b)?(i=e.r,a=e.g,l=e.b,c={r:255*L(i,255),g:255*L(a,255),b:255*L(l,255)},f=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):B(e.h)&&B(e.s)&&B(e.v)?(h=O(e.s),d=O(e.v),c=function(e,r,n){e=6*L(e,360),r=L(r,100),n=L(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6,u=[n,s,o,o,l,n][c],h=[l,n,n,s,o,o][c],d=[o,o,l,n,n,s][c];return{r:255*u,g:255*h,b:255*d}}(e.h,h,d),f=!0,m="hsv"):B(e.h)&&B(e.s)&&B(e.l)&&(h=O(e.s),p=O(e.l),c=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,h,p),f=!0,m="hsl"),e.hasOwnProperty("a")&&(u=e.a)),u=E(u),{ok:f,format:e.format||m,r:o(255,s(c.r,0)),g:o(255,s(c.g,0)),b:o(255,s(c.b,0)),a:u}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,l:c}}function h(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=a,u=a-l;if(i=0===a?0:u/a,a==l)n=0;else{switch(a){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:i,v:c}}function d(t,e,r,n){var i=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function p(t,e,r,n){return[z(D(n)),z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16))].join("")}function f(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s-=e/100,r.s=P(r.s),c(r)}function m(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.s+=e/100,r.s=P(r.s),c(r)}function g(t){return c(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l+=e/100,r.l=P(r.l),c(r)}function v(t,e){e=0===e?0:e||10;var r=c(t).toRgb();return r.r=s(0,o(255,r.r-a(-e/100*255))),r.g=s(0,o(255,r.g-a(-e/100*255))),r.b=s(0,o(255,r.b-a(-e/100*255))),c(r)}function x(t,e){e=0===e?0:e||10;var r=c(t).toHsl();return r.l-=e/100,r.l=P(r.l),c(r)}function b(t,e){var r=c(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,c(r)}function _(t){var e=c(t).toHsl();return e.h=(e.h+180)%360,c(e)}function w(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+120)%360,s:e.s,l:e.l}),c({h:(r+240)%360,s:e.s,l:e.l})]}function k(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+90)%360,s:e.s,l:e.l}),c({h:(r+180)%360,s:e.s,l:e.l}),c({h:(r+270)%360,s:e.s,l:e.l})]}function T(t){var e=c(t).toHsl(),r=e.h;return[c(t),c({h:(r+72)%360,s:e.s,l:e.l}),c({h:(r+216)%360,s:e.s,l:e.l})]}function S(t,e,r){e=e||6,r=r||30;var n=c(t).toHsl(),i=360/r,a=[c(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function A(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16)),z(D(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:O(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;return e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;u<e.length;u++)(n=c.readability(t,e[u]))>l&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var M=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(M);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"===typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function B(t){return!!F.CSS_UNIT.exec(t)}"undefined"!==typeof e&&e.exports?e.exports=c:window.tinycolor=c}(Math)}}),D=d({"src/lib/extend.js"(t){var e=A(),r=Array.isArray;function n(t,i,a,o){var s,l,c,u,h,d,p,f=t[0],m=t.length;if(2===m&&r(f)&&r(t[1])&&0===f.length){if(p=function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"===typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],f),p)return f;f.splice(0,f.length)}for(var g=1;g<m;g++)for(l in s=t[g])c=f[l],u=s[l],o&&r(u)?f[l]=u:i&&u&&(e(u)||(h=r(u)))?(h?(h=!1,d=c&&r(c)?c:[]):d=c&&e(c)?c:{},f[l]=n([d,u],i,a,o)):("undefined"!==typeof u||a)&&(f[l]=u);return f}t.extendFlat=function(){return n(arguments,!1,!1,!1)},t.extendDeep=function(){return n(arguments,!0,!1,!1)},t.extendDeepAll=function(){return n(arguments,!0,!0,!1)},t.extendDeepNoArrays=function(){return n(arguments,!0,!1,!0)}}}),R=d({"src/plots/font_attributes.js"(t,e){e.exports=function(t){var e=t.variantValues,r=t.editType,n=t.colorEditType;void 0===n&&(n=r);var i={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};t.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var a={family:{valType:"string",noBlank:!0,strict:!0,editType:r},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:n},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:t.noFontVariant?void 0:{editType:r,valType:"enumerated",values:e||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:t.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:t.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:t.noFontShadow?void 0:{editType:r,valType:"string",dflt:t.autoShadowDflt?"auto":"none"},editType:r};return t.autoSize&&(a.size.dflt="auto"),t.autoColor&&(a.color.dflt="auto"),t.arrayOk&&(a.family.arrayOk=!0,a.weight.arrayOk=!0,a.style.arrayOk=!0,t.noFontVariant||(a.variant.arrayOk=!0),t.noFontTextcase||(a.textcase.arrayOk=!0),t.noFontLineposition||(a.lineposition.arrayOk=!0),t.noFontShadow||(a.shadow.arrayOk=!0),a.size.arrayOk=!0,a.color.arrayOk=!0),a}}}),F=d({"src/components/fx/constants.js"(t,e){e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),B=d({"src/components/fx/layout_attributes.js"(t,e){var r=F(),n=R(),i=n({editType:"none"});i.family.dflt=r.HOVERFONT,i.size.dflt=r.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:n({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}}),j=d({"src/components/fx/attributes.js"(t,e){var r=R(),n=B().hoverlabel,i=D().extendFlat;e.exports={hoverlabel:{bgcolor:i({},n.bgcolor,{arrayOk:!0}),bordercolor:i({},n.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:i({},n.align,{arrayOk:!0}),namelength:i({},n.namelength,{arrayOk:!0}),editType:"none"}}}}),N=d({"src/plots/attributes.js"(t,e){var r=R(),n=j();e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:r({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}}),U=d({"src/components/colorscale/scales.js"(t,e){var r=O(),n={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=n.RdBu;function a(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var n=0;n<t.length;n++){var i=t[n];if(2!==i.length||+i[0]<e||!r(i[1]).isValid())return!1;e=+i[0]}return!0}e.exports={scales:n,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"===typeof t&&(r(),"string"===typeof t&&r()),a(t)?t:e},isValid:function(t){return void 0!==n[t]||a(t)}}}}),V=d({"src/components/color/attributes.js"(t){t.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],t.defaultLine="#444",t.lightLine="#eee",t.background="#fff",t.borderLine="#BEC8D9",t.lightFraction=1e3/11}}),q=d({"src/components/color/index.js"(t,e){var r=O(),n=k(),i=M().isTypedArray,a=e.exports={},o=V();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function c(t){if(n(t)||"string"!==typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var i=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===i.length;if(!a&&3!==i.length)return t;for(var o=0;o<i.length;o++){if(!i[o].length)return t;if(i[o]=Number(i[o]),!(i[o]>=0))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(r(t))},a.opacity=function(t){return t?r(t).getAlpha():0},a.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var i=r(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(t,e,n){var i=r(t).toRgb(),a=r(e).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(t,e,n){var i=r(t);return 1!==i.getAlpha()&&(i=r(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:n?i.darken(n):s).toString()},a.stroke=function(t,e){var n=r(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=r(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"===typeof t){var e,r,n,o,s=Object.keys(t);for(e=0;e<s.length;e++)if(o=t[n=s[e]],"color"===n.substr(n.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=c(o[r]);else t[n]=c(o);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=c(o[r][1]));else if(Array.isArray(o)){var l=o[0];if(!Array.isArray(l)&&l&&"object"===typeof l)for(r=0;r<o.length;r++)a.clean(o[r])}else o&&"object"===typeof o&&!i(o)&&a.clean(o)}}}}),$=d({"src/constants/interactions.js"(t,e){e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),H=d({"src/lib/regex.js"(t){t.counter=function(t,e,r,n){var i=(e||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===t?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+t+"([2-9]|[1-9][0-9]+)?"+i)}}}),W=d({"src/lib/coerce.js"(t){var e=k(),r=O(),n=D().extendFlat,i=N(),a=U(),o=q(),s=$().DESELECTDIM,l=C(),c=H().counter,u=z().modHalf,h=M().isArrayOrTypedArray,d=M().isTypedArraySpec,p=M().decodeTypedArraySpec;function f(e,r){var n=t.valObjectMeta[r.valType];if(r.arrayOk&&h(e))return!0;if(n.validateFunction)return n.validateFunction(e,r);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(e,o,i,r),a!==i}t.valObjectMeta={data_array:{coerceFunction:function(t,e,r){e.set(h(t)?t:d(t)?p(t):r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,r,n,i){d(t)&&(t=p(t)),!e(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?r.set(n):r.set(+t)}},integer:{coerceFunction:function(t,r,n,i){-1===(i.extras||[]).indexOf(t)?(d(t)&&(t=p(t)),t%1||!e(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?r.set(n):r.set(+t)):r.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!==typeof t){var i="number"===typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,n){d(t)&&(t=p(t)),r(t).isValid()?e.set(t):e.set(n)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every((function(t){return r(t).isValid()}))?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,r){e.set(a.get(t,r))}},angle:{coerceFunction:function(t,r,n){d(t)&&(t=p(t)),"auto"===t?r.set("auto"):e(t)?r.set(u(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(r);"string"===typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"===typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"===typeof t){for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}else e.set(r);else e.set(t)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(d(t)?p(t):t)}},info_array:{coerceFunction:function(e,r,n,i){function a(e,r,n){var i,a={set:function(t){i=t}};return void 0===n&&(n=r.dflt),t.valObjectMeta[r.valType].coerceFunction(e,a,n,r),i}if(d(e)&&(e=p(e)),h(e)){var o,s,l,c,u,f,m=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(e)&&h(e[0]),g=i.items,y=[],v=Array.isArray(g),x=v&&m&&h(g[0]),b=m&&v&&!x,_=v&&!b?g.length:e.length;if(n=Array.isArray(n)?n:[],m)for(o=0;o<_;o++)for(y[o]=[],l=h(e[o])?e[o]:[],u=b?g.length:v?g[o].length:l.length,s=0;s<u;s++)c=b?g[s]:v?g[o][s]:g,void 0!==(f=a(l[s],c,(n[o]||[])[s]))&&(y[o][s]=f);else for(o=0;o<_;o++)void 0!==(f=a(e[o],v?g[o]:g,n[o]))&&(y[o]=f);r.set(y)}else r.set(n)},validateFunction:function(t,e){if(!h(t))return!1;var r=e.items,n=Array.isArray(r),i=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(i){if(!h(t[a])||!e.freeLength&&t[a].length!==r[a].length)return!1;for(var o=0;o<t[a].length;o++)if(!f(t[a][o],n?r[a][o]:r))return!1}else if(!f(t[a],n?r[a]:r))return!1;return!0}}},t.coerce=function(e,r,n,i,a){var o=l(n,i).get(),s=l(e,i),c=l(r,i),u=s.get(),m=r._template;if(void 0===u&&m&&(u=l(m,i).get(),m=0),void 0===a&&(a=o.dflt),o.arrayOk){if(h(u))return c.set(u),u;if(d(u))return u=p(u),c.set(u),u}var g=t.valObjectMeta[o.valType].coerceFunction;g(u,c,a,o);var y=c.get();return m&&y===a&&!f(u,o)&&(g(u=l(m,i).get(),c,a,o),y=c.get()),y},t.coerce2=function(e,r,n,i,a){var o=l(e,i),s=t.coerce(e,r,n,i,a),c=o.get();return void 0!==c&&null!==c&&s},t.coerceFont=function(t,e,r,i){i||(i={}),r=n({},r);var a={family:t(e+".family",(r=n(r,i.overrideDflt||{})).family),size:t(e+".size",r.size),color:t(e+".color",r.color),weight:t(e+".weight",r.weight),style:t(e+".style",r.style)};if(i.noFontVariant||(a.variant=t(e+".variant",r.variant)),i.noFontLineposition||(a.lineposition=t(e+".lineposition",r.lineposition)),i.noFontTextcase||(a.textcase=t(e+".textcase",r.textcase)),!i.noFontShadow){var o=r.shadow;"none"===o&&i.autoShadowDflt&&(o="auto"),a.shadow=t(e+".shadow",o)}return a},t.coercePattern=function(t,e,r,n){if(t(e+".shape")){t(e+".solidity"),t(e+".size");var i="overlay"===t(e+".fillmode");if(!n){var a=t(e+".bgcolor",i?r:void 0);t(e+".fgcolor",i?o.contrast(a):r)}t(e+".fgopacity",i?.5:1)}},t.coerceHoverinfo=function(e,r,n){var a,o=r._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return t.coerce(e,r,s,"hoverinfo",a)},t.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;void 0!==i&&(h(i)||t.selected||t.unselected||(r=i,n=s*i),e("selected.marker.opacity",r),e("unselected.marker.opacity",n))}},t.validate=f}}),G=d({"src/plot_api/plot_config.js"(t,e){var r={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},n={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(r,n),e.exports={configAttributes:r,dfltConfig:n}}}),Y=d({"src/lib/notifier.js"(t,e){var r=v(),n=k(),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var a=1e3;n(e)?a=e:"long"===e&&(a=3e3);var o=r.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(t){var n=r.select(this);n.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){n.transition().call(s)}));for(var i=n.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&i.append("br"),i.append("span").text(o[l]);"stick"===e?n.transition().duration(350).style("opacity",1):n.transition().duration(700).style("opacity",1).transition().delay(a).call(s)}))}function s(t){t.duration(700).style("opacity",0).each("end",(function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),r.select(this).remove()}))}}}}),Z=d({"src/lib/loggers.js"(t,e){var r=G().dfltConfig,n=Y(),i=e.exports={};i.log=function(){var t;if(r.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(r.notifyOnLogging>1){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"long")}},i.warn=function(){var t;if(r.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(r.notifyOnLogging>0){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"stick")}},i.error=function(){var t;if(r.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.error.apply(console,e)}if(r.notifyOnLogging>0){var i=[];for(t=0;t<arguments.length;t++)i.push(arguments[t]);n(i.join("<br>"),"stick")}}}}),X=d({"src/lib/noop.js"(t,e){e.exports=function(){}}}),K=d({"src/lib/push_unique.js"(t,e){e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}}}),J=d({"node_modules/gl-mat4/create.js"(t,e){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),Q=d({"node_modules/gl-mat4/clone.js"(t,e){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}}),tt=d({"node_modules/gl-mat4/copy.js"(t,e){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}}),et=d({"node_modules/gl-mat4/identity.js"(t,e){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),rt=d({"node_modules/gl-mat4/transpose.js"(t,e){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}}}),nt=d({"node_modules/gl-mat4/invert.js"(t,e){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-d*f,A=u*y-p*f,M=h*g-d*m,C=h*y-p*m,E=d*y-p*g,L=v*E-x*C+b*M+_*A-w*S+k*T;return L?(L=1/L,t[0]=(s*E-l*C+c*M)*L,t[1]=(i*C-n*E-a*M)*L,t[2]=(m*k-g*w+y*_)*L,t[3]=(d*w-h*k-p*_)*L,t[4]=(l*A-o*E-c*S)*L,t[5]=(r*E-i*A+a*S)*L,t[6]=(g*b-f*k-y*x)*L,t[7]=(u*k-d*b+p*x)*L,t[8]=(o*C-s*A+c*T)*L,t[9]=(n*A-r*C-a*T)*L,t[10]=(f*w-m*b+y*v)*L,t[11]=(h*b-u*w-p*v)*L,t[12]=(s*S-o*M-l*T)*L,t[13]=(r*M-n*S+i*T)*L,t[14]=(m*x-f*_-g*v)*L,t[15]=(u*_-h*x+d*v)*L,t):null}}}),it=d({"node_modules/gl-mat4/adjoint.js"(t,e){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15];return t[0]=s*(d*y-p*g)-h*(l*y-c*g)+m*(l*p-c*d),t[1]=-(n*(d*y-p*g)-h*(i*y-a*g)+m*(i*p-a*d)),t[2]=n*(l*y-c*g)-s*(i*y-a*g)+m*(i*c-a*l),t[3]=-(n*(l*p-c*d)-s*(i*p-a*d)+h*(i*c-a*l)),t[4]=-(o*(d*y-p*g)-u*(l*y-c*g)+f*(l*p-c*d)),t[5]=r*(d*y-p*g)-u*(i*y-a*g)+f*(i*p-a*d),t[6]=-(r*(l*y-c*g)-o*(i*y-a*g)+f*(i*c-a*l)),t[7]=r*(l*p-c*d)-o*(i*p-a*d)+u*(i*c-a*l),t[8]=o*(h*y-p*m)-u*(s*y-c*m)+f*(s*p-c*h),t[9]=-(r*(h*y-p*m)-u*(n*y-a*m)+f*(n*p-a*h)),t[10]=r*(s*y-c*m)-o*(n*y-a*m)+f*(n*c-a*s),t[11]=-(r*(s*p-c*h)-o*(n*p-a*h)+u*(n*c-a*s)),t[12]=-(o*(h*g-d*m)-u*(s*g-l*m)+f*(s*d-l*h)),t[13]=r*(h*g-d*m)-u*(n*g-i*m)+f*(n*d-i*h),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+f*(n*l-i*s)),t[15]=r*(s*d-l*h)-o*(n*d-i*h)+u*(n*l-i*s),t}}}),at=d({"node_modules/gl-mat4/determinant.js"(t,e){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-d*m)-(e*s-n*a)*(u*g-d*f)+(e*l-i*a)*(u*m-h*f)+(r*s-n*o)*(c*g-d*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*f-u*p)}}}),ot=d({"node_modules/gl-mat4/multiply.js"(t,e){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*d+w*g,t[2]=x*a+b*c+_*p+w*y,t[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*d+w*g,t[6]=x*a+b*c+_*p+w*y,t[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*d+w*g,t[10]=x*a+b*c+_*p+w*y,t[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*d+w*g,t[14]=x*a+b*c+_*p+w*y,t[15]=x*o+b*u+_*f+w*v,t}}}),st=d({"node_modules/gl-mat4/translate.js"(t,e){e.exports=function(t,e,r){var n,i,a,o,s,l,c,u,h,d,p,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+d*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+f*y+e[15]),t}}}),lt=d({"node_modules/gl-mat4/scale.js"(t,e){e.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}}),ct=d({"node_modules/gl-mat4/rotate.js"(t,e){e.exports=function(t,e,r,n){var i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M,C=n[0],E=n[1],L=n[2],P=Math.sqrt(C*C+E*E+L*L);return Math.abs(P)<1e-6?null:(C*=P=1/P,E*=P,L*=P,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],c=e[2],u=e[3],h=e[4],d=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],x=C*C*o+a,b=E*C*o+L*i,_=L*C*o-E*i,w=C*E*o-L*i,k=E*E*o+a,T=L*E*o+C*i,S=C*L*o+E*i,A=E*L*o-C*i,M=L*L*o+a,t[0]=s*x+h*b+m*_,t[1]=l*x+d*b+g*_,t[2]=c*x+p*b+y*_,t[3]=u*x+f*b+v*_,t[4]=s*w+h*k+m*T,t[5]=l*w+d*k+g*T,t[6]=c*w+p*k+y*T,t[7]=u*w+f*k+v*T,t[8]=s*S+h*A+m*M,t[9]=l*S+d*A+g*M,t[10]=c*S+p*A+y*M,t[11]=u*S+f*A+v*M,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}}}),ut=d({"node_modules/gl-mat4/rotateX.js"(t,e){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+d*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=d*i-l*n,t}}}),ht=d({"node_modules/gl-mat4/rotateY.js"(t,e){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-h*n,t[3]=l*i-d*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+h*i,t[11]=l*n+d*i,t}}}),dt=d({"node_modules/gl-mat4/rotateZ.js"(t,e){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+d*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=d*i-l*n,t}}}),pt=d({"node_modules/gl-mat4/fromRotation.js"(t,e){e.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);return Math.abs(c)<1e-6?null:(o*=c=1/c,s*=c,l*=c,n=Math.sin(e),i=Math.cos(e),a=1-i,t[0]=o*o*a+i,t[1]=s*o*a+l*n,t[2]=l*o*a-s*n,t[3]=0,t[4]=o*s*a-l*n,t[5]=s*s*a+i,t[6]=l*s*a+o*n,t[7]=0,t[8]=o*l*a+s*n,t[9]=s*l*a-o*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}}}),ft=d({"node_modules/gl-mat4/fromRotationTranslation.js"(t,e){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,d=n*c,p=i*l,f=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return t[0]=1-(p+m),t[1]=h+v,t[2]=d-y,t[3]=0,t[4]=h-v,t[5]=1-(u+m),t[6]=f+g,t[7]=0,t[8]=d+y,t[9]=f-g,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}}}),mt=d({"node_modules/gl-mat4/fromScaling.js"(t,e){e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),gt=d({"node_modules/gl-mat4/fromTranslation.js"(t,e){e.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}}}),yt=d({"node_modules/gl-mat4/fromXRotation.js"(t,e){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),vt=d({"node_modules/gl-mat4/fromYRotation.js"(t,e){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),xt=d({"node_modules/gl-mat4/fromZRotation.js"(t,e){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),bt=d({"node_modules/gl-mat4/fromQuat.js"(t,e){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,d=i*o,p=i*s,f=i*l,m=a*o,g=a*s,y=a*l;return t[0]=1-h-f,t[1]=u+y,t[2]=d-g,t[3]=0,t[4]=u-y,t[5]=1-c-f,t[6]=p+m,t[7]=0,t[8]=d+g,t[9]=p-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),_t=d({"node_modules/gl-mat4/frustum.js"(t,e){e.exports=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t}}}),wt=d({"node_modules/gl-mat4/perspective.js"(t,e){e.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}}}),kt=d({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(t,e){e.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}}}),Tt=d({"node_modules/gl-mat4/ortho.js"(t,e){e.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t}}}),St=d({"node_modules/gl-mat4/lookAt.js"(t,e){var r=et();e.exports=function(t,e,n,i){var a,o,s,l,c,u,h,d,p,f,m=e[0],g=e[1],y=e[2],v=i[0],x=i[1],b=i[2],_=n[0],w=n[1],k=n[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?r(t):(h=m-_,d=g-w,p=y-k,f=1/Math.sqrt(h*h+d*d+p*p),a=x*(p*=f)-b*(d*=f),o=b*(h*=f)-v*p,s=v*d-x*h,(f=Math.sqrt(a*a+o*o+s*s))?(a*=f=1/f,o*=f,s*=f):(a=0,o=0,s=0),l=d*s-p*o,c=p*a-h*s,u=h*o-d*a,(f=Math.sqrt(l*l+c*c+u*u))?(l*=f=1/f,c*=f,u*=f):(l=0,c=0,u=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=d,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+c*g+u*y),t[14]=-(h*m+d*g+p*y),t[15]=1,t)}}}),At=d({"node_modules/gl-mat4/str.js"(t,e){e.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}}}),Mt=d({"node_modules/gl-mat4/index.js"(t,e){e.exports={create:J(),clone:Q(),copy:tt(),identity:et(),transpose:rt(),invert:nt(),adjoint:it(),determinant:at(),multiply:ot(),translate:st(),scale:lt(),rotate:ct(),rotateX:ut(),rotateY:ht(),rotateZ:dt(),fromRotation:pt(),fromRotationTranslation:ft(),fromScaling:mt(),fromTranslation:gt(),fromXRotation:yt(),fromYRotation:vt(),fromZRotation:xt(),fromQuat:bt(),frustum:_t(),perspective:wt(),perspectiveFromFieldOfView:kt(),ortho:Tt(),lookAt:St(),str:At()}}}),Ct=d({"src/lib/matrix.js"(t){var e=Mt();t.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},t.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},t.dot=function(e,r){if(!e.length||!r.length||e.length!==r.length)return null;var n,i,a=e.length;if(e[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=t.dot(e[i],r);else if(r[0].length){var o=t.transposeRagged(r);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=t.dot(e,o[i])}else for(n=0,i=0;i<a;i++)n+=e[i]*r[i];return n},t.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},t.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},t.rotationXYMatrix=function(e,r,n){return t.dot(t.dot(t.translationMatrix(r,n),t.rotationMatrix(e)),t.translationMatrix(-r,-n))},t.apply3DTransform=function(e){return function(){var r=arguments,n=1===arguments.length?r[0]:[r[0],r[1],r[2]||0];return t.dot(e,[n[0],n[1],n[2],1]).slice(0,3)}},t.apply2DTransform=function(e){return function(){var r=arguments;3===r.length&&(r=r[0]);var n=1===arguments.length?r[0]:[r[0],r[1]];return t.dot(e,[n[0],n[1],1]).slice(0,2)}},t.apply2DTransform2=function(e){var r=t.apply2DTransform(e);return function(t){return r(t.slice(0,2)).concat(r(t.slice(2,4)))}},t.convertCssMatrix=function(t){if(t){var e=t.length;if(16===e)return t;if(6===e)return[t[0],t[1],0,0,t[2],t[3],0,0,0,0,1,0,t[4],t[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.inverseTransformMatrix=function(t){var r=[];return e.invert(r,t),[[r[0],r[1],r[2],r[3]],[r[4],r[5],r[6],r[7]],[r[8],r[9],r[10],r[11]],[r[12],r[13],r[14],r[15]]]}}}),Et=d({"src/lib/dom.js"(t,e){var r=v(),n=Z(),i=Ct(),a=Mt();function o(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function s(t,e,r){var i="plotly.js-style-"+t,a=document.getElementById(i);if(!a||!a.matches(".no-inline-styles")){a||((a=document.createElement("style")).setAttribute("id",i),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o?o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):n.warn("addStyleRule failed"):n.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function l(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(t){return+t}))}function c(t){for(var e=[];u(t);)e.push(t),t=t.parentNode,"function"===typeof ShadowRoot&&t instanceof ShadowRoot&&(t=t.host);return e}function u(t){return t&&(t instanceof Element||t instanceof HTMLElement)}e.exports={getGraphDiv:function(t){var e;if("string"===typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=r.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:o,addStyleRule:function(t,e){s("global",t,e)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&o(r)},setStyleOnHover:function(t,e,r,n,i,a){var o=n.split(":"),s=i.split(":"),l="data-btn-style-event-added";a||(a=document),a.querySelectorAll(t).forEach((function(t){t.getAttribute(l)||(t.addEventListener("mouseenter",(function(){var t=this.querySelector(r);t&&(t.style[o[0]]=o[1])})),t.addEventListener("mouseleave",(function(){var t=this.querySelector(r);t&&(e&&this.matches(e)?t.style[o[0]]=o[1]:t.style[s[0]]=s[1])})),t.setAttribute(l,!0))}))},getFullTransformMatrix:function(t){var e=c(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(t){var e=l(t);if(e){var n=i.convertCssMatrix(e);r=a.multiply(r,r,n)}})),r},getElementTransformMatrix:l,getElementAndAncestors:c,equalDomRects:function(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}}}),Lt=d({"src/plots/animation_attributes.js"(t,e){e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}}),Pt=d({"src/plot_api/edit_types.js"(t,e){var r=D().extendFlat,n=A(),i={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},a={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},o=i.flags.slice().concat(["fullReplot"]),s=a.flags.slice().concat("layoutReplot");function l(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function c(t,e,i){var a=r({},t);for(var o in a){var s=a[o];n(s)&&(a[o]=u(s,e,0,o))}return"from-root"===i&&(a.editType=e),a}function u(t,e,n,i){if(t.valType){var a=r({},t);if(a.editType=e,Array.isArray(t.items)){a.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)a.items[o]=u(t.items[o],e)}return a}return c(t,e,"_"===i.charAt(0)?"nested":"from-root")}e.exports={traces:i,layout:a,traceFlags:function(){return l(o)},layoutFlags:function(){return l(s)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:c}}}),It=d({"src/components/drawing/attributes.js"(t){t.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},t.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}}),zt=d({"src/constants/docs.js"(t,e){e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}}),Ot=d({"src/plots/template_attributes.js"(t){var e=zt();function r(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],i=0;i<r.length;i++)n[i]="`"+r[i]+"`";e+="Finally, the template string has access to ",e=1===r.length?e+"variable "+n[0]:e+"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}e.FORMAT_LINK,e.DATE_FORMAT_LINK,t.hovertemplateAttrs=function(t,e){t=t||{},r(e=e||{});var n={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(n.arrayOk=!0),n},t.texttemplateAttrs=function(t,e){t=t||{},r(e=e||{});var n={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(n.arrayOk=!0),n},t.shapeTexttemplateAttrs=function(t,e){return e=e||{},(t=t||{}).newshape,r(e),{valType:"string",dflt:"",editType:t.editType||"arraydraw"}}}}),Dt=d({"src/components/shapes/label_texttemplate.js"(t,e){function r(t,e){return e?e.d2l(t):t}function n(t,e){return e?e.l2d(t):t}function i(t){return t.x0shift||0}function a(t){return t.x1shift||0}function o(t){return t.y0shift||0}function s(t){return t.y1shift||0}function l(t,e){return r(t.x1,e)+a(t)-r(t.x0,e)-i(t)}function c(t,e,n){return r(t.y1,n)+s(t)-r(t.y0,n)-o(t)}e.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return"line"!==t.type?void 0:c(t,0,r)/l(t,e)},dx:l,dy:c,width:function(t,e){return Math.abs(l(t,e))},height:function(t,e,r){return Math.abs(c(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(l(t,e),2)+Math.pow(c(t,0,r),2))},xcenter:function(t,e){return n((r(t.x1,e)+a(t)+r(t.x0,e)+i(t))/2,e)},ycenter:function(t,e,i){return n((r(t.y1,i)+s(t)+r(t.y0,i)+o(t))/2,i)}}}}),Rt=d({"src/components/shapes/draw_newshape/attributes.js"(t,e){var r=Pt().overrideAll,n=N(),i=R(),a=It().dash,o=D().extendFlat,s=Ot().shapeTexttemplateAttrs,l=Dt();e.exports=r({newshape:{visible:o({},n.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:o({},n.legend,{}),legendgroup:o({},n.legendgroup,{}),legendgrouptitle:{text:o({},n.legendgrouptitle.text,{}),font:i({})},legendrank:o({},n.legendrank,{}),legendwidth:o({},n.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:o({},a,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:o({},n.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:s({newshape:!0},{keys:Object.keys(l)}),font:i({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)"},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),Ft=d({"src/components/selections/draw_newselection/attributes.js"(t,e){var r=It().dash,n=D().extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:n({},r,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),Bt=d({"src/plots/pad_attributes.js"(t,e){e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}}}),jt=d({"src/plots/layout_attributes.js"(t,e){var r=R(),n=Lt(),i=V(),a=Rt(),o=Ft(),s=Bt(),l=D().extendFlat,c=r({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,e.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:a.newshape,activeshape:a.activeshape,newselection:o.newselection,activeselection:o.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},n.transition,{editType:"none"})}}}),Nt=h({"temp_stylePlugin:node_modules/maplibre-gl/dist/maplibre-gl.css"(){}}),Ut=h({"stylePlugin:/Users/ekl/code/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"(){Nt()}}),Vt=d({"src/registry.js"(t){var e=Z(),r=X(),n=K(),i=A(),a=Et().addStyleRule,o=D(),s=N(),l=jt(),c=o.extendFlat,u=o.extendDeepAll;function h(r){var n=r.name,i=r.categories,o=r.meta;if(t.modules[n])e.log("Type "+n+" already registered");else{t.subplotsRegistry[r.basePlotModule.name]||function(r){var n=r.name;if(t.subplotsRegistry[n])e.log("Plot type "+n+" already registered.");else for(var i in m(r),t.subplotsRegistry[n]=r,t.componentsRegistry)y(i,r.name)}(r.basePlotModule);for(var s={},l=0;l<i.length;l++)s[i[l]]=!0,t.allCategories[i[l]]=!0;for(var u in t.modules[n]={_module:r,categories:s},o&&Object.keys(o).length&&(t.modules[n].meta=o),t.allTypes.push(n),t.componentsRegistry)g(u,n);r.layoutAttributes&&c(t.traceLayoutAttributes,r.layoutAttributes);var h=r.basePlotModule,d=h.name;if("mapbox"===d){var p=h.constants.styleRules;for(var f in p)a(".js-plotly-plot .plotly .mapboxgl-"+f,p[f])}"map"===d&&Ut(),"geo"!==d&&"mapbox"!==d&&"map"!==d||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function d(e){if("string"!==typeof e.name)throw new Error("Component module *name* must be a string.");var r=e.name;for(var i in t.componentsRegistry[r]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&n(t.layoutArrayContainers,r),m(e)),t.modules)g(r,i);for(var a in t.subplotsRegistry)y(r,a);e.schema&&e.schema.layout&&u(l,e.schema.layout)}function p(t){if("string"!==typeof t.name)throw new Error("Transform module *name* must be a string.");var r="Transform module "+t.name,n="function"===typeof t.transform,a="function"===typeof t.calcTransform;if(!n&&!a)throw new Error(r+" is missing a *transform* or *calcTransform* method.");n&&a&&e.log([r+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i(t.attributes)||e.log(r+" registered without an *attributes* object."),"function"!==typeof t.supplyDefaults&&e.log(r+" registered without a *supplyDefaults* method.")}function f(e){var r=e.name,n=r.split("-")[0],i=e.dictionary,a=e.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=t.localeRegistry,c=l[r];if(c||(l[r]=c={}),n!==r){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=i),s&&u.format===c.format&&(u.format=a)}o&&(c.dictionary=i),s&&(c.format=a)}function m(e){if(e.layoutAttributes){var r=e.layoutAttributes._arrayAttrRegexps;if(r)for(var i=0;i<r.length;i++)n(t.layoutArrayRegexes,r[i])}}function g(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.traces){var i=n.traces[r];i&&u(t.modules[r]._module.attributes,i)}}function y(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.subplots){var i=t.subplotsRegistry[r],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&u(a,s)}}function v(t){return"object"===typeof t&&(t=t.type),t}t.modules={},t.allCategories={},t.allTypes=[],t.subplotsRegistry={},t.componentsRegistry={},t.layoutArrayContainers=[],t.layoutArrayRegexes=[],t.traceLayoutAttributes={},t.localeRegistry={},t.apiMethodRegistry={},t.collectableSubplotTypes=null,t.register=function(e){if(t.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var r=0;r<e.length;r++){var n=e[r];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":p(n);break;case"component":d(n);break;case"locale":f(n);break;case"apiMethod":var i=n.name;t.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},t.getModule=function(e){var r=t.modules[v(e)];return!!r&&r._module},t.traceIs=function(r,n){if("various"===(r=v(r)))return!1;var i=t.modules[r];return i||(r&&e.log("Unrecognized trace type "+r+"."),i=t.modules[s.type.dflt]),!!i.categories[n]},t.getComponentMethod=function(e,n){var i=t.componentsRegistry[e];return i&&i[n]||r},t.call=function(){var e=arguments[0],r=[].slice.call(arguments,1);return t.apiMethodRegistry[e].apply(null,r)}}}),qt=d({"src/lib/dates.js"(t){var e,r,n=b().timeFormat,i=k(),a=Z(),o=z().mod,s=T(),l=s.BADNUM,c=s.ONEDAY,u=s.ONEHOUR,h=s.ONEMIN,d=s.ONESEC,p=s.EPOCHJD,f=Vt(),m=b().utcFormat,g=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,v=(new Date).getFullYear()-70;function x(t){return t&&f.componentsRegistry.calendars&&"string"===typeof t&&"gregorian"!==t}function _(t,e){return String(t+Math.pow(10,e)).substr(1)}t.dateTick0=function(e,r){var n=function(t,e){return x(t)?e?f.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:f.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(e,!!r);if(r<2)return n;var i=t.dateTime2ms(n,e);return i+=c*(r-1),t.ms2DateTime(i,0,e)},t.dfltRange=function(t){return x(t)?f.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},t.isJSDate=function(t){return"object"===typeof t&&null!==t&&"function"===typeof t.getTime},t.dateTime2ms=function(n,i){if(t.isJSDate(n)){var a=n.getTimezoneOffset()*h,s=(n.getUTCMinutes()-n.getMinutes())*h+(n.getUTCSeconds()-n.getSeconds())*d+(n.getUTCMilliseconds()-n.getMilliseconds());if(s){var m=3*h;a=a-m/2+o(s-a+m/2,m)}return(n=Number(n)-a)>=e&&n<=r?n:l}if("string"!==typeof n&&"number"!==typeof n)return l;n=String(n);var b=x(i),_=n.charAt(0);!b||"G"!==_&&"g"!==_||(n=n.substr(1),i="");var w=b&&"chinese"===i.substr(0,7),k=n.match(w?y:g);if(!k)return l;var T=k[1],S=k[3]||"1",A=Number(k[5]||1),M=Number(k[7]||0),C=Number(k[9]||0),E=Number(k[11]||0);if(b){if(2===T.length)return l;var L;T=Number(T);try{var P=f.getComponentMethod("calendars","getCal")(i);if(w){var I="i"===S.charAt(S.length-1);S=parseInt(S,10),L=P.newDate(T,P.toMonthIndex(T,S,I),A)}else L=P.newDate(T,Number(S),A)}catch(O){return l}return L?(L.toJD()-p)*c+M*u+C*h+E*d:l}T=2===T.length?(Number(T)+2e3-v)%100+v:Number(T),S-=1;var z=new Date(Date.UTC(2e3,S,A,M,C));return z.setUTCFullYear(T),z.getUTCMonth()!==S||z.getUTCDate()!==A?l:z.getTime()+E*d},e=t.MIN_MS=t.dateTime2ms("-9999"),r=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==l};var w=90*c,S=3*u,A=5*h;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+_(e,2)+":"+_(r,2),(n||i)&&(t+=":"+_(n,2),i))){for(var a=4;i%10===0;)a-=1,i/=10;t+="."+_(i,a)}return t}t.ms2DateTime=function(t,n,i){if("number"!==typeof t||!(t>=e&&t<=r))return l;n||(n=0);var a,s,g,y,v,b,_=Math.floor(10*o(t+.05,1)),k=Math.round(t-_/10);if(x(i)){var T=Math.floor(k/c)+p,C=Math.floor(o(t,c));try{a=f.getComponentMethod("calendars","getCal")(i).fromJD(T).formatDate("yyyy-mm-dd")}catch(E){a=m("G%Y-%m-%d")(new Date(k))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n<w?Math.floor(C/u):0,g=n<w?Math.floor(C%u/h):0,y=n<S?Math.floor(C%h/d):0,v=n<A?C%d*10+_:0}else b=new Date(k),a=m("%Y-%m-%d")(b),s=n<w?b.getUTCHours():0,g=n<w?b.getUTCMinutes():0,y=n<S?b.getUTCSeconds():0,v=n<A?10*b.getUTCMilliseconds()+_:0;return M(a,s,g,y,v)},t.ms2DateTimeLocal=function(t){if(!(t>=e+c&&t<=r-c))return l;var i=Math.floor(10*o(t+.05,1)),a=new Date(Math.round(t-i/10));return M(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},t.cleanDate=function(e,r,n){if(e===l)return r;if(t.isJSDate(e)||"number"===typeof e&&isFinite(e)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return a.error("unrecognized date",e),r;return e};var C=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function P(t,e,r,n){t=t.replace(C,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),x(n))try{t=f.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(a){return"Invalid"}return r(t)(i)}var I=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,e,r,n,a,s){if(a=x(a)&&a,!e)if("y"===r)e=s.year;else if("m"===r)e=s.month;else{if("d"!==r)return function(t,e){var r=o(t+.05,c),n=_(Math.floor(r/u),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(o(t/d,60),I[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+P(s.dayMonthYear,t,n,a);e=s.dayMonth+"\n"+s.year}return P(e,t,n,a)};var O=3*c;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,c);if(t=Math.round(t-n),r)try{var i=Math.round(t/c)+p,s=f.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return e%12?s.add(l,e,"m"):s.add(l,e/12,"y"),(l.toJD()-p)*c+n}catch(h){a.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+O);return u.setUTCMonth(u.getUTCMonth()+e)+n-O},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,u=x(e)&&f.getComponentMethod("calendars","getCal")(e),h=0;h<t.length;h++)if(n=t[h],i(n)){if(!(n%c))if(u)try{1===(r=u.fromJD(n/c+p)).day()?1===r.month()?a++:o++:s++}catch(m){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var d=t.length-l;return{exactYears:a/d,exactMonths:o/d,exactDays:s/d}}}}),$t=d({"src/lib/identity.js"(t,e){e.exports=function(t){return t}}}),Ht=d({"src/lib/search.js"(t){var e=k(),r=Z(),n=$t(),i=T().BADNUM,a=1e-9;function o(t,e){return t<e}function s(t,e){return t<=e}function l(t,e){return t>e}function c(t,e){return t>=e}t.findBin=function(t,n,i){if(e(n.start))return i?Math.ceil((t-n.start)/n.size-a)-1:Math.floor((t-n.start)/n.size+a);var u,h,d=0,p=n.length,f=0,m=p>1?(n[p-1]-n[0])/(p-1):1;for(h=m>=0?i?o:s:i?c:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);d<p&&f++<100;)h(n[u=Math.floor((d+p)/2)],t)?d=u+1:p=u;return f>90&&r.log("Long binary search..."),d-1},t.sorterAsc=function(t,e){return t-e},t.sorterDes=function(t,e){return e-t},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},t.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=c((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]},t.sort=function(t,e){for(var r=0,n=0,i=1;i<t.length;i++){var a=e(t[i],t[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},t.findIndexOfMin=function(t,e){e=e||n;for(var r,i=1/0,a=0;a<t.length;a++){var o=e(t[a]);o<i&&(i=o,r=a)}return r}}}),Wt=d({"src/lib/sort_object_keys.js"(t,e){e.exports=function(t){return Object.keys(t).sort()}}}),Gt=d({"src/lib/stats.js"(t){var e=k(),r=M().isArrayOrTypedArray;t.aggNums=function(n,i,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),e(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=t.aggNums(n,i,a[s]);a=l}for(s=0;s<o;s++)e(i)?e(a[s])&&(i=n(+i,+a[s])):i=a[s];return i},t.len=function(e){return t.aggNums((function(t){return t+1}),0,e)},t.mean=function(e,r){return r||(r=t.len(e)),t.aggNums((function(t,e){return t+e}),0,e)/r},t.geometricMean=function(e,r){return r||(r=t.len(e)),Math.pow(t.aggNums((function(t,e){return t*e}),1,e),1/r)},t.midRange=function(e){if(void 0!==e&&0!==e.length)return(t.aggNums(Math.max,null,e)+t.aggNums(Math.min,null,e))/2},t.variance=function(r,n,i){return n||(n=t.len(r)),e(i)||(i=t.mean(r,n)),t.aggNums((function(t,e){return t+Math.pow(e-i,2)}),0,r)/n},t.stdev=function(e,r,n){return Math.sqrt(t.variance(e,r,n))},t.median=function(e){var r=e.slice().sort();return t.interp(r,.5)},t.interp=function(t,r){if(!e(r))throw"n should be a finite number";if((r=r*t.length-.5)<0)return t[0];if(r>t.length-1)return t[t.length-1];var n=r%1;return n*t[Math.ceil(r)]+(1-n)*t[Math.floor(r)]}}}),Yt=d({"src/lib/angles.js"(t,e){var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(t){return Math.abs(t[1]-t[0])>o-1e-14}function l(t,e){return i(e-t,o)}function c(t,e){if(s(e))return!0;var r,i;e[0]<e[1]?(r=e[0],i=e[1]):(r=e[1],i=e[0]),(r=n(r,o))>(i=n(i,o))&&(i+=o);var a=n(t,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(t,e,r,n,i,l,c){i=i||0,l=l||0;var u,h,d,p,f,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(u=0,h=a,d=o):r<n?(u=r,d=n):(u=n,d=r),t<e?(p=t,f=e):(p=e,f=t);var y,v=Math.abs(d-u)<=a?0:1;function x(t,e,r){return"A"+[t,t]+" "+[0,v,r]+" "+g(t,e)}return m?y=null===p?"M"+g(f,u)+x(f,h,0)+x(f,d,0)+"Z":"M"+g(p,u)+x(p,h,0)+x(p,d,0)+"ZM"+g(f,u)+x(f,h,1)+x(f,d,1)+"Z":null===p?(y="M"+g(f,u)+x(f,d,0),c&&(y+="L0,0Z")):y="M"+g(p,u)+"L"+g(f,u)+x(f,d,0)+"L"+g(p,d)+x(p,u,1)+"Z",y}e.exports={deg2rad:function(t){return t/180*a},rad2deg:function(t){return t/a*180},angleDelta:l,angleDist:function(t,e){return Math.abs(l(t,e))},isFullCircle:s,isAngleInsideSector:c,isPtInsideSector:function(t,e,r,n){return!!c(e,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),t>=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return u(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return u(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return u(t,e,r,n,i,a,1)}}}}),Zt=d({"src/lib/anchor_utils.js"(t){t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}}),Xt=d({"src/lib/geometry2d.js"(t){var e,r,n,i=z().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,h=n-e,d=a-e,p=s-a,f=l*p-u*h;if(0===f)return null;var m=(c*p-u*d)/f,g=(c*h-l*d)/f;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function o(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}t.segmentsIntersect=a,t.segmentDistance=function(t,e,r,n,i,s,l,c){if(a(t,e,r,n,i,s,l,c))return 0;var u=r-t,h=n-e,d=l-i,p=c-s,f=u*u+h*h,m=d*d+p*p,g=Math.min(o(u,h,f,i-t,s-e),o(u,h,f,l-t,c-e),o(d,p,m,t-i,e-s),o(d,p,m,r-i,n-s));return Math.sqrt(g)},t.getTextLocation=function(t,a,o,s){if(t===r&&s===n||(e={},r=t,n=s),e[o])return e[o];var l=t.getPointAtLength(i(o-s/2,a)),c=t.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(i(o,a)),d={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return e[o]=d,d},t.clearLocationCache=function(){r=null},t.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.x<a?a-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=d(c);p;){if((c+=p+r)>h)return;p=d(c)}for(p=d(h);p;){if(c>(h-=p+r))return;p=d(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,d=0,p=s;h<c;){if(i=(d+p)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;u*o>0?p=i:d=i,h++}return a}}}),Kt=d({"src/lib/throttle.js"(t){var e={};function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,i){var a=e[t],o=Date.now();if(!a){for(var s in e)e[s].ts<o-6e4&&delete e[s];a=e[t]={ts:0,timer:null}}function l(){i(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}r(a),o>a.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},t.done=function(t){var r=e[t];return r&&r.timer?new Promise((function(t){var e=r.onDone;r.onDone=function(){e&&e(),t(),r.onDone=null}})):Promise.resolve()},t.clear=function(n){if(n)r(e[n]),delete e[n];else for(var i in e)t.clear(i)}}}),Jt=d({"src/lib/clear_responsive.js"(t,e){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),Qt=d({"node_modules/is-mobile/index.js"(t,e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(t){t||(t={});let e=t.ua;if(e||"undefined"===typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"===typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!==typeof e)return!1;let a=r.test(e)&&!n.test(e)||!!t.tablet&&i.test(e);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(a=!0),a}}}),te=d({"src/lib/preserve_drawing_buffer.js"(t,e){var r=k(),n=Qt();e.exports=function(t){var e;if("string"!==typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;return"undefined"!==typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"===typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t}()))return!0;var i=n({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!i)for(var a=e.split(" "),o=1;o<a.length;o++)if(-1!==a[o].indexOf("Safari"))for(var s=o-1;s>-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return i}}}),ee=d({"src/lib/make_trace_groups.js"(t,e){var r=v();e.exports=function(t,e,n){var i=t.selectAll("g."+n.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=r.select(this)})),i}}}),re=d({"src/lib/localize.js"(t,e){var r=Vt();e.exports=function(t,e){for(var n=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return e}}}),ne=d({"src/lib/filter_unique.js"(t,e){e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}}}),ie=d({"src/lib/filter_visible.js"(t,e){function r(t){return!0===t.visible}function n(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,i=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?n:r),a=[],o=0;o<t.length;o++){var s=t[o];i(s)&&a.push(s)}return a}}}),ae=d({"src/lib/increment.js"(t,e){e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),oe=d({"src/lib/clean_number.js"(t,e){var r=k(),n=T().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"===typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}}),se=d({"src/lib/index.js"(t,e){var r=v(),n=b().utcFormat,i=_().format,a=k(),o=T(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=e.exports={};u.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};u.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,u.warn('encountered bad format: "'+e+'"'))},u.noFormat=function(t){return String(t)},u.numberFormat=function(t){var e;try{e=i(u.adjustFormat(t))}catch(r){return u.warnBadFormat(t),u.noFormat}return e},u.nestedProperty=C(),u.keyedContainer=E(),u.relativeAttr=L(),u.isPlainObject=A(),u.toLogRange=P(),u.relinkPrivateKeys=I();var d=M();u.isArrayBuffer=d.isArrayBuffer,u.isTypedArray=d.isTypedArray,u.isArrayOrTypedArray=d.isArrayOrTypedArray,u.isArray1D=d.isArray1D,u.ensureArray=d.ensureArray,u.concat=d.concat,u.maxRowLength=d.maxRowLength,u.minRowLength=d.minRowLength;var p=z();u.mod=p.mod,u.modHalf=p.modHalf;var f=W();u.valObjectMeta=f.valObjectMeta,u.coerce=f.coerce,u.coerce2=f.coerce2,u.coerceFont=f.coerceFont,u.coercePattern=f.coercePattern,u.coerceHoverinfo=f.coerceHoverinfo,u.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,u.validate=f.validate;var m=qt();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Ht();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=Wt();var y=Gt();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var x=Ct();u.init2dArray=x.init2dArray,u.transposeRagged=x.transposeRagged,u.dot=x.dot,u.translationMatrix=x.translationMatrix,u.rotationMatrix=x.rotationMatrix,u.rotationXYMatrix=x.rotationXYMatrix,u.apply3DTransform=x.apply3DTransform,u.apply2DTransform=x.apply2DTransform,u.apply2DTransform2=x.apply2DTransform2,u.convertCssMatrix=x.convertCssMatrix,u.inverseTransformMatrix=x.inverseTransformMatrix;var w=Yt();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var S=Zt();u.isLeftAnchor=S.isLeftAnchor,u.isCenterAnchor=S.isCenterAnchor,u.isRightAnchor=S.isRightAnchor,u.isTopAnchor=S.isTopAnchor,u.isMiddleAnchor=S.isMiddleAnchor,u.isBottomAnchor=S.isBottomAnchor;var O=Xt();u.segmentsIntersect=O.segmentsIntersect,u.segmentDistance=O.segmentDistance,u.getTextLocation=O.getTextLocation,u.clearLocationCache=O.clearLocationCache,u.getVisibleSegment=O.getVisibleSegment,u.findPointOnPath=O.findPointOnPath;var R=D();u.extendFlat=R.extendFlat,u.extendDeep=R.extendDeep,u.extendDeepAll=R.extendDeepAll,u.extendDeepNoArrays=R.extendDeepNoArrays;var F=Z();u.log=F.log,u.warn=F.warn,u.error=F.error;var B=H();u.counterRegex=B.counter;var j=Kt();u.throttle=j.throttle,u.throttleDone=j.done,u.clearThrottle=j.clear;var N=Et();function U(t){var e={};for(var r in t)for(var n=t[r],i=0;i<n.length;i++)e[n[i]]=+r;return e}u.getGraphDiv=N.getGraphDiv,u.isPlotDiv=N.isPlotDiv,u.removeElement=N.removeElement,u.addStyleRule=N.addStyleRule,u.addRelatedStyleRule=N.addRelatedStyleRule,u.deleteRelatedStyleRule=N.deleteRelatedStyleRule,u.setStyleOnHover=N.setStyleOnHover,u.getFullTransformMatrix=N.getFullTransformMatrix,u.getElementTransformMatrix=N.getElementTransformMatrix,u.getElementAndAncestors=N.getElementAndAncestors,u.equalDomRects=N.equalDomRects,u.clearResponsive=Jt(),u.preserveDrawingBuffer=te(),u.makeTraceGroups=ee(),u._=re(),u.notifier=Y(),u.filterUnique=ne(),u.filterVisible=ie(),u.pushUnique=K(),u.increment=ae(),u.cleanNumber=oe(),u.ensureNumber=function(t){return a(t)?(t=Number(t))>s||t<l?c:t:c},u.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&a(t)&&t>=0&&t%1===0},u.noop=X(),u.identity=$t(),u.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},u.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;i<e.length;i++){var a=e[i],o=u.nestedProperty(t,a.replace("?",r)),s=u.nestedProperty(t,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(t){t.parentNode.appendChild(t)},u.cancelTransition=function(t){return t.transition().duration(0)},u.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s<a;s++)o[s]=e(t[s],r,n,i);return o},u.randstr=function t(e,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var h=parseInt(l,n);return e&&e[l]||h!==1/0&&h>=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(t,e,r){var n;function i(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)void 0!==(i=t[r[n]])&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},u.mergeArray=function(t,e,r,n){var i="function"===typeof n;if(u.isArrayOrTypedArray(t))for(var a=Math.min(t.length,e.length),o=0;o<a;o++){var s=t[o];e[o][r]=i?n(s):s}},u.mergeArrayCastPositive=function(t,e,r){return u.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},u.castOption=function(t,e,r,n){n=n||u.identity;var i=u.nestedProperty(t,r).get();return u.isArrayOrTypedArray(i)?Array.isArray(e)&&u.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},u.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=u.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},u.tagSelected=function(t,e,r){var n,i,a=e.selectedpoints,o=e._indexToPoints;o&&(n=U(o));for(var s=0;s<a.length;s++){var l=a[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,h=r?r[c]:c;void 0!==(i=h)&&i<t.length&&(t[h].selected=1)}}},u.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=U(r),i=[],a=0;a<e.length;a++){var o=e[a];if(u.isIndex(o)){var s=n[o];u.isIndex(s)&&i.push(s)}}return i}return e},u.getTargetArray=function(t,e){var r=e.target;if("string"===typeof r&&r){var n=u.nestedProperty(t,r).get();return!!u.isArrayOrTypedArray(n)&&n}return!!u.isArrayOrTypedArray(r)&&r},u.minExtend=function t(e,r,n){var i={};"object"!==typeof r&&(r={});var a,o,s,l="pieLike"===n?-1:3,c=Object.keys(e);for(a=0;a<c.length;a++)s=e[o=c[a]],"_"!==o.charAt(0)&&"function"!==typeof s&&("module"===o?i[o]=s:Array.isArray(s)?i[o]="colorscale"===o||-1===l?s.slice():s.slice(0,l):u.isTypedArray(s)?i[o]=-1===l?s.subarray():s.subarray(0,l):i[o]=s&&"object"===typeof s?t(e[o],r[o],n):s);for(c=Object.keys(r),a=0;a<c.length;a++)"object"===typeof(s=r[o=c[a]])&&o in i&&"object"===typeof i[o]||(i[o]=s);return i},u.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},u.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1};var V=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return V.test(window.navigator.userAgent)};var q=/iPad|iPhone|iPod/;u.isIOS=function(){return q.test(window.navigator.userAgent)};var $=/Firefox\/(\d+)\.\d+/;u.getFirefoxVersion=function(){var t=$.exec(window.navigator.userAgent);if(t&&2===t.length){var e=parseInt(t[1]);if(!isNaN(e))return e}return null},u.isD3Selection=function(t){return t instanceof r.selection},u.ensureSingle=function(t,e,r,n){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var a=t.append(e);return r&&a.classed(r,!0),n&&a.call(n),a},u.ensureSingleById=function(t,e,r,n){var i=t.select(e+"#"+r);if(i.size())return i;var a=t.append(e).attr("id",r);return n&&a.call(n),a},u.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var G=/^([^\[\.]+)\.(.+)?/,J=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function Q(t){return"__"===t.slice(0,2)}u.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"===typeof t&&!Array.isArray(t))for(r in t)if(t.hasOwnProperty(r))if(e=r.match(G)){if(i=t[r],Q(n=e[1]))continue;delete t[r],t[n]=u.extendDeepNoArrays(t[n]||{},u.objectFromPath(r,u.expandObjectPaths(i))[n])}else if(e=r.match(J)){if(i=t[r],Q(n=e[1]))continue;if(a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3])s=e[4],o=t[n][a]=t[n][a]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)));else{if(Q(n))continue;t[n][a]=u.expandObjectPaths(i)}}else{if(Q(r))continue;t[r]=u.expandObjectPaths(t[r])}return t},u.numSeparate=function(t,e,r){if(r||(r=!1),"string"!==typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"===typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var tt=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return tt.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n](!0)),void 0!==i?i:""}))};var et={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return ot.apply(et,arguments)};var rt={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return ot.apply(rt,arguments)};var nt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,it={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return ot.apply(it,arguments)};var at=/^[:|\|]/;function ot(t,e,r){var i=this,a=arguments;return e||(e={}),t.replace(u.TEMPLATE_STRING_REGEX,(function(t,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,d="xother"===o||"yother"===o||l||h||c,p=o;(l||c)&&(p=p.substring(1)),(h||c)&&(p=p.substring(0,p.length-1));var f,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(t){var e=t.match(nt);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(p);p=x.key,y=x.op,v=x.number}if(d){if(void 0===(f=e[p]))return""}else for(g=3;g<a.length;g++)if(m=a[g]){if(m.hasOwnProperty(p)){f=m[p];break}if(tt.test(p)||(f=u.nestedProperty(m,p).get(!0)),void 0!==f)break}if(void 0!==f&&("*"===y&&(f*=v),"/"===y&&(f/=v)),void 0===f&&i)return i.count<i.max&&(u.warn("Variable '"+p+"' in "+i.name+" could not be found!"),f=t),i.count===i.max&&u.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(s){var b;if(":"===s[0]&&(b=r?r.numberFormat:u.numberFormat,""!==f&&(f=b(s.replace(at,""))(f))),"|"===s[0]){b=r?r.timeFormat:n;var _=u.dateTime2ms(f);f=u.formatDate(_,s.replace(at,""),!1,b)}}else{var w=p+"Label";e.hasOwnProperty(w)&&(f=e[w])}return d&&(f="("+f+")",(l||c)&&(f=" "+f),(h||c)&&(f+=" ")),f}))}u.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var st=2e9;u.seedPseudoRandom=function(){st=2e9},u.pseudoRandom=function(){var t=st;return st=(69069*st+1)%4294967296,Math.abs(st-t)<429496729?u.pseudoRandom():st/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},u.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},u.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},u.strRotate=function(t){return t?"rotate("+t+")":""},u.strScale=function(t){return 1!==t?"scale("+t+")":""},u.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,i=t.targetX,a=t.targetY,o=t.anchorX||0,s=t.anchorY||0,l=t.rotate,c=t.scale;return c?c>1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(t,e){t.attr("transform",u.getTextTransform(e)),t.style("display",e.scale?null:"none")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},u.bigFont=function(t){return Math.round(1.2*t)};var lt=u.getFirefoxVersion(),ct=null!==lt&&lt<86;u.getPositionFromD3Event=function(){return ct?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),le=d({"build/plotcss.js"(){var t,e,r=se(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(e in n)t=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(t,n[e])}}),ce=d({"node_modules/is-browser/client.js"(t,e){e.exports=!0}}),ue=d({"node_modules/has-hover/index.js"(t,e){var r,n=ce();r="function"===typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}}),he=d({"node_modules/events/events.js"(t,e){var r,n="object"===typeof Reflect?Reflect:null,i=n&&"function"===typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"===typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"===typeof t.on&&g(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,a,o,s;if(l(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"===typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):m(i,i.length)}function f(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"===typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!==typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(a){n.once&&t.removeEventListener(e,i),r(a)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!==typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!==typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"===typeof l)i(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r<c;++r)i(u[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return l(e),this.on(t,d(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,d(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,a,o;if(l(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!==typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),de=d({"src/lib/events.js"(t,e){var r=he().EventEmitter,n={init:function(t){if(t._ev instanceof r)return t;var e=new r,n=new r;return t._ev=e,t._internalEv=n,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,r){e.emit(t,r),n.emit(t,r)},t},triggerHandler:function(t,e,r){var n=t._ev;if(n){var i=n._events[e];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;a<i.length-1;a++)o(i[a]);return o(i[a])}}function o(t){return t.listener?(n.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(n,[r]))):t.apply(n,[r])}},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=n}}),pe=d({"src/lib/queue.js"(t,e){var r=se(),n=G().dfltConfig,i={add:function(t,e,r,i,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(i),o.redo.args.push(a)),t.undoQueue.queue.length>n.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},plotDo:function(t,e,n){t.autoplay=!0,n=function(t,e){for(var n,i=[],a=0;a<e.length;a++)n=e[a],i[a]=n===t?n:"object"===typeof n?Array.isArray(n)?r.extendDeep([],n):r.extendDeepAll({},n):n;return i}(t,n),e.apply(null,n)}};e.exports=i}}),fe=d({"src/plots/frame_attributes.js"(t,e){e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}}),me=d({"src/plot_api/plot_schema.js"(t){var e=Vt(),r=se(),n=N(),i=jt(),a=fe(),o=Lt(),s=G().configAttributes,l=Pt(),c=r.extendDeepAll,u=r.isPlainObject,h=r.isArrayOrTypedArray,d=r.nestedProperty,p=r.valObjectMeta,f="_isSubplotObj",m="_isLinkedToArray",g="_deprecated",y=[f,m,"_arrayAttrRegexps",g];function v(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(x(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!u(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!x(e[++r]))return!1}else if("info_array"===t.valType){var i=e[++r];if(!x(i))return!1;var a=t.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function b(){var t,r,n={};for(t in c(n,i),e.subplotsRegistry)if((r=e.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a<r.attr.length;a++)k(n,r,r.attr[a]);else k(n,r,"subplot"===r.attr?r.name:r.attr);for(t in e.componentsRegistry){var o=(r=e.componentsRegistry[t]).schema;if(o&&(o.subplots||o.layout)){var s=o.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete n.yaxis[l];delete n.xaxis.shift,delete n.xaxis.autoshift}else"colorscale"===r.name?c(n,r.layoutAttributes):r.layoutAttributes&&T(n,r.layoutAttributes,r.name)}return{layoutAttributes:w(n)}}function _(){var t={frames:c({},a)};return w(t),t.frames}function w(e){return function(e){function r(t){return{valType:"string",editType:"none"}}function n(e,n,i){t.isValObject(e)?!0!==e.arrayOk&&"data_array"!==e.valType||(i[n+"src"]=r(n)):u(e)&&(e.role="object")}t.crawl(e,n)}(e),function(e){function r(t,e,r){if(t){var n=t[m];n&&(delete t[m],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}t.crawl(e,r)}(e),function(t){function e(t){for(var r in t)if(u(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}e(t)}(e),e}function k(t,e,r){var n=d(t,r),i=c({},e.layoutAttributes);i[f]=!0,n.set(i)}function T(t,e,r){var n=d(t,r);n.set(c(n.get()||{},e))}t.IS_SUBPLOT_OBJ=f,t.IS_LINKED_TO_ARRAY=m,t.DEPRECATED=g,t.UNDERSCORE_ATTRS=y,t.get=function(){var r={};return e.allTypes.forEach((function(i){r[i]=function(r){var i,a;i=e.modules[r]._module,a=i.basePlotModule;var o={type:null},s=c({},n),l=c({},i.attributes);t.crawl(l,(function(t,e,r,n,i){d(s,i).set(void 0),void 0===t&&d(l,i).set(void 0)})),c(o,s),e.traceIs(r,"noOpacity")&&delete o.opacity,e.traceIs(r,"showLegend")||(delete o.showlegend,delete o.legendgroup),e.traceIs(r,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),i.selectPoints||delete o.selectedpoints,c(o,l),a.attributes&&c(o,a.attributes),o.type=r;var u={meta:i.meta||{},categories:i.categories||{},animatable:Boolean(i.animatable),type:r,attributes:w(o)};if(i.layoutAttributes){var h={};c(h,i.layoutAttributes),u.layoutAttributes=w(h)}return i.animatable||t.crawl(u,(function(e){t.isValObject(e)&&"anim"in e&&delete e.anim})),u}(i)})),{defs:{valObjects:p,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:l.traces,layout:l.layout},impliedEdits:{}},traces:r,layout:b(),frames:_(),animation:w(o),config:w(s)}},t.crawl=function(e,r,n,i){var a=n||0;i=i||"",Object.keys(e).forEach((function(n){var o=e[n];if(-1===y.indexOf(n)){var s=(i?i+".":"")+n;r(o,n,e,a,s),t.isValObject(o)||u(o)&&"impliedEdits"!==n&&t.crawl(o,r,a+1,s)}}))},t.isValObject=function(t){return t&&void 0!==t.valType},t.findArrayAttributes=function(e){var r,i,a=[],o=[],s=[];function l(t,e,n,i){o=o.slice(0,i).concat([e]),s=s.slice(0,i).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&("colorbar"!==o[i-1]||"ticktext"!==e&&"tickvals"!==e)&&c(r,0,"")}function c(t,e,r){var n=t[o[e]],l=r+o[e];if(e===o.length-1)h(n)&&a.push(i+l);else if(s[e]){if(Array.isArray(n))for(var d=0;d<n.length;d++)u(n[d])&&c(n[d],e+1,l+"["+d+"].")}else u(n)&&c(n,e+1,l+".")}return r=e,i="",t.crawl(n,l),e._module&&e._module.attributes&&t.crawl(e._module.attributes,l),a},t.getTraceValObject=function(t,r){var i,a,o=r[0],s=t._module;if(s||(s=(e.modules[t.type||n.type.dflt]||{})._module),!s)return!1;if(!(a=(i=s.attributes)&&i[o])){var l=s.basePlotModule;l&&l.attributes&&(a=l.attributes[o])}return a||(a=n[o]),v(a,r,1)},t.getLayoutValObject=function(t,r){var n=function(t,r){var n,a,o,s,l=t._basePlotModules;if(l){var c;for(n=0;n<l.length;n++){if((o=l[n]).attrRegex&&o.attrRegex.test(r)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!c&&o.layoutAttributes&&(c=o.layoutAttributes)}var u=o.baseLayoutAttrOverrides;if(u&&r in u)return u[r]}if(c)return c}var h=t._modules;if(h)for(n=0;n<h.length;n++)if((s=h[n].layoutAttributes)&&r in s)return s[r];for(a in e.componentsRegistry){if("colorscale"===(o=e.componentsRegistry[a]).name&&0===r.indexOf("coloraxis"))return o.layoutAttributes[r];if(!o.schema&&r===o.name)return o.layoutAttributes}return r in i&&i[r]}(t,r[0]);return v(n,r,1)}}}),ge=d({"src/plot_api/plot_template.js"(t){var e=se(),r=N(),n="templateitemname",i={name:{valType:"string",editType:"none"}};function a(t){return t&&"string"===typeof t}function o(t){var r=t.length-1;return"s"!==t.charAt(r)&&e.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}i[n]={valType:"string",editType:"calc"},t.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=i.name,e[n]=i[n],e},t.traceTemplater=function(t){var n,i,a={};for(n in t)i=t[n],Array.isArray(i)&&i.length&&(a[n]=0);return{newTrace:function(o){var s={type:n=e.coerce(o,{},r,"type"),_template:null};if(n in a){i=t[n];var l=a[n]%i.length;a[n]++,s._template=i[l]}return s}}},t.newContainer=function(t,r,n){var i=t._template,a=i&&(i[r]||n&&i[n]);return e.isPlainObject(a)||(a=null),t[r]={_template:a}},t.arrayTemplater=function(t,e,r){var i=t._template,s=i&&i[o(e)],l=i&&i[e];Array.isArray(l)&&l.length||(l=[]);var c={};return{newItem:function(t){var e={name:t.name,_input:t},i=e[n]=t[n];if(!a(i))return e._template=s,e;for(var o=0;o<l.length;o++){var u=l[o];if(u.name===i)return c[i]=1,e._template=u,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<l.length;e++){var r=l[e],i=r.name;if(a(i)&&!c[i]){var o={_template:r,name:i,_input:{_templateitemname:i}};o[n]=r[n],t.push(o),c[i]=1}}return t}}},t.arrayDefaultKey=o,t.arrayEditor=function(t,r,i){var a=(e.nestedProperty(t,r).get()||[]).length,o=i._index,s=o>=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(t,r){s?e.nestedProperty(l[c],t).set(r):l[c+"."+t]=r}function d(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:d,applyUpdate:function(r,n){r&&h(r,n);var i=d();for(var a in i)e.nestedProperty(t,a).set(i[a])}}}}}),ye=d({"src/plots/cartesian/constants.js"(t,e){var r=H().counter;e.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),ve=d({"src/plots/cartesian/axis_ids.js"(t){var e=Vt(),r=ye();function n(t,e){if(e&&e.length)for(var r=0;r<e.length;r++)if(e[r][t])return!0;return!1}t.id2name=function(t){if("string"===typeof t&&t.match(r.AX_ID_PATTERN)){var e=t.split(" ")[0].substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},t.name2id=function(t){if(t.match(r.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},t.cleanId=function(t,e,n){var i=/( domain)$/.test(t);if("string"===typeof t&&t.match(r.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)&&(!i||n)){var a=t.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===a&&(a=""),t.charAt(0)+a+(i&&n?" domain":"")}},t.list=function(e,r,n){var i=e._fullLayout;if(!i)return[];var a,o=t.listIds(e,r),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var c=i._subplots.gl3d||[];for(a=0;a<c.length;a++){var u=i[c[a]];r?s.push(u[r+"axis"]):s.push(u.xaxis,u.yaxis,u.zaxis)}}return s},t.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},t.getFromId=function(e,r,n){var i=e._fullLayout;return r=void 0===r||"string"!==typeof r?r:r.replace(" domain",""),"x"===n?r=r.replace(/y[0-9]*/,""):"y"===n&&(r=r.replace(/x[0-9]*/,"")),i[t.id2name(r)]},t.getFromTrace=function(r,n,i){var a=r._fullLayout,o=null;if(e.traceIs(n,"gl3d")){var s=n.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=t.getFromId(r,n[i+"axis"]||i);return o},t.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,e){return n(e,t._axisMatchGroups)||n(e,t._axisConstraintGroups)}}}),xe=d({"src/components/shapes/handle_outline.js"(t,e){e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}}),be=d({"src/traces/scatter/layout_attributes.js"(t,e){e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),_e=d({"src/plots/get_data.js"(t){var e=Vt();ye().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,r,n){var i=e.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[a]===n&&o.push(l)}return o},t.getModuleCalcData=function(t,r,n){var i,a=[],o=[];if(!(i="string"===typeof r?e.getModule(r).plot:"function"===typeof r?r:r.plot))return[a,t];for(var s=n,l=0;l<t.length;l++){var c=t[l],u=c[0].trace,h=void 0!==u.zorder;!0===u.visible&&0!==u._length&&(!u._module||u._module.plot!==i||h&&u.zorder!==s?o.push(c):a.push(c))}return[a,o]},t.getSubplotData=function(t,r,n){if(!e.subplotsRegistry[r])return[];for(var i,a=e.subplotsRegistry[r].attr,o=[],s=0;s<t.length;s++)(i=t[s])[a]===n&&o.push(i);return o}}}),we=d({"src/plots/command.js"(t){var e=Vt(),r=se();function n(t,e,n){var i,a,o,s=!1;if("data"===e.type)i=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;i=t._fullLayout}return a=r.nestedProperty(i,e.prop).get(),(o=n[e.type]=n[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==a&&(s=!0),o[e.prop]=a,{changed:s,value:a}}function i(t,e){var n=[],i=e[0],a={};if("string"===typeof i)a[i]=e[1];else{if(!r.isPlainObject(i))return n;a=i}return o(a,(function(t,e,r){n.push({type:"layout",prop:t,value:r})}),"",0),n}function a(t,e){var n,i,a,s,l=[];if(i=e[0],a=e[1],n=e[2],s={},"string"===typeof i)s[i]=a;else{if(!r.isPlainObject(i))return l;s=i,void 0===n&&(n=a)}return void 0===n&&(n=null),o(s,(function(e,r,i){var a,o;if(Array.isArray(i)){o=i.slice();var s=Math.min(o.length,t.data.length);n&&(s=Math.min(s,n.length)),a=[];for(var c=0;c<s;c++)a[c]=n?n[c]:c}else o=i,a=n?n.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var u=o;o=[];for(var h=0;h<a.length;h++)o[h]=u}o.length=Math.min(a.length,o.length)}l.push({type:"data",prop:e,traces:a,value:o})}),"",0),l}function o(t,e,n,i){Object.keys(t).forEach((function(a){var s=t[a];if("_"!==a[0]){var l=n+(i>0?".":"")+a;r.isPlainObject(s)?o(s,e,l,i+1):e(l,a,s)}}))}t.manageCommandObserver=function(e,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(e,c,s.cache),s.check=function(){if(l){var t=n(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<u.length;h++)e._internalOn(u[h],s.check);s.remove=function(){for(var t=0;t<u.length;t++)e._removeInternalListener(u[t],s.check)}}else r.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},i&&(i._commandObserver=s),s},t.hasSimpleAPICommandBindings=function(e,r,n){var i,a,o=r.length;for(i=0;i<o;i++){var s,l=r[i],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var h=t.computeAPICommandBindings(e,c,u);if(1!==h.length)return!1;if(a){if((s=h[0]).type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var d=0;d<a.traces.length;d++)if(a.traces[d]!==s.traces[d])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();var p=(s=h[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=i)}return a},t.executeAPICommand=function(t,n,i){if("skip"===n)return Promise.resolve();var a=e.apiMethodRegistry[n],o=[t];Array.isArray(i)||(i=[]);for(var s=0;s<i.length;s++)o.push(i[s]);return a.apply(null,o).catch((function(t){return r.warn("API call to Plotly."+n+" rejected.",t),Promise.reject(t)}))},t.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=a(t,r);break;case"relayout":n=i(0,r);break;case"update":n=a(t,[r[0],r[2]]).concat(i(0,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}}}),ke=d({"src/plots/plots.js"(t,e){var r=v(),n=b().timeFormatLocale,i=_().formatLocale,a=k(),o=S(),s=Vt(),l=me(),c=ge(),u=se(),h=q(),d=T().BADNUM,p=ve(),f=xe().clearOutline,m=be(),g=Lt(),y=fe(),x=_e().getModuleCalcData,w=u.relinkPrivateKeys,A=u._,M=e.exports={};u.extendFlat(M,s),M.attributes=N(),M.attributes.type.values=M.allTypes,M.fontAttrs=R(),M.layoutAttributes=jt();var C=we();M.executeAPICommand=C.executeAPICommand,M.computeAPICommandBindings=C.computeAPICommandBindings,M.manageCommandObserver=C.manageCommandObserver,M.hasSimpleAPICommandBindings=C.hasSimpleAPICommandBindings,M.redrawText=function(t){return t=u.getGraphDiv(t),new Promise((function(e){setTimeout((function(){t._fullLayout&&(s.getComponentMethod("annotations","draw")(t),s.getComponentMethod("legend","draw")(t),s.getComponentMethod("colorbar","draw")(t),e(M.previousPromises(t)))}),300)}))},M.resize=function(t){var e;t=u.getGraphDiv(t);var r=new Promise((function(r,n){t&&!u.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||u.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,s.call("relayout",t,{autosize:!0}).then((function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))}))}}),100)}));return e&&e(r),r},M.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},M.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,n=u.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each((function(){var t=r.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),i=n.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){M.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},M.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=M.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1}};var E=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],L=["year","month","dayMonth","dayMonthYear"];function P(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=t._context.locales,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(a(u),n))break;l=s.localeRegistry}var h=r.split("-")[0];if(n||h===r)break;r=h}return n||a(s.localeRegistry.en.format),i}function I(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),i=t._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?t._id+s:s+t._id),!a||!e._plots[a]){a="";for(var l=t._counterAxes,c=0;c<l.length;c++){var u=l[c],h=n?t._id+u:u+t._id;o||(o=h);var d=p.getFromId(r,u);if(s&&d.overlaying===s){a=h;break}}}return a||o}function z(t){return"string"===typeof t&&"px"===t.substr(t.length-2)&&parseFloat(t)}function O(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={}),t._reservedMargin||(t._reservedMargin={})}M.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=t._fullLayout={},c=t.layout||{},h=t._fullData||[],d=t._fullData=[],p=t.data||[],m=t.calcdata||[],g=t._context||{};t._transitionData||M.createTransitionData(t),l._dfltTitle={plot:A(t,"Click to enter Plot title"),subtitle:A(t,"Click to enter Plot subtitle"),x:A(t,"Click to enter X axis title"),y:A(t,"Click to enter Y axis title"),colorbar:A(t,"Click to enter Colorscale title"),annotation:A(t,"new text")},l._traceWord=A(t,"trace");var y=P(t,E);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var v=a.width,x=a.height;M.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=v),c.height||(l.height=x),M.sanitizeMargins(l)}else{M.supplyLayoutGlobalDefaults(c,l,y);var b=!c.width||!c.height,_=l.autosize,k=g.autosizable;b&&(_||k)?M.plotAutoSize(t,c,l):b&&M.sanitizeMargins(l),!_&&b&&(c.width=l.width,c.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:function(e){try{e=i(t).format(u.adjustFormat(e))}catch(r){return u.warnBadFormat(e),u.noFormat}return e},timeFormat:n(t).utcFormat}}(y,l.separators),l._extraFormat=P(t,L),l._initialAutoSizeIsDone=!0,l._dataLength=p.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var T=l._subplots=function(){var t,e,r=s.collectableSubplotTypes,n={};if(!r){r=[];var i=s.subplotsRegistry;for(var a in i){var o=i[a].attr;if(o&&(r.push(a),Array.isArray(o)))for(e=0;e<o.length;e++)u.pushUnique(r,o[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),S=l._splomAxes={x:{},y:{}},C=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(t,e){var r,n,i=e.length,a=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,l=new Array(i),c={};function h(t,e){l[e]=t,c[t]=1}function d(t,e){if(t&&"string"===typeof t&&!c[t])return h(t,e),!0}for(r=0;r<i;r++){var p=e[r].uid;"number"===typeof p&&(p=String(p)),d(p,r)||r<s&&d(a[r].uid,r)||h(u.randstr(c),r)}return l}(h,p),M.supplyDataDefaults(p,d,c,l);var I=Object.keys(S.x),z=Object.keys(S.y);if(I.length>1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<I.length;o++)u.pushUnique(T.xaxis,I[o]);for(o=0;o<z.length;o++)u.pushUnique(T.yaxis,z[o]);for(var D in C)u.pushUnique(T.cartesian,D)}if(l._has=M._hasPlotType.bind(l),h.length===d.length)for(o=0;o<d.length;o++)w(d[o],h[o]);M.supplyLayoutModuleDefaults(c,l,d,t._transitionData);var R=l._visibleModules,F=[];for(o=0;o<R.length;o++){var B=R[o].crossTraceDefaults;B&&u.pushUnique(F,B)}for(o=0;o<F.length;o++)F[o](d,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&I.length>15&&z.length>15&&0===l.shapes.length&&0===l.images.length,M.linkSubplots(d,l,h,a),M.cleanPlot(d,l,h,a);var j=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));j&&!N?a._bgLayer.remove():N&&!j&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&f({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var a=t[i];a.meta?n[a.index]=a._meta={meta:a.meta}:e.meta&&(a._meta={meta:e.meta}),e.meta&&(a._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(d,l),w(l,a),s.getComponentMethod("colorscale","crossTraceDefaults")(d,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var U,V=l._tracePreGUI,q={};for(U in V)q[U]="old";for(o=0;o<d.length;o++)q[U=d[o]._fullInput.uid]||(V[U]={}),q[U]="new";for(U in q)"old"===q[U]&&delete V[U];O(l),s.getComponentMethod("rangeslider","makeData")(l),r||m.length!==d.length||M.supplyDefaultsUpdateCalc(m,d)}},M.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=(t[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,l,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(a,s).get().slice(),u.nestedProperty(n,s).set(l)}i.trace=n}}},M.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},M._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e].name;if(i===t)return!0;var a=s.modules[i];if(a&&a.categories[t])return!0}return!1},M.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),c=e._has&&e._has("gl");l&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;t:for(i=0;i<r.length;i++){var h=r[i].uid;for(a=0;a<t.length;a++)if(h===t[a].uid)continue t;u&&n._infolayer.select(".cb"+h).remove()}},M.linkSubplots=function(t,e,r,n){var i,a,o=n._plots||{},l=e._plots={},c={_fullData:t,_fullLayout:e},h=e._subplots.cartesian||[];for(i=0;i<h.length;i++){var d,f=h[i],m=o[f],g=p.getFromId(c,f,"x"),y=p.getFromId(c,f,"y");for(m?d=l[f]=m:(d=l[f]={}).id=f,g._counterAxes.push(y._id),y._counterAxes.push(g._id),g._subplotsWith.push(f),y._subplotsWith.push(f),d.xaxis=g,d.yaxis=y,d._hasClipOnAxisFalse=!1,a=0;a<t.length;a++){var v=t[a];if(v.xaxis===d.xaxis._id&&v.yaxis===d.yaxis._id&&!1===v.cliponaxis){d._hasClipOnAxisFalse=!0;break}}}var x,b=p.list(c,null,!0);for(i=0;i<b.length;i++){var _=null;(x=b[i]).overlaying&&(_=p.getFromId(c,x.overlaying))&&_.overlaying&&(x.overlaying=!1,_=null),x._mainAxis=_||x,_&&(x.domain=_.domain.slice()),x._anchorAxis="free"===x.anchor?null:p.getFromId(c,x.anchor)}for(i=0;i<b.length;i++)if((x=b[i])._counterAxes.sort(p.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=I(x,e),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||s.getComponentMethod("rangeslider","isVisible")(x))){var w=1,k=0;for(a=0;a<x._counterAxes.length;a++){var T=p.getFromId(c,x._counterAxes[a]);w=Math.min(w,T.domain[0]),k=Math.max(k,T.domain[1])}w<k&&(x._counterDomainMin=w,x._counterDomainMax=k)}},M.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],l.crawl(t._module.attributes,(function(t,n,i,a){r[a]=n,r.length=a+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))}))),n=0;n<e.length;n++)u.nestedProperty(t,"_input."+e[n]).get()||u.nestedProperty(t,e[n]).set(null)},M.supplyDataDefaults=function(t,e,r,n){var i,a,o,l=n._modules,h=n._visibleModules,d=n._basePlotModules,p=0;function f(t){e.push(t);var r=t._module;r&&(u.pushUnique(l,r),!0===t.visible&&u.pushUnique(h,r),u.pushUnique(d,t._module.basePlotModule),!1!==t._input.visible&&p++)}n._transformModules=[];var m={},g=[],y=(r.template||{}).data||{},v=c.traceTemplater(y);for(i=0;i<t.length;i++)o=t[i],(a=v.newTrace(o)).uid=n._traceUids[i],M.supplyTraceDefaults(o,a,p,n,i),a.index=i,a._input=o,a._fullInput=a,f(a),s.traceIs(a,"carpetAxis")&&(m[a.carpet]=a),s.traceIs(a,"carpetDependent")&&g.push(i);for(i=0;i<g.length;i++)if((a=e[g[i]]).visible){var x=m[a.carpet];a._carpet=x,x&&x.visible?(a.xaxis=x.xaxis,a.yaxis=x.yaxis):a.visible=!1}},M.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return u.coerce(t||{},r,g,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=M.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=M.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=M.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=M.supplyAnimationTransitionDefaults(t.transition||{});return r},M.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,g.frame,r,n)}return r("duration"),r("redraw"),e},M.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,g.transition,r,n)}return r("duration"),r("easing"),e},M.supplyFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t,e,y,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},M.supplyTraceDefaults=function(t,e,r,n,i){var a,o=n.colorway||h.defaults,l=o[r%o.length];function c(r,n){return u.coerce(t,e,M.attributes,r,n)}var d=c("visible");c("type"),c("name",n._traceWord+" "+i),c("uirevision",n.uirevision);var p=M.getModule(e);if(e._module=p,p){var f=p.basePlotModule,m=f.attr,g=f.attributes;if(m&&g){var y=n._subplots,v="";if(Array.isArray(m))for(a=0;a<m.length;a++){var x=m[a],b=u.coerce(t,e,g,x);y[x]&&u.pushUnique(y[x],b),v+=b}else v=u.coerce(t,e,g,m);y[f.name]&&u.pushUnique(y[f.name],v)}}if(d&&(c("customdata"),c("ids"),c("meta"),s.traceIs(e,"showLegend")?(u.coerce(t,e,p.attributes.showlegend?p.attributes:M.attributes,"showlegend"),c("legend"),c("legendwidth"),c("legendgroup"),c("legendgrouptitle.text"),c("legendrank"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,p&&p.supplyDefaults(t,e,l,n),s.traceIs(e,"noOpacity")||c("opacity"),s.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),s.traceIs(e,"noHover")||(e.hovertemplate||u.coerceHoverinfo(t,e,n),"parcats"!==e.type&&s.getComponentMethod("fx","supplyDefaults")(t,e,l,n)),p&&p.selectPoints)){var _=c("selectedpoints");u.isTypedArray(_)&&(e.selectedpoints=Array.from(_))}return e},M.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return u.coerce(t,e,M.layoutAttributes,r,n)}var i=t.template;u.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),n("autotypenumbers");var a=u.coerceFont(n,"font"),o=a.size;u.coerceFont(n,"title.font",a,{overrideDflt:{size:Math.round(1.4*o)}}),n("title.text",e._dfltTitle.plot),n("title.xref");var l=n("title.yref");n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l");var c=n("title.automargin");n("title.x"),n("title.xanchor"),n("title.y"),n("title.yanchor"),n("title.subtitle.text",e._dfltTitle.subtitle),u.coerceFont(n,"title.subtitle.font",a,{overrideDflt:{size:Math.round(.7*e.title.font.size)}}),c&&("paper"===l&&(0!==e.title.y&&(e.title.y=1),"auto"===e.title.yanchor&&(e.title.yanchor=0===e.title.y?"top":"bottom")),"container"===l&&("auto"===e.title.y&&(e.title.y=1),"auto"===e.title.yanchor&&(e.title.yanchor=e.title.y<.5?"bottom":"top"))),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("minreducedwidth"),n("minreducedheight"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&M.sanitizeMargins(e),s.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var h=n("uirevision");n("editrevision",h),n("selectionrevision",h),s.getComponentMethod("modebar","supplyLayoutDefaults")(t,e),s.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,n),s.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(t,e,n),n("meta"),u.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),s.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n),u.coerce(t,e,m,"scattermode")},M.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,l=u.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(t):{};if(n=z(c.width)||z(c.maxWidth)||r.width,i=z(c.height)||z(c.maxHeight)||r.height,a(s)&&s>0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var d=M.layoutAttributes.width.min,p=M.layoutAttributes.height.min;n<d&&(n=d),i<p&&(i=p);var f=!e.width&&Math.abs(r.width-n)>1,m=!e.height&&Math.abs(r.height-i)>1;(m||f)&&(f&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),M.sanitizeMargins(r)},M.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var d in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(u.subplotSort);for(a=0;a<c.length;a++)(o=c[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var p=e._modules;for(a=0;a<p.length;a++)(o=p[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var f=e._transformModules;for(a=0;a<f.length;a++)(o=f[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);for(i in l)(o=l[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},M.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},M.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&u.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},M.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},M.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},M.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},M.autoMargin=function(t,e,r){var n=t._fullLayout,i=n.width,a=n.height,o=n.margin,s=n.minreducedwidth,l=n.minreducedheight,c=u.constrain(i-o.l-o.r,2,s),h=u.constrain(a-o.t-o.b,2,l),d=Math.max(0,i-c),p=Math.max(0,a-h),f=n._pushmargin,m=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var g=r.pad;if(void 0===g&&(g=Math.min(12,o.l,o.r,o.t,o.b)),d){var y=(r.l+r.r)/d;y>1&&(r.l/=y,r.r/=y)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;f[e]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:w,size:r.b+g},t:{val:_,size:r.t+g}},m[e]=1}else delete f[e],delete m[e];if(!n._replotting)return M.doAutoMargin(t)}},M.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),O(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,d=o.r,f=o.t,m=o.b,g=e._pushmargin,y=e._pushmarginIds,v=e.minreducedwidth,x=e.minreducedheight;if(!1!==o.autoexpand){for(var b in g)y[b]||delete g[b];var _=t._fullLayout._reservedMargin;for(var w in _)for(var k in _[w]){var T=_[w][k];l[k]=Math.max(l[k],T)}for(var S in g.base={l:{val:0,size:h},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:m}},l){var A=0;for(var C in g)"base"!==C&&a(g[C][S].size)&&(A=g[C][S].size>A?g[C][S].size:A);var E=Math.max(0,o[S]-A);l[S]=Math.max(0,l[S]-E)}for(var L in g){var P=g[L].l||{},I=g[L].b||{},z=P.val,D=P.size,R=I.val,F=I.size,B=r-l.r-l.l,j=n-l.t-l.b;for(var N in g){if(a(D)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(D*U+(V-B)*z)/(U-z),$=(V*(1-z)+(D-B)*(1-U))/(U-z);q+$>h+d&&(h=q,d=$)}}if(a(F)&&g[N].t){var H=g[N].t.val,W=g[N].t.size;if(H>R){var G=(F*H+(W-j)*R)/(H-R),Y=(W*(1-R)+(F-j)*(1-H))/(H-R);G+Y>m+f&&(m=G,f=Y)}}}}}var Z=u.constrain(r-o.l-o.r,2,v),X=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-Z),J=Math.max(0,n-X);if(K){var Q=(h+d)/K;Q>1&&(h/=Q,d/=Q)}if(J){var tt=(m+f)/J;tt>1&&(m/=tt,f/=tt)}if(i.l=Math.round(h)+l.l,i.r=Math.round(d)+l.r,i.t=Math.round(f)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(M.didMarginChange(c,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount<et)return s.call("_doPlot",t);e._size=c,u.warn("Too many auto-margin redraws.")}!function(t){var e=p.list(t,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach((function(t){for(var r=0;r<e.length;r++){var n=e[r][t];n&&n()}}))}(t)};var D=["l","r","t","b","p","w","h"];function F(t,e,r){var n=!1,i=[M.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,M.rehover,M.reselect,function(){return t.emit("plotly_transitioning",[]),new Promise((function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var e;o++,n||o!==a||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}M.didMarginChange=function(t,e){for(var r=0;r<D.length;r++){var n=D[r],i=t[n],o=e[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},M.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&M.supplyDefaults(t);var s=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function h(t,e){if("function"===typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"===typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(t[a],e)}else e&&(i[a]="_function")})),i}var a=Array.isArray(t),s=u.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map((function(t){return h(t,e)})):s?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var d={data:(s||[]).map((function(t){var r=h(t);return e&&delete r.fit,r}))};if(!e&&(d.layout=h(l),i)){var p=l._size;d.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return c&&(d.frames=h(c)),a&&(d.config=h(t._context,!0)),"object"===n?d:JSON.stringify(d)},M.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},M.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=M.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)void 0!==(i=n[r])&&null!==i&&(-1===(a=u.traces.indexOf(i))&&(a=u.data.length,u.traces[a]=i),u.data[a]=M.extendTrace(u.data[a],s.data[r]))}return u},M.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},M.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,c,h=u.extendDeepNoArrays({},e||{}),d=u.expandObjectPaths(h),p={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=u.nestedProperty(d,r[a])).get())?u.nestedProperty(p,r[a]).set(null):(n.set(null),u.nestedProperty(p,r[a]).set(i));if(t=u.extendDeepNoArrays(t||{},d),r&&r.length)for(a=0;a<r.length;a++)if(l=u.nestedProperty(p,r[a]).get()){for(c=(s=u.nestedProperty(t,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var f=l[o];c[o]=null===f?null:M.extendObjectWithContainers(c[o],f)}s.set(c)}return t},M.dataArrayContainers=["transforms","dimensions"],M.layoutArrayContainers=s.layoutArrayContainers,M.extendTrace=function(t,e){return M.extendObjectWithContainers(t,e,M.dataArrayContainers)},M.extendLayout=function(t,e){return M.extendObjectWithContainers(t,e,M.layoutArrayContainers)},M.transition=function(t,e,r,n,i,a){var o={redraw:i.redraw},s={},l=[];return o.prepareFn=function(){for(var i=Array.isArray(e)?e.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var c=a[o],h=t._fullData[c]._module;if(h){if(h.animatable){var d=h.basePlotModule.name;s[d]||(s[d]=[]),s[d].push(c)}t.data[a[o]]=M.extendTrace(t.data[a[o]],e[o])}}var p=u.expandObjectPaths(u.extendDeepNoArrays({},r)),f=/^[xy]axis[0-9]*$/;for(var m in p)f.test(m)&&delete p[m].range;M.extendLayout(t.layout,p),delete t.calcdata,M.supplyDefaults(t),M.doCalcdata(t);var g=u.expandObjectPaths(r);if(g){var y=t._fullLayout._plots;for(var v in y){var x=y[v],b=x.xaxis,_=x.yaxis,w=b.range.slice(),k=_.range.slice(),T=null,S=null,A=null,C=null;Array.isArray(g[b._name+".range"])?T=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(T=g[b._name].range.slice()),Array.isArray(g[_._name+".range"])?S=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(S=g[_._name].range.slice()),w&&T&&(b.r2l(w[0])!==b.r2l(T[0])||b.r2l(w[1])!==b.r2l(T[1]))&&(A={xr0:w,xr1:T}),k&&S&&(_.r2l(k[0])!==_.r2l(S[0])||_.r2l(k[1])!==_.r2l(S[1]))&&(C={yr0:k,yr1:S}),(A||C)&&l.push(u.extendFlat({plotinfo:x},A,C))}}return Promise.resolve()},o.runFn=function(e){var n,i,o=t._fullLayout._basePlotModules,c=l.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(t,l,a,e);for(var h in c?((n=u.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var d=s[h];t._fullData[d[0]]._module.basePlotModule.plot(t,d,n,e)}},F(t,a,o)},M.transitionFromReact=function(t,e,r,n){var i=t._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var t=i._plots;for(var a in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var l=t[a],c=l.xaxis,h=l.yaxis,d=n[c._name].range.slice(),p=n[h._name].range.slice(),f=c.range.slice(),m=h.range.slice();c.setScale(),h.setScale();var g=null,y=null;c.r2l(d[0])===c.r2l(f[0])&&c.r2l(d[1])===c.r2l(f[1])||(g={xr0:d,xr1:f}),h.r2l(p[0])===h.r2l(m[0])&&h.r2l(p[1])===h.r2l(m[1])||(y={yr0:p,yr1:m}),(g||y)&&s.push(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=t._fullData,c=t._fullLayout._basePlotModules,h=[],d=0;d<l.length;d++)h.push(d);function p(){if(t._fullLayout)for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function f(){if(t._fullLayout)for(var e=0;e<c.length;e++)c[e].plot(t,o,i,r)}s.length&&e.anim?"traces first"===a.ordering?(n=u.extendFlat({},a,{duration:0}),o=h,i=a,setTimeout(p,a.duration),f()):(n=a,o=null,i=u.extendFlat({},a,{duration:0}),setTimeout(f,n.duration),p()):s.length?(n=a,p()):e.anim&&(o=h,i=a,f())},F(t,a,o)},M.doCalcdata=function(t,e){var r,n,i,a,o=p.list(t),c=t._fullData,h=t._fullLayout,f=new Array(c.length),m=(t.calcdata||[]).slice();for(t.calcdata=f,h._numBoxes=0,h._numViolins=0,h._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,h._piecolormap={},h._sunburstcolormap={},h._treemapcolormap={},h._iciclecolormap={},h._funnelareacolormap={},i=0;i<c.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(f[i]=m[i]);for(i=0;i<c.length;i++)(r=c[i])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var g=h._subplots.polar||[];for(i=0;i<g.length;i++)o.push(h[g[i]].radialaxis,h[g[i]].angularaxis);for(var y in h._colorAxes){var v=h[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var x=!1;function b(e){if(r=c[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(t,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(a=0;a<r.transforms.length;a++){var o=r.transforms[a];(n=transformsRegistry[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(t,r,o))}}}function _(e,i){if(r=c[e],!!(n=r._module).isContainer===i){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(a=s.length-1;a>=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,f[e]=o}}for(j(o,c,h),i=0;i<c.length;i++)_(i,!0);for(i=0;i<c.length;i++)b(i);for(x&&j(o,c,h),i=0;i<c.length;i++)_(i,!0);for(i=0;i<c.length;i++)_(i,!1);U(t);var w=function(t,e){var r,n,i,a,o,l=[];function c(t,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===t){var a=r._counterAxes[0],o=p.getFromId(e,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(t,e){return 0===t||0===e||s&&t===n[e].length-1||l&&e===n.length-1?-1:("y"===i?e:t)-1}}return function(t,e){return"y"===i?e:t}}var h={min:function(t){return u.aggNums(Math.min,null,t)},max:function(t){return u.aggNums(Math.max,null,t)},sum:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return u.mean(t)},"geometric mean":function(t){return u.geometricMean(t)},median:function(t){return u.median(t)}};function d(t,e){return t[1]-e[1]}function f(t,e){return e[1]-t[1]}for(r=0;r<t.length;r++){var m=t[r];if("category"===m.type){var g=m.categoryorder.match(B);if(g){var y=g[1],v=g[2],x=m._id.charAt(0),b="x"===x,_=[];for(n=0;n<m._categories.length;n++)_.push([m._categories[n],[]]);for(n=0;n<m._traceIndices.length;n++){var w=m._traceIndices[n],k=e._fullData[w];if(!0===k.visible){var T=k.type;s.traceIs(k,"histogram")&&(delete k._xautoBinFinished,delete k._yautoBinFinished);var S="splom"===T,A="scattergl"===T,M=e.calcdata[w];for(i=0;i<M.length;i++){var C,E,L=M[i];if(S){var P=k._axesDim[m._id];if(!b){var I=k._diag[P][0];I&&(m=e._fullLayout[p.id2name(I)])}var z=L.trace.dimensions[P].values;for(a=0;a<z.length;a++)for(C=m._categoriesMap[z[a]],o=0;o<L.trace.dimensions.length;o++)if(o!==P){var O=L.trace.dimensions[o];_[C][1].push(O.values[a])}}else if(A){for(a=0;a<L.t.x.length;a++)b?(C=L.t.x[a],E=L.t.y[a]):(C=L.t.y[a],E=L.t.x[a]),_[C][1].push(E);L.t&&L.t._scene&&delete L.t._scene.dirty}else if(L.hasOwnProperty("z")){E=L.z;var D=c(k.type,m,E);for(a=0;a<E.length;a++)for(o=0;o<E[a].length;o++)(C=D(o,a))+1&&_[C][1].push(E[a][o])}else for(void 0===(C=L.p)&&(C=L[x]),void 0===(E=L.s)&&(E=L.v),void 0===E&&(E=b?L.y:L.x),Array.isArray(E)||(E=void 0===E?[]:[E]),a=0;a<E.length;a++)_[C][1].push(E[a])}}}m._categoriesValue=_;var R=[];for(n=0;n<_.length;n++)R.push([_[n][0],h[y](_[n][1])]);R.sort("descending"===v?f:d),m._categoriesAggregatedValue=R,m._initialCategories=R.map((function(t){return t[0]})),l=l.concat(m.sortByInitialCategories())}}}return l}(o,t);if(w.length){for(h._numBoxes=0,h._numViolins=0,i=0;i<w.length;i++)_(w[i],!0);for(i=0;i<w.length;i++)_(w[i],!1);U(t)}s.getComponentMethod("fx","calc")(t),s.getComponentMethod("errorbars","calc")(t)};var B=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function j(t,e,r){var n={};function i(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}u.simpleMap(t,i);for(var a=r._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])n[s]||i(r[p.id2name(s)])}function U(t){var e,r,n,i=t._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var h=o[n],d=i._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var p=d[e],f="cartesian"===n?i._plots[p]:i[p];for(r=0;r<h.length;r++)h[r](t,f,p)}else for(r=0;r<h.length;r++)h[r](t)}}M.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},M.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},M.reselect=function(t){var e=t._fullLayout,r=(t.layout||{}).selections,n=e._previousSelections;e._previousSelections=r;var i=e._reselect||JSON.stringify(r)!==JSON.stringify(n);s.getComponentMethod("selections","reselect")(t,i)},M.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in a)if(!o[c]){var h=a[c][0];h[0].trace.visible=!1,o[c]=[h]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(t,e,u.filterVisible(p),n)}e.traceHash=o},M.plotBasePlot=function(t,e,r,n,i){var a=s.getModule(t),o=x(e.calcdata,a)[0];a.plot(e,o,n,i)},M.cleanBasePlot=function(t,e,r,n,i){var a=i._has&&i._has(t),o=r._has&&r._has(t);a&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()}}}),Te=d({"src/constants/xmlns_namespaces.js"(t){t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}}}),Se=d({"src/constants/alignment.js"(t,e){e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}}),Ae=d({"src/lib/svg_text_utils.js"(t){var e=v(),r=se(),n=r.strTranslate,i=Te(),a=Se().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(f,v,A){var M=f.text(),L=!f.attr("data-notex")&&v&&v._context.typesetMath&&"undefined"!==typeof MathJax&&M.match(o),P=e.select(f.node().parentNode);if(!P.empty()){var I=f.attr("class")?f.attr("class").split(" ")[0]:"text";return I+="-math",P.selectAll("svg."+I).remove(),P.selectAll("g."+I+"-group").remove(),f.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),L?(v&&v._promises||[]).push(new Promise((function(t){f.style("display","none");var i=parseInt(f.node().style.fontSize,10),a={fontSize:i};!function(t,n,i){var a,o,u,h,d=parseInt((MathJax.version||"").split(".")[0]);if(2===d||3===d){var p=function(){return o=r.extendDeepAll({},MathJax.Hub.config),u=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:c},displayAlign:"left"})},f=function(){o=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c},m=function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},g=function(){"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg")},y=function(){var i="math-output-"+r.randstr({},64),a=(h=e.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute","font-size":n.fontSize+"px"}).text(t.replace(s,"\\lt ").replace(l,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(a):MathJax.typeset([a])},v=function(){var n=h.select(2===d?".MathJax_SVG":".MathJax"),a=!n.empty()&&h.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===d?e.select("body").select("#MathJax_SVG_glyphs"):n.select("defs"),i(n,o,s)}else r.log("There was an error in the tex syntax.",t),i();h.remove()},x=function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)},b=function(){"svg"!==a&&(MathJax.config.startup.output=a)},_=function(){return void 0!==u&&(MathJax.Hub.processSectionDelay=u),MathJax.Hub.Config(o)},w=function(){MathJax.config=o};2===d?MathJax.Hub.Queue(p,m,y,v,x,_):3===d&&(f(),g(),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){y(),v(),b(),w()})))}else r.warn("No MathJax version:",MathJax.version)}(L[2],a,(function(e,r,a){P.selectAll("svg."+I).remove(),P.selectAll("g."+I+"-group").remove();var o=e&&e.select("svg");if(!o||!o.node())return z(),void t();var s=P.append("g").classed(I+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});s.node().appendChild(o.node()),r&&r.node()&&o.node().insertBefore(r.node().cloneNode(!0),o.node().firstChild);var l=a.width,c=a.height;o.attr({class:I,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=f.node().style.fill||"black",h=o.select("g");h.attr({fill:u,stroke:u});var d=h.node().getBoundingClientRect(),p=d.width,m=d.height;(p>l||m>c)&&(o.style("overflow","hidden"),p=(d=o.node().getBoundingClientRect()).width,m=d.height);var g=+f.attr("x"),y=+f.attr("y"),v=-(i||f.node().getBoundingClientRect().height)/4;if("y"===I[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-p/2,v-m/2)});else if("l"===I[0])y=v-m/2;else if("a"===I[0]&&0!==I.indexOf("atitle"))g=0,y=v;else{var x=f.attr("text-anchor");g-=p*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y:y}),A&&A.call(f,s),t(s)}))}))):z(),f}function z(){P.empty()||(I=f.attr("class")+"-math",P.select("svg."+I).remove()),f.text("").style("white-space","pre");var n=function(t,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function f(){c++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:c*a+"em"}),t.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s<n.length;s++)v(n[s])}function v(t){var r,n=t.type,a={};if("a"===n){r="a";var s=t.target,c=t.href,u=t.popup;c&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":c},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else r="tspan";t.style&&(a.style=t.style);var f=document.createElementNS(i.svg,r);if("sup"===n||"sub"===n){A(o,p),o.appendChild(f);var m=document.createElementNS(i.svg,"tspan");A(m,p),e.select(m).attr("dy",d[n]),a.dy=h[n],o.appendChild(f),o.appendChild(m)}else o.appendChild(f);e.select(f).attr(a),o=t.node=f,l.push(t)}function A(t,e){t.appendChild(document.createTextNode(e))}function M(t){if(1!==l.length){var e=l.pop();t!==e.type&&r.log("Start tag <"+e.type+"> doesnt match end tag <"+t+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag </"+t+">.",n)}var L=x.test(n);L?f():(o=t,l=[{node:t}]);for(var P=n.split(g),I=0;I<P.length;I++){var z=P[I],O=z.match(y),D=O&&O[2].toLowerCase(),R=u[D];if("br"===D)f();else if(void 0===R)A(o,C(z));else if(O[1])M(D);else{var F=O[4],B={type:D},j=T(F,b);if(j?(j=j.replace(S,"$1 fill:"),R&&(j+=";"+R)):R&&(j=R),j&&(B.style=j),"a"===D){s=!0;var N=T(F,_);if(N){var U=E(N);U&&(B.href=U,B.target=T(F,w)||"_blank",B.popup=T(F,k))}}v(B)}}return s}(f.node(),M);n&&f.style("pointer-events","all"),t.positionText(f),A&&A.call(f)}};var s=/(<|&lt;|&#60;)/g,l=/(>|&gt;|&#62;)/g,c=[["$","$"],["\\(","\\)"]],u={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p="\u200b",f=["http:","https:","mailto:","",void 0,":"],m=t.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;t.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var S=/(^|;)\s*color:/;t.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(g),a=[],o="",s=0,l=0;l<i.length;l++){var c=i[l],u=c.match(y),h=u&&u[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(a.push(c),o=h);else{var d=c.length;if(s+d<r)a.push(c),s+=d;else if(s<r){var p=r-s;o&&("br"!==o||p<=3||d<=3)&&a.pop(),r>3?a.push(c.substr(0,p-3)+"..."):a.push(c.substr(0,p));break}o=""}}return a.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(M,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):A[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==f.indexOf(i)&&-1!==f.indexOf(a)?e:""}function L(t,e,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=C,t.sanitizeHTML=function(t){t=t.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=t.split(g),o=0;o<a.length;o++){var s=a[o],l=s.match(y),c=l&&l[2].toLowerCase();if(c in u)if(l[1])i.length&&(n=i.pop());else{var h=l[4],d=T(h,b),p=d?{style:d}:{};if("a"===c){var f=T(h,_);if(f){var v=E(f);if(v){p.href=v;var x=T(h,w);x&&(p.target=x)}}}var k=document.createElement(c);n.appendChild(k),e.select(k).attr(p),n=k,i.push(k)}else n.appendChild(document.createTextNode(C(s)))}return r.innerHTML},t.lineCount=function(t){return t.selectAll("tspan.line").size()||1},t.positionText=function(t,r,n){return t.each((function(){var t=e.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",r),o=i("y",n);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})}))};var P="1px ";t.makeTextShadow=function(t){return P+P+P+t+", -"+P+"-"+P+P+t+", "+P+"-"+P+P+t+", -"+P+P+P+t},t.makeEditable=function(t,r){var n=r.gd,i=r.delegate,a=e.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=e.select(n).select(".svg-container"),o=i.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12),u=r.text;void 0===u&&(u=t.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:r.fill||s.fill||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(L(t,i,r)).on("blur",(function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var r,i=e.select(this).attr("class");(r=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(r).style({opacity:0});var o=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),a.edit.call(t,o)})).on("focus",(function(){var t=this;n._editing=!0,e.select(document).on("mouseup",(function(){if(e.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===e.event.which?(n._editing=!1,t.style({opacity:1}),e.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),e.select(this).call(L(t,i,r)))})).on("keydown",(function(){13===e.event.which&&this.blur()})).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return r.immediate?s():o.on("click",s),e.rebind(t,a,"on")}}}),Me=d({"src/components/colorscale/helpers.js"(t,e){var r=v(),n=O(),i=k(),a=se(),o=q(),s=U().isValid,l=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function u(t){var e,r,n,i=t._colorAx,a=i||t,o={};for(r=0;r<l.length;r++)o[n=l[r]]=a[n];if(i)for(e="c",r=0;r<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in a||(s="z"+n)in a)&&(o[n]=a[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==c.indexOf(t)?e+t:t;a[n]=a["_"+n]=r},o}function h(t){for(var e=u(t),r=e.min,n=e.max,i=e.reversescale?d(e.colorscale):e.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var c=i[l];o[l]=r+c[0]*(n-r),s[l]=c[1]}return{domain:o,range:s}}function d(t){for(var e=t.length,r=new Array(e),n=e-1,i=0;n>=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var a=t.domain,s=t.range,l=s.length,c=new Array(l),u=0;u<l;u++){var h=n(s[u]).toRgb();c[u]=[h.r,h.g,h.b,h.a]}var d,p=r.scale.linear().domain(a).range(c).clamp(!0),m=e.noNumericCheck,g=e.returnArray;return(d=m&&g?p:m?function(t){return f(p(t))}:g?function(t){return i(t)?p(t):n(t).isValid()?t:o.defaultLine}:function(t){return i(t)?f(p(t)):n(t).isValid()?t:o.defaultLine}).domain=p.domain,d.range=function(){return s},d}function f(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return n(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?a.nestedProperty(t,e).get()||{}:t,o=n[r||"color"];o&&o._inputArray&&(o=o._inputArray);var l=!1;if(a.isArrayOrTypedArray(o))for(var c=0;c<o.length;c++)if(i(o[c])){l=!0;break}return a.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||a.isPlainObject(n.colorbar))},extractOpts:u,extractScale:h,flipScale:d,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(t,e){return p(h(t),e)}}}}),Ce=d({"src/plots/cartesian/axis_format_attributes.js"(t,e){var r=zt(),n=r.FORMAT_LINK,i=r.DATE_FORMAT_LINK;function a(t,e){return["Sets the "+t+" formatting rule"+(e?"for `"+e+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+n+"."].join(" ")}function o(t,e){return a(t,e)+[" And for dates see: "+i+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}e.exports={axisHoverFormat:function(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?a:o)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:a,descriptionWithDates:o}}}),Ee=d({"src/plots/cartesian/layout_attributes.js"(t,e){var r=R(),n=V(),i=It().dash,a=D().extendFlat,o=ge().templatedArray,s=Ce().descriptionWithDates,l=T().ONEDAY,c=ye(),u=c.HOUR_PATTERN,h=c.WEEKDAY_PATTERN,d={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},p=a({},d,{values:d.values.slice().concat(["sync"])});function f(t){return{valType:"integer",min:0,dflt:t?5:0,editType:"ticks"}}var m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},y={valType:"data_array",editType:"ticks"},v={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function x(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=5),e}function b(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=1),e}var _={valType:"color",dflt:n.defaultLine,editType:"ticks"},w={valType:"color",dflt:n.lightLine,editType:"ticks"};function k(t){var e={valType:"number",min:0,editType:"ticks"};return t||(e.dflt=1),e}var S=a({},i,{editType:"ticks"}),A={valType:"boolean",editType:"ticks"};e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:n.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:r({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[c.idRegex.x.toString(),c.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"calc"},rangebreaks:o("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[h,u,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:p,nticks:f(),tick0:m,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:y,ticktext:{valType:"data_array",editType:"ticks"},ticks:v,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:x(),tickwidth:b(),tickcolor:_,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:a({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:r({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:s("tick label")},tickformatstops:o("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:s("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:A,gridcolor:w,gridwidth:k(),griddash:S,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},minor:{tickmode:d,nticks:f("minor"),tick0:m,dtick:g,tickvals:y,ticks:v,ticklen:x("minor"),tickwidth:b("minor"),tickcolor:_,gridcolor:w,gridwidth:k("minor"),griddash:S,showgrid:A,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Le=d({"src/components/colorbar/attributes.js"(t,e){var r=Ee(),n=R(),i=D().extendFlat,a=Pt().overrideAll;e.exports=a({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:r.linecolor,outlinewidth:r.linewidth,bordercolor:r.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:i({},r.ticks,{dflt:""}),ticklabeloverflow:i({},r.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:n({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,title:{text:{valType:"string"},font:n({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}}),Pe=d({"src/components/colorscale/attributes.js"(t,e){var r=Le(),n=H().counter,i=Wt(),a=U().scales;function o(t){return"`"+t+"`"}i(a),e.exports=function(t,e){t=t||"";var i,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===s,u="string"===typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,h=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(i=e.colorAttr,e.colorAttr):o(d+(i={z:"z",c:"color"}[s]));var p=s+"auto",f=s+"min",m=s+"max",g=s+"mid",y=(o(d+p),o(d+f),o(d+m),{});y[f]=y[m]=void 0;var v={};v[p]=!1;var x={};return"color"===i&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},e.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},x[f]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=r),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:n("coloraxis"),dflt:null,editType:"calc"}),x}}}),Ie=d({"src/components/colorscale/layout_attributes.js"(t,e){var r=D().extendFlat,n=Pe(),i=U().scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:r({_isSubplotObj:!0,editType:"calc"},n("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}}),ze=d({"src/components/colorbar/has_colorbar.js"(t,e){var r=se();e.exports=function(t){return r.isPlainObject(t.colorbar)}}}),Oe=d({"src/plots/cartesian/clean_ticks.js"(t){var e=k(),r=se(),n=T(),i=n.ONEDAY,a=n.ONEWEEK;t.dtick=function(t,r){var n="log"===r,a="date"===r,o="category"===r,s=a?i:1;if(!t)return s;if(e(t))return(t=Number(t))<=0?s:o?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!==typeof t||!a&&!n)return s;var l=t.charAt(0),c=t.substr(1);return(c=e(c)?Number(c):0)<=0||!(a&&"M"===l&&c===Math.round(c)||n&&"L"===l||n&&"D"===l&&(1===c||2===c))?s:t},t.tick0=function(t,n,i,o){return"date"===n?r.cleanDate(t,r.dateTick0(i,o%a===0?1:0)):"D1"!==o&&"D2"!==o?e(t)?Number(t):0:void 0}}}),De=d({"src/plots/cartesian/tick_value_defaults.js"(t,e){var r=Oe(),n=se().isArrayOrTypedArray,i=M().isTypedArraySpec,a=M().decodeTypedArraySpec;e.exports=function(t,e,o,s,l){l||(l={});var c=l.isMinor,u=c?t.minor||{}:t,h=c?e.minor:e,d=c?"minor.":"";function p(t){var e=u[t];return i(e)&&(e=a(e)),void 0!==e?e:(h._template||{})[t]}var f=p("tick0"),m=p("dtick"),g=p("tickvals"),y=o(d+"tickmode",n(g)?"array":m?"linear":"auto");if("auto"===y||"sync"===y)o(d+"nticks");else if("linear"===y){var v=h.dtick=r.dtick(m,s);h.tick0=r.tick0(f,s,e.calendar,v)}else"multicategory"!==s&&(void 0===o(d+"tickvals")?h.tickmode="auto":c||o("ticktext"))}}}),Re=d({"src/plots/cartesian/tick_mark_defaults.js"(t,e){var r=se(),n=Ee();e.exports=function(t,e,i,a){var o=a.isMinor,s=o?t.minor||{}:t,l=o?e.minor:e,c=o?n.minor:n,u=o?"minor.":"",h=r.coerce2(s,l,c,"ticklen",o?.6*(e.ticklen||5):void 0),d=r.coerce2(s,l,c,"tickwidth",o?e.tickwidth||1:void 0),p=r.coerce2(s,l,c,"tickcolor",(o?e.tickcolor:void 0)||l.color);i(u+"ticks",!o&&a.outerTicks||h||d||p?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}}}),Fe=d({"src/plots/cartesian/show_dflt.js"(t,e){e.exports=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}}}),Be=d({"src/plots/array_container_defaults.js"(t,e){var r=se(),n=ge();e.exports=function(t,e,i){var a,o,s=i.name,l=i.inclusionAttr||"visible",c=e[s],u=r.isArrayOrTypedArray(t[s])?t[s]:[],h=e[s]=[],d=n.arrayTemplater(e,s,l);for(a=0;a<u.length;a++){var p=u[a];r.isPlainObject(p)?o=d.newItem(p):(o=d.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&i.handleItemDefaults(p,o,e,i),h.push(o)}var f=d.defaultItems();for(a=0;a<f.length;a++)(o=f[a])._index=h.length,i.handleItemDefaults({},o,e,i,{}),h.push(o);if(r.isArrayOrTypedArray(c)){var m=Math.min(c.length,h.length);for(a=0;a<m;a++)r.relinkPrivateKeys(h[a],c[a])}return h}}}),je=d({"src/plots/cartesian/tick_label_defaults.js"(t,e){var r=se(),n=q().contrast,i=Ee(),a=Fe(),o=Be();function s(t,e){function n(n,a){return r.coerce(t,e,i.tickformatstops,n,a)}n("enabled")&&(n("dtickrange"),n("value"))}e.exports=function(t,e,l,c,u){u||(u={});var h=l("labelalias");r.isPlainObject(h)||delete e.labelalias;var d=a(t);if(l("showticklabels")){u.noTicklabelshift||l("ticklabelshift"),u.noTicklabelstandoff||l("ticklabelstandoff");var p=u.font||{},f=e.color,m=-1!==(e.ticklabelposition||"").indexOf("inside")?n(u.bgColor):f&&f!==i.color.dflt?f:p.color;if(r.coerceFont(l,"tickfont",p,{overrideDflt:{color:m}}),u.noTicklabelstep||"multicategory"===c||"log"===c||l("ticklabelstep"),!u.noAng){var g=l("tickangle");u.noAutotickangles||"auto"!==g||l("autotickangles")}if("category"!==c){var y=l("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),e.tickformatstops.length||delete e.tickformatstops,u.noExp||y||"date"===c||(l("showexponent",d),l("exponentformat"),l("minexponent"),l("separatethousands"))}}}}}),Ne=d({"src/plots/cartesian/prefix_suffix_defaults.js"(t,e){var r=Fe();e.exports=function(t,e,n,i,a){a||(a={});var o=a.tickSuffixDflt,s=r(t);n("tickprefix")&&n("showtickprefix",s),n("ticksuffix",o)&&n("showticksuffix",s)}}}),Ue=d({"src/components/colorbar/defaults.js"(t,e){var r=se(),n=ge(),i=De(),a=Re(),o=je(),s=Ne(),l=Le();e.exports=function(t,e,c){var u=n.newContainer(e,"colorbar"),h=t.colorbar||{};function d(t,e){return r.coerce(h,u,l,t,e)}var p=c.margin||{t:0,b:0,l:0,r:0},f=c.width-p.l-p.r,m=c.height-p.t-p.b,g="v"===d("orientation"),y=d("thicknessmode");d("thickness","fraction"===y?30/(g?f:m):30);var v=d("lenmode");d("len","fraction"===v?1:g?m:f);var x,b,_,w="paper"===d("yref"),k="paper"===d("xref"),T="left";g?(_="middle",T=k?"left":"right",x=k?1.02:1,b=.5):(_=w?"bottom":"top",T="center",x=.5,b=w?1.02:1),r.coerce(h,u,{x:{valType:"number",min:k?-2:0,max:k?3:1,dflt:x}},"x"),r.coerce(h,u,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:b}},"y"),d("xanchor",T),d("xpad"),d("yanchor",_),d("ypad"),r.noneOrAll(h,u,["x","y"]),d("outlinecolor"),d("outlinewidth"),d("bordercolor"),d("borderwidth"),d("bgcolor");var S=r.coerce(h,u,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:g?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");d("ticklabeloverflow",-1!==S.indexOf("inside")?"hide past domain":"hide past div"),i(h,u,d,"linear");var A=c.font,M={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:A};-1!==S.indexOf("inside")&&(M.bgColor="black"),s(h,u,d,"linear",M),o(h,u,d,"linear",M),a(h,u,d,"linear",M),d("title.text",c._dfltTitle.colorbar);var C=u.showticklabels?u.tickfont:A,E=r.extendFlat({},A,{family:C.family,size:r.bigFont(C.size)});r.coerceFont(d,"title.font",E),d("title.side",g?"top":"right")}}}),Ve=d({"src/components/colorscale/defaults.js"(t,e){var r=k(),n=se(),i=ze(),a=Ue(),o=U().isValid,s=Vt().traceIs;function l(t,e){var r=e.slice(0,e.length-1);return e?n.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,c,u,h,d){var p=d.prefix,f=d.cLetter,m="_module"in c,g=l(e,p),y=l(c,p),v=l(c._template||{},p)||{},x=function(){return delete e.coloraxis,delete c.coloraxis,t(e,c,u,h,d)};if(m){var b=u._colorAxes||{},_=h(p+"coloraxis");if(_){var w=s(c,"contour")&&n.nestedProperty(c,"contours.coloring").get()||"heatmap",k=b[_];return void(k?(k[2].push(x),k[0]!==w&&(k[0]=!1,n.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,c,[x]])}}var T=g[f+"min"],S=g[f+"max"],A=r(T)&&r(S)&&T<S;h(p+f+"auto",!A)?h(p+f+"mid"):(h(p+f+"min"),h(p+f+"max"));var M,C,E=g.colorscale,L=v.colorscale;void 0!==E&&(M=!o(E)),void 0!==L&&(M=!o(L)),h(p+"autocolorscale",M),h(p+"colorscale"),h(p+"reversescale"),"marker.line."!==p&&(p&&m&&(C=i(g)),h(p+"showscale",C)&&(p&&v&&(y._template=v),a(g,y,u)))}}}),qe=d({"src/components/colorscale/layout_defaults.js"(t,e){var r=se(),n=ge(),i=Ie(),a=Ve();e.exports=function(t,e){function o(n,a){return r.coerce(t,e,i,n,a)}o("colorscale.sequential"),o("colorscale.sequentialminus"),o("colorscale.diverging");var s,l,c=e._colorAxes;function u(t,e){return r.coerce(s,l,i.coloraxis,t,e)}for(var h in c){var d=c[h];if(d[0])s=t[h]||{},(l=n.newContainer(e,h,"coloraxis"))._name=h,a(s,l,e,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<d[2].length;p++)d[2][p]();delete e._colorAxes[h]}}}}}),$e=d({"src/components/colorscale/cross_trace_defaults.js"(t,e){var r=se(),n=Me().hasColorscale,i=Me().extractOpts;e.exports=function(t,e){function a(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,n){var o=n.container?r.nestedProperty(t,n.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&a(o,n.min),(l||void 0===s.max)&&a(o,n.max),s.autocolorscale&&a(o,"colorscale")}}for(var s=0;s<t.length;s++){var l=t[s],c=l._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(l,c[u]);else o(l,c);n(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var h in e._colorAxes)o(e[h],{min:"cmin",max:"cmax"})}}}),He=d({"src/components/colorscale/calc.js"(t,e){var r=k(),n=se(),i=Me().extractOpts;e.exports=function(t,e,a){var o,s=t._fullLayout,l=a.vals,c=a.containerStr,u=c?n.nestedProperty(e,c).get():e,h=i(u),d=!1!==h.auto,p=h.min,f=h.max,m=h.mid,g=function(){return n.aggNums(Math.min,null,l)},y=function(){return n.aggNums(Math.max,null,l)};void 0===p?p=g():d&&(p=u._colorAx&&r(p)?Math.min(p,g()):g()),void 0===f?f=y():d&&(f=u._colorAx&&r(f)?Math.max(f,y()):y()),d&&void 0!==m&&(f-m>m-p?p=m-(f-m):f-m<m-p&&(f=m+(m-p))),p===f&&(p-=.5,f+=.5),h._sync("min",p),h._sync("max",f),h.autocolorscale&&(o=p*f<0?s.colorscale.diverging:p>=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),We=d({"src/components/colorscale/index.js"(t,e){var r=U(),n=Me();e.exports={moduleType:"component",name:"colorscale",attributes:Pe(),layoutAttributes:Ie(),supplyLayoutDefaults:qe(),handleDefaults:Ve(),crossTraceDefaults:$e(),calc:He(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),Ge=d({"src/traces/scatter/subtypes.js"(t,e){var r=se(),n=M().isTypedArraySpec;e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return r.isPlainObject(e)&&(r.isArrayOrTypedArray(e.size)||n(e.size))}}}}),Ye=d({"src/traces/scatter/make_bubble_size_func.js"(t,e){var r=k();e.exports=function(t,e){e||(e=2);var n=t.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var n=o(t/e);return r(n)&&n>0?Math.max(n,a):0}}}}),Ze=d({"src/components/fx/helpers.js"(t){var e=se();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(e,r){if("splom"===e.type){for(var n=e.xaxes||[],i=e.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==r.indexOf(n[a]+i[o]))return!0;return!1}return-1!==r.indexOf(t.getSubplot(e))},t.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},t.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},t.getDistanceFunction=function(e,r,n,i){return"closest"===e?i||t.quadrature(r,n):"x"===e.charAt(0)?r:n},t.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=1/0,i=t.length,a=0;a<i;a++)(n=e(t[a]))<=r.distance&&(r.index=a,r.distance=n);return r},t.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},t.quadrature=function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},t.makeEventData=function(e,r,n){var i="index"in e?e.index:e.pointNumber,a={data:r._input,fullData:r,curveNumber:r.index,pointNumber:i};if(r._indexToPoints){var o=r._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return r._module.eventData?a=r._module.eventData(a,e,r,n,i):("xVal"in e?a.x=e.xVal:"x"in e&&(a.x=e.x),"yVal"in e?a.y=e.yVal:"y"in e&&(a.y=e.y),e.xa&&(a.xaxis=e.xa),e.ya&&(a.yaxis=e.ya),void 0!==e.zLabelVal&&(a.z=e.zLabelVal)),t.appendArrayPointValue(a,r,i),a},t.appendArrayPointValue=function(t,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===t[c]){var u=i(e.nestedProperty(r,l).get(),a);void 0!==u&&(t[c]=u)}}},t.appendArrayMultiPointValues=function(t,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===t[c]){for(var u=e.nestedProperty(r,l).get(),h=new Array(a.length),d=0;d<a.length;d++)h[d]=i(u,a[d]);t[c]=h}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function n(t){return r[t]||t}function i(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var a={x:!0,y:!0},o={"x unified":!0,"y unified":!0};t.isUnifiedHover=function(t){return"string"===typeof t&&!!o[t]},t.isXYhover=function(t){return"string"===typeof t&&!!a[t]}}}),Xe=d({"node_modules/parse-svg-path/index.js"(t,e){e.exports=function(t){var e=[];return t.replace(n,(function(t,n,a){var o=n.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),e.push(a);if(a.length<r[o])throw new Error("malformed path data");e.push([n].concat(a.splice(0,r[o])))}})),e};var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi}}),Ke=d({"src/components/drawing/symbol_defs.js"(t,e){var r,n,i,a,o=Xe(),s=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},l="M0,0Z",c=Math.sqrt(2),u=Math.sqrt(3),h=Math.PI,d=Math.cos,p=Math.sin;function f(t){return null===t}function m(t,e,s){if((!t||t%360===0)&&!e)return s;if(i===t&&a===e&&r===s)return n;function l(t,r){var n=d(t),i=p(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}i=t,a=e,r=s;for(var c=t/180*h,u=0,f=0,m=o(s),g="",y=0;y<m.length;y++){var v=m[y],x=v[0],b=u,_=f;if("M"===x||"L"===x)u=+v[1],f=+v[2];else if("m"===x||"l"===x)u+=+v[1],f+=+v[2];else if("H"===x)u=+v[1];else if("h"===x)u+=+v[1];else if("V"===x)f=+v[1];else if("v"===x)f+=+v[1];else if("A"===x){u=+v[1],f=+v[2];var w=l(c,[+v[6],+v[7]]);v[6]=w[0],v[7]=w[1],v[3]=+v[3]+t}"H"!==x&&"V"!==x||(x="L"),"h"!==x&&"v"!==x||(x="l"),"m"!==x&&"l"!==x||(u-=b,f-=_);var k=l(c,[u,f]);"H"!==x&&"V"!==x||(x="L"),"M"!==x&&"L"!==x&&"m"!==x&&"l"!==x||(v[1]=k[0],v[2]=k[1]),v[0]=x,g+=v[0]+v.slice(1).join(",")}return n=g,g}e.exports={circle:{n:0,f:function(t,e,r){if(f(e))return l;var n=s(t,2),i="M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z";return r?m(e,r,i):i}},square:{n:1,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")}},diamond:{n:2,f:function(t,e,r){if(f(e))return l;var n=s(1.3*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"Z")}},cross:{n:3,f:function(t,e,r){if(f(e))return l;var n=s(.4*t,2),i=s(1.2*t,2);return m(e,r,"M"+i+","+n+"H"+n+"V"+i+"H-"+n+"V"+n+"H-"+i+"V-"+n+"H-"+n+"V-"+i+"H"+n+"V-"+n+"H"+i+"Z")}},x:{n:4,f:function(t,e,r){if(f(e))return l;var n=s(.8*t/c,2),i="l"+n+","+n,a="l"+n+",-"+n,o="l-"+n+",-"+n,u="l-"+n+","+n;return m(e,r,"M0,"+n+i+a+o+a+o+u+o+u+i+u+i+"Z")}},"triangle-up":{n:5,f:function(t,e,r){if(f(e))return l;var n=s(2*t/u,2);return m(e,r,"M-"+n+","+s(t/2,2)+"H"+n+"L0,-"+s(t,2)+"Z")}},"triangle-down":{n:6,f:function(t,e,r){if(f(e))return l;var n=s(2*t/u,2);return m(e,r,"M-"+n+",-"+s(t/2,2)+"H"+n+"L0,"+s(t,2)+"Z")}},"triangle-left":{n:7,f:function(t,e,r){if(f(e))return l;var n=s(2*t/u,2);return m(e,r,"M"+s(t/2,2)+",-"+n+"V"+n+"L-"+s(t,2)+",0Z")}},"triangle-right":{n:8,f:function(t,e,r){if(f(e))return l;var n=s(2*t/u,2);return m(e,r,"M-"+s(t/2,2)+",-"+n+"V"+n+"L"+s(t,2)+",0Z")}},"triangle-ne":{n:9,f:function(t,e,r){if(f(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M-"+i+",-"+n+"H"+n+"V"+i+"Z")}},"triangle-se":{n:10,f:function(t,e,r){if(f(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M"+n+",-"+i+"V"+n+"H-"+i+"Z")}},"triangle-sw":{n:11,f:function(t,e,r){if(f(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M"+i+","+n+"H-"+n+"V-"+i+"Z")}},"triangle-nw":{n:12,f:function(t,e,r){if(f(e))return l;var n=s(.6*t,2),i=s(1.2*t,2);return m(e,r,"M-"+n+","+i+"V-"+n+"H"+i+"Z")}},pentagon:{n:13,f:function(t,e,r){if(f(e))return l;var n=s(.951*t,2),i=s(.588*t,2),a=s(-t,2),o=s(-.309*t,2);return m(e,r,"M"+n+","+o+"L"+i+","+s(.809*t,2)+"H-"+i+"L-"+n+","+o+"L0,"+a+"Z")}},hexagon:{n:14,f:function(t,e,r){if(f(e))return l;var n=s(t,2),i=s(t/2,2),a=s(t*u/2,2);return m(e,r,"M"+a+",-"+i+"V"+i+"L0,"+n+"L-"+a+","+i+"V-"+i+"L0,-"+n+"Z")}},hexagon2:{n:15,f:function(t,e,r){if(f(e))return l;var n=s(t,2),i=s(t/2,2),a=s(t*u/2,2);return m(e,r,"M-"+i+","+a+"H"+i+"L"+n+",0L"+i+",-"+a+"H-"+i+"L-"+n+",0Z")}},octagon:{n:16,f:function(t,e,r){if(f(e))return l;var n=s(.924*t,2),i=s(.383*t,2);return m(e,r,"M-"+i+",-"+n+"H"+i+"L"+n+",-"+i+"V"+i+"L"+i+","+n+"H-"+i+"L-"+n+","+i+"V-"+i+"Z")}},star:{n:17,f:function(t,e,r){if(f(e))return l;var n=1.4*t,i=s(.225*n,2),a=s(.951*n,2),o=s(.363*n,2),c=s(.588*n,2),u=s(-n,2),h=s(-.309*n,2),d=s(.118*n,2),p=s(.809*n,2);return m(e,r,"M"+i+","+h+"H"+a+"L"+o+","+d+"L"+c+","+p+"L0,"+s(.382*n,2)+"L-"+c+","+p+"L-"+o+","+d+"L-"+a+","+h+"H-"+i+"L0,"+u+"Z")}},hexagram:{n:18,f:function(t,e,r){if(f(e))return l;var n=s(.66*t,2),i=s(.38*t,2),a=s(.76*t,2);return m(e,r,"M-"+a+",0l-"+i+",-"+n+"h"+a+"l"+i+",-"+n+"l"+i+","+n+"h"+a+"l-"+i+","+n+"l"+i+","+n+"h-"+a+"l-"+i+","+n+"l-"+i+",-"+n+"h-"+a+"Z")}},"star-triangle-up":{n:19,f:function(t,e,r){if(f(e))return l;var n=s(t*u*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),c="A "+o+","+o+" 0 0 1 ";return m(e,r,"M-"+n+","+i+c+n+","+i+c+"0,-"+a+c+"-"+n+","+i+"Z")}},"star-triangle-down":{n:20,f:function(t,e,r){if(f(e))return l;var n=s(t*u*.8,2),i=s(.8*t,2),a=s(1.6*t,2),o=s(4*t,2),c="A "+o+","+o+" 0 0 1 ";return m(e,r,"M"+n+",-"+i+c+"-"+n+",-"+i+c+"0,"+a+c+n+",-"+i+"Z")}},"star-square":{n:21,f:function(t,e,r){if(f(e))return l;var n=s(1.1*t,2),i=s(2*t,2),a="A "+i+","+i+" 0 0 1 ";return m(e,r,"M-"+n+",-"+n+a+"-"+n+","+n+a+n+","+n+a+n+",-"+n+a+"-"+n+",-"+n+"Z")}},"star-diamond":{n:22,f:function(t,e,r){if(f(e))return l;var n=s(1.4*t,2),i=s(1.9*t,2),a="A "+i+","+i+" 0 0 1 ";return m(e,r,"M-"+n+",0"+a+"0,"+n+a+n+",0"+a+"0,-"+n+a+"-"+n+",0Z")}},"diamond-tall":{n:23,f:function(t,e,r){if(f(e))return l;var n=s(.7*t,2),i=s(1.4*t,2);return m(e,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},"diamond-wide":{n:24,f:function(t,e,r){if(f(e))return l;var n=s(1.4*t,2),i=s(.7*t,2);return m(e,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},hourglass:{n:25,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"H-"+n+"L"+n+",-"+n+"H-"+n+"Z")},noDot:!0},bowtie:{n:26,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"V-"+n+"L-"+n+","+n+"V-"+n+"Z")},noDot:!0},"circle-cross":{n:27,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t,e,r){if(f(e))return l;var n=s(t,2),i=s(t/c,2);return m(e,r,"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t,e,r){if(f(e))return l;var n=s(1.3*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM0,-"+n+"V"+n+"M-"+n+",0H"+n)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t,e,r){if(f(e))return l;var n=s(1.3*t,2),i=s(.65*t,2);return m(e,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM-"+i+",-"+i+"L"+i+","+i+"M-"+i+","+i+"L"+i+",-"+i)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t,e,r){if(f(e))return l;var n=s(1.4*t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t,e,r){if(f(e))return l;var n=s(1.2*t,2),i=s(.85*t,2);return m(e,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t,e,r){if(f(e))return l;var n=s(t/2,2),i=s(t,2);return m(e,r,"M"+n+","+i+"V-"+i+"M"+(n-i)+",-"+i+"V"+i+"M"+i+","+n+"H-"+i+"M-"+i+","+(n-i)+"H"+i)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t,e,r){if(f(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+n+","+a+"L0,0M"+n+","+a+"L0,0M0,-"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t,e,r){if(f(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+n+",-"+a+"L0,0M"+n+",-"+a+"L0,0M0,"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t,e,r){if(f(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M"+a+","+n+"L0,0M"+a+",-"+n+"L0,0M-"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t,e,r){if(f(e))return l;var n=s(1.2*t,2),i=s(1.6*t,2),a=s(.8*t,2);return m(e,r,"M-"+a+","+n+"L0,0M-"+a+",-"+n+"L0,0M"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t,e,r){if(f(e))return l;var n=s(1.4*t,2);return m(e,r,"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t,e,r){if(f(e))return l;var n=s(1.4*t,2);return m(e,r,"M0,"+n+"V-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M"+n+","+n+"L-"+n+",-"+n)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M0,0L-"+n+","+s(2*t,2)+"H"+n+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M0,0L-"+n+",-"+s(2*t,2)+"H"+n+"Z")},noDot:!0},"arrow-left":{n:47,f:function(t,e,r){if(f(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,0L"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-right":{n:48,f:function(t,e,r){if(f(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,0L-"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M-"+n+",0H"+n+"M0,0L-"+n+","+s(2*t,2)+"H"+n+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t,e,r){if(f(e))return l;var n=s(t,2);return m(e,r,"M-"+n+",0H"+n+"M0,0L-"+n+",-"+s(2*t,2)+"H"+n+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t,e,r){if(f(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,-"+i+"V"+i+"M0,0L"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t,e,r){if(f(e))return l;var n=s(2*t,2),i=s(t,2);return m(e,r,"M0,-"+i+"V"+i+"M0,0L-"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(t,e,r){if(f(e))return l;var n=h/2.5,i=2*t*d(n),a=2*t*p(n);return m(e,r,"M0,0L"+-i+","+a+"L"+i+","+a+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(t,e,r){if(f(e))return l;var n=h/4,i=2*t*d(n),a=2*t*p(n);return m(e,r,"M0,0L"+-i+","+a+"A "+2*t+","+2*t+" 0 0 1 "+i+","+a+"Z")},backoff:.4,noDot:!0}}}}),Je=d({"src/components/drawing/index.js"(t,e){var r=v(),n=se(),i=n.numberFormat,a=k(),o=O(),s=Vt(),l=q(),c=We(),u=n.strTranslate,h=Ae(),d=Te(),p=Se().LINE_SPACING,f=$().DESELECTDIM,m=Ge(),g=Ye(),y=Ze().appendArrayPointValue,x=e.exports={};function b(t){return"none"===t?void 0:t}x.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,a=e.color,o=e.size,s=e.family,c=e.shadow,u=e.lineposition,d=e.textcase;s&&t.style("font-family",s),o+1&&t.style("font-size",o+"px"),a&&t.call(l.fill,a),i&&t.style("font-weight",i),n&&t.style("font-style",n),r&&t.style("font-variant",r),d&&t.style("text-transform",b(function(t){return _[t]}(d))),c&&t.style("text-shadow","auto"===c?h.makeTextShadow(l.contrast(a)):b(c)),u&&t.style("text-decoration-line",b(function(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(u)))};var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(t,e,r,n){var i=e.fillpattern,a=e.fillgradient,o=i&&x.getPatternAttr(i.shape,0,"");if(o){var s=x.getPatternAttr(i.bgcolor,0,null),c=x.getPatternAttr(i.fgcolor,0,null),u=i.fgopacity,h=x.getPatternAttr(i.size,0,8),d=x.getPatternAttr(i.solidity,0,.3),p=e.uid;x.pattern(t,"point",r,p,o,h,d,void 0,i.fillmode,s,c,u)}else if(a&&"none"!==a.type){var f,m,g=a.type,y="scatterfill-"+e.uid;n&&(y="legendfill-"+e.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===g&&(g+="reversed"),t.call(x.gradient,r,y,g,a.colorscale,"fill")):("horizontal"===g?(f={x:a.start,y:0},m={x:a.stop,y:0}):"vertical"===g&&(f={x:0,y:a.start},m={x:0,y:a.stop}),f.x=e._xA.c2p(void 0===f.x?e._extremes.x.min[0].val:f.x,!0),f.y=e._yA.c2p(void 0===f.y?e._extremes.y.min[0].val:f.y,!0),m.x=e._xA.c2p(void 0===m.x?e._extremes.x.max[0].val:m.x,!0),m.y=e._yA.c2p(void 0===m.y?e._extremes.y.max[0].val:m.y,!0),t.call(E,r,y,"linear",a.colorscale,"fill",f,m,!0,!1))}else e.fillcolor&&t.call(l.fill,e.fillcolor)}x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform",u(i,o)),!0)},x.translatePoints=function(t,e,n){t.each((function(t){var i=r.select(this);x.translatePoint(t,i,e,n)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var n=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,l=a.ycalendar,c=s.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,r.select(this),n,i,o,l)}))}))}},x.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,n,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";r.select(this).call(l.stroke,n||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t,e){var n=r.select(t.node());w(t,((n.data()[0]||[])[0]||{}).trace||{},e,!1)},x.fillGroupStyle=function(t,e,n){t.style("stroke-width",0).each((function(t){var i=r.select(this);t[0].trace&&w(i,t[0].trace,e,n)}))};var T=Ke();x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(T).forEach((function(t){var e=T[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var S=x.symbolNames.length;function A(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(a(t))t=+t;else if("string"===typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=S||t>=400?0:Math.floor(Math.max(t,0))};var M=i("~f"),C={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function E(t,e,i,a,s,c,u,h,d,p){var f,m=s.length;"linear"===a?f={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:d?"userSpaceOnUse":"objectBoundingBox"},reversed:p}:"radial"===a&&(f={node:"radialGradient",reversed:p});for(var g=new Array(m),y=0;y<m;y++)f.reversed?g[m-1-y]=[M(100*(1-s[y][0])),s[y][1]]:g[y]=[M(100*s[y][0]),s[y][1]];var v=e._fullLayout,x="g"+v._uid+"-"+i,b=v._defs.select(".gradients").selectAll("#"+x).data([a+g.join(";")],n.identity);b.exit().remove(),b.enter().append(f.node).each((function(){var t=r.select(this);f.attrs&&t.attr(f.attrs),t.attr("id",x);var e=t.selectAll("stop").data(g);e.exit().remove(),e.enter().append("stop"),e.each((function(t){var e=o(t[1]);r.select(this).attr({offset:t[0]+"%","stop-color":l.tinyRGB(e),"stop-opacity":e.getAlpha()})}))})),t.style(c,G(x,e)).style(c+"-opacity",null),t.classed("gradient_filled",!0)}x.gradient=function(t,e,r,n,i,a){var o=C[n];return E(t,e,r,o.type,i,a,o.start,o.stop,!1,o.reversed)},x.pattern=function(t,e,i,a,s,c,u,h,d,p,f,m){var g="legend"===e;h&&("overlay"===d?(p=h,f=l.contrast(p)):(p=void 0,f=h));var y,v,x,b,_,w,k,T,S,A,M,C=i._fullLayout,E="p"+C._uid+"-"+a,L={},P=o(f),I=l.tinyRGB(P),z=m*P.getAlpha();switch(s){case"/":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",L={d:x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"\\":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",L={d:x="M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"x":y=c*Math.sqrt(2),v=c*Math.sqrt(2),x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2+"M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,b=c-c*Math.sqrt(1-u),w="path",L={d:x,opacity:z,stroke:I,"stroke-width":b+"px"};break;case"|":w="path",w="path",L={d:x="M"+(y=c)/2+",0L"+y/2+","+(v=c),opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"-":w="path",w="path",L={d:x="M0,"+(v=c)/2+"L"+(y=c)+","+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"+":w="path",x="M"+(y=c)/2+",0L"+y/2+","+(v=c)+"M0,"+v/2+"L"+y+","+v/2,b=c-c*Math.sqrt(1-u),w="path",L={d:x,opacity:z,stroke:I,"stroke-width":b+"px"};break;case".":y=c,v=c,u<Math.PI/4?_=Math.sqrt(u*c*c/Math.PI):(k=u,T=Math.PI/4,S=1,A=c/2,M=c/Math.sqrt(2),_=A+(M-A)*(k-T)/(S-T)),w="circle",L={cx:y/2,cy:v/2,r:_,opacity:z,fill:I}}var O=[s||"noSh",p||"noBg",f||"noFg",c,u].join(";"),D=C._defs.select(".patterns").selectAll("#"+E).data([O],n.identity);D.exit().remove(),D.enter().append("pattern").each((function(){var t=r.select(this);if(t.attr({id:E,width:y+"px",height:v+"px",patternUnits:"userSpaceOnUse",patternTransform:g?"scale(0.8)":""}),p){var e=o(p),n=l.tinyRGB(e),i=e.getAlpha(),a=t.selectAll("rect").data([0]);a.exit().remove(),a.enter().append("rect").attr({width:y+"px",height:v+"px",fill:n,"fill-opacity":i})}var s=t.selectAll(w).data([0]);s.exit().remove(),s.enter().append(w).attr(L)})),t.style("fill",G(E,i)).style("fill-opacity",null),t.classed("pattern_filled",!0)},x.initGradients=function(t){var e=t._fullLayout;n.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),r.select(t).selectAll(".gradient_filled").classed("gradient_filled",!1)},x.initPatterns=function(t){var e=t._fullLayout;n.ensureSingle(e._defs,"g","patterns").selectAll("pattern").remove(),r.select(t).selectAll(".pattern_filled").classed("pattern_filled",!1)},x.getPatternAttr=function(t,e,r){return t&&n.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t},x.pointStyle=function(t,e,n,i){if(t.size()){var a=x.makePointStyleFns(e);t.each((function(t){x.singlePointStyle(t,r.select(this),e,a,n,i)}))}},x.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker,c=s.line;if(o&&o.i>=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),i.ms2mrc){var u;u="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=u,i.selectedSizeFn&&(u=t.mrc=i.selectedSizeFn(t));var h=x.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var d=st(t,r),p=X(t,r);e.attr("d",A(h,u,d,p))}var f,m,g,y=!1;if(t.so)g=c.outlierwidth,m=c.outliercolor,f=s.outliercolor;else{var v=(c||{}).width;g=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(f=l.defaultLine,y=!0),f="mc"in t?t.mcc=i.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(f=i.selectedColorFn(t))}if(t.om)e.call(l.stroke,f).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var b=s.gradient,_=t.mgt;_?y=!0:_=b&&b.type,n.isArrayOrTypedArray(_)&&(_=_[0],C[_]||(_=0));var w=s.pattern,k=w&&x.getPatternAttr(w.shape,t.i,"");if(_&&"none"!==_){var T=t.mgc;T?y=!0:T=b.color;var S=r.uid;y&&(S+="-"+t.i),x.gradient(e,a,S,_,[[0,T],[1,f]],"fill")}else if(k){var M=!1,E=w.fgcolor;!E&&o&&o.color&&(E=o.color,M=!0);var L=x.getPatternAttr(E,t.i,o&&o.color||null),P=x.getPatternAttr(w.bgcolor,t.i,null),I=w.fgopacity,z=x.getPatternAttr(w.size,t.i,8),O=x.getPatternAttr(w.solidity,t.i,.3);M=M||t.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var D=r.uid;M&&(D+="-"+t.i),x.pattern(e,"point",a,D,k,z,O,t.mcc,w.fillmode,P,L,I)}else n.isArrayOrTypedArray(f)?l.fill(e,f[t.i]):l.fill(e,f);g&&l.stroke(e,m)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),s.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&n.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,d=void 0!==u,p=void 0!==h;(n.isArrayOrTypedArray(c)||d||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?u:e:p?h:f*e});var m=a.color,g=o.color,y=l.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,f))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];n.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",n.selectedOpacityFn(e))})),n.selectedColorFn&&a.push((function(t,e){l.fill(t,n.selectedColorFn(e))})),n.selectedSizeFn&&a.push((function(t,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);t.attr("d",A(x.symbolNumber(a),o,st(r,e),X(r,e))),r.mrc2=o})),a.length&&t.each((function(t){for(var e=r.select(this),n=0;n<a.length;n++)a[n](e,t)}))}},x.tryColorscale=function(t,e){var r=e?n.nestedProperty(t,e).get():t;if(r){var i=r.color;if((r.colorscale||r._colorAx)&&n.isArrayOrTypedArray(i))return c.makeColorScaleFuncFromTrace(r)}return n.identity};var L,P,I={start:1,end:-1,middle:0,bottom:1,top:-1};function z(t,e,n,i,a){var o=r.select(t.node().parentNode),s=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",l=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",c=i?i/.8+1:0,d=(h.lineCount(t)-1)*p+1,f=I[l]*c,m=.75*n+I[s]*c+(I[s]-1)*d*n/2;t.attr("text-anchor",l),a||o.attr("transform",u(f,m))}function D(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?r:0}function R(t,e,r){return r&&(t=V(t)),e?B(t[1]):F(t[0])}function F(t){var e=r.round(t,2);return L=e,e}function B(t){var e=r.round(t,2);return P=e,e}function j(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,d=3*c*(l+c),p=3*l*(l+c);return[[F(e[0]+(d&&u/d)),B(e[1]+(d&&h/d))],[F(e[0]-(p&&u/p)),B(e[1]-(p&&h/p))]]}x.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each((function(t){var o=r.select(this),c=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,d=u?u(t,e,l):{},p={};y(p,e,t.i);var f=e._meta||{};c=n.texttemplateString(c,d,l._d3locale,p,t,f)}var m=t.tp||e.textposition,g=D(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:v}).text(c).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,c=D(t,e);l.fill(i,a);var u=s.traceIs(e,"bar-like");z(i,o,c,t.mrc2||t.mrc,u)}))}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(j(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},x.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,a=[j(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(j(t[r-1],t[r],t[r+1],e));for(a.push(j(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+t[0]+"Z"};var N={hv:function(t,e,r){return"H"+F(e[0])+"V"+R(e,1,r)},vh:function(t,e,r){return"V"+B(e[1])+"H"+R(e,0,r)},hvh:function(t,e,r){return"H"+F((t[0]+e[0])/2)+"V"+B(e[1])+"H"+R(e,0,r)},vhv:function(t,e,r){return"V"+B((t[1]+e[1])/2)+"H"+F(e[0])+"V"+R(e,1,r)}},U=function(t,e,r){return"L"+R(e,0,r)+","+R(e,1,r)};function V(t,e){var r=t.backoff,i=t.trace,a=t.d,o=t.i;if(r&&i&&i.marker&&i.marker.angle%360===0&&i.line&&"spline"!==i.line.shape){var s=n.isArrayOrTypedArray(r),l=t,c=e?e[0]:L||0,u=e?e[1]:P||0,h=l[0],d=l[1],p=h-c,f=d-u,m=Math.atan2(f,p),g=s?r[o]:r;if("auto"===g){var y=l.i;"scatter"===i.type&&y--;var v=l.marker,b=v.symbol;n.isArrayOrTypedArray(b)&&(b=b[y]);var _=v.size;n.isArrayOrTypedArray(_)&&(_=_[y]),g=v?x.symbolBackOffs[x.symbolNumber(b)]*_:0,g+=x.getMarkerStandoff(a[y],i)||0}var w=h-g*Math.cos(m),k=d-g*Math.sin(m);(w<=h&&w>=c||w>=h&&w<=c)&&(k<=d&&k>=u||k>=d&&k<=u)&&(t=[w,k])}return t}x.steps=function(t){var e=N[t]||U;return function(t){for(var r="M"+F(t[0][0])+","+B(t[0][1]),n=t.length,i=1;i<n;i++)r+=e(t[i-1],t[i],i===n-1);return r}},x.applyBackoff=V,x.makeTester=function(){var t=n.ensureSingleById(r.select("body"),"svg","js-plotly-tester",(function(t){t.attr(d.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),e=n.ensureSingle(t,"path","js-reference-point",(function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));x.tester=t,x.testref=e},x.savedBBoxes={};var H=0;function W(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function G(t,e){if(!t)return null;var r=e._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+t+"')":"url(#"+t+")"}x.bBox=function(t,e,i){var a,o,s;if(i||(i=W(t)),i){if(a=x.savedBBoxes[i])return n.extendFlat({},a)}else if(1===t.childNodes.length){var l=t.childNodes[0];if(i=W(l)){var c=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=x.bBox(l,!1,i);return c&&(p.left+=c,p.right+=c),u&&(p.top+=u,p.bottom+=u),p}if(i+="~"+c+"~"+u+"~"+d,a=x.savedBBoxes[i])return n.extendFlat({},a)}}e?o=t:(s=x.tester.node(),o=t.cloneNode(!0),s.appendChild(o)),r.select(o).attr("transform",null).call(h.positionText,0,0);var f=o.getBoundingClientRect(),m=x.testref.node().getBoundingClientRect();e||s.removeChild(o);var g={height:f.height,width:f.width,left:f.left-m.left,top:f.top-m.top,right:f.right-m.left,bottom:f.bottom-m.top};return H>=1e4&&(x.savedBBoxes={},H=0),i&&(x.savedBBoxes[i]=g),H++,n.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",G(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var Z=/translate\([^)]*\)\s*$/;function X(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,n){t&&t.each((function(){var t,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(Z);t=1===e&&1===n?[]:[u(o,s),"scale("+e+","+n+")",u(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=X;var K,J,Q,tt,et,rt,nt=Math.atan2,it=Math.cos,at=Math.sin;function ot(t,e){var r=e[0],n=e[1];return[r*it(t)-n*at(t),r*at(t)+n*it(t)]}function st(t,e){var r,i,o=t.ma;void 0===o&&((o=e.marker.angle)&&!n.isArrayOrTypedArray(o)||(o=0));var s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],i=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;r=c.c2p(t.x),i=u.c2p(t.y)}if(e._geo){var h,d=t.lonlat[0],p=t.lonlat[1],f=e._geo.project([d,p+1e-5]),m=e._geo.project([d+1e-5,p]),g=nt(m[1]-i,m[0]-r),y=nt(f[1]-i,f[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var v=d/180*Math.PI,x=p/180*Math.PI,b=K/180*Math.PI,_=J/180*Math.PI,w=b-v,k=it(_)*at(w),T=at(_)*it(x)-it(_)*at(x)*it(w);h=-nt(k,T)-Math.PI,K=d,J=p}var S=ot(g,[it(h),0]),A=ot(y,[at(h),0]);o=nt(S[1]+A[1],S[0]+A[0])/Math.PI*180,"previous"!==s||rt===e.uid&&t.i===et+1||(o=null)}if("previous"===s&&!e._geo)if(rt===e.uid&&t.i===et+1&&a(r)&&a(i)){var M=r-Q,C=i-tt,E=e.line&&e.line.shape||"",L=E.slice(E.length-1);"h"===L&&(C=0),"v"===L&&(M=0),o+=nt(C,M)/Math.PI*180+90}else o=null}return Q=r,tt=i,et=t.i,rt=e.uid,o}x.getMarkerAngle=st}}),Qe=d({"src/components/titles/index.js"(t,e){var r=v(),n=k(),i=ke(),a=Vt(),o=se(),s=o.strTranslate,l=Je(),c=q(),u=Ae(),h=$(),d=Se().OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,f){var m,g=t._fullLayout,y=f.propContainer,v=f.propName,x=f.placeholder,b=f.traceIndex,_=f.avoid||{},w=f.attributes,k=f.transform,T=f.containerGroup,S=1,A=y.title,M=(A&&A.text?A.text:"").trim(),C=!1,E=A&&A.font?A.font:{},L=E.family,P=E.size,I=E.color,z=E.weight,O=E.style,D=E.variant,R=E.textcase,F=E.lineposition,B=E.shadow,j=!!f.subtitlePropName,N=f.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,$=1,H=U.font,W=H.family,G=H.size,Y=H.color,Z=H.weight,X=H.style,K=H.variant,J=H.textcase,Q=H.lineposition,tt=H.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(p," % ")===e.replace(p," % ")}""===M?S=0:rt(M,x)&&(et||(M=""),S=.2,C=!0),j&&(""===V?$=0:rt(V,N)&&(et||(V=""),$=.2,q=!0)),f._meta?M=o.templateString(M,f._meta):g._meta&&(M=o.templateString(M,g._meta));var nt,it=M||V||et;T||(T=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=T.selectAll("text."+e).data(it?[0]:[]);at.enter().append("text"),at.text(M).attr("class",e),at.exit().remove();var ot=null,st=e+"-subtitle",lt=V||et;if(j&&lt&&((ot=T.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return T;function ct(t,e){o.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(n){var a,h=n.title,d=n.subtitle;if(!k&&nt&&(k={}),k?(a="",k.rotate&&(a+="rotate("+[k.rotate,w.x,w.y]+")"),(k.offset||nt)&&(a+=s(0,(k.offset||0)-(nt||0)))):a=null,h.attr("transform",a),h.style("opacity",S*c.opacity(I)).call(l.font,{color:c.rgb(I),size:r.round(P,2),family:L,weight:z,style:O,variant:D,textcase:R,shadow:B,lineposition:F}).attr(w).call(u.convertToTspans,t,(function(t){if(t){var e=r.select(t.node().parentNode).select("."+st);if(!e.empty()){var n=t.node().getBBox();if(n.height){var i=n.y+n.height+1.6*G;e.attr("y",i)}}}})),d){var p=T.select("."+e+"-math-group"),f=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*G:f.y+f.height+1.6*G,y=o.extendFlat({},w,{y:g});d.attr("transform",a),d.style("opacity",$*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(G,2),family:W,weight:Z,style:X,variant:K,textcase:J,shadow:tt,lineposition:Q}).attr(y).call(u.convertToTspans,t)}return i.previousPromises(t)}function ht(e){var i=e.title,a=r.select(i.node().parentNode);if(_&&_.selection&&_.side&&M){a.attr("transform",null);var c=d[_.side],u="left"===_.side||"top"===_.side?-1:1,h=n(_.pad)?_.pad:2,p=l.bBox(a.node()),f={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var b=m[v][x];f[x]=Math.max(f[x],b)}var w={left:f.l,top:f.t,right:g.width-f.r,bottom:g.height-f.b},k=_.maxShift||u*(w[_.side]-p[_.side]),T=0;if(k<0)T=k;else{var S=_.offsetLeft||0,A=_.offsetTop||0;p.left-=S,p.right-=S,p.top-=A,p.bottom-=A,_.selection.each((function(){var t=l.bBox(this);o.bBoxIntersect(p,t,h)&&(T=Math.max(T,u*(t[_.side]-p[c])+h))})),T=Math.min(k,T),y._titleScoot=Math.abs(T)}if(T>0||k<0){var C={left:[-T,0],right:[T,0],top:[0,-T],bottom:[0,T]}[_.side];a.attr("transform",s(C[0],C[1]))}}}function dt(t,e){t.text(e).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(at.call(ct,ot),et&&(M?at.on(".opacity",null):(dt(at,x),C=!0),at.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?a.call("_guiRestyle",t,v,e,b):a.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),j)){if(j&&!M){var pt=at.node().getBBox(),ft=pt.y+pt.height+1.6*G;ot.attr("y",ft)}V?ot.on(".opacity",null):(dt(ot,N),q=!0),ot.call(u.makeEditable,{gd:t}).on("edit",(function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",C),ot&&ot.classed("js-placeholder",q),T},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),tr=d({"src/plots/cartesian/set_convert.js"(t,e){var r=v(),n=b().utcFormat,i=se(),a=i.numberFormat,o=k(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,d=T(),p=d.FP_SAFE,f=d.BADNUM,m=d.LOG_CLIP,g=d.ONEWEEK,y=d.ONEDAY,x=d.ONEHOUR,_=d.ONEMIN,w=d.ONESEC,S=ve(),A=ye(),M=A.HOUR_PATTERN,C=A.WEEKDAY_PATTERN;function E(t){return Math.pow(10,t)}function L(t){return null!==t&&void 0!==t}e.exports=function(t,e){e=e||{};var d=t._id||"x",v=d.charAt(0);function b(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return f}function k(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=c(e,n||t.calendar);if(s===f){if(!o(e))return f;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);s=c(new Date(u))+l/10}return s}function T(e,r,n){return l(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(L(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"===typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function O(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function D(t){return o(t)?+t:z(t)}function R(t,e,n){return r.round(n+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return o(e)?R(e,t._m,t._b):f},j=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var N="y"===v;B=function(e){if(!o(e))return f;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=N;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,s=0,l=0;l<r;l++){var c=i*t._rangebreaks[l].min,u=i*t._rangebreaks[l].max;if(a<c)break;if(!(a>u)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},j=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;i<r&&!(e<t._rangebreaks[i].pmin);i++)e>t._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?b:u,t.l2c="log"===t.type?E:u,t.l2p=B,t.p2l=j,t.c2p="log"===t.type?function(t,e){return B(b(t,e))}:B,t.p2c="log"===t.type?function(t){return E(j(t))}:j,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=j,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return b(s(t),e)},t.r2d=t.r2c=function(t){return E(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=b,t.l2d=E,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return E(j(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=j,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=k,t.c2d=t.c2r=t.l2d=t.l2r=T,t.d2p=t.r2p=function(e,r,n){return t.l2p(k(e,0,n))},t.p2d=t.p2r=function(t,e,r){return T(j(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,f,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return"string"===typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=O,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return Array.isArray(t)||"string"===typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(r){var n,a,o=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var l in s)if(l!==d){var c=e[S.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],p=[];for(n=0;n<o.length;n++){var f=r[o[n]];if(v in f){var m=f[v],g=f._length||i.minRowLength(m);if(h(m[0])&&h(m[1]))for(a=0;a<g;a++){var y=m[0][a],x=m[1][a];L(y)&&L(x)&&(p.push([y,x]),y in u[0][1]||(u[0][1][y]=u[0][0]++),x in u[1][1]||(u[1][1][x]=u[1][0]++))}}}for(p.sort((function(t,e){var r=u[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var i=u[1][1];return i[t[1]]-i[e[1]]})),n=0;n<p.length;n++)I(p[n])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.limitRange=function(e){var r=t.minallowed,n=t.maxallowed;if(void 0!==r||void 0!==n){e||(e="range");var a=i.nestedProperty(t,e).get(),o=i.simpleMap(a,t.r2l),s=o[1]<o[0];s&&o.reverse();var l=i.simpleMap([r,n],t.r2l);if(void 0!==r&&o[0]<l[0]&&(a[s?1:0]=r),void 0!==n&&o[1]>l[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var d=u+1;void 0!==r&&(d=Math.max(d,c)),a[s?0:1]=d}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=i.nestedProperty(t,e).get();if(a=(a="date"===t.type?i.dfltRange(t.calendar):"y"===v?A.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||A.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"!==t.type||t.autorange||(s[0]=i.cleanDate(s[0],f,t.calendar),s[1]=i.cleanDate(s[1],f,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var u=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(u-1e3),s[1]=t.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-p?s[n]=-p:s[n]>p&&(s[n]=p),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=S.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===v;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._lBreaks+=Math.abs(l.max-l.min);var d=h;c>u&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._B.push(t._B[t._B.length-1]-p*t._m2*(l.max-l.min));for(s=0;s<t._rangebreaks.length;s++)(l=t._rangebreaks[s]).pmin=B(l.min),l.pmax=B(l.max)}if(!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.maskBreaks=function(e){var r,n,a,o,l,c=t.rangebreaks||[];c._cachedPatterns||(c._cachedPatterns=c.map((function(e){return e.enabled&&e.bounds?i.simpleMap(e.bounds,e.pattern?s:t.d2c):null}))),c._cachedValues||(c._cachedValues=c.map((function(e){return e.enabled&&e.values?i.simpleMap(e.values,t.d2c).sort(i.sorterAsc):null})));for(var u=0;u<c.length;u++){var h=c[u];if(h.enabled)if(h.bounds){var d=h.pattern;switch(n=(r=c._cachedPatterns[u])[0],a=r[1],d){case C:o=(l=new Date(e)).getUTCDay(),n>a&&(a+=7,o<n&&(o+=7));break;case M:o=(l=new Date(e)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>a&&(a+=24,o<n&&(o+=24));break;case"":o=e}if(o>=n&&o<a)return f}else for(var p=c._cachedValues[u],m=0;m<p.length;m++)if(a=(n=p[m])+h.dvalue,e>=n&&e<a)return f}return e},t.locateBreaks=function(e,r){var n,a,o,l,c=[];if(!t.rangebreaks)return c;var u=t.rangebreaks.slice().sort((function(t,e){return t.pattern===C&&e.pattern===M?-1:e.pattern===C&&t.pattern===M?1:0})),h=function(t,n){if((t=i.constrain(t,e,r))!==(n=i.constrain(n,e,r))){for(var a=!0,o=0;o<c.length;o++){var s=c[o];t<s.max&&n>=s.min&&(t<s.min&&(s.min=t),n>s.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n<u.length;n++){var d=u[n];if(d.enabled)if(d.bounds){var p=e,f=r;d.pattern&&(p=Math.floor(p)),o=(a=i.simpleMap(d.bounds,d.pattern?s:t.r2l))[0],l=a[1];var m,v,b=new Date(p);switch(d.pattern){case C:v=g,m=(l-o+(l<o?7:0))*y,p+=o*y-(b.getUTCDay()*y+b.getUTCHours()*x+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;case M:v=y,m=(l-o+(l<o?24:0))*x,p+=o*x-(b.getUTCHours()*x+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),m=v=(f=Math.max(a[0],a[1]))-p}for(var k=p;k<f;k+=v)h(k,k+m)}else for(var T=i.simpleMap(d.values,t.d2c),S=0;S<T.length;S++)h(o=T[S],l=o+d.dvalue)}return c.sort((function(t,e){return t.min-e.min})),c},t.makeCalcdata=function(e,r,n){var a,o,s,l,c=t.type,u="date"===c&&e[r+"calendar"];if(r in e){if(a=e[r],l=e._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===c||"log"===c)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===c)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var i=(t[0]||[])[n],a=(t[1]||[])[n];r[n]=z([i,a])}return r}(a,l);for(o=new Array(l),s=0;s<l;s++)o[s]=t.d2c(a[s],0,u,n)}else{var h=r+"0"in e?t.d2c(e[r+"0"],0,u):0,d=e["d"+r]?Number(e["d"+r]):1;for(a=e[{x:"y",y:"x"}[r]],l=e._length||a.length,o=new Array(l),s=0;s<l;s++)o[s]=h+s*d}if(t.rangebreaks)for(s=0;s<l;s++)o[s]=t.maskBreaks(o[s]);return o},t.isValidRange=function(e,r){return Array.isArray(e)&&2===e.length&&(r&&null===e[0]||o(t.r2l(e[0])))&&(r&&null===e[1]||o(t.r2l(e[1])))},t.getAutorangeDflt=function(e,r){var n=!t.isValidRange(e,"nullOk");return n&&r&&r.reverseDflt?n="reversed":e&&(null===e[0]&&null===e[1]?n=!0:null===e[0]&&null!==e[1]?n="min":null!==e[0]&&null===e[1]&&(n="max")),n},t.isReversed=function(){var e=t.autorange;return"reversed"===e||"min reversed"===e||"max reversed"===e},t.isPtWithinRange=function(e,r){var n=t.c2l(e[v],null,r),i=t.r2l(t.range[0]),a=t.r2l(t.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},t._emptyCategories=function(){t._categories=[],t._categoriesMap={}},t.clearCalc=function(){var r=t._matchGroup;if(r){var n=null,i=null;for(var a in r){var o=e[S.id2name(a)];if(o._categories){n=o._categories,i=o._categoriesMap;break}}n&&i?(t._categories=n,t._categoriesMap=i):t._emptyCategories()}else t._emptyCategories();if(t._initialCategories)for(var s=0;s<t._initialCategories.length;s++)I(t._initialCategories[s])},t.sortByInitialCategories=function(){var r=[];if(t._emptyCategories(),t._initialCategories)for(var n=0;n<t._initialCategories.length;n++)I(t._initialCategories[n]);r=r.concat(t._traceIndices);var i=t._matchGroup;for(var a in i)if(d!==a){var o=e[S.id2name(a)];o._categories=t._categories,o._categoriesMap=t._categoriesMap,r=r.concat(o._traceIndices)}return r};var U=e._d3locale;"date"===t.type&&(t._dateFormat=U?U.timeFormat:n,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=U?U.numberFormat:a,delete t._minDtick,delete t._forceTick0}}}),er=d({"src/plots/cartesian/axis_autotype.js"(t,e){var r=k(),n=se(),i=T().BADNUM,a=n.isArrayOrTypedArray,o=n.isDateTime,s=n.cleanNumber,l=Math.round;function c(t,e){return e?r(t):"number"===typeof t}function u(t){return Math.max(1,(t-1)/1e3)}e.exports=function(t,e,n){var h=t,d=n.noMultiCategory;if(a(h)&&!h.length)return"-";if(!d&&function(t){return a(t[0])&&a(t[1])}(h))return"multicategory";if(d&&Array.isArray(h[0])){for(var p=[],f=0;f<h.length;f++)if(a(h[f]))for(var m=0;m<h[f].length;m++)p.push(h[f][m]);h=p}if(function(t,e){for(var n=t.length,i=u(n),a=0,s=0,c={},h=0;h<n;h+=i){var d=t[l(h)],p=String(d);c[p]||(c[p]=1,o(d,e)&&a++,r(d)&&s++)}return a>2*s}(h,e))return"date";var g="strict"!==n.autotypenumbers;return function(t,e){for(var r=t.length,n=u(r),a=0,o=0,c={},h=0;h<r;h+=n){var d=t[l(h)],p=String(d);if(!c[p]){c[p]=1;var f=typeof d;"boolean"===f?o++:(e?s(d)!==i:"number"===f)?a++:"string"===f&&o++}}return o>2*a}(h,g)?"category":function(t,e){for(var r=t.length,n=0;n<r;n++)if(c(t[n],e))return!0;return!1}(h,g)?"linear":"-"}}}),rr=d({"src/plots/cartesian/autorange.js"(t,e){var r=v(),n=k(),i=se(),a=T().FP_SAFE,o=Vt(),s=Je(),l=ve(),c=l.getFromId,u=l.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=f(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return i.simpleMap(e.range,e.r2l);var m=u[0].val,g=h[0].val;for(r=1;r<u.length&&m===g;r++)m=Math.min(m,u[r].val);for(r=1;r<h.length&&m===g;r++)g=Math.max(g,h[r].val);var y=e.autorange,v="reversed"===y||"min reversed"===y||"max reversed"===y;if(!v&&e.range){var x=i.simpleMap(e.range,e.r2l);v=x[1]<x[0]}"reversed"===e.autorange&&(e.autorange=!0);var b,_,w,k,T,A,M=e.rangemode,C="tozero"===M,E="nonnegative"===M,L=e._length,P=L/10,I=0;for(r=0;r<u.length;r++)for(b=u[r],n=0;n<h.length;n++)(A=(_=h[n]).val-b.val-d(e,b.val,_.val))>0&&((T=L-s(b)-l(_))>P?A/T>I&&(w=b,k=_,I=A/T):A/L>I&&(w={val:b.val,nopad:1},k={val:_.val,nopad:1},I=A/L));if(m===g){var z=m-1,O=m+1;if(C)if(0===m)a=[0,1];else{var D=(m>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=m/(1-Math.min(.5,D/L));a=m>0?[0,R]:[R,0]}else a=E?[Math.max(0,z),Math.max(1,O)]:[z,O]}else C?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):E&&(w.val-I*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),I=(k.val-w.val-d(e,b.val,_.val))/(L-s(w)-l(k)),a=[w.val-I*s(w),k.val+I*l(k)];return a=S(a,e),e.limitRange&&e.limitRange(),v&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a<i.length;a++){var o=i[a];n+=o.max-o.min}return n}function p(t,e,n){var a=.05*e._length,o=e._anchorAxis||{};if(-1!==(e.ticklabelposition||"").indexOf("inside")||-1!==(o.ticklabelposition||"").indexOf("inside")){var l=e.isReversed();if(!l){var c=i.simpleMap(e.range,e.r2l);l=c[1]<c[0]}l&&(n=!n)}var h=0;return u(t,e._id)||(h=function(t,e,n){var a=0,o="x"===e._id.charAt(0);for(var l in t._plots){var c=t._plots[l];if(e._id===c.xaxis._id||e._id===c.yaxis._id){var u=(o?c.yaxis:c.xaxis)||{};if(-1!==(u.ticklabelposition||"").indexOf("inside")&&(!n&&("left"===u.side||"bottom"===u.side)||n&&("top"===u.side||"right"===u.side))){if(u._vals){var h=i.deg2rad(u._tickAngles[u._id+"tick"]||0),d=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));if(!u._vals[0].bb){var f=u._id+"tick";u._selections[f].each((function(t){var e=r.select(this);e.select(".text-math-group").empty()&&(t.bb=s.bBox(e.node()))}))}for(var m=0;m<u._vals.length;m++){var g=u._vals[m].bb;if(g){var y=6+g.width,v=6+g.height;a=Math.max(a,o?Math.max(y*d,v*p):Math.max(v*d,y*p))}}}"inside"===u.ticks&&"inside"===u.ticklabelposition&&(a+=u.ticklen||0)}}}return a}(t,e,n)),a=Math.max(h,a),"domain"===e.constrain&&e._inputDomain&&(a*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(t){return t.nopad?0:t.pad+(t.extrapad?a:h)}}function f(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,u=[],h=[];function d(t,e){for(n=0;n<e.length;n++){var r=t[e[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(i=0;i<s.min.length;i++)a=s.min[i],m(u,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],g(h,a.val,a.pad,{extrapad:a.extrapad})}}}if(d(s,e._traceIndices),d(l.annotations||[],e._annIndices||[]),d(l.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r)for(var p in e._matchGroup)if(p!==e._id){var y=c(t,p),v=f(t,y,!0),x=e._length/y._length;for(i=0;i<v.min.length;i++)a=v.min[i],m(u,a.val,a.pad*x,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],g(h,a.val,a.pad*x,{extrapad:a.extrapad})}return{min:u,max:h}}function m(t,e,r,n){y(t,e,r,n,b)}function g(t,e,r,n){y(t,e,r,n,_)}function y(t,e,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var c=t[l];if(i(c.val,e)&&c.pad>=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return n(t)&&Math.abs(t)<a}function b(t,e){return t<=e}function _(t,e){return t>=e}function w(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))<(r=t.d2l(r))}function S(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],n=t[1],a=e.autorangeoptions.include;if(void 0!==a){var o=e.d2l(r),s=e.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l<a.length;l++){var c=e.d2l(a[l]);o>=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&w(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&w(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}e.exports={applyAutorangeOptions:S,getAutoRange:h,makePadFn:p,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():h(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=h(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,c,u,h,d,p,f=[],y=[],v=e.length,b=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1,T=r.vpadLinearized||!1;function S(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var A=S((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=S((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=S(r.vpadplus||r.vpad),E=S(r.vpadminus||r.vpad);if(!k){if(d=1/0,p=-1/0,w)for(i=0;i<v;i++)(o=e[i])<d&&o>0&&(d=o),o>p&&o<a&&(p=o);else for(i=0;i<v;i++)(o=e[i])<d&&o>-a&&(d=o),o>p&&o<a&&(p=o);e=[d,p],v=2}var L={tozero:_,extrapad:b};function P(r){s=e[r],n(s)&&(u=A(r),h=M(r),T?(l=t.c2l(s)-E(r),c=t.c2l(s)+C(r)):(d=s-E(r),p=s+C(r),w&&d<p/10&&(d=p/10),l=t.c2l(d),c=t.c2l(p)),_&&(l=Math.min(0,l),c=Math.max(0,c)),x(l)&&m(f,l,h,L),x(c)&&g(y,c,u,L))}var I=Math.min(6,v);for(i=0;i<I;i++)P(i);for(i=v-1;i>=I;i--)P(i);return{min:f,max:y,opts:r}},concatExtremes:f}}}),nr=d({"src/plots/cartesian/axes.js"(t,e){var r=v(),n=k(),i=ke(),a=Vt(),o=se(),s=o.strTranslate,l=Ae(),c=Qe(),u=q(),h=Je(),d=Ee(),p=Oe(),f=T(),m=f.ONEMAXYEAR,g=f.ONEAVGYEAR,y=f.ONEMINYEAR,x=f.ONEMAXQUARTER,b=f.ONEAVGQUARTER,_=f.ONEMINQUARTER,w=f.ONEMAXMONTH,S=f.ONEAVGMONTH,A=f.ONEMINMONTH,M=f.ONEWEEK,C=f.ONEDAY,E=C/2,L=f.ONEHOUR,P=f.ONEMIN,I=f.ONESEC,z=f.ONEMILLI,O=f.ONEMICROSEC,D=f.MINUS_SIGN,R=f.BADNUM,F={K:"zeroline"},B={K:"gridline",L:"path"},j={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},$=Se(),H=$.MID_SHIFT,W=$.CAP_SHIFT,G=$.LINE_SPACING,Y=$.OPPOSITE_SIDE,Z=e.exports={};Z.setConvert=tr();var X=er(),K=ve(),J=K.idSort,Q=K.isLinked;Z.id2name=K.id2name,Z.name2id=K.name2id,Z.cleanId=K.cleanId,Z.list=K.list,Z.listIds=K.listIds,Z.getFromId=K.getFromId,Z.getFromTrace=K.getFromTrace;var tt=rr();function et(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}Z.getAutoRange=tt.getAutoRange,Z.findExtremes=tt.findExtremes,Z.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"===typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"===typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,u,c)},Z.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},Z.coercePosition=function(t,e,r,n,i,a){var s,l;if("range"!==Z.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=Z.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}t[i]=s(l)},Z.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:Z.getFromId(e,r).cleanPos)(t)},Z.redrawComponents=function(t,e){e=e||Z.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;u<e.length;u++)for(var h=r[Z.id2name(e[u])][o],d=0;d<h.length;d++){var p=h[d];if(!c[p]&&(l(t,p),c[p]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0),n("selections","drawOne","_selectionIndices")};var rt=Z.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(o.isArrayOrTypedArray(a)){if(i={type:X(n,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},Z.setConvert(i),"category"===i.type)for(var s=0;s<n.length;s++)i.d2c(n[s])}else i=Z.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:it,c2d:it}:{d2c:nt,c2d:nt}};function nt(t){return+t}function it(t){return String(t)}function at(t,e){return Math.abs((t/e+.5)%1-.5)<.001}function ot(t,e){return Math.abs(t/e-1)<.001}function st(t){return+t.substring(1)}function lt(t,e){return t.rangebreaks&&(e=e.filter((function(e){return t.maskBreaks(e.x)!==R}))),e}function ct(t){var e=t._mainAxis,r=[];if(e._vals)for(var n=0;n<e._vals.length;n++)if(!e._vals[n].noTick){var i=e.l2p(e._vals[n].x),a=t.p2l(i),o=Z.tickText(t,a);e._vals[n].minor&&(o.minor=!0,o.text=""),r.push(o)}return r=lt(t,r)}function ut(t,e){var r=et(o.simpleMap(t.range,t.r2l)),n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var s=[],l=0;l<=1;l++)if((void 0===e||!(e&&l||!1===e&&!l))&&(!l||t.minor)){var c=l?t.minor.tickvals:t.tickvals,u=l?[]:t.ticktext;if(c){o.isArrayOrTypedArray(u)||(u=[]);for(var h=0;h<c.length;h++){var d=a(c[h]);if(d>n&&d<i){var p=Z.tickText(t,d,!1,String(u[h]));l&&(p.minor=!0,p.text=""),s.push(p)}}}}return s=lt(t,s)}Z.getDataToCoordFunc=function(t,e,r,n){return rt(t,e,r,n).d2c},Z.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},Z.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Z.saveRangeInitial=function(t,e){for(var r=Z.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial0&&void 0===a._rangeInitial1,s=o||a.range[0]!==a._rangeInitial0||a.range[1]!==a._rangeInitial1,l=a.autorange;(o&&!0!==l||e&&s)&&(a._rangeInitial0="min"===l||"max reversed"===l?void 0:a.range[0],a._rangeInitial1="max"===l||"min reversed"===l?void 0:a.range[1],a._autorangeInitial=l,n=!0)}return n},Z.saveShowSpikeInitial=function(t,e){for(var r=Z.list(t,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==i||o.showspikes||(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,n},Z.autoBin=function(t,e,r,i,a,s){var l,c=o.aggNums(Math.min,null,t),u=o.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:u-c};if(a||(a=e.calendar),l="log"===e.type?{type:"linear",range:[c,u]}:{type:e.type,range:o.simpleMap([c,u],e.c2r,0,a),calendar:a},Z.setConvert(l),s=s&&p.dtick(s,l.type))l.dtick=s,l.tick0=p.tick0(void 0,l.type,a);else{var h;if(r)h=(u-c)/r;else{var d=o.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),m=f*o.roundUp(d.minDiff/f,[.9,1.9,4.9,9.9],!0);h=Math.max(m,2*o.stdev(t)/Math.pow(t.length,i?.25:.4)),n(h)||(h=1)}Z.autoTicks(l,h)}var g,y=l.dtick,v=Z.tickIncrement(Z.tickFirst(l),y,"reverse",a);if("number"===typeof y)v=function(t,e,r,i,a){var o=0,s=0,l=0,c=0;function u(e){return(1+100*(e-t)/r.dtick)%100<2}for(var h=0;h<e.length;h++)e[h]%1===0?l++:n(e[h])||c++,u(e[h])&&o++,u(e[h]+r.dtick/2)&&s++;var d=e.length-c;if(l===d&&"date"!==r.type)r.dtick<1?t=i-.5*r.dtick:(t-=.5)+r.dtick<i&&(t+=r.dtick);else if(s<.1*d&&(o>.3*d||u(i)||u(a))){var p=r.dtick/2;t+=t+p<i?p:-p}return t}(v,t,l,c,u),g=v+(1+Math.floor((u-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(t,e,r,n,i){var a=o.findExactDates(e,i),s=.8;if(a.exactDays>s){var l=Number(r.substr(1));a.exactYears>s&&l%12===0?t=Z.tickIncrement(t,"M6","reverse")+1.5*C:a.exactMonths>s?t=Z.tickIncrement(t,"M1","reverse")+15.5*C:t-=E;var c=Z.tickIncrement(t,r);if(c<=n)return c}return t}(v,t,y,c,a)),g=v;g<=u;)g=Z.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},Z.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var i,a=e.dtick&&n(e._tmin);if(a){var s=Z.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,.99*s+.01*e._tmin]}else{var l=o.simpleMap(e.range,e.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(t.range=o.simpleMap(i,e.l2r),t._isMinor=!0,Z.prepTicks(t,r),a){var c=n(e.dtick),u=n(t.dtick),h=c?e.dtick:+e.dtick.substring(1),d=u?t.dtick:+t.dtick.substring(1);c&&u?at(h,d)?h===2*M&&d===2*C&&(t.dtick=M):h===2*M&&d===3*C?t.dtick=M:h!==M||(e._input.minor||{}).nticks?ot(h/d,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=C:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":at(h,d)?h>=12&&2===d&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?at(h,d)||(t.dtick=ot(h/d,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Z.prepTicks=function(t,e){var r=o.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var i,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(i=t.tickfont?o.bigFont(t.tickfont.size||12):15,a=t._length/i):(i="y"===t._id.charAt(0)?40:80,a=o.constrain(t._length/i,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,Z.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i=r(),a=Z.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=L,o&&!i&&t.dtick<L&&(t.dtick=L)):/%p/.test(a)?(e=E,o&&!i&&t.dtick<E&&(t.dtick=E)):/%[Aadejuwx]/.test(a)?(e=C,o&&!i&&t.dtick<C&&(t.dtick=C)):/%[UVW]/.test(a)?(e=M,o&&!i&&t.dtick<M&&(t.dtick=M)):/%[Bbm]/.test(a)?(e=S,o&&(i?st(t.dtick)<1:t.dtick<A)&&(t.dtick="M1")):/%[q]/.test(a)?(e=b,o&&(i?st(t.dtick)<3:t.dtick<_)&&(t.dtick="M3")):/%[Yy]/.test(a)&&(e=g,o&&(i?st(t.dtick)<12:t.dtick<y)&&(t.dtick="M12")))}(i=r())&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0),t._definedDelta=e}(t),t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),xt(t)},Z.calcTicks=function(t,e){for(var r,i,a,s,l=t.type,c=t.calendar,u=t.ticklabelstep,h="period"===t.ticklabelmode,d=t.range[0]>t.range[1],p=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],f=o.simpleMap(t.range,t.r2l,void 0,void 0,e),v=f[1]<f[0],k=Math.min(f[0],f[1]),T=Math.max(f[0],f[1]),D=Math.max(1e3,t._length||0),F=[],B=[],j=[],N=[],U=[],V=t.minor&&(t.minor.ticks||t.minor.showgrid),q=1;q>=(V?0:1);q--){var $=!q;q?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var H=q?t:o.extendFlat({},t,t.minor);if($?Z.prepMinorTicks(H,t,e):Z.prepTicks(H,e),"array"!==H.tickmode)if("sync"!==H.tickmode){var W=et(f),G=W[0],Y=W[1],X=n(H.dtick),K="log"===l&&!(X||"L"===H.dtick.charAt(0)),J=Z.tickFirst(H,e);if(q){if(t._tmin=J,J<G!==v)break;"category"!==l&&"multicategory"!==l||(Y=v?Math.max(-.5,Y):Math.min(t._categories.length-.5,Y))}var Q,tt,rt=null,nt=J;q&&(X?tt=t.dtick:"date"===l?"string"===typeof t.dtick&&"M"===t.dtick.charAt(0)&&(tt=S*t.dtick.substring(1)):tt=t._roughDTick,Q=Math.round((t.r2l(nt)-t.r2l(t.tick0))/tt)-1);var it=H.dtick;for(H.rangebreaks&&H._tick0Init!==H.tick0&&(nt=jt(nt,t),v||(nt=Z.tickIncrement(nt,it,!v,c))),q&&h&&(nt=Z.tickIncrement(nt,it,!v,c),Q--);v?nt>=Y:nt<=Y;nt=Z.tickIncrement(nt,it,v,c)){if(q&&Q++,H.rangebreaks&&!v){if(nt<G)continue;if(H.maskBreaks(nt)===R&&jt(nt,H)>=T)break}if(j.length>D||nt===rt)break;rt=nt;var at={value:nt};q?(K&&nt!==(0|nt)&&(at.simpleLabel=!0),u>1&&Q%u&&(at.skipLabel=!0),j.push(at)):(at.minor=!0,N.push(at))}}else j=[],F=ct(t);else q?(j=[],F=ut(t,!$)):(N=[],B=ut(t,!$))}if(!N||N.length<2)p=!1;else{var ot=(N[1].value-N[0].value)*(d?-1:1);r=ot,i=t.tickformat,(/%f/.test(i)?r>=O:/%L/.test(i)?r>=z:/%[SX]/.test(i)?r>=I:/%M/.test(i)?r>=P:/%[HI]/.test(i)?r>=L:/%p/.test(i)?r>=E:/%[Aadejuwx]/.test(i)?r>=C:/%[UVW]/.test(i)?r>=M:/%[Bbm]/.test(i)?r>=A:/%[q]/.test(i)?r>=_:!/%[Yy]/.test(i)||r>=y)||(p=!1)}if(p){var st=j.concat(N);h&&j.length&&(st=st.slice(1)),(st=st.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){p.map((function(e){var r=t+e;r>=0&&r<st.length&&o.pushUnique(U,st[r])}))}))}else U=j;if(V&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var lt=j.map((function(t){return t.value})),ht=[],dt=0;dt<N.length;dt++){var pt=N[dt],ft=pt.value;if(-1===lt.indexOf(ft)){for(var mt=!1,gt=0;!mt&&gt<j.length;gt++)1e7+j[gt].value===1e7+ft&&(mt=!0);mt||ht.push(pt)}}N=ht}if(h&&function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n].value,a=n,o=n+1;n<t.length-1?(a=n,o=n+1):n>0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,d=0;h>=y?d=u>=y&&u<=m?u:g:r===b&&h>=_?d=u>=_&&u<=x?u:b:h>=A?d=u>=A&&u<=w?u:S:r===M&&h>=M?d=M:h>=C?d=C:r===E&&h>=E?d=E:r===L&&h>=L&&(d=L),d>=u&&(d=u,s=!0);var p=i+d;if(e.rangebreaks&&d>0){for(var f=0,v=0;v<84;v++){var k=(v+.5)/84;e.maskBreaks(i*(1-k)+k*p)!==R&&f++}(d*=f/84)||(t[n].drop=!0),s&&u>M&&(d=u)}(d>0||0===n)&&(t[n].periodX=i+d/2)}}(U,t,t._definedDelta),t.rangebreaks){var yt="y"===t._id.charAt(0),vt=1;"auto"===t.tickmode&&(vt=t.tickfont?t.tickfont.size:12);var xt=NaN;for(a=j.length-1;a>-1;a--)if(j[a].drop)j.splice(a,1);else{j[a].value=jt(j[a].value,t);var bt=t.c2p(j[a].value);(yt?xt>bt-vt:xt<bt+vt)?j.splice(v?a+1:a,1):xt=bt}}Bt(t)&&360===Math.abs(f[1]-f[0])&&j.pop(),t._tmax=(j[j.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var _t,wt=function(e){e.text="",t._prevDateHead=s};function kt(t,e){var r=Z.tickText(t,e.value,!1,e.simpleLabel),n=e.periodX;return void 0!==n&&(r.periodX=n,(n>T||n<k)&&(n>T&&(r.periodX=T),n<k&&(r.periodX=k),wt(r))),r}for(j=j.concat(N),a=0;a<j.length;a++){var Tt=j[a].minor,St=j[a].value;Tt?((_t=p&&-1!==U.indexOf(j[a])?kt(t,j[a]):{x:St}).minor=!0,B.push(_t)):(s=t._prevDateHead,_t=kt(t,j[a]),(j[a].skipLabel||p&&-1===U.indexOf(j[a]))&&wt(_t),F.push(_t))}return F=F.concat(B),t._inCalcTicks=!1,h&&F.length&&(F[0].noTick=!0),F};var ht=[2,5,10],dt=[1,2,3,6,12],pt=[1,2,5,10,15,30],ft=[1,2,3,7,14],mt=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],gt=[-.301,0,.301,.699,1],yt=[15,30,45,90,180];function vt(t,e,r){return e*o.roundUp(t/e,r)}function xt(t){var e=t.dtick;if(t._tickexponent=0,n(e)||"string"===typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),i=t.l2r(r).replace(/(^-|i)/g,""),a=i.length;if("M"===String(e).charAt(0))a>10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=C&&a<=10||e>=15*C)t._tickround="d";else if(e>=P&&a<=16||e>=L)t._tickround="M";else if(e>=I&&a<=19||e>=P)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(n(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);n(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(wt(t.exponentformat)&&!kt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function bt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}Z.autoTicks=function(t,e,r){var i;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar,0);var s=2*e;if(s>g)e/=g,i=a(10),t.dtick="M"+12*vt(e,i,ht);else if(s>S)e/=S,t.dtick="M"+vt(e,1,dt);else if(s>C){if(t.dtick=vt(e,C,t._hasDayOfWeekBreaks?[1,2,7,14]:ft),!r){var l=Z.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else s>L?t.dtick=vt(e,L,dt):s>P?t.dtick=vt(e,P,pt):s>I?t.dtick=vt(e,I,pt):(i=a(10),t.dtick=vt(e,i,ht))}else if("log"===t.type){t.tick0=0;var u=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),t.dtick="L"+vt(e,i,ht)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Bt(t)?(t.tick0=0,i=1,t.dtick=vt(e,i,yt)):(t.tick0=0,i=a(10),t.dtick=vt(e,i,ht));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!==typeof t.dtick){var d=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(d)}},Z.tickIncrement=function(t,e,i,a){var s=i?-1:1;if(n(e))return o.increment(t,s*e);var l=e.charAt(0),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?gt:mt,h=t+.01*s,d=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},Z.tickFirst=function(t,e){var i=t.r2l||Number,a=o.simpleMap(t.range,i,void 0,void 0,e),s=a[1]<a[0],l=s?Math.floor:Math.ceil,c=et(a)[0],u=t.dtick,h=i(t.tick0);if(n(u)){var d=l((c-h)/u)*u+h;return"category"!==t.type&&"multicategory"!==t.type||(d=o.constrain(d,0,t._categories.length-1)),d}var p=u.charAt(0),f=Number(u.substr(1));if("M"===p){for(var m,g,y,v=0,x=h;v<10;){if(((m=Z.tickIncrement(x,u,s,t.calendar))-c)*(x-c)<=0)return s?Math.min(x,m):Math.max(x,m);g=(c-(x+m)/2)/(m-x),y=p+(Math.abs(Math.round(g))||1)*f,x=Z.tickIncrement(x,y,g<0?!s:s,t.calendar),v++}return o.error("tickFirst did not converge",t),x}if("L"===p)return Math.log(l((Math.pow(10,c)-h)/f)*f+h)/Math.LN10;if("D"===p){var b="D2"===u?gt:mt,_=o.roundUp(o.mod(c,1),b,s);return Math.floor(c)+Math.log(r.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(u)},Z.tickText=function(t,e,r,i){var a,s=bt(t,e),l="array"===t.tickmode,c=r||l,u=t.type,h="category"===u?t.d2l_noadd:t.d2l,d=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};if(l&&o.isArrayOrTypedArray(t.ticktext)){var p=o.simpleMap(t.range,t.r2l),f=(Math.abs(p[1]-p[0])-(t._lBreaks||0))/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-h(t.tickvals[a]))<f);a++);if(a<t.ticktext.length)return s.text=String(t.ticktext[a]),s.xbnd=[d(s.x-.5),d(s.x+t.dtick-.5)],s}function m(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==i}var g=r?"never":"none"!==t.exponentformat&&m(t.showexponent)?"hide":"";if("date"===u?function(t,e,r,i){var a=t._tickround,s=r&&t.hoverformat||Z.getTickFormat(t);(i=!s&&i)&&(a=n(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,c=o.formatDate(e.x,s,a,t._dateFormat,t.calendar,t._extraFormat),u=c.indexOf("\n");if(-1!==u&&(l=c.substr(u+1),c=c.substr(0,u)),i&&(void 0===l||"00:00:00"!==c&&"00:00"!==c?8===c.length&&(c=c.replace(/:00$/,"")):(c=l,l="")),l)if(r)"d"===a?c+=", "+l:c=l+(c?", "+c:"");else if(t._inCalcTicks&&t._prevDateHead===l){var h=Nt(t),d=t._trueSide||t.side;(!h&&"top"===d||h&&"bottom"===d)&&(c+="<br> ")}else t._prevDateHead=l,c+="<br>"+l;e.text=c}(t,s,r,c):"log"===u?function(t,e,r,i,a){var s=t.dtick,l=e.x,c=t.tickformat,u="string"===typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)e.text=Tt(Math.pow(10,l),t,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),d=Math.abs(h),p=t.exponentformat;"power"===p||wt(p)&&kt(h)?(e.text=0===h?1:1===h?"10":"10<sup>"+(h>1?"":D)+d+"</sup>",e.fontSize*=1.25):("e"===p||"E"===p)&&d>2?e.text="1"+p+(h>0?"+":D)+d:(e.text=Tt(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);e.text=String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,s,r):Bt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Tt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}function r(t,n){return e(n,0)?t:r(n,t%n)}function n(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}var i=n(t),a=t*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)e.text=Tt(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="\u03c0":e.text=s[0]+"\u03c0":e.text=["<sup>",s[0],"</sup>","\u2044","<sub>",s[1],"</sub>","\u03c0"].join(""),l&&(e.text=D+e.text)}}}}(t,s,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=Tt(e.x,t,i,n)}(t,s,0,c,g),i||(t.tickprefix&&!m(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!m(t.showticksuffix)&&(s.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(s.text)){var y=t.labelalias[s.text];"string"===typeof y&&(s.text=y)}return("boundaries"===t.tickson||t.showdividers)&&(s.xbnd=[d(s.x-.5),d(s.x+t.dtick-.5)]),s},Z.hoverLabelText=function(t,e,r){r&&(t=o.extendFlat({},t,{hoverformat:r}));var n=o.isArrayOrTypedArray(e)?e[0]:e,i=o.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return Z.hoverLabelText(t,n,r)+" - "+Z.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,s=Z.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":D+s:s};var _t=["f","p","n","\u03bc","m","","k","M","G","T"];function wt(t){return"SI"===t||"B"===t}function kt(t){return t>14||t<-15}function Tt(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=Z.getTickFormat(e),h=e.separatethousands;if(i){var d={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:n(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};xt(d),s=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,D);var p,f=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))<f)t="0",a=!1;else{if(t+=f,c&&(t*=Math.pow(10,-c),s+=c),0===s)t=String(Math.floor(t));else if(s<0){t=(t=String(Math.round(t))).substr(0,t.length+s);for(var m=s;m<0;m++)t+="0"}else{var g=(t=String(t)).indexOf(".")+1;g&&(t=t.substr(0,g+s).replace(/\.?0+$/,""))}t=o.numSeparate(t,e._separators,h)}return c&&"hide"!==l&&(wt(l)&&kt(c)&&(l="power"),p=c<0?D+-c:"power"!==l?"+"+c:String(c),"e"===l||"E"===l?t+=l+p:"power"===l?t+="\xd710<sup>"+p+"</sup>":"B"===l&&9===c?t+="B":wt(l)&&(t+=_t[c/3+5])),a?D+t:t}function St(t,e){if(t){var r=Object.keys(V).reduce((function(t,r){return-1!==e.indexOf(r)&&V[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function At(t,e){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var s in n)r.push(bt(t,o.interp(n[s],.5),s));return r}function Mt(t){return void 0!==t.periodX?t.periodX:t.x}function Ct(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Et(t){var e=t.title.font.size,r=(t.title.text.match(l.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?e*(W+r*G):r?e*(r+1)*G:e}function Lt(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function Pt(t){var e=r.select(t),n=e.select(".text-math-group");return n.empty()?e.select("text"):n}function It(t){return t._id+".automargin"}function zt(t){return It(t)+".mirror"}function Ot(t){return t._id+".rangeslider"}function Dt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function Rt(t,e,r){var n,i,a=[],s=[],l=t.layout;for(n=0;n<e.length;n++)a.push(Z.getFromId(t,e[n]));for(n=0;n<r.length;n++)s.push(Z.getFromId(t,r[n]));var c=Object.keys(d),u=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],f=a[0][p],m=s[0][p],g=!0,y=!1,v=!1;if("_"!==p.charAt(0)&&"function"!==typeof f&&-1===u.indexOf(p)){for(i=1;i<a.length&&g;i++){var x=a[i][p];"type"===p&&-1!==h.indexOf(f)&&-1!==h.indexOf(x)&&f!==x?y=!0:x!==f&&(g=!1)}for(i=1;i<s.length&&g;i++){var b=s[i][p];"type"===p&&-1!==h.indexOf(m)&&-1!==h.indexOf(b)&&m!==b?v=!0:s[i][p]!==m&&(g=!1)}g&&(y&&(l[a[0]._name].type="linear"),v&&(l[s[0]._name].type="linear"),Ft(l,p,a,s,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var _=t._fullLayout.annotations[n];-1!==e.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&o.swapAttrs(l.annotations[n],["?"])}}function Ft(t,e,r,n,i){var a,s=o.nestedProperty,l=s(t[r[0]._name],e).get(),c=s(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===i.x&&(l.text=i.y),c&&c.text===i.y&&(c.text=i.x)),a=0;a<r.length;a++)s(t,r[a]._name+"."+e).set(c);for(a=0;a<n.length;a++)s(t,n[a]._name+"."+e).set(l)}function Bt(t){return"angularaxis"===t._id}function jt(t,e){for(var r=e._rangebreaks.length,n=0;n<r;n++){var i=e._rangebreaks[n];if(t>=i.min&&t<i.max)return i.max}return t}function Nt(t){return-1!==(t.ticklabelposition||"").indexOf("inside")}function Ut(t,e){Nt(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function qt(t,e,r,n){var i,a="free"===t.anchor||void 0!==t.overlaying&&!1!==t.overlaying?t.overlaying:t._id;i=n?"right"===t.side?e:-e:e,a in r||(r[a]={}),t.side in r[a]||(r[a][t.side]=0),r[a][t.side]+=i}Z.getTickFormat=function(t){var e,r,n;function i(t){return"string"!==typeof t?t:Number(t.replace("M",""))*S}function a(t,e){var r=["L","D"];if(typeof t===typeof e){if("number"===typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"===typeof t?1:-1}function o(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!==typeof i||n(i)<=n(t))&&(!a&&"number"!==typeof a||n(a)>=n(t))}function s(t,e){var r=null===e[0],n=null===e[1],i=a(t,e[0])>=0,o=a(t,e[1])<=0;return(r||i)&&(n||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&o(t.dtick,n.dtickrange,i)){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&s(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},Z.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?Z.findSubplotsWithAxis(n,e):n;return i.sort((function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),i},Z.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},Z.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var n,i,a={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=Z.list(t,"x",!0),l=Z.list(t,"y",!0),c=[];for(n=0;n<s.length;n++)for(c.push({x:s[n],y:o}),i=0;i<l.length;i++)0===n&&c.push({x:a,y:l[i]}),c.push({x:s[n],y:l[i]});var u=e._clips.selectAll(".axesclip").data(c,(function(t){return t.x._id+t.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),u.exit().remove(),u.each((function(t){r.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})}))}},Z.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each((function(t){var e=t[0],r=n._plots[e];if(r){var i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.minorGridlayer&&r.minorGridlayer.selectAll("path").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()}}));var i=e&&"redraw"!==e?e:Z.listIds(t),a=Z.list(t).filter((function(t){return t.autoshift})).map((function(t){return t.overlaying}));i.map((function(e){var r=Z.getFromId(t,e);if("sync"===r.tickmode&&r.overlaying){var n=i.findIndex((function(t){return t===r.overlaying}));n>=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(e){return function(){if(e){var n=Z.getFromId(t,e);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=Z.drawOne(t,n,r);return n._shiftPusher&&qt(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},Z.drawOne=function(t,e,r){var n,s,d,p=(r=r||{}).axShifts||{},f=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=Z.counterLetter(g),x=m._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==f.indexOf(e._id)||-1!==f.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var b=e.linewidth/2||0;"inside"===e.ticks&&(b+=e.ticklen),qt(e,b,p,!0),qt(e,e.shift||0,p,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,p));var _=x[y+"axislayer"],w=e._mainLinePosition,k=w+=e._shift,T=e._mainMirrorPosition,S=e._vals=Z.calcTicks(e),A=[e.mirror,k,T].join("_");for(n=0;n<S.length;n++)S[n].axInfo=A;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var M={};if(e.visible){var C,E,L=Z.makeTransTickFn(e),P=Z.makeTransTickLabelFn(e),I="inside"===e.ticks,z="outside"===e.ticks;if("boundaries"===e.tickson){var O=function(t,e){var r,n=[],i=function(t,e){var r=t.xbnd[e];null!==r&&n.push(o.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)i(e[r],0);i(e[r-1],1)}return n}(0,S);E=Z.clipEnds(e,O),C=I?E:O}else E=Z.clipEnds(e,S),C=I&&"period"!==e.ticklabelmode?E:S;var D,R=e._gridVals=E,F=function(t,e){var r,n,i=[],a=e.length&&e[e.length-1].x<e[0].x,s=function(t,e){var r=t.xbnd[e];null!==r&&i.push(o.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var l=e[r];l.text2!==n&&s(l,a?1:0),n=l.text2}s(e[r-1],a?0:1)}return i}(e,S);if(!m._hasOnlyLargeSploms){var B=e._subplotsWith,j={};for(n=0;n<B.length;n++){s=B[n];var N=(d=m._plots[s])[v+"axis"],U=N._mainAxis._id;if(!j[U]){j[U]=1;var V="x"===y?"M0,"+N._offset+"v"+N._length:"M"+N._offset+",0h"+N._length;Z.drawGrid(t,e,{vals:R,counterAxis:N,layer:d.gridlayer.select("."+g),minorLayer:d.minorGridlayer.select("."+g),path:V,transFn:L}),Z.drawZeroLine(t,e,{counterAxis:N,layer:d.zerolinelayer,path:V,transFn:L})}}}var q=Z.getTickSigns(e),$=Z.getTickSigns(e,"minor");if(e.ticks||e.minor&&e.minor.ticks){var X,K,J,Q,tt=Z.makeTickPath(e,k,q[2]),et=Z.makeTickPath(e,k,$[2],{minor:!0});if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(X=Z.makeTickPath(e,T,q[3]),K=Z.makeTickPath(e,T,$[3],{minor:!0}),J=tt+X,Q=et+K):(X="",K="",J=tt,Q=et),e.showdividers&&z&&"boundaries"===e.tickson){var rt={};for(n=0;n<F.length;n++)rt[F[n].x]=1;D=function(t){return rt[t.x]?X:J}}else D=function(t){return t.minor?Q:J}}if(Z.drawTicks(t,e,{vals:C,layer:_,path:D,transFn:L}),"allticks"===e.mirror){var nt=Object.keys(e._linepositions||{});for(n=0;n<nt.length;n++){s=nt[n],d=m._plots[s];var it=e._linepositions[s]||[],at=it[0],ot=it[1],st=it[2],lt=Z.makeTickPath(e,at,st?q[0]:$[0],{minor:st})+Z.makeTickPath(e,ot,st?q[1]:$[1],{minor:st});Z.drawTicks(t,e,{vals:C,layer:d[y+"axislayer"],path:lt,transFn:L})}}var ct=[];if(ct.push((function(){return Z.drawLabels(t,e,{vals:S,layer:_,plotinfo:d,transFn:P,labelFns:Z.makeLabelFns(e,k)})})),"multicategory"===e.type){var ut={x:2,y:10}[y];ct.push((function(){var r={x:"height",y:"width"}[y],n=dt()[r]+ut+(e._tickAngles[g+"tick"]?e.tickfont.size*G:0);return Z.drawLabels(t,e,{vals:At(e,S),layer:_,cls:g+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:L,labelFns:Z.makeLabelFns(e,k+n*q[4])})})),ct.push((function(){return e._depth=q[4]*(dt("tick2")[e.side]-k),function(t,e,r){var n=e._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,Ct);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,e.dividercolor).style("stroke-width",h.crispRound(t,e.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:F,layer:_,path:Z.makeTickPath(e,k,q[4],{len:e._depth}),transFn:L})}))}else e.title.hasOwnProperty("standoff")&&ct.push((function(){e._depth=q[4]*(dt()[e.side]-k)}));var ht=a.getComponentMethod("rangeslider","isVisible")(e);return r.skipTitle||ht&&"bottom"===e.side||ct.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size,s=(e.title.text.match(l.BR_TAG_ALL)||[]).length;if(e.title.hasOwnProperty("standoff"))"bottom"===e.side||"right"===e.side?r=e._depth+e.title.standoff+o*W:"top"!==e.side&&"left"!==e.side||(r=e._depth+e.title.standoff+o*(H+s*G));else{var u=Nt(e);if("multicategory"===e.type)r=e._depth;else{var d=1.5*o;u&&(d=.5*o,"outside"===e.ticks&&(d+=e.ticklen)),r=10+d+(e.linewidth?e.linewidth-1:0)}u||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var p,f,m,g,y=Z.getPxPosition(t,e);if("x"===a?(f=e._offset+e._length/2,m="top"===e.side?y-r:y+r):(m=e._offset+e._length/2,f="right"===e.side?y+r:y-r,p={rotate:"-90",offset:0}),"multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(g={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var x=h.getTranslate(v.node().parentNode);g.offsetLeft=x.x,g.offsetTop=x.y}e.title.hasOwnProperty("standoff")&&(g.pad=0)}return e._titleStandoff=r,c.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:g,transform:p,attributes:{x:f,y:m,"text-anchor":"middle"}})}(t,e)})),ct.push((function(){var r,n,o,s,l=e.side.charAt(0),c=Y[e.side].charAt(0),u=Z.getPxPosition(t,e),h=z?e.ticklen:0;(e.automargin||ht||e._shiftPusher)&&("multicategory"===e.type?r=dt("tick2"):(r=dt(),"x"===y&&"b"===l&&(e._depth=Math.max(r.width>0?r.bottom-u:0,h))));var d=0,p=0;if(e._shiftPusher&&(d=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[y]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(p+=Et(e))),e._fullDepth=Math.max(d,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1],g="number"===typeof e._shift?e._shift:0;if("x"===y){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),f.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var b=e._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,f.reverse()),r.height>0){var _=r.bottom-(e._offset+e._length);_>0&&(n.yb=0,n.b=_);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=Et(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[c]+=h),!0===e.mirror||"ticks"===e.mirror?o[v]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(o[v]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}ht&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"===typeof e.automargin&&(St(n,e.automargin),St(o,e.automargin)),i.autoMargin(t,It(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Ot(e),s)})),o.syncOrAsync(ct)}}function dt(t){var r=g+(t||"tick");return M[r]||(M[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Pt(this),e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=Z.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,k)),M[r]}},Z.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)===("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},Z.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},Z.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,d=t.tickfont?t.tickfont.size:12;return(o||n)&&(u+=d*W,h+=(t.linewidth||0)/2),(i||a)&&(u+=(t.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=d*(1-W)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=t.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===t._id.charAt(0)?function(e){return s(i+t._offset+t.l2p(Mt(e))+r,a+n)}:function(e){return s(a+n,i+t._offset+t.l2p(Mt(e))+r)}},Z.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},Z.makeLabelFns=function(t,e,r){var i=t.ticklabelposition||"",a=function(t){return-1!==i.indexOf(t)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),d="inside"===i&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,f=0,m=d?t.ticklen:0;if(h?m*=-1:u&&(m=0),d&&(p+=m,r)){var g=o.deg2rad(r);p=m*Math.cos(g)+1,f=m*Math.sin(g)}t.showticklabels&&(d||t.showline)&&(p+=.2*t.tickfont.size);var y,v,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(h?-1:1),labelShift:f},k=0,T=t.side,S=t._id.charAt(0),A=t.tickangle;if("x"===S)b=(_=!h&&"bottom"===T||h&&"top"===T)?1:-1,h&&(b*=-1),y=f*b,v=e+p*b,x=_?1:-.2,90===Math.abs(A)&&(h?x+=H:x=-90===A&&"bottom"===T?W:90===A&&"top"===T?H:.5,k=H/2*(A/90)),w.xFn=function(t){return t.dx+y+k*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return n(e)&&0!==e&&180!==e?e*b<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===S){if(b=(_=!h&&"left"===T||h&&"right"===T)?1:-1,h&&(b*=-1),y=p,v=f*b,x=0,h||90!==Math.abs(A)||(x=-90===A&&"left"===T||90===A&&"right"===T?W:.5),h){var M=n(A)?+A:0;if(0!==M){var C=o.deg2rad(M);k=Math.abs(Math.sin(C))*W*b,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*b+k*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*H},w.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Z.drawTicks=function(t,e,n){n=n||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?n.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?n.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Ct);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ut(e,[N]),o.attr("transform",n.transFn)},Z.drawGrid=function(t,e,n){if(n=n||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?n.vals.filter((function(t){return t.minor})):[],s=e.showgrid?n.vals.filter((function(t){return!t.minor})):[],l=n.counterAxis;if(l&&Z.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,d=0;d<s.length;d++){var p=s[d].x;if(c?!p:Math.abs(p)<e.dtick/100){if(s=s.slice(0,d).concat(s.slice(d+1)),!c)break;d--}}e._gw=h.crispRound(t,e.gridwidth,1);for(var f=a?h.crispRound(t,e.minor.gridwidth,1):0,m=n.layer,g=n.minorLayer,y=1;y>=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Ct);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?f:e._gw)+"px"})).style("display",null),"function"===typeof n.path&&x.attr("d",n.path)}}Ut(e,[B,j])}},Z.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=Z.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return J(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Ut(e,[F])},Z.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,c=e._id,u=i.cls||c+"tick",d=i.vals.filter((function(t){return t.text})),p=i.labelFns,f=i.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(e.showticklabels?d:[],Ct),y=[];function v(t,a){t.each((function(t){var o=r.select(this),c=o.select(".text-math-group"),u=p.anchorFn(t,a),d=i.transFn.call(o.node(),t)+(n(a)&&0!==+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),f=l.lineCount(o),m=G*t.fontSize,g=p.heightFn(t,n(a)?+a:0,(f-1)*m);if(g&&(d+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:d,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",d+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var n=r.select(this),i=t._promises.length;n.call(l.positionText,p.xFn(e),p.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(l.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){v(n,f)}))):v(n,f)})),Ut(e,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(t){r.select(this).select("text").call(l.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var n=e.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===e._id.charAt(0),l=0,c=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var d=Math.min(l,c),p=Math.max(l,c),f=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>p||a.left<d)&&(o=1):(a.bottom>p||a.top+(e.tickangle?0:t.fontSize/4)<d)&&(o=1);var l=n.select("text");o?i&&l.style("opacity",0):(l.style("opacity",1),m="bottom"===f||"right"===f?Math.min(m,s?a.top:a.left):-1/0,y="top"===f||"left"===f?Math.max(y,s?a.bottom:a.right):1/0)}})),a._plots){var x=a._plots[v];if(e._id===x.xaxis._id||e._id===x.yaxis._id){var b=s?x.yaxis:x.xaxis;b&&(b["_visibleLabelMin_"+e._id]=m,b["_visibleLabelMax_"+e._id]=y)}}}},e._hideCounterAxisInsideTickLabels=function(t){var n="x"===e._id.charAt(0),i=[];for(var o in a._plots){var s=a._plots[o];e._id!==s.xaxis._id&&e._id!==s.yaxis._id||i.push(n?s.yaxis:s.xaxis)}i.forEach((function(n,i){n&&Nt(n)&&(t||[F,j,B,N,U]).forEach((function(t){var o="tick"===t.K&&"text"===t.L&&"period"===e.ticklabelmode,s=a._plots[e._mainSubplot];(t.K===F.K?s.zerolinelayer.selectAll("."+e._id+"zl"):t.K===j.K?s.minorGridlayer.selectAll("."+e._id):t.K===B.K?s.gridlayer.selectAll("."+e._id):s[e._id.charAt(0)+"axislayer"]).each((function(){var a=r.select(this);t.L&&(a=a.selectAll(t.L)),a.each((function(a){var s=e.l2p(o?Mt(a):a.x)+e._offset,l=r.select(this);s<e["_visibleLabelMax_"+n._id]&&s>e["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},v(g,m+1?m:f);var x=null;e._selections&&(e._selections[u]=g);var b=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,b.push((function(){v(g,m)}))):b.push((function(){if(v(g,f),d.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,r=0,n=[],a=1;g.each((function(t){r=Math.max(r,t.fontSize);var i=e.l2p(t.x),o=Pt(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===e.tickson||e.showdividers)&&!i.secondary,c=d.length,u=Math.abs((d[c-1].x-d[0].x)*e._m)/(c-1),p=s?u/2:u,m=s?e.ticklen:1.25*r*a,y=p/Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),b=e.autotickangles.map((function(t){return t*Math.PI/180})),_=b.find((function(t){return Math.abs(Math.cos(t))<=y}));void 0===_&&(_=b.reduce((function(t,e){return Math.abs(Math.cos(t))<Math.abs(Math.cos(e))?t:e}),b[0]));var w=_*(180/Math.PI);if(s){var k=2;for(e.ticks&&(k+=e.tickwidth/2),t=0;t<n.length;t++){var T=d[t].xbnd,S=n[t];if(null!==T[0]&&S.left-e.l2p(T[0])<k||null!==T[1]&&e.l2p(T[1])-S.right<k){x=w;break}}}else{var A=e.ticklabelposition||"",M=function(t){return-1!==A.indexOf(t)},C=M("top"),E=M("left"),L=M("right"),P=M("bottom")||E||C||L?(e.tickwidth||0)+6:0;for(t=0;t<n.length-1;t++)if(o.bBoxIntersect(n[t],n[t+1],P)){x=w;break}}x&&v(g,x)}})),e._tickAngles&&b.push((function(){e._tickAngles[u]=null===x?n(f)?f:0:x}));var _=function(){var t=0,r=0;return g.each((function(n,i){var a,o=Pt(this);o.select(".text-math-group").empty()&&(e._vals[i]&&(a=e._vals[i].bb||h.bBox(o.node()),e._vals[i].bb=a),t=Math.max(t,a.width),r=Math.max(r,a.height))})),{labelsMaxW:t,labelsMaxH:r}},w=e._anchorAxis;if(w&&(w.autorange||w.insiderange)&&Nt(e)&&!Q(a,e._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),w.autorange&&(a._insideTickLabelsUpdaterange[w._name+".autorange"]=w.autorange,b.push(_)),w.insiderange)){var k=_(),T="y"===e._id.charAt(0)?k.labelsMaxW:k.labelsMaxH;T+=6,"inside"===e.ticklabelposition&&(T+=e.ticklen||0);var S="right"===e.side||"top"===e.side?1:-1,A=1===S?1:0,M=1===S?0:1,C=[];C[M]=w.range[M];var E=w.range,L=w.r2p(E[A]),P=w.r2p(E[M]),I=a._insideTickLabelsUpdaterange[w._name+".range"];if(I){var z=w.r2p(I[A]),O=w.r2p(I[M]),D=S*("y"===e._id.charAt(0)?1:-1);D*L<D*z&&(L=z,C[A]=E[A]=I[A]),D*P>D*O&&(P=O,C[M]=E[M]=I[M])}var R=Math.abs(P-L);R-T>0?T*=1+T/(R-=T):T=0,"y"!==e._id.charAt(0)&&(T=-T),C[A]=w.p2r(w.r2p(E[A])+S*T),"min"===w.autorange||"max reversed"===w.autorange?(C[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(C[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=C}var V=o.syncOrAsync(b);return V&&V.then&&t._promises.push(V),V},Z.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},Z.shouldShowZeroLine=function(t,e,r){var n=o.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===R)&&(Lt(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=Z.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])===("x"===o)?0:e._length),c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return p(r,l);for(var u=Z.list(t,s),h=0;h<u.length;h++){var d=u[h];if(d._mainAxis===i&&p(d,l))return!0}}function p(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"===typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var i=t._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,i=e._id.charAt(0),o=0;o<r.length;o++){var s=r[o];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(a.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[i])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===i)return!0}}return!1}(t,e))},Z.clipEnds=function(t,e){return e.filter((function(e){return Lt(t,e.x)}))},Z.allowAutoMargin=function(t){for(var e=Z.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(i.allowAutoMargin(t,It(n)),n.mirror&&i.allowAutoMargin(t,zt(n))),a.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,Ot(n))}},Z.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,c=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],Dt(c.x,l.x),Dt(c.y,l.y);Dt(c.x,[o]),Dt(c.y,[s])}else i.push({x:[o],y:[s]})}}return i}(t,e),n=0;n<r.length;n++)Rt(t,r[n].x,r[n].y)}}}),ir=d({"src/plots/cartesian/autorange_options_defaults.js"(t,e){e.exports=function(t,e,r){var n,i;if(r){var a="reversed"===e||"min reversed"===e||"max reversed"===e;n=r[a?1:0],i=r[a?0:1]}var o=t("autorangeoptions.minallowed",null===i?n:void 0),s=t("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&t("autorangeoptions.clipmin"),void 0===s&&t("autorangeoptions.clipmax"),t("autorangeoptions.include")}}}),ar=d({"src/plots/cartesian/range_defaults.js"(t,e){var r=ir();e.exports=function(t,e,n,i){var a=e._template||{},o=e.type||a.type||"-";n("minallowed"),n("maxallowed");var s,l=n("range");l||i.noInsiderange||"log"===o||(!(s=n("insiderange"))||null!==s[0]&&null!==s[1]||(e.insiderange=!1,s=void 0),s&&(l=n("range",s)));var c,u=e.getAutorangeDflt(l,i),h=n("autorange",u);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||"reversed"!==h&&!0!==h)&&(null===l[0]||"min"!==h&&"max reversed"!==h)&&(null===l[1]||"max"!==h&&"min reversed"!==h)||(l=void 0,delete e.range,e.autorange=!0,c=!0),c||(h=n("autorange",u=e.getAutorangeDflt(l,i))),h&&(r(n,h,l),"linear"!==o&&"-"!==o||n("rangemode")),e.cleanRange()}}}),or=d({"node_modules/mouse-event-offset/index.js"(t,e){var r={left:0,top:0};e.exports=function(t,e,n){e=e||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=e)===window||i===document||i===document.body?r:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}}}),sr=d({"node_modules/has-passive-events/index.js"(t,e){var r=ce();e.exports=r&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(r){t=!1}return t}()}}),lr=d({"src/components/dragelement/align.js"(t,e){e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}}}),cr=d({"src/components/dragelement/cursor.js"(t,e){var r=se(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,i,a){return t="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),n[e][t]}}}),ur=d({"src/components/dragelement/unhover.js"(t,e){var r=de(),n=Kt(),i=Et().getGraphDiv,a=F(),o=e.exports={};o.wrapped=function(t,e,r){(t=i(t))._fullLayout&&n.clear(t._fullLayout._uid+a.HOVERID),o.raw(t,e,r)},o.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}}}),hr=d({"src/components/dragelement/index.js"(t,e){var r=or(),n=ue(),i=sr(),a=se().removeElement,o=ye(),s=e.exports={};s.align=lr(),s.getCursor=cr();var l=ur();function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function u(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(t){var e,r,l,h,d,p,f,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function _(i){g._dragged=!1,g._dragging=!0;var a=u(i);e=a[0],r=a[1],f=i.target,p=i,m=2===i.buttons||i.ctrlKey,"undefined"===typeof i.clientX&&"undefined"===typeof i.clientY&&(i.clientX=e,i.clientY=r),(l=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=l),t.prepFn&&t.prepFn(i,e,r),n&&!m?(d=c()).style.cursor=window.getComputedStyle(x).cursor:n||(d=document,h=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=u(n),a=t.minDrag||o.MINDRAG,l=b(i[0]-e,i[1]-r,a),c=l[0],h=l[1];(c||h)&&(g._dragged=!0,s.unhover(g,n)),g._dragged&&t.moveFn&&!m&&(g._dragdata={element:x,dx:c,dy:h},t.moveFn(c,h))}function k(e){var r;(delete g._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),n?a(d):h&&(d.documentElement.style.cursor=h,h=null),g._dragging)?(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged?t.doneFn&&t.doneFn():(p.target===f?r=p:(r={target:f,srcElement:f,toElement:f},Object.keys(p).concat(Object.keys(p.__proto__)).forEach((t=>{var e=p[t];r[t]||"function"===typeof e||(r[t]=e)}))),t.clickFn&&t.clickFn(y,r),m||f.dispatchEvent(new MouseEvent("click",e))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),dr=d({"src/lib/setcursor.js"(t,e){e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}}}),pr=d({"src/lib/override_cursor.js"(t,e){var r=dr(),n="data-savedcursor";e.exports=function(t,e){var i=t.attr(n);if(e){if(!i){for(var a=(t.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&t.attr(n,s.substr(7)).classed(s,!1)}t.attr(n)||t.attr(n,"!!")}r(t,e)}else i&&(t.attr(n,null),"!!"===i?r(t):r(t,i))}}}),fr=d({"src/components/legend/attributes.js"(t,e){var r=R(),n=V();e.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),grouptitlefont:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:r({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}}),mr=d({"src/components/legend/helpers.js"(t){t.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},t.isVertical=function(t){return"h"!==t.orientation},t.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}}}),gr=d({"src/components/legend/defaults.js"(t,e){var r=Vt(),n=se(),i=ge(),a=N(),o=fr(),s=jt(),l=mr();function c(t,e,c,u){var h=e[t]||{},d=i.newContainer(c,t);function p(t,e){return n.coerce(h,d,o,t,e)}var f=n.coerceFont(p,"font",c.font);if(p("bgcolor",c.paper_bgcolor),p("bordercolor"),p("visible")){for(var m,g=function(t,e){var r=m._input,i=m;return n.coerce(r,i,a,t,e)},y=c.font||{},v=n.coerceFont(p,"grouptitlefont",y,{overrideDflt:{size:Math.round(1.1*y.size)}}),x=0,b=!1,_="normal",w=(c.shapes||[]).filter((function(t){return t.showlegend})),k=u.concat(w).filter((function(e){return t===(e.legend||"legend")})),T=0;T<k.length;T++)if((m=k[T]).visible){var S=m._isShape;(m.showlegend||m._dfltShowLegend&&!(m._module&&m._module.attributes&&m._module.attributes.showlegend&&!1===m._module.attributes.showlegend.dflt))&&(x++,m.showlegend&&(b=!0,(!S&&r.traceIs(m,"pie-like")||!0===m._input.showlegend)&&x++),n.coerceFont(g,"legendgrouptitle.font",v)),(!S&&r.traceIs(m,"bar")&&"stack"===c.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(_=l.isGrouped({traceorder:_})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(_=l.isReversed({traceorder:_})?"reversed+grouped":"grouped")}var A=n.coerce(e,c,s,"showlegend",b&&x>("legend"===t?1:0));if(!1===A&&(c[t]=void 0),(!1!==A||h.uirevision)&&(p("uirevision",c.uirevision),!1!==A)){p("borderwidth");var M,C,E,L="h"===p("orientation"),P="paper"===p("yref"),I="paper"===p("xref"),z="left";if(L?(M=0,r.getComponentMethod("rangeslider","isVisible")(e.xaxis)?P?(C=1.1,E="bottom"):(C=1,E="top"):P?(C=-.1,E="top"):(C=0,E="bottom")):(C=1,E="auto",I?M=1.02:(M=1,z="right")),n.coerce(h,d,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:M}},"x"),n.coerce(h,d,{y:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:C}},"y"),p("traceorder",_),l.isGrouped(c[t])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",z),p("yanchor",E),p("valign"),n.noneOrAll(h,d,["x","y"]),p("title.text")){p("title.side",L?"left":"top");var O=n.extendFlat({},f,{size:n.bigFont(f.size)});n.coerceFont(p,"title.font",O)}}}}e.exports=function(t,e,r){var i,a=r.slice(),o=e.shapes;if(o)for(i=0;i<o.length;i++){var s=o[i];if(s.showlegend){var l={_input:s._input,visible:s.visible,showlegend:s.showlegend,legend:s.legend};a.push(l)}}var u=["legend"];for(i=0;i<a.length;i++)n.pushUnique(u,a[i].legend);for(e._legends=[],i=0;i<u.length;i++){var h=u[i];c(h,t,e,a),e[h]&&e[h].visible&&(e[h]._id=h),e._legends.push(h)}}}}),yr=d({"src/components/legend/handle_click.js"(t,e){var r=Vt(),n=se(),i=n.pushUnique,a=!0;e.exports=function(t,e,o){var s=e._fullLayout;if(!e._dragged&&!e._editing){var l,c=s.legend.itemclick,u=s.legend.itemdoubleclick,h=s.legend.groupclick;if(1===o&&"toggle"===c&&"toggleothers"===u&&a&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),a=!1):a=!1,1===o?l=c:2===o&&(l=u),l){var d="togglegroup"===h,p=s.hiddenlabels?s.hiddenlabels.slice():[],f=t.data()[0][0];if(!f.groupTitle||!f.noClick){var m=e._fullData,g=(s.shapes||[]).filter((function(t){return t.showlegend})),y=m.concat(g),v=f.trace;v._isShape&&(v=v._fullInput);var x,b,_,w,k,T=v.legendgroup,S={},A=[],M=[],C=[],E=(s.shapes||[]).map((function(t){return t._input})),L=!1,P=v.legend,I=v._fullInput;if(I&&I._isShape||!r.traceIs(v,"pie-like")){var z,O=T&&T.length,D=[];if(O)for(x=0;x<y.length;x++)(z=y[x]).visible&&z.legendgroup===T&&D.push(x);if("toggle"===l){var R;switch(v.visible){case!0:R="legendonly";break;case!1:R=!1;break;case"legendonly":R=!0}if(O)if(d)for(x=0;x<y.length;x++){var F=y[x];!1!==F.visible&&F.legendgroup===T&&Q(F,R)}else Q(v,R);else Q(v,R)}else if("toggleothers"===l){var B,j,N,U,V=!0;for(x=0;x<y.length;x++)if(B=(U=y[x])===v,j=!0!==U.showlegend,!B&&!j&&(!O||U.legendgroup!==T)&&U.legend===P&&!0===U.visible&&!r.traceIs(U,"notLegendIsolatable")){V=!1;break}for(x=0;x<y.length;x++)if(!1!==(U=y[x]).visible&&U.legend===P&&!r.traceIs(U,"notLegendIsolatable"))switch(v.visible){case"legendonly":Q(U,!0);break;case!0:N=!!V||"legendonly",B=U===v,j=!0!==U.showlegend&&!U.legendgroup,Q(U,!(!(B||O&&U.legendgroup===T)&&!j)||N)}}for(x=0;x<M.length;x++)if(_=M[x]){var q=_.constructUpdate(),$=Object.keys(q);for(b=0;b<$.length;b++)w=$[b],(S[w]=S[w]||[])[C[x]]=q[w]}for(k=Object.keys(S),x=0;x<k.length;x++)for(w=k[x],b=0;b<A.length;b++)S[w].hasOwnProperty(b)||(S[w][b]=void 0);L?r.call("_guiUpdate",e,S,{shapes:E},A):r.call("_guiRestyle",e,S,A)}else{var H=f.label,W=p.indexOf(H);if("toggle"===l)-1===W?p.push(H):p.splice(W,1);else if("toggleothers"===l){var G=-1!==W,Y=[];for(x=0;x<e.calcdata.length;x++){var Z=e.calcdata[x];for(b=0;b<Z.length;b++){var X=Z[b].label;P===Z[0].trace.legend&&H!==X&&(-1===p.indexOf(X)&&(G=!0),i(p,X),Y.push(X))}}if(!G)for(var K=0;K<Y.length;K++){var J=p.indexOf(Y[K]);-1!==J&&p.splice(J,1)}}r.call("_guiRelayout",e,"hiddenlabels",p)}}}}function Q(t,e){if(!f.groupTitle||d){var r=t._fullInput||t,n=r._isShape,i=r.index;void 0===i&&(i=r._index);var a,o=!1!==r.visible&&e;n?(a=o,E[i].visible=a,L=!0):function(t,e){var r=A.indexOf(t),n=S.visible;n||(n=S.visible=[]),-1===A.indexOf(t)&&(A.push(t),r=A.length-1),n[r]=e}(i,o)}}}}}),vr=d({"src/components/legend/constants.js"(t,e){e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}}),xr=d({"src/components/legend/get_legend_data.js"(t,e){var r=Vt(),n=mr();e.exports=function(t,e,i){var a,o,s=e._inHover,l=n.isGrouped(e),c=n.isReversed(e),u={},h=[],d=!1,p={},f=0,m=0;function g(t,r,a){if(!1!==e.visible&&(!i||t===e._id))if(""!==r&&n.isGrouped(e))-1===h.indexOf(r)?(h.push(r),d=!0,u[r]=[a]):u[r].push(a);else{var o="~~i"+f;h.push(o),u[o]=[a],f++}}for(a=0;a<t.length;a++){var y=t[a],v=y[0],x=v.trace,b=x.legend,_=x.legendgroup;if(s||x.visible&&x.showlegend)if(r.traceIs(x,"pie-like"))for(p[_]||(p[_]={}),o=0;o<y.length;o++){var w=y[o].label;p[_][w]||(g(b,_,{label:w,color:y[o].color,i:y[o].i,trace:x,pts:y[o].pts}),p[_][w]=!0,m=Math.max(m,(w||"").length))}else g(b,_,v),m=Math.max(m,(x.name||"").length)}if(!h.length)return[];var k=!d||!l,T=[];for(a=0;a<h.length;a++){var S=u[h[a]];k?T.push(S[0]):T.push(S)}for(k&&(T=[T]),a=0;a<T.length;a++){var A=1/0;for(o=0;o<T[a].length;o++){var M=T[a][o].trace.legendrank;A>M&&(A=M)}T[a][0]._groupMinRank=A,T[a][0]._preGroupSort=a}var C=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(T.forEach((function(t,e){t[0]._preGroupSort=e})),T.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;a<T.length;a++){T[a].forEach((function(t,e){t._preSort=e})),T[a].sort(C);var E=T[a][0].trace,L=null;for(o=0;o<T[a].length;o++){var P=T[a][o].trace.legendgrouptitle;if(P&&P.text){L=P,s&&(P.font=e._groupTitleFont);break}}if(c&&T[a].reverse(),L){var I=!1;for(o=0;o<T[a].length;o++)if(r.traceIs(T[a][o].trace,"pie-like")){I=!0;break}T[a].unshift({i:-1,groupTitle:L,noClick:I,trace:{showlegend:E.showlegend,legendgroup:E.legendgroup,visible:"toggleitem"===e.groupclick||E.visible}})}for(o=0;o<T[a].length;o++)T[a][o]=[T[a][o]]}return e._lgroupsLength=T.length,e._maxNameLength=m,T}}}),br=d({"src/traces/pie/helpers.js"(t){var e=se();function r(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}t.formatPiePercent=function(t,n){var i=r((100*t).toPrecision(3));return e.numSeparate(i,n)+"%"},t.formatPieValue=function(t,n){var i=r(t.toPrecision(10));return e.numSeparate(i,n)},t.getFirstFilled=function(t,r){if(e.isArrayOrTypedArray(t))for(var n=0;n<r.length;n++){var i=t[r[n]];if(i||0===i||""===i)return i}},t.castOption=function(r,n){return e.isArrayOrTypedArray(r)?t.getFirstFilled(r,n):r||void 0},t.getRotationAngle=function(t){return("auto"===t?0:t)*Math.PI/180}}}),_r=d({"src/traces/pie/fill_one.js"(t,e){var r=Je(),n=q();e.exports=function(t,e,i,a){var o=i.marker.pattern;o&&o.shape?r.pointStyle(t,i,a,e):n.fill(t,e.color)}}}),wr=d({"src/traces/pie/style_one.js"(t,e){var r=q(),n=br().castOption,i=_r();e.exports=function(t,e,a,o){var s=a.marker.line,l=n(s.color,e.pts)||r.defaultLine,c=n(s.width,e.pts)||0;t.call(i,e,a,o).style("stroke-width",c).call(r.stroke,l)}}}),kr=d({"src/components/legend/style.js"(t,e){var r=v(),n=Vt(),i=se(),a=i.strTranslate,o=Je(),s=q(),l=Me().extractOpts,c=Ge(),u=wr(),h=br().castOption,d=vr();function p(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}function f(t){var e=t[0].trace,r=e.contours,n=c.hasLines(e),i=c.hasMarkers(e),a=e.visible&&e.fill&&"none"!==e.fill,o=!1,s=!1;if(r){var l=r.coloring;"lines"===l?o=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?a="="!==r._operation:"fill"!==l&&"heatmap"!==l||(s=!0)}return{showMarker:i,showLine:n,showFill:a,showGradientLine:o,showGradientFill:s,anyLine:n||o,anyFill:a||s}}function m(t,e,r){return t&&i.isArrayOrTypedArray(t)?e:t>r?r:t}e.exports=function(t,e,g){var y=e._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,b=(x+2*d.itemGap)/2,_=a(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function k(t,i,a){var c=t[0].trace,u=c.marker||{},h=u.line||{},d=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=a?c.visible&&c.type===a:n.traceIs(c,"bar"),f=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(p?[t]:[]);f.enter().append("path").classed("legend"+a,!0).attr("d",d).attr("transform",_),f.exit().remove(),f.each((function(t){var n=r.select(this),i=t[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var d=i.mcc;if(!g._inHover&&"mc"in i){var p=l(u),f=p.mid;void 0===f&&(f=(p.max+p.min)/2),d=o.tryColorscale(u,"")(f)}var y=d||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var b=o.getPatternAttr(v.bgcolor,0,null),_=o.getPatternAttr(v.fgcolor,0,null),k=v.fgopacity,T=m(v.size,8,10),S=m(v.solidity,.5,1),A="legend-"+c.uid;n.call(o.pattern,"legend",e,A,x,T,S,d,v.fillmode,b,_,k)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function T(t,a,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),d=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[t]:[]);if(d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.size()){var p=l.marker||{},f=w(h(p.line.width,s.pts),p.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:f}}},m),y=i.minExtend(s,{trace:g},m);u(d,y,g,e)}}t.each((function(t){var e=r.select(this),n=i.ensureSingle(e,"g","layers");n.style("opacity",t[0].trace.opacity);var o=g.indentation,s=g.valign,l=t[0].lineHeight,c=t[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var d=n.selectAll("g.legendsymbols").data([t]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var n,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=r.select(this),d=l(a),f=d.colorscale,m=d.reversescale;if(f){if(!n){var g=f.length;u=0===c?f[m?g-1:0][1]:1===c?f[m?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var r="legendfill-"+a.uid;o.gradient(t,e,r,p(m,"radial"===n),f,"fill")}}))}))})).each((function(t){var e=t[0].trace,n="waterfall"===e.type;if(t[0]._distinct&&n){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,k(t,this,"waterfall")}var a=[];e.visible&&n&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var n=r.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(t){k(t,this,"funnel")})).each((function(t){k(t,this)})).each((function(t){var a=t[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),l.exit().remove(),l.each((function(){var t=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);t.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(t,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var n,a,s=f(t),u=s.showFill,h=s.showLine,d=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=t[0],b=v.trace,_=l(b),k=_.colorscale,T=_.reversescale,S=c.hasMarkers(b)||!g?"M5,0":y?"M5,-2":"M5,-3",A=r.select(this),M=A.select(".legendfill").selectAll("path").data(u||m?[t]:[]);if(M.enter().append("path").classed("js-fill",!0),M.exit().remove(),M.attr("d",S+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(u)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+b.uid;o.gradient(t,e,r,p(T),k,"fill")}})),h||d){var C=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:C}}),n=[i.minExtend(v,{trace:a})]}var E=A.select(".legendlines").selectAll("path").data(h||d?[n]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",S+(d?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;o.lineGroupStyle(t),o.gradient(t,e,r,p(T),k,"stroke")}})})).each((function(t){var n,a,s=f(t),l=s.anyFill,u=s.anyLine,h=s.showLine,d=s.showMarker,p=t[0],m=p.trace,g=!d&&!u&&!l&&c.hasText(m);function y(t,e,r,n){var a=i.nestedProperty(m,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(d||g||h){var b={},w={};if(d){b.mc=y("marker.color",x),b.mx=y("marker.symbol",x),b.mo=y("marker.opacity",i.mean,[.2,1]),b.mlc=y("marker.line.color",x),b.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=y("marker.size",i.mean,[2,16],12);b.ms=k,w.marker.size=k}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=y("textposition",x),b.ts=10,b.tc=y("textfont.color",x),b.tf=y("textfont.family",x),b.tw=y("textfont.weight",x),b.ty=y("textfont.style",x),b.tv=y("textfont.variant",x),b.tC=y("textfont.textcase",x),b.tE=y("textfont.lineposition",x),b.tS=y("textfont.shadow",x)),n=[i.minExtend(p,b)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var T=r.select(this).select("g.legendpoints"),S=T.selectAll("path.scatterpts").data(d?n:[]);S.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),S.exit().remove(),S.call(o.pointStyle,a,e),d&&(n[0].mrc=3);var A=T.selectAll("g.pointtext").data(g?n:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),Tr=d({"src/components/legend/draw.js"(t,e){var r=v(),n=se(),i=ke(),a=Vt(),o=de(),s=hr(),l=Je(),c=q(),u=Ae(),h=yr(),d=vr(),p=Se(),f=p.LINE_SPACING,m=p.FROM_TL,g=p.FROM_BR,y=xr(),x=kr(),b=mr(),_=/^legend[0-9]*$/;function w(t,e){var o,h,p=e||{},v=t._fullLayout,_=P(p),w=p._inHover;if(w?(h=p.layer,o="hover"):(h=v._infolayer,o=_),h){var A;if(o+=v._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!p.entries)return;A=y(p.entries,p)}else{for(var I=(t.calcdata||[]).slice(),z=v.shapes,O=0;O<z.length;O++){var D=z[O];if(D.showlegend){var R={_isShape:!0,_fullInput:D,index:D._index,name:D.name||D.label.text||"shape "+D._index,legend:D.legend,legendgroup:D.legendgroup,legendgrouptitle:D.legendgrouptitle,legendrank:D.legendrank,legendwidth:D.legendwidth,showlegend:D.showlegend,visible:D.visible,opacity:D.opacity,mode:"line"===D.type?"lines":"markers",line:D.line,marker:{line:D.line,color:D.fillcolor,size:12,symbol:"rect"===D.type?"square":"circle"===D.type?"circle":"hexagon2"}};I.push([{trace:R}])}}A=v.showlegend&&y(I,p,v._legends.length>1)}var F=v.hiddenlabels||[];if(!w&&(!v.showlegend||!A.length))return h.selectAll("."+_).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(t,_);var B=n.ensureSingle(h,"g",_,(function(t){w||t.attr("pointer-events","all")})),j=n.ensureSingleById(v._topdefs,"clipPath",o,(function(t){t.append("rect")})),N=n.ensureSingle(B,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));N.call(c.stroke,p.bordercolor).call(c.fill,p.bgcolor).style("stroke-width",p.borderwidth+"px");var U,V=n.ensureSingle(B,"g","scrollbox"),q=p.title;p._titleWidth=0,p._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",_+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),C(U,V,t,p,1)):V.selectAll("."+_+"titletext").remove();var $=n.ensureSingle(B,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),H=V.selectAll("g.groups").data(A);H.enter().append("g").attr("class","groups"),H.exit().remove();var W=H.selectAll("g.traces").data(n.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",(function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==F.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){r.select(this).call(S,t,p)})).call(x,t,p).each((function(){w||r.select(this).call(M,t,_)})),n.syncOrAsync([i.previousPromises,function(){return function(t,e,n,i){var a=t._fullLayout,o=P(i);i||(i=a[o]);var s=a._size,c=b.isVertical(i),u=b.isGrouped(i),h="fraction"===i.entrywidthmode,p=i.borderwidth,f=2*p,m=d.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(p+m),v=L(i),x=i.y<0||0===i.y&&"top"===v,_=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var S=0;i._width=0,i._height=0;var A=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(c)n.each((function(t){var e=t[0].height;l.setTranslate(this,p+A[0],p+A[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),S=g+i._width,i._width+=m+g+f,i._height+=y,u&&(e.each((function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=E(i),C=i.x<0||0===i.x&&"right"===M,I=i.x>1||1===i.x&&"left"===M,z=_||x,O=a.width/2;i._maxWidth=Math.max(C?z&&"left"===M?s.l+s.w:O:I?z&&"right"===M?s.r+s.w:O:s.w,2*g);var D=0,R=0;n.each((function(t){var e=k(t,i,g);D=Math.max(D,e),R+=e})),S=null;var F=0;if(u){var B=0,j=0,N=0;e.each((function(){var t=0,e=0;r.select(this).selectAll("g.traces").each((function(r){var n=k(r,i,g),a=r[0].height;l.setTranslate(this,A[0],A[1]+p+m+a/2+e),e+=a,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var n=t+m;j>0&&n+p+j>i._maxWidth?(F=Math.max(F,j),j=0,N+=B+w,B=e):B=Math.max(B,e),l.setTranslate(this,j,N),j+=n})),i._width=Math.max(F,j)+p,i._height=N+B+y}else{var U=n.size(),V=R+f+(U-1)*m<i._maxWidth,q=0,$=0,H=0,W=0;n.each((function(t){var e=t[0].height,r=k(t,i,g),n=V?r:D;h||(n+=m),n+p+$-m>=i._maxWidth&&(F=Math.max(F,W),$=0,H+=q,i._height+=q,q=0),l.setTranslate(this,A[0]+p+$,A[1]+p+H+e/2+m),W=$+r+m,$+=n,q=Math.max(q,e)})),V?(i._width=$+f,i._height=q+y):(i._width=Math.max(F,W)+f,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(p+d.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(p+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,Y=G.legendText||G.legendPosition;n.each((function(t){var e=r.select(this).select("."+o+"toggle"),n=t[0].height,a=t[0].trace.legendgroup,s=k(t,i,g);u&&""!==a&&(s=T[a]);var d=Y?g:S||s;c||h||(d+=m/2),l.setRect(e,0,-n/2,d,n)}))}(t,H,W,p)},function(){var e,c,y,x,b=v._size,k=p.borderwidth,S="paper"===p.xref,A="paper"===p.yref;if(q.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*f,i=0,a=t.node(),o=l.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*d.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*d.titlePad-o),u.positionText(t,r+d.titlePad+i,r+n)}}(U,p,k),!w){var M,C;M=S?b.l+b.w*p.x-m[E(p)]*p._width:v.width*p.x-m[E(p)]*p._width,C=A?b.t+b.h*(1-p.y)-m[L(p)]*p._effHeight:v.height*(1-p.y)-m[L(p)]*p._effHeight;var P=function(t,e,r,n){var a=t._fullLayout,o=a[e],s=E(o),l=L(o),c="paper"===o.xref,u="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?"b":"t",d=o.x<.5?"l":"r",p={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?t._fullLayout._reservedMargin[e][h]=p[h]:u||"v"===o.orientation?t._fullLayout._reservedMargin[e][d]=p[d]:t._fullLayout._reservedMargin[e][h]=p[h]}(t,_,M,C);if(P)return;if(v.margin.autoexpand){var I=M,z=C;M=S?n.constrain(M,0,v.width-p._width):I,C=A?n.constrain(C,0,v.height-p._effHeight):z,M!==I&&n.log("Constrain "+_+".x to make legend fit inside graph"),C!==z&&n.log("Constrain "+_+".y to make legend fit inside graph")}l.setTranslate(B,M,C)}if($.on(".drag",null),B.on("wheel",null),w||p._height<=p._maxHeight||t._context.staticPlot){var O=p._effHeight;w&&(O=p._height),N.attr({width:p._width-k,height:O-k,x:k/2,y:k/2}),l.setTranslate(V,0,0),j.select("rect").attr({width:p._width-2*k,height:O-2*k,x:k,y:k}),l.setClipUrl(V,o,t),l.setRect($,0,0,0,0),delete p._scrollY}else{var D,R,F,H=Math.max(d.scrollBarMinHeight,p._effHeight*p._effHeight/p._height),W=p._effHeight-H-2*d.scrollBarMargin,G=p._height-p._effHeight,Y=W/G,Z=Math.min(p._scrollY||0,G);N.attr({width:p._width-2*k+d.scrollBarWidth+d.scrollBarMargin,height:p._effHeight-k,x:k/2,y:k/2}),j.select("rect").attr({width:p._width-2*k+d.scrollBarWidth+d.scrollBarMargin,height:p._effHeight-2*k,x:k,y:k+Z}),l.setClipUrl(V,o,t),J(Z,H,Y),B.on("wheel",(function(){J(Z=n.constrain(p._scrollY+r.event.deltaY/W*G,0,G),H,Y),0!==Z&&Z!==G&&r.event.preventDefault()}));var X=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=Z})).on("drag",(function(){var t=r.event.sourceEvent;2===t.buttons||t.ctrlKey||(R="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,J(Z=function(t,e,r){var i=(r-e)/Y+t;return n.constrain(i,0,G)}(F,D,R),H,Y))}));$.call(X);var K=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,F=Z)})).on("drag",(function(){var t=r.event.sourceEvent;"touchmove"===t.type&&(R=t.changedTouches[0].clientY,J(Z=function(t,e,r){var i=(e-r)/Y+t;return n.constrain(i,0,G)}(F,D,R),H,Y))}));V.call(K)}function J(e,r,n){p._scrollY=t._fullLayout[_]._scrollY=e,l.setTranslate(V,0,-e),l.setRect($,p._width,d.scrollBarMargin+e*n,d.scrollBarWidth,r),j.select("rect").attr("y",k+e)}t._context.edits.legendPosition&&(B.classed("cursor-move",!0),s.init({element:B.node(),gd:t,prepFn:function(t){if(t.target!==$.node()){var e=l.getTranslate(B);y=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==x){var n=y+t,i=x+r;l.setTranslate(B,n,i),e=s.align(n,p._width,b.l,b.l+b.w,p.xanchor),c=s.align(i+p._height,-p._height,b.t+b.h,b.t,p.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[_+".x"]=e,r[_+".y"]=c,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=h.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&T(t,B,n,e,r)}}))}],t)}}function k(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function T(t,e,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,t,n))}function S(t,e,r){var i,o,s=P(r),c=t.data()[0][0],h=c.trace,p=a.traceIs(h,"pie-like"),f=!r._inHover&&e._context.edits.legendText&&!p,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=p?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(f?A(i,m):i);var y=r.indentation+r.itemwidth+2*d.itemGap;u.positionText(g,y,0),f?g.call(u.makeEditable,{gd:e,text:i}).call(C,t,e,r).on("edit",(function(n){this.text(A(n,m)).call(C,t,e,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",e,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",e,o,h.index)})):C(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function M(t,e,i){var a,o=e._context.doubleClickDelay,s=1,l=n.ensureSingle(t,"rect",i+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-e._legendMouseDownTime<o?s+=1:(s=1,e._legendMouseDownTime=a)})),l.on("mouseup",(function(){if(!e._dragged&&!e._editing){var n=e._fullLayout[i];(new Date).getTime()-e._legendMouseDownTime>o&&(s=Math.max(s-1,1)),T(e,n,t,s,r.event)}})))}function C(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),u.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=P(r);r||(r=e._fullLayout[s]);var c,h,p=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*f;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,p,p+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=u.lineCount(v),b=v.node();if(c=m*x,h=b?l.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),u.positionText(v,p+d.titlePad,p+m);else{var _=2*d.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(_=d.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,_,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else t.remove()}(e,r,n,i)}))}function E(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function L(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}function P(t){return t._id||"legend"}e.exports=function(t,e){if(e)w(t,e);else{var n=t._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var t=r.select(this),e=t.attr("class").split(" ")[0];e.match(_)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;a<i.length;a++){var o=i[a];w(t,t._fullLayout[o])}}}}}),Sr=d({"src/components/fx/hover.js"(t){var e=v(),r=k(),n=O(),i=se(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=de(),c=Ae(),u=pr(),h=Je(),d=q(),p=hr(),f=nr(),m=ye().zindexSeparator,g=Vt(),y=Ze(),x=F(),b=gr(),_=Tr(),w=x.YANGLE,T=Math.PI*w/180,S=1/Math.sin(T),A=Math.cos(T),M=Math.sin(T),C=x.HOVERARROWSIZE,E=x.HOVERTEXTPAD,L={box:!0,ohlc:!0,violin:!0,candlestick:!0},P={scatter:!0,scattergl:!0,splom:!0};function I(t,e){return t.distance-e.distance}function z(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa?t.xa._id:"",t.ya?t.ya._id:""].join(",")}t.hover=function(t,n,o,s){t=i.getGraphDiv(t);var c=n.target;i.throttle(t._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,(function(){!function(t,n,o,s,c){o||(o="xy"),"string"===typeof o&&(o=o.split(m)[0]);var h,v,x,b=Array.isArray(o)?o:[o],_=t._fullLayout,w=_.hoversubplots,k=_._plots||[],T=k[o],A=_._has("cartesian"),M=n.hovermode||_.hovermode,E="x"===(M||"").charAt(0),O="y"===(M||"").charAt(0);if(A&&(E||O)&&"axis"===w)for(var D=b.length,F=0;F<D;F++)if(k[h=b[F]]){v=f.getFromId(t,h,"x"),x=f.getFromId(t,h,"y");var B=(E?v:x)._subplotsWith;if(B&&B.length)for(var q=0;q<B.length;q++)a(b,B[q])}if(T&&"single"!==w){var H=T.overlays.map((function(t){return t.id}));b=b.concat(H)}for(var Z=b.length,X=new Array(Z),K=new Array(Z),J=!1,Q=0;Q<Z;Q++)if(k[h=b[Q]])J=!0,X[Q]=k[h].xaxis,K[Q]=k[h].yaxis;else{if(!_[h]||!_[h]._subplot)return void i.warn("Unrecognized subplot: "+h);var tt=_[h]._subplot;X[Q]=tt.xaxis,K[Q]=tt.yaxis}if(M&&!J&&(M="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(M)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return p.unhoverRaw(t,n);var et=_.hoverdistance;-1===et&&(et=1/0);var rt=_.spikedistance;-1===rt&&(rt=1/0);var nt,it,at,ot,st,lt,ct,ut,ht,dt,pt,ft,mt,gt=[],yt=[],vt={hLinePoint:null,vLinePoint:null},xt=!1;if(Array.isArray(n))for(M="array",at=0;at<n.length;at++)(st=t.calcdata[n[at].curveNumber||0])&&(lt=st[0].trace,"skip"!==st[0].trace.hoverinfo&&(yt.push(st),"h"===lt.orientation&&(xt=!0)));else{var bt,_t,wt=t.calcdata.slice();for(wt.sort((function(t,e){return(t[0].trace.zorder||0)-(e[0].trace.zorder||0)})),ot=0;ot<wt.length;ot++)st=wt[ot],"skip"!==(lt=st[0].trace).hoverinfo&&y.isTraceInSubplots(lt,b)&&(yt.push(st),"h"===lt.orientation&&(xt=!0));if(c){if(!1===l.triggerHandler(t,"plotly_beforehover",n))return;var kt=c.getBoundingClientRect();bt=n.clientX-kt.left,_t=n.clientY-kt.top,_._calcInverseTransform(t);var Tt=i.apply3DTransform(_._invTransform)(bt,_t);if(bt=Tt[0],_t=Tt[1],bt<0||bt>X[0]._length||_t<0||_t>K[0]._length)return p.unhoverRaw(t,n)}else bt="xpx"in n?n.xpx:X[0]._length/2,_t="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=bt+X[0]._offset,n.pointerY=_t+K[0]._offset,nt="xval"in n?y.flat(b,n.xval):y.p2c(X,bt),it="yval"in n?y.flat(b,n.yval):y.p2c(K,_t),!r(nt[0])||!r(it[0]))return i.warn("Fx.hover failed",n,t),p.unhoverRaw(t,n)}var St=1/0;function At(e,a){for(ot=0;ot<yt.length;ot++)if((st=yt[ot])&&st[0]&&st[0].trace&&!0===(lt=st[0].trace).visible&&0!==lt._length&&-1===["carpet","contourcarpet"].indexOf(lt._module.name)){if(ht=M,y.isUnifiedHover(ht)&&(ht=ht.charAt(0)),"splom"===lt.type?ct=b[ut=0]:(ct=y.getSubplot(lt),ut=b.indexOf(ct)),ft={cd:st,trace:lt,xa:X[ut],ya:K[ut],maxHoverDistance:et,maxSpikeDistance:rt,index:!1,distance:Math.min(St,et),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:d.defaultLine,name:lt.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},_[ct]&&(ft.subplot=_[ct]._subplot),_._splomScenes&&_._splomScenes[lt.uid]&&(ft.scene=_._splomScenes[lt.uid]),"array"===ht){var o=n[ot];"pointNumber"in o?(ft.index=o.pointNumber,ht="closest"):(ht="","xval"in o&&(dt=o.xval,ht="x"),"yval"in o&&(pt=o.yval,ht=ht?"closest":"y"))}else void 0!==e&&void 0!==a?(dt=e,pt=a):(dt=nt[ut],pt=it[ut]);if(mt=gt.length,0!==et)if(lt._module&&lt._module.hoverPoints){var s=lt._module.hoverPoints(ft,dt,pt,ht,{finiteRange:!0,hoverLayer:_._hoverlayer,hoversubplots:w,gd:t});if(s)for(var l,c=0;c<s.length;c++)l=s[c],r(l.x0)&&r(l.y0)&&gt.push(U(l,M))}else i.log("Unrecognized trace type in hover:",lt);if("closest"===M&&gt.length>mt&&(gt.splice(0,mt),St=gt[0].distance),A&&0!==rt&&0===gt.length){ft.distance=rt,ft.index=!1;var u=lt._module.hoverPoints(ft,dt,pt,"closest",{hoverLayer:_._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,p=u.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var f=p[0];r(f.x0)&&r(f.y0)&&(h=Ct(f),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Ct(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function Mt(t,e,r){for(var n,i=null,a=1/0,o=0;o<t.length;o++)v&&v._id!==t[o].xa._id||x&&x._id!==t[o].ya._id||(n=t[o].spikeDistance,r&&0===o&&(n=-1/0),n<=a&&n<=e&&(i=t[o],a=n));return i}function Ct(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}At();var Et={fullLayout:_,container:_._hoverlayer,event:n},Lt=t._spikepoints,Pt={vLinePoint:vt.vLinePoint,hLinePoint:vt.hLinePoint};t._spikepoints=Pt;var It=function(){var t=gt.filter((function(t){return v&&v._id===t.xa._id&&x&&x._id===t.ya._id})),e=gt.filter((function(t){return!(v&&v._id===t.xa._id&&x&&x._id===t.ya._id)}));t.sort(I),e.sort(I),gt=function(t,e){for(var r=e.charAt(0),n=[],i=[],a=[],o=0;o<t.length;o++){var s=t[o];g.traceIs(s.trace,"bar-like")||g.traceIs(s.trace,"box-violin")?a.push(s):s.trace[r+"period"]?i.push(s):n.push(s)}return n.concat(i).concat(a)}(gt=t.concat(e),M)};It();var zt=M.charAt(0),Ot=("x"===zt||"y"===zt)&&gt[0]&&P[gt[0].trace.type];if(A&&0!==rt&&0!==gt.length){var Dt=Mt(gt.filter((function(t){return t.ya.showspikes})),rt,Ot);vt.hLinePoint=Ct(Dt);var Rt=Mt(gt.filter((function(t){return t.xa.showspikes})),rt,Ot);vt.vLinePoint=Ct(Rt)}if(0===gt.length){var Ft=p.unhoverRaw(t,n);return!A||null===vt.hLinePoint&&null===vt.vLinePoint||$(Lt)&&V(t,vt,Et),Ft}if(A&&$(Lt)&&V(t,vt,Et),y.isXYhover(ht)&&0!==gt[0].length&&"splom"!==gt[0].trace.type){var Bt=gt[0],jt=(gt=L[Bt.trace.type]?gt.filter((function(t){return t.trace.index===Bt.trace.index})):[Bt]).length;At(W("x",Bt,_),W("y",Bt,_));var Nt,Ut=[],Vt={},qt=0,$t=function(t){var e=L[t.trace.type]?z(t):t.trace.index;if(Vt[e]){var r=Vt[e]-1,n=Ut[r];r>0&&Math.abs(t.distance)<Math.abs(n.distance)&&(Ut[r]=t)}else qt++,Vt[e]=qt,Ut.push(t)};for(Nt=0;Nt<jt;Nt++)$t(gt[Nt]);for(Nt=gt.length-1;Nt>jt-1;Nt--)$t(gt[Nt]);gt=Ut,It()}var Ht=t._hoverdata,Wt=[],Gt=G(t),Yt=Y(t);for(at=0;at<gt.length;at++){var Zt=gt[at],Xt=y.makeEventData(Zt,Zt.trace,Zt.cd);if(!1!==Zt.hovertemplate){var Kt=!1;Zt.cd[Zt.index]&&Zt.cd[Zt.index].ht&&(Kt=Zt.cd[Zt.index].ht),Zt.hovertemplate=Kt||Zt.trace.hovertemplate||!1}if(Zt.xa&&Zt.ya){var Jt=Zt.x0+Zt.xa._offset,Qt=Zt.x1+Zt.xa._offset,te=Zt.y0+Zt.ya._offset,ee=Zt.y1+Zt.ya._offset,re=Math.min(Jt,Qt),ne=Math.max(Jt,Qt),ie=Math.min(te,ee),ae=Math.max(te,ee);Xt.bbox={x0:re+Yt,x1:ne+Yt,y0:ie+Gt,y1:ae+Gt}}Zt.eventData=[Xt],Wt.push(Xt)}t._hoverdata=Wt;var oe="y"===M&&(yt.length>1||gt.length>1)||"closest"===M&&xt&&gt.length>1,se=d.combine(_.plot_bgcolor||d.background,_.paper_bgcolor),le=R(gt,{gd:t,hovermode:M,rotateLabels:oe,bgColor:se,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(M)||(function(t,e,r,n){var i,a,o,s,l,c,u,h=e?"xa":"ya",d=e?"ya":"xa",p=0,f=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(t){return t*r._invScaleX},k=function(t){return t*r._invScaleY};function T(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;s<t.length;s++)(c=t[s]).pos+c.dp+c.size>e.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s<t.length&&!(n<=0);s++)if((c=t[s]).pos<e.pmin+1)for(c.del=!0,n--,o=2*c.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[d],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(f=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,p=j(t,e),m=t.anchor,T="end"===m?-1:1;if("middle"===m)u=(c=t.crossPos+(a?k(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?k(t.by):w(t.bx));else if(a)u=(c=t.crossPos+k(C+p.y)-k(t.by/2-C))+k(t.by);else{var A=w(T*C+p.x),M=A+w(T*t.bx);c=t.crossPos+Math.min(A,M),u=t.crossPos+Math.max(A,M)}a?void 0!==b&&void 0!==_&&Math.min(u,_)-Math.max(c,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?S:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));!i&&p<=m;){for(p++,i=!0,s=0;s<g.length-1;){var A=g[s],M=g[s+1],E=A[A.length-1],L=M[0];if((a=E.pos+E.dp+E.size-L.pos-L.dp+L.size)>.01){for(l=M.length-1;l>=0;l--)M[l].dp+=a;for(A.push.apply(A,M),g.splice(s+1,1),u=0,l=A.length-1;l>=0;l--)u+=A[l].dp;for(o=u/A.length,l=A.length-1;l>=0;l--)A[l].dp-=o;i=!1}else s++}g.forEach(T)}for(s=g.length-1;s>=0;s--){var P=g[s];for(l=P.length-1;l>=0;l--){var I=P[l],z=I.datum;z.offset=I.dp,z.del=I.del}}}(ce,oe,_,le.commonLabelBoundingBox),N(ce,oe,_._invScaleX,_._invScaleY)),c&&c.tagName){var ue=g.getComponentMethod("annotations","hasClickToShow")(t,Wt);u(e.select(c),ue?"pointer":"")}c&&!s&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Ht)&&(Ht&&t.emit("plotly_unhover",{event:n,points:Ht}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:X,yaxes:K,xvals:nt,yvals:it}))}(t,n,o,s,c)}))},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=G(i),o=Y(i),s=!1,l=R(t.map((function(t){var e=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(e,n),h=Math.max(e,n),p=Math.min(s,l),f=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,p+=x,f+=x}c.bbox={x0:u+o,x1:h+o,y0:p+a,y1:f+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||d.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,e){var n=t.y0-t.by/2;t.offset=n-5<c?c-n+5:0,c=n+t.by+t.offset,e===r.anchorIndex&&(u=t.offset)})).each((function(t){t.offset-=u})),N(l,s,i._fullLayout._invScaleX,i._fullLayout._invScaleY),n?l:l.node()};var D=/<extra>([\s\S]*)<\/extra>/;function R(t,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,p=r.bgColor,f=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===t.length)return[[]];var k=r.fontFamily||x.HOVERFONT,T=r.fontSize||x.HOVERFONTSIZE,S=r.fontWeight||a.font.weight,A=r.fontStyle||a.font.style,M=r.fontVariant||a.font.variant,L=r.fontTextcase||a.font.textcase,P=r.fontLineposition||a.font.lineposition,I=r.fontShadow||a.font.shadow,O=t[0],D=O.xa,R=O.ya,F=l.charAt(0),j=F+"Label",N=O[j];if(void 0===N&&"multicategory"===D.type)for(var U=0;U<t.length&&void 0===(N=t[U][j]);U++);var V=Z(n,m),q=V.top,$=V.width,H=V.height,W=void 0!==N&&O.distance<=r.hoverdistance&&("x"===l||"y"===l);if(W){var G,Y,X=!0;for(G=0;G<t.length;G++)if(X&&void 0===t[G].zLabel&&(X=!1),Y=t[G].hoverinfo||t[G].trace.hoverinfo){var K=Array.isArray(Y)?Y:Y.split("+");if(-1===K.indexOf("all")&&-1===K.indexOf(l)){W=!1;break}}X&&(W=!1)}var J=f.selectAll("g.axistext").data(W?[0]:[]);J.enter().append("g").classed("axistext",!0),J.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(J.each((function(){var t=e.select(this),r=i.ensureSingle(t,"path","",(function(t){t.style({"stroke-width":"1px"})})),s=i.ensureSingle(t,"text","",(function(t){t.attr("data-notex",1)})),u=v.bgcolor||d.defaultLine,p=v.bordercolor||d.contrast(u),f=d.contrast(u),m=v.font,g={weight:m.weight||S,style:m.style||A,variant:m.variant||M,textcase:m.textcase||L,lineposition:m.lineposition||P,shadow:m.shadow||I,family:m.family||k,size:m.size||T,color:m.color||f};r.style({fill:u,stroke:p}),s.text(N).call(h.font,g).call(c.positionText,0,0).call(c.convertToTspans,n),t.attr("transform","");var y,x,b=Z(n,s.node());if("x"===l){var _="top"===D.side?"-":"";s.attr("text-anchor","middle").call(c.positionText,0,"top"===D.side?q-b.bottom-C-E:q-b.top+C+E),y=D._offset+(O.x0+O.x1)/2,x=R._offset+("top"===D.side?0:R._length);var w=b.width/2+E,z=y;y<w?z=w:y>a.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+C)+","+_+C+"H"+w+"v"+_+(2*E+b.height)+"H"+-w+"V"+_+C+"H"+(y-z-C)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===D.side?(Q.minY=x-(2*E+b.height),Q.maxY=x-E):(Q.minY=x+E,Q.maxY=x+(2*E+b.height))}else{var F,B,j;"right"===R.side?(F="start",B=1,j="",y=D._offset+D._length):(F="end",B=-1,j="-",y=D._offset),x=R._offset+(O.y0+O.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+j+C+","+C+"V"+(E+b.height/2)+"h"+j+(2*E+b.width)+"V-"+(E+b.height/2)+"H"+j+C+"V-"+C+"Z"),Q.minY=x-(E+b.height/2),Q.maxY=x+(E+b.height/2),"right"===R.side?(Q.minX=y+C,Q.maxX=y+C+(2*E+b.width)):(Q.minX=y-C-(2*E+b.width),Q.maxX=y-C);var U,V=b.height/2,$=q-b.top-V,H="clip"+a._uid+"commonlabel"+R._id;if(y<b.width+2*E+C){U="M-"+(C+E)+"-"+V+"h-"+(b.width-E)+"V"+V+"h"+(b.width-E)+"Z";var W=b.width-y+E;c.positionText(s,W,$),"end"===F&&s.selectAll("tspan").each((function(){var t=e.select(this),r=h.tester.append("text").text(t.text()).call(h.font,g),i=Z(n,r.node());Math.round(i.width)<Math.round(b.width)&&t.attr("x",W-i.width),r.remove()}))}else c.positionText(s,B*(E+C),$),U=null;var G=a._topclips.selectAll("#"+H).data(U?[0]:[]);G.enter().append("clipPath").attr("id",H).append("path"),G.exit().remove(),G.select("path").attr("d",U),h.setClipUrl(s,U?H:null,n)}t.attr("transform",o(y,x))})),y.isUnifiedHover(l)){f.selectAll("g.hovertext").remove();var tt=t.filter((function(t){return"none"!==t.hoverinfo}));if(0===tt.length)return[];var et=a.hoverlabel,rt=et.font,nt={showlegend:!0,legend:{title:{text:N,font:rt},font:rt,bgcolor:et.bgcolor,bordercolor:et.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},it={font:rt};b(nt,it,n._fullData);var at=it.legend;at.entries=[];for(var ot=0;ot<tt.length;ot++){var st=tt[ot];if("none"!==st.hoverinfo){var lt=B(st,!0,l,a,N),ct=lt[0],ut=lt[1];st.name=ut,st.text=""!==ut?ut+" : "+ct:ct;var ht=st.cd[st.index];ht&&(ht.mc&&(st.mc=ht.mc),ht.mcc&&(st.mc=ht.mcc),ht.mlc&&(st.mlc=ht.mlc),ht.mlcc&&(st.mlc=ht.mlcc),ht.mlw&&(st.mlw=ht.mlw),ht.mrc&&(st.mrc=ht.mrc),ht.dir&&(st.dir=ht.dir)),st._distinct=!0,at.entries.push([st])}}at.entries.sort((function(t,e){return t[0].trace.index-e[0].trace.index})),at.layer=f,at._inHover=!0,at._groupTitleFont=et.grouptitlefont,_(n,at);var dt,pt,ft,mt,gt=f.select("g.legend"),yt=Z(n,gt.node()),vt=yt.width+2*E,xt=yt.height+2*E,bt=tt[0],_t=(bt.x0+bt.x1)/2,wt=(bt.y0+bt.y1)/2,kt=!(g.traceIs(bt.trace,"bar-like")||g.traceIs(bt.trace,"box-violin"));"y"===F?kt?(pt=wt-E,dt=wt+E):(pt=Math.min.apply(null,tt.map((function(t){return Math.min(t.y0,t.y1)}))),dt=Math.max.apply(null,tt.map((function(t){return Math.max(t.y0,t.y1)})))):pt=dt=i.mean(tt.map((function(t){return(t.y0+t.y1)/2})))-xt/2,"x"===F?kt?(ft=_t+E,mt=_t-E):(ft=Math.max.apply(null,tt.map((function(t){return Math.max(t.x0,t.x1)}))),mt=Math.min.apply(null,tt.map((function(t){return Math.min(t.x0,t.x1)})))):ft=mt=i.mean(tt.map((function(t){return(t.x0+t.x1)/2})))-vt/2;var Tt,St,At=D._offset,Mt=R._offset;return mt+=At-vt,pt+=Mt-xt,Tt=(ft+=At)+vt<$&&ft>=0?ft:mt+vt<$&&mt>=0?mt:At+vt<$?At:ft-_t<_t-mt+vt?$-vt:0,Tt+=E,St=(dt+=Mt)+xt<H&&dt>=0?dt:pt+xt<H&&pt>=0?pt:Mt+xt<H?Mt:dt-wt<wt-pt+xt?H-xt:0,St+=E,gt.attr("transform",o(Tt-1,St-1)),gt}var Ct=f.selectAll("g.hovertext").data(t,(function(t){return z(t)}));return Ct.enter().append("g").classed("hovertext",!0).each((function(){var t=e.select(this);t.append("rect").call(d.fill,d.addOpacity(p,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(h.font,{weight:S,style:A,variant:M,textcase:L,lineposition:P,shadow:I,family:k,size:T})})),Ct.exit().remove(),Ct.each((function(t){var r=e.select(this).attr("transform",""),i=t.color;Array.isArray(i)&&(i=i[t.eventData[0].pointNumber]);var f=t.bgcolor||i,m=d.combine(d.opacity(f)?f:d.defaultLine,p),g=d.combine(d.opacity(i)?i:d.defaultLine,p),y=t.borderColor||d.contrast(m),v=B(t,W,l,a,N,r),x=v[0],b=v[1],_=r.select("text.nums").call(h.font,{family:t.fontFamily||k,size:t.fontSize||T,color:t.fontColor||y,weight:t.fontWeight||S,style:t.fontStyle||A,variant:t.fontVariant||M,textcase:t.fontTextcase||L,lineposition:t.fontLineposition||P,shadow:t.fontShadow||I}).text(x).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n),z=r.select("text.name"),O=0,D=0;if(b&&b!==x){z.call(h.font,{family:t.fontFamily||k,size:t.fontSize||T,color:g,weight:t.fontWeight||S,style:t.fontStyle||A,variant:t.fontVariant||M,textcase:t.fontTextcase||L,lineposition:t.fontLineposition||P,shadow:t.fontShadow||I}).text(b).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n);var R=Z(n,z.node());O=R.width+2*E,D=R.height+2*E}else z.remove(),r.select("rect").remove();r.select("path").style({fill:m,stroke:y});var F=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,U=Math.abs(t.x1-t.x0),V=Math.abs(t.y1-t.y0),G=Z(n,_.node()),Y=G.width/a._invScaleX,X=G.height/a._invScaleY;t.ty0=(q-G.top)/a._invScaleY,t.bx=Y+2*E,t.by=Math.max(X+2*E,D),t.anchor="start",t.txwidth=Y,t.tx2width=O,t.offset=0;var K,J,Q=(Y+C+E+O)*a._invScaleX;if(u)t.pos=F,K=j+V/2+Q<=H,J=j-V/2-Q>=0,"top"!==t.idealAlign&&K||!J?K?(j+=V/2,t.anchor="start"):t.anchor="middle":(j-=V/2,t.anchor="end"),t.crossPos=j;else{if(t.pos=j,K=F+U/2+Q<=$,J=F-U/2-Q>=0,"left"!==t.idealAlign&&K||!J)if(K)F+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=F+tt-$,rt=F-tt;et>0&&(F-=et),rt<0&&(F+=-rt)}else F-=U/2,t.anchor="end";t.crossPos=F}_.attr("text-anchor",t.anchor),O&&z.attr("text-anchor",t.anchor),r.attr("transform",o(F,j)+(u?s(w):""))})),{hoverLabels:Ct,commonLabelBoundingBox:Q}}function B(t,e,r,n,a,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=i.templateString(t.name,t.trace._meta)),s=H(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===a?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"<br>":"")+t.text),void 0!==t.extraText&&(l+=(l?"<br>":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var d=t.hovertemplateLabels||t;t[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),l=(l=i.hovertemplateString(h,d,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(D,(function(e,r){return s=H(r,t.nameLength),""}))}return[l,s]}function j(t,e){var r=0,n=t.offset;return e&&(n*=-M,r=t.offset*A),{x:r,y:n}}function N(t,r,n,i){var a=function(t){return t*n},o=function(t){return t*i};t.each((function(t){var n=e.select(this);if(t.del)return n.remove();var i=n.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u=function(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(C+E),n=r+e*(t.txwidth+E);return"middle"===t.anchor&&(r-=t.tx2width/2,n+=t.txwidth/2+E),{alignShift:e,textShiftX:r,text2ShiftX:n}}(t),d=j(t,r),p=d.x,f=d.y,m="middle"===s;n.select("path").attr("d",m?"M-"+a(t.bx/2+t.tx2width/2)+","+o(f-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*C+p)+","+o(C+f)+"v"+o(t.by/2-C)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*C+p)+"V"+o(f-C)+"Z");var g=p+u.textShiftX,y=f+t.ty0-t.by/2+E,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==s?(i.attr("text-anchor","start"),g=m?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===v&&"end"!==s&&(i.attr("text-anchor","end"),g=m?t.bx/2-t.tx2width/2-E:t.bx+E)),i.call(c.positionText,a(g),o(y)),t.tx2width&&(n.select("text.name").call(c.positionText,a(u.text2ShiftX+u.alignShift*E+p),o(f+t.ty0-t.by/2+E)),n.select("rect").call(h.setRect,a(u.text2ShiftX+(u.alignShift-1)*t.tx2width/2+p),o(f-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function U(t,e){var n=t.index,a=t.trace||{},o=t.cd[0],s=t.cd[n]||{};function l(t){return t||r(t)&&0===t}var c=Array.isArray(n)?function(t,e){var r=i.castOption(o,n,t);return l(r)?r:i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(s,a,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===a.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:f.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:f.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!isNaN(t.xerr)&&!("log"===t.xa.type&&t.xerr<=0)){var h=f.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+f.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+h,"x"===e&&(t.distance+=1)}if(!isNaN(t.yerr)&&!("log"===t.ya.type&&t.yerr<=0)){var d=f.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+f.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function V(t,e,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var m=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,b,_=n.readability(v.color,m)<1.5?d.contrast(m):v.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,S=f.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=S,b=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,M=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),M=Math.max(M,a.position)),x=l.l+A*l.w,b=l.l+M*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S+("right"!==a.side?k:-k),cy:y,r:k,fill:T}).classed("spikeline",!0)}if(p){var C,E,L=e.vLinePoint;i=L&&L.xa,a=L&&L.ya,"cursor"===i.spikesnap?(C=c.pointerX,E=c.pointerY):(C=i._offset+L.x,E=a._offset+L.y);var P,I,z=n.readability(L.color,m)<1.5?d.contrast(m):L.color,O=i.spikemode,D=i.spikethickness,R=i.spikecolor||z,F=f.getPxPosition(t,i);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(P=F,I=E),-1!==O.indexOf("across")){var B=i._counterDomainMin,j=i._counterDomainMax;"free"===i.anchor&&(B=Math.min(B,i.position),j=Math.max(j,i.position)),P=l.t+(1-j)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:I,"stroke-width":D+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==i.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function $(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function H(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function W(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function G(t){return t.offsetTop+t.clientTop}function Y(t){return t.offsetLeft+t.clientLeft}function Z(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],d=c[1],p=u[0],f=u[1];return{x:h,y:d,width:p-h,height:f-d,top:Math.min(d,f),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(d,f)}}}}),Ar=d({"src/components/fx/hoverlabel_defaults.js"(t,e){var r=se(),n=q(),i=Ze().isUnifiedHover;e.exports=function(t,e,a,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Mr=d({"src/components/fx/layout_global_defaults.js"(t,e){var r=se(),n=Ar(),i=B();e.exports=function(t,e){n(t,e,(function(n,a){return r.coerce(t,e,i,n,a)}))}}}),Cr=d({"src/components/fx/defaults.js"(t,e){var r=se(),n=j(),i=Ar();e.exports=function(t,e,a,o){var s=r.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(i,a){return r.coerce(t,e,n,i,a)}),s)}}}),Er=d({"src/components/fx/hovermode_defaults.js"(t,e){var r=se(),n=B();e.exports=function(t,e){function i(i,a){return void 0!==e[i]?e[i]:r.coerce(t,e,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Lr=d({"src/components/fx/layout_defaults.js"(t,e){var r=se(),n=B(),i=Er(),a=Ar();e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}i(t,e)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=e._has("mapbox"),l=e._has("map"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}}),Pr=d({"src/components/fx/calc.js"(t,e){var r=se(),n=Vt();function i(t,e,n,i){i=i||r.identity,Array.isArray(t)&&(e[0][n]=i(t))}e.exports=function(t){var e=t.calcdata,a=t._fullLayout;function o(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var s=0;s<e.length;s++){var l=e[s],c=l[0].trace;if(!n.traceIs(c,"pie-like")){var u=n.traceIs(c,"2dMap")?i:r.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,l,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.font.weight,l,"htw"),u(c.hoverlabel.font.style,l,"hty"),u(c.hoverlabel.font.variant,l,"htv"),u(c.hoverlabel.namelength,l,"hnl"),u(c.hoverlabel.align,l,"hta"))}}}}}),Ir=d({"src/components/fx/click.js"(t,e){var r=Vt(),n=Sr().hover;e.exports=function(t,e,i){var a=r.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==i&&n(t,e,i,!0),t._hoverdata&&e&&e.target&&(a&&a.then?a.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}}}),zr=d({"src/components/fx/index.js"(t,e){var r=v(),n=se(),i=hr(),a=Ze(),o=B(),s=Sr();e.exports={moduleType:"component",name:"fx",constants:F(),schema:{layout:o},attributes:j(),layoutAttributes:o,supplyLayoutGlobalDefaults:Mr(),supplyDefaults:Cr(),supplyLayoutDefaults:Lr(),calc:Pr(),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(t,e,r){return n.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return n.castOption(t,r,"hoverinfo",(function(r){return n.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(t){var e=n.isD3Selection(t)?t:r.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:Ir()}}}),Or=d({"src/components/dragelement/helpers.js"(t){t.selectMode=function(t){return"lasso"===t||"select"===t},t.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},t.openMode=function(t){return"drawline"===t||"drawopenpath"===t},t.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},t.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}}}),Dr=d({"src/lib/clear_gl_canvases.js"(t,e){e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}}}),Rr=d({"src/fonts/ploticon.js"(t,e){e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}}}}),Fr=d({"src/components/shapes/draw_newshape/constants.js"(t,e){e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Br=d({"src/components/selections/helpers.js"(t,e){var r=se().strTranslate;function n(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:n,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return n(t,r[e])}},getTransform:function(t){return r(t.xaxis._offset,t.yaxis._offset)}}}}),jr=d({"src/components/shapes/draw_newshape/helpers.js"(t){var e=Xe(),r=Fr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=Br(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}t.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n<e;n++)for(var i=t[n].length,a=0;a<i;a++){var o=t[n][a][0];if("Z"===o)r+="Z";else for(var s=t[n][a].length,u=0;u<s;u++){var h=u;"Q"===o||"S"===o?h=c[u]:"C"===o&&(h=l[u]),r+=t[n][a][h],u>0&&u<s-1&&(r+=",")}}return r},t.readPaths=function(t,r,i,a){var l,c,u,h=e(t),d=[],p=-1,f=0,m=0,g=function(){c=f,u=m};g();for(var y=0;y<h.length;y++){var v,x,b,_,w=[],k=h[y][0],T=k;switch(k){case"M":p++,d[p]=[],f=+h[y][1],m=+h[y][2],w.push([T,f,m]),g();break;case"Q":case"S":v=+h[y][1],b=+h[y][2],f=+h[y][3],m=+h[y][4],w.push([T,f,m,v,b]);break;case"C":v=+h[y][1],b=+h[y][2],x=+h[y][3],_=+h[y][4],f=+h[y][5],m=+h[y][6],w.push([T,f,m,v,b,x,_]);break;case"T":case"L":f=+h[y][1],m=+h[y][2],w.push([T,f,m]);break;case"H":T="L",f=+h[y][1],w.push([T,f,m]);break;case"V":T="L",m=+h[y][1],w.push([T,f,m]);break;case"A":T="L";var S=+h[y][1],A=+h[y][2];+h[y][4]||(S=-S,A=-A);var M=f-S,C=m;for(l=1;l<=n/2;l++){var E=2*Math.PI*l/n;w.push([T,M+S*Math.cos(E),C+A*Math.sin(E)])}break;case"Z":f===c&&m===u||(f=c,m=u,w.push([T,f,m]))}for(var L=(i||{}).domain,P=r._fullLayout._size,I=i&&"pixel"===i.xsizemode,z=i&&"pixel"===i.ysizemode,O=!1===a,D=0;D<w.length;D++){for(l=0;l+2<7;l+=2){var R=w[D][l+1],F=w[D][l+2];void 0!==R&&void 0!==F&&(f=R,m=F,i&&(i.xaxis&&i.xaxis.p2r?(O&&(R-=i.xaxis._offset),R=I?s(i.xaxis,i.xanchor)+R:o(i.xaxis,R)):(O&&(R-=P.l),L?R=L.x[0]+R/P.w:R/=P.w),i.yaxis&&i.yaxis.p2r?(O&&(F-=i.yaxis._offset),F=z?s(i.yaxis,i.yanchor)-F:o(i.yaxis,F)):(O&&(F-=P.t),F=L?L.y[1]-F/P.h:1-F/P.h)),w[D][l+1]=R,w[D][l+2]=F)}d[p].push(w[D].slice())}}return d},t.pointsOnRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!u(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!u(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!u(t[0][1],t[1][1])&&!u(t[0][1],t[3][1]))&&!!(h(t[0],t[1])*h(t[0],t[3]))},t.pointsOnEllipse=function(t){var e=t.length;if(e!==n+1)return!1;e=n;for(var r=0;r<e;r++){var i=(2*e-r)%e,a=(e/2+i)%e,o=(e/2+r)%e;if(!u(h(t[r],t[o]),h(t[i],t[a])))return!1}return!0},t.handleEllipse=function(e,r,a){if(!e)return[r,a];var o=t.ellipseOver({x0:r[0],y0:r[1],x1:a[0],y1:a[1]}),s=(o.x1+o.x0)/2,l=(o.y1+o.y0)/2,c=(o.x1-o.x0)/2,u=(o.y1-o.y0)/2;c||(c=u/=i),u||(u=c/=i);for(var h=[],d=0;d<n;d++){var p=2*d*Math.PI/n;h.push([s+c*Math.cos(p),l+u*Math.sin(p)])}return h},t.ellipseOver=function(t){var e=t.x0,r=t.y0,n=t.x1,a=t.y1,o=n-e,s=a-r,l=((e-=o)+n)/2,c=((r-=s)+a)/2;return{x0:l-(o*=i),y0:c-(s*=i),x1:l+o,y1:c+s}},t.fixDatesForPaths=function(t,e,r){var n="date"===e.type,i="date"===r.type;if(!n&&!i)return t;for(var a=0;a<t.length;a++)for(var o=0;o<t[a].length;o++)for(var s=0;s+2<t[a][o].length;s+=2)n&&(t[a][o][s+1]=t[a][o][s+1].replace(" ","_")),i&&(t[a][o][s+2]=t[a][o][s+2].replace(" ","_"));return t}}}),Nr=d({"src/components/shapes/draw_newshape/newshapes.js"(t,e){var r=Or(),n=r.drawMode,i=r.openMode,a=Fr(),o=a.i000,s=a.i090,l=a.i180,c=a.i270,u=a.cos45,h=a.sin45,d=Br(),p=d.p2r,f=d.r2p,m=xe().clearOutline,g=jr(),y=g.readPaths,v=g.writePaths,x=g.ellipseOver,b=g.fixDatesForPaths;function _(t,e,r){var n,a=t[0][0],d=e.gd,m=a.getAttribute("d"),g=d._fullLayout.newshape,_=e.plotinfo,w=e.isActiveShape,k=_.xaxis,T=_.yaxis,S=!!_.domain||!_.xaxis,A=!!_.domain||!_.yaxis,M=i(r),C=y(m,d,_,w),E={editable:!0,visible:g.visible,name:g.name,showlegend:g.showlegend,legend:g.legend,legendwidth:g.legendwidth,legendgroup:g.legendgroup,legendgrouptitle:{text:g.legendgrouptitle.text,font:g.legendgrouptitle.font},legendrank:g.legendrank,label:g.label,xref:S?"paper":k._id,yref:A?"paper":T._id,layer:g.layer,opacity:g.opacity,line:{color:g.line.color,width:g.line.width,dash:g.line.dash}};if(M||(E.fillcolor=g.fillcolor,E.fillrule=g.fillrule),1===C.length&&(n=C[0]),n&&5===n.length&&"drawrect"===r)E.type="rect",E.x0=n[0][1],E.y0=n[0][2],E.x1=n[2][1],E.y1=n[2][2];else if(n&&"drawline"===r)E.type="line",E.x0=n[0][1],E.y0=n[0][2],E.x1=n[1][1],E.y1=n[1][2];else if(n&&"drawcircle"===r){E.type="circle";var L=n[o][1],P=n[s][1],I=n[l][1],z=n[c][1],O=n[o][2],D=n[s][2],R=n[l][2],F=n[c][2],B=_.xaxis&&("date"===_.xaxis.type||"log"===_.xaxis.type),j=_.yaxis&&("date"===_.yaxis.type||"log"===_.yaxis.type);B&&(L=f(_.xaxis,L),P=f(_.xaxis,P),I=f(_.xaxis,I),z=f(_.xaxis,z)),j&&(O=f(_.yaxis,O),D=f(_.yaxis,D),R=f(_.yaxis,R),F=f(_.yaxis,F));var N=(P+z)/2,U=(O+R)/2,V=x({x0:N,y0:U,x1:N+(z-P+I-L)/2*u,y1:U+(F-D+R-O)/2*h});B&&(V.x0=p(_.xaxis,V.x0),V.x1=p(_.xaxis,V.x1)),j&&(V.y0=p(_.yaxis,V.y0),V.y1=p(_.yaxis,V.y1)),E.x0=V.x0,E.y0=V.y0,E.x1=V.x1,E.y1=V.y1}else E.type="path",k&&T&&b(C,k,T),E.path=v(C),n=null;return E}e.exports={newShapes:function(t,e){if(t.length&&t[0][0]){var r=e.gd,i=e.isActiveShape,a=e.dragmode,o=(r.layout||{}).shapes||[];if(!n(a)&&void 0!==i){var s=r._fullLayout._activeShapeIndex;if(s<o.length)switch(r._fullLayout.shapes[s].type){case"rect":a="drawrect";break;case"circle":a="drawcircle";break;case"line":a="drawline";break;case"path":var l=o[s].path||"";a="Z"===l[l.length-1]?"drawclosedpath":"drawopenpath"}}var c=_(t,e,a);m(r);for(var u=e.editHelpers,h=(u||{}).modifyItem,d=[],p=0;p<o.length;p++){var f=r._fullLayout.shapes[p];if(d[p]=f._input,void 0!==i&&p===r._fullLayout._activeShapeIndex){var g=c;switch(f.type){case"line":case"rect":case"circle":h("x0",g.x0-(f.x0shift||0)),h("x1",g.x1-(f.x1shift||0)),h("y0",g.y0-(f.y0shift||0)),h("y1",g.y1-(f.y1shift||0));break;case"path":h("path",g.path)}}}return void 0===i?(d.push(c),d):u?u.getUpdateObj():{}}},createShapeObj:_}}}),Ur=d({"src/components/selections/draw_newselection/newselections.js"(t,e){var r=Or().selectMode,n=xe().clearOutline,i=jr(),a=i.readPaths,o=i.writePaths,s=i.fixDatesForPaths;e.exports=function(t,e){if(t.length){var i=t[0][0];if(i){var l=i.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,h=e.plotinfo,d=h.xaxis,p=h.yaxis,f=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!r(m)&&void 0!==f){var y=c._fullLayout._activeSelectionIndex;if(y<g.length)switch(c._fullLayout.selections[y].type){case"rect":m="select";break;case"path":m="lasso"}}var v,x=a(l,c,h,f),b={xref:d._id,yref:p._id,opacity:u.opacity,line:{color:u.line.color,width:u.line.width,dash:u.line.dash}};1===x.length&&(v=x[0]),v&&5===v.length&&"select"===m?(b.type="rect",b.x0=v[0][1],b.y0=v[0][2],b.x1=v[2][1],b.y1=v[2][2]):(b.type="path",d&&p&&s(x,d,p),b.path=o(x),v=null),n(c);for(var _=e.editHelpers,w=(_||{}).modifyItem,k=[],T=0;T<g.length;T++){var S=c._fullLayout.selections[T];if(S){if(k[T]=S._input,void 0!==f&&T===c._fullLayout._activeSelectionIndex){var A=b;switch(S.type){case"rect":w("x0",A.x0),w("x1",A.x1),w("y0",A.y0),w("y1",A.y1);break;case"path":w("path",A.path)}}}else k[T]=S}return void 0===f?(k.push(b),k):_?_.getUpdateObj():{}}}}}}),Vr=d({"src/components/shapes/constants.js"(t,e){e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}}),qr=d({"src/components/shapes/helpers.js"(t){var e=Vr(),r=se(),n=nr();function i(t,e){var r=0;return(e=e||0)&&t&&("category"===t.type||"multicategory"===t.type)&&(r=(t.r2p(1)-t.r2p(0))*e),r}t.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},t.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},t.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},t.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},t.extractPathCoords=function(t,n,i){var a=[];return t.match(e.segmentRE).forEach((function(t){var o=n[t.charAt(0)].drawn;if(void 0!==o){var s=t.substr(1).match(e.paramRE);if(s&&!(s.length<o)){var l=s[o],c=i?l:r.cleanNumber(l);a.push(c)}}})),a},t.getDataToPixel=function(e,r,n,a,o){var s,l=e._fullLayout._size;if(r)if("domain"===o)s=function(t){return r._length*(a?1-t:t)+r._offset};else{var c=t.shapePositionToRange(r);s=function(t){var e=i(r,n);return r._offset+r.r2p(c(t,!0))+e},"date"===r.type&&(s=t.decodeDate(s))}else s=a?function(t){return l.t+l.h*(1-t)}:function(t){return l.l+l.w*t};return s},t.getPixelToData=function(e,r,n,i){var a,o=e._fullLayout._size;if(r)if("domain"===i)a=function(t){var e=(t-r._offset)/r._length;return n?1-e:e};else{var s=t.rangeToShapePosition(r);a=function(t){return s(r.p2r(t-r._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a},t.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n},t.makeShapesOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}},t.makeSelectionsOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.selections[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),{options:r,plotinfo:n}},t.getPathString=function(a,o){var s,l,c,u,h,d,p,f,m=o.type,g=n.getRefType(o.xref),y=n.getRefType(o.yref),v=n.getFromId(a,o.xref),x=n.getFromId(a,o.yref),b=a._fullLayout._size,_=i(v,o.x0shift),w=i(v,o.x1shift),k=i(x,o.y0shift),T=i(x,o.y1shift);if(v?"domain"===g?l=function(t){return v._offset+v._length*t}:(s=t.shapePositionToRange(v),l=function(t){return v._offset+v.r2p(s(t,!0))}):l=function(t){return b.l+b.w*t},x?"domain"===y?u=function(t){return x._offset+x._length*(1-t)}:(c=t.shapePositionToRange(x),u=function(t){return x._offset+x.r2p(c(t,!0))}):u=function(t){return b.t+b.h*(1-t)},"path"===m)return v&&"date"===v.type&&(l=t.decodeDate(l)),x&&"date"===x.type&&(u=t.decodeDate(u)),function(t,n,i){var a=t.path,o=t.xsizemode,s=t.ysizemode,l=t.xanchor,c=t.yanchor;return a.replace(e.segmentRE,(function(t){var a=0,u=t.charAt(0),h=e.paramIsX[u],d=e.paramIsY[u],p=e.numParams[u],f=t.substr(1).replace(e.paramRE,(function(t){return h[a]?t="pixel"===o?n(l)+Number(t):n(t):d[a]&&(t="pixel"===s?i(c)-Number(t):i(t)),++a>p&&(t="X"),t}));return a>p&&(f=f.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),u+f}))}(o,l,u);if("pixel"===o.xsizemode){var S=l(o.xanchor);h=S+o.x0+_,d=S+o.x1+w}else h=l(o.x0)+_,d=l(o.x1)+w;if("pixel"===o.ysizemode){var A=u(o.yanchor);p=A-o.y0+k,f=A-o.y1+T}else p=u(o.y0)+k,f=u(o.y1)+T;if("line"===m)return"M"+h+","+p+"L"+d+","+f;if("rect"===m)return"M"+h+","+p+"H"+d+"V"+f+"H"+h+"Z";var M=(h+d)/2,C=(p+f)/2,E=Math.abs(M-h),L=Math.abs(C-p),P="A"+E+","+L,I=M+E+","+C;return"M"+I+P+" 0 1,1 "+M+","+(C-L)+P+" 0 0,1 "+I+"Z"}}}),$r=d({"src/components/shapes/display_labels.js"(t,e){var r=se(),n=nr(),i=Ae(),a=Je(),o=jr().readPaths,s=qr(),l=s.getPathString,c=Dt(),u=Se().FROM_TL;e.exports=function(t,e,h,d){if(d.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var p;if(h.label.texttemplate){var f={};if("path"!==h.type){var m=n.getFromId(t,h.xref),g=n.getFromId(t,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(f[y]=v)}}p=r.texttemplateStringForShapes(h.label.texttemplate,{},t._fullLayout._d3locale,f)}else p=h.label.text;var x,b,_,w,k={"data-index":e},T=h.label.font,S=d.append("g").attr(k).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(h.path){var A=l(t,h),M=o(A,t);x=1/0,_=1/0,b=-1/0,w=-1/0;for(var C=0;C<M.length;C++)for(var E=0;E<M[C].length;E++)for(var L=M[C][E],P=1;P<L.length;P+=2){var I=L[P],z=L[P+1];x=Math.min(x,I),b=Math.max(b,I),_=Math.min(_,z),w=Math.max(w,z)}}else{var O=n.getFromId(t,h.xref),D=h.x0shift,R=h.x1shift,F=n.getRefType(h.xref),B=n.getFromId(t,h.yref),j=h.y0shift,N=h.y1shift,U=n.getRefType(h.yref),V=function(e,r){return s.getDataToPixel(t,O,r,!1,F)(e)},q=function(e,r){return s.getDataToPixel(t,B,r,!0,U)(e)};x=V(h.x0,D),b=V(h.x1,R),_=q(h.y0,j),w=q(h.y1,N)}var $=h.label.textangle;"auto"===$&&($="line"===h.type?function(t,e,r,n){var i,a;return a=Math.abs(r-t),i=r>=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),S.call((function(e){return e.call(a.font,T).attr({}),i.convertToTspans(e,t),e}));var H=function(t,e,r,n,i,a,o){var s,l,c,h,d=i.label.textposition,p=i.label.textangle,f=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,b=i.label.yanchor;if("line"===m){"start"===d?(s=t,l=e):"end"===d?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===d?"auto"===p?r>t?"left":r<t?"right":"center":r>t?"right":r<t?"left":"center":"end"===d?"auto"===p?r>t?"right":r<t?"left":"center":r>t?"left":r<t?"right":"center":"center");var _={left:1,center:0,right:-1},w={bottom:-1,middle:0,top:1};if("auto"===p){var k=w[b];c=-f*y*k,h=f*v*k}else c=f*_[x],h=f*w[b];s+=c,l+=h}else c=f+3,-1!==d.indexOf("right")?(s=Math.max(t,r)-c,"auto"===x&&(x="right")):-1!==d.indexOf("left")?(s=Math.min(t,r)+c,"auto"===x&&(x="left")):(s=(t+r)/2,"auto"===x&&(x="center")),l=-1!==d.indexOf("top")?Math.min(e,n):-1!==d.indexOf("bottom")?Math.max(e,n):(e+n)/2,h=f,"bottom"===b?l-=h:"top"===b&&(l+=h);var T=u[b],S=i.label.font.size,A=o.height;return{textx:s+(A*T-S)*y,texty:l+-(A*T-S)*v,xanchor:x}}(x,_,b,w,h,$,a.bBox(S.node())),W=H.textx,G=H.texty,Y=H.xanchor;S.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[Y],y:G,x:W,transform:"rotate("+$+","+W+","+G+")"}).call(i.positionText,W,G)}}}}),Hr=d({"src/components/shapes/display_outlines.js"(t,e){var r=se().strTranslate,n=hr(),i=Or(),a=i.drawMode,o=i.selectMode,s=Vt(),l=q(),c=Fr(),u=c.i000,h=c.i090,d=c.i180,p=c.i270,f=xe().clearOutlineControllers,m=jr(),g=m.pointsOnRectangle,y=m.pointsOnEllipse,v=m.writePaths,x=Nr().newShapes,b=Nr().createShapeObj,_=Ur(),w=$r();function k(t,e){var r,n,i,a=t[e][1],o=t[e][2],s=t.length;return n=t[r=(e+1)%s][1],i=t[r][2],n===a&&i===o&&(n=t[r=(e+2)%s][1],i=t[r][2]),[r,n,i]}e.exports=function t(e,i,c,m){m||(m=0);var T=c.gd;function S(){t(e,i,c,m++),(y(e[0])||c.hasText)&&A({redrawing:!0})}function A(t){var e={};void 0!==c.isActiveShape&&(c.isActiveShape=!1,e=x(i,c)),void 0!==c.isActiveSelection&&(c.isActiveSelection=!1,e=_(i,c),T._fullLayout._reselect=!0),Object.keys(e).length&&s.call((t||{}).redrawing?"relayout":"_guiRelayout",T,e)}var M,C,E,L,P,I=T._fullLayout._zoomlayer,z=c.dragmode,O=a(z),D=o(z);if((O||D)&&(T._fullLayout._outlining=!0),f(T),i.attr("d",v(e)),m||!c.isActiveShape&&!c.isActiveSelection||(P=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[r]=[];for(var i=0;i<n.length;i++){t[r][i]=[];for(var a=0;a<n[i].length;a++)t[r][i][a]=n[i][a]}}return t}([],e),function(t){M=[];for(var i=0;i<e.length;i++){var a=e[i],o=g(a),s=!o&&y(a);M[i]=[];for(var f=a.length,m=0;m<f;m++)if("Z"!==a[m][0]&&(!s||m===u||m===h||m===d||m===p)){var v,x=o&&c.isActiveSelection;x&&(v=k(a,m));var b=a[m][1],_=a[m][2],w=t.append(x?"rect":"circle").attr("data-i",i).attr("data-j",m).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(x){var S=v[1]-b,A=v[2]-_,C=A?5:Math.max(Math.min(25,Math.abs(S)-5),5),E=S?5:Math.max(Math.min(25,Math.abs(A)-5),5);w.classed(A?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",C).attr("height",E).attr("x",b-C/2).attr("y",_-E/2).attr("transform",r(S/2,A/2))}else w.classed("cursor-grab",!0).attr("r",5).attr("cx",b).attr("cy",_);M[i][m]={element:w.node(),gd:T,prepFn:B,doneFn:N,clickFn:U},n.init(M[i][m])}}}(I.append("g").attr("class","outline-controllers")),function(){if(C=[],e.length){var t=0;C[t]={element:i[0][0],gd:T,prepFn:q,doneFn:$,clickFn:H},n.init(C[t])}}()),O&&c.hasText){var R=I.select(".label-temp"),F=b(i,c,c.dragmode);w(T,"label-temp",F,R)}function B(t){E=+t.srcElement.getAttribute("data-i"),L=+t.srcElement.getAttribute("data-j"),M[E][L].moveFn=j}function j(t,r){if(e.length){var n=P[E][L][1],i=P[E][L][2],a=e[E],o=a.length;if(g(a)){var s=t,l=r;c.isActiveSelection&&(k(a,L)[1]===a[L][1]?l=0:s=0);for(var u=0;u<o;u++)if(u!==L){var h=a[u];h[1]===a[L][1]&&(h[1]=n+s),h[2]===a[L][2]&&(h[2]=i+l)}if(a[L][1]=n+s,a[L][2]=i+l,!g(a))for(var d=0;d<o;d++)for(var p=0;p<a[d].length;p++)a[d][p]=P[E][d][p]}else a[L][1]=n+t,a[L][2]=i+r;S()}}function N(){A()}function U(t,r){if(2===t){E=+r.srcElement.getAttribute("data-i"),L=+r.srcElement.getAttribute("data-j");var n=e[E];g(n)||y(n)||function(){if(e.length&&e[E]&&e[E].length){for(var t=[],r=0;r<e[E].length;r++)r!==L&&t.push(e[E][r]);t.length>1&&(2!==t.length||"Z"!==t[1][0])&&(0===L&&(t[0][0]="M"),e[E]=t,S(),A())}}()}}function V(t,r){!function(t,r){if(e.length)for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)for(var a=0;a+2<e[n][i].length;a+=2)e[n][i][a+1]=P[n][i][a+1]+t,e[n][i][a+2]=P[n][i][a+2]+r}(t,r),S()}function q(t){(E=+t.srcElement.getAttribute("data-i"))||(E=0),C[E].moveFn=V}function $(){A()}function H(t){2===t&&function(t){if(o(t._fullLayout.dragmode)){f(t);var e=t._fullLayout._activeSelectionIndex,r=(t.layout||{}).selections||[];if(e<r.length){for(var n=[],i=0;i<r.length;i++)i!==e&&n.push(r[i]);delete t._fullLayout._activeSelectionIndex;var a=t._fullLayout.selections[e];t._fullLayout._deselect={xref:a.xref,yref:a.yref},s.call("_guiRelayout",t,{selections:n})}}}(T)}}}}),Wr=d({"src/components/shapes/draw.js"(t,e){var r=v(),n=Vt(),i=se(),a=nr(),o=jr().readPaths,s=Hr(),l=$r(),c=xe().clearOutlineControllers,u=q(),h=Je(),d=ge().arrayEditor,p=hr(),f=dr(),m=Vr(),g=qr(),y=g.getPathString;function x(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeUpperLayer.selectAll("text").remove(),e._shapeLowerLayer.selectAll("text").remove(),e._plots){var n=e._plots[r].shapelayer;n&&(n.selectAll("path").remove(),n.selectAll("text").remove())}for(var i=0;i<e.shapes.length;i++)!0===e.shapes[i].visible&&w(t,i)}function b(t){return!!t._fullLayout._outlining}function _(t){return!t._context.edits.shapePosition}function w(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var c=g.makeShapesOptionsAndPlotinfo(t,e),v=c.options,w=c.plotinfo;function A(c){var A=y(t,v),M={"data-index":e,"fill-rule":v.fillrule,d:A},C=v.opacity,E=v.fillcolor,L=v.line.width?v.line.color:"rgba(0,0,0,0)",P=v.line.width,I=v.line.dash;P||!0!==v.editable||(P=5,I="solid");var z="Z"!==A[A.length-1],O=_(t)&&v.editable&&t._fullLayout._activeShapeIndex===e;O&&(E=z?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,C=t._fullLayout.activeshape.opacity);var D,R=c.append("g").classed("shape-group",!0).attr({"data-index":e}),F=R.append("path").attr(M).style("opacity",C).call(u.stroke,L).call(u.fill,E).call(h.dashLine,I,P);if(k(R,t,v),l(t,e,v,R),(O||t._context.edits.shapePosition)&&(D=d(t.layout,"shapes",v)),O){F.style({cursor:"move"});var B={element:F.node(),plotinfo:w,gd:t,editHelpers:D,hasText:v.label.text||v.label.texttemplate,isActiveShape:!0},j=o(A,t);s(j,F,B)}else t._context.edits.shapePosition?function(t,e,o,s,c,u){var d,v,x,_,w,S,A,M,C,E,L,P,I,z,O,D,R=10,F=10,B="pixel"===o.xsizemode,j="pixel"===o.ysizemode,N="line"===o.type,U="path"===o.type,V=u.modifyItem,q=r.select(e.node().parentNode),$=a.getFromId(t,o.xref),H=a.getRefType(o.xref),W=a.getFromId(t,o.yref),G=a.getRefType(o.yref),Y=o.x0shift,Z=o.x1shift,X=o.y0shift,K=o.y1shift,J=function(e,r){return g.getDataToPixel(t,$,r,!1,H)(e)},Q=function(e,r){return g.getDataToPixel(t,W,r,!0,G)(e)},tt=g.getPixelToData(t,$,!1,H),et=g.getPixelToData(t,W,!0,G),rt=it(),nt={element:rt.node(),gd:t,prepFn:st,doneFn:lt,clickFn:ct};function it(){return N?at():e}function at(){var t=10,r=Math.max(o.line.width,t),n=c.append("g").attr("data-index",s).attr("drag-helper",!0);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":r,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=Math.max(r/2,t);return n.append("circle").attr({"data-line-point":"start-point",cx:B?J(o.xanchor)+o.x0:J(o.x0,Y),cy:j?Q(o.yanchor)-o.y0:Q(o.y0,X),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:B?J(o.xanchor)+o.x1:J(o.x1,Z),cy:j?Q(o.yanchor)-o.y1:Q(o.y1,K),r:a}).style(i).classed("cursor-grab",!0),n}function ot(r){if(b(t))D=null;else if(N)D="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=nt.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!U&&i>R&&a>F&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";f(e,l),D=l.split("-")[0]}}function st(r){b(t)||(B&&(w=J(o.xanchor)),j&&(S=Q(o.yanchor)),"path"===o.type?O=o.path:(d=B?o.x0:J(o.x0),v=j?o.y0:Q(o.y0),x=B?o.x1:J(o.x1),_=j?o.y1:Q(o.y1)),d<x?(C=d,I="x0",E=x,z="x1"):(C=x,I="x1",E=d,z="x0"),!j&&v<_||j&&v>_?(A=v,L="y0",M=_,P="y1"):(A=_,L="y1",M=v,P="y0"),ot(r),dt(c,o),ft(e,o,t),nt.moveFn="move"===D?ut:ht,nt.altKey=r.altKey)}function lt(){b(t)||(f(e),pt(c),k(e,t,o),n.call("_guiRelayout",t,u.getUpdateObj()))}function ct(){b(t)||pt(c)}function ut(r,n){if("path"===o.type){var i=function(t){return t},a=i,u=i;B?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(J(t)+r)},$&&"date"===$.type&&(a=g.encodeDate(a))),j?V("yanchor",o.yanchor=et(S+n)):(u=function(t){return et(Q(t)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else B?V("xanchor",o.xanchor=tt(w+r)):(V("x0",o.x0=tt(d+r)),V("x1",o.x1=tt(x+r))),j?V("yanchor",o.yanchor=et(S+n)):(V("y0",o.y0=et(v+n)),V("y1",o.y1=et(_+n)));e.attr("d",y(t,o)),dt(c,o),l(t,s,o,q)}function ht(r,n){if(U){var i=function(t){return t},a=i,u=i;B?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(J(t)+r)},$&&"date"===$.type&&(a=g.encodeDate(a))),j?V("yanchor",o.yanchor=et(S+n)):(u=function(t){return et(Q(t)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else if(N){if("resize-over-start-point"===D){var h=d+r,p=j?v-n:v+n;V("x0",o.x0=B?h:tt(h)),V("y0",o.y0=j?p:et(p))}else if("resize-over-end-point"===D){var f=x+r,m=j?_-n:_+n;V("x1",o.x1=B?f:tt(f)),V("y1",o.y1=j?m:et(m))}}else{var b=function(t){return-1!==D.indexOf(t)},k=b("n"),H=b("s"),G=b("w"),Y=b("e"),Z=k?A+n:A,X=H?M+n:M,K=G?C+r:C,rt=Y?E+r:E;j&&(k&&(Z=A-n),H&&(X=M-n)),(!j&&X-Z>F||j&&Z-X>F)&&(V(L,o[L]=j?Z:et(Z)),V(P,o[P]=j?X:et(X))),rt-K>R&&(V(I,o[I]=B?K:tt(K)),V(z,o[z]=B?rt:tt(rt)))}e.attr("d",y(t,o)),dt(c,o),l(t,s,o,q)}function dt(t,e){function r(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=J(B?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),s=Q(j?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),B&&j){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(B){var c="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",c)}else{var u="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",u)}}(B||j)&&r()}function pt(t){t.selectAll(".visual-cue").remove()}function ft(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}p.init(nt),rt.node().onmousemove=ot}(t,F,v,e,c,D):!0===v.editable&&F.style("pointer-events",z||u.opacity(E)*C<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(t,e){if(_(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeShapeIndex)return void S(t);t._fullLayout._activeShapeIndex=n,t._fullLayout._deactivateShape=S,x(t)}}}(t,F)}))}v._input&&!0===v.visible&&("above"===v.layer?A(t._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?A(t._fullLayout._shapeLowerLayer):"between"===v.layer?A(w.shapelayerBetween):w._hadPlotinfo?A((w.mainplotinfo||w).shapelayer):A(t._fullLayout._shapeLowerLayer))}function k(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function T(t,e,r){return t.replace(m.segmentRE,(function(t){var n=0,i=t.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function S(t){_(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,x(t))}e.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(_(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var i=[],a=0;a<r.length;a++)a!==e&&i.push(r[a]);return delete t._fullLayout._activeShapeIndex,n.call("_guiRelayout",t,{shapes:i})}}},drawLabel:l}}}),Gr=d({"src/components/modebar/buttons.js"(t,e){var r=Vt(),n=ke(),i=ve(),a=Rr(),o=Wr().eraseActiveShape,s=se(),l=s._,c=e.exports={};function u(t,e){var n,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=i.list(t,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===s){var p,f="in"===l?.5:2,m=(1+f)/2,g=(1-f)/2;for(a=0;a<h.length;a++)if(!(n=h[a]).fixedrange)if(p=n._name,"auto"===l)u[p+".autorange"]=!0;else if("reset"===l)void 0===n._rangeInitial0&&void 0===n._rangeInitial1?u[p+".autorange"]=!0:void 0===n._rangeInitial0?(u[p+".autorange"]=n._autorangeInitial,u[p+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(u[p+".range"]=[n._rangeInitial0,null],u[p+".autorange"]=n._autorangeInitial):u[p+".range"]=[n._rangeInitial0,n._rangeInitial1],void 0!==n._showSpikeInitial&&(u[p+".showspikes"]=n._showSpikeInitial,"on"!==d||n._showSpikeInitial||(d="off"));else{var y=[n.r2l(n.range[0]),n.r2l(n.range[1])],v=[m*y[0]+g*y[1],m*y[1]+g*y[0]];u[p+".range[0]"]=n.l2r(v[0]),u[p+".range[1]"]=n.l2r(v[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=c._isHoriz?"y":"x",o.setAttribute("data-val",l)),u[s]=l;c._cartesianSpikesEnabled=d,r.call("_guiRelayout",t,u)}function h(t,e){for(var n=e.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],s={},l=i.split("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=a;var u="pan"===a?a:"zoom";s.dragmode=u,r.call("_guiRelayout",t,s)}function d(t,e){for(var n=e.currentTarget.getAttribute("data-attr"),i="resetLastSave"===n,a="resetDefault"===n,o=t._fullLayout,s=o._subplots.gl3d||[],l={},c=0;c<s.length;c++){var u,h=s[c],d=h+".camera",p=h+".aspectratio",f=h+".aspectmode",m=o[h]._scene;i?(l[d+".up"]=m.viewInitial.up,l[d+".eye"]=m.viewInitial.eye,l[d+".center"]=m.viewInitial.center,u=!0):a&&(l[d+".up"]=null,l[d+".eye"]=null,l[d+".center"]=null,u=!0),u&&(l[p+".x"]=m.viewInitial.aspectratio.x,l[p+".y"]=m.viewInitial.aspectratio.y,l[p+".z"]=m.viewInitial.aspectratio.z,l[f]=m.viewInitial.aspectmode)}r.call("_guiRelayout",t,l)}function p(t,e){var r=e.currentTarget,n=r._previousVal,i=t._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var c=0;c<a.length;c++){var u=a[c],h=i[u],d=u+".hovermode";s[d]=h.hovermode,l[d]=!1;for(var p=0;p<3;p++){var f=o[p],m=u+"."+f+".showspikes";l[m]=!1,s[m]=h[f].showspikes}}r._previousVal=s}return l}function f(t,e){for(var n=e.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var c=s[l],u=o[c];if("zoom"===i){var h=u.projection.scale,d="in"===a?2*h:.5*h;r.call("_guiRelayout",t,c+".projection.scale",d)}}"reset"===i&&b(t,"geo")}function m(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function g(t){var e=m(t);r.call("_guiRelayout",t,"hovermode",e)}function y(t,e){x(t,e,"mapbox")}function v(t,e){x(t,e,"map")}function x(t,e,n){for(var i=e.currentTarget.getAttribute("data-val"),a=t._fullLayout,o=a._subplots[n]||[],s={},l=0;l<o.length;l++){var c=o[l],u=a[c].zoom,h="in"===i?1.05*u:u/1.05;s[c+".zoom"]=h}r.call("_guiRelayout",t,s)}function b(t,e){for(var n=t._fullLayout,i=n._subplots[e]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=n[s]._subplot.viewInitial,c=Object.keys(l),u=0;u<c.length;u++){var h=c[u];a[s+"."+h]=l[h]}r.call("_guiRelayout",t,a)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return l(t,"png"===e?"Download plot as a png":"Download plot")},icon:a.camera,click:function(t){var e=t._context.toImageButtonOptions,n={format:e.format||"png"};s.notifier(l(t,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach((function(t){t in e&&(n[t]=e[t])})),r.call("downloadImage",t,n).then((function(e){s.notifier(l(t,"Snapshot succeeded")+" - "+e,"long")})).catch((function(){s.notifier(l(t,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.disk,click:function(t){n.sendDataToCloud(t)}},c.editInChartStudio={name:"editInChartStudio",title:function(t){return l(t,"Edit in Chart Studio")},icon:a.pencil,click:function(t){n.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"dragmode",val:"zoom",icon:a.zoombox,click:u},c.pan2d={name:"pan2d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"dragmode",val:"pan",icon:a.pan,click:u},c.select2d={name:"select2d",_cat:"select",title:function(t){return l(t,"Box Select")},attr:"dragmode",val:"select",icon:a.selectbox,click:u},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return l(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:a.lasso,click:u},c.drawclosedpath={name:"drawclosedpath",title:function(t){return l(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:a.drawclosedpath,click:u},c.drawopenpath={name:"drawopenpath",title:function(t){return l(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:a.drawopenpath,click:u},c.drawline={name:"drawline",title:function(t){return l(t,"Draw line")},attr:"dragmode",val:"drawline",icon:a.drawline,click:u},c.drawrect={name:"drawrect",title:function(t){return l(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:a.drawrect,click:u},c.drawcircle={name:"drawcircle",title:function(t){return l(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:a.drawcircle,click:u},c.eraseshape={name:"eraseshape",title:function(t){return l(t,"Erase active shape")},icon:a.eraseshape,click:o},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return l(t,"Autoscale")},attr:"zoom",val:"auto",icon:a.autoscale,click:u},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return l(t,"Reset axes")},attr:"zoom",val:"reset",icon:a.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(t){return l(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(t){return l(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:a.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return l(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:a.zoombox,click:h},c.pan3d={name:"pan3d",_cat:"pan",title:function(t){return l(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:a.pan,click:h},c.orbitRotation={name:"orbitRotation",title:function(t){return l(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:a["3d_rotate"],click:h},c.tableRotation={name:"tableRotation",title:function(t){return l(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:a["z-axis"],click:h},c.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return l(t,"Reset camera to default")},attr:"resetDefault",icon:a.home,click:d},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return l(t,"Reset camera to last save")},attr:"resetLastSave",icon:a.movie,click:d},c.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(t,e){var n=p(t,e);r.call("_guiRelayout",t,n)}},c.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:f},c.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:f},c.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return l(t,"Reset")},attr:"reset",val:null,icon:a.autoscale,click:f},c.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:g},c.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:g},c.resetViewSankey={name:"resetSankeyGroup",title:function(t){return l(t,"Reset view")},icon:a.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},n=0;n<t._fullData.length;n++){var i=t._fullData[n]._viewInitial;e["node.groups"].push(i.node.groups.slice()),e["node.x"].push(i.node.x.slice()),e["node.y"].push(i.node.y.slice())}r.call("restyle",t,e)}},c.toggleHover={name:"toggleHover",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(t,e){var n=p(t,e);n.hovermode=m(t),r.call("_guiRelayout",t,n)}},c.resetViews={name:"resetViews",title:function(t){return l(t,"Reset views")},icon:a.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(t,e),r.setAttribute("data-attr","resetLastSave"),d(t,e),b(t,"geo"),b(t,"mapbox"),b(t,"map")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return l(t,"Toggle Spike Lines")},icon:a.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,n=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===n?"off":"on",r.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=i.list(t,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},c.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){b(t,"mapbox")}},c.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(t){return l(t,"Reset view")},attr:"reset",icon:a.home,click:function(t){b(t,"map")}},c.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:y},c.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:v},c.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:y},c.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:v}}}),Yr=d({"src/components/modebar/constants.js"(t,e){var r=Gr(),n=Object.keys(r),i=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],a=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(i),o=[];n.forEach((function(t){!function(t){if(-1===a.indexOf(t._cat||t.name)){var e=t.name,r=(t._cat||t.name).toLowerCase();-1===o.indexOf(e)&&o.push(e),-1===o.indexOf(r)&&o.push(r)}}(r[t])})),o.sort(),e.exports={DRAW_MODES:i,backButtons:a,foreButtons:o}}}),Zr=d({"src/components/modebar/attributes.js"(t,e){Yr(),e.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}}),Xr=d({"src/components/modebar/defaults.js"(t,e){var r=se(),n=q(),i=ge(),a=Zr();e.exports=function(t,e){var o=t.modebar||{},s=i.newContainer(e,"modebar");function l(t,e){return r.coerce(o,s,a,t,e)}l("orientation"),l("bgcolor",n.addOpacity(e.paper_bgcolor,.5));var c=n.contrast(n.rgb(e.modebar.bgcolor));l("color",n.addOpacity(c,.3)),l("activecolor",n.addOpacity(c,.7)),l("uirevision",e.uirevision),l("add"),l("remove")}}}),Kr=d({"src/components/modebar/modebar.js"(t,e){var r=v(),n=k(),i=se(),a=Rr(),o=g().version,s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var c=l.prototype;c.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="#"+a+" .modebar-group";document.querySelectorAll(s).forEach((function(t){t.style.backgroundColor=o.bgcolor}));var l=!this.hasButtons(e),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton(),i.setStyleOnHover("#"+a+" .modebar-btn",".active",".icon path","fill: "+o.activecolor,"fill: "+o.color,this.element)},c.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)})),e.element.appendChild(r)}))},c.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var e=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=e.bgcolor,t},c.createButton=function(t){var e=this,n=document.createElement("a");n.setAttribute("rel","tooltip"),n.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"===typeof i&&(i=i(this.graphInfo)),(i||0===i)&&n.setAttribute("data-title",i),void 0!==t.attr&&n.setAttribute("data-attr",t.attr);var o=t.val;if(void 0!==o&&("function"===typeof o&&(o=o(this.graphInfo)),n.setAttribute("data-val",o)),"function"!==typeof t.click)throw new Error("must provide button 'click' function in button config");n.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),n.setAttribute("data-toggle",t.toggle||!1),t.toggle&&r.select(n).classed("active",!0);var s=t.icon;return"function"===typeof s?n.appendChild(s()):n.appendChild(this.createIcon(s||a.question)),n.setAttribute("data-gravity",t.gravity||"n"),n},c.createIcon=function(t){var e,r=n(t.height)?Number(t.height):t.ascent-t.descent,i="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(i,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var a=document.createElementNS(i,"path");a.setAttribute("d",t.path),t.transform?a.setAttribute("transform",t.transform):void 0!==t.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(a)}return t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]),e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},c.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,n=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=r.select(t),c=function(t,r){var n=e.modebar,i=t.querySelector(".icon path");i&&(r||t.matches(":hover")?i.style.fill=n.activecolor:i.style.fill=n.color)};if(s){if(o===n){var u=!l.classed("active");l.classed("active",u),c(t,u)}}else{var h=null===o?o:i.nestedProperty(e,o).get();l.classed("active",h===a),c(t,h===a)}}))},c.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},c.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly.js")+" (v"+o+")"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(a.newplotlylogo)),t.appendChild(e),t},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=function(t,e){var n=t._fullLayout,i=new l({graphInfo:t,container:n._modebardiv.node(),buttons:e});return n._privateplot&&r.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}}}),Jr=d({"src/components/modebar/manage.js"(t,e){var r=ve(),n=Ge(),i=Vt(),a=Ze().isUnifiedHover,o=Kr(),s=Gr(),l=Yr().DRAW_MODES,c=se().extendDeep;e.exports=function(t){var e=t._fullLayout,u=t._context,h=e._modeBar;if(u.displayModeBar||u.watermark){if(!Array.isArray(u.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(u.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var d,p=u.modeBarButtons;d=Array.isArray(p)&&p.length?function(t){for(var e=c([],t),r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if("string"===typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));e[r][i]=s[a]}}return e}(p):!u.displayModeBar&&u.watermark?[]:function(t){var e=t._fullLayout,o=t._fullData,c=t._context;function u(t,e){if("string"===typeof e){if(e.toLowerCase()===t.toLowerCase())return!0}else{var r=e.name,n=e._cat||e.name;if(r===t||n===t.toLowerCase())return!0}return!1}var h=e.modebar.add;"string"===typeof h&&(h=[h]);var d=e.modebar.remove;"string"===typeof d&&(d=[d]);var p=c.modeBarButtonsToAdd.concat(h.filter((function(t){for(var e=0;e<c.modeBarButtonsToRemove.length;e++)if(u(t,c.modeBarButtonsToRemove[e]))return!1;return!0}))),f=c.modeBarButtonsToRemove.concat(d.filter((function(t){for(var e=0;e<c.modeBarButtonsToAdd.length;e++)if(u(t,c.modeBarButtonsToAdd[e]))return!1;return!0}))),m=e._has("cartesian"),g=e._has("gl3d"),y=e._has("geo"),v=e._has("pie"),x=e._has("funnelarea"),b=e._has("ternary"),_=e._has("mapbox"),w=e._has("map"),k=e._has("polar"),T=e._has("smith"),S=e._has("sankey"),A=function(t){for(var e=r.list({_fullLayout:t},null,!0),n=0;n<e.length;n++)if(!e[n].fixedrange)return!1;return!0}(e),M=a(e.hovermode),C=[];function E(t){if(t.length){for(var e=[],r=0;r<t.length;r++){for(var n=t[r],i=s[n],a=i.name.toLowerCase(),o=(i._cat||i.name).toLowerCase(),l=!1,c=0;c<f.length;c++){var u=f[c].toLowerCase();if(u===a||u===o){l=!0;break}}l||e.push(s[n])}C.push(e)}}var L=["toImage"];c.showEditInChartStudio?L.push("editInChartStudio"):c.showSendToCloud&&L.push("sendDataToCloud"),E(L);var P=[],I=[],z=[],O=[];(m||v||x||b)+y+g+_+w+k+T>1?(I=["toggleHover"],z=["resetViews"]):y?(P=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],z=["resetGeo"]):g?(I=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(P=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],z=["resetViewMapbox"]):w?(P=["zoomInMap","zoomOutMap"],I=["toggleHover"],z=["resetViewMap"]):v?I=["hoverClosestPie"]:S?(I=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):I=["toggleHover"],m&&I.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0}(o)||M)&&(I=[]),m&&!A&&(P=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==z[0]&&(z=["resetScale2d"])),g?O=["zoom3d","pan3d","orbitRotation","tableRotation"]:m&&!A||b?O=["zoom2d","pan2d"]:_||w||y?O=["pan2d"]:k&&(O=["zoom2d"]),function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var a=t[r];a._module&&a._module.selectPoints&&(i.traceIs(a,"scatter-like")?(n.hasMarkers(a)||n.hasText(a))&&(e=!0):i.traceIs(a,"box-violin")&&"all"!==a.boxpoints&&"all"!==a.points||(e=!0))}return e}(o)&&O.push("select2d","lasso2d");var D=[],R=function(t){-1===D.indexOf(t)&&-1!==I.indexOf(t)&&D.push(t)};if(Array.isArray(p)){for(var F=[],B=0;B<p.length;B++){var j=p[B];"string"===typeof j?(j=j.toLowerCase(),-1!==l.indexOf(j)?(e._has("mapbox")||e._has("map")||e._has("cartesian"))&&O.push(j):"togglespikelines"===j?R("toggleSpikelines"):"togglehover"===j?R("toggleHover"):"hovercompare"===j?R("hoverCompareCartesian"):"hoverclosest"===j?(R("hoverClosestCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie")):"v1hovermode"===j&&(R("hoverClosestCartesian"),R("hoverCompareCartesian"),R("hoverClosestGeo"),R("hoverClosest3d"),R("hoverClosestPie"))):F.push(j)}p=F}return E(O),E(P.concat(z)),E(D),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(C,p)}(t),h?h.update(t,d):e._modeBar=o(t,d)}else h&&(h.destroy(),delete e._modeBar)}}}),Qr=d({"src/components/modebar/index.js"(t,e){e.exports={moduleType:"component",name:"modebar",layoutAttributes:Zr(),supplyLayoutDefaults:Xr(),manage:Jr()}}}),tn=d({"src/plots/cartesian/scale_zoom.js"(t,e){var r=Se().FROM_BL;e.exports=function(t,e,n){void 0===n&&(n=r[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*n;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}}}),en=d({"src/plots/cartesian/constraints.js"(t){var e=se(),r=rr(),n=ve().id2name,i=Ee(),a=tn(),o=tr(),s=T().ALMOST_EQUAL,l=Se().FROM_BL;function c(t,r,a){var o=a.axIds,s=a.layoutOut,l=a.hasImage,c=s._axisConstraintGroups,p=s._axisMatchGroups,f=r._id,m=f.charAt(0),g=((s._splomAxes||{})[m]||{})[f]||{},y=r._id,v="x"===y.charAt(0);function x(n,a){return e.coerce(t,r,i,n,a)}r._matchGroup=null,r._constraintGroup=null,x("constrain",l?"domain":"range"),e.coerce(t,r,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var b,_,w=r.type,k=[];for(b=0;b<o.length;b++)(_=o[b])!==y&&s[n(_)].type===w&&k.push(_);var T=h(c,y);if(T){var S=[];for(b=0;b<k.length;b++)T[_=k[b]]||S.push(_);k=S}var A,M,C=k.length;C&&(t.matches||g.matches)&&(A=e.coerce(t,r,{matches:{valType:"enumerated",values:k,dflt:-1!==k.indexOf(g.matches)?g.matches:void 0}},"matches"));var E=l&&!v?r.anchor:void 0;if(C&&!A&&(t.scaleanchor||E)&&(M=e.coerce(t,r,{scaleanchor:{valType:"enumerated",values:k.concat([!1])}},"scaleanchor",E)),A){r._matchGroup=d(p,y,A,1);var L=s[n(A)],P=u(s,r)/u(s,L);v!==("x"===A.charAt(0))&&(P=(v?"x":"y")+P),d(c,y,A,P)}else t.matches&&-1!==o.indexOf(t.matches)&&e.warn("ignored "+r._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(M){var I=x("scaleratio");I||(I=r.scaleratio=1),d(c,y,M,I)}else t.scaleanchor&&-1!==o.indexOf(t.scaleanchor)&&e.warn("ignored "+r._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function u(t,e){var r=e.domain;return r||(r=t[n(e.overlaying)].domain),r[1]-r[0]}function h(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function d(t,e,r,n){var i,a,o,s,l,c=h(t,e);null===c?((c={})[e]=1,l=t.length,t.push(c)):l=t.indexOf(c);var u=Object.keys(c);for(i=0;i<t.length;i++)if(o=t[i],i!==l&&o[r]){var d=o[r];for(a=0;a<u.length;a++)o[s=u[a]]=p(d,p(n,c[s]));return void t.splice(l,1)}if(1!==n)for(a=0;a<u.length;a++){var f=u[a];c[f]=p(n,c[f])}c[r]=1}function p(t,e){var r,n,i="",a="";"string"===typeof t&&(r=(i=t.match(/^[xy]*/)[0]).length,t=+t.substr(r)),"string"===typeof e&&(n=(a=e.match(/^[xy]*/)[0]).length,e=+e.substr(n));var o=t*e;return r||n?r&&n&&i.charAt(0)!==a.charAt(0)?r===n?o:(r>n?i.substr(n):a.substr(r))+o:i+a+t*e:o}function f(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;o<a.length;o++){var s=a[o],l=t[s];if("string"===typeof l){var c=l.match(/^[xy]*/)[0],u=c.length;l=+l.substr(u);for(var h="y"===c.charAt(0)?n:1/n,d=0;d<u;d++)l*=h}i[s]=l}return i}function m(t,e){var r=t._inputDomain,n=l[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}t.handleDefaults=function(t,r,i){var a,s,l,u,h,d,p,f,m=i.axIds,g=i.axHasImage,y=r._axisConstraintGroups=[],v=r._axisMatchGroups=[];for(a=0;a<m.length;a++)c(h=t[u=n(m[a])],d=r[u],{axIds:m,layoutOut:r,hasImage:g[u]});function x(t,e){for(a=0;a<t.length;a++)for(l in s=t[a])r[n(l)][e]=s}for(x(v,"_matchGroup"),a=0;a<y.length;a++)for(l in s=y[a])if((d=r[n(l)]).fixedrange){for(var b in s){var _=n(b);!1===(t[_]||{}).fixedrange&&e.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),r[_].fixedrange=!0}break}for(a=0;a<y.length;){for(l in s=y[a]){(d=r[n(l)])._matchGroup&&Object.keys(d._matchGroup).length===Object.keys(s).length&&(y.splice(a,1),a--);break}a++}x(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],k=!1,T=!1;function S(){f=d[p],"rangebreaks"===p&&(T=d._hasDayOfWeekBreaks)}for(a=0;a<v.length;a++){s=v[a];for(var A=0;A<w.length;A++){var M;for(l in p=w[A],f=null,s)if(h=t[u=n(l)],d=r[u],p in d){if(!d.matches&&(M=d,p in h)){S();break}null===f&&p in h&&S()}if("range"===p&&f&&h.range&&2===h.range.length&&null!==h.range[0]&&null!==h.range[1]&&(k=!0),"autorange"===p&&null===f&&k&&(f=!1),null===f&&p in M&&(f=M[p]),null!==f)for(l in s)(d=r[n(l)])[p]="range"===p?f.slice():f,"rangebreaks"===p&&(d._hasDayOfWeekBreaks=T,o(d,r))}}},t.enforce=function(t){var e,i,o,l,c,u,h,d,p=t._fullLayout,g=p._axisConstraintGroups||[];for(e=0;e<g.length;e++){o=f(g[e],p);var y=Object.keys(o),v=1/0,x=0,b=1/0,_={},w={},k=!1;for(i=0;i<y.length;i++)w[l=y[i]]=c=p[n(l)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),_[l]=u=Math.abs(c._m)/o[l],v=Math.min(v,u),"domain"!==c.constrain&&c._constraintShrinkable||(b=Math.min(b,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(k=!0);if(!(v>s*x)||k)for(i=0;i<y.length;i++)if(u=_[l=y[i]],h=(c=w[l]).constrain,u!==b||"domain"===h)if(d=u/b,"range"===h)a(c,d);else{var T=c._inputDomain,S=(c.domain[1]-c.domain[0])/(T[1]-T[0]),A=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((d/=S)*A<1){c.domain=c._input.domain=T.slice(),a(c,d);continue}if(A<1&&(c.range=c._input.range=c._inputRange.slice(),d*=A),c.autorange){var M=c.r2l(c.range[0]),C=c.r2l(c.range[1]),E=(M+C)/2,L=E,P=E,I=Math.abs(C-E),z=E-I*d*1.0001,O=E+I*d*1.0001,D=r.makePadFn(p,c,0),R=r.makePadFn(p,c,1);m(c,d);var F,B,j=Math.abs(c._m),N=r.concatExtremes(t,c),U=N.min,V=N.max;for(B=0;B<U.length;B++)(F=U[B].val-D(U[B])/j)>z&&F<L&&(L=F);for(B=0;B<V.length;B++)(F=V[B].val+R(V[B])/j)<O&&F>P&&(P=F);d/=(P-L)/(2*I),L=c.l2r(L),P=c.l2r(P),c.range=c._input.range=M<C?[L,P]:[P,L]}m(c,d)}}},t.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++)if(r[n][e])return"g"+n;return e},t.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}}}),rn=d({"src/plot_api/subroutines.js"(t){var e=v(),r=Vt(),n=ke(),i=se(),a=Ae(),o=Dr(),s=q(),l=Je(),c=Qe(),u=Qr(),h=nr(),d=Se(),p=en(),f=p.enforce,m=p.clean,g=rr().doAutoRange,y="start",x="middle",b="end",_=ye().zindexSeparator;function w(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&a[0]<e[1]&&a[1]>e[0])return!0}return!1}function k(r){var a,o,c,p,f,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),t.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function b(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-v-n:e._offset+e._length+v+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+v+n:e._offset-v-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a<x.length;a++){var k=(p=x[a])._anchorAxis;p._linepositions={},p._lw=l.crispRound(r,p.linewidth,1),p._mainLinePosition=b(p,k,p.side),p._mainMirrorPosition=p.mirror&&k?b(p,k,d.OPPOSITE_SIDE[p.side]):null}var S=[],M=[],C=[],E=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(o in g._plots)if((c=g._plots[o]).mainplot)c.bg&&c.bg.remove(),c.bg=void 0;else{var L=c.xaxis.domain,P=c.yaxis.domain,I=c.plotgroup;if(w(L,P,C)&&-1===o.indexOf(_)){var z=I.node(),O=c.bg=i.ensureSingle(I,"rect","bg");z.insertBefore(O.node(),z.childNodes[0]),M.push(o)}else I.select("rect.bg").remove(),C.push([L,P]),E||(S.push(o),M.push(o))}var D,R,F,B,j,N,U,V,q,$,H,W,G,Y=g._bgLayer.selectAll(".bg").data(S);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(t){g._plots[t].bg=e.select(this)})),a=0;a<M.length;a++)c=g._plots[M[a]],f=c.xaxis,m=c.yaxis,c.bg&&void 0!==f._offset&&void 0!==m._offset&&c.bg.call(l.setRect,f._offset-v,m._offset-v,f._length+2*v,m._length+2*v).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(o in g._plots){c=g._plots[o],f=c.xaxis,m=c.yaxis;var Z,X,K=c.clipId="clip"+g._uid+o+"plot",J=i.ensureSingleById(g._clips,"clipPath",K,(function(t){t.classed("plotclip",!0).append("rect")}));c.clipRect=J.select("rect").attr({width:f._length,height:m._length}),l.setTranslate(c.plot,f._offset,m._offset),c._hasClipOnAxisFalse?(Z=null,X=K):(Z=K,X=null),l.setClipUrl(c.plot,Z,r),c.layerClipId=X}function Q(t){return"M"+D+","+t+"H"+R}function tt(t){return"M"+f._offset+","+t+"h"+f._length}function et(t){return"M"+t+","+V+"V"+U}function rt(t){return void 0!==m._shift&&(t+=m._shift),"M"+t+","+m._offset+"v"+m._length}function nt(t,e,r){if(!t.showline||o!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(o in g._plots){c=g._plots[o],f=c.xaxis,m=c.yaxis;var it="M0,0";T(f,o)&&(j=A(f,"left",m,x),D=f._offset-(j?v+j:0),N=A(f,"right",m,x),R=f._offset+f._length+(N?v+N:0),F=b(f,m,"bottom"),B=b(f,m,"top"),!(G=!f._anchorAxis||o!==f._mainSubplot)||"allticks"!==f.mirror&&"all"!==f.mirror||(f._linepositions[o]=[F,B]),it=nt(f,Q,tt),G&&f.showline&&("all"===f.mirror||"allticks"===f.mirror)&&(it+=Q(F)+Q(B)),c.xlines.style("stroke-width",f._lw+"px").call(s.stroke,f.showline?f.linecolor:"rgba(0,0,0,0)")),c.xlines.attr("d",it);var at="M0,0";T(m,o)&&(H=A(m,"bottom",f,x),U=m._offset+m._length+(H?v:0),W=A(m,"top",f,x),V=m._offset-(W?v:0),q=b(m,f,"left"),$=b(m,f,"right"),!(G=!m._anchorAxis||o!==m._mainSubplot)||"allticks"!==m.mirror&&"all"!==m.mirror||(m._linepositions[o]=[q,$]),at=nt(m,et,rt),G&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(at+=et(q)+et($)),c.ylines.style("stroke-width",m._lw+"px").call(s.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),c.ylines.attr("d",at)}return h.makeClipPaths(r),n.previousPromises(r)}function T(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function S(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=d.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function A(t,e,r,n){if(S(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&S(t,e,a))return a._lw}return 0}function M(t){return"top"===t?d.CAP_SHIFT+.3+"em":"bottom"===t?"-0.3em":d.MID_SHIFT+"em"}t.layoutStyles=function(t){return i.syncOrAsync([n.doAutoMargin,k],t)},t.drawMainTitle=function(t){var r=t._fullLayout.title,o=t._fullLayout,s=function(t){var e=t.title,r=x;return i.isRightAnchor(e)?r=b:i.isLeftAnchor(e)&&(r=y),r}(o),u=function(t){var e=t.title,r="0em";return i.isTopAnchor(e)?r=d.CAP_SHIFT+"em":i.isMiddleAnchor(e)&&(r=d.MID_SHIFT+"em"),r}(o),h=function(t,e){var r=t.title,n=t._size,i=0;return"0em"!==e&&e?e===d.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+i:t.height-t.height*r.y+i}(o,u),p=function(t,e){var r=t.title,n=t._size,i=0;return e===y?i=r.pad.l:e===b&&(i=-r.pad.r),"paper"===r.xref?n.l+n.w*r.x+i:t.width*r.x+i}(o,s);if(c.draw(t,"gtitle",{propContainer:o,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:o._dfltTitle.plot,subtitlePlaceholder:o._dfltTitle.subtitle,attributes:{x:p,y:h,"text-anchor":s,dy:u}}),r.text&&r.automargin){var f=e.selectAll(".gtitle"),m=l.bBox(e.selectAll(".g-gtitle").node()).height,g=function(t,e,r){var n=e.y,i=e.yanchor,a=n>.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,m);if(g>0){!function(t,e,r,a){var o="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(t,e,r,n,a){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=i.isTopAnchor(e)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(e)&&"t"===r||i.isBottomAnchor(e)&&"b"===r)&&l<a}(t,s,l,e,a)?c[l]=r:"container"===s.yref&&(u[l]=r,t._fullLayout._reservedMargin[o]=u),n.allowAutoMargin(t,o),n.autoMargin(t,o,c)}(t,h,g,m),f.attr({x:p,y:h,"text-anchor":s,dy:M(r.yanchor)}).call(a.positionText,p,h);var v=(r.text.match(a.BR_TAG_ALL)||[]).length;if(v){var _=d.LINE_SPACING*v+d.MID_SHIFT;0===r.y&&(_=-_),f.selectAll(".line").each((function(){var t=+this.getAttribute("dy").slice(0,-2)-_+"em";this.setAttribute("dy",t)}))}var w=e.selectAll(".gtitle-subtitle");if(w.node()){var k=f.node().getBBox(),T=k.y+k.height+c.SUBTITLE_PADDING_EM*r.subtitle.font.size;w.attr({x:p,y:T,"text-anchor":s,dy:M(r.yanchor)}).call(a.positionText,p,T)}}}},t.doTraceStyle=function(e){var i,a=e.calcdata,s=[];for(i=0;i<a.length;i++){var l=a[i],c=l[0]||{},u=c.trace||{},h=u._module||{},d=h.arraysToCalcdata;d&&d(l,u);var p=h.editStyle;p&&s.push({fn:p,cd0:c})}if(s.length){for(i=0;i<s.length;i++){var f=s[i];f.fn(e,f.cd0)}o(e),t.redrawReglTraces(e)}return n.style(e),r.getComponentMethod("legend","draw")(e),n.previousPromises(e)},t.doColorBars=function(t){return r.getComponentMethod("colorbar","draw")(t),n.previousPromises(t)},t.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,r.call("_doPlot",t,"",e)},t.doLegend=function(t){return r.getComponentMethod("legend","draw")(t),n.previousPromises(t)},t.doTicksRelayout=function(e){return h.draw(e,"redraw"),e._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(e),o(e),t.redrawReglTraces(e)),t.drawMainTitle(e),n.previousPromises(e)},t.doModeBar=function(t){var e=t._fullLayout;u.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var i=e._basePlotModules[r].updateFx;i&&i(t)}return n.previousPromises(t)},t.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setViewport(i)}},t.drawData=function(e){var i=e._fullLayout;o(e);for(var a=i._basePlotModules,s=0;s<a.length;s++)a[s].plot(e);return t.redrawReglTraces(e),n.style(e),r.getComponentMethod("selections","draw")(e),r.getComponentMethod("shapes","draw")(e),r.getComponentMethod("annotations","draw")(e),r.getComponentMethod("images","draw")(e),i._replotting=!1,n.previousPromises(e)},t.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,o=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?i.pushUnique(o,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&i.pushUnique(s,l.subplot))}for(r=0;r<o.length;r++)(n=e._plots[o[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},t.doAutoRangeAndConstraints=function(t){for(var e,r=h.list(t,"",!0),n={},i=0;i<r.length;i++)if(!n[(e=r[i])._id]){n[e._id]=1,m(t,e),g(t,e);var a=e._matchGroup;if(a)for(var o in a){var s=h.getFromId(t,o);g(t,s,e.range),n[o]=1}}f(t)},t.finalDraw=function(t){r.getComponentMethod("rangeslider","draw")(t),r.getComponentMethod("rangeselector","draw")(t)},t.drawMarginPushers=function(t){r.getComponentMethod("legend","draw")(t),r.getComponentMethod("rangeselector","draw")(t),r.getComponentMethod("sliders","draw")(t),r.getComponentMethod("updatemenus","draw")(t),r.getComponentMethod("colorbar","draw")(t)}}}),nn=d({"src/components/selections/draw.js"(t,e){var r=jr().readPaths,n=Hr(),i=xe().clearOutlineControllers,a=q(),o=Je(),s=ge().arrayEditor,l=qr(),c=l.getPathString;function u(t){var e=t._fullLayout;for(var r in i(t),e._selectionLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.selections.length;a++)d(t,a)}function h(t){return t._context.editSelection}function d(t,e){t._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+e+'"]').remove();var i=l.makeSelectionsOptionsAndPlotinfo(t,e),d=i.options,m=i.plotinfo;d._input&&function(i){var l=c(t,d),g={"data-index":e,"fill-rule":"evenodd",d:l},y=d.opacity,v="rgba(0,0,0,0)",x=d.line.color||a.contrast(t._fullLayout.plot_bgcolor),b=d.line.width,_=d.line.dash;b||(b=5,_="solid");var w=h(t)&&t._fullLayout._activeSelectionIndex===e;w&&(v=t._fullLayout.activeselection.fillcolor,y=t._fullLayout.activeselection.opacity);for(var k=[],T=1;T>=0;T--){var S=i.append("path").attr(g).style("opacity",T?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,T?"solid":_,T?4+b:b);if(p(S,t,d),w){var A=s(t.layout,"selections",d);S.style({cursor:"move"});var M={element:S.node(),plotinfo:m,gd:t,editHelpers:A,isActiveSelection:!0},C=r(l,t);n(C,S,M)}else S.style("pointer-events",T?"all":"none");k[T]=S}var E=k[0];k[1].node().addEventListener("click",(function(){return function(t,e){if(h(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeSelectionIndex)return void f(t);t._fullLayout._activeSelectionIndex=n,t._fullLayout._deactivateSelection=f,u(t)}}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;o.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function f(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,u(t))}e.exports={draw:u,drawOne:d,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=f,u(t)}}}}}),an=d({"node_modules/polybooljs/lib/build-log.js"(t,e){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!==typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}}}),on=d({"node_modules/polybooljs/lib/epsilon.js"(t,e){e.exports=function(t){"number"!==typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"===typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<t)&&!(l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],c=a*l-o*s;if(Math.abs(c)<t)return!1;var u=e[0]-n[0],h=e[1]-n[1],d=(s*h-l*u)/c,p=(a*h-o*u)/c,f={alongA:0,alongB:0,pt:[e[0]+d*a,e[1]+d*o]};return f.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,f.alongB=p<=-t?-2:p<t?-1:p-1<=-t?0:p-1<t?1:2,f},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var c=r[l][0],u=r[l][1];u-i>t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}}}),sn=d({"node_modules/polybooljs/lib/linked-list.js"(t,e){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}}),ln=d({"node_modules/polybooljs/lib/intersecter.js"(t,e){var r=sn();e.exports=function(t,e,n){function i(t,e,r){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(t,r){a.insertBefore(t,(function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var n=function(t,e){var n=r.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(n,t.end),n}(t,e);return function(t,e,n){var i=r.node({isStart:!1,pt:e.end,seg:e,primary:n,other:t,status:null});t.other=i,o(i,t.pt)}(n,t,e),n}function l(t,e){var r=i(e,t.seg.end,t.seg);return function(t,e){n&&n.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(r,t.primary)}function c(i,o){var s=r.create();function c(t){return s.findTransition((function(r){var n=function(t,r){var n=t.seg.start,i=t.seg.end,a=r.seg.start,o=r.seg.end;return e.pointsCollinear(n,a,o)?e.pointsCollinear(i,a,o)||e.pointAboveOrOnLine(i,a,o)?1:-1:e.pointAboveOrOnLine(n,a,o)?1:-1}(t,r.ev);return n>0}))}function u(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,c=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var d=e.pointsSame(o,c),p=e.pointsSame(s,u);if(d&&p)return r;var f=!d&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(d)return m?l(r,s):l(t,u),r;f&&(p||(m?l(r,s):l(t,u)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var h=[];!a.isEmpty();){var d=a.getHead();if(n&&n.vert(d.pt[0]),d.isStart){let e=function(){if(f){var t=u(d,f);if(t)return t}return!!m&&u(d,m)};n&&n.segmentNew(d.seg,d.primary);var p=c(d),f=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(d.seg,!!f&&f.seg,!!m&&m.seg);var g,y,v=e();if(v)t?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=d.seg.myFill,n&&n.segmentUpdate(v.seg),d.other.remove(),d.remove();if(a.getHead()!==d){n&&n.rewind(d.seg);continue}t?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:i,d.seg.myFill.above=y?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(g=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:i,d.seg.otherFill={above:g,below:g}),n&&n.status(d.seg,!!f&&f.seg,!!m&&m.seg),d.other.status=p.insert(r.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!d.primary){var b=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=b}h.push(d.seg)}a.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var r,i,a,o=t[t.length-1],l=0;l<t.length;l++){r=o,o=t[l];var c=e.pointsCompare(r,o);0!==c&&s((i=c<0?r:o,a=c<0?o:r,{id:n?n.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return c(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach((function(t){s(i(t.start,t.end,t),!0)})),r.forEach((function(t){s(i(t.start,t.end,t),!1)})),c(e,n)}}}}}),cn=d({"node_modules/polybooljs/lib/segment-chainer.js"(t,e){e.exports=function(t,e,r){var n=[],i=[];return t.forEach((function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u<n.length;u++){var h=(g=n[u])[0],d=(g[1],g[g.length-1]);if(g[g.length-2],e.pointsSame(h,a)){if(T(u,!0,!0))break}else if(e.pointsSame(h,o)){if(T(u,!0,!1))break}else if(e.pointsSame(d,a)){if(T(u,!1,!0))break}else if(e.pointsSame(d,o)&&T(u,!1,!1))break}if(c===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(c===l){r&&r.chainMatch(s.index);var p=s.index,f=s.matches_pt1?o:a,m=s.matches_head,g=n[p],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],x=m?g[g.length-1]:g[0],b=m?g[g.length-2]:g[1];return e.pointsCollinear(v,y,f)&&(m?(r&&r.chainRemoveHead(s.index,f),g.shift()):(r&&r.chainRemoveTail(s.index,f),g.pop()),y=v),e.pointsSame(x,f)?(n.splice(p,1),e.pointsCollinear(b,x,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void i.push(g)):void(m?(r&&r.chainAddHead(s.index,f),g.unshift(f)):(r&&r.chainAddTail(s.index,f),g.push(f)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;s.matches_head?l.matches_head?k?(S(_),A(_,w)):(S(w),A(w,_)):A(w,_):l.matches_head?A(_,w):k?(S(_),A(w,_)):(S(w),A(_,w))}function T(t,e,r){return c.index=t,c.matches_head=e,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function S(t){r&&r.chainReverse(t),n[t].reverse()}function A(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],c=o[0],u=o[1];e.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(i,c),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}})),i}}}),un=d({"node_modules/polybooljs/lib/segment-selector.js"(t,e){function r(t,e,r){var n=[];return t.forEach((function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})})),r&&r.selected(n),n}var n={union:function(t,e){return r(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return r(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return r(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return r(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return r(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=n}}),hn=d({"node_modules/polybooljs/lib/geojson.js"(t,e){var r={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++)if(n(e,(s=t.children[r]).region))return void o(s,e);var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function c(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var u=[];function h(t){var e=[c(t.region,!1)];u.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)h(t.children[e]);return c(t.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};e.exports=r}}),dn=d({"node_modules/polybooljs/index.js"(t,e){var r,n=an(),i=on(),a=ln(),o=cn(),s=un(),l=hn(),c=!1,u=i();function h(t,e,n){var i=r.segments(t),a=r.segments(e),o=n(r.combine(i,a));return r.polygon(o)}r={buildLog:function(t){return!0===t?c=n():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return u.epsilon(t)},segments:function(t){var e=a(!0,u,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:a(!1,u,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:s.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:s.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:s.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:s.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:s.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:o(t.segments,u,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return l.toPolygon(r,t)},polygonToGeoJSON:function(t){return l.fromPolygon(r,u,t)},union:function(t,e){return h(t,e,r.selectUnion)},intersect:function(t,e){return h(t,e,r.selectIntersect)},difference:function(t,e){return h(t,e,r.selectDifference)},differenceRev:function(t,e){return h(t,e,r.selectDifferenceRev)},xor:function(t,e){return h(t,e,r.selectXor)}},"object"===typeof window&&(window.PolyBool=r),e.exports=r}}),pn=d({"node_modules/point-in-polygon/nested.js"(t,e){e.exports=function(t,e,r,n){var i=t[0],a=t[1],o=!1;void 0===r&&(r=0),void 0===n&&(n=e.length);for(var s=n-r,l=0,c=s-1;l<s;c=l++){var u=e[l+r][0],h=e[l+r][1],d=e[c+r][0],p=e[c+r][1];h>a!==p>a&&i<(d-u)*(a-h)/(p-h)+u&&(o=!o)}return o}}}),fn=d({"src/lib/polygon.js"(t,e){var r=Ct().dot,n=T().BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),e=1;e<r.length;e++)i=Math.min(i,r[e][0]),a=Math.max(a,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,l=function(t){return t[1]===r[0][1]}));var u=!0,h=r[0];for(e=1;e<r.length;e++)if(h[0]!==r[e][0]||h[1]!==r[e][1]){u=!1;break}return{xmin:i,xmax:a,ymin:o,ymax:s,pts:r,contains:c?function(t,e){var r=t[0],c=t[1];return!(r===n||r<i||r>a||c===n||c<o||c>s)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===n||l<i||l>a||c===n||c<o||c>s)return!1;var u,h,d,p,f,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;u<m;u++)if(h=g,d=y,g=r[u][0],y=r[u][1],!(l<(p=Math.min(h,g))||l>Math.max(h,g)||c>Math.max(d,y)))if(c<Math.min(d,y))l!==p&&v++;else{if(c===(f=g===h?c:d+(l-h)*(y-d)/(g-h)))return 1!==u||!e;c<=f&&l!==p&&v++}return v%2===1},isRect:c,degenerate:u}},i.isSegmentBent=function(t,e,n,i){var a,o,s,l=t[e],c=[t[n][0]-l[0],t[n][1]-l[1]],u=r(c,c),h=Math.sqrt(u),d=[-c[1]/h,c[0]/h];for(a=e+1;a<n;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=r(o,c))<0||s>u||Math.abs(r(o,d))>i)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c<t.length;c++)(c===t.length-1||i.isSegmentBent(t,l,c+1,e))&&(r.push(t[c]),r.length<s-2&&(n=c,a=r.length-1),l=c)}return t.length>1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}}),mn=d({"src/components/selections/constants.js"(t,e){e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),gn=d({"src/components/selections/select.js"(t,e){var r=dn(),n=pn(),i=Vt(),a=Je().dashStyle,o=q(),s=zr(),l=Ze().makeEventData,c=Or(),u=c.freeMode,h=c.rectMode,d=c.drawMode,p=c.openMode,f=c.selectMode,m=qr(),g=Vr(),y=Hr(),v=xe().clearOutline,x=jr(),b=x.handleEllipse,_=x.readPaths,w=Nr().newShapes,k=Ur(),T=nn().activateLastSelection,S=se(),A=S.sorterAsc,M=fn(),C=Kt(),E=ve().getFromId,L=Dr(),P=rn().redrawReglTraces,I=mn(),z=I.MINSELECT,O=M.filter,D=M.tester,R=Br(),F=R.p2r,B=R.axValue,j=R.getTransform;function N(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,c,u,h,d,f,m,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){W(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],i.fullData.index===r.cd[0].trace.index){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(v,s=Z(e,r,n,i));if(_.pointNumbers.length>0?function(t,e){var r,n,i,a=[];for(i=0;i<t.length;i++)(r=t[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i<e.pointNumbers.length;i++)if(n.selectedpoints.indexOf(e.pointNumbers[i])<0)return!1;return!0}return!1}(s,_):function(t){var e,r,n=0;for(r=0;r<t.length;r++)if((e=t[r].cd[0].trace).selectedpoints){if(e.selectedpoints.length>1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(d=K(_))){for(o&&o.remove(),g=0;g<s.length;g++)(l=s[g])._module.selectPoints(l,!1);J(e,s),G(a),x&&dt(e)}else{for(f=t.shiftKey&&(void 0!==d?d:K(_)),c=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}(_.pointNumber,_.searchInfo,f),u=H(a.selectionDefs.concat([c])),g=0;g<s.length;g++)if(h=tt(s[g]._module.selectPoints(s[g],u),s[g]),b.length)for(var w=0;w<h.length;w++)b.push(h[w]);else b=h;if(J(e,s,m={points:b}),c&&a&&a.selectionDefs.push(c),o){var k=a.mergedPolygons,T=p(a.dragmode);y(et(k,T),o,a)}x&&ht(e,m)}}}function V(t){return"pointNumber"in t&&"searchInfo"in t}function $(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,i){var a=t.searchInfo.cd[0].trace.index;return i.cd[0].trace.index===a&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:!!t.subtract}}function H(t){if(t.length){for(var e=[],r=V(t[0])?0:t[0][0][0],n=r,i=V(t[0])?0:t[0][0][1],a=i,o=0;o<t.length;o++)if(V(t[o]))e.push($(t[o]));else{var s=D(t[o]);s.subtract=!!t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(t,r,n,i){for(var a=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,i)&&(a=!e[o].subtract);return a},isRect:!1,degenerate:!1}}}function W(t,e,r){var n=e._fullLayout,i=r.plotinfo,a=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,s=(t.shiftKey||t.altKey)&&!(d(a)&&p(a));o&&s&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):s&&i.selection||G(r),o||(v(e),n._lastSelectedSubplot=i.id)}function G(t,e){var r=t.dragmode,n=t.plotinfo,a=t.gd;(function(t){return t._fullLayout._activeShapeIndex>=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=d(r),l=f(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,t)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(t)&&(u=k(h,t)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){e&&T(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),c=r.map(Y);for(o=0;o<t.calcdata.length;o++)if(!0===(a=(i=t.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!N({subplot:n})||a.subplot!==n&&a.geo!==n)if("splom"===a.type){if(a._xaxes[l[0]]&&a._yaxes[c[0]]){var u=X(a._module,i,e[0],r[0]);u.scene=t._fullLayout._splomScenes[a.uid],s.push(u)}}else if("sankey"===a.type){var h=X(a._module,i,e[0],r[0]);s.push(h)}else{if(-1===l.indexOf(a.xaxis)&&(!a._xA||!a._xA.overlaying))continue;if(-1===c.indexOf(a.yaxis)&&(!a._yA||!a._yA.overlaying))continue;s.push(X(a._module,i,E(t,a.xaxis),E(t,a.yaxis)))}else s.push(X(a._module,i,e[0],r[0]));return s}function X(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}function K(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function J(t,e,r){var n,a;for(n=0;n<e.length;n++){var o=e[n].cd[0].trace._fullInput,s=t._fullLayout._tracePreGUI[o.uid]||{};void 0===s.selectedpoints&&(s.selectedpoints=o._input.selectedpoints||null)}if(r){var l=r.points||[];for(n=0;n<e.length;n++)(a=e[n].cd[0].trace)._input.selectedpoints=a._fullInput.selectedpoints=[],a._fullInput!==a&&(a.selectedpoints=[]);for(var c=0;c<l.length;c++){var u=l[c],h=u.data,d=u.fullData,p=u.pointIndex,f=u.pointIndices;f?([].push.apply(h.selectedpoints,f),a._fullInput!==a&&[].push.apply(d.selectedpoints,f)):(h.selectedpoints.push(p),a._fullInput!==a&&d.selectedpoints.push(p))}}else for(n=0;n<e.length;n++)delete(a=e[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,a._fullInput!==a&&delete a._fullInput.selectedpoints;!function(t,e){for(var r=!1,n=0;n<e.length;n++){var a=e[n],o=a.cd;i.traceIs(o[0].trace,"regl")&&(r=!0);var s=a._module,l=s.styleOnSelect||s.style;l&&(l(t,o,o[0].node3),o[0].nodeRangePlot3&&l(t,o,o[0].nodeRangePlot3))}r&&(L(t),P(t))}(t,e)}function Q(t,e,n){for(var i=(n?r.difference:r.union)({regions:t},{regions:[e]}).regions.reverse(),a=0;a<i.length;a++){var o=i[a];o.subtract=st(o,i.slice(0,a))}return i}function tt(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=l(t[i],n,r);return t}function et(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var i=0;i<t[n].length;i++){r[n][i]=[],r[n][i][0]=i?"L":"M";for(var a=0;a<t[n][i].length;a++)r[n][i].push(t[n][i][a])}e||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}function rt(t,e){for(var r,n,i=[],a=[],o=0;o<e.length;o++){var s=e[o];n=s._module.selectPoints(s,t),a.push(n),r=tt(n,s),i=i.concat(r)}return i}function nt(t,e,r,n,i){var a,o,s,l=!!n;i&&(a=i.plotinfo,o=i.xaxes[0]._id,s=i.yaxes[0]._id);var c=[],u=[],h=ot(t),p=t._fullLayout;if(a){var m=p._zoomlayer,g=p.dragmode,y=d(g),v=f(g);if(y||v){var x=E(t,o,"x"),b=E(t,s,"y");if(x&&b){var w=m.selectAll(".select-outline-"+a.id);if(w&&t._fullLayout._outlining&&w.length){for(var k=w[0][0].getAttribute("d"),T=_(k,t,a),S=[],A=0;A<T.length;A++){for(var M=T[A],C=[],L=0;L<M.length;L++)C.push([lt(x,M[L][1]),lt(b,M[L][2])]);C.xref=o,C.yref=s,C.subtract=st(C,S),S.push(C)}h=h.concat(S)}}}}var P=o&&s?[o+s]:p._subplots.cartesian;!function(t){var e=t.calcdata;if(e)for(var r=0;r<e.length;r++){var n=e[r][0].trace,i=t._fullLayout._splomScenes;if(i){var a=i[n.uid];a&&(a.selectBatch=[])}}}(t);for(var I={},z=0;z<P.length;z++){var O=P[z],D=O.indexOf("y"),R=O.slice(0,D),F=O.slice(D),B=o&&s?r:void 0;if(B=at(h,R,F,B)){var j=n;if(!l){var N=E(t,R,"x"),U=E(t,F,"y");j=Z(t,[N],[U],O);for(var V=0;V<j.length;V++){var q=j[V],$=q.cd[0],H=$.trace;if("scattergl"===q._module.name&&!$.t.xpx){var W=H.x,G=H.y,Y=H._length;$.t.xpx=[],$.t.ypx=[];for(var X=0;X<Y;X++)$.t.xpx[X]=N.c2p(W[X]),$.t.ypx[X]=U.c2p(G[X])}"splom"===q._module.name&&(I[H.uid]||(I[H.uid]=!0))}}var K=rt(B,j);c=c.concat(K),u=u.concat(j)}}var Q={points:c};J(t,u,Q);var tt=p.clickmode.indexOf("event")>-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var ft=ct(et);ut([E(t,nt,"x"),E(t,pt,"y")])(Q,ft)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];if(i.xaxis&&i.xaxis._id===t&&i.yaxis&&i.yaxis._id===e)return!0}return!1})(o=mt.xref,s=mt.yref,u)||it(t,o,s,n),tt&&(Q.points.length?ht(t,Q):dt(t)),p._deselect=!1}return{eventData:Q,selectionTesters:r}}function it(t,e,r,n){n=Z(t,[E(t,e,"x")],[E(t,r,"y")],e+r);for(var i=0;i<n.length;i++){var a=n[i];a._module.selectPoints(a,!1)}J(t,n)}function at(t,e,r,n){for(var i,a=0;a<t.length;a++){var o=t[a];e===o.xref&&r===o.yref&&(i?n=H(i=Q(i,o,!!o.subtract)):(i=[o],n=D(o)))}return n}function ot(t,e){for(var r=[],n=t._fullLayout,i=n.selections,a=i.length,o=0;o<a;o++)if(!e||o===n._activeSelectionIndex){var s=i[o];if(s){var l,c,u,h,d,p=s.xref,f=s.yref,y=E(t,p,"x"),v=E(t,f,"y");if("rect"===s.type){d=[];var x=lt(y,s.x0),b=lt(y,s.x1),_=lt(v,s.y0),w=lt(v,s.y1);d=[[x,_],[x,w],[b,w],[b,_]],l=Math.min(x,b),c=Math.max(x,b),u=Math.min(_,w),h=Math.max(_,w),d.xmin=l,d.xmax=c,d.ymin=u,d.ymax=h,d.xref=p,d.yref=f,d.subtract=!1,d.isRect=!0,r.push(d)}else if("path"===s.type)for(var k=s.path.split("Z"),T=[],S=0;S<k.length;S++){var A=k[S];if(A){A+="Z";var M=m.extractPathCoords(A,g.paramIsX,"raw"),C=m.extractPathCoords(A,g.paramIsY,"raw");l=1/0,c=-1/0,u=1/0,h=-1/0,d=[];for(var L=0;L<M.length;L++){var P=lt(y,M[L]),I=lt(v,C[L]);d.push([P,I]),l=Math.min(P,l),c=Math.max(P,c),u=Math.min(I,u),h=Math.max(I,h)}d.xmin=l,d.xmax=c,d.ymin=u,d.ymax=h,d.xref=p,d.yref=f,d.subtract=st(d,T),T.push(d),r.push(d)}}}}return r}function st(t,e){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i],o=0;o<t.length;o++)if(n(t[o],a)){r=!r;break}return r}function lt(t,e){return"date"===t.type&&(e=e.replace("_"," ")),"log"===t.type?t.c2p(e):t.r2p(e,null,t.calendar)}function ct(t){for(var e=t.length,r=[],n=0;n<e;n++){var i=t[n];r=(r=r.concat(i)).concat([i[0]])}return(a=r).isRect=5===a.length&&a[0][0]===a[4][0]&&a[0][1]===a[4][1]&&a[0][0]===a[1][0]&&a[2][0]===a[3][0]&&a[0][1]===a[3][1]&&a[1][1]===a[2][1]||a[0][1]===a[1][1]&&a[2][1]===a[3][1]&&a[0][0]===a[3][0]&&a[1][0]===a[2][0],a.isRect&&(a.xmin=Math.min(a[0][0],a[2][0]),a.xmax=Math.max(a[0][0],a[2][0]),a.ymin=Math.min(a[0][1],a[2][1]),a.ymax=Math.max(a[0][1],a[2][1])),a;var a}function ut(t){return function(e,r){for(var n,i,a=0;a<t.length;a++){var o=t[a],s=o._id,l=s.charAt(0);if(r.isRect){n||(n={});var c=r[l+"min"],u=r[l+"max"];void 0!==c&&void 0!==u&&(n[s]=[F(o,c),F(o,u)].sort(A))}else i||(i={}),i[s]=r.map(B(o))}n&&(e.range=n),i&&(e.lassoPoints=i)}}function ht(t,e){e&&(e.selections=(t.layout||{}).selections||[]),t.emit("plotly_selected",e)}function dt(t){t.emit("plotly_deselect",null)}e.exports={reselect:nt,prepSelect:function(t,e,r,n,l){var c=!N(n),m=u(l),g=h(l),v=p(l),x=d(l),_=f(l),w="drawcircle"===l,k="drawline"===l||w,T=n.gd,A=T._fullLayout,M=_&&"immediate"===A.newselection.mode&&c,E=A._zoomlayer,L=n.element.getBoundingClientRect(),P=n.plotinfo,R=j(P),F=e-L.left,B=r-L.top;A._calcInverseTransform(T);var V=S.apply3DTransform(A._invTransform)(F,B);F=V[0],B=V[1];var q,$,Y,X,K,tt,at,ot=A._invScaleX,st=A._invScaleY,lt=F,pt=B,ft="M"+F+","+B,mt=n.xaxes[0],gt=n.yaxes[0],yt=mt._length,vt=gt._length,xt=t.altKey&&!(d(l)&&v);W(t,T,n),m&&(q=O([[F,B]],I.BENDPX));var bt=E.selectAll("path.select-outline-"+P.id).data([1]),_t=x?A.newshape:A.newselection;x&&(n.hasText=_t.label.text||_t.label.texttemplate);var wt=x&&!v?_t.fillcolor:"rgba(0,0,0,0)",kt=_t.line.color||(c?o.contrast(T._fullLayout.plot_bgcolor):"#7f7f7f");bt.enter().append("path").attr("class","select-outline select-outline-"+P.id).style({opacity:x?_t.opacity/2:1,"stroke-dasharray":a(_t.line.dash,_t.line.width),"stroke-width":_t.line.width+"px","shape-rendering":"crispEdges"}).call(o.stroke,kt).call(o.fill,wt).attr("fill-rule","evenodd").classed("cursor-move",!!x).attr("transform",R).attr("d",ft+"Z");var Tt=E.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",R).attr("d","M0,0Z");if(x&&n.hasText){var St=E.select(".label-temp");St.empty()&&(St=E.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var At=A._uid+I.SELECTID,Mt=[],Ct=Z(T,n.xaxes,n.yaxes,n.subplot);M&&!t.shiftKey&&(n._clearSubplotSelections=function(){if(c){var t=mt._id,e=gt._id;it(T,t,e,Ct);for(var r=(T.layout||{}).selections||[],n=[],a=!1,o=0;o<r.length;o++){var s=A.selections[o];s&&s.xref===t&&s.yref===e?a=!0:n.push(r[o])}a&&(T._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",T,{selections:n}))}});var Et=function(t){var e=t.plotinfo;return e.fillRangeItems||ut(t.xaxes.concat(t.yaxes))}(n);n.moveFn=function(t,e){n._clearSubplotSelections&&(n._clearSubplotSelections(),n._clearSubplotSelections=void 0),lt=Math.max(0,Math.min(yt,ot*t+F)),pt=Math.max(0,Math.min(vt,st*e+B));var r=Math.abs(lt-F),i=Math.abs(pt-B);if(g){var a,o,s;if(_){var l=A.selectdirection;switch(a="any"===l?i<Math.min(.6*r,z)?"h":r<Math.min(.6*i,z)?"v":"d":l){case"h":o=w?vt/2:0,s=vt;break;case"v":o=w?yt/2:0,s=yt}}if(x)switch(A.newshape.drawdirection){case"vertical":a="h",o=w?vt/2:0,s=vt;break;case"horizontal":a="v",o=w?yt/2:0,s=yt;break;case"ortho":r<i?(a="h",o=B,s=pt):(a="v",o=F,s=lt);break;default:a="d"}"h"===a?((X=k?b(w,[lt,o],[lt,s]):[[F,o],[F,s],[lt,s],[lt,o]]).xmin=k?lt:Math.min(F,lt),X.xmax=k?lt:Math.max(F,lt),X.ymin=Math.min(o,s),X.ymax=Math.max(o,s),Tt.attr("d","M"+X.xmin+","+(B-z)+"h-4v"+2*z+"h4ZM"+(X.xmax-1)+","+(B-z)+"h4v"+2*z+"h-4Z")):"v"===a?((X=k?b(w,[o,pt],[s,pt]):[[o,B],[o,pt],[s,pt],[s,B]]).xmin=Math.min(o,s),X.xmax=Math.max(o,s),X.ymin=k?pt:Math.min(B,pt),X.ymax=k?pt:Math.max(B,pt),Tt.attr("d","M"+(F-z)+","+X.ymin+"v-4h"+2*z+"v4ZM"+(F-z)+","+(X.ymax-1)+"v4h"+2*z+"v-4Z")):"d"===a&&((X=k?b(w,[F,B],[lt,pt]):[[F,B],[F,pt],[lt,pt],[lt,B]]).xmin=Math.min(F,lt),X.xmax=Math.max(F,lt),X.ymin=Math.min(B,pt),X.ymax=Math.max(B,pt),Tt.attr("d","M0,0Z"))}else m&&(q.addPt([lt,pt]),X=q.filtered);if(n.selectionDefs&&n.selectionDefs.length?(Y=Q(n.mergedPolygons,X,xt),X.subtract=xt,$=H(n.selectionDefs.concat([X]))):(Y=[X],$=D(X)),y(et(Y,v),bt,n),_){var c,u=nt(T,!1),h=u.eventData?u.eventData.points.slice():[];u=nt(T,!1,$,Ct,n),$=u.selectionTesters,at=u.eventData,c=q?q.filtered:ct(Y),C.throttle(At,I.SELECTDELAY,(function(){for(var t=(Mt=rt($,Ct)).slice(),e=0;e<h.length;e++){for(var r=h[e],n=!1,i=0;i<t.length;i++)if(t[i].curveNumber===r.curveNumber&&t[i].pointNumber===r.pointNumber){n=!0;break}n||t.push(r)}t.length&&(at||(at={}),at.points=t),Et(at,c),function(t,e){t.emit("plotly_selecting",e)}(T,at)}))}},n.clickFn=function(t,e){if(Tt.remove(),T._fullLayout._activeShapeIndex>=0)T._fullLayout._deactivateShape(T);else if(!x){var r=A.clickmode;C.done(At).then((function(){if(C.clear(At),2===t){for(bt.remove(),K=0;K<Ct.length;K++)(tt=Ct[K])._module.selectPoints(tt,!1);if(J(T,Ct),G(n),dt(T),Ct.length){var a=Ct[0].xaxis,o=Ct[0].yaxis;if(a&&o){for(var l=[],c=T._fullLayout.selections,u=0;u<c.length;u++){var h=c[u];h&&(h.xref===a._id&&h.yref===o._id||l.push(h))}l.length<c.length&&(T._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",T,{selections:l}))}}}else r.indexOf("select")>-1&&U(e,T,n.xaxes,n.yaxes,n.subplot,n,bt),"event"===r&&ht(T,void 0);s.click(T,e,P.id)})).catch(S.error)}},n.doneFn=function(){Tt.remove(),C.done(At).then((function(){C.clear(At),!M&&X&&n.selectionDefs&&(X.subtract=xt,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(M||x)&&G(n,M),n.doneFnCompleted&&n.doneFnCompleted(Mt),_&&ht(T,at)})).catch(S.error)}},clearOutline:v,clearSelectionsCache:G,selectOnClick:U}}}),yn=d({"src/components/annotations/arrow_paths.js"(t,e){e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),vn=d({"src/constants/axis_placeable_objects.js"(t,e){e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}}}),xn=d({"src/components/annotations/attributes.js"(t,e){var r=yn(),n=R(),i=ye(),a=ge().templatedArray;vn(),e.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),bn=d({"src/traces/scatter/constants.js"(t,e){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),_n=d({"src/traces/scatter/fillcolor_attribute.js"(t,e){e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),wn=d({"src/traces/scatter/attributes.js"(t,e){var r=Ce().axisHoverFormat,n=Ot().texttemplateAttrs,i=Ot().hovertemplateAttrs,a=Pe(),o=R(),s=It().dash,l=It().pattern,c=Je(),u=bn(),h=D().extendFlat,d=_n();e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:d(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),kn=d({"src/components/selections/attributes.js"(t,e){var r=xn(),n=wn().line,i=It().dash,a=D().extendFlat,o=Pt().overrideAll,s=ge().templatedArray;vn(),e.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),Tn=d({"src/components/selections/defaults.js"(t,e){var r=se(),n=nr(),i=Be(),a=kn(),o=qr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var d,p,f,m=u[h],g={_fullLayout:i},y=n.coerceRef(t,e,g,m);if((d=n.getFromId(g,y))._selectionIndices.push(e._index),f=o.rangeToShapePosition(d),p=o.shapePositionToRange(d),c){var v=m+"0",x=m+"1",b=t[v],_=t[x];t[v]=p(t[v],!0),t[x]=p(t[x],!0),n.coercePosition(e,g,s,y,v),n.coercePosition(e,g,s,y,x);var w=e[v],k=e[x];void 0!==w&&void 0!==k&&(e[v]=f(w),e[x]=f(k),t[v]=b,t[x]=_)}}c&&r.noneOrAll(t,e,["x0","x1","y0","y1"])}e.exports=function(t,e){i(t,e,{name:"selections",handleItemDefaults:s});for(var r=e.selections,n=0;n<r.length;n++){var a=r[n];a&&void 0===a.path&&(void 0!==a.x0&&void 0!==a.x1&&void 0!==a.y0&&void 0!==a.y1||(e.selections[n]=null))}}}}),Sn=d({"src/components/selections/draw_newselection/defaults.js"(t,e){e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}}}),An=d({"src/plots/cartesian/include_components.js"(t,e){var r=Vt(),n=se(),i=ve();e.exports=function(t){return function(e,a){var o=e[t];if(Array.isArray(o))for(var s=r.subplotsRegistry.cartesian,l=s.idRegex,c=a._subplots,u=c.xaxis,h=c.yaxis,d=c.cartesian,p=a._has("cartesian"),f=0;f<o.length;f++){var m=o[f];if(n.isPlainObject(m)){var g=i.cleanId(m.xref,"x",!1),y=i.cleanId(m.yref,"y",!1),v=l.x.test(g),x=l.y.test(y);if(v||x){p||n.pushUnique(a._basePlotModules,s);var b=!1;v&&-1===u.indexOf(g)&&(u.push(g),b=!0),x&&-1===h.indexOf(y)&&(h.push(y),b=!0),b&&v&&x&&d.push(g+y)}}}}}}}),Mn=d({"src/components/selections/index.js"(t,e){var r=nn(),n=gn();e.exports={moduleType:"component",name:"selections",layoutAttributes:kn(),supplyLayoutDefaults:Tn(),supplyDrawNewSelectionDefaults:Sn(),includeBasePlot:An()("selections"),draw:r.draw,drawOne:r.drawOne,reselect:n.reselect,prepSelect:n.prepSelect,clearOutline:n.clearOutline,clearSelectionsCache:n.clearSelectionsCache,selectOnClick:n.selectOnClick}}}),Cn=d({"src/plots/cartesian/dragbox.js"(t,e){var r=v(),n=se(),i=n.numberFormat,a=O(),o=sr(),s=Vt(),l=n.strTranslate,c=Ae(),u=q(),h=Je(),d=zr(),p=nr(),f=dr(),m=hr(),g=Or(),y=g.selectingOrDrawing,x=g.freeMode,b=Se().FROM_TL,_=Dr(),w=rn().redrawReglTraces,k=ke(),T=ve().getFromId,S=Mn().prepSelect,A=Mn().clearOutline,M=Mn().selectOnClick,C=tn(),E=ye(),L=E.MINDRAG,P=E.MINZOOM,I=!0;function z(t,e,r,i){var a=n.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return a.call(f,i),a.node()}function D(t,e,n,i,a,o,s){var l=z(t,"rect",e,n);return r.select(l).call(h.setRect,i,a,o,s),l}function R(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function F(t,e,r,n,i){for(var a=0;a<t.length;a++){var o=t[a];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-e:e,c=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],h=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+h*e),n[o._name+".range[1]"]=o.l2r(u+h*r)}}if(i&&i.length){var d=(e+(1-r))/2;F(i,d,1-d,n,[])}}function B(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(!n.fixedrange){if(n.rangebreaks){var i=n._length,a=(n.p2l(0+e)-n.p2l(0)+(n.p2l(i+e)-n.p2l(i)))/2;n.range=[n.l2r(n._rl[0]-a),n.l2r(n._rl[1]-a)]}else n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)];n.limitRange&&n.limitRange()}}}function j(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),$(t,e,i,a)}function $(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function H(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function W(t){I&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,i,a){for(var o,s,l,c,u=!1,h={},d={},p=(a||{}).xaHash,f=(a||{}).yaHash,m=0;m<e.length;m++){var g=e[m];for(o in r)if(g[o]){for(l in g)a&&(p[l]||f[l])||("x"===l.charAt(0)?r:i)[l]||(h[l]=o);for(s in i)a&&(p[s]||f[s])||!g[s]||(u=!0)}for(s in i)if(g[s])for(c in g)a&&(p[c]||f[c])||("x"===c.charAt(0)?r:i)[c]||(d[c]=s)}u&&(n.extendFlat(h,d),d={});var y={},v=[];for(l in h){var x=T(t,l);v.push(x),y[x._id]=x}var b={},_=[];for(c in d){var w=T(t,c);_.push(w),b[w._id]=w}return{xaHash:y,yaHash:b,xaxes:v,yaxes:_,xLinks:h,yLinks:d,isSubplotConstrained:u}}function Z(t,e){if(o){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}))}function X(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,o,l,u,f,g,v){var I,z,O,q,$,K,J,Q,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ht,dt,pt,ft,mt=t._fullLayout._zoomlayer,gt=g+v==="nsew",yt=1===(g+v).length;function vt(){if(I=e.xaxis,z=e.yaxis,tt=I._length,et=z._length,J=I._offset,Q=z._offset,(O={})[I._id]=I,(q={})[z._id]=z,g&&v)for(var r=e.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;O[i._id]=i;var a=r[n].yaxis;q[a._id]=a}$=X(O),K=X(q),it=R($,v),at=R(K,g),ot=!at&&!it,nt=Y(t,t._fullLayout._axisMatchGroups,O,q);var o=(rt=Y(t,t._fullLayout._axisConstraintGroups,O,q,nt)).isSubplotConstrained||nt.isSubplotConstrained;st=v||o,lt=g||o;var s=t._fullLayout;ct=s._has("scattergl"),ut=s._has("splom"),ht=s._has("svg")}o+=e.yaxis._shift,vt();var xt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(at+it,t._fullLayout.dragmode,gt),bt=D(e,g+v+"drag",xt,o,l,u,f);if(ot&&!gt)return bt.onmousedown=null,bt.style.pointerEvents="none",bt;var _t,wt,kt,Tt,St,At,Mt,Ct,Et,Lt,Pt={element:bt,gd:t,plotinfo:e};function It(){Pt.plotinfo.selection=!1,A(t)}function zt(n,a){var o=Pt.gd;if(o._fullLayout._activeShapeIndex>=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(H(o),2!==n||yt||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];it&&(r=r.concat($)),at&&(r=r.concat(K)),nt.xaxes&&(r=r.concat(nt.xaxes)),nt.yaxes&&(r=r.concat(nt.yaxes));var n,i,a={};if("reset+autosize"===e)for(e="autosize",i=0;i<r.length;i++){var o=(n=r[i])._rangeInitial0,l=n._rangeInitial1,c=void 0!==o||void 0!==l;if(c&&(void 0!==o&&o!==n.range[0]||void 0!==l&&l!==n.range[1])||!c&&!0!==n.autorange){e="reset";break}}if("autosize"===e)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(a[n._name+".autorange"]=!0);else if("reset"===e)for((it||rt.isSubplotConstrained)&&(r=r.concat(rt.xaxes)),at&&!rt.isSubplotConstrained&&(r=r.concat(rt.yaxes)),rt.isSubplotConstrained&&(it?at||(r=r.concat(K)):r=r.concat($)),i=0;i<r.length;i++)if(!(n=r[i]).fixedrange){var u=n._name,h=n._autorangeInitial;void 0===n._rangeInitial0&&void 0===n._rangeInitial1?a[u+".autorange"]=!0:void 0===n._rangeInitial0?(a[u+".autorange"]=h,a[u+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(a[u+".range"]=[n._rangeInitial0,null],a[u+".autorange"]=h):a[u+".range"]=[n._rangeInitial0,n._rangeInitial1]}t.emit("plotly_doubleclick",null),s.call("_guiRelayout",t,a)}}(),gt)l.indexOf("select")>-1&&M(a,o,$,K,e.id,Pt),l.indexOf("event")>-1&&d.click(o,a,e.id);else if(1===n&&yt){var u=g?z:I,h="s"===g||"w"===v?0:1,p=u._name+".range["+h+"]",f=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(bt).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(f),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(t){var e=u.d2r(t);void 0!==e&&s.call("_guiRelayout",o,p,e)}))}}}function Ot(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,ft*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){Mt="",kt.r=kt.l,kt.t=kt.b,Et.attr("d","M0,0Z")}if(kt.l=Math.min(_t,n),kt.r=Math.max(_t,n),kt.t=Math.min(wt,i),kt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(Mt="xy",a/tt>o/et?(o=a*et/tt,wt>i?kt.t=wt-o:kt.b=wt+o):(a=o*tt/et,_t>n?kt.l=_t-a:kt.r=_t+a),Et.attr("d",G(kt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){Mt="xy";var l=Math.min(kt.l/tt,(et-kt.b)/et),c=Math.max(kt.r/tt,(et-kt.t)/et);kt.l=l*tt,kt.r=c*tt,kt.b=(1-l)*et,kt.t=(1-c)*et,Et.attr("d",G(kt))}else s();else!at||o<Math.min(Math.max(.6*a,L),P)?a<L||!it?s():(kt.t=0,kt.b=et,Mt="x",Et.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-P-.5)+"h-3v"+(2*P+1)+"h3ZM"+(t.r+.5)+","+(e-P-.5)+"h3v"+(2*P+1)+"h-3Z"}(kt,wt))):!it||a<Math.min(.6*o,P)?(kt.l=0,kt.r=tt,Mt="y",Et.attr("d",function(t,e){return"M"+(e-P-.5)+","+(t.t-.5)+"v-3h"+(2*P+1)+"v3ZM"+(e-P-.5)+","+(t.b+.5)+"v3h"+(2*P+1)+"v-3Z"}(kt,_t))):(Mt="xy",Et.attr("d",G(kt)));kt.w=kt.r-kt.l,kt.h=kt.b-kt.t,Mt&&(Lt=!0),t._dragged=Lt,V(Ct,Et,kt,St,At,Tt),Dt(),t.emit("plotly_relayouting",dt),At=!0}function Dt(){dt={},"xy"!==Mt&&"x"!==Mt||(F($,kt.l/tt,kt.r/tt,dt,rt.xaxes),Vt("x",dt)),"xy"!==Mt&&"y"!==Mt||(F(K,(et-kt.b)/et,(et-kt.t)/et,dt,rt.yaxes),Vt("y",dt))}function Rt(){Dt(),H(t),$t(),W(t)}Pt.prepFn=function(e,r,i){var o=Pt.dragmode,s=t._fullLayout.dragmode;s!==o&&(Pt.dragmode=s),vt(),pt=t._fullLayout._invScaleX,ft=t._fullLayout._invScaleY,ot||(gt?e.shiftKey?"pan"===s?s="zoom":y(s)||(s="pan"):e.ctrlKey&&(s="pan"):s="pan"),x(s)?Pt.minDrag=1:Pt.minDrag=void 0,y(s)?(Pt.xaxes=$,Pt.yaxes=K,S(e,r,i,Pt,s)):(Pt.clickFn=zt,y(o)&&It(),ot||("zoom"===s?(Pt.moveFn=Ot,Pt.doneFn=Rt,Pt.minDrag=1,function(e,r,i){var o=bt.getBoundingClientRect();_t=r-o.left,wt=i-o.top,t._fullLayout._calcInverseTransform(t);var s=n.apply3DTransform(t._fullLayout._invTransform)(_t,wt);_t=s[0],wt=s[1],kt={l:_t,r:_t,w:0,t:wt,b:wt,h:0},Tt=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),At=!1,Mt="xy",Lt=!1,Ct=N(mt,Tt,J,Q,St="M0,0H"+tt+"V"+et+"H0V0"),Et=U(mt,J,Q)}(0,r,i)):"pan"===s&&(Pt.moveFn=Ut,Pt.doneFn=$t))),t._fullLayout._redrag=function(){var e=t._dragdata;if(e&&e.element===bt){var r=t._fullLayout.dragmode;y(r)||(vt(),Ht([0,0,tt,et]),Pt.moveFn(e.dx,e.dy))}}},m.init(Pt);var Ft=[0,0,tt,et],Bt=null,jt=E.REDRAWDELAY,Nt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ut(e,r){if(e*=pt,r*=ft,!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===it||"ns"===at){var n=it?-e:0,i=at?-r:0;if(nt.isSubplotConstrained){if(it&&at){var a=(e/tt-r/et)/2;n=-(e=a*tt),i=-(r=-a*et)}at?n=-i*tt/et:i=-n*et/tt}return it&&(B($,e),Vt("x")),at&&(B(K,r),Vt("y")),Ht([n,i,tt,et]),qt(),void t.emit("plotly_relayouting",dt)}var o,s,l="w"===it===("n"===at)?1:-1;if(it&&at&&(rt.isSubplotConstrained||nt.isSubplotConstrained)){var c=(e/tt+l*r/et)/2;e=c*tt,r=l*c*et}if("w"===it?e=p($,0,e):"e"===it?e=p($,1,-e):it||(e=0),"n"===at?r=p(K,1,r):"s"===at?r=p(K,0,-r):at||(r=0),o="w"===it?e:0,s="n"===at?r:0,rt.isSubplotConstrained&&!nt.isSubplotConstrained||nt.isSubplotConstrained&&it&&at&&l>0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u<$.length;u++)$[u].range=$[u]._r.slice(),C($[u],1-r/et);o=(e=r*tt/et)/2}if(nt.isSubplotConstrained||!at&&1===it.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),C(K[u],1-e/tt);s=(r=e*et/tt)/2}}nt.isSubplotConstrained&&at||Vt("x"),nt.isSubplotConstrained&&it||Vt("y");var h=tt-e,d=et-r;!nt.isSubplotConstrained||it&&at||(it?(s=o?0:e*et/tt,d=h*et/tt):(o=s?0:r*tt/et,h=d*tt/et)),Ht([o,s,h,d]),qt(),t.emit("plotly_relayouting",dt)}function p(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/j(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function Vt(t,e){for(var r=nt.isSubplotConstrained?{x:K,y:$}[t]:nt[t+"axes"],n=nt.isSubplotConstrained?{x:$,y:K}[t]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=nt.xLinks[o]||nt.yLinks[o],l=n[0]||O[s]||q[s];l&&(e?(e[a._name+".range[0]"]=e[l._name+".range[0]"],e[a._name+".range[1]"]=e[l._name+".range[1]"]):a.range=l.range.slice())}}function qt(){var r,n=[];function i(t){for(r=0;r<t.length;r++)t[r].fixedrange||n.push(t[r]._id)}function a(t,e){for(r=0;r<t.length;r++){var i=t[r],a=i[e];i.fixedrange||"sync"!==a.tickmode||n.push(a._id)}}for(st&&(i($),i(rt.xaxes),i(nt.xaxes),a(e.overlays,"xaxis")),lt&&(i(K),i(rt.yaxes),i(nt.yaxes),a(e.overlays,"yaxis")),dt={},r=0;r<n.length;r++){var o=n[r],s=T(t,o);p.drawOne(t,s,{skipTitle:!0}),dt[s._name+".range[0]"]=s.range[0],dt[s._name+".range[1]"]=s.range[1]}p.redrawComponents(t,n)}function $t(){Ht([0,0,tt,et]),n.syncOrAsync([k.previousPromises,function(){t._fullLayout._replotting=!1,s.call("_guiRelayout",t,dt)}],t)}function Ht(e){var r,i,a,o,l=t._fullLayout,c=l._plots,u=l._subplots.cartesian;if(ut&&s.subplotsRegistry.splom.drag(t),ct)for(r=0;r<u.length;r++)if(a=(i=c[u[r]]).xaxis,o=i.yaxis,i._scene){a.limitRange&&a.limitRange(),o.limitRange&&o.limitRange();var d=n.simpleMap(a.range,a.r2l),p=n.simpleMap(o.range,o.r2l);i._scene.update({range:[d[0],p[0],d[1],p[1]]})}if((ut||ct)&&(_(t),w(t)),ht){var f=e[2]/I._length,m=e[3]/z._length;for(r=0;r<u.length;r++){a=(i=c[u[r]]).xaxis,o=i.yaxis;var y,x,b,k,T=(st||nt.isSubplotConstrained)&&!a.fixedrange&&O[a._id],S=(lt||nt.isSubplotConstrained)&&!o.fixedrange&&q[o._id];if(T?(y=f,b=v||nt.isSubplotConstrained?e[0]:Yt(a,y)):nt.xaHash[a._id]?(y=f,b=e[0]*a._length/I._length):nt.yaHash[a._id]?(y=m,b="ns"===at?-e[1]*a._length/z._length:Yt(a,y,{n:"top",s:"bottom"}[at])):b=Gt(a,y=Wt(a,f,m)),y>1&&(void 0!==a.maxallowed&&st===(a.range[0]<a.range[1]?"e":"w")||void 0!==a.minallowed&&st===(a.range[0]<a.range[1]?"w":"e"))&&(y=1,b=0),S?(x=m,k=g||nt.isSubplotConstrained?e[1]:Yt(o,x)):nt.yaHash[o._id]?(x=m,k=e[1]*o._length/z._length):nt.xaHash[o._id]?(x=f,k="ew"===it?-e[0]*o._length/I._length:Yt(o,x,{e:"right",w:"left"}[it])):k=Gt(o,x=Wt(o,f,m)),x>1&&(void 0!==o.maxallowed&&lt===(o.range[0]<o.range[1]?"n":"s")||void 0!==o.minallowed&&lt===(o.range[0]<o.range[1]?"s":"n"))&&(x=1,k=0),y||x){y||(y=1),x||(x=1);var A=a._offset-b/y,M=o._offset-k/x;i.clipRect.call(h.setTranslate,b,k).call(h.setScale,y,x),i.plot.call(h.setTranslate,A,M).call(h.setScale,1/y,1/x),y===i.xScaleFactor&&x===i.yScaleFactor||(h.setPointGroupScale(i.zoomScalePts,y,x),h.setTextPointsScale(i.zoomScaleTxt,y,x)),h.hideOutsideRangePoints(i.clipOnAxisFalseTraces,i),i.xScaleFactor=y,i.yScaleFactor=x}}}}function Wt(t,e,r){return t.fixedrange?0:st&&rt.xaHash[t._id]?e:lt&&(rt.isSubplotConstrained?rt.xaHash:rt.yaHash)[t._id]?r:0}function Gt(t,e){return e?(t.range=t._r.slice(),C(t,e),Yt(t,e)):0}function Yt(t,e,r){return t._length*(1-e)*b[r||t.constraintoward||"middle"]}return g.length*v.length!==1&&Z(bt,(function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(It(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();vt(),clearTimeout(Bt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var i,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),o=Nt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-o.left)/o.width,l=(o.bottom-e.clientY)/o.height;if(st){for(v||(s=.5),i=0;i<$.length;i++)c($[i],s,a);Vt("x"),Ft[2]*=a,Ft[0]+=Ft[2]*s*(1/a-1)}if(lt){for(g||(l=.5),i=0;i<K.length;i++)c(K[i],l,a);Vt("y"),Ft[3]*=a,Ft[1]+=Ft[3]*(1-l)*(1/a-1)}Ht(Ft),qt(),t.emit("plotly_relayouting",dt),Bt=setTimeout((function(){t._fullLayout&&(Ft=[0,0,tt,et],$t())}),jt),e.preventDefault()}else n.log("Did not find wheel motion attributes: ",e)}function c(t,e,r){if(!t.fixedrange){var i=n.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map((function(e){return t.l2r(a+(e-a)*r)}))}}})),bt},makeDragger:z,makeRectDragger:D,makeZoombox:N,makeCorners:U,updateZoombox:V,xyCorners:G,transitionZoombox:$,removeZoombox:H,showDoubleClickNotifier:W,attachWheelEventHandler:Z}}}),En=d({"src/plots/cartesian/graph_interact.js"(t){var e=v(),r=zr(),n=hr(),i=dr(),a=Cn().makeDragBox,o=ye().DRAGGERSIZE;t.initInteractions=function(i){var s=i._fullLayout;if(i._context.staticPlot)e.select(i).selectAll(".drag").remove();else if(s._has("cartesian")||s._has("splom")){Object.keys(s._plots||{}).sort((function(t,e){if((s._plots[t].mainplot&&!0)===(s._plots[e].mainplot&&!0)){var r=t.split("y"),n=e.split("y");return r[0]===n[0]?Number(r[1]||1)-Number(n[1]||1):Number(r[0]||1)-Number(n[0]||1)}return s._plots[t].mainplot?1:-1})).forEach((function(t){var e=s._plots[t],l=e.xaxis,c=e.yaxis;if(!e.mainplot){var u=a(i,e,l._offset,c._offset,l._length,c._length,"ns","ew");u.onmousemove=function(e){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===t&&i._fullLayout._plots[t]&&r.hover(i,e,t)},r.hover(i,e,t),i._fullLayout._lasthover=u,i._fullLayout._hoversubplot=t},u.onmouseout=function(t){i._dragging||(i._fullLayout._hoversubplot=null,n.unhover(i,t))},i._context.showAxisDragHandles&&(a(i,e,l._offset-o,c._offset-o,o,o,"n","w"),a(i,e,l._offset+l._length,c._offset-o,o,o,"n","e"),a(i,e,l._offset-o,c._offset+c._length,o,o,"s","w"),a(i,e,l._offset+l._length,c._offset+c._length,o,o,"s","e"))}if(i._context.showAxisDragHandles){if(t===l._mainSubplot){var h=l._mainLinePosition;"top"===l.side&&(h-=o),a(i,e,l._offset+.1*l._length,h,.8*l._length,o,"","ew"),a(i,e,l._offset,h,.1*l._length,o,"","w"),a(i,e,l._offset+.9*l._length,h,.1*l._length,o,"","e")}if(t===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=o),a(i,e,d,c._offset+.1*c._length,o,.8*c._length,"ns",""),a(i,e,d,c._offset+.9*c._length,o,.1*c._length,"s",""),a(i,e,d,c._offset,o,.1*c._length,"n","")}}}));var l=s._hoverlayer.node();l.onmousemove=function(t){t.target=i._fullLayout._lasthover,r.hover(i,t,s._hoversubplot)},l.onclick=function(t){t.target=i._fullLayout._lasthover,r.click(i,t)},l.onmousedown=function(t){i._fullLayout._lasthover.onmousedown(t)},t.updateFx(i)}},t.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";i(e._draggers,r)}}}),Ln=d({"src/plot_api/container_array_match.js"(t,e){var r=Vt();e.exports=function(t){for(var e,n,i=r.layoutArrayContainers,a=r.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if((n=t.match(a[s]))&&0===n.index){e=n[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(n=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(n[1]),property:n[3]||""}:{array:e,index:"",property:""}}}}),Pn=d({"src/plot_api/manage_arrays.js"(t){var e=A(),r=X(),n=Z(),i=Ht().sorterAsc,a=Vt();t.containerArrayMatch=Ln();var o=t.isAddVal=function(t){return"add"===t||e(t)},s=t.isRemoveVal=function(t){return null===t||"remove"===t};t.applyContainerArrayChanges=function(t,e,l,c,u){var h=e.astr,d=a.getComponentMethod(h,"supplyLayoutDefaults"),p=a.getComponentMethod(h,"draw"),f=a.getComponentMethod(h,"drawOne"),m=c.replot||c.recalc||d===r||p===r,g=t.layout,y=t._fullLayout;if(l[""]){Object.keys(l).length>1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))e.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(d(g,y),p(t),!0)}var x,b,_,w,k,T,S,A,M=Object.keys(l).map(Number).sort(i),C=e.get(),E=C||[],L=u(y,h).get(),P=[],I=-1,z=E.length;for(x=0;x<M.length;x++)if(w=l[_=M[x]],k=Object.keys(w),T=w[""],S=o(T),_<0||_>E.length-(S?0:1))n.warn("index out of range",h,_);else if(void 0!==T)k.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,_),s(T)?P.push(_):S?("add"===T&&(T={}),E.splice(_,0,T),L&&L.splice(_,0,{})):n.warn("Unrecognized full object edit value",h,_,T),-1===I&&(I=_);else for(b=0;b<k.length;b++)A=h+"["+_+"].",u(E[_],k[b],A).set(w[k[b]]);for(x=P.length-1;x>=0;x--)E.splice(P[x],1),L&&L.splice(P[x],1);if(E.length?C||e.set(E):e.set(null),m)return!1;if(d(g,y),f!==r){var O;if(-1===I)O=M;else{for(z=Math.max(E.length,z),O=[],x=0;x<M.length&&!((_=M[x])>=I);x++)O.push(_);for(x=I;x<z;x++)O.push(x)}for(x=0;x<O.length;x++)f(t,O[x])}else p(t);return!0}}}),In=d({"src/plot_api/helpers.js"(t){var e=k(),r=(bt(),Vt()),n=se(),i=ke(),a=ve(),o=q(),s=a.cleanId,l=a.getFromTrace,c=r.traceIs;function u(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=s(r,n,!0))}function h(t){if(!n.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"===typeof e||"number"===typeof e)&&String(e)}function d(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var i,a=Math.min(t.length,e.length);for(i=0;i<a&&t.charAt(i)===e.charAt(i);i++);return t.substr(0,i).trim()}function p(t){var e="middle",r="center";return"string"===typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function f(t,e){return e in t&&"object"===typeof t[e]&&0===Object.keys(t[e]).length}t.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(e){var r;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(e));for(r=0;r<l.length;r++){var c=l[r];if(a&&a.test(c)){var h=e[c];h.anchor&&"free"!==h.anchor&&(h.anchor=s(h.anchor)),h.overlaying&&(h.overlaying=s(h.overlaying)),h.type||(h.isdate?h.type="date":h.islog?h.type="log":!1===h.isdate&&!1===h.islog&&(h.type="linear")),"withzero"!==h.autorange&&"tozero"!==h.autorange||(h.autorange=!0,h.rangemode="tozero"),h.insiderange&&delete h.range,delete h.islog,delete h.isdate,delete h.categories,f(h,"domain")&&delete h.domain}}var d=Array.isArray(e.annotations)?e.annotations.length:0;for(r=0;r<d;r++){var p=e.annotations[r];n.isPlainObject(p)&&(u(p,"xref"),u(p,"yref"))}var m=Array.isArray(e.shapes)?e.shapes.length:0;for(r=0;r<m;r++){var g=e.shapes[r];n.isPlainObject(g)&&(u(g,"xref"),u(g,"yref"))}var y=Array.isArray(e.images)?e.images.length:0;for(r=0;r<y;r++){var v=e.images[r];n.isPlainObject(v)&&(u(v,"xref"),u(v,"yref"))}var x=e.legend;return x&&(x.x>3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===e.dragmode&&(e.dragmode="orbit"),o.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var a=0;a<e.length;a++){var l,u=e[a];if("histogramy"===u.type&&"xbins"in u&&!("ybins"in u)&&(u.ybins=u.xbins,delete u.xbins),"histogramy"===u.type&&t.swapXYData(u),"histogramx"!==u.type&&"histogramy"!==u.type||(u.type="histogram"),"scl"in u&&!("colorscale"in u)&&(u.colorscale=u.scl,delete u.scl),"reversescl"in u&&!("reversescale"in u)&&(u.reversescale=u.reversescl,delete u.reversescl),u.xaxis&&(u.xaxis=s(u.xaxis,"x")),u.yaxis&&(u.yaxis=s(u.yaxis,"y")),c(u,"gl3d")&&u.scene&&(u.scene=i.subplotsRegistry.gl3d.cleanId(u.scene)),!c(u,"pie-like")&&!c(u,"bar-like"))if(Array.isArray(u.textposition))for(l=0;l<u.textposition.length;l++)u.textposition[l]=p(u.textposition[l]);else u.textposition&&(u.textposition=p(u.textposition));var m=r.getModule(u);if(m&&m.colorbar){var g=m.colorbar.container,y=g?u[g]:u;y&&y.colorscale&&("YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd"))}if("surface"===u.type&&n.isPlainObject(u.contours)){var v=["x","y","z"];for(l=0;l<v.length;l++){var x=u.contours[v[l]];n.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if("candlestick"===u.type||"ohlc"===u.type){var b=!1!==(u.increasing||{}).showlegend,_=!1!==(u.decreasing||{}).showlegend,w=h(u.increasing),k=h(u.decreasing);if(!1!==w&&!1!==k){var T=d(w,k,b,_);T&&(u.name=T)}else!w&&!k||u.name||(u.name=w||k)}f(u,"line")&&delete u.line,"marker"in u&&(f(u.marker,"line")&&delete u.marker.line,f(u,"marker")&&delete u.marker),o.clean(u),u.autobinx&&(delete u.autobinx,delete u.xbins),u.autobiny&&(delete u.autobiny,delete u.ybins)}},t.swapXYData=function(t){var e;if(n.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,i="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);n.swapAttrs(t,["error_?.copy_ystyle"]),i&&n.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"===typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},t.coerceTraceIndices=function(t,r){if(e(r))return[r];if(!Array.isArray(r)||!r.length)return t.data.map((function(t,e){return e}));if(Array.isArray(r)){for(var i=[],a=0;a<r.length;a++)n.isIndex(r[a],t.data.length)?i.push(r[a]):n.warn("trace index (",r[a],") is not a number or is out of bounds");return i}return r},t.manageArrayContainers=function(t,r,i){var a=t.obj,o=t.parts,s=o.length,l=o[s-1],c=e(l);if(c&&null===r){var u=o.slice(0,s-1).join(".");n.nestedProperty(a,u).get().splice(l,1)}else c&&void 0===t.get()?(void 0===t.get()&&(i[t.astr]=null),t.set(r)):t.set(r)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function g(t){var e=t.search(m);if(e>0)return t.substr(0,e)}t.hasParent=function(t,e){for(var r=g(e);r;){if(r in t)return!0;r=g(r)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(t,e,r){for(var i=0;i<e.length;i++)for(var a=t._fullData[i],o=0;o<3;o++){var s=l(t,a,y[o]);if(s&&"log"!==s.type){var c=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;c=u+"."+c}var h=c+".type";void 0===r[c]&&void 0===r[h]&&n.nestedProperty(t.layout,h).set(null)}}}}}),zn=d({"src/plot_api/plot_api.js"(t){var e=v(),r=k(),n=ue(),i=se(),a=i.nestedProperty,o=de(),s=pe(),l=Vt(),c=me(),u=ke(),h=nr(),d=ar(),p=Ee(),f=Je(),m=q(),g=En().initInteractions,y=Te(),x=Mn().clearOutline,b=G().dfltConfig,_=Pn(),w=In(),T=rn(),S=Pt(),A=ye().AX_NAME_PATTERN,M=0;function C(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function E(t,e){try{t._fullLayout._paper.style("background",e)}catch(r){i.error(r)}}function L(t,e){E(t,m.combine(e,"white"))}function P(t,r){if(!t._context){t._context=i.extendDeep({},b);var a=e.select("base");t._context._baseUrl=a.size()&&a.attr("href")?window.location.href.split("#")[0]:""}var o,s,l,c=t._context;if(r){for(s=Object.keys(r),o=0;o<s.length;o++)"editable"!==(l=s[o])&&"edits"!==l&&l in c&&("setBackground"===l&&"opaque"===r[l]?c[l]=L:c[l]=r[l]);var u=r.editable;if(void 0!==u)for(c.editable=u,s=Object.keys(c.edits),o=0;o<s.length;o++)c.edits[s[o]]=u;if(r.edits)for(s=Object.keys(r.edits),o=0;o<s.length;o++)(l=s[o])in c.edits&&(c.edits[l]=r.edits[l]);c._exportedPlot=r._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||n||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"===typeof c.setBackground||(c.setBackground=E),c._hasZeroHeight=c._hasZeroHeight||0===t.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===t.clientWidth;var h=c.scrollZoom,d=c._scrollZoom={};if(!0===h)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1,d.map=1;else if("string"===typeof h){var p=h.split("+");for(o=0;o<p.length;o++)d[p[o]]=1}else!1!==h&&(d.gl3d=1,d.geo=1,d.mapbox=1,d.map=1)}function I(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function z(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"===typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),"undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&z(t,r,"newIndices"),"undefined"!==typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,n,o,s){!function(t,e,r,n){var a=i.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"===typeof r)throw new Error("indices must be an integer or array of integers");for(var o in z(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,o);for(var l=function(t,e,n,o){var s,l,c,u,h,d=i.isPlainObject(o),p=[];for(var f in Array.isArray(n)||(n=[n]),n=I(n,t.data.length-1),e)for(var m=0;m<n.length;m++){if(s=t.data[n[m]],l=(c=a(s,f)).get(),u=e[f][m],!i.isArrayOrTypedArray(u))throw new Error("attribute: "+f+" index: "+m+" must be an array");if(!i.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+f);if(l.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+f);h=d?o[f][m]:o,r(h)||(h=-1),p.push({prop:c,target:l,insert:u,maxp:Math.floor(h)})}return p}(t,e,n,o),c={},u={},h=0;h<l.length;h++){var d=l[h].prop,p=l[h].maxp,f=s(l[h].target,l[h].insert,p);d.set(f[0]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(f[1]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(l[h].target.length)}return{update:c,maxPoints:u}}function R(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(e,r,n,a){e=i.getGraphDiv(e),w.clearPromiseQueue(e);var o={};if("string"===typeof r)o[r]=n;else{if(!i.isPlainObject(r))return i.warn("Restyle fail.",r,n,a),Promise.reject();o=i.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(e.changed=!0);var l=w.coerceTraceIndices(e,a),c=U(e,o,l),h=c.flags;h.calc&&(e.calcdata=void 0),h.clearAxisTypes&&w.clearAxisTypes(e,l,{});var d=[];h.fullReplot?d.push(t._doPlot):(d.push(u.previousPromises),u.supplyDefaults(e),h.markerSize&&(u.doCalcdata(e),H(d)),h.style&&d.push(T.doTraceStyle),h.colorbars&&d.push(T.doColorBars),d.push(C)),d.push(u.rehover,u.redrag,u.reselect),s.add(e,F,[e,c.undoit,c.traces],F,[e,c.redoit,c.traces]);var p=i.syncOrAsync(d,e);return p&&p.then||(p=Promise.resolve()),p.then((function(){return e.emit("plotly_restyle",c.eventData),e}))}function B(t){return void 0===t?null:t}function j(t,e){return e?function(e,r,n){var i=a(e,r),o=i.set;return i.set=function(e){N((n||"")+r,i.get(),e,t),o(e)},i}:a}function N(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],o=Array.isArray(r)?r:[],s=Math.max(a.length,o.length),l=0;l<s;l++)N(t+"["+l+"]",a[l],o[l],n);else if(i.isPlainObject(e)||i.isPlainObject(r)){var c=i.isPlainObject(e)?e:{},u=i.isPlainObject(r)?r:{},h=i.extendFlat({},c,u);for(var d in h)N(t+"."+d,c[d],u[d],n)}else void 0===n[t]&&(n[t]=B(e))}function U(t,e,r){var n,o,s=t._fullLayout,d=t._fullData,p=t.data,f=s._guiEditing,m=j(s._preGUI,f),g=i.extendDeepAll({},e),y=S.traceFlags(),v={},x={};function b(){return r.map((function(){}))}function _(t){var e=h.id2name(t);-1===o.indexOf(e)&&o.push(e)}function k(t){return"LAYOUT"+t+".autorange"}function T(t){return"LAYOUT"+t+".range"}function A(t){for(var e=t;e<d.length;e++)if(d[e]._input===p[t])return d[e]}function M(n,i,a){if(Array.isArray(n))n.forEach((function(t){M(t,i,a)}));else if(!(n in e)&&!w.hasParent(e,n)){var o;if("LAYOUT"===n.substr(0,6))o=m(t.layout,n.replace("LAYOUT",""));else{var l=r[a];o=j(s._tracePreGUI[A(l)._fullInput.uid],f)(p[l],n)}n in x||(x[n]=b()),void 0===x[n][a]&&(x[n][a]=B(o.get())),void 0!==i&&o.set(i)}}function C(t){return function(e){return d[e][t]}}function E(t){return function(e,n){return!1===e?d[r[n]][t]:null}}for(var L in e){if(w.hasParent(e,L))throw new Error("cannot set "+L+" and a parent attribute simultaneously");var P,I,z,O,D,R,F=e[L];if("autobinx"!==L&&"autobiny"!==L||(L=L.charAt(L.length-1)+"bins",F=Array.isArray(F)?F.map(E(L)):!1===F?r.map(C(L)):null),v[L]=F,"LAYOUT"!==L.substr(0,6)){for(x[L]=b(),n=0;n<r.length;n++)if(P=p[r[n]],I=A(r[n]),O=(z=j(s._tracePreGUI[I._fullInput.uid],f)(P,L)).get(),void 0!==(D=Array.isArray(F)?F[n%F.length]:F)){var N=z.parts[z.parts.length-1],U=L.substr(0,L.length-N.length-1),V=U?U+".":"",q=U?a(I,U).get():I;if((R=c.getTraceValObject(I,z.parts))&&R.impliedEdits&&null!==D)for(var $ in R.impliedEdits)M(i.relativeAttr(L,$),R.impliedEdits[$],n);else if("thicknessmode"!==N&&"lenmode"!==N||O===D||"fraction"!==D&&"pixels"!==D||!q){if("type"===L&&("pie"===D!==("pie"===O)||"funnelarea"===D!==("funnelarea"===O))){var H="x",W="y";"bar"!==D&&"bar"!==O||"h"!==P.orientation||(H="y",W="x"),i.swapAttrs(P,["?","?src"],"labels",H),i.swapAttrs(P,["d?","?0"],"label",H),i.swapAttrs(P,["?","?src"],"values",W),"pie"===O||"funnelarea"===O?(a(P,"marker.color").set(a(P,"marker.colors").get()),s._pielayer.selectAll("g.trace").remove()):l.traceIs(P,"cartesian")&&a(P,"marker.colors").set(a(P,"marker.color").get())}}else{var G=s._size,Y=q.orient,Z="top"===Y||"bottom"===Y;if("thicknessmode"===N){var X=Z?G.h:G.w;M(V+"thickness",q.thickness*("fraction"===D?1/X:X),n)}else{var K=Z?G.w:G.h;M(V+"len",q.len*("fraction"===D?1/K:K),n)}}if(x[L][n]=B(O),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(L)){if("orientation"===L){z.set(D);var J=P.x&&!P.y?"h":"v";if((z.get()||J)===I.orientation)continue}else"orientationaxes"===L&&(P.orientation={v:"h",h:"v"}[I.orientation]);w.swapXYData(P),y.calc=y.clearAxisTypes=!0}else-1!==u.dataArrayContainers.indexOf(z.parts[0])?(w.manageArrayContainers(z,D,x),y.calc=!0):(R?R.arrayOk&&!l.traceIs(I,"regl")&&(i.isArrayOrTypedArray(D)||i.isArrayOrTypedArray(O))?y.calc=!0:S.update(y,R):y.calc=!0,z.set(D))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(L)&&h.swap(t,r),"orientationaxes"===L){var Q=a(t.layout,"hovermode"),tt=Q.get();"x"===tt?Q.set("y"):"y"===tt?Q.set("x"):"x unified"===tt?Q.set("y unified"):"y unified"===tt&&Q.set("x unified")}if(-1!==["orientation","type"].indexOf(L)){for(o=[],n=0;n<r.length;n++){var et=p[r[n]];l.traceIs(et,"cartesian")&&(_(et.xaxis||"x"),_(et.yaxis||"y"))}M(o.map(k),!0,0),M(o.map(T),[0,1],0)}}else z=m(t.layout,L.replace("LAYOUT","")),x[L]=[B(z.get())],z.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:x,redoit:v,traces:r,eventData:i.extendDeepNoArrays([],[g,r])}}function V(t,e,r){t=i.getGraphDiv(t),w.clearPromiseQueue(t);var n={};if("string"===typeof e)n[e]=r;else{if(!i.isPlainObject(e))return i.warn("Relayout fail.",e,r),Promise.reject();n=i.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=X(t,n),o=a.flags;o.calc&&(t.calcdata=void 0);var l=[u.previousPromises];o.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&($(t,o,a)||u.supplyDefaults(t),o.legend&&l.push(T.doLegend),o.layoutstyle&&l.push(T.layoutStyles),o.axrange&&H(l,a.rangesAltered),o.ticks&&l.push(T.doTicksRelayout),o.modebar&&l.push(T.doModeBar),o.camera&&l.push(T.doCamera),o.colorbars&&l.push(T.doColorBars),l.push(C)),l.push(u.rehover,u.redrag,u.reselect),s.add(t,V,[t,a.undoit],V,[t,a.redoit]);var c=i.syncOrAsync(l,t);return c&&c.then||(c=Promise.resolve(t)),c.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function $(t,e,r){var n,a,o=t._fullLayout;if(!e.axrange)return!1;for(var s in e)if("axrange"!==s&&e[s])return!1;var l=function(t,e){return i.coerce(n,a,p,t,e)},c={};for(var u in r.rangesAltered){var f=h.id2name(u);if(n=t.layout[f],a=o[f],d(n,a,l,c),a._matchGroup)for(var m in a._matchGroup)if(m!==u){var g=o[h.id2name(m)];g.autorange=a.autorange,g.range=a.range.slice(),g._input.range=a.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=h.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return h.draw(t,r,{skipTitle:!0})}:function(t){return h.draw(t,"redraw")};t.push(x,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var W=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(t,e){var r,n,o,s=t.layout,u=t._fullLayout,d=u._guiEditing,p=j(u._preGUI,d),f=Object.keys(e),m=h.list(t),g=i.extendDeepAll({},e),y={};for(f=Object.keys(e),n=0;n<f.length;n++)if(0===f[n].indexOf("allaxes")){for(o=0;o<m.length;o++){var v=m[o]._id.substr(1),x=-1!==v.indexOf("scene")?v+".":"",b=f[n].replace("allaxes",x+m[o]._name);e[b]||(e[b]=e[f[n]])}delete e[f[n]]}var k=S.layoutFlags(),T={},M={};function C(t,r){if(Array.isArray(t))t.forEach((function(t){C(t,r)}));else if(!(t in e)&&!w.hasParent(e,t)){var n=p(s,t);t in M||(M[t]=B(n.get())),void 0!==r&&n.set(r)}}var E,L={};function P(t){var e=h.name2id(t.split(".")[0]);return L[e]=1,e}for(var I in e){if(w.hasParent(e,I))throw new Error("cannot set "+I+" and a parent attribute simultaneously");for(var z=p(s,I),O=e[I],D=z.parts.length-1;D>0&&"string"!==typeof z.parts[D];)D--;var R=z.parts[D],F=z.parts[D-1]+"."+R,N=z.parts.slice(0,D).join("."),U=a(t.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==O){T[I]=O,M[I]="reverse"===R?O:B(q);var $=c.getLayoutValObject(u,z.parts);if($&&$.impliedEdits&&null!==O)for(var H in $.impliedEdits)C(i.relativeAttr(I,H),$.impliedEdits[H]);if(-1!==["width","height"].indexOf(I))if(O){C("autosize",null);var G="height"===I?"width":"height";C(G,u[G])}else u[I]=t._initialAutoSize[I];else if("autosize"===I)C("width",O?null:u.width),C("height",O?null:u.height);else if(F.match(W))P(F),a(u,N+"._inputRange").set(null);else if(F.match(Y)){P(F),a(u,N+"._inputRange").set(null);var X=a(u,N).get();X._inputDomain&&(X._input.domain=X._inputDomain.slice())}else F.match(Z)&&a(u,N+"._inputDomain").set(null);if("type"===R){E=U;var J="linear"===V.type&&"log"===O,Q="log"===V.type&&"linear"===O;if(J||Q){if(E&&E.range)if(V.autorange)J&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var tt=E.range[0],et=E.range[1];J?(tt<=0&&et<=0&&C(N+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),C(N+".range[0]",Math.log(tt)/Math.LN10),C(N+".range[1]",Math.log(et)/Math.LN10)):(C(N+".range[0]",Math.pow(10,tt)),C(N+".range[1]",Math.pow(10,et)))}else C(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,O,C),l.getComponentMethod("images","convertCoords")(t,V,O,C)}else C(N+".autorange",!0),C(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(A)){var rt=a(u,I).get(),nt=(O||{}).type;nt&&"-"!==nt||(nt="linear"),l.getComponentMethod("annotations","convertCoords")(t,rt,nt,C),l.getComponentMethod("images","convertCoords")(t,rt,nt,C)}var it=_.containerArrayMatch(I);if(it){r=it.array,n=it.index;var at=it.property,ot=$||{editType:"calc"};""!==n&&""===at&&(_.isAddVal(O)?M[I]=null:_.isRemoveVal(O)?M[I]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),S.update(k,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=O,delete e[I]}else"reverse"===R?(U.range?U.range.reverse():(C(N+".autorange",!0),U.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===I&&(!1===O&&!1!==q||!1!==O&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==q&&"select"!==q?k.plot=!0:$?S.update(k,$):k.calc=!0,z.set(O))}}for(r in y)_.applyContainerArrayChanges(t,p(s,r),y[r],k,p)||(k.plot=!0);for(var lt in L){var ct=(E=h.getFromId(t,lt))&&E._constraintGroup;if(ct)for(var ut in k.calc=!0,ct)L[ut]||(h.getFromId(t,ut)._constraintShrinkable=!0)}(K(t)||e.height||e.width)&&(k.plot=!0);var ht=u.shapes;for(n=0;n<ht.length;n++)if(ht[n].showlegend){k.calc=!0;break}return(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:L,undoit:M,redoit:T,eventData:g}}function K(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&u.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function J(e,r,n,a){e=i.getGraphDiv(e),w.clearPromiseQueue(e),i.isPlainObject(r)||(r={}),i.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var o=w.coerceTraceIndices(e,a),l=U(e,i.extendFlat({},r),o),c=l.flags,h=X(e,i.extendFlat({},n)),d=h.flags;(c.calc||d.calc)&&(e.calcdata=void 0),c.clearAxisTypes&&w.clearAxisTypes(e,o,n);var p=[];d.layoutReplot?p.push(T.layoutReplot):c.fullReplot?p.push(t._doPlot):(p.push(u.previousPromises),$(e,d,h)||u.supplyDefaults(e),c.style&&p.push(T.doTraceStyle),(c.colorbars||d.colorbars)&&p.push(T.doColorBars),d.legend&&p.push(T.doLegend),d.layoutstyle&&p.push(T.layoutStyles),d.axrange&&H(p,h.rangesAltered),d.ticks&&p.push(T.doTicksRelayout),d.modebar&&p.push(T.doModeBar),d.camera&&p.push(T.doCamera),p.push(C)),p.push(u.rehover,u.redrag,u.reselect),s.add(e,J,[e,l.undoit,h.undoit,l.traces],J,[e,l.redoit,h.redoit,l.traces]);var f=i.syncOrAsync(p,e);return f&&f.then||(f=Promise.resolve(e)),f.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:h.eventData}),e}))}function Q(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var tt=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],et=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=t.match(n.pattern);if(i){var a=i[1]||"";return{head:a,tail:t.substr(a.length+1),attr:n.attr}}}}function nt(t,e){var r=a(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=a(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function ot(t,e){var r=i.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&i.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function st(t,e,r,n){var a,o,s,l=n.getValObject,c=n.flags,u=n.immutable,h=n.inArray,d=n.arrayIndex;function p(){var t=a.editType;h&&-1!==t.indexOf("arraydraw")?i.pushUnique(c.arrays[h],d):(S.update(c,a),"none"!==t&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(W.test(s)||Y.test(s))&&(c.rangesAltered[r[0]]=1),"datarevision"===o&&(c.newDataRevision=1))}function f(t){return"data_array"===t.valType||t.arrayOk}for(o in t){if(c.calc&&!n.transition)return;var m=t[o],g=e[o],y=r.concat(o);if(s=y.join("."),"_"!==o.charAt(0)&&"function"!==typeof m&&m!==g){if(("tick0"===o||"dtick"===o)&&"geo"!==r[0]){var v=e.tickmode;if("auto"===v||"array"===v||!v)continue}if(("range"!==o||!e.autorange)&&("zmin"!==o&&"zmax"!==o||"contourcarpet"!==e.type)&&(a=l(y))&&(!a._compareAsJSON||JSON.stringify(m)!==JSON.stringify(g))){var x,b=a.valType,_=f(a),w=Array.isArray(m),k=Array.isArray(g);if(w&&k){var T="_input_"+o,A=t[T],M=e[T];if(Array.isArray(A)&&A===M)continue}if(void 0===g)_&&w?c.calc=!0:p();else if(a._isLinkedToArray){var C=[],E=!1;h||(c.arrays[o]=C);var L=Math.min(m.length,g.length),P=Math.max(m.length,g.length);if(L!==P){if("arraydraw"!==a.editType){p();continue}E=!0}for(x=0;x<L;x++)st(m[x],g[x],y.concat(x),i.extendFlat({inArray:o,arrayIndex:x},n));if(E)for(x=L;x<P;x++)C.push(x)}else!b&&i.isPlainObject(m)?st(m,g,y,n):_?w&&k?(u&&(c.calc=!0),(u||n.newDataRevision)&&p()):w!==k?c.calc=!0:p():w&&k&&m.length===g.length&&String(m)===String(g)||p()}}}for(o in e)if(!(o in t)&&"_"!==o.charAt(0)&&"function"!==typeof e[o]){if(f(a=l(r.concat(o)))&&Array.isArray(e[o]))return void(c.calc=!0);p()}}function lt(t,e){var r;for(r in t)if("_"!==r.charAt(0)){var n=t[r],a=e[r];if(n!==a)if(i.isPlainObject(n)&&i.isPlainObject(a)){if(lt(n,a))return!0}else{if(!Array.isArray(n)||!Array.isArray(a))return!0;if(n.length!==a.length)return!0;for(var o=0;o<n.length;o++)if(n[o]!==a[o]){if(!i.isPlainObject(n[o])||!i.isPlainObject(a[o]))return!0;if(lt(n[o],a[o]))return!0}}}}function ct(t){var e=t._fullLayout,r=t.getBoundingClientRect();if(!i.equalDomRects(r,e._lastBBox)){var n=e._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(t));e._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),e._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),e._lastBBox=r}}t.animate=function(t,e,r){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=u.supplyAnimationDefaults(r)).transition,o=r.frame;function s(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var d,p,f=0;function m(t){return Array.isArray(a)?f>=a.length?t.transitionOpts=a[f]:t.transitionOpts=a[0]:t.transitionOpts=a,f++,t}var g=[],y=void 0===e||null===e,v=Array.isArray(e);if(y||v||!i.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(d=0;d<n._frames.length;d++)(p=n._frames[d])&&(y||String(p.group)===String(e))&&g.push({type:"byname",name:String(p.name),data:m({name:p.name})});else if(v)for(d=0;d<e.length;d++){var x=e[d];-1!==["number","string"].indexOf(typeof x)?(x=String(x),g.push({type:"byname",name:x,data:m({name:x})})):i.isPlainObject(x)&&g.push({type:"object",data:m(i.extendFlat({},x))})}}else g.push({type:"object",data:m(i.extendFlat({},e))});for(d=0;d<g.length;d++)if("byname"===(p=g[d]).type&&!n._frameHash[p.data.name])return i.warn('animate failure: frame not found: "'+p.data.name+'"'),void h();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&g.reverse();var b=t._fullLayout._currentFrame;if(b&&r.fromcurrent){var _=-1;for(d=0;d<g.length;d++)if("byname"===(p=g[d]).type&&p.name===b){_=d;break}if(_>0&&_<g.length-1){var k=[];for(d=0;d<g.length;d++)p=g[d],("byname"!==g[d].type||d>_)&&k.push(p);g=k}}g.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var a;a="byname"===e[i].type?u.computeFrame(t,e[i].name):e[i].data;var d=l(i),p=s(i);p.duration=Math.min(p.duration,d.duration);var f={frame:a,name:e[i].name,frameOpts:d,transitionOpts:p};i===e.length-1&&(f.onComplete=c(o,2),f.onInterrupt=h),n._frameQueue.push(f)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||function(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,u.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}()}}(g):(t.emit("plotly_animated"),o())}))},t.addFrames=function(t,e,r){if(t=i.getGraphDiv(t),null===e||void 0===e)return Promise.resolve();if(!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=t._transitionData._frames,h=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var d=c.length+2*e.length,p=[],f={};for(n=e.length-1;n>=0;n--)if(i.isPlainObject(e[n])){var m=e[n].name,g=(h[m]||f[m]||{}).name,y=e[n].name,v=h[g]||f[g];g&&y&&"number"===typeof y&&v&&M<5&&(M++,i.warn('addFrames: overwriting frame "'+(h[g]||f[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f[m]={name:m},p.push({frame:u.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index<e.index?1:0}));var x=[],b=[],_=c.length;for(n=p.length-1;n>=0;n--){if("number"===typeof(a=p[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+t._transitionData._counter++];);if(h[a.name]){for(o=0;o<c.length&&(c[o]||{}).name!==a.name;o++);x.push({type:"replace",index:o,value:a}),b.unshift({type:"replace",index:o,value:c[o]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=u.modifyFrames,k=u.modifyFrames,T=[t,b],S=[t,x];return s&&s.add(t,w,T,k,S),u.modifyFrames(t,x)},t.deleteFrames=function(t,e){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,o=[],l=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,d=[t,l],p=[t,o];return s&&s.add(t,c,d,h,p),u.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=t.deleteTraces,h=e,d=[r,c],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"===typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!==typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(r,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(t){return i.extendFlat({},t)})),w.cleanData(n),o=0;o<n.length;o++)r.data.push(n[o]);for(o=0;o<n.length;o++)c.push(-n.length+o);if("undefined"===typeof a)return l=t.redraw(r),s.add(r,u,d,h,p),l;Array.isArray(a)||(a=[a]);try{O(r,c,a)}catch(f){throw r.data.splice(r.data.length-n.length,n.length),f}return s.startSequence(r),s.add(r,u,d,h,p),l=t.moveTraces(r,c,a),s.stopSequence(r),l},t.deleteTraces=function e(r,n){r=i.getGraphDiv(r);var a,o,l=[],c=t.addTraces,u=e,h=[r,l,n],d=[r,n];if("undefined"===typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(r,n,"indices"),(n=I(n,r.data.length-1)).sort(i.sorterDes),a=0;a<n.length;a+=1)o=r.data.splice(n[a],1)[0],l.push(o);var p=t.redraw(r);return s.add(r,c,h,u,d),p},t.extendTraces=function e(r,n,a,o){var l=D(r=i.getGraphDiv(r),n,a,o,(function(t,e,r){var n,a;if(i.isTypedArray(t))if(r<0){var o=new t.constructor(0),s=R(t,e);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),a.set(t),a.set(e.subarray(0,l),t.length)}else{var c=r-e.length,u=t.length-c;n.set(t.subarray(u)),n.set(e,c),a.set(t.subarray(0,u))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),c=t.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,t.prependTraces,u,e,arguments),c},t.moveTraces=function e(r,n,a){var o,l=[],c=[],u=e,h=e,d=[r=i.getGraphDiv(r),a,n],p=[r,n,a];if(O(r,n,a),n=Array.isArray(n)?n:[n],"undefined"===typeof a)for(a=[],o=0;o<n.length;o++)a.push(-n.length+o);for(a=Array.isArray(a)?a:[a],n=I(n,r.data.length-1),a=I(a,r.data.length-1),o=0;o<r.data.length;o++)-1===n.indexOf(o)&&l.push(r.data[o]);for(o=0;o<n.length;o++)c.push({newIndex:a[o],trace:r.data[n[o]]});for(c.sort((function(t,e){return t.newIndex-e.newIndex})),o=0;o<c.length;o+=1)l.splice(c[o].newIndex,0,c[o].trace);r.data=l;var f=t.redraw(r);return s.add(r,u,d,h,p),f},t.prependTraces=function e(r,n,a,o){var l=D(r=i.getGraphDiv(r),n,a,o,(function(t,e,r){var n,a;if(i.isTypedArray(t))if(r<=0){var o=new t.constructor(0),s=R(e,t);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),a.set(e.subarray(l)),a.set(t,l)}else{var c=r-e.length;n.set(e),n.set(t.subarray(0,c),e.length),a.set(t.subarray(c))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),c=t.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,t.extendTraces,u,e,arguments),c},t.newPlot=function(e,r,n,a){return e=i.getGraphDiv(e),u.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),u.purge(e),t._doPlot(e,r,n,a)},t._doPlot=function(r,n,a,s){var c;if(r=i.getGraphDiv(r),o.init(r),i.isPlainObject(n)){var d=n;n=d.data,a=d.layout,s=d.config,c=d.frames}if(!1===o.triggerHandler(r,"plotly_beforeplot",[n,a,s]))return Promise.reject();n||a||i.isPlotDiv(r)||i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",r),P(r,s),a||(a={}),e.select(r).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(r._promises)||(r._promises=[]);var p=0===(r.data||[]).length&&Array.isArray(n);Array.isArray(n)&&(w.cleanData(n),p?r.data=n:r.data.push.apply(r.data,n),r.empty=!1),r.layout&&!p||(r.layout=w.cleanLayout(a)),u.supplyDefaults(r);var m=r._fullLayout,v=m._has("cartesian");m._replotting=!0,(p||m._shouldCreateBgLayer)&&(function(t){var r=e.select(t),n=t._fullLayout;if(n._calcInverseTransform=ct,n._calcInverseTransform(t),n._container=r.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([{}]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paperdiv.select(".modebar-container").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),n._modebardiv=n._paperdiv.append("div"),delete n._modeBar,n._hoverpaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var a={};e.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),n._uid=i.randstr(a)}n._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._clips=n._defs.append("g").classed("clips",!0),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._topclips=n._topdefs.append("g").classed("clips",!0),n._bgLayer=n._paper.append("g").classed("bglayer",!0),n._draggers=n._paper.append("g").classed("draglayer",!0);var o=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=o.append("g").classed("imagelayer",!0),n._shapeLowerLayer=o.append("g").classed("shapelayer",!0),n._cartesianlayer=n._paper.append("g").classed("cartesianlayer",!0),n._polarlayer=n._paper.append("g").classed("polarlayer",!0),n._smithlayer=n._paper.append("g").classed("smithlayer",!0),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0),n._geolayer=n._paper.append("g").classed("geolayer",!0),n._funnelarealayer=n._paper.append("g").classed("funnelarealayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._iciclelayer=n._paper.append("g").classed("iciclelayer",!0),n._treemaplayer=n._paper.append("g").classed("treemaplayer",!0),n._sunburstlayer=n._paper.append("g").classed("sunburstlayer",!0),n._indicatorlayer=n._toppaper.append("g").classed("indicatorlayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0);var s=n._toppaper.append("g").classed("layer-above",!0);n._imageUpperLayer=s.append("g").classed("imagelayer",!0),n._shapeUpperLayer=s.append("g").classed("shapelayer",!0),n._selectionLayer=n._toppaper.append("g").classed("selectionlayer",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._menulayer=n._toppaper.append("g").classed("menulayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._hoverpaper.append("g").classed("hoverlayer",!0),n._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}(r),m._shouldCreateBgLayer&&delete m._shouldCreateBgLayer),f.initGradients(r),f.initPatterns(r),p&&h.saveShowSpikeInitial(r);var x=!r.calcdata||r.calcdata.length!==(r._fullData||[]).length;x&&u.doCalcdata(r);for(var b=0;b<r.calcdata.length;b++)r.calcdata[b][0].trace=r._fullData[b];r._context.responsive?r._responsiveChartHandler||(r._responsiveChartHandler=function(){i.isHidden(r)||u.resize(r)},window.addEventListener("resize",r._responsiveChartHandler)):i.clearResponsive(r);var _=i.extendFlat({},m._size),k=0;function S(){if(u.clearAutoMarginIds(r),T.drawMarginPushers(r),h.allowAutoMargin(r),r._fullLayout.title.text&&r._fullLayout.title.automargin&&u.allowAutoMargin(r,"title.automargin"),m._has("pie"))for(var t=r._fullData,e=0;e<t.length;e++){var n=t[e];"pie"===n.type&&n.automargin&&u.allowAutoMargin(r,"pie."+n.uid+".automargin")}return u.doAutoMargin(r),u.previousPromises(r)}function A(){r._transitioning||(T.doAutoRangeAndConstraints(r),p&&h.saveRangeInitial(r),l.getComponentMethod("rangeslider","calcAutorange")(r))}var M=[u.previousPromises,function(){if(c)return t.addFrames(r,c)},function t(){for(var e=m._basePlotModules,n=0;n<e.length;n++)e[n].drawFramework&&e[n].drawFramework(r);!m._glcanvas&&m._has("gl")&&(m._glcanvas=m._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(t){return t.key})),m._glcanvas.enter().append("canvas").attr("class",(function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var a=r._context.plotGlPixelRatio;if(m._glcanvas){m._glcanvas.attr("width",m.width*a).attr("height",m.height*a).style("width",m.width+"px").style("height",m.height+"px");var o=m._glcanvas.data()[0].regl;if(o&&(Math.floor(m.width*a)!==o._gl.drawingBufferWidth||Math.floor(m.height*a)!==o._gl.drawingBufferHeight)){var s="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!k)return i.log(s+" Clearing graph and plotting again."),u.cleanPlot([],{},r._fullData,m),u.supplyDefaults(r),m=r._fullLayout,u.doCalcdata(r),k++,t();i.error(s)}}return"h"===m.modebar.orientation?m._modebardiv.style("height",null).style("width","100%"):m._modebardiv.style("width",null).style("height",m.height+"px"),u.previousPromises(r)},S,function(){if(u.didMarginChange(_,m._size))return i.syncOrAsync([S,T.layoutStyles],r)}];v&&M.push((function(){if(x)return i.syncOrAsync([l.getComponentMethod("shapes","calcAutorange"),l.getComponentMethod("annotations","calcAutorange"),A],r);A()})),M.push(T.layoutStyles),v&&M.push((function(){return h.draw(r,p?"":"redraw")}),(function(t){var e=t._fullLayout._insideTickLabelsUpdaterange;if(e)return t._fullLayout._insideTickLabelsUpdaterange=void 0,V(t,e).then((function(){h.saveRangeInitial(t,!0)}))})),M.push(T.drawData,T.finalDraw,g,u.addLinks,u.rehover,u.redrag,u.reselect,u.doAutoMargin,u.previousPromises);var E=i.syncOrAsync(M,r);return E&&E.then||(E=Promise.resolve()),E.then((function(){return C(r),r}))},t.purge=function(t){var e=(t=i.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return u.cleanPlot([],{},r,e),u.purge(t),o.purge(t),e._container&&e._container.remove(),delete t._context,t},t.react=function(e,r,n,o){var s,h;e=i.getGraphDiv(e),w.clearPromiseQueue(e);var d=e._fullData,p=e._fullLayout;if(i.isPlotDiv(e)&&d&&p){if(i.isPlainObject(r)){var f=r;r=f.data,n=f.layout,o=f.config,s=f.frames}var m=!1;if(o){var g=i.extendDeep({},e._context);e._context=void 0,P(e,o),m=lt(g,e._context)}e.data=r||[],w.cleanData(e.data),e.layout=n||{},w.cleanLayout(e.layout),function(t,e,r,n){var o,s,l,c,u,h,d,p,f,m,g=n._preGUI,y=[],v={},x={};for(o in g){if(u=rt(o,tt)){if(f=u.head,m=u.tail,s=u.attr||f+".uirevision",(c=(l=a(n,s).get())&&nt(s,e))&&c===l){if(null===(h=g[o])&&(h=void 0),ot(p=(d=a(e,o)).get(),h)){void 0===p&&"autorange"===m&&y.push(f),d.set(B(a(n,o).get()));continue}if("autorange"===m||"range["===m.substr(0,6)){var b=g[f+".range[0]"],_=g[f+".range[1]"],w=g[f+".autorange"];if(w||null===w&&null===b&&null===_){if(!(f in v)){var k=a(e,f).get();v[f]=k&&(k.autorange||!1!==k.autorange&&(!k.range||2!==k.range.length))}if(v[f]){d.set(B(a(n,o).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+o);delete g[o],u&&"range["===u.tail.substr(0,6)&&(x[u.head]=1)}for(var T=0;T<y.length;T++){var S=y[T];if(x[S]){var A=a(e,S).get();A&&delete A.autorange}}var M=n._tracePreGUI;for(var C in M){var E,L=M[C],P=null;for(o in L){if(!P){var I=it(C,r);if(I<0){delete M[C];break}var z=at(C,t,(E=r[I]._fullInput).index);if(z<0){delete M[C];break}P=t[z]}if(u=rt(o,et)){if(u.attr?c=(l=a(n,u.attr).get())&&nt(u.attr,e):(l=E.uirevision,void 0===(c=P.uirevision)&&(c=e.uirevision)),c&&c===l&&(null===(h=L[o])&&(h=void 0),ot(p=(d=a(P,o)).get(),h))){d.set(B(a(E,o).get()));continue}}else i.warn("unrecognized GUI edit: "+o+" in trace uid "+C);delete L[o]}}}(e.data,e.layout,d,p),u.supplyDefaults(e,{skipUpdateCalc:!0});var y=e._fullData,v=e._fullLayout,x=void 0===v.datarevision,b=v.transition,_=function(t,e,r,n,i){var a=S.layoutFlags();function o(t){return c.getLayoutValObject(r,t)}for(var s in a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,r)if((s.startsWith("xaxis")||s.startsWith("yaxis"))&&e[s]){var l=r[s].domain,u=e[s].domain,h=e[s]._inputDomain;e[s]._inputDomain&&(l[0]===h[0]&&l[1]===h[1]?r[s].domain=e[s].domain:l[0]===u[0]&&l[1]===u[1]||(r[s]._inputDomain=null))}var d={getValObject:o,flags:a,immutable:n,transition:i,gd:t};return st(e,r,[],d),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some"),a}(e,p,v,x,b),k=_.newDataRevision,A=function(t,e,r,n,i,a){var o=e.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,u=S.traceFlags();function h(t){var e=c.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e}u.arrays={},u.nChanges=0,u.nChangesAnim=0;var d={getValObject:h,flags:u,immutable:n,transition:i,newDataRevision:a,gd:t},p={};for(s=0;s<e.length;s++)if(r[s]){if(p[(l=r[s]._fullInput).uid])continue;p[l.uid]=1,st(e[s]._fullInput,l,[],d)}return(u.calc||u.plot)&&(u.fullReplot=!0),i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(e,d,y,x,b,k);if(K(e)&&(_.layoutReplot=!0),A.calc||_.calc){e.calcdata=void 0;for(var M=Object.getOwnPropertyNames(v),E=0;E<M.length;E++){var L=M[E],I=L.substring(0,5);if("xaxis"===I||"yaxis"===I){var z=v[L]._emptyCategories;z&&z()}}}else u.supplyDefaultsUpdateCalc(e.calcdata,y);var O=[];if(s&&(e._transitionData={},u.createTransitionData(e),O.push((function(){return t.addFrames(e,s)}))),v.transition&&!m&&(A.anim||_.anim))_.ticks&&O.push(T.doTicksRelayout),u.doCalcdata(e),T.doAutoRangeAndConstraints(e),O.push((function(){return u.transitionFromReact(e,A,_,p)}));else if(A.fullReplot||_.layoutReplot||m)e._fullLayout._skipDefaults=!0,O.push(t._doPlot);else{for(var D in _.arrays){var R=_.arrays[D];if(R.length){var F=l.getComponentMethod(D,"drawOne");if(F!==i.noop)for(var j=0;j<R.length;j++)F(e,R[j]);else{var N=l.getComponentMethod(D,"draw");if(N===i.noop)throw new Error("cannot draw components: "+D);N(e)}}}O.push(u.previousPromises),A.style&&O.push(T.doTraceStyle),(A.colorbars||_.colorbars)&&O.push(T.doColorBars),_.legend&&O.push(T.doLegend),_.layoutstyle&&O.push(T.layoutStyles),_.axrange&&H(O),_.ticks&&O.push(T.doTicksRelayout),_.modebar&&O.push(T.doModeBar),_.camera&&O.push(T.doCamera),O.push(C)}O.push(u.rehover,u.redrag,u.reselect),(h=i.syncOrAsync(O,e))&&h.then||(h=Promise.resolve(e))}else h=t.newPlot(e,r,n,o);return h.then((function(){return e.emit("plotly_react",{data:r,layout:n}),e}))},t.redraw=function(e){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);return w.cleanData(e.data),w.cleanLayout(e.layout),e.calcdata=void 0,t._doPlot(e).then((function(){return e.emit("plotly_redraw"),e}))},t.relayout=V,t.restyle=F,t.setPlotConfig=function(t){return i.extendFlat(b,t)},t.update=J,t._guiRelayout=Q(V),t._guiRestyle=Q(F),t._guiUpdate=Q(J),t._storeDirectGUIEdit=function(t,e,r){for(var n in r)N(n,a(t,n).get(),r[n],e)}}}),On=d({"src/snapshot/helpers.js"(t){var e=Vt();t.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("mapbox")||t._has("map"))?500:0},t.getRedrawFunc=function(t){return function(){e.getComponentMethod("colorbar","draw")(t)}},t.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},t.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var r=window.URL||window.webkitURL;t.createObjectURL=function(t){return r.createObjectURL(t)},t.revokeObjectURL=function(t){return r.revokeObjectURL(t)},t.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),i=0;i<e;i++)n[i]=t.charCodeAt(i);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},t.octetStream=function(t){document.location.href="data:application/octet-stream"+t},t.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}}),Dn=d({"src/snapshot/tosvg.js"(t,e){var r=v(),n=(se(),Je()),i=q(),a=(Te(),/"/g),o="TOBESTRIPPED",s=new RegExp('("'+o+")|("+o+'")',"g");e.exports=function(t,e,l){var c,u=t._fullLayout,h=u._paper,d=u._toppaper,p=u.width,f=u.height;h.insert("rect",":first-child").call(n.setRect,0,0,p,f).call(i.fill,u.paper_bgcolor);var m=u._basePlotModules||[];for(c=0;c<m.length;c++){var g=m[c];g.toSVG&&g.toSVG(t)}if(d){var y=d.node().childNodes,v=Array.prototype.slice.call(y);for(c=0;c<v.length;c++){var x=v[c];x.childNodes.length&&h.node().appendChild(x)}}u._draggers&&u._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var t=r.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(a,o));var n=this.style.fontWeight;!n||"normal"!==n&&"400"!==n||t.style("font-weight",void 0);var i=this.style.fontStyle;i&&"normal"===i&&t.style("font-style",void 0);var s=this.style.fontVariant;s&&"normal"===s&&t.style("font-variant",void 0)}else t.remove()})),h.selectAll(".gradient_filled,.pattern_filled").each((function(){var t=r.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(a,o));var n=this.style.stroke;n&&-1!==n.indexOf("url(")&&t.style("stroke",n.replace(a,o))})),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),"svg"===e&&l&&(h.attr("width",l*p),h.attr("height",l*f),h.attr("viewBox","0 0 "+p+" "+f));var b=(new window.XMLSerializer).serializeToString(h.node());return b=(b=(b=function(t){var e=r.select("body").append("div").style({display:"none"}).html(""),n=t.replace(/(&[^;]*;)/gi,(function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),n}(b)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(s,"'")}}}),Rn=d({"src/snapshot/svgtoimg.js"(t,e){var r=se(),n=he().EventEmitter,i=On();e.exports=function(t){var e=t.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=t.svg,u=t.format||"png",h=t.canvas,d=t.scale||1,p=t.width||300,f=t.height||150,m=d*p,g=d*f,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!t.promise)return e.emit("error",l)}n(r),t.promise||e.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!t.promise)return e.emit("error",r)},v.src=s}));return t.promise?a:e}}}),Fn=d({"src/plot_api/to_image.js"(t,e){var r=k(),n=zn(),i=ke(),a=se(),o=On(),s=Dn(),l=Rn(),c=g().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var h,d,p,f;function m(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(h=t.data||[],d=t.layout||{},p=t.config||{},f={}):(t=a.getGraphDiv(t),h=a.extendDeep([],t.data),d=a.extendDeep({},t.layout),p=t._context,f=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,u,t,r)}var v=y("format"),x=y("width"),b=y("height"),_=y("scale"),w=y("setBackground"),k=y("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var S=a.extendFlat({},d);x?S.width=x:null===e.width&&r(f.width)&&(S.width=f.width),b?S.height=b:null===e.height&&r(f.height)&&(S.height=f.height);var A=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),M=o.getRedrawFunc(T);function C(){return new Promise((function(t){setTimeout(t,o.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=s(T,v,_),u=T._fullLayout.width,h=T._fullLayout.height;function d(){n.purge(T),document.body.removeChild(T)}if("full-json"===v){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=c,p=JSON.stringify(p),d(),t(k?p:o.encodeJSON(p))}if(d(),"svg"===v)return t(k?r:o.encodeSVG(r));var f=document.createElement("canvas");f.id=a.randstr(),l({format:v,width:u,height:h,scale:_,canvas:f,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){n.newPlot(T,h,S,A).then(M).then(C).then(E).then((function(e){t(function(t){return k?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}}}),Bn=d({"src/plot_api/validate.js"(t,e){var r=se(),n=ke(),i=me(),a=G().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(t,e,n,i,a,u){u=u||[];for(var h=Object.keys(t),m=0;m<h.length;m++){var g=h[m],y=u.slice();y.push(g);var v=t[g],x=e[g],b=f(n,g),_=(b||{}).valType,w="info_array"===_,k="colorscale"===_,T=(b||{}).items;if(p(n,g))if(o(v)&&o(x)&&"any"!==_)c(v,x,b,i,a,y);else if(w&&s(v)){v.length>x.length&&i.push(d("unused",a,y.concat(x.length)));var S,A,M,C,E,L=x.length,P=Array.isArray(T);if(P&&(L=Math.min(L,T.length)),2===b.dimensions)for(A=0;A<L;A++)if(s(v[A])){v[A].length>x[A].length&&i.push(d("unused",a,y.concat(A,x[A].length)));var I=x[A].length;for(S=0;S<(P?Math.min(I,T[A].length):I);S++)M=P?T[A][S]:T,C=v[A][S],E=x[A][S],r.validate(C,M)?E!==C&&E!==+C&&i.push(d("dynamic",a,y.concat(A,S),C,E)):i.push(d("value",a,y.concat(A,S),C))}else i.push(d("array",a,y.concat(A),v[A]));else for(A=0;A<L;A++)M=P?T[A]:T,C=v[A],E=x[A],r.validate(C,M)?E!==C&&E!==+C&&i.push(d("dynamic",a,y.concat(A),C,E)):i.push(d("value",a,y.concat(A),C))}else if(b.items&&!w&&s(v)){var z,O,D=T[Object.keys(T)[0]],R=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((O=y.slice()).push(F),o(v[F])&&o(x[z])){R.push(F);var B=v[F],j=x[z];o(B)&&!1!==B.visible&&!1===j.visible?i.push(d("invisible",a,O)):c(B,j,D,i,a,O)}}for(z=0;z<v.length;z++)(O=y.slice()).push(z),o(v[z])?-1===R.indexOf(z)&&i.push(d("unused",a,O)):i.push(d("object",a,O,v[z]))}else!o(v)&&o(x)?i.push(d("object",a,y,v)):l(v)||!l(x)||w||k?g in e?r.validate(v,b)?"enumerated"===b.valType&&(b.coerceNumber&&v!==+x||v!==x)&&i.push(d("dynamic",a,y,v,x)):i.push(d("value",a,y,v)):i.push(d("unused",a,y,v)):i.push(d("array",a,y,v));else i.push(d("schema",a,y))}return i}e.exports=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var l,u,h=i.get(),p=[],f={_context:r.extendFlat({},a)};s(t)?(f.data=r.extendDeep([],t),l=t):(f.data=[],l=[],p.push(d("array","data"))),o(e)?(f.layout=r.extendDeep({},e),u=e):(f.layout={},u={},arguments.length>1&&p.push(d("object","layout"))),n.supplyDefaults(f);for(var m=f._fullData,g=l.length,y=0;y<g;y++){var v=l[y],x=["data",y];if(o(v)){var b=m[y],_=b.type,w=h.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==v.visible&&p.push(d("invisible",x)),c(v,b,w,p,x)}else p.push(d("object",x))}var k=f._fullLayout,T=function(t,e){for(var n=t.layout.layoutAttributes,i=0;i<e.length;i++){var a=e[i],o=t.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?r.extendFlat(n[o.attributes.subplot.dflt],s):r.extendFlat(n,s))}return n}(h,m);return c(u,k,T,p,"layout"),0===p.length?void 0:p};var u={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":h(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":h(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return h(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=o(r)?"container":"key";return h(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[h(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?h(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[h(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function h(t){return s(t)?"In data trace "+t[1]+", ":"In "+t+", "}function d(t,e,n,i,a){var o,l;n=n||"",s(e)?(o=e[0],l=e[1]):(o=e,l=null);var c=function(t){if(!s(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"===typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(n),h=u[t](e,c,i,a);return r.log(h),{code:t,container:o,trace:l,path:n,astr:c,msg:h}}function p(t,e){var r=g(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function f(t,e){return e in t?t[e]:t[g(e).keyMinusId]}var m=r.counterRegex("([a-z]+)");function g(t){var e=t.match(m);return{keyMinusId:e&&e[1],id:e&&e[2]}}}}),jn=d({"src/snapshot/filesaver.js"(t,e){var r=se(),n=On();e.exports=function(t,e,i){var a=document.createElement("a"),o="download"in a;return new Promise((function(s,l){var c,u;if(o)return c=n.createBlob(t,i),u=n.createObjectURL(c),a.href=u,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),n.revokeObjectURL(u),c=null,s(e);if(r.isSafari()){var h="svg"===i?",":";base64,";return n.octetStream(h+encodeURIComponent(t)),s(e)}l(new Error("download error"))}))}}}),Nn=d({"src/snapshot/download.js"(t,e){var r=se(),n=Fn(),i=jn();On(),e.exports=function(t,e){var a;return r.isPlainObject(t)||(a=r.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise((function(r,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var s=n(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format.replace("-","."),s.then((function(t){return a&&(a._snapshotInProgress=!1),i(t,l,e.format)})).then((function(t){r(t)})).catch((function(t){a&&(a._snapshotInProgress=!1),o(t)}))}))}}}),Un=d({"src/plot_api/template_api.js"(t){var e=se(),r=e.isPlainObject,n=me(),i=ke(),a=N(),o=ge(),s=G().dfltConfig;function l(t,n){t=e.extendDeep({},t);var i,a,s=Object.keys(t).sort();function u(e,n,i){if(r(n)&&r(e))l(e,n);else if(Array.isArray(n)&&Array.isArray(e)){var s=o.arrayTemplater({_template:t},i);for(a=0;a<n.length;a++){var c=n[a],u=s.newItem(c)._template;u&&l(u,c)}var h=s.defaultItems();for(a=0;a<h.length;a++)n.push(h[a]._template);for(a=0;a<n.length;a++)delete n[a].templateitemname}}for(i=0;i<s.length;i++){var h=s[i],d=t[h];if(h in n?u(d,n[h],h):n[h]=d,c(h)===h)for(var p in n){var f=c(p);p===f||f!==h||p in t||u(d,n[p],h)}}}function c(t){return t.replace(/[0-9]+$/,"")}function u(t,n,i,a,s){var l=s&&i(s);for(var h in t){var d=t[h],f=p(t,h,a),m=p(t,h,s),g=i(m);if(!g){var y=c(h);y!==h&&(g=i(m=p(t,y,s)))}if((!l||l!==g)&&!(!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(d)))if(!g.valType&&r(d))u(d,n,i,f,m);else if(g._isLinkedToArray&&Array.isArray(d))for(var v=!1,x=0,b={},_=0;_<d.length;_++){var w=d[_];if(r(w)){var k=w.name;if(k)b[k]||(u(w,n,i,p(d,x,f),p(d,x,m)),x++,b[k]=1);else if(!v){var T=p(t,o.arrayDefaultKey(h),a),S=p(d,x,f);u(w,n,i,S,p(d,x,m));var A=e.nestedProperty(n,S);e.nestedProperty(n,T).set(A.get()),A.set(null),v=!0}}}else e.nestedProperty(n,f).set(d)}}function h(t,r){return n.getLayoutValObject(t,e.nestedProperty({},r).parts)}function d(t,r){return n.getTraceValObject(t,e.nestedProperty({},r).parts)}function p(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function f(t){for(var e=0;e<t.length;e++)if(r(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}t.makeTemplate=function(t){t=e.isPlainObject(t)?t:e.getGraphDiv(t),t=e.extendDeep({_context:s},{data:t.data,layout:t.layout}),i.supplyDefaults(t);var n=t.data||[],o=t.layout||{};o._basePlotModules=t._fullLayout._basePlotModules,o._modules=t._fullLayout._modules;var c={data:{},layout:{}};n.forEach((function(t){var r={};u(t,r,d.bind(null,t));var n=e.coerce(t,{},a,"type"),i=c.data[n];i||(i=c.data[n]=[]),i.push(r)})),u(o,c.layout,h.bind(null,o)),delete c.layout.template;var p=o.template;if(r(p)){var f,m,g,y,v,x,b=p.layout;r(b)&&l(b,c.layout);var _=p.data;if(r(_)){for(m in c.data)if(g=_[m],Array.isArray(g)){for(x=(v=c.data[m]).length,y=g.length,f=0;f<x;f++)l(g[f%y],v[f]);for(f=x;f<y;f++)v.push(e.extendDeep({},g[f]))}for(m in _)m in c.data||(c.data[m]=e.extendDeep([],_[m]))}}return c},t.validateTemplate=function(t,n){var a=e.extendDeep({},{_context:s,data:t.data,layout:t.layout}),o=a.layout||{};r(n)||(n=o.template||{});var l=n.layout,u=n.data,h=[];a.layout=o,a.layout.template=n,i.supplyDefaults(a);var d=a._fullLayout,g=a._fullData,y={};if(r(l)?(function t(e,n){for(var i in e)if("_"!==i.charAt(0)&&r(e[i])){var a,o=c(i),s=[];for(a=0;a<n.length;a++)s.push(p(e,i,n[a])),o!==i&&s.push(p(e,o,n[a]));for(a=0;a<s.length;a++)y[s[a]]=1;t(e[i],s)}}(d,["layout"]),function t(e,n){for(var i in e)if(-1===i.indexOf("defaults")&&r(e[i])){var a=p(e,i,n);y[a]?t(e[i],a):h.push({code:"unused",path:a})}}(l,"layout")):h.push({code:"layout"}),r(u)){for(var v,x={},b=0;b<g.length;b++){var _=g[b];x[v=_.type]=(x[v]||0)+1,_._fullInput._template||h.push({code:"missing",index:_.index,traceType:v})}for(v in u){var w=u[v].length,k=x[v]||0;w>k?h.push({code:"unused",traceType:v,templateCount:w,dataCount:k}):k>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:k})}}else h.push({code:"data"});if(function t(e,n){for(var i in e)if("_"!==i.charAt(0)){var a=e[i],o=p(e,i,n);r(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&f(a)&&t(a,o)}}({data:g,layout:d},""),h.length)return h.map(m)}}}),Vn=d({"src/plot_api/index.js"(t){var e=zn();t._doPlot=e._doPlot,t.newPlot=e.newPlot,t.restyle=e.restyle,t.relayout=e.relayout,t.redraw=e.redraw,t.update=e.update,t._guiRestyle=e._guiRestyle,t._guiRelayout=e._guiRelayout,t._guiUpdate=e._guiUpdate,t._storeDirectGUIEdit=e._storeDirectGUIEdit,t.react=e.react,t.extendTraces=e.extendTraces,t.prependTraces=e.prependTraces,t.addTraces=e.addTraces,t.deleteTraces=e.deleteTraces,t.moveTraces=e.moveTraces,t.purge=e.purge,t.addFrames=e.addFrames,t.deleteFrames=e.deleteFrames,t.animate=e.animate,t.setPlotConfig=e.setPlotConfig;var r=Et().getGraphDiv,n=Wr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Fn(),t.validate=Bn(),t.downloadImage=Nn();var i=Un();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}}),qn=d({"src/traces/scatter/xy_defaults.js"(t,e){var r=se(),n=Vt();e.exports=function(t,e,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}}),$n=d({"src/traces/scatter/period_defaults.js"(t,e){var r=se().dateTick0,n=T().ONEWEEK;function i(t,e){return r(e,t%n===0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}}}),Hn=d({"src/traces/scatter/stack_defaults.js"(t,e){var r=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(e):(c=l[o]={traceIndices:[],traces:[e]},u=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},d=0;d<r.length;d++){var p=r[d],f=p+"Found";if(!c[f]){var m=void 0!==t[p],g="orientation"===p;if((m||u)&&(c[p]=i(p,h[p]),g&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),m&&(c[f]=!0,!u&&(delete c.traces[0][p],g))))for(var y=0;y<c.traces.length-1;y++){var v=c.traces[y];v._input.fill!==v.fill&&(v.fill=c.fillDflt)}}}return c}}}}),Wn=d({"src/traces/scatter/marker_defaults.js"(t,e){var r=q(),n=Me().hasColorscale,i=Ve(),a=Ge();e.exports=function(t,e,o,s,l,c){var u=a.isBubble(t),h=(t.line||{}).color;c=c||{},h&&(o=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",o),n(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?r.background:r.defaultLine),n(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}}),Gn=d({"src/traces/scatter/line_defaults.js"(t,e){var r=se().isArrayOrTypedArray,n=Me().hasColorscale,i=Ve();e.exports=function(t,e,a,o,s,l){l||(l={});var c=(t.marker||{}).color;c&&c._inputArray&&(c=c._inputArray),s("line.color",a),n(t,"line")?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!r(c)&&c||a),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}}}),Yn=d({"src/traces/scatter/line_shape_defaults.js"(t,e){e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}}}),Zn=d({"src/traces/scatter/text_defaults.js"(t,e){var r=se();e.exports=function(t,e,n,i,a){a=a||{},i("textposition"),r.coerceFont(i,"textfont",a.font||n.font,a),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}}),Xn=d({"src/traces/scatter/fillcolor_defaults.js"(t,e){var r=q(),n=se().isArrayOrTypedArray;e.exports=function(t,e,i,a,o){o||(o={});var s,l=!1;if(e.marker){var c=e.marker.color,u=(e.marker.line||{}).color;c&&!n(c)?l=c:u&&!n(u)&&(l=u)}if(o.moduleHasFillgradient&&"none"!==a("fillgradient.type")){a("fillgradient.start"),a("fillgradient.stop");var h=a("fillgradient.colorscale");h&&(s=function(t){for(var e=r.interpolate(t[0][1],t[1][1],.5),n=2;n<t.length;n++){var i=r.interpolate(t[n-1][1],t[n][1],.5);e=r.interpolate(e,i,t[n-1][0]/t[n][0])}return e}(h))}a("fillcolor",r.addOpacity((e.line||{}).color||l||s||i,.5))}}}),Kn=d({"src/traces/scatter/defaults.js"(t,e){var r=se(),n=Vt(),i=wn(),a=bn(),o=Ge(),s=qn(),l=$n(),c=Hn(),u=Wn(),h=Gn(),d=Yn(),p=Zn(),f=Xn(),m=se().coercePattern;e.exports=function(t,e,g,y){function v(n,a){return r.coerce(t,e,i,n,a)}var x=s(t,e,y,v);if(x||(e.visible=!1),e.visible){l(t,e,y,v),v("xhoverformat"),v("yhoverformat"),v("zorder");var b=c(t,e,y,v);"group"===y.scattermode&&void 0===e.orientation&&v("orientation","v");var _=!b&&x<a.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",_),o.hasMarkers(e)&&u(t,e,g,y,v,{gradient:!0}),o.hasLines(e)&&(h(t,e,g,y,v,{backoff:!0}),d(t,e,v),v("connectgaps"),v("line.simplify")),o.hasText(e)&&(v("texttemplate"),p(t,e,y,v));var w=[];(o.hasMarkers(e)||o.hasText(e))&&(v("cliponaxis"),v("marker.maxdisplayed"),w.push("points")),v("fill",b?b.fillDflt:"none"),"none"!==e.fill&&(f(t,e,g,v,{moduleHasFillgradient:!0}),o.hasLines(e)||d(t,e,v),m(v,"fillpattern",e.fillcolor,!1));var k=(e.line||{}).color,T=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||w.push("fills"),v("hoveron",w.join("+")||"points"),"fills"!==e.hoveron&&v("hovertemplate");var S=n.getComponentMethod("errorbars","supplyDefaults");S(t,e,k||T||g,{axis:"y"}),S(t,e,k||T||g,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(e,v)}}}}),Jn=d({"src/traces/scatter/grouping_defaults.js"(t,e){var r=en().getAxisGroup;e.exports=function(t,e,n,i,a){var o=e.orientation,s=e[{v:"x",h:"y"}[o]+"axis"],l=r(n,s)+o,c=n._alignmentOpts||{},u=i("alignmentgroup"),h=c[l];h||(h=c[l]={});var d=h[u];d?d.traces.push(e):d=h[u]={traces:[e],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var p=i("offsetgroup")||"",f=d.offsetGroups,m=f[p];e._offsetIndex=0,("group"!==a||p)&&(m||(m=f[p]={offsetIndex:Object.keys(f).length}),e._offsetIndex=m.offsetIndex)}}}),Qn=d({"src/traces/scatter/cross_trace_defaults.js"(t,e){var r=se(),n=Jn(),i=wn();e.exports=function(t,e){var a,o,s,l=e.scattermode;function c(t){return r.coerce(o._input,o,i,t)}if("group"===e.scattermode)for(s=0;s<t.length;s++)"scatter"===(o=t[s]).type&&(a=o._input,n(a,o,e,c,l));for(s=0;s<t.length;s++){var u=t[s];if("scatter"===u.type){var h=u.fill;if("none"!==h&&"toself"!==h&&(u.opacity=void 0,"tonexty"===h||"tonextx"===h))for(var d=s-1;d>=0;d--){var p=t[d];if("scatter"===p.type&&p.xaxis===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}}),ti=d({"src/traces/scatter/layout_defaults.js"(t,e){var r=se(),n=be();e.exports=function(t,e){var i,a,o="group"===e.barmode;"group"===e.scattermode&&(i="scattergap",a=o?e.bargap:.2,r.coerce(t,e,n,i,a))}}}),ei=d({"src/plots/cartesian/align_period.js"(t,e){var r=k(),n=se(),i=n.dateTime2ms,a=n.incrementMonth,o=T().ONEAVGMONTH;e.exports=function(t,e,n,s){if("date"!==e.type)return{vals:s};var l=t[n+"periodalignment"];if(!l)return{vals:s};var c,u=t[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"===typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var d=e.calendar,p="start"===l,f="end"===l,m=t[n+"period0"],g=i(m,d)||0,y=[],v=[],x=[],b=s.length,_=0;_<b;_++){var w,k,T,S=s[_];if(c){for(w=Math.round((S-g)/(c*o)),T=a(g,c*w,d);T>S;)T=a(T,-c,d);for(;T<=S;)T=a(T,c,d);k=a(T,-c,d)}else{for(T=g+(w=Math.round((S-g)/u))*u;T>S;)T-=u;for(;T<=S;)T+=u;k=T-u}y[_]=p?k:f?T:(k+T)/2,v[_]=k,x[_]=T}return{vals:y,starts:v,ends:x}}}}),ri=d({"src/traces/scatter/colorscale_calc.js"(t,e){var r=Me().hasColorscale,n=He(),i=Ge();e.exports=function(t,e){i.hasLines(e)&&r(e,"line")&&n(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ni=d({"src/traces/scatter/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.texttemplate,t,"txt"),r.mergeArray(e.hovertext,t,"htx"),r.mergeArray(e.customdata,t,"data"),r.mergeArray(e.textposition,t,"tp"),e.textfont&&(r.mergeArrayCastPositive(e.textfont.size,t,"ts"),r.mergeArray(e.textfont.color,t,"tc"),r.mergeArray(e.textfont.family,t,"tf"),r.mergeArray(e.textfont.weight,t,"tw"),r.mergeArray(e.textfont.style,t,"ty"),r.mergeArray(e.textfont.variant,t,"tv"),r.mergeArray(e.textfont.textcase,t,"tC"),r.mergeArray(e.textfont.lineposition,t,"tE"),r.mergeArray(e.textfont.shadow,t,"tS"));var i=e.marker;if(i){r.mergeArrayCastPositive(i.size,t,"ms"),r.mergeArrayCastPositive(i.opacity,t,"mo"),r.mergeArray(i.symbol,t,"mx"),r.mergeArray(i.angle,t,"ma"),r.mergeArray(i.standoff,t,"mf"),r.mergeArray(i.color,t,"mc");var a=i.line;i.line&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(r.mergeArray(o.type,t,"mgt"),r.mergeArray(o.color,t,"mgc"))}}}}),ii=d({"src/traces/scatter/calc_selection.js"(t,e){var r=se();e.exports=function(t,e){r.isArrayOrTypedArray(e.selectedpoints)&&r.tagSelected(t,e)}}}),ai=d({"src/traces/scatter/calc.js"(t,e){var r=k(),n=se(),i=nr(),a=ei(),o=T().BADNUM,s=Ge(),l=ri(),c=ni(),u=ii();function h(t,e,r,n,a,o,l){var c=e._length,u=t._fullLayout,h=r._id,d=n._id,p=u._firstScatter[f(e)]===e.uid,g=(m(e,u,r,n)||{}).orientation,y=e.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},x={padded:!0};l&&(v.ppad=x.ppad=l);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===y||"tonextx"===y&&(p||"h"===g))?v.tozero=!0:(e.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(s.hasMarkers(e)||s.hasText(e))||(v.padded=!1,v.ppad=0),b&&("tozeroy"===y||"tonexty"===y&&(p||"v"===g))?x.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(x.padded=!1),h&&(e._extremes[h]=i.findExtremes(r,a,v)),d&&(e._extremes[d]=i.findExtremes(n,o,x))}function d(t,e){if(s.hasMarkers(t)){var r,a=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},n.isArrayOrTypedArray(a.size)){var l={type:"linear"};i.setConvert(l);for(var c=l.makeCalcdata(t.marker,"size"),u=new Array(e),h=0;h<e;h++)u[h]=r(c[h]);return u}return r(a.size)}}function p(t,e){var r=f(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function f(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function m(t,e,r,n){var i=t.stackgroup;if(i){var a=e._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;return"linear"===o.type||"log"===o.type?a:void 0}}e.exports={calc:function(t,e){var s,f,g,y,v,x,b=t._fullLayout,_=e._xA=i.getFromId(t,e.xaxis||"x","x"),w=e._yA=i.getFromId(t,e.yaxis||"y","y"),k=_.makeCalcdata(e,"x"),T=w.makeCalcdata(e,"y"),S=a(e,_,"x",k),A=a(e,w,"y",T),M=S.vals,C=A.vals,E=e._length,L=new Array(E),P=e.ids,I=m(e,b,_,w),z=!1;p(b,e);var O,D="x",R="y";I?(n.pushUnique(I.traceIndices,e.index),(s="v"===I.orientation)?(R="s",O="x"):(D="s",O="y"),v="interpolate"===I.stackgaps):h(t,e,_,w,M,C,d(e,E));var F=!!e.xperiodalignment,B=!!e.yperiodalignment;for(f=0;f<E;f++){var j=L[f]={},N=r(M[f]),U=r(C[f]);N&&U?(j[D]=M[f],j[R]=C[f],F&&(j.orig_x=k[f],j.xEnd=S.ends[f],j.xStart=S.starts[f]),B&&(j.orig_y=T[f],j.yEnd=A.ends[f],j.yStart=A.starts[f])):I&&(s?N:U)?(j[O]=s?M[f]:C[f],j.gap=!0,v?(j.s=o,z=!0):j.s=0):j[D]=j[R]=o,P&&(j.id=String(P[f]))}if(c(L,e),l(t,e),u(L,e),I){for(f=0;f<L.length;)L[f][O]===o?L.splice(f,1):f++;if(n.sort(L,(function(t,e){return t[O]-e[O]||t.i-e.i})),z){for(f=0;f<L.length-1&&L[f].gap;)f++;for((x=L[f].s)||(x=L[f].s=0),g=0;g<f;g++)L[g].s=x;for(y=L.length-1;y>f&&L[y].gap;)y--;for(x=L[y].s,g=L.length-1;g>y;g--)L[g].s=x;for(;f<y;)if(L[++f].gap){for(g=f+1;L[g].gap;)g++;for(var V=L[f-1][O],q=L[f-1].s,$=(L[g].s-q)/(L[g][O]-V);f<g;)L[f].s=q+(L[f][O]-V)*$,f++}}}return L},calcMarkerSize:d,calcAxisExpansion:h,setFirstScatter:p,getStackOpts:m}}}),oi=d({"src/traces/bar/sieve.js"(t,e){e.exports=n;var r=se().distinctVals;function n(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var n=1/0,i=e.posAxis._id.charAt(0),a=[],o=0;o<t.length;o++){for(var s=t[o],l=0;l<s.length;l++){var c=s[l],u=c.p;void 0===u&&(u=c[i]),void 0!==u&&a.push(u)}s[0]&&s[0].width1&&(n=Math.min(s[0].width1,n))}this.positions=a;var h=r(a);this.distinctPositions=h.vals,1===h.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(h.minDiff,n);var d=(e.posAxis||{}).type;"category"!==d&&"multicategory"!==d||(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}n.prototype.put=function(t,e,r){var n=this.getLabel(t,e,r),i=this.bins[n]||0;return this.bins[n]=i+r,i},n.prototype.get=function(t,e,r){var n=this.getLabel(t,e,r);return this.bins[n]||0},n.prototype.getLabel=function(t,e,r){return(r<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?t:Math.round(t/this.binWidth))+"g"+e}}}),si=d({"src/traces/bar/cross_trace_calc.js"(t,e){var r=k(),n=se().isArrayOrTypedArray,i=T().BADNUM,a=Vt(),o=nr(),s=en().getAxisGroup,l=oi();function c(t,e,a,s,c){if(s.length){var d,y,v,x;switch(function(t,e){var i,a;for(i=0;i<e.length;i++){var o,s=e[i],l=s[0].trace,c="funnel"===l.type?l._base:l.base,u="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===t.type||"multicategory"===t.type?function(){return null}:t.d2c;if(n(c)){for(a=0;a<Math.min(c.length,s.length);a++)o=h(c[a],0,u),r(o)?(s[a].b=+o,s[a].hasB=1):s[a].b=0;for(;a<s.length;a++)s[a].b=0}else{o=h(c,0,u);var d=r(o);for(o=d?o:0,a=0;a<s.length;a++)s[a].b=o,d&&(s[a].hasB=1)}}}(a,s),c.mode){case"overlay":u(t,e,a,s,c);break;case"group":for(d=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.offset?y.push(x):d.push(x);y.length&&function(t,e,r,n,a){var o=new l(n,{posAxis:e,sepNegVal:!1,overlapNoMerge:!a.norm});h(t,e,o,a),function(t,e){for(var r=t.traces,n=0;n<r.length;n++){var a=r[n],o=a[0].trace,s=a[0].t.offsetindex;if(void 0===o.base)for(var c=new l([a],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),u=0;u<a.length;u++){var h=a[u];if(h.p!==i){var d=c.put(h.p,s,h.b+h.s);d&&(h.b=d)}}}}(o,e),a.norm?(f(o),m(r,o,a)):p(r,o)}(t,e,a,y,c),d.length&&u(t,e,a,d,c);break;case"stack":case"relative":for(d=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.base?y.push(x):d.push(x);!function(t){if(!(t.length<2)){var e,n,i,a,o,s;for(e=0;e<t.length&&void 0===(a=(n=t[e][0].trace).marker?n.marker.cornerradius:void 0);e++);if(void 0!==a)for(o=r(a)?+a:+a.slice(0,-1),s=r(a)?"px":"%",e=0;e<t.length;e++)(i=t[e][0].t).cornerradiusvalue=o,i.cornerradiusform=s}}(y),y.length&&function(t,e,r,n,a){var s=new l(n,{posAxis:e,sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});h(t,e,s,a),function(t,e,r){var n,a,s,l,c,u,h,d=g(t),p=e.traces;for(l=0;l<p.length;l++)if("funnel"===(a=(n=p[l])[0].trace).type)for(h=n[0].t.offsetindex,c=0;c<n.length;c++)(u=n[c]).s!==i&&e.put(u.p,h,-.5*u.s);for(l=0;l<p.length;l++){s="funnel"===(a=(n=p[l])[0].trace).type,h="barpolar"===a.type?0:n[0].t.offsetindex;var f=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var m;m=s?u.s:u.s+u.b;var y=e.put(u.p,h,m),v=y+m;u.b=y,u[d]=v,r.norm||(f.push(v),u.hasB&&f.push(y))}r.norm||(a._extremes[t._id]=o.findExtremes(t,f,{tozero:!0,padded:!0}))}}(r,s,a);for(var c=0;c<n.length;c++)for(var u=n[c],d=u[0].t.offsetindex,p=0;p<u.length;p++){var f=u[p];f.s!==i&&f.b+f.s===s.get(f.p,d,f.s)&&(f._outmost=!0)}a.norm&&m(r,s,a)}(t,e,a,y,c),d.length&&u(t,e,a,d,c)}!function(t){var e,n,i,a,o,s,l;for(e=0;e<t.length;e++)i=(n=t[e])[0].trace,void 0===(a=n[0].t).cornerradiusvalue&&void 0!==(o=i.marker?i.marker.cornerradius:void 0)&&(s=r(o)?+o:+o.slice(0,-1),l=r(o)?"px":"%",a.cornerradiusvalue=s,a.cornerradiusform=l)}(s),function(t,e){var i,a,o,s=g(e),l={},c=1/0,u=-1/0;for(i=0;i<t.length;i++)for(o=t[i],a=0;a<o.length;a++){var h=o[a].p;r(h)&&(c=Math.min(c,h),u=Math.max(u,h))}var d=1e4/(u-c),p=l.round=function(t){return String(Math.round(d*(t-c)))},f={},m={},y=t.some((function(t){var e=t[0].trace;return"marker"in e&&e.marker.cornerradius}));for(i=0;i<t.length;i++){(o=t[i])[0].t.extents=l;var v=o[0].t.poffset,x=n(v);for(a=0;a<o.length;a++){var b=o[a],_=b[s]-b.w/2;if(r(_)){var w=b[s]+b.w/2,k=p(b.p);l[k]?l[k]=[Math.min(_,l[k][0]),Math.max(w,l[k][1])]:l[k]=[_,w]}if(b.p0=b.p+(x?v[a]:v),b.p1=b.p0+b.w,b.s0=b.b,b.s1=b.s0+b.s,y){var T=Math.min(b.s0,b.s1)||0,S=Math.max(b.s0,b.s1)||0,A=b[s];f[A]=A in f?Math.min(f[A],T):T,m[A]=A in m?Math.max(m[A],S):S}}}y&&function(t,e,r,n){for(var i=g(n),a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s],c=l[i];l._sMin=e[c],l._sMax=r[c]}}(t,f,m,e)}(s,e)}}function u(t,e,r,n,i){for(var a=0;a<n.length;a++){var o=n[a],s=new l([o],{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});h(t,e,s,i),i.norm?(f(s),m(r,s,i)):p(r,s)}}function h(t,e,i,a){var o,l,c,u,h=t._fullLayout,p=i.positions,f=i.distinctPositions,m=i.minDiff,y=i.traces,v=y.length,x=p.length!==f.length,b=m*(1-a.gap);if("angularaxis"===e._id)c=-(l=(o=b)*(1-(a.groupgap||0)))/2;else{var _=s(h,e._id)+y[0][0].trace.orientation;u=h._alignmentOpts[_]||{}}for(var w=0;w<v;w++){var k=y[w],T=k[0].trace;if("angularaxis"!==e._id){var S=u[T.alignmentgroup]||{},A=Object.keys(S.offsetGroups||{}).length;l=(o=A?b/A:x?b/v:b)*(1-(a.groupgap||0)),c=A?((2*T._offsetIndex+1-A)*o-l)/2:x?((2*w+1-v)*o-l)/2:-l/2}var M=k[0].t;M.barwidth=l,M.offsetindex=T._offsetIndex||0,M.poffset=c,M.bargroupwidth=b,M.bardelta=m}i.binWidth=y[0][0].t.barwidth/100,function(t){var e,i,a=t.traces;for(e=0;e<a.length;e++){var o,s=a[e],l=s[0],c=l.trace,u=l.t,h=c._offset||c.offset,d=u.poffset;if(n(h)){for(o=Array.prototype.slice.call(h,0,s.length),i=0;i<o.length;i++)r(o[i])||(o[i]=d);for(i=o.length;i<s.length;i++)o.push(d);u.poffset=o}else void 0!==h&&(u.poffset=h);var p=c._width||c.width,f=u.barwidth;if(n(p)){var m=Array.prototype.slice.call(p,0,s.length);for(i=0;i<m.length;i++)r(m[i])||(m[i]=f);for(i=m.length;i<s.length;i++)m.push(f);if(u.barwidth=m,void 0===h){for(o=[],i=0;i<s.length;i++)o.push(d+(f-m[i])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===h&&(u.poffset=d+(f-p)/2))}}(i),function(t,e){for(var r=e.traces,i=g(t),a=0;a<r.length;a++)for(var o=r[a],s=o[0].t,l=s.poffset,c=n(l),u=s.barwidth,h=n(u),d=0;d<o.length;d++){var p=o[d],f=p.w=h?u[d]:u;void 0===p.p&&(p.p=p[i],p["orig_"+i]=p[i]);var m=(c?l[d]:l)+f/2;p[i]=p.p+m}}(e,i),"angularaxis"===e._id?d(e,i):d(e,i,x)}function d(t,e,r){var i=e.traces,a=e.minDiff/2;o.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var s=0;s<i.length;s++){var l,c,u,h,d=i[s],p=d[0],f=p.trace,m=[];for(h=0;h<d.length;h++)c=(l=d[h]).p-a,u=l.p+a,m.push(c,u);if(f.width||f.offset){var g=p.t,y=g.poffset,v=g.barwidth,x=n(y),b=n(v);for(h=0;h<d.length;h++){l=d[h];var _=x?y[h]:y,w=b?v[h]:v;u=(c=l.p+_)+w,m.push(c,u)}}f._extremes[t._id]=o.findExtremes(t,m,{padded:!1})}}function p(t,e){for(var r=e.traces,n=g(t),i=0;i<r.length;i++){for(var a=r[i],s=a[0].trace,l="scatter"===s.type,c="v"===s.orientation,u=[],h=!1,d=0;d<a.length;d++){var p=a[d],f=l?0:p.b,m=l?c?p.y:p.x:f+p.s;p[n]=m,u.push(m),p.hasB&&u.push(f),p.hasB&&p.b||(h=!0)}s._extremes[t._id]=o.findExtremes(t,u,{tozero:h,padded:!0})}}function f(t){for(var e=t.traces,r=0;r<e.length;r++)for(var n=e[r],a=n[0].t.offsetindex,o=0;o<n.length;o++){var s=n[o];s.s!==i&&t.put(s.p,a,s.b+s.s)}}function m(t,e,n){var a=e.traces,s=g(t),l="fraction"===n.norm?1:100,c=l/1e9,u=t.l2c(t.c2l(0)),h="stack"===n.mode?l:u;function d(e){return r(t.c2l(e))&&(e<u-c||e>h+c||!r(u))}for(var p=0;p<a.length;p++){for(var f=a[p],m=f[0].t.offsetindex,y=f[0].trace,v=[],x=!1,b=!1,_=0;_<f.length;_++){var w=f[_];if(w.s!==i){var k=Math.abs(l/e.get(w.p,m,w.s));w.b*=k,w.s*=k;var T=w.b,S=T+w.s;w[s]=S,v.push(S),b=b||d(S),w.hasB&&(v.push(T),b=b||d(T)),w.hasB&&w.b||(x=!0)}}y._extremes[t._id]=o.findExtremes(t,v,{tozero:x,padded:b})}}function g(t){return t._id.charAt(0)}e.exports={crossTraceCalc:function(t,e){for(var r=e.xaxis,n=e.yaxis,i=t._fullLayout,o=t._fullData,s=t.calcdata,l=[],u=[],h=0;h<o.length;h++){var d=o[h];if(!0===d.visible&&a.traceIs(d,"bar")&&d.xaxis===r._id&&d.yaxis===n._id&&("h"===d.orientation?l.push(s[h]):u.push(s[h]),d._computePh))for(var p=t.calcdata[h],f=0;f<p.length;f++)"function"===typeof p[f].ph0&&(p[f].ph0=p[f].ph0()),"function"===typeof p[f].ph1&&(p[f].ph1=p[f].ph1())}var m={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};c(t,r,n,u,m),c(t,n,r,l,m)},setGroupPositions:c}}}),li=d({"src/traces/scatter/cross_trace_calc.js"(t,e){var r=ai(),n=si().setGroupPositions;function i(t,e,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(t,e,r,n){var i=t[e-1],a=t[e+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){"group"===t._fullLayout.scattermode&&function(t,e){for(var r=e.xaxis,i=e.yaxis,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=[],c=[],u=0;u<o.length;u++){var h=o[u];!0===h.visible&&"scatter"===h.type&&h.xaxis===r._id&&h.yaxis===i._id&&("h"===h.orientation?l.push(s[u]):"v"===h.orientation&&c.push(s[u]))}var d={mode:a.scattermode,gap:a.scattergap};n(t,r,i,c,d),n(t,i,r,l,d)}(t,e);var a=e.xaxis,o=e.yaxis,s=a._id+o._id,l=t._fullLayout._scatterStackOpts[s];if(l){var c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T=t.calcdata;for(var S in l){var A=(v=l[S]).traceIndices;if(A.length){for(x="interpolate"===v.stackgaps,b=v.groupnorm,"v"===v.orientation?(_="x",w="y"):(_="y",w="x"),k=new Array(A.length),c=0;c<k.length;c++)k[c]=!1;f=T[A[0]];var M=new Array(f.length);for(c=0;c<f.length;c++)M[c]=f[c][_];for(c=1;c<A.length;c++){for(p=T[A[c]],u=h=0;u<p.length;u++){for(m=p[u][_];m>M[h]&&h<M.length;h++)i(p,u,M[h],c,k,x,_),u++;if(m!==M[h]){for(d=0;d<c;d++)i(T[A[d]],h,m,d,k,x,_);M.splice(h,0,m)}h++}for(;h<M.length;h++)i(p,u,M[h],c,k,x,_),u++}var C=M.length;for(u=0;u<f.length;u++){for(g=f[u][w]=f[u].s,c=1;c<A.length;c++)(p=T[A[c]])[0].trace._rawLength=p[0].trace._length,p[0].trace._length=C,g+=p[u].s,p[u][w]=g;if(b)for(y=("fraction"===b?g:g/100)||1,c=0;c<A.length;c++){var E=T[A[c]][u];E[w]/=y,E.sNorm=E.s/y}}for(c=0;c<A.length;c++){var L=(p=T[A[c]])[0].trace,P=r.calcMarkerSize(L,L._rawLength),I=Array.isArray(P);if(P&&k[c]||I){var z=P;for(P=new Array(C),u=0;u<C;u++)P[u]=p[u].gap?0:I?z[p[u].i]:z}var O=new Array(C),D=new Array(C);for(u=0;u<C;u++)O[u]=p[u].x,D[u]=p[u].y;r.calcAxisExpansion(t,L,a,o,O,D,P),p[0].t.orientation=v.orientation}}}}}}}),ci=d({"src/traces/scatter/line_points.js"(t,e){var r=Je(),n=T(),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=se(),c=l.segmentsIntersect,u=l.constrain,h=bn();e.exports=function(t,e){var n,a,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M,C=e.trace||{},E=e.xaxis,L=e.yaxis,P="log"===E.type,I="log"===L.type,z=E._length,O=L._length,D=e.backoff,R=C.marker,F=e.connectGaps,B=e.baseTolerance,j=e.shape,N="linear"===j,U=C.fill&&"none"!==C.fill,V=[],q=h.minTolerance,$=t.length,H=new Array($),W=0;function G(r){var n=t[r];if(!n)return!1;var a=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?L.l2p(n.y):L.c2p(n.y);if(a===i){if(P&&(a=E.c2p(n.x,!0)),a===i)return!1;I&&l===i&&(a*=Math.abs(E._m*O*(E._m>0?o:s)/(L._m*z*(L._m>0?o:s)))),a*=1e3}if(l===i){if(I&&(l=L.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&c<l){var u=o*a-s*i;if(u*u<l)return!0}}function Z(t,e){var r=t[0]/z,n=t[1]/O,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==A&&Y(r,n,A,M)&&(i=0),i&&e&&Y(r,n,e[0]/z,e[1]/O)&&(i=0),(1+h.toleranceGrowth*i)*B}function X(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var K,J,Q,tt,et,rt,nt,it=h.maxScreensAway,at=-z*it,ot=z*(1+it),st=-O*it,lt=O*(1+it),ct=[[at,st,ot,st],[ot,st,ot,lt],[ot,lt,at,lt],[at,lt,at,st]];function ut(t){if(t[0]<at||t[0]>ot||t[1]<st||t[1]>lt)return[u(t[0],at,ot),u(t[1],st,lt)]}function ht(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function dt(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return c&&((a&&o?c>0===a[t]>o[t]?a:o:a||o)[t]+=c),s}}function pt(t){var e=t[0],r=t[1],n=e===H[W-1][0],i=r===H[W-1][1];if(!n||!i)if(W>1){var a=e===H[W-2][0],o=r===H[W-2][1];n&&(e===at||e===ot)&&a?o?W--:H[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:H[W-1]=t:H[W++]=t}else H[W++]=t}function ft(t){H[W-1][0]!==t[0]&&H[W-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===j||"spline"===j?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)<X(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===j||"vh"===j?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===j?nt=dt(0,at,ot):"vhv"===j&&(nt=dt(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&D&&(e.i=n,e.d=t,e.trace=C,e.marker=mt?R[e.i]:R,e.backoff=D),A=e[0]/z,M=e[1]/O,K=e[0]<at?at:e[0]>ot?ot:0,J=e[1]<st?st:e[1]>lt?lt:0,K||J){if(W)if(et){var r=nt(et,e);r.length>1&&(ft(r[0]),H[W++]=r[1])}else rt=nt(H[W-1],e)[0],H[W++]=rt;else H[W++]=[K||e[0],J||e[1]];var i=H[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(et&&(Q!==K&&tt!==J?pt(Q&&tt?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?at:ot,lt]:[n>0?ot:at,st]}(et,e):[Q||K,tt||J]):Q&&tt&&pt([Q,tt])),pt([K,J])):Q-K&&tt-J&&pt([K||Q,J||tt]),et=e,Q=K,tt=J}else et&&ft(nt(et,e)[0]),H[W++]=e}for(n=0;n<$;n++)if(a=G(n)){for(W=0,et=null,gt(a),n++;n<$;n++){if(!(p=G(n))){if(F)continue;break}if(N&&e.simplify){var yt=G(n+1);if(x=X(p,a),U&&(0===W||W===$-1)||!(x<Z(p,yt)*q)){for(y=[(p[0]-a[0])/x,(p[1]-a[1])/x],f=a,b=x,_=k=T=0,g=!1,d=p,n++;n<t.length;n++){if(m=yt,yt=G(n+1),!m){if(F)continue;break}if(S=(v=[m[0]-a[0],m[1]-a[1]])[0]*y[1]-v[1]*y[0],k=Math.min(k,S),(T=Math.max(T,S))-k>Z(m,yt))break;d=m,(w=v[0]*y[0]+v[1]*y[1])>b?(b=w,p=m,g=!1):w<_&&(_=w,f=m,g=!0)}if(g?(gt(p),d!==f&&gt(f)):(f!==a&&gt(f),d!==p&&gt(p)),gt(d),n>=t.length||!m)break;gt(m),a=m}}else gt(p)}et&&pt([Q||et[0],tt||et[1]]),V.push(H.slice(0,W))}var vt=j.slice(j.length-1);if(D&&"h"!==vt&&"v"!==vt){for(var xt=!1,bt=-1,_t=[],wt=0;wt<V.length;wt++)for(var kt=0;kt<V[wt].length-1;kt++){var Tt=V[wt][kt],St=V[wt][kt+1],At=r.applyBackoff(St,Tt);At[0]===St[0]&&At[1]===St[1]||(xt=!0),_t[bt+1]||(_t[++bt]=[Tt,[At[0],At[1]]])}return xt?_t:V}return V}}}),ui=d({"src/traces/scatter/link_traces.js"(t,e){var r={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,n){var i,a,o,s,l,c={},u=!1,h=-1,d=0,p=-1;for(a=0;a<n.length;a++)(o=(i=n[a][0].trace).stackgroup||"")?o in c?l=c[o]:(l=c[o]=d,d++):i.fill in r&&p>=0?l=p:(l=p=d,d++),l<h&&(u=!0),i._groupIndex=h=l;var f=n.slice();u&&f.sort((function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(a=0;a<f.length;a++)o=(i=f[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in r&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return f}}}),hi=d({"src/traces/scatter/plot.js"(t,e){var r=v(),n=Vt(),i=se(),a=i.ensureSingle,o=i.identity,s=Je(),l=Ge(),c=ci(),u=ui(),h=fn().tester;function d(t,e,u,d,p,f,m){var g,y=t._context.staticPlot;!function(t,e,n,a,o){var s=n.xaxis,c=n.yaxis,u=r.extent(i.simpleMap(s.range,s.r2c)),h=r.extent(i.simpleMap(c.range,c.r2c)),d=a[0].trace;if(l.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var f=a.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(f.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach((function(t){delete t.vis})),f.forEach((function(t,e){0===Math.round((e+y)%m)&&(t.vis=!0)}))}}}(0,e,u,d,p);var v=!!m&&m.duration>0;function x(t){return v?t.transition():t}var b=u.xaxis,_=u.yaxis,w=d[0].trace,k=w.line,T=r.select(f),S=a(T,"g","errorbars"),A=a(T,"g","lines"),M=a(T,"g","points"),C=a(T,"g","text");if(n.getComponentMethod("errorbars","plot")(t,S,u,m),!0===w.visible){var E,L;x(T).style("opacity",w.opacity);var P,I,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(P=1,I=_.c2p(0,!0)):"x"===z&&(P=0,I=b.c2p(0,!0)),d[0][u.isRangePlot?"nodeRangePlot3":"node3"]=T;var O,D,R="",F=[],B=w._prevtrace,j=null,N=null;B&&(R=B._prevRevpath||"",L=B._nextFill,F=B._ownPolygons,j=B._fillsegments,N=B._fillElement);var U,V,q,$,H,W,G="",Y="",Z=[];w._polygons=[];var X=[],K=[],J=i.noop;if(E=w._ownFill,l.hasLines(w)||"none"!==w.fill){L&&L.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(U=s.steps(k.shape),V=s.steps(k.shape.split("").reverse().join(""))):U=V="spline"===k.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),k.smoothing):s.smoothopen(t,k.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return V(t.reverse())},K=c(d,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),X=new Array(K.length);var Q=0;for(g=0;g<K.length;g++){var tt,et=K[g];tt&&z?tt.push.apply(tt,et):(tt=et.slice(),X[Q]=tt,Q++)}w._fillElement=null,w._fillExclusionElement=N,w._fillsegments=X.slice(0,Q),X=w._fillsegments,K.length&&($=K[0][0].slice(),W=(H=K[K.length-1])[H.length-1].slice()),J=function(t){return function(e){if(O=U(e),D=q(e),G?z?(G+="L"+O.substr(1),Y=D+"L"+Y.substr(1)):(G+="Z"+O,Y=D+"Z"+Y):(G=O,Y=D),l.hasLines(w)){var n=r.select(this);if(n.datum(d),t)x(n.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var i=x(n);i.attr("d",O),s.singleLineStyle(d,i)}}}}}var rt=A.selectAll(".js-line").data(K);x(rt.exit()).style("opacity",0).remove(),rt.each(J(!1)),rt.enter().append("path").classed("js-line",!0).style("vector-effect",y?"none":"non-scaling-stroke").call(s.lineGroupStyle).each(J(!0)),s.setClipUrl(rt,u.layerClipId,t);var nt=function(){var t=new Array(X.length);for(g=0;g<X.length;g++)t[g]=h(X[g]);return t},it=function(t){var e,r;if(t&&0!==t.length){for(e=new Array(t.length-1+X.length),r=0;r<t.length-1;r++)e[r]=h(t[r]);var n=t[t.length-1].slice();for(n.reverse(),r=0;r<X.length;r++)e[t.length-1+r]=h(X[r].concat(n))}else for(e=new Array(X.length),r=0;r<X.length;r++){var i=X[r][0].slice(),a=X[r][X[r].length-1].slice();i[P]=a[P]=I;var o=[a,i].concat(X[r]);e[r]=h(o)}return e};K.length?(E?(E.datum(d),$&&W&&(z?($[P]=W[P]=I,x(E).attr("d","M"+W+"L"+$+"L"+G.substr(1)).call(s.singleFillStyle,t),Z=it(null)):(x(E).attr("d",G+"Z").call(s.singleFillStyle,t),Z=nt())),w._polygons=Z,w._fillElement=E):L&&("tonext"===w.fill.substr(0,6)&&G&&R?("tonext"===w.fill?(x(L).attr("d",G+"Z"+R+"Z").call(s.singleFillStyle,t),Z=nt(),w._polygons=Z.concat(F)):(x(L).attr("d",G+"L"+R.substr(1)+"Z").call(s.singleFillStyle,t),Z=it(j),w._polygons=Z),w._fillElement=L):ot(L)),w._prevRevpath=Y):(E?ot(E):L&&ot(L),w._prevRevpath=null),w._ownPolygons=Z,M.datum(d),C.datum(d),function(e,n,i){var a,c=i[0].trace,h=l.hasMarkers(c),d=l.hasText(c),p=function(t){if(t.ids)return ut}(c),f=ht,m=ht;if(h||d){var g=o,y=c.stackgroup,w=y&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+_._id][y].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?lt:st:y&&!w&&(g=ct),h&&(f=g),d&&(m=g)}var k,T=(a=e.selectAll("path.point").data(f,p)).enter().append("path").classed("point",!0);v&&T.call(s.pointStyle,c,t).call(s.translatePoints,b,_).style("opacity",0).transition().style("opacity",1),a.order(),h&&(k=s.makePointStyleFns(c)),a.each((function(e){var n=r.select(this),i=x(n);s.translatePoint(e,i,b,_)?(s.singlePointStyle(e,i,c,k,t),u.layerClipId&&s.hideOutsideRangePoint(e,i,b,_,c.xcalendar,c.ycalendar),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),v?a.exit().transition().style("opacity",0).remove():a.exit().remove(),(a=n.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),a.order(),a.each((function(t){var e=r.select(this),n=x(e.select("text"));s.translatePoint(t,n,b,_)?u.layerClipId&&s.hideOutsideRangePoint(t,e,b,_,c.xcalendar,c.ycalendar):e.remove()})),a.selectAll("text").call(s.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),n=_.c2p(t.y);r.select(this).selectAll("tspan.line").each((function(){x(r.select(this)).attr({x:e,y:n})}))})),a.exit().remove()}(M,C,d);var at=!1===w.cliponaxis?null:u.layerClipId;s.setClipUrl(M,at,t),s.setClipUrl(C,at,t)}function ot(t){x(t).attr("d","M0,0Z")}function st(t){return t.filter((function(t){return!t.gap&&t.vis}))}function lt(t){return t.filter((function(t){return t.vis}))}function ct(t){return t.filter((function(t){return!t.gap}))}function ut(t){return t.id}function ht(){return!1}}e.exports=function(t,e,n,i,l,c){var h,p,f=!l,m=!!l&&l.duration>0,g=u(t,e,n);(h=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(t,e,n){e.each((function(e){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,t);var l=e[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(t){l[t]=null})).remove(),u.order().each((function(t){l[t]=a(r.select(this),"path","js-fill")}))}))}(t,h,e),m?(c&&(p=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,g,this,l)}))}))):h.each((function(r,n){d(t,n,e,r,g,this,l)})),f&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),di=d({"src/traces/scatter/marker_colorbar.js"(t,e){e.exports={container:"marker",min:"cmin",max:"cmax"}}}),pi=d({"src/traces/scatter/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,e,"x"),s=r.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),fi=d({"src/traces/scatter/style.js"(t,e){var r=v(),n=Je(),i=Vt();function a(t,e,r){n.pointStyle(t.selectAll("path.point"),e,r)}function o(t,e,r){n.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=r.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){a(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){o(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(n.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),i.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:o,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,t),o(r,i,t))}}}}),mi=d({"src/traces/scatter/get_trace_color.js"(t,e){var r=q(),n=Ge();e.exports=function(t,e){var i,a;if("lines"===t.mode)return(i=t.line.color)&&r.opacity(i)?i:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(t.line||{}).color)&&r.opacity(i)&&n.hasLines(t)&&t.line.width?i:t.fillcolor}}}),gi=d({"src/traces/scatter/hover.js"(t,e){var r=se(),n=zr(),i=Vt(),a=mi(),o=q(),s=r.fillText;e.exports=function(t,e,l,c){var u=t.cd,h=u[0].trace,d=t.xa,p=t.ya,f=d.c2p(e),m=p.c2p(l),g=[f,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,b=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var _=function(t){var e=Math.max(v,t.mrc||0),r=d.c2p(t.x)-f,n=p.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},w=n.getDistanceFunction(c,(function(t){if(x){var e=d.c2p(t.xStart),r=d.c2p(t.xEnd);return f>=Math.min(e,r)&&f<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.x)-f);return a<n?i*a/n:a-n+i}),(function(t){if(b){var e=p.c2p(t.yStart),r=p.c2p(t.yEnd);return m>=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return a<n?i*a/n:a-n+i}),_);if(n.getClosest(u,w,t),!1!==t.index){var k=u[t.index],T=d.c2p(k.x,!0),S=p.c2p(k.y,!0),A=k.mrc||1;t.index=k.i;var M=u[0].t.orientation,C=M&&(k.sNorm||k.s),E="h"===M?C:void 0!==k.orig_x?k.orig_x:k.x,L="v"===M?C:void 0!==k.orig_y?k.orig_y:k.y;return r.extendFlat(t,{color:a(h,k),x0:T-A,x1:T+A,xLabelVal:E,y0:S-A,y1:S+A,yLabelVal:L,spikeDistance:_(k),hovertemplate:h.hovertemplate}),s(k,h,t),i.getComponentMethod("errorbars","hoverInfo")(k,h,t),[t]}}function P(t){if(!t)return!1;var e=t.node();try{var r=new DOMPoint(g[0],g[1]);return e.isPointInFill(r)}catch(i){var n=e.ownerSVGElement.createSVGPoint();return n.x=g[0],n.y=g[1],e.isPointInFill(n)}}if(-1!==y.indexOf("fills")&&h._fillElement&&P(h._fillElement)&&!P(h._fillExclusionElement)){var I=function(t){var e,r,n,i,a,o,s,l,c,u=[],h=1/0,f=-1/0,m=1/0,y=-1/0;for(e=0;e<t.length;e++){var v=t[e];v.contains(g)&&(u.push(v),m=Math.min(m,v.ymin),y=Math.max(y,v.ymax))}if(0===u.length)return null;for(r=((m=Math.max(m,0))+(y=Math.min(y,p._length)))/2,e=0;e<u.length;e++)for(i=u[e].pts,n=1;n<i.length;n++)(l=i[n-1][1])>r!==(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),f=Math.max(f,a)));return{x0:h=Math.max(h,0),x1:f=Math.min(f,d._length),y0:r,y1:r}}(h._polygons);null===I&&(I={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(t,{distance:t.maxHoverDistance,x0:I.x0,x1:I.x1,y0:I.y0,y1:I.y1,color:z,hovertemplate:!1}),delete t.index,h.text&&!r.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}}),yi=d({"src/traces/scatter/select.js"(t,e){var r=Ge();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===e)for(n=0;n<s.length;n++)s[n].selected=0;else for(n=0;n<s.length;n++)i=s[n],a=l.c2p(i.x),o=c.c2p(i.y),null!==i.i&&e.contains([a,o],!1,n,t)?(u.push({pointNumber:i.i,x:l.c2d(i.x),y:c.c2d(i.y)}),i.selected=1):i.selected=0;return u}}}),vi=d({"src/plots/cartesian/attributes.js"(t,e){e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}}),xi=d({"src/plots/cartesian/type_defaults.js"(t,e){var r=Vt().traceIs,n=er();function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function a(t,e){var n=i(t),a=r(t,"box-violin"),o=r(t._fullInput||{},"candlestick");return a&&!o&&e===n&&void 0===t[n]&&void 0===t[n+"0"]}e.exports=function(t,e,o,s){o("autotypenumbers",s.autotypenumbersDflt),"-"===o("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var o,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],d={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=t.autotypenumbers,a(c,l)){var p=i(c),f=[];for(o=0;o<e.length;o++){var m=e[o];r(m,"box-violin")&&(m[l+"axis"]||l)===s&&(void 0!==m[p]?f.push(m[p][0]):void 0!==m.name?f.push(m.name):f.push("text"),m[u]!==h&&(h=void 0))}t.type=n(f,h,d)}else if("splom"===c.type){var g=c.dimensions[c._axesDim[s]];g.visible&&(t.type=n(g.values,h,d))}else t.type=n(c[l]||[c[l+"0"]],h,d)}else t.type="linear"}}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}}}),bi=d({"src/plots/cartesian/category_order_defaults.js"(t,e){var r=M().isTypedArraySpec;e.exports=function(t,e,n,i){if("category"===e.type){var a,o=t.categoryarray,s=Array.isArray(o)&&o.length>0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),s||"array"!==c||(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var s=e.data[n];s[a+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var c=l[i];null!==c&&void 0!==c&&(o[c]=1)}}return Object.keys(o)}(e,i).sort(),"category ascending"===c?e._initialCategories=l:"category descending"===c&&(e._initialCategories=l.reverse()))}}}}),_i=d({"src/plots/cartesian/line_grid_defaults.js"(t,e){var r=O().mix,n=V(),i=se();e.exports=function(t,e,a,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(t,e,o.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");a("showline",o.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var h=l("gridcolor",r(s,o.bgColor,o.blend||n.lightFraction).toRgbString()),d=l("gridwidth"),p=l("griddash");if(a("showgrid",o.showGrid||!!h||!!d||!!p)||(delete e.gridcolor,delete e.gridwidth,delete e.griddash),o.hasMinor){var f=l("minor.gridcolor",r(e.gridcolor,o.bgColor,67).toRgbString()),m=l("minor.gridwidth",e.gridwidth||1),g=l("minor.griddash",e.griddash||"solid");a("minor.showgrid",!!f||!!m||!!g)||(delete e.minor.gridcolor,delete e.minor.gridwidth,delete e.minor.griddash)}if(!o.noZeroLine){var y=l("zerolinecolor",s),v=l("zerolinewidth");a("zeroline",o.showGrid||!!y||!!v)||(delete e.zerolinecolor,delete e.zerolinewidth)}}}}),wi=d({"src/plots/cartesian/axis_defaults.js"(t,e){var r=k(),n=Vt(),i=se(),a=ge(),o=Be(),s=Ee(),l=De(),c=Re(),u=je(),h=Ne(),d=bi(),p=_i(),f=ar(),m=tr(),g=ye().WEEKDAY_PATTERN,y=ye().HOUR_PATTERN;function v(t,e,n){function a(r,n){return i.coerce(t,e,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=b(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===n.autorange){var d=n.range;if(d[0]<d[1]){if(o[0]<d[0]&&o[1]>d[1])return void(e.enabled=!1)}else if(o[0]>d[0]&&o[1]<d[1])return void(e.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(e.enabled=!1);a("dvalue")}}}e.exports=function(t,e,r,y,x){var b,_=y.letter,w=y.font||{},k=y.splomStash||{},T=r("visible",!y.visibleDflt),S=e._template||{},A=e.type||S.type||"-";"date"===A&&(n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",y.calendar),y.noTicklabelmode||(b=r("ticklabelmode"))),y.noTicklabelindex||"date"!==A&&"linear"!==A||r("ticklabelindex");var M="";y.noTicklabelposition&&"multicategory"!==A||(M=i.coerce(t,e,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===b?["outside","inside"]:"x"===_?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),y.noTicklabeloverflow||r("ticklabeloverflow",-1!==M.indexOf("inside")?"hide past domain":"category"===A||"multicategory"===A?"allow":"hide past div"),m(e,x),f(t,e,r,y),d(t,e,r,y),"category"===A||y.noHover||r("hoverformat");var C=r("color"),E=C!==s.color.dflt?C:w.color,L=k.label||x._dfltTitle[_];if(h(t,e,r,A,y),!T)return e;r("title.text",L),i.coerceFont(r,"title.font",w,{overrideDflt:{size:i.bigFont(w.size),color:E}}),l(t,e,r,A);var P=y.hasMinor;if(P&&(a.newContainer(e,"minor"),l(t,e,r,A,{isMinor:!0})),u(t,e,r,A,y),c(t,e,r,y),P){var I=y.isMinor;y.isMinor=!0,c(t,e,r,y),y.isMinor=I}p(t,e,r,{dfltColor:C,bgColor:y.bgColor,showGrid:y.showGrid,hasMinor:P,attributes:s}),!P||e.minor.ticks||e.minor.showgrid||delete e.minor,(e.showline||e.ticks)&&r("mirror");var z,O="multicategory"===A;if(y.noTickson||"category"!==A&&!O||!e.ticks&&!e.showgrid||(O&&(z="boundaries"),"boundaries"===r("tickson",z)&&delete e.ticklabelposition),O&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===A)if(o(t,e,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),e.rangebreaks.length){for(var D=0;D<e.rangebreaks.length;D++)if(e.rangebreaks[D].pattern===g){e._hasDayOfWeekBreaks=!0;break}if(m(e,x),x._has("scattergl")||x._has("splom"))for(var R=0;R<y.data.length;R++){var F=y.data[R];"scattergl"!==F.type&&"splom"!==F.type||(F.visible=!1,i.warn(F.type+" traces do not work on axes with rangebreaks. Setting trace "+F.index+" to `visible: false`."))}}else delete e.rangebreaks;return e};var x={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function b(t){if("string"===typeof t)return x[t.substr(0,3).toLowerCase()]}}}),ki=d({"src/plots/cartesian/position_defaults.js"(t,e){var r=k(),n=se();e.exports=function(t,e,i,a){var o,s,l,c,u,h,d=a.counterAxes||[],p=a.overlayableAxes||[],f=a.letter,m=a.grid,g=a.overlayingDomain;m&&(s=m._domains[f][m._axisMap[e._id]],o=m._anchors[e._id],s&&(l=m[f+"side"].split(" ")[0],c=m.domain[f]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(r(t.position)?"free":d[0]||"free"),l=l||("x"===f?"bottom":"left"),c=c||0,u=0,h=!1;var y=n.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(d),dflt:o}},"anchor"),v=n.coerce(t,e,{side:{valType:"enumerated",values:"x"===f?["bottom","top"]:["left","right"],dflt:l}},"side");"free"===y&&("y"===f&&(i("autoshift")&&(c="left"===v?g[0]:g[1],h=!e.automargin||e.automargin,u="left"===v?-3:3),i("shift",u)),i("position",c)),i("automargin",h);var x=!1;if(p.length&&(x=n.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(p),dflt:!1}},"overlaying")),!x){var b=i("domain",s);b[0]>b[1]-1/4096&&(e.domain=s),n.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return i("layer"),e}}}),Ti=d({"src/plots/cartesian/layout_defaults.js"(t,e){var r=se(),n=q(),i=Ze().isUnifiedHover,a=Er(),o=ge(),s=jt(),l=Ee(),c=xi(),u=wi(),h=en(),d=ki(),p=ve(),f=p.id2name,m=p.name2id,g=ye().AX_ID_PATTERN,y=Vt(),v=y.traceIs,x=y.getComponentMethod;function b(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,y){var _,w,k=e.autotypenumbers,T={},S={},A={},M={},C={},E={},L={},P={},I={},z={};for(_=0;_<y.length;_++){var O=y[_];if(v(O,"cartesian")){var D,R;if(O.xaxis)D=f(O.xaxis),b(T,D,O);else if(O.xaxes)for(w=0;w<O.xaxes.length;w++)b(T,f(O.xaxes[w]),O);if(O.yaxis)R=f(O.yaxis),b(T,R,O);else if(O.yaxes)for(w=0;w<O.yaxes.length;w++)b(T,f(O.yaxes[w]),O);"funnel"===O.type?"h"===O.orientation?(D&&(S[D]=!0),R&&(L[R]=!0)):R&&(A[R]=!0):"image"===O.type?(R&&(P[R]=!0),D&&(P[D]=!0)):(R&&(C[R]=!0,E[R]=!0),v(O,"carpet")&&("carpet"!==O.type||O._cheater)||D&&(M[D]=!0)),"carpet"===O.type&&O._cheater&&D&&(S[D]=!0),v(O,"2dMap")&&(I[D]=!0,I[R]=!0),v(O,"oriented")&&(z["h"===O.orientation?R:D]=!0)}}var F=e._subplots,B=F.xaxis,j=F.yaxis,N=r.simpleMap(B,f),U=r.simpleMap(j,f),V=N.concat(U),q=n.background;B.length&&j.length&&(q=r.coerce(t,e,s,"plot_bgcolor"));var $,H,W,G,Y,Z=n.combine(q,e.paper_bgcolor);function X(){var t=T[$]||[];Y._traceIndices=t.map((function(t){return t.index})),Y._annIndices=[],Y._shapeIndices=[],Y._selectionIndices=[],Y._imgIndices=[],Y._subplotsWith=[],Y._counterAxes=[],Y._name=Y._attr=$,Y._id=H}function K(t,e){return r.coerce(G,Y,l,t,e)}function J(t,e){return r.coerce2(G,Y,l,t,e)}function Q(t){return"x"===t?j:B}function tt(e,r){for(var n="x"===e?N:U,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(m(o))}return i}var et={x:Q("x"),y:Q("y")},rt=et.x.concat(et.y),nt={},it=[];function at(){var t=G.matches;g.test(t)&&-1===rt.indexOf(t)&&(nt[t]=G.type,it=Object.keys(nt))}var ot=a(t,e),st=i(ot);for(_=0;_<V.length;_++){$=V[_],H=m($),W=$.charAt(0),r.isPlainObject(t[$])||(t[$]={}),G=t[$],Y=o.newContainer(e,$,W+"axis"),X();var lt="x"===W&&!M[$]&&S[$]||"y"===W&&!C[$]&&A[$],ct="y"===W&&(!E[$]&&L[$]||P[$]),ut={hasMinor:!0,letter:W,font:e.font,outerTicks:I[$],showGrid:!z[$],data:T[$]||[],bgColor:Z,calendar:e.calendar,automargin:!0,visibleDflt:lt,reverseDflt:ct,autotypenumbersDflt:k,splomStash:((e._splomAxes||{})[W]||{})[H],noAutotickangles:"y"===W};K("uirevision",e.uirevision),c(G,Y,K,ut),u(G,Y,K,ut,e);var ht=st&&W===ot.charAt(0),dt=J("spikecolor",st?Y.color:void 0),pt=J("spikethickness",st?1.5:void 0),ft=J("spikedash",st?"dot":void 0),mt=J("spikemode",st?"across":void 0),gt=J("spikesnap");K("showspikes",!!ht||!!dt||!!pt||!!ft||!!mt||!!gt)||(delete Y.spikecolor,delete Y.spikethickness,delete Y.spikedash,delete Y.spikemode,delete Y.spikesnap);var yt=f(G.overlaying),vt=[0,1];if(void 0!==e[yt]){var xt=f(e[yt].anchor);void 0!==e[xt]&&(vt=e[xt].domain)}d(G,Y,K,{letter:W,counterAxes:et[W],overlayableAxes:tt(W,$),grid:e.grid,overlayingDomain:vt}),K("title.standoff"),at(),Y._input=G}for(_=0;_<it.length;){H=it[_++],W=($=f(H)).charAt(0),r.isPlainObject(t[$])||(t[$]={}),G=t[$],Y=o.newContainer(e,$,W+"axis"),X();var bt={letter:W,font:e.font,outerTicks:I[$],showGrid:!z[$],data:[],bgColor:Z,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:k,splomStash:((e._splomAxes||{})[W]||{})[H]};K("uirevision",e.uirevision),Y.type=nt[H]||"linear",u(G,Y,K,bt,e),d(G,Y,K,{letter:W,counterAxes:et[W],overlayableAxes:tt(W,$),grid:e.grid}),K("fixedrange"),at(),Y._input=G}var _t=x("rangeslider","handleDefaults"),wt=x("rangeselector","handleDefaults");for(_=0;_<N.length;_++)$=N[_],G=t[$],Y=e[$],_t(t,e,$),"date"===Y.type&&wt(G,Y,e,U,Y.calendar),K("fixedrange");for(_=0;_<U.length;_++){$=U[_],G=t[$],Y=e[$];var kt=e[f(Y.anchor)];K("fixedrange",x("rangeslider","isVisible")(kt))}h.handleDefaults(t,e,{axIds:rt.concat(it).sort(p.idSort),axHasImage:P})}}}),Si=d({"src/plots/cartesian/transition_axes.js"(t,e){var r=v(),n=Vt(),i=se(),a=Je(),o=nr();e.exports=function(t,e,s,l){var c=t._fullLayout;if(0!==e.length){var u,h,d,p;l&&(u=l());var f=r.ease(s.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},i=0;i<e.length;i++){var a=e[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return n.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)}))}()})),h=Date.now(),p=window.requestAnimationFrame((function r(){d=Date.now();for(var i=Math.min(1,(d-h)/s.duration),a=f(i),o=0;o<e.length;o++)g(e[o],a);d-h>s.duration?(function(){for(var r={},i=0;i<e.length;i++){var a=e[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}u&&u(),n.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)}))}(),p=window.cancelAnimationFrame(r)):p=window.requestAnimationFrame(r)})),Promise.resolve()}function m(t){var e=t.xaxis,r=t.yaxis;c._defs.select("#"+t.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!e.xr1,d=!!e.yr1,p=[];if(h){var f=i.simpleMap(e.xr0,s.r2l),m=i.simpleMap(e.xr1,s.r2l),g=f[1]-f[0],y=m[1]-m[0];p[0]=(f[0]*(1-r)+r*m[0]-f[0])/(f[1]-f[0])*c,p[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(f[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(f[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(d){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?c/p[2]:1,k=d?u/p[3]:1,T=h?p[0]:0,S=d?p[1]:0,A=h?p[0]/p[2]*c:0,M=d?p[1]/p[3]*u:0,C=s._offset-A,E=l._offset-M;n.clipRect.call(a.setTranslate,T,S).call(a.setScale,1/w,1/k),n.plot.call(a.setTranslate,C,E).call(a.setScale,w,k),a.setPointGroupScale(n.zoomScalePts,1/w,1/k),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}o.redrawComponents(t)}}}),Ai=d({"src/plots/cartesian/index.js"(t){var e=v(),r=Vt(),n=se(),i=ke(),a=Je(),o=_e().getModuleCalcData,s=ve(),l=ye(),c=Te(),u=n.ensureSingle;function h(t,e,r){return n.ensureSingle(t,e,r,(function(t){t.datum(r)}))}var d=l.zindexSeparator;function p(t,n,i,s,c){for(var u,h,d,p=l.traceLayerClasses,f=t._fullLayout,m=f._zindices,g=f._modules,y=[],v=[],x=0;x<m.length;x++)for(var b=m[x],_=0;_<g.length;_++){var w=(u=g[_]).name,k=r.modules[w].categories;if(k.svg){var T=u.layerName||w+"layer",S=T+(x?Number(x)+1:""),A=u.plot;d=(h=o(i,A,b))[0],i=h[1],d.length&&y.push({i:p.indexOf(T),zindex:x,className:S,plotMethod:A,cdModule:d}),k.zoomScale&&v.push("."+S)}}y.sort((function(t,e){return(t.zindex||0)-(e.zindex||0)||t.i-e.i}));var M=n.plot.selectAll("g.mlayer").data(y,(function(t){return t.className}));if(M.enter().append("g").attr("class",(function(t){return t.className})).classed("mlayer",!0).classed("rangeplot",n.isRangePlot),M.exit().remove(),M.order(),M.each((function(r){var i=e.select(this),o=r.className;r.plotMethod(t,n,r.cdModule,i,s,c),-1===l.clipOnAxisFalseQuery.indexOf("."+o)&&a.setClipUrl(i,n.layerClipId,t)})),f._has("scattergl")&&(u=r.getModule("scattergl"),d=o(i,u)[0],u.plot(t,n,d)),!t._context.staticPlot&&(n._hasClipOnAxisFalse&&(n.clipOnAxisFalseTraces=n.plot.selectAll(l.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),v.length)){var C=n.plot.selectAll(v.join(",")).selectAll(".trace");n.zoomScalePts=C.selectAll("path.point"),n.zoomScaleTxt=C.selectAll(".textpoint")}}function f(t,e){var r=t._fullLayout,n=e.plotgroup,i=e.id,a=-1!==i.indexOf(d),o=l.layerValue2layerClass[e.xaxis.layer],c=l.layerValue2layerClass[e.yaxis.layer],p=r._hasOnlyLargeSploms,f=r._zindices.length>1,m=e.mainplotinfo;if(!e.mainplot||f)if(p)e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.xaxislayer=u(n,"g","xaxislayer-above"),e.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");e.shapelayer=u(g,"g","shapelayer"),e.imagelayer=u(g,"g","imagelayer"),m&&f?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=u(n,"g","minor-gridlayer"),e.gridlayer=u(n,"g","gridlayer"),e.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");e.shapelayerBetween=u(y,"g","shapelayer"),e.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),e.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),e.overaxesBelow=u(n,"g","overaxes-below")}e.overplot=u(n,"g","overplot"),e.plot=u(e.overplot,"g",i),a||(e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),e.overaxesAbove=u(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+c),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",b=i+"-y";e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",b),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",b),e.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",b),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",b),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+c).select("."+b),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+c).select("."+b)}a||(p||(h(e.minorGridlayer,"g",e.xaxis._id),h(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort),h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function m(t,r){if(t){var n={};for(var i in t.each((function(t){var i=t[0];e.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];n[s.id]&&s.plot.selectAll(".trace").remove()}}}function g(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}t.name="cartesian",t.attr=["xaxis","yaxis"],t.idRoot=["x","y"],t.idRegex=l.idRegex,t.attrRegex=l.attrRegex,t.attributes=vi(),t.layoutAttributes=Ee(),t.supplyLayoutDefaults=Ti(),t.transitionAxes=Si(),t.finalizeSubplots=function(t,e){var r,i,a,o=e._subplots,c=o.xaxis,u=o.yaxis,h=o.cartesian,d=h,p={},f={};for(r=0;r<d.length;r++){var m=d[r].split("y");p[m[0]]=1,f["y"+m[1]]=1}for(r=0;r<c.length;r++)p[i=c[r]]||(a=(t[s.id2name(i)]||{}).anchor,l.idRegex.y.test(a)||(a="y"),h.push(i+a),d.push(i+a),f[a]||(f[a]=1,n.pushUnique(u,a)));for(r=0;r<u.length;r++)f[a=u[r]]||(i=(t[s.id2name(a)]||{}).anchor,l.idRegex.x.test(i)||(i="x"),h.push(i+a),d.push(i+a),p[i]||(p[i]=1,n.pushUnique(c,i)));if(!d.length){for(var g in i="",a="",t)l.attrRegex.test(g)&&("x"===g.charAt(0)?(!i||+g.substr(5)<+i.substr(5))&&(i=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g));i=i?s.name2id(i):"x",a=a?s.name2id(a):"y",c.push(i),u.push(a),h.push(i+a)}},t.plot=function(t,e,r,i){var a,o=t._fullLayout,s=o._subplots.cartesian,l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(var c=o._zindices,u=0;u<c.length;u++){var h=c[u];for(a=0;a<s.length;a++){var f=s[a],m=o._plots[f];if(u>0){var g=m.id;if(-1!==g.indexOf(d))continue;g+=d+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x<l.length;x++){var b=l[x],_=b[0].trace;h===(_.zorder||0)&&_.xaxis+_.yaxis===f&&((-1!==e.indexOf(_.index)||_.carpet)&&(y&&y[0].trace.xaxis+y[0].trace.yaxis===f&&-1!==["tonextx","tonexty","tonext"].indexOf(_.fill)&&-1===v.indexOf(y)&&v.push(y),v.push(b)),y=b)}p(t,m,v,r,i)}}},t.clean=function(t,e,r,n){var i,a,o,l=n._plots||{},c=e._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in l)(i=l[o]).plotgroup&&i.plotgroup.remove();var h=n._has&&n._has("gl"),p=e._has&&e._has("gl");if(h&&!p)for(o in l)(i=l[o])._scene&&i._scene.destroy();if(u.xaxis&&u.yaxis){var f=s.listIds({_fullLayout:n});for(a=0;a<f.length;a++){var y=f[a];e[s.id2name(y)]||n._infolayer.selectAll(".g-"+y+"title").remove()}}var v=n._has&&n._has("cartesian"),x=e._has&&e._has("cartesian");if(v&&!x)m(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(u.cartesian)for(a=0;a<u.cartesian.length;a++){var b=u.cartesian[a];if(-1===b.indexOf(d)&&!c[b]){var _="."+b+",."+b+"-x,."+b+"-y";n._cartesianlayer.selectAll(_).remove(),g(b,n)}}},t.drawFramework=function(t){var r,i=t._fullLayout,a=t.calcdata,o={};for(r=0;r<a.length;r++){var s=a[r][0],l=s.trace.zorder||0;o[l]||(o[l]=[]),o[l].push(s)}var c=Object.keys(o).map(Number).sort(n.sorterAsc);c.length||(c=[0]),i._zindices=c;var h=function(t){var e,r,n,i,a,o,s=t._fullLayout,l=s._zindices.length,c=s._subplots.cartesian,u=c.length,h=[],p=[];for(e=0;e<u;e++){n=c[e],a=(i=s._plots[n]).xaxis,o=i.yaxis;var f=a._mainAxis,m=o._mainAxis,g=f._id+m._id,y=s._plots[g];i.overlays=[],g!==n&&y?(i.mainplot=g,i.mainplotinfo=y,p.push(n)):(i.mainplot=void 0,i.mainplotinfo=void 0,h.push(n))}for(e=0;e<p.length;e++)n=p[e],(i=s._plots[n]).mainplotinfo.overlays.push(i);var v=h.concat(p),x=[];for(e=0;e<u;e++){n=v[e],a=(i=s._plots[n]).xaxis,o=i.yaxis;for(var b=[],_=1;_<=l;_++){var w="";for(_>1&&(w+=d+_),b.push(n+w),r=0;r<i.overlays.length;r++)b.push(i.overlays[r].id+w)}b=b.concat([a.layer,o.layer,a.overlaying||"",o.overlaying||""]),x.push(b)}return x}(t),p=h.length,g=[];for(r=0;r<p;r++)g[r]=h[r].slice();for(var y=1;y<c.length;y++){var v=[];for(r=0;r<p;r++)v[r]=h[r].slice(),v[r][0]+=d+(y+1);g=g.concat(v)}var x=i._cartesianlayer.selectAll(".subplot").data(g,String);x.enter().append("g").attr("class",(function(t){return"subplot "+t[0]})),x.order(),x.exit().call(m,i),x.each((function(r){var a=r[0],o=a.indexOf(d),s=-1!==o,l=s?a.slice(0,o):a,c=i._plots[a];c||(c=n.extendFlat({},i._plots[l]))&&(c.id=a,i._plots[a]=c,i._subplots.cartesian.push(a)),c&&(c.plotgroup=e.select(this),f(t,c),s||(c.draglayer=u(i._draggers,"g",a)))}))},t.rangePlot=function(t,e,r){f(t,e),p(t,e,r),i.style(t)},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter((function(t,e){return e===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:c.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})}))},t.updateFx=En().updateFx}}),Mi=d({"src/traces/scatter/index.js"(t,e){var r=Ge();e.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:wn(),layoutAttributes:be(),supplyDefaults:Kn(),crossTraceDefaults:Qn(),supplyLayoutDefaults:ti(),calc:ai().calc,crossTraceCalc:li(),arraysToCalcdata:ni(),plot:hi(),colorbar:di(),formatLabels:pi(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:gi(),selectPoints:yi(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ai(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}}),Ci=d({"src/components/annotations/draw_arrow_head.js"(t,e){var r=v(),n=q(),i=yn(),a=se(),o=a.strScale,s=a.strRotate,l=a.strTranslate;e.exports=function(t,e,a){var c,u,h,d,p=t.node(),f=i[a.arrowhead||0],m=i[a.startarrowhead||0],g=(a.arrowwidth||1)*(a.arrowsize||1),y=(a.arrowwidth||1)*(a.startarrowsize||1),v=e.indexOf("start")>=0,x=e.indexOf("end")>=0,b=f.backoff*g+a.standoff,_=m.backoff*y+a.startstandoff;if("line"===p.nodeName){c={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=c.x-u.x,k=c.y-u.y;if(d=(h=Math.atan2(k,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+k*k))return void O();if(b){if(b*b>w*w+k*k)return void O();var T=b*Math.cos(h),S=b*Math.sin(h);u.x+=T,u.y+=S,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+k*k)return void O();var A=_*Math.cos(h),M=_*Math.sin(h);c.x-=A,c.y-=M,t.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var C=p.getTotalLength(),E="";if(C<b+_)return void O();var L=p.getPointAtLength(0),P=p.getPointAtLength(.1);h=Math.atan2(L.y-P.y,L.x-P.x),c=p.getPointAtLength(Math.min(_,C)),E="0px,"+_+"px,";var I=p.getPointAtLength(C),z=p.getPointAtLength(C-.1);d=Math.atan2(I.y-z.y,I.x-z.x),u=p.getPointAtLength(Math.max(0,C-b)),E+=C-(E?_+b:b)+"px,"+C+"px",t.style("stroke-dasharray",E)}function O(){t.style("stroke-dasharray","0px,100px")}function D(e,i,c,u){e.path&&(e.noRotate&&(c=0),r.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&D(m,c,h,y),x&&D(f,u,d,g)}}}),Ei=d({"src/components/annotations/draw.js"(t,e){var r=v(),n=Vt(),i=ke(),a=se(),o=a.strTranslate,s=nr(),l=q(),c=Je(),u=zr(),h=Ae(),d=dr(),p=hr(),f=ge().arrayEditor,m=Ci();function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function y(t,e,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/u}function x(t,e,i,g,v,x){var b,_,w=t._fullLayout,k=t._fullLayout._size,T=t._context.edits;g?(b="annotation-"+g,_=g+".annotations"):(b="annotation",_="annotations");var S=f(t.layout,_,e),A=S.modifyBase,M=S.modifyItem,C=S.getUpdateObj;w._infolayer.selectAll("."+b+'[data-index="'+i+'"]').remove();var E="clip"+w._uid+"_ann"+i;if(e._input&&!1!==e.visible){var L={x:{},y:{}},P=+e.textangle||0,I=w._infolayer.append("g").classed(b,!0).attr("data-index",String(i)).style("opacity",e.opacity),z=I.append("g").classed("annotation-text-g",!0),O=T[e.showarrow?"annotationTail":"annotationPosition"],D=e.captureevents||T.annotationText||O,R=z.append("g").style("pointer-events",D?"all":null).call(d,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",W(r.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,B=e.borderpad,j=F+B,N=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+E).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",E).append("rect"),V.exit().remove();var q=e.font,$=w._meta?a.templateString(e.text,w._meta):e.text,H=R.append("text").classed("annotation-text",!0).text($);T.annotationText?H.call(h.makeEditable,{delegate:R,gd:t}).call(G).on("edit",(function(r){e.text=r,this.call(G),M("text",r),v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0),n.call("_guiRelayout",t,C())})):H.call(G)}else r.selectAll("#"+E).remove();function W(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function G(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Y),r}function Y(){var r=H.selectAll("a");1===r.size()&&r.text()===H.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),f=c.bBox((u?i:H).node()),b=f.width,_=f.height,S=e.width||b,D=e.height||_,B=Math.round(S+2*j),q=Math.round(D+2*j);function $(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var G=!1,Y=["x","y"],Z=0;Z<Y.length;Z++){var X,K,J,Q,tt,et=Y[Z],rt=e[et+"ref"]||et,nt=e["a"+et+"ref"],it={x:v,y:x}[et],at=(P+("x"===et?0:-90))*Math.PI/180,ot=B*Math.cos(at),st=q*Math.sin(at),lt=Math.abs(ot)+Math.abs(st),ct=e[et+"anchor"],ut=e[et+"shift"]*("x"===et?1:-1),ht=L[et],dt=s.getRefType(rt);if(it&&"domain"!==dt){var pt=it.r2fraction(e[et]);(pt<0||pt>1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(G=!0):G=!0),X=it._offset+it.r2p(e[et]),Q=.5}else{var ft="domain"===dt;"x"===et?(J=e[et],X=ft?it._offset+it._length*J:X=k.l+k.w*J):(J=1-e[et],X=ft?it._offset+it._length*J:X=k.t+k.h*J),Q=e.showarrow?.5:J}if(e.showarrow){ht.head=X;var mt=e["a"+et];if(tt=ot*$(.5,e.xanchor)-st*$(.5,e.yanchor),nt===rt){var gt=s.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=k.t+k.h*mt):ht.tail=k.l+k.w*mt:ht.tail=it._offset+it.r2p(mt),K=tt}else ht.tail=X+mt,K=tt+mt;ht.text=ht.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else K=tt=lt*$(Q,ct),ht.text=X+tt;ht.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(G)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(S-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),u)i.select("svg").attr({x:j+bt-1,y:j+_t}).call(c.setClipUrl,U?E:null,t);else{var wt=j+_t-f.top,kt=j+bt-f.left;H.call(h.positionText,kt,wt).call(c.setClipUrl,U?E:null,t)}V.select("rect").call(c.setRect,j,j,S,D),N.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(L.x.text-B/2),Math.round(L.y.text-q/2)),z.attr({transform:"rotate("+P+","+L.x.text+","+L.y.text+")"});var Tt,St=function(r,i){I.selectAll(".annotation-arrow-g").remove();var s=L.x.head,u=L.y.head,h=L.x.tail+r,d=L.y.tail+i,f=L.x.text+r,b=L.y.text+i,_=a.rotationXYMatrix(P,f,b),w=a.apply2DTransform(_),S=a.apply2DTransform2(_),E=+N.attr("width"),O=+N.attr("height"),D=f-.5*E,F=D+E,B=b-.5*O,j=B+O,U=[[D,B,D,j],[D,j,F,j],[F,j,F,B],[F,B,D,B]].map(S);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(h,d,s,u,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,$=e.arrowside,H=I.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),W=H.append("path").attr("d","M"+h+","+d+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,$,e),T.annotationPosition&&W.node().parentNode&&!g){var G=s,Y=u;if(e.standoff){var Z=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-d,2));G+=e.standoff*(h-s)/Z,Y+=e.standoff*(d-u)/Z}var X,K,J=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(d-Y),transform:o(G,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);X=t.x,K=t.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(X,K),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),M("x",y(v,t,"x",k,e)),M("y",y(x,r,"y",k,e)),e.axref===e.xref&&M("ax",y(v,t,"ax",k,e)),e.ayref===e.yref&&M("ay",y(x,r,"ay",k,e)),H.attr("transform",o(t,r)),z.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&St(0,0),O&&p.init({element:R.node(),gd:t,prepFn:function(){Tt=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?M("ax",y(v,t,"ax",k,e)):M("ax",e.ax+t),e.ayref===e.yref?M("ay",y(x,r,"ay",k.w,e)):M("ay",e.ay+r),St(t,r);else{if(g)return;var i,a;if(v)i=y(v,t,"x",k,e);else{var s=e._xsize/k.w,l=e.x+(e._xshift-e.xshift)/k.w-s/2;i=p.align(l+t/k.w,s,0,1,e.xanchor)}if(x)a=y(x,r,"y",k,e);else{var c=e._ysize/k.h,u=e.y-(e._yshift+e.yshift)/k.h-c/2;a=p.align(u-r/k.h,c,0,1,e.yanchor)}M("x",i),M("y",a),v&&x||(n=p.getCursor(v?.5:i,x?.5:a,e.xanchor,e.yanchor))}z.attr({transform:o(t,r)+Tt}),d(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(n))},doneFn:function(){d(R),n.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&g(t,r);return i.previousPromises(t)},drawOne:g,drawRaw:x}}}),Li=d({"src/components/annotations/click.js"(t,e){var r=se(),n=Vt(),i=ge().arrayEditor;function a(t,e){var r,n,i,a,s,l,c,u=t._fullLayout.annotations,h=[],d=[],p=[],f=(e||[]).length;for(r=0;r<u.length;r++)if(a=(i=u[r]).clicktoshow){for(n=0;n<f;n++)if(l=(s=e[n]).xaxis,c=s.yaxis,l._id===i.xref&&c._id===i.yref&&l.d2r(s.x)===o(i._xclick,l)&&c.d2r(s.y)===o(i._yclick,c)){(i.visible?"onout"===a?d:p:h).push(r);break}n===f&&i.visible&&"onout"===a&&d.push(r)}return{on:h,off:d,explicitOff:p}}function o(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var o,s,l=a(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},d=t._fullLayout.annotations;if(c.length||u.length){for(o=0;o<c.length;o++)(s=i(t.layout,"annotations",d[c[o]])).modifyItem("visible",!0),r.extendFlat(h,s.getUpdateObj());for(o=0;o<u.length;o++)(s=i(t.layout,"annotations",d[u[o]])).modifyItem("visible",!1),r.extendFlat(h,s.getUpdateObj());return n.call("update",t,{},h)}}}}}),Pi=d({"src/components/annotations/common_defaults.js"(t,e){var r=se(),n=q();e.exports=function(t,e,i,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=n.opacity(s);a("borderpad");var c=a("borderwidth"),u=a("showarrow");if(a("text",u?" ":i._dfltTitle.annotation),a("textangle"),r.coerceFont(a,"font",i.font),a("width"),a("align"),a("height")&&a("valign"),u){var h,d,p=a("arrowside");-1!==p.indexOf("end")&&(h=a("arrowhead"),d=a("arrowsize")),-1!==p.indexOf("start")&&(a("startarrowhead",h),a("startarrowsize",d)),a("arrowcolor",l?e.bordercolor:n.defaultLine),a("arrowwidth",2*(l&&c||1)),a("standoff"),a("startstandoff")}var f=a("hovertext"),m=i.hoverlabel||{};if(f){var g=a("hoverlabel.bgcolor",m.bgcolor||(n.opacity(o)?n.rgb(o):n.defaultLine)),y=a("hoverlabel.bordercolor",m.bordercolor||n.contrast(g)),v=r.extendFlat({},m.font);v.color||(v.color=y),r.coerceFont(a,"hoverlabel.font",v)}a("captureevents",!!f)}}}),Ii=d({"src/components/annotations/defaults.js"(t,e){var r=se(),n=nr(),i=Be(),a=Pi(),o=xn();function s(t,e,i){function s(n,i){return r.coerce(t,e,o,n,i)}var l=s("visible"),c=s("clicktoshow");if(l||c){a(t,e,i,s);for(var u=e.showarrow,h=["x","y"],d=[-10,-30],p={_fullLayout:i},f=0;f<2;f++){var m=h[f],g=n.coerceRef(t,e,p,m,"","paper");if("paper"!==g&&n.getFromId(p,g)._annIndices.push(e._index),n.coercePosition(e,p,s,g,m,.5),u){var y="a"+m,v=n.coerceRef(t,e,p,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=e[y]="pixel");var x="pixel"===v?d[f]:.4;n.coercePosition(e,p,s,v,y,x)}s(m+"anchor"),s(m+"shift")}if(r.noneOrAll(t,e,["x","y"]),u&&r.noneOrAll(t,e,["ax","ay"]),c){var b=s("xclick"),_=s("yclick");e._xclick=void 0===b?e.x:n.cleanPosition(b,p,e.xref),e._yclick=void 0===_?e.y:n.cleanPosition(_,p,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:s})}}}),zi=d({"src/components/annotations/calc_autorange.js"(t,e){var r=se(),n=nr(),i=Ei().draw;function a(t){var e=t._fullLayout;r.filterVisible(e.annotations).forEach((function(e){var r=n.getFromId(t,e.xref),i=n.getFromId(t,e.yref),a=n.getRefType(e.xref),s=n.getRefType(e.yref);e._extremes={},"range"===a&&o(e,r),"range"===s&&o(e,i)}))}function o(t,e){var r,i=e._id,a=i.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],h=t["_"+a+"padminus"],d={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,f=p+d,m=p-d,g=3*t.startarrowsize*t.arrowwidth||0,y=g+d,v=g-d;if(c===l){var x=n.findExtremes(e,[e.r2c(o)],{ppadplus:f,ppadminus:m}),b=n.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(h,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=n.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,f,y),ppadminus:Math.max(h,m,v)});t._extremes[i]=r}e.exports=function(t){var e=t._fullLayout;if(r.filterVisible(e.annotations).length&&t._fullData.length)return r.syncOrAsync([i,a],t)}}}),Oi=d({"src/components/annotations/convert_coords.js"(t,e){var r=k(),n=P();e.exports=function(t,e,i,a){e=e||{};var o="log"===i&&"linear"===e.type,s="linear"===i&&"log"===e.type;if(o||s)for(var l,c,u=t._fullLayout.annotations,h=e._id.charAt(0),d=0;d<u.length;d++)l=u[d],c="annotations["+d+"].",l[h+"ref"]===e._id&&p(h),l["a"+h+"ref"]===e._id&&p("a"+h);function p(t){var i=l[t],s=null;s=o?n(i,e.range):Math.pow(10,i),r(s)||(s=null),a(c+t,s)}}}}),Di=d({"src/components/annotations/index.js"(t,e){var r=Ei(),n=Li();e.exports={moduleType:"component",name:"annotations",layoutAttributes:xn(),supplyLayoutDefaults:Ii(),includeBasePlot:An()("annotations"),calcAutorange:zi(),draw:r.draw,drawOne:r.drawOne,drawRaw:r.drawRaw,hasClickToShow:n.hasClickToShow,onClick:n.onClick,convertCoords:Oi()}}}),Ri=d({"src/components/annotations3d/attributes.js"(t,e){var r=xn(),n=Pt().overrideAll,i=ge().templatedArray;e.exports=n(i("annotation",{visible:r.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:r.xanchor,xshift:r.xshift,yanchor:r.yanchor,yshift:r.yshift,text:r.text,textangle:r.textangle,font:r.font,width:r.width,height:r.height,opacity:r.opacity,align:r.align,valign:r.valign,bgcolor:r.bgcolor,bordercolor:r.bordercolor,borderpad:r.borderpad,borderwidth:r.borderwidth,showarrow:r.showarrow,arrowcolor:r.arrowcolor,arrowhead:r.arrowhead,startarrowhead:r.startarrowhead,arrowside:r.arrowside,arrowsize:r.arrowsize,startarrowsize:r.startarrowsize,arrowwidth:r.arrowwidth,standoff:r.standoff,startstandoff:r.startstandoff,hovertext:r.hovertext,hoverlabel:r.hoverlabel,captureevents:r.captureevents}),"calc","from-root")}}),Fi=d({"src/components/annotations3d/defaults.js"(t,e){var r=se(),n=nr(),i=Be(),a=Pi(),o=Ri();function s(t,e,i,s){function l(n,i){return r.coerce(t,e,o,n,i)}function c(t){var r=t+"axis",a={_fullLayout:{}};return a._fullLayout[r]=i[r],n.coercePosition(e,a,l,t,t,.5)}l("visible")&&(a(t,e,s.fullLayout,l),c("x"),c("y"),c("z"),r.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),r.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}}}),Bi=d({"src/components/annotations3d/convert.js"(t,e){var r=se(),n=nr();function i(t,e){var i=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},r.extendFlat(t._xa,o),n.setConvert(t._xa),t._xa._offset=a.l+i.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(i.x[1]-i.x[0])},t._ya={},r.extendFlat(t._ya,o),n.setConvert(t._ya),t._ya._offset=a.t+(1-i.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(i.y[1]-i.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}}}),ji=d({"src/plots/gl3d/project.js"(t,e){function r(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}e.exports=function(t,e){return r(t.projection,r(t.view,r(t.model,[e[0],e[1],e[2],1])))}}}),Ni=d({"src/components/annotations3d/draw.js"(t,e){var r=Ei().drawRaw,n=ji(),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,a=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],c=!1,u=0;u<3;u++){var h=i[u],d=l[h],p=e[h+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=n(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*a[0],e.yaxis.r2l(l.y)*a[1],e.zaxis.r2l(l.z)*a[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}}}),Ui=d({"src/components/annotations3d/index.js"(t,e){var r=Vt(),n=se();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Ri()}}},layoutAttributes:Ri(),handleDefaults:Fi(),includeBasePlot:function(t,e){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(t[l].annotations||[]).length&&(n.pushUnique(e._basePlotModules,i),n.pushUnique(e._subplots.gl3d,l))}},convert:Bi(),draw:Ni()}}}),Vi=d({"src/components/shapes/attributes.js"(t,e){var r=xn(),n=R(),i=wn().line,a=It().dash,o=D().extendFlat,s=ge().templatedArray,l=(vn(),N()),c=Ot().shapeTexttemplateAttrs,u=Dt();e.exports=s("shape",{visible:o({},l.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:o({},l.legend,{editType:"calc+arraydraw"}),legendgroup:o({},l.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:o({},l.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:n({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:o({},l.legendrank,{editType:"calc+arraydraw"}),legendwidth:o({},l.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:o({},r.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:o({},r.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(u)}),font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}}),qi=d({"src/components/shapes/defaults.js"(t,e){var r=se(),n=nr(),i=Be(),a=Vi(),o=qr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}if(e._isShape=!0,s("visible")){s("showlegend")&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),r.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var l=s("path"),c=s("type",l?"path":"rect"),u="path"!==c;u&&delete e.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule"),s("line.width")&&(s("line.color"),s("line.dash"));for(var h=s("xsizemode"),d=s("ysizemode"),p=["x","y"],f=0;f<2;f++){var m,g,y,v=p[f],x=v+"anchor",b="x"===v?h:d,_={_fullLayout:i},w=n.coerceRef(t,e,_,v,void 0,"paper");if("range"===n.getRefType(w)?((m=n.getFromId(_,w))._shapeIndices.push(e._index),y=o.rangeToShapePosition(m),g=o.shapePositionToRange(m),"category"!==m.type&&"multicategory"!==m.type||(s(v+"0shift"),s(v+"1shift"))):g=y=r.identity,u){var k=v+"0",T=v+"1",S=t[k],A=t[T];t[k]=g(t[k],!0),t[T]=g(t[T],!0),"pixel"===b?(s(k,0),s(T,10)):(n.coercePosition(e,_,s,w,k,.25),n.coercePosition(e,_,s,w,T,.75)),e[k]=y(e[k]),e[T]=y(e[T]),t[k]=S,t[T]=A}if("pixel"===b){var M=t[x];t[x]=g(t[x],!0),n.coercePosition(e,_,s,w,x,.25),e[x]=y(e[x]),t[x]=M}}u&&r.noneOrAll(t,e,["x0","x1","y0","y1"]);var C,E,L="line"===c;if(u&&(C=s("label.texttemplate")),C||(E=s("label.text")),E||C){s("label.textangle");var P=s("label.textposition",L?"middle":"middle center");s("label.xanchor"),s("label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(L,P)),s("label.padding"),r.coerceFont(s,"label.font",i.font)}}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:s})}}}),$i=d({"src/components/shapes/draw_newshape/defaults.js"(t,e){var r=q(),n=se();e.exports=function(t,e,i){if(i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),n.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity"),i("newshape.line.width")){var a=(t||{}).plot_bgcolor||"#FFF";i("newshape.line.color",r.contrast(a)),i("newshape.line.dash")}var o="drawline"===t.dragmode,s=i("newshape.label.text"),l=i("newshape.label.texttemplate");if(s||l){i("newshape.label.textangle");var c=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(o,c)),i("newshape.label.padding"),n.coerceFont(i,"newshape.label.font",e.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}}),Hi=d({"src/components/shapes/calc_autorange.js"(t,e){var r=se(),n=nr(),i=Vr(),a=qr();function o(t){return l(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function s(t){return l(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function l(t,e,n,o,s,l){var c=t/2,u=l;if("pixel"===e){var h=s?a.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[n,o],d=r.aggNums(Math.max,null,h),p=r.aggNums(Math.min,null,h),f=p<0?Math.abs(p)+c:c,m=d>0?d+c:c;return{ppad:c,ppadplus:u?f:m,ppadminus:u?m:f}}return{ppad:c}}function c(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(e.path){var d,p,f,m,g=1/0,y=-1/0,v=e.path.match(i.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),d=0;d<v.length;d++)void 0!==(p=r[v[d].charAt(0)].drawn)&&(!(f=v[d].substr(1).match(i.paramRE))||f.length<p||((m=h(f[p]))<g&&(g=m),m>y&&(y=m)));return y>=g?[g,y]:void 0}}e.exports=function(t){var e=t._fullLayout,a=r.filterVisible(e.shapes);if(a.length&&t._fullData.length)for(var l=0;l<a.length;l++){var u,h,d=a[l];d._extremes={};var p=n.getRefType(d.xref),f=n.getRefType(d.yref);"paper"!==d.xref&&"domain"!==p&&(h=c(u=n.getFromId(t,d.xref),d,i.paramIsX))&&(d._extremes[u._id]=n.findExtremes(u,h,o(d))),"paper"!==d.yref&&"domain"!==f&&(h=c(u=n.getFromId(t,d.yref),d,i.paramIsY))&&(d._extremes[u._id]=n.findExtremes(u,h,s(d)))}}}}),Wi=d({"src/components/shapes/index.js"(t,e){var r=Wr();e.exports={moduleType:"component",name:"shapes",layoutAttributes:Vi(),supplyLayoutDefaults:qi(),supplyDrawNewShapeDefaults:$i(),includeBasePlot:An()("shapes"),calcAutorange:Hi(),draw:r.draw,drawOne:r.drawOne}}}),Gi=d({"src/components/images/attributes.js"(t,e){var r=ye(),n=ge().templatedArray;vn(),e.exports=n("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),Yi=d({"src/components/images/defaults.js"(t,e){var r=se(),n=nr(),i=Be(),a=Gi();function o(t,e,i){function o(n,i){return r.coerce(t,e,a,n,i)}var s=o("source");if(!o("visible",!!s))return e;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:i},c=["x","y"],u=0;u<2;u++){var h=c[u],d=n.coerceRef(t,e,l,h,"paper",void 0);"paper"!==d&&n.getFromId(l,d)._imgIndices.push(e._index),n.coercePosition(e,l,o,d,h,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:o})}}}),Zi=d({"src/components/images/draw.js"(t,e){var r=v(),n=Je(),i=nr(),a=ve(),o=Te();e.exports=function(t){var e,s,l=t._fullLayout,c=[],u={},h=[];for(s=0;s<l.images.length;s++){var d=l.images[s];if(d.visible)if("below"===d.layer&&"paper"!==d.xref&&"paper"!==d.yref){e=a.ref2id(d.xref)+a.ref2id(d.yref);var p=l._plots[e];if(!p){h.push(d);continue}p.mainplot&&(e=p.mainplot.id),u[e]||(u[e]=[]),u[e].push(d)}else"above"===d.layer?c.push(d):h.push(d)}var f={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(e){var n=r.select(this);if(this._imgSrc!==e.source)if(n.attr("xmlns",o.svg),!t._context.staticPlot||e.source&&"data:"===e.source.slice(0,5))n.attr("xlink:href",e.source),this._imgSrc=e.source;else{var i=new Promise(function(t){var r=new Image;function i(){n.remove(),t()}this.img=r,r.setAttribute("crossOrigin","anonymous"),r.onerror=i,r.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d",{willReadFrequently:!0}).drawImage(this,0,0);var r=e.toDataURL("image/png");n.attr("xlink:href",r),t()},n.on("error",i),r.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(i)}}function y(e){var a,o,s=r.select(this),c=i.getFromId(t,e.xref),u=i.getFromId(t,e.yref),h="domain"===i.getRefType(e.xref),d="domain"===i.getRefType(e.yref),p=l._size;a=void 0!==c?"string"===typeof e.xref&&h?c._length*e.sizex:Math.abs(c.l2p(e.sizex)-c.l2p(0)):e.sizex*p.w,o=void 0!==u?"string"===typeof e.yref&&d?u._length*e.sizey:Math.abs(u.l2p(e.sizey)-u.l2p(0)):e.sizey*p.h;var g,y,v=a*f[e.xanchor].offset,x=o*m[e.yanchor].offset,b=f[e.xanchor].sizing+m[e.yanchor].sizing;switch(g=void 0!==c?"string"===typeof e.xref&&h?c._length*e.x+c._offset:c.r2p(e.x)+c._offset:e.x*p.w+p.l,g+=v,y=void 0!==u?"string"===typeof e.yref&&d?u._length*(1-e.y)+u._offset:u.r2p(e.y)+u._offset:p.h-e.y*p.h+p.t,y+=x,e.sizing){case"fill":b+=" slice";break;case"stretch":b="none"}s.attr({x:g,y:y,width:a,height:o,preserveAspectRatio:b,opacity:e.opacity});var _=(c&&"domain"!==i.getRefType(e.xref)?c._id:"")+(u&&"domain"!==i.getRefType(e.yref)?u._id:"");n.setClipUrl(s,_?"clip"+l._uid+_:null,t)}function v(t){return[t.xref,t.x,t.sizex,t.yref,t.y,t.sizey].join("_")}function x(t,e){return t._index-e._index}var b=l._imageLowerLayer.selectAll("image").data(h,v),_=l._imageUpperLayer.selectAll("image").data(c,v);b.enter().append("image"),_.enter().append("image"),b.exit().remove(),_.exit().remove(),b.each((function(t){g.bind(this)(t),y.bind(this)(t)})),_.each((function(t){g.bind(this)(t),y.bind(this)(t)})),b.sort(x),_.sort(x);var w=Object.keys(l._plots);for(s=0;s<w.length;s++){e=w[s];var k=l._plots[e];if(k.imagelayer){var T=k.imagelayer.selectAll("image").data(u[e]||[],v);T.enter().append("image"),T.exit().remove(),T.each((function(t){g.bind(this)(t),y.bind(this)(t)})),T.sort(x)}}}}}),Xi=d({"src/components/images/convert_coords.js"(t,e){var r=k(),n=P();e.exports=function(t,e,i,a){e=e||{};var o="log"===i&&"linear"===e.type,s="linear"===i&&"log"===e.type;if(o||s)for(var l,c,u=t._fullLayout.images,h=e._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(l=u[d])[h+"ref"]===e._id){var p=l[h],f=l["size"+h],m=null,g=null;if(o){m=n(p,e.range);var y=f/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,p))*(Math.pow(10,f/2)-Math.pow(10,-f/2));r(m)?r(g)||(g=null):(m=null,g=null),a(c+h,m),a(c+"size"+h,g)}}}}),Ki=d({"src/components/images/index.js"(t,e){e.exports={moduleType:"component",name:"images",layoutAttributes:Gi(),supplyLayoutDefaults:Yi(),includeBasePlot:An()("images"),draw:Zi(),convertCoords:Xi()}}}),Ji=d({"src/components/updatemenus/constants.js"(t,e){e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}}}),Qi=d({"src/components/updatemenus/attributes.js"(t,e){var r=R(),n=V(),i=D().extendFlat,a=Pt().overrideAll,o=Bt(),s=ge().templatedArray,l=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=a(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:l,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(o({editType:"arraydraw"}),{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:n.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}}),ta=d({"src/components/updatemenus/defaults.js"(t,e){var r=se(),n=Be(),i=Qi(),a=Ji().name,o=i.buttons;function s(t,e,a){function o(n,a){return r.coerce(t,e,i,n,a)}o("visible",n(t,e,{name:"buttons",handleItemDefaults:l}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}}),ea=d({"src/components/updatemenus/scrollbox.js"(t,e){e.exports=o;var r=v(),n=q(),i=Je(),a=se();function o(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(t,e,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=t;var u,h,d,p,f=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,b="left"===v,_="up"===v,w=m,k=y;x||b||"right"===v||_||(this.position.direction="down",x=!0),x||_?(h=(u=f)+w,x?(d=g,k=(p=Math.min(d+k,c))-d):k=(p=g+k)-(d=Math.max(p-k,0))):(p=(d=g)+k,b?w=(h=f+w)-(u=Math.max(h-w,0)):(u=f,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:d,w:w,h:k};var T=m>w,S=o.barLength+2*o.barPad,A=o.barWidth+2*o.barPad,M=f,C=g+y;C+A>c&&(C=c-A);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),T?(this.hbar=E.attr({rx:o.barRadius,ry:o.barRadius,x:M,y:C,width:S,height:A}),this._hbarXMin=M+S/2,this._hbarTranslateMax=w-S):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>k,P=o.barWidth+2*o.barPad,I=o.barLength+2*o.barPad,z=f+m,O=g;z+P>l&&(z=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),L?(this.vbar=D.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:O,width:P,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?h+P+.5:h+.5,j=d-.5,N=T?p+A+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(T||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),T||L?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(N)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:f,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||L){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),L&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},o.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},o.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},o.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var o=t/r;this.hbar.call(i.setTranslate,t+o*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}}}),ra=d({"src/components/updatemenus/draw.js"(t,e){var r=v(),n=ke(),i=q(),a=Je(),o=se(),s=Ae(),l=ge().arrayEditor,c=Se().LINE_SPACING,u=Ji(),h=ea();function d(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function f(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,u.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||g(t,n,i,a,e))}function m(t,e,r,n,i){var s=o.ensureSingle(e,"g",u.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,d={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,t).call(A,i,d,f),o.ensureSingle(e,"text",u.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(M,String(p(r,i)?-1:i._index)),g(t,e,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(k,i)})),a.setTranslate(e,l.lx,l.ly)}function g(t,e,i,a,s){i||(i=e).attr("pointer-events","all");var l=function(t){return-1===+t.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),d=h.enter().append("g").classed(c,!0),p=h.exit();"dropdown"===s.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var b={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},T={l:b.x+s.borderwidth,t:b.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,t).call(A,s,b),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(f(t,s,0,e,i,a,-1),n.executeAPICommand(t,o.method,o.args2)):(f(t,s,0,e,i,a,l),n.executeAPICommand(t,o.method,o.args))),t.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,s),h.call(_,s)}))})),h.call(_,s),x?(T.w=Math.max(v.openWidth,v.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(v.openHeight,v.headerHeight)),T.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,d=i._dims,p=i.active;if(h)for(s=0,l=0;l<p;l++)s+=d.heights[l]+u.gapButton;else for(o=0,l=0;l<p;l++)o+=d.widths[l]+u.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,s,T):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",(function(){e=!1,r||t.disable()})),r&&t.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,e||t.disable()}))}(a))}function y(t,e,r,n){t.call(x,e).call(b,e,r,n)}function x(t,e){o.ensureSingle(t,"rect",u.itemRectClassName,(function(t){t.attr({rx:u.rx,ry:u.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var i=o.ensureSingle(t,"text",u.itemTextClassName,(function(t){t.attr({"text-anchor":"start","data-notex":1})})),l=r.label,c=n._fullLayout._meta;c&&(l=o.templateString(l,c)),i.call(a.font,e.font).text(l).call(s.convertToTspans,n)}function _(t,e){var n=e.active;t.each((function(t,a){var o=r.select(this);a===n&&e.showactive&&o.select("rect."+u.itemRectClassName).call(i.fill,u.activeColor)}))}function w(t){t.select("rect."+u.itemRectClassName).call(i.fill,u.hoverColor)}function k(t,e){t.select("rect."+u.itemRectClassName).call(i.fill,e.bgcolor)}function T(t,e){var i=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},l=a.tester.selectAll("g."+u.dropdownButtonClassName).data(o.filterVisible(e.buttons));l.enter().append("g").classed(u.dropdownButtonClassName,!0);var h=-1!==["up","down"].indexOf(e.direction);l.each((function(n,o){var l=r.select(this);l.call(y,e,n,t);var d=l.select("."+u.itemTextClassName),p=d.node()&&a.bBox(d.node()).width,f=Math.max(p+u.textPadX,u.minWidth),m=e.font.size*c,g=s.lineCount(d),v=Math.max(m*g,u.minHeight)+u.textOffsetY;v=Math.ceil(v),f=Math.ceil(f),i.widths[o]=f,i.heights[o]=v,i.height1=Math.max(i.height1,v),i.width1=Math.max(i.width1,f),h?(i.totalWidth=Math.max(i.totalWidth,f),i.openWidth=i.totalWidth,i.totalHeight+=v+u.gapButton,i.openHeight+=v+u.gapButton):(i.totalWidth+=f+u.gapButton,i.openWidth+=f+u.gapButton,i.totalHeight=Math.max(i.totalHeight,v),i.openHeight=i.totalHeight)})),h?i.totalHeight-=u.gapButton:i.totalWidth-=u.gapButton,i.headerWidth=i.width1+u.arrowPadX,i.headerHeight=i.height1,"dropdown"===e.type&&(h?(i.width1+=u.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=u.arrowPadX),l.remove();var d=i.totalWidth+e.pad.l+e.pad.r,p=i.totalHeight+e.pad.t+e.pad.b,f=t._fullLayout._size;i.lx=f.l+f.w*e.x,i.ly=f.t+f.h*(1-e.y);var m="left";o.isRightAnchor(e)&&(i.lx-=d,m="right"),o.isCenterAnchor(e)&&(i.lx-=d/2,m="center");var g="top";o.isBottomAnchor(e)&&(i.ly-=p,g="bottom"),o.isMiddleAnchor(e)&&(i.ly-=p/2,g="middle"),i.totalWidth=Math.ceil(i.totalWidth),i.totalHeight=Math.ceil(i.totalHeight),i.lx=Math.round(i.lx),i.ly=Math.round(i.ly),n.autoMargin(t,S(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[m]||0),r:d*({left:1,center:.5}[m]||0),b:p*({top:1,middle:.5}[g]||0),t:p*({bottom:1,middle:.5}[g]||0)})}function S(t){return u.autoMarginIdRoot+t._index}function A(t,e,r,n){n=n||{};var i=t.select("."+u.itemRectClassName),o=t.select("."+u.itemTextClassName),l=e.borderwidth,h=r.index,d=e._dims;a.setTranslate(t,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(e.direction),f=n.height||(p?d.heights[h]:d.height1);i.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[h]),height:f});var m=e.font.size*c,g=(s.lineCount(o)-1)*m/2;s.positionText(o,u.textOffsetX,f/2-g+u.textOffsetY),p?r.y+=d.heights[h]+r.yPad:r.x+=d.widths[h]+r.xPad,r.index++}function M(t,e){t.attr(u.menuIndexAttrName,e||"-1").selectAll("g."+u.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,i=o.filterVisible(e[u.name]);function a(e){n.autoMargin(t,S(e))}var s=e._menulayer.selectAll("g."+u.containerClassName).data(i.length>0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,d);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),y=0;y<i.length;y++){var v=i[y];T(t,v)}var x="updatemenus"+e._uid,b=new h(t,c,x);l.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(M)),l.exit().each((function(t){c.call(M),a(t)})).remove(),l.each((function(e){var i=r.select(this),a="dropdown"===e.type?c:null;n.manageCommandObserver(t,e,e.buttons,(function(r){f(t,e,e.buttons[r.index],i,a,b,r.index,!0)})),"dropdown"===e.type?(m(t,i,c,b,e),p(c,e)&&g(t,i,c,b,e)):g(t,i,null,null,e)}))}}}}),na=d({"src/components/updatemenus/index.js"(t,e){var r=Ji();e.exports={moduleType:"component",name:r.name,layoutAttributes:Qi(),supplyLayoutDefaults:ta(),draw:ra()}}}),ia=d({"src/components/sliders/constants.js"(t,e){e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}}),aa=d({"src/components/sliders/attributes.js"(t,e){var r=R(),n=Bt(),i=D().extendDeepAll,a=Pt().overrideAll,o=Lt(),s=ge().templatedArray,l=ia(),c=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=a(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(n({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:o.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:r({})},font:r({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}),"arraydraw","from-root")}}),oa=d({"src/components/sliders/defaults.js"(t,e){var r=se(),n=Be(),i=aa(),a=ia().name,o=i.steps;function s(t,e,a){function o(n,a){return r.coerce(t,e,i,n,a)}for(var s=n(t,e,{name:"steps",handleItemDefaults:l}),c=0,u=0;u<s.length;u++)s[u].visible&&c++;if(c<2?e.visible=!1:o("visible")){e._stepCount=c;var h=e._visibleSteps=r.filterVisible(s);(s[o("active")]||{}).visible||(e.active=h[0]._index),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),r.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}if("skip"===t.method||Array.isArray(t.args)?n("visible"):e.visible=!1){n("method"),n("args");var i=n("label","step-"+e._index);n("value",i),n("execute")}}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}}),sa=d({"src/components/sliders/draw.js"(t,e){var r=v(),n=ke(),i=q(),a=Je(),o=se(),s=o.strTranslate,l=Ae(),c=ge().arrayEditor,u=ia(),h=Se(),d=h.LINE_SPACING,p=h.FROM_TL,f=h.FROM_BR;function m(t){return u.autoMarginIdRoot+t._index}function g(t){return t._index}function y(t,e){var i=a.tester.selectAll("g."+u.labelGroupClass).data(e._visibleSteps);i.enter().append("g").classed(u.labelGroupClass,!0);var s=0,c=0;i.each((function(t){var n=_(r.select(this),{step:t},e).node();if(n){var i=a.bBox(n);c=Math.max(c,i.height),s=Math.max(s,i.width)}})),i.remove();var h=e._dims={};h.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=t._fullLayout._size;h.lx=d.l+d.w*e.x,h.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?h.outerLength=Math.round(d.w*e.len):h.outerLength=e.len,h.inputAreaStart=0,h.inputAreaLength=Math.round(h.outerLength-e.pad.l-e.pad.r);var g=(h.inputAreaLength-2*u.stepInset)/(e._stepCount-1),y=s+u.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=c,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,e.currentvalue.visible){var v=a.tester.append("g");i.each((function(t){var r=x(v,e,t.label),n=r.node()&&a.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);h.currentValueMaxWidth=Math.max(h.currentValueMaxWidth,Math.ceil(n.width)),h.currentValueHeight=Math.max(h.currentValueHeight,Math.ceil(n.height)),h.currentValueMaxLines=Math.max(h.currentValueMaxLines,i)})),h.currentValueTotalHeight=h.currentValueHeight+e.currentvalue.offset,v.remove()}h.height=h.currentValueTotalHeight+u.tickOffset+e.ticklen+u.labelOffset+h.labelHeight+e.pad.t+e.pad.b;var b="left";o.isRightAnchor(e)&&(h.lx-=h.outerLength,b="right"),o.isCenterAnchor(e)&&(h.lx-=h.outerLength/2,b="center");var w="top";o.isBottomAnchor(e)&&(h.ly-=h.height,w="bottom"),o.isMiddleAnchor(e)&&(h.ly-=h.height/2,w="middle"),h.outerLength=Math.ceil(h.outerLength),h.height=Math.ceil(h.height),h.lx=Math.round(h.lx),h.ly=Math.round(h.ly);var k={y:e.y,b:h.height*f[w],t:h.height*p[w]};"fraction"===e.lenmode?(k.l=0,k.xl=e.x-e.len*p[b],k.r=0,k.xr=e.x+e.len*f[b]):(k.x=e.x,k.l=h.outerLength*p[b],k.r=h.outerLength*f[b]),n.autoMargin(t,m(e),k)}function x(t,e,r){if(e.currentvalue.visible){var n,i,s=e._dims;switch(e.currentvalue.xanchor){case"right":n=s.inputAreaLength-u.currentValueInset-s.currentValueMaxWidth,i="left";break;case"center":n=.5*s.inputAreaLength,i="middle";break;default:n=u.currentValueInset,i="left"}var c=o.ensureSingle(t,"text",u.labelClass,(function(t){t.attr({"text-anchor":i,"data-notex":1})})),h=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"===typeof r)h+=r;else{var p=e.steps[e.active].label,f=e._gd._fullLayout._meta;f&&(p=o.templateString(p,f)),h+=p}e.currentvalue.suffix&&(h+=e.currentvalue.suffix),c.call(a.font,e.currentvalue.font).text(h).call(l.convertToTspans,e._gd);var m=l.lineCount(c),g=(s.currentValueMaxLines+1-m)*e.currentvalue.font.size*d;return l.positionText(c,n,g),c}}function b(t,e,r){o.ensureSingle(t,"rect",u.gripRectClass,(function(n){n.call(S,e,t,r).style("pointer-events","all")})).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(t,e,r){var n=o.ensureSingle(t,"text",u.labelClass,(function(t){t.attr({"text-anchor":"middle","data-notex":1})})),i=e.step.label,s=r._gd._fullLayout._meta;return s&&(i=o.templateString(i,s)),n.call(a.font,r.font).text(i).call(l.convertToTspans,r._gd),n}function w(t,e){var n=o.ensureSingle(t,"g",u.labelsClass),i=e._dims,s=n.selectAll("g."+u.labelGroupClass).data(i.labelSteps);s.enter().append("g").classed(u.labelGroupClass,!0),s.exit().remove(),s.each((function(t){var n=r.select(this);n.call(_,t,e),a.setTranslate(n,C(e,t.fraction),u.tickOffset+e.ticklen+e.font.size*d+u.labelOffset+i.currentValueTotalHeight)}))}function k(t,e,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&T(t,e,r,o,!0,i)}function T(t,e,r,i,a,o){var s=r.active;r.active=i,c(t.layout,u.name,r).applyUpdate("active",i);var l=r.steps[r.active];e.call(M,r,o),e.call(x,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&n.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function S(t,e,n){if(!e._context.staticPlot){var a=n.node(),o=r.select(e);t.on("mousedown",l),t.on("touchstart",l)}function s(){return n.data()[0]}function l(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=n.select("."+u.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),l.call(i.fill,t.activebgcolor);var c=E(t,r.mouse(a)[0]);function h(){var t=s(),i=E(t,r.mouse(a)[0]);k(e,n,t,i,!1)}function d(){var t=s();t._dragging=!1,l.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),o.on("touchend",null),o.on("touchmove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}k(e,n,t,c,!0),t._dragging=!0,o.on("mousemove",h),o.on("touchmove",h),o.on("mouseup",d),o.on("touchend",d)}}function A(t,e){var n=t.selectAll("rect."+u.tickRectClass).data(e._visibleSteps),o=e._dims;n.enter().append("rect").classed(u.tickRectClass,!0),n.exit().remove(),n.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),n.each((function(t,n){var s=n%o.labelStride===0,l=r.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),a.setTranslate(l,C(e,n/(e._stepCount-1))-.5*e.tickwidth,(s?u.tickOffset:u.minorTickOffset)+o.currentValueTotalHeight)}))}function M(t,e,r){for(var n=t.select("rect."+u.gripRectClass),i=0,a=0;a<e._stepCount;a++)if(e._visibleSteps[a]._index===e.active){i=a;break}var o=C(e,i/(e._stepCount-1));if(!e._invokingCommand){var l=n;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(S,e,t,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(t,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[u.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=e,n.push(a))}return n}(i,t),s=i._infolayer.selectAll("g."+u.containerClassName).data(o.length>0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),n.autoMargin(t,m(e))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h<o.length;h++){var d=o[h];y(t,d)}c.each((function(e){var i=r.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),n.manageCommandObserver(t,e,e._visibleSteps,(function(e){var r=i.data()[0];r.active!==e.index&&(r._dragging||T(t,i,r,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(x,r).call(P,r).call(w,r).call(A,r).call(L,t,r).call(b,t,r);var n=r._dims;a.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(M,r,!1),e.call(x,r)}(t,r.select(this),e)}))}}}}),la=d({"src/components/sliders/index.js"(t,e){var r=ia();e.exports={moduleType:"component",name:r.name,layoutAttributes:aa(),supplyLayoutDefaults:oa(),draw:sa()}}}),ca=d({"src/components/rangeslider/attributes.js"(t,e){var r=V();e.exports={bgcolor:{valType:"color",dflt:r.background,editType:"plot"},bordercolor:{valType:"color",dflt:r.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),ua=d({"src/components/rangeslider/oppaxis_attributes.js"(t,e){e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),ha=d({"src/components/rangeslider/constants.js"(t,e){e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),da=d({"src/components/rangeslider/helpers.js"(t){var e=ve(),r=Ae(),n=ha(),i=Se().LINE_SPACING,a=n.name;function o(t){var e=t&&t[a];return e&&e.visible}t.isVisible=o,t.makeData=function(t){for(var r=e.list({_fullLayout:t},"x",!0),n=t.margin,i=[],s=0;s<r.length;s++){var l=r[s];if(o(l)){i.push(l);var c=l[a];c._id=a+l._id,c._height=(t.height-n.b-n.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}t._rangeSliderData=i},t.autoMarginOpts=function(t,e){var o=t._fullLayout,s=e[a],l=e._id.charAt(0),c=0,u=0;return"bottom"===e.side&&(c=e._depth,e.title.text!==o._dfltTitle[l]&&(u=1.5*e.title.font.size+10+s._offsetShift,u+=(e.title.text.match(r.BR_TAG_ALL)||[]).length*e.title.font.size*i)),{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:s._height+c+Math.max(o.margin.b,u),pad:n.extraPad+2*s._offsetShift}}}}),pa=d({"src/components/rangeslider/defaults.js"(t,e){var r=se(),n=ge(),i=ve(),a=ca(),o=ua();e.exports=function(t,e,s){var l=t[s],c=e[s];if(l.rangeslider||e._requestRangeslider[c._id]){r.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,h,d=l.rangeslider,p=n.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var f=e._subplots;if(f)for(var m=f.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===i.name2id(s)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),g=r.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];u=d[v]||{},h=n.newContainer(p,v,"yaxis");var x,b=e[v];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(t,e){return r.coerce(d,p,a,t,e)}function w(t,e){return r.coerce(u,h,o,t,e)}}}}),fa=d({"src/components/rangeslider/calc_autorange.js"(t,e){var r=ve().list,n=rr().getAutoRange,i=ha();e.exports=function(t){for(var e=r(t,"x",!0),a=0;a<e.length;a++){var o=e[a],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=n(t,o))}}}}),ma=d({"src/components/rangeslider/draw.js"(t,e){var r=v(),n=Vt(),i=ke(),a=se(),o=a.strTranslate,s=Je(),l=q(),c=Qe(),u=Ai(),h=ve(),d=hr(),p=dr(),f=ha();function m(t){return"number"===typeof t.clientX?t.clientX:t.touches&&t.touches.length>0?t.touches[0].clientX:0}function g(t,e,r,n){var i=a.ensureSingle(t,"rect",f.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(t,e,n,o){var l,c=e.calcdata,d=t.selectAll("g."+f.rangePlotClassName).data(n._subplotsWith,a.identity);d.enter().append("g").attr("class",(function(t){return f.rangePlotClassName+" "+t})).call(s.setClipUrl,o._clipId,e),d.order(),d.exit().remove(),d.each((function(t,a){var s=r.select(this),d=0===a,p=h.getFromId(e,t,"y"),f=p._name,m=o[f],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[f]={type:p.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[f].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[f];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};d?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(e,x,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(c,t))}))}function b(t,e,r,n,i){a.ensureSingle(t,"rect",f.maskMinClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,f.maskColor),a.ensureSingle(t,"rect",f.maskMaxClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,f.maskColor),"match"!==i.rangemode&&(a.ensureSingle(t,"rect",f.maskMinOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(l.fill,f.maskOppAxisColor),a.ensureSingle(t,"rect",f.maskMaxOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",f.maskOppBorder).call(l.fill,f.maskOppAxisColor))}function _(t,e,r,n){e._context.staticPlot||a.ensureSingle(t,"rect",f.slideBoxClassName,(function(t){t.attr({y:0,cursor:f.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:f.slideBoxFill})}function w(t,e,r,n){var i=a.ensureSingle(t,"g",f.grabberMinClassName),o=a.ensureSingle(t,"g",f.grabberMaxClassName),s={x:0,width:f.handleWidth,rx:f.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":f.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};a.ensureSingle(i,"rect",f.handleMinClassName,(function(t){t.attr(s)})).attr(c),a.ensureSingle(o,"rect",f.handleMaxClassName,(function(t){t.attr(s)})).attr(c);var u={width:f.grabAreaWidth,x:0,y:0,fill:f.grabAreaFill,cursor:e._context.staticPlot?void 0:f.grabAreaCursor};a.ensureSingle(i,"rect",f.grabAreaMinClassName,(function(t){t.attr(u)})).attr("height",n._height),a.ensureSingle(o,"rect",f.grabAreaMaxClassName,(function(t){t.attr(u)})).attr("height",n._height)}e.exports=function(t){for(var e=t._fullLayout,i=e._rangeSliderData,s=0;s<i.length;s++){var l=i[s][f.name];l._clipId=l._id+"-"+e._uid}var u=e._infolayer.selectAll("g."+f.containerClassName).data(i,(function(t){return t._name}));u.exit().each((function(t){var r=t[f.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==i.length&&(u.enter().append("g").classed(f.containerClassName,!0).attr("pointer-events","all"),u.each((function(i){var s=r.select(this),l=i[f.name],u=e[h.id2name(i.anchor)],v=l[h.id2name(i.anchor)];if(l.range){var k,T=a.simpleMap(l.range,i.r2l),S=a.simpleMap(i.range,i.r2l);k=S[0]<S[1]?[Math.min(T[0],S[0]),Math.max(T[1],S[1])]:[Math.max(T[0],S[0]),Math.min(T[1],S[1])],l.range=l._input.range=a.simpleMap(k,i.l2r)}i.cleanRange("rangeslider.range");var A=e._size,M=i.domain;l._width=A.w*(M[1]-M[0]);var C=Math.round(A.l+A.w*M[0]),E=Math.round(A.t+A.h*(1-i._counterDomainMin)+("bottom"===i.side?i._depth:0)+l._offsetShift+f.extraPad);s.attr("transform",o(C,E)),l._rl=a.simpleMap(l.range,i.r2l);var L=l._rl[0],P=l._rl[1],I=P-L;if(l.p2d=function(t){return t/l._width*I+L},l.d2p=function(t){return(t-L)/I*l._width},i.rangebreaks){var z=i.locateBreaks(L,P);if(z.length){var O,D,R=0;for(O=0;O<z.length;O++)R+=(D=z[O]).max-D.min;var F=l._width/(P-L-R),B=[-F*L];for(O=0;O<z.length;O++)D=z[O],B.push(B[B.length-1]-F*(D.max-D.min));for(l.d2p=function(t){for(var e=B[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.max)e=B[r+1];else if(t<n.min)break}return e+F*t},O=0;O<z.length;O++)(D=z[O]).pmin=l.d2p(D.min),D.pmax=l.d2p(D.max);l.p2d=function(t){for(var e=B[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.pmax)e=B[r+1];else if(t<n.pmin)break}return(t-e)/F}}}if("match"!==v.rangemode){var j=u.r2l(v.range[0]),N=u.r2l(v.range[1])-j;l.d2pOppAxis=function(t){return(t-j)/N*l._height}}s.call(g,t,i,l).call(y,t,i,l).call(x,t,i,l).call(b,t,i,l,v).call(_,t,i,l).call(w,t,i,l),function(t,e,i,o){if(!e._context.staticPlot){var s=t.select("rect."+f.slideBoxClassName).node(),l=t.select("rect."+f.grabAreaMinClassName).node(),c=t.select("rect."+f.grabAreaMaxClassName).node();t.on("mousedown",u),t.on("touchstart",u)}function u(){var u=r.event,h=u.target,f=m(u),g=f-t.node().getBoundingClientRect().left,y=o.d2p(i._rl[0]),v=o.d2p(i._rl[1]),x=d.coverSlip();function b(t){var u,d,b,_=+m(t)-f;switch(h){case s:if(b="ew-resize",y+_>i._length||v+_<0)return;u=y+_,d=v+_;break;case l:if(b="col-resize",y+_>i._length)return;u=y+_,d=v;break;case c:if(b="col-resize",v+_<0)return;u=y,d=v+_;break;default:b="ew-resize",u=g,d=g+_}if(d<u){var w=d;d=u,u=w}o._pixelMin=u,o._pixelMax=d,p(r.select(x),b),function(t,e,r,i){function o(t){return r.l2r(a.constrain(t,i._rl[0],i._rl[1]))}var s=o(i.p2d(i._pixelMin)),l=o(i.p2d(i._pixelMax));window.requestAnimationFrame((function(){n.call("_guiRelayout",e,r._name+".range",[s,l])}))}(0,e,i,o)}function _(){x.removeEventListener("mousemove",b),x.removeEventListener("mouseup",_),this.removeEventListener("touchmove",b),this.removeEventListener("touchend",_),a.removeElement(x)}this.addEventListener("touchmove",b),this.addEventListener("touchend",_),x.addEventListener("mousemove",b),x.addEventListener("mouseup",_)}}(s,t,i,l),function(t,e,r,n,i,s){var l=f.handleWidth/2;function c(t){return a.constrain(t,0,n._width)}function u(t){return a.constrain(t,0,n._height)}function h(t){return a.constrain(t,-l,n._width+l)}var d=c(n.d2p(r._rl[0])),p=c(n.d2p(r._rl[1]));if(t.select("rect."+f.slideBoxClassName).attr("x",d).attr("width",p-d),t.select("rect."+f.maskMinClassName).attr("width",d),t.select("rect."+f.maskMaxClassName).attr("x",p).attr("width",n._width-p),"match"!==s.rangemode){var m=n._height-u(n.d2pOppAxis(i._rl[1])),g=n._height-u(n.d2pOppAxis(i._rl[0]));t.select("rect."+f.maskMinOppAxisClassName).attr("x",d).attr("height",m).attr("width",p-d),t.select("rect."+f.maskMaxOppAxisClassName).attr("x",d).attr("y",g).attr("height",n._height-g).attr("width",p-d),t.select("rect."+f.slideBoxClassName).attr("y",m).attr("height",g-m)}var y=.5,v=Math.round(h(d-l))-y,x=Math.round(h(p-l))+y;t.select("g."+f.grabberMinClassName).attr("transform",o(v,y)),t.select("g."+f.grabberMaxClassName).attr("transform",o(x,y))}(s,0,i,l,u,v),"bottom"===i.side&&c.draw(t,i._id+"title",{propContainer:i,propName:i._name+".title",placeholder:e._dfltTitle.x,attributes:{x:i._offset+i._length/2,y:E+l._height+l._offsetShift+10+1.5*i.title.font.size,"text-anchor":"middle"}})})))}}}),ga=d({"src/components/rangeslider/index.js"(t,e){var r=se(),n=ca(),i=ua(),a=da();e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r.extendFlat({},n,{yaxis:i})}}},layoutAttributes:ca(),handleDefaults:pa(),calcAutorange:fa(),draw:ma(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}}),ya=d({"src/components/rangeselector/attributes.js"(t,e){var r=R(),n=V(),i=(0,ge().templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:r({editType:"plot"}),bgcolor:{valType:"color",dflt:n.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}}),va=d({"src/components/rangeselector/constants.js"(t,e){e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}}),xa=d({"src/components/rangeselector/defaults.js"(t,e){var r=se(),n=q(),i=ge(),a=Be(),o=ya(),s=va();function l(t,e,n,i){var a=i.calendar;function s(n,i){return r.coerce(t,e,o.buttons,n,i)}if(s("visible")){var l=s("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?s("stepmode"):e.stepmode="backward",s("count")),s("label")}}e.exports=function(t,e,c,u,h){var d=t.rangeselector||{},p=i.newContainer(e,"rangeselector");function f(t,e){return r.coerce(d,p,o,t,e)}if(f("visible",a(d,p,{name:"buttons",handleItemDefaults:l,calendar:h}).length>0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+s.yPad]}(e,c,u);f("x",m[0]),f("y",m[1]),r.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),r.coerceFont(f,"font",c.font);var g=f("bgcolor");f("activecolor",n.contrast(g,s.lightAmount,s.darkAmount)),f("bordercolor"),f("borderwidth")}}}}),ba=d({"src/components/rangeselector/get_update_object.js"(t,e){var r=x(),n=se().titleCase;e.exports=function(t,e){var i=t._name,a={};if("all"===e.step)a[i+".autorange"]=!0;else{var o=function(t,e){var i,a=t.range,o=new Date(t.r2l(a[1])),s=e.step,l=r["utc"+n(s)],c=e.count;switch(e.stepmode){case"backward":i=t.l2r(+l.offset(o,-c));break;case"todate":var u=l.offset(o,-c);i=t.l2r(+l.ceil(u))}var h=a[1];return[i,h]}(t,e);a[i+".range[0]"]=o[0],a[i+".range[1]"]=o[1]}return a}}}),_a=d({"src/components/rangeselector/draw.js"(t,e){var r=v(),n=Vt(),i=ke(),a=q(),o=Je(),s=se(),l=s.strTranslate,c=Ae(),u=ve(),h=Se(),d=h.LINE_SPACING,p=h.FROM_TL,f=h.FROM_BR,m=va(),g=ba();function y(t){return t._id}function x(t,e,r){var n=s.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:m.rx,ry:m.ry}),n.call(a.stroke,e.bordercolor).call(a.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function b(t,e,r,n){var i,a;s.ensureSingle(t,"text","selector-text",(function(t){t.attr("text-anchor","middle")})).call(o.font,e.font).text((i=r,a=n._fullLayout._meta,i.label?a?s.templateString(i.label,a):i.label:"all"===i.step?"all":i.count+i.step.charAt(0))).call((function(t){c.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=u.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each((function(e){var a=r.select(this),u=e,h=u.rangeselector,y=a.selectAll("g.button").data(s.filterVisible(h.buttons));y.enter().append("g").classed("button",!0),y.exit().remove(),y.each((function(e){var i=r.select(this),a=g(u,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(u,e,a),i.call(x,h,e),i.call(b,h,e,t),i.on("click",(function(){t._dragged||n.call("_guiRelayout",t,a)})),i.on("mouseover",(function(){e._isHovered=!0,i.call(x,h,e)})),i.on("mouseout",(function(){e._isHovered=!1,i.call(x,h,e)}))})),function(t,e,n,a,u){var h=0,g=0,y=n.borderwidth;e.each((function(){var t=r.select(this).select(".selector-text"),e=n.font.size*d,i=Math.max(e*c.lineCount(t),16)+3;g=Math.max(g,i)})),e.each((function(){var t=r.select(this),e=t.select(".selector-rect"),i=t.select(".selector-text"),a=i.node()&&o.bBox(i.node()).width,s=n.font.size*d,u=c.lineCount(i),p=Math.max(a+10,m.minButtonWidth);t.attr("transform",l(y+h,y)),e.attr({x:0,y:0,width:p,height:g}),c.positionText(i,p/2,g/2-(u-1)*s/2+3),h+=p+5}));var v=t._fullLayout._size,x=v.l+v.w*n.x,b=v.t+v.h*(1-n.y),_="left";s.isRightAnchor(n)&&(x-=h,_="right"),s.isCenterAnchor(n)&&(x-=h/2,_="center");var w="top";s.isBottomAnchor(n)&&(b-=g,w="bottom"),s.isMiddleAnchor(n)&&(b-=g/2,w="middle"),h=Math.ceil(h),g=Math.ceil(g),x=Math.round(x),b=Math.round(b),i.autoMargin(t,a+"-range-selector",{x:n.x,y:n.y,l:h*p[_],r:h*f[_],b:g*f[w],t:g*p[w]}),u.attr("transform",l(x,b))}(t,y,h,u._name,a)}))}}}),wa=d({"src/components/rangeselector/index.js"(t,e){e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:ya()}}},layoutAttributes:ya(),handleDefaults:xa(),draw:_a()}}}),ka=d({"src/plots/domain.js"(t){var e=D().extendFlat;t.attributes=function(t,r){r=r||{};var n={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},i=(t.name&&t.name,t.trace,r.description&&r.description,{x:e({},n,{}),y:e({},n,{}),editType:t.editType});return t.noGridCell||(i.row={valType:"integer",min:0,dflt:0,editType:t.editType},i.column={valType:"integer",min:0,dflt:0,editType:t.editType}),i},t.defaults=function(t,e,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete t.domain.row)}var c=r("domain.x",i),u=r("domain.y",a);c[0]<c[1]||(t.domain.x=i.slice()),u[0]<u[1]||(t.domain.y=a.slice())}}}),Ta=d({"src/components/grid/index.js"(t,e){var r=se(),n=H().counter,i=ka().attributes,a=ye().idRegex,o=ge(),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[n("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function l(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),d=0;d<i;d++){var p=c+u*d;l[a?i-1-d:d]=[p,p+h]}return l}function u(t,e,r,n,i){var a,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(a=0;a<r;a++)s(a,t[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(t,e){var n=t.grid||{},i=l(e,n,"x"),a=l(e,n,"y");if(t.grid||i||a){var u,h,d=Array.isArray(n.subplots)&&Array.isArray(n.subplots[0]),p=Array.isArray(i),f=Array.isArray(a),m=p&&i!==n.xaxes&&f&&a!==n.yaxes;d?(u=n.subplots.length,h=n.subplots[0].length):(f&&(u=a.length),p&&(h=i.length));var g=o.newContainer(e,"grid"),y=T("rows",u),v=T("columns",h);if(y*v>1){d||p||f||"independent"===T("pattern")&&(d=!0),g._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:c("x",T,w,x,v),y:c("y",T,k,b,y,_)}}else delete e.grid}function T(t,e){return r.coerce(n,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,c,h,d=t.grid||{},p=e._subplots,f=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(f){var x=d.subplots||[];c=r.subplots=new Array(m);var b=1;for(n=0;n<m;n++){var _=c[n]=new Array(g),w=x[n]||[];for(i=0;i<g;i++)if(y?(s=1===b?"xy":"x"+b+"y"+b,b++):s=w[i],_[i]="",-1!==p.cartesian.indexOf(s)){if(h=s.indexOf("y"),a=s.slice(0,h),o=s.slice(h),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;_[i]=s,v[a]=i,v[o]=n}}}else{var k=l(e,d,"x"),T=l(e,d,"y");r.xaxes=u(k,p.xaxis,g,v,"x"),r.yaxes=u(T,p.yaxis,m,v,"y")}var S=r._anchors={},A="top to bottom"===r.roworder;for(var M in v){var C,E,L,P=M.charAt(0),I=r[P+"side"];if(I.length<8)S[M]="free";else if("x"===P){if("t"===I.charAt(0)===A?(C=0,E=1,L=m):(C=m-1,E=-1,L=-1),f){var z=v[M];for(n=C;n!==L;n+=E)if((s=c[n][z])&&(h=s.indexOf("y"),s.slice(0,h)===M)){S[M]=s.slice(h);break}}else for(n=C;n!==L;n+=E)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(M+o)){S[M]=o;break}}else if("l"===I.charAt(0)?(C=0,E=1,L=g):(C=g-1,E=-1,L=-1),f){var O=v[M];for(n=C;n!==L;n+=E)if((s=c[O][n])&&(h=s.indexOf("y"),s.slice(h)===M)){S[M]=s.slice(0,h);break}}else for(n=C;n!==L;n+=E)if(a=r.xaxes[n],-1!==p.cartesian.indexOf(a+M)){S[M]=a;break}}}}}}}),Sa=d({"src/components/errorbars/attributes.js"(t,e){e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}}),Aa=d({"src/components/errorbars/defaults.js"(t,e){var r=k(),n=Vt(),i=se(),a=ge(),o=Sa();e.exports=function(t,e,s,l){var c="error_"+l.axis,u=a.newContainer(e,c),h=t[c]||{};function d(t,e){return i.coerce(h,u,o,t,e)}if(!1!==d("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var p=d("type","array"in h?"data":"percent"),f=!0;"sqrt"!==p&&(f=d("symmetric",!(("data"===p?"arrayminus":"valueminus")in h))),"data"===p?(d("array"),d("traceref"),f||(d("arrayminus"),d("tracerefminus"))):"percent"!==p&&"constant"!==p||(d("value"),f||d("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&d(m,!(h.color||r(h.thickness)||r(h.width))),l.inherit&&u[m]||(d("color",s),d("thickness"),d("width",n.traceIs(e,"gl3d")?0:4))}}}}),Ma=d({"src/components/errorbars/compute_error.js"(t,e){function r(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,n=t.symmetric;if("data"===e){var i=t.array||[];if(n)return function(t,e){var r=+i[e];return[r,r]};var a=t.arrayminus||[];return function(t,e){var r=+i[e],n=+a[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=r(e,t.value),s=r(e,t.valueminus);return n||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}}}),Ca=d({"src/components/errorbars/calc.js"(t,e){var r=k(),n=Vt(),i=nr(),a=se(),o=Ma();function s(t,e,n,s){var l=e["error_"+s]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var u=o(l),h=0;h<t.length;h++){var d=t[h],p=d.i;if(void 0===p)p=h;else if(null===p)continue;var f=d[s];if(r(n.c2l(f))){var m=u(f,p);if(r(m[0])&&r(m[1])){var g=d[s+"s"]=f-m[0],y=d[s+"h"]=f+m[1];c.push(g,y)}}}var v=n._id,x=e._extremes[v],b=i.findExtremes(n,c,a.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],o=a[0].trace;if(!0===o.visible&&n.traceIs(o,"errorBarsOK")){var l=i.getFromId(t,o.xaxis),c=i.getFromId(t,o.yaxis);s(a,o,l,"x"),s(a,o,c,"y")}}}}}),Ea=d({"src/components/errorbars/plot.js"(t,e){var r=v(),n=k(),i=Je(),a=Ge();e.exports=function(t,e,o,s){var l=o.xaxis,c=o.yaxis,u=s&&s.duration>0,h=t._context.staticPlot;e.each((function(e){var d,p=e[0].trace,f=p.error_x||{},m=p.error_y||{};p.ids&&(d=function(t){return t.id});var g=a.hasMarkers(p)&&p.marker.maxdisplayed>0;m.visible||f.visible||(e=[]);var y=r.select(this).selectAll("g.errorbar").data(e,d);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,t),y.each((function(t){var e=r.select(this),i=function(t,e,r){var i={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(i.yh=r.c2p(t.yh),i.ys=r.c2p(t.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),n(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var d=m.width;a="M"+(i.x-d)+","+i.yh+"h"+2*d+"m-"+d+",0V"+i.ys,i.noYS||(a+="m-"+d+",0h"+2*d),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(f.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(f.copy_ystyle?m:f).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}}))}}))}}}),La=d({"src/components/errorbars/style.js"(t,e){var r=v(),n=q();e.exports=function(t){t.each((function(t){var e=t[0].trace,i=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),Pa=d({"src/components/errorbars/index.js"(t,e){var r=se(),n=Pt().overrideAll,i=Sa(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Aa(),calc:Ca(),makeComputeError:Ma(),plot:Ea(),style:La(),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}}}),Ia=d({"src/components/colorbar/constants.js"(t,e){e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),za=d({"src/components/colorbar/draw.js"(t,e){var r=v(),n=O(),i=ke(),a=Vt(),o=nr(),s=hr(),l=se(),c=l.strTranslate,u=D().extendFlat,h=dr(),d=Je(),p=q(),f=Qe(),m=Ae(),g=Me().flipScale,y=wi(),x=ki(),b=Ee(),_=Se(),w=_.LINE_SPACING,k=_.FROM_TL,T=_.FROM_BR,S=Ia().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+S.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"===typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var h=0;h<o.length;h++){var d=o[h];if((n=d[0].trace)._module){var p=n._module.colorbar;if(!0===n.visible&&p)for(var f=Array.isArray(p),m=f?p:[p],y=0;y<m.length;y++){var v=(i=m[y]).container;(r=v?n[v]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(f&&v?"-"+v:""),e._traceIndex=n.index,e._propPrefix=(v?v+".":"")+"colorbar.",e._meta=n._meta,c(),s.push(e))}}}for(var x in a._colorAxes)if((r=a[x]).showscale){var b=a._colorAxes[x];(e=l(r.colorbar))._id="cb"+x,e._propPrefix=x+".colorbar.",e._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],i.calc=n._module.colorbar.calc),c(),s.push(e)}return s}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(S.colorbar,!0),e.each((function(e){var g=r.select(this);l.ensureSingle(g,"rect",S.cbbg),l.ensureSingle(g,"g",S.cbfills),l.ensureSingle(g,"g",S.cblines),l.ensureSingle(g,"g",S.cbaxis,(function(t){t.classed(S.crisp,!0)})),l.ensureSingle(g,"g",S.cbtitleunshift,(function(t){t.append("g").classed(S.cbtitle,!0)})),l.ensureSingle(g,"rect",S.cboutline);var v=function(t,e,a){var s="v"===e.orientation,h=e.len,g=e.lenmode,v=e.thickness,_=e.thicknessmode,A=e.outlinewidth,M=e.borderwidth,C=e.bgcolor,E=e.xanchor,L=e.yanchor,P=e.xpad,I=e.ypad,z=e.x,O=s?e.y:1-e.y,D="paper"===e.yref,R="paper"===e.xref,F=a._fullLayout,B=F._size,j=e._fillcolor,N=e._line,U=e.title,V=U.side,q=e._zrange||r.extent(("function"===typeof j?j:N.color).domain()),$="function"===typeof N.color?N.color:function(){return N.color},H="function"===typeof j?j:function(){return j},W=e._levels,G=function(t,e,r){var n,i,a=e._levels,o=[],s=[],l=a.end+a.size/100,c=a.size,u=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*c,!(c>0?n>=l:n<=l));i++)n>u&&n<h&&o.push(n);if(e._fillgradient)s=[0];else if("function"===typeof e._fillcolor){var d=e._filllevels;if(d)for(l=d.end+d.size/100,c=d.size,i=0;i<1e5&&(n=d.start+i*c,!(c>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(t){return t-a.size/2}))).push(s[s.length-1]+a.size)}else e._fillcolor&&"string"===typeof e._fillcolor&&(s=[0]);return a.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,e,q),Y=G.fill,Z=G.line,X=Math.round(v*("fraction"===_?s?B.w:B.h:1)),K=X/(s?B.w:B.h),J=Math.round(h*("fraction"===g?s?B.h:B.w:1)),Q=J/(s?B.h:B.w),tt=R?B.w:a._fullLayout.width,et=D?B.h:a._fullLayout.height,rt=Math.round(s?z*tt+P:O*et+I),nt={center:.5,right:1}[E]||0,it={top:1,middle:.5}[L]||0,at=s?z-nt*K:O-it*K,ot=s?O-it*Q:z-nt*Q,st=Math.round(s?et*(1-ot):tt*ot);e._lenFrac=Q,e._thickFrac=K,e._uFrac=at,e._vFrac=ot;var lt=e._axis=function(t,e,r){var n=t._fullLayout,i="v"===e.orientation,a={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,labelalias:e.labelalias,ticklabelposition:e.ticklabelposition,ticklabeloverflow:e.ticklabeloverflow,ticklabelstep:e.ticklabelstep,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:i?"right":"bottom",position:1},o=i?"y":"x",s={type:"linear",_id:o+e._id},c={letter:o,font:n.font,noAutotickangles:"y"===o,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:n.calendar};function u(t,e){return l.coerce(a,s,b,t,e)}return y(a,s,u,c,n),x(a,s,u,c),s}(a,e,q);lt.position=K+(s?z+P/B.w:O+I/B.h);var ct=-1!==["top","bottom"].indexOf(V);if(s&&ct&&(lt.title.side=V,lt.titlex=z+P/B.w,lt.titley=ot+("top"===U.side?Q-I/B.h:I/B.h)),s||ct||(lt.title.side=V,lt.titley=O+I/B.h,lt.titlex=ot+P/B.w),N.color&&"auto"===e.tickmode){lt.tickmode="linear",lt.tick0=W.start;var ut=W.size,ht=l.constrain(J/50,4,15)+1,dt=(q[1]-q[0])/((e.nticks||ht)*ut);if(dt>1){var pt=Math.pow(10,Math.floor(Math.log(dt)/Math.LN10));ut*=pt*l.roundUp(dt/pt,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=s?[ot+I/B.h,ot+Q-I/B.h]:[ot+P/B.w,ot+Q-P/B.w],lt.setScale(),t.attr("transform",c(Math.round(B.l),Math.round(B.t)));var ft,mt=t.select("."+S.cbtitleunshift).attr("transform",c(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+S.cbaxis),xt=0,bt=0;function _t(r,n){var i={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+S.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),f.draw(a,r,u(i,n||{}))}function wt(){var t,e;(s&&ct||!s&&!ct)&&("top"===V&&(t=P+B.l+tt*z,e=I+B.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=P+B.l+tt*z,e=I+B.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=I+B.t+et*O+3+.75*yt,t=P+B.l+tt*ot),_t(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))}function kt(){if(s&&!ct||!s&&ct){var t,n,i=lt.position||0,o=lt._offset+lt._length/2;if("right"===V)n=o,t=B.l+tt*i+10+yt*(lt.showticklabels?1:.5);else if(t=o,"bottom"===V&&(n=B.t+et*i+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("<br>").length;n=B.t+et*i+10-X-w*yt*l}_t((s?"h":"v")+lt._id+"title",{avoid:{selection:r.select(a).selectAll("g."+lt._id+"tick"),side:V,offsetTop:s?0:B.t,offsetLeft:s?B.l:0,maxShift:s?F.width:F.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function Tt(){if(!s&&!ct||s&&ct){var i,u=t.select("."+S.cbtitle),h=u.select("text"),p=[-A/2,A/2],f=u.select(".h"+lt._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),f?(i=d.bBox(f),bt=i.width,(xt=i.height)>g&&(p[1]-=(xt-g)/2)):h.node()&&!h.classed(S.jsPlaceholder)&&(i=d.bBox(h.node()),bt=i.width,xt=i.height),s){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/B.h,p[1]*=-1;else{lt.domain[0]+=xt/B.h;var y=m.lineCount(h);p[1]+=(1-y)*g}u.attr("transform",c(p[0],p[1])),lt.setScale()}}else bt&&("right"===V&&(lt.domain[0]+=(bt+yt/2)/B.w),u.attr("transform",c(p[0],p[1])),lt.setScale())}t.selectAll("."+S.cbfills+",."+S.cblines).attr("transform",s?c(0,Math.round(B.h*(1-lt.domain[1]))):c(Math.round(B.w*lt.domain[0]),0)),vt.attr("transform",s?c(0,Math.round(-B.t)):c(Math.round(-B.l),0));var v=t.select("."+S.cbfills).selectAll("rect."+S.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(S.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(lt.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",rt).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max(X,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(e._fillgradient)d.gradient(c,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=H(t).replace("e-","");c.attr("fill",n(u).toHexString())}}));var b=t.select("."+S.cblines).selectAll("path."+S.cbline).data(N.color&&N.width?Z:[]);b.enter().append("path").classed(S.cbline,!0),b.exit().remove(),b.each((function(t){var e=rt,n=Math.round(lt.c2p(t))+N.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+X).call(d.lineGroupStyle,N.width,$(t),N.dash)})),vt.selectAll("g."+lt._id+"tick,path").remove();var _=rt+X+(A||0)/2-("outside"===e.ticks?1:0),k=o.calcTicks(lt),T=o.getTickSigns(lt)[2];return o.drawTicks(a,lt,{vals:"inside"===lt.ticks?o.clipEnds(lt,k):k,layer:vt,path:o.makeTickPath(lt,_,T),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:k,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,_)})}function St(){var r,o=X+A/2;-1===gt.indexOf("inside")&&(r=d.bBox(vt.node()),o+=s?r.width:r.height),ft=mt.select("text");var l=0,u=s&&"top"===V,f=!s&&"right"===V,m=0;if(ft.node()&&!ft.classed(S.jsPlaceholder)){var y,x=mt.select(".h"+lt._id+"title-math-group").node();x&&(s&&ct||!s&&!ct)?(l=(r=d.bBox(x)).width,y=r.height):(l=(r=d.bBox(mt.node())).right-B.l-(s?rt:st),y=r.bottom-B.t-(s?st:rt),s||"top"!==V||(o+=r.height,m=r.height)),f&&(ft.attr("transform",c(l/2+yt/2,0)),l*=2),o=Math.max(o,s?l:y)}var b=2*(s?P:I)+o+M+A/2,w=0;!s&&U.text&&"bottom"===L&&O<=0&&(b+=w=b/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var j=M+A,N=(s?rt:st)-j/2-(s?P:0),q=(s?st:rt)-(s?J:I+m-w);t.select("."+S.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(b-w,2)).attr(s?"height":"width",Math.max(J+j,2)).call(p.fill,C).call(p.stroke,e.bordercolor).style("stroke-width",M);var $=f?Math.max(l-10,0):0;t.selectAll("."+S.cboutline).attr("x",(s?rt:st+P)+$).attr("y",(s?st+I-J:rt)+(u?xt:0)).attr(s?"width":"height",Math.max(X,2)).attr(s?"height":"width",Math.max(J-(s?2*I+xt:2*P+$),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":A});var H=s?nt*b:0,W=s?0:(1-it)*b-m;if(H=R?B.l-H:-H,W=D?B.t-W:-W,t.attr("transform",c(H,W)),!s&&(M||n(C).getAlpha()&&!n.equals(F.paper_bgcolor,C))){var G=vt.selectAll("text"),Y=G[0].length,Z=t.select("."+S.cbbg).node(),K=d.bBox(Z),Q=d.getTranslate(t),tt=2;G.each((function(t,e){var r=0,n=Y-1;if(e===r||e===n){var i,a=d.bBox(this),o=d.getTranslate(this);if(e===n){var s=a.right+o.x;(i=K.right+Q.x+st-M-tt+z-s)>0&&(i=0)}else if(e===r){var l=a.left+o.x;(i=K.left+Q.x+st+M+tt-l)<0&&(i=0)}i&&(Y<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var et={},at=k[E],ot=T[E],ut=k[L],ht=T[L],dt=b-X;s?("pixels"===g?(et.y=O,et.t=J*ut,et.b=J*ht):(et.t=et.b=0,et.yt=O+h*ut,et.yb=O-h*ht),"pixels"===_?(et.x=z,et.l=b*at,et.r=b*ot):(et.l=dt*at,et.r=dt*ot,et.xl=z-v*at,et.xr=z+v*ot)):("pixels"===g?(et.x=z,et.l=J*at,et.r=J*ot):(et.l=et.r=0,et.xl=z+h*at,et.xr=z-h*ot),"pixels"===_?(et.y=1-O,et.t=b*ut,et.b=b*ht):(et.t=dt*ut,et.b=dt*ht,et.yt=O-v*ut,et.yb=O+v*ht));var pt=e.y<.5?"b":"t",bt=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var _t={r:F.width-N-H,l:N+et.r,b:F.height-q-W,t:q+et.b};R&&D?i.autoMargin(a,e._id,et):R?a._fullLayout._reservedMargin[e._id][pt]=_t[pt]:D||s?a._fullLayout._reservedMargin[e._id][bt]=_t[bt]:a._fullLayout._reservedMargin[e._id][pt]=_t[pt]}return l.syncOrAsync([i.previousPromises,wt,Tt,kt,i.previousPromises,St],a)}(g,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,u=r._fullLayout,d=u._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+c(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/d.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/d.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var u=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}}}),Oa=d({"src/components/colorbar/index.js"(t,e){e.exports={moduleType:"component",name:"colorbar",attributes:Le(),supplyDefaults:Ue(),draw:za().draw,hasColorbar:ze()}}}),Da=d({"src/components/legend/index.js"(t,e){e.exports={moduleType:"component",name:"legend",layoutAttributes:fr(),supplyLayoutDefaults:gr(),draw:Tr(),style:kr()}}}),Ra=d({"src/locale-en.js"(t,e){e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),Fa=d({"src/locale-en-us.js"(t,e){e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),Ba=d({"src/snapshot/cloneplot.js"(t,e){var r=Vt(),n=se(),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var n,s,l=t.data,c=t.layout,u=a([],l),h=a({},c,o(e.tileClass)),d=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var p=Object.keys(h);for(n=0;n<p.length;n++)s=p[n],["xaxis","yaxis","zaxis"].indexOf(s.slice(0,5))>-1&&(h[p[n]].title={text:""});for(n=0;n<u.length;n++){var f=u[n];f.showscale=!1,f.marker&&(f.marker.showscale=!1),r.traceIs(f,"pie-like")&&(f.textposition="none")}}if(Array.isArray(e.annotations))for(n=0;n<e.annotations.length;n++)h.annotations.push(e.annotations[n]);var m=Object.keys(h).filter((function(t){return t.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===e.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<m.length;n++){var y=h[m[n]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var x={gd:v,td:v,layout:h,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=o(e.tileClass),x}}}),ja=d({"src/snapshot/toimage.js"(t,e){var r=he().EventEmitter,n=Vt(),i=se(),a=On(),o=Ba(),s=Dn(),l=Rn();e.exports=function(t,e){var c=new r,u=o(t,{format:"png"}),h=u.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var d=a.getRedrawFunc(h);return n.call("_doPlot",h,u.data,u.layout,u.config).then(d).then((function(){var t=a.getDelay(h._fullLayout);setTimeout((function(){var t=s(h),r=document.createElement("canvas");r.id=i.randstr(),(c=l({format:e.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:r,emitter:c,svg:t})).clean=function(){h&&document.body.removeChild(h)}}),t)})).catch((function(t){c.emit("error",t)})),c}}}),Na=d({"src/snapshot/index.js"(t,e){var r=On(),n={getDelay:r.getDelay,getRedrawFunc:r.getRedrawFunc,clone:Ba(),toSVG:Dn(),svgToImg:Rn(),toImage:ja(),downloadImage:Nn()};e.exports=n}}),Ua=d({"src/core.js"(t){t.version=g().version,y(),le();var e,r,n=Vt(),i=t.register=n.register,a=Vn(),o=Object.keys(a);for(r=0;r<o.length;r++)"_"!==(e=o[r]).charAt(0)&&(t[e]=a[e]),i({moduleType:"apiMethod",name:e,fn:a[e]});i(Mi()),i([Di(),Ui(),Mn(),Wi(),Ki(),na(),la(),ga(),wa(),Ta(),Pa(),We(),Oa(),Da(),zr(),Qr()]),i([Ra(),Fa()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=Rr();var s=zr(),l=ke();t.Plots={resize:l.resize,graphJson:l.graphJson,sendDataToCloud:l.sendDataToCloud},t.Fx={hover:s.hover,unhover:s.unhover,loneHover:s.loneHover,loneUnhover:s.loneUnhover},t.Snapshot=Na(),t.PlotSchema=me()}}),Va=d({"lib/core.js"(t,e){e.exports=Ua()}}),qa=d({"src/traces/bar/constants.js"(t,e){e.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}}),$a=d({"src/traces/bar/attributes.js"(t,e){var r=wn(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=Pe(),s=R(),l=qa(),c=It().pattern,u=D().extendFlat,h=s({editType:"calc",arrayOk:!0,colorEditType:"style"}),d=u({},r.marker.line.width,{dflt:0}),p=u({width:d,editType:"calc"},o("marker.line")),f=u({line:p,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:c,cornerradius:{valType:"any",editType:"calc"}});e.exports={x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:r.text,texttemplate:a({editType:"plot"},{keys:l.eventDataKeys}),hovertext:r.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:u({},h,{}),insidetextfont:u({},h,{}),outsidetextfont:u({},h,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:u({},r.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:f,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:{marker:{opacity:r.selected.marker.opacity,color:r.selected.marker.color,editType:"style"},textfont:r.selected.textfont,editType:"style"},unselected:{marker:{opacity:r.unselected.marker.opacity,color:r.unselected.marker.color,editType:"style"},textfont:r.unselected.textfont,editType:"style"},zorder:r.zorder}}}),Ha=d({"src/traces/bar/layout_attributes.js"(t,e){e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}}),Wa=d({"src/traces/bar/style_defaults.js"(t,e){var r=q(),n=Me().hasColorscale,i=Ve(),a=se().coercePattern;e.exports=function(t,e,o,s,l){var c=o("marker.color",s),u=n(t,"marker");u&&i(t,e,l,o,{prefix:"marker.",cLetter:"c"}),o("marker.line.color",r.defaultLine),n(t,"marker.line")&&i(t,e,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width"),o("marker.opacity"),a(o,"marker.pattern",c,u),o("selected.marker.color"),o("unselected.marker.color")}}}),Ga=d({"src/traces/bar/defaults.js"(t,e){var r=k(),n=se(),i=q(),a=Vt(),o=qn(),s=$n(),l=Wa(),c=Jn(),u=$a(),h=n.coerceFont;function d(t){if(r(t)){if((t=+t)>=0)return t}else if("string"===typeof t&&"%"===(t=t.trim()).slice(-1)&&r(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function p(t,e,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),d=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),f=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),b=!(t.textfont&&t.textfont.color);if(b&&delete x.color,h(i,"insidetextfont",x),f){var _=n.extendFlat({},v);b&&delete _.color,h(i,"pathbar.textfont",_)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),d&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function h(r,i){return n.coerce(t,e,u,r,i)}if(o(t,e,c,h)){s(t,e,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",e.x&&!e.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var d=h("textposition");p(t,0,c,h,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,c);var f=(e.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(t,e,f||i.defaultLine,{axis:"y"}),m(t,e,f||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t,e){return n.coerce(i._input,i,u,t,e)}for(var o=0;o<t.length;o++)if("bar"===(i=t[o]).type){r=i._input;var s=a("marker.cornerradius",e.barcornerradius);i.marker&&(i.marker.cornerradius=d(s)),c(r,i,e,a,e.barmode)}},handleText:p,validateCornerradius:d}}}),Ya=d({"src/traces/bar/layout_defaults.js"(t,e){var r=Vt(),n=nr(),i=se(),a=Ha(),o=Ga().validateCornerradius;e.exports=function(t,e,s){function l(r,n){return i.coerce(t,e,a,r,n)}for(var c=!1,u=!1,h=!1,d={},p=l("barmode"),f="group"===p,m=0;m<s.length;m++){var g=s[m];if(r.traceIs(g,"bar")&&g.visible){c=!0;var y=g.xaxis+g.yaxis;f?(d[y]&&(h=!0),d[y]=!0):(y+=g._input.offsetgroup,d.length>0&&!d[y]&&(h=!0),d[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:e},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==p&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}}),Za=d({"src/traces/bar/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.hovertext,t,"htx");var i=e.marker;if(i){r.mergeArray(i.opacity,t,"mo",!0),r.mergeArray(i.color,t,"mc");var a=i.line;a&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"))}}}}),Xa=d({"src/traces/bar/calc.js"(t,e){var r=nr(),n=ei(),i=Me().hasColorscale,a=He(),o=Za(),s=ii();e.exports=function(t,e){var l,c,u,h,d,p,f=r.getFromId(t,e.xaxis||"x"),m=r.getFromId(t,e.yaxis||"y"),g={msUTC:!(!e.base&&0!==e.base)};"h"===e.orientation?(l=f.makeCalcdata(e,"x",g),u=m.makeCalcdata(e,"y"),h=n(e,m,"y",u),d=!!e.yperiodalignment,p="y"):(l=m.makeCalcdata(e,"y",g),u=f.makeCalcdata(e,"x"),h=n(e,f,"x",u),d=!!e.xperiodalignment,p="x"),c=h.vals;for(var y=Math.min(c.length,l.length),v=new Array(y),x=0;x<y;x++)v[x]={p:c[x],s:l[x]},d&&(v[x].orig_p=u[x],v[x][p+"End"]=h.ends[x],v[x][p+"Start"]=h.starts[x]),e.ids&&(v[x].id=String(e.ids[x]));return i(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),i(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(v,e),s(v,e),v}}}),Ka=d({"src/traces/bar/uniform_text.js"(t,e){var r=v(),n=se();function i(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=i(t),a=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=o<a,r[n]=r[n]||1/0,e.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(t,e){e[i(t)]=void 0},resizeText:function(t,e,i){var a=t._fullLayout,o=a["_"+i+"Text_minsize"];if(o){var s,l="hide"===a.uniformtext.mode;switch(i){case"funnelarea":case"pie":case"sunburst":s="g.slice";break;case"treemap":case"icicle":s="g.slice, g.pathbar";break;default:s="g.points > g.point"}e.selectAll(s).each((function(t){var e=t.transform;if(e){e.scale=l&&e.hide?0:o/e.fontSize;var i=r.select(this).select("text");n.setTransormAndDisplay(i,e)}}))}}}}}),Ja=d({"src/traces/bar/helpers.js"(t){var e=k(),r=O(),n=se().isArrayOrTypedArray;t.coerceString=function(t,e,r){if("string"===typeof e){if(e||!t.noBlank)return e}else if(("number"===typeof e||!0===e)&&!t.strict)return String(e);return void 0!==r?r:t.dflt},t.coerceNumber=function(t,r,n){if(e(r)){r=+r;var i=t.min,a=t.max;if(!(void 0!==i&&r<i||void 0!==a&&r>a))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,e,n){return r(e).isValid()?e:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},t.getValue=function(t,e){var r;return n(t)?e<t.length&&(r=t[e]):r=t,r},t.getLineWidth=function(t,e){return 0<e.mlw?e.mlw:n(t.marker.line.width)?0:t.marker.line.width}}}),Qa=d({"src/traces/bar/style.js"(t,e){var r=v(),n=q(),i=Je(),a=se(),o=Vt(),s=Ka().resizeText,l=$a(),c=l.textfont,u=l.insidetextfont,h=l.outsidetextfont,d=Ja();function p(t,e,r){i.pointStyle(t.selectAll("path"),e,r),f(t,e,r)}function f(t,e,n){t.selectAll("text").each((function(t){var o=r.select(this),s=a.ensureUniformFontSize(n,m(o,t,e,n));i.font(o,s)}))}function m(t,e,r,n){var i=n._fullLayout.font,a=r.textfont;if(t.classed("bartext-inside")){var o=_(e,r);a=y(r,e.i,i,o)}else t.classed("bartext-outside")&&(a=x(r,e.i,i));return a}function g(t,e,r){return b(c,t.textfont,e,r)}function y(t,e,r,i){var a=g(t,e,r);return(void 0===t._input.textfont||void 0===t._input.textfont.color||Array.isArray(t.textfont.color)&&void 0===t.textfont.color[e])&&(a={color:n.contrast(i),family:a.family,size:a.size,weight:a.weight,style:a.style,variant:a.variant,textcase:a.textcase,lineposition:a.lineposition,shadow:a.shadow}),b(u,t.insidetextfont,e,a)}function x(t,e,r){var n=g(t,e,r);return b(h,t.outsidetextfont,e,n)}function b(t,e,r,n){e=e||{};var i=d.getValue(e.family,r),a=d.getValue(e.size,r),o=d.getValue(e.color,r),s=d.getValue(e.weight,r),l=d.getValue(e.style,r),c=d.getValue(e.variant,r),u=d.getValue(e.textcase,r),h=d.getValue(e.lineposition,r),p=d.getValue(e.shadow,r);return{family:d.coerceString(t.family,i,n.family),size:d.coerceNumber(t.size,a,n.size),color:d.coerceColor(t.color,o,n.color),weight:d.coerceString(t.weight,s,n.weight),style:d.coerceString(t.style,l,n.style),variant:d.coerceString(t.variant,c,n.variant),textcase:d.coerceString(t.variant,u,n.textcase),lineposition:d.coerceString(t.variant,h,n.lineposition),shadow:d.coerceString(t.variant,p,n.shadow)}}function _(t,e){return"waterfall"===e.type?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}e.exports={style:function(t){var e=r.select(t).selectAll('g[class^="barlayer"]').selectAll("g.trace");s(t,e,"bar");var n=e.size(),i=t._fullLayout;e.style("opacity",(function(t){return t[0].trace.opacity})).each((function(t){("stack"===i.barmode&&n>1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){p(r.select(this),e[0].trace,t)})),o.getComponentMethod("errorbars","style")(e)},styleTextPoints:f,styleOnSelect:function(t,e,n){var s=e[0].trace;s.selectedpoints?function(t,e,n){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,n){t.each((function(t){var o,s=r.select(this);if(t.selected){o=a.ensureUniformFontSize(n,m(s,t,e,n));var l=e.selected.textfont&&e.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,n)}(n,s,t):(p(n,s,t),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}}}),to=d({"src/traces/bar/plot.js"(t,e){var r=v(),n=k(),i=se(),a=Ae(),o=q(),s=Je(),l=Vt(),c=nr().tickText,u=Ka(),h=u.recordMinTextSize,d=u.clearMinTextSize,p=Qa(),f=Ja(),m=qa(),g=$a(),y=g.text,x=g.textposition,b=Ze().appendArrayPointValue,_=m.TEXTPAD;function w(t){return t.id}function T(t){return(t>0)-(t<0)}function S(t,e){return t<e?1:-1}function A(t,e,r,n){var i;return!e.uniformtext.mode&&M(r)?(n&&(i=n()),t.transition().duration(r.duration).ease(r.easing).each("end",(function(){i&&i()})).each("interrupt",(function(){i&&i()}))):t}function M(t){return t&&t.duration>0}function C(t,e,r,n,i){return!(t<0||e<0)&&(r<=t&&n<=e||r<=e&&n<=t||(i?t>=r*(e/n):e>=n*(t/r)))}function E(t){return"auto"===t?0:t}function L(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function P(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,d=((a.leftToRight||0)+1)/2,p=1-d,f=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(e-t),b=Math.abs(n-r),w=x>2*_&&b>2*_?_:0;x-=2*w,b-=2*w;var k=E(l);"auto"!==l||y<=x&&v<=b||!(y>x||v>b)||(y>b||v>x)&&y<v===x<b||(k+=90);var T,A,M=L(i,k);if(m&&m-g>_){var C=function(t,e,r,n,i,a,o,s,l){var c,u,h,d,p,f=Math.max(0,Math.abs(e-t)-2*_),m=Math.max(0,Math.abs(n-r)-2*_),g=a-_,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(f-v)?d=m/i.y:i.y/i.x<=(m-x)/f?d=f/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(f-g)*(f-g)+(m/2-g)*(m/2-g)-g*g,d=(-(u=-2*i.x*(f-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(f/2-g)*(f/2-g)+(m/2-g)*(m/2-g)-g*g,d=(-(u=-i.x*(f/2-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(f/2-g)*(f/2-g)+(m-g)*(m-g)-g*g,d=(-(u=-i.x*(f/2-g)-2*i.y*(m-g))+Math.sqrt(u*u-4*c*h))/(2*c)),d=Math.min(1,d),p=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*d)/2)*(g-(m-i.y*d)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(f-i.x*d)/2)*(g-(f-i.x*d)/2)))-o),{scale:d,pad:p}}(t,e,r,n,M,m,g,o,f);T=C.scale,A=C.pad}else T=1,s&&(T=Math.min(1,x/M.x,b/M.y)),A=0;var P=i.left*p+i.right*d,I=(i.top+i.bottom)/2,z=(t+_)*p+(e-_)*d,O=(r+n)/2,D=0,R=0;if(h||u){var F=(o?M.x:M.y)/2;m&&(u||f)&&(w+=A);var B=o?S(t,e):S(r,n);o?h?(z=t+B*w,D=-B*F):(z=e-B*w,D=B*F):h?(O=r+B*w,R=-B*F):(O=n-B*w,R=B*F)}return{textX:P,textY:I,targetX:z,targetY:O,anchorX:D,anchorY:R,scale:T,rotate:k}}e.exports={plot:function(t,e,u,m,g,v){var k=e.xaxis,I=e.yaxis,z=t._fullLayout,O=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},d("bar",z));var D=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),d=l[0].trace,m=l[0].t,D="waterfall"===d.type,R="funnel"===d.type,F="histogram"===d.type,B="bar"===d.type,j=B||R,N=0;D&&d.connector.visible&&"between"===d.connector.mode&&(N=d.connector.line.width/2);var U="h"===d.orientation,V=M(g),q=i.ensureSingle(u,"g","points"),$=function(t){if(t.ids)return w}(d),H=q.selectAll("g.point").data(i.identity,$);H.enter().append("g").classed("point",!0),H.exit().remove(),H.each((function(u,w){var M,D,R=r.select(this),q=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(u,k,I,U),$=q[0][0],H=q[0][1],W=q[1][0],G=q[1][1],Y=0===(U?H-$:G-W);if(Y&&j&&f.getLineWidth(d,u)&&(Y=!1),Y||(Y=!n($)||!n(H)||!n(W)||!n(G)),u.isBlank=Y,Y&&(U?H=$:G=W),N&&!Y&&(U?($-=S($,H)*N,H+=S($,H)*N):(W-=S(W,G)*N,G+=S(W,G)*N)),"waterfall"===d.type){if(!Y){var Z=d[u.dir].marker;M=Z.line.width,D=Z.color}}else M=f.getLineWidth(d,u),D=u.mc||d.marker.color;function X(t){var e=r.round(M/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(t)-e,2):t}var K=o.opacity(D)<1||M>.01?X:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?X(t):t>e?Math.ceil(t):Math.floor(t)};t._context.staticPlot||($=K($,H,U),H=K(H,$,U),W=K(W,G,!U),G=K(G,W,!U));var J,Q=U?k.c2p:I.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var tt,et,rt=B||F?function(t,e){if(!t)return 0;var r,n=U?Math.abs(G-W):Math.abs(H-$),i=U?Math.abs(H-$):Math.abs(G-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+$+","+W+"V"+G+"H"+H+"V"+W+"Z",it=0;if(rt&&u.s){var at=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((it=K(u.hasB?0:Math.abs(Q(J,!0)-Q(at,!0))))<rt){var ot=S($,H),st=S(W,G),lt=ot===-st?1:0;if(U)if(u.hasB)tt="M"+($+rt*ot)+","+W+"A "+rt+","+rt+" 0 0 "+lt+" "+$+","+(W+rt*st)+"V"+(G-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+($+rt*ot)+","+G+"H"+(H-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(G-rt*st)+"V"+(W+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H-rt*ot)+","+W+"Z";else{var ct=(et=Math.abs(H-$)+it)<rt?rt-Math.sqrt(et*(2*rt-et)):0,ut=it>0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+$+","+W+"V"+(G-ct*st)+"H"+ht(H-(rt-it)*ot,$)+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(G-rt*st-ut)+"V"+(W+rt*st+ut)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(H-(rt-it)*ot,$)+","+(W+ct*st)+"Z"}else if(u.hasB)tt="M"+($+rt*ot)+","+W+"A "+rt+","+rt+" 0 0 "+lt+" "+$+","+(W+rt*st)+"V"+(G-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+($+rt*ot)+","+G+"H"+(H-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(G-rt*st)+"V"+(W+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H-rt*ot)+","+W+"Z";else{var dt=(et=Math.abs(G-W)+it)<rt?rt-Math.sqrt(et*(2*rt-et)):0,pt=it>0?Math.sqrt(it*(2*rt-it)):0,ft=st>0?Math.max:Math.min;tt="M"+($+dt*ot)+","+W+"V"+ft(G-(rt-it)*st,W)+"A "+rt+","+rt+" 0 0 "+lt+" "+($+rt*ot-pt)+","+G+"H"+(H-rt*ot+pt)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H-dt*ot)+","+ft(G-(rt-it)*st,W)+"V"+W+"Z"}}else tt=nt}else tt=nt;var mt=A(i.ensureSingle(R,"path"),z,g,v);if(mt.style("vector-effect",O?"none":"non-scaling-stroke").attr("d",isNaN((H-$)*(G-W))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(d);s.singlePointStyle(u,mt,d,gt,t)}!function(t,e,r,n,o,l,u,d,m,g,v,w,k){var T,M=e.xaxis,I=e.yaxis,z=t._fullLayout;function O(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+T,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var D=n[0].trace,R="h"===D.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace,l=s.texttemplate;return o=l?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,d,p="histogram"===o.type,f="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return c(u,u.c2l(t),!0).text}function v(t){return c(d,d.c2l(t),!0).text}g?(l="y",u=a,h="x",d=n):(l="x",u=n,h="y",d=a);var x=e[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[h+"Label"]=v(x.s);var k={};b(k,o,x.i),(p||void 0===k.x)&&(k.x=g?_.value:_.label),(p||void 0===k.y)&&(k.y=g?_.label:_.value),(p||void 0===k.xLabel)&&(k.xLabel=g?_.valueLabel:_.labelLabel),(p||void 0===k.yLabel)&&(k.yLabel=g?_.labelLabel:_.valueLabel),f&&(_.delta=+x.rawS||x.s,_.deltaLabel=v(_.delta),_.final=x.v,_.finalLabel=v(_.final),_.initial=_.final-_.delta,_.initialLabel=v(_.initial)),m&&(_.value=x.s,_.valueLabel=v(_.value),_.percentInitial=x.begR,_.percentInitialLabel=i.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=i.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=i.formatPercent(x.sumR));var T=i.castOption(o,x.i,"customdata");return T&&(_.customdata=T),i.texttemplateString(s,_,t._d3locale,k,_,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(t){return c(o?n:r,t,!0).text}function h(t){return c(o?r:n,+t,!0).text}var d,p=a.textinfo,f=t[e],m=p.split("+"),g=[],y=function(t){return-1!==m.indexOf(t)};if(y("label")&&g.push(u(t[e].p)),y("text")&&(0===(d=i.castOption(a,f.i,"text"))||d)&&g.push(d),s){var v=+f.rawS||f.s,x=f.v,b=x-v;y("initial")&&g.push(h(b)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(f.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(d=i.formatPercent(f.begR),w&&(d+=" of initial"),g.push(d)),y("percent previous")&&(d=i.formatPercent(f.difR),w&&(d+=" of previous"),g.push(d)),y("percent total")&&(d=i.formatPercent(f.sumR),w&&(d+=" of total"),g.push(d))}return g.join("<br>")}(e,r,n,a):f.getValue(s.text,r),f.coerceString(y,o)}(z,n,o,M,I);T=function(t,e){var r=f.getValue(t.textposition,e);return f.coerceEnumerated(x,r)}(D,o);var B="stack"===w.mode||"relative"===w.mode,j=n[o],N=!B||j._outmost,U=j.hasB,V=g&&g-v>_;if(F&&"none"!==T&&(!j.isBlank&&l!==u&&d!==m||"auto"!==T&&"inside"!==T)){var q=z.font,$=p.getBarColor(n[o],D),H=p.getInsideTextFont(D,o,q,$),W=p.getOutsideTextFont(D,o,q),G=D.insidetextanchor||"end",Y=r.datum();R?"log"===M.type&&Y.s0<=0&&(l=M.range[0]<M.range[1]?0:M._length):"log"===I.type&&Y.s0<=0&&(d=I.range[0]<I.range[1]?I._length:0);var Z,X,K,J,Q,tt=Math.abs(u-l),et=Math.abs(m-d),rt=tt-2*_,nt=et-2*_;if("outside"===T&&(N||j.hasB||(T="inside")),"auto"===T)if(N){T="inside",Z=O(r,F,Q=i.ensureUniformFontSize(t,H)),K=(X=s.bBox(Z.node())).width,J=X.height;var it,at=K>0&&J>0;it=V?U?C(rt-2*g,nt,K,J,R)||C(rt,nt-2*g,K,J,R):R?C(rt-(g-v),nt,K,J,R)||C(rt,nt-2*(g-v),K,J,R):C(rt,nt-(g-v),K,J,R)||C(rt-2*(g-v),nt,K,J,R):C(rt,nt,K,J,R),at&&it?T="inside":(T="outside",Z.remove(),Z=null)}else T="inside";if(!Z){var ot=(Z=O(r,F,Q=i.ensureUniformFontSize(t,"outside"===T?W:H))).attr("transform");if(Z.attr("transform",""),K=(X=s.bBox(Z.node())).width,J=X.height,Z.attr("transform",ot),K<=0||J<=0)return void Z.remove()}var st,lt=D.textangle;st="outside"===T?function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,d=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:d>2*_?_:0;var f=1;l&&(f=s?Math.min(1,p/h):Math.min(1,d/u));var m=E(c),g=L(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,k=0,T=0,A=s?S(e,t):S(r,n);return s?(b=e-A*o,k=A*y):(w=n+A*o,T=-A*y),{textX:v,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:T,scale:f,rotate:m}}(l,u,d,m,X,{isHorizontal:R,constrained:"both"===D.constraintext||"outside"===D.constraintext,angle:lt}):P(l,u,d,m,X,{isHorizontal:R,constrained:"both"===D.constraintext||"inside"===D.constraintext,angle:lt,anchor:G,hasB:U,r:g,overhead:v}),st.fontSize=Q.size,h("histogram"===D.type?"bar":D.type,st,z),j.transform=st;var ct=A(Z,z,w,k);i.setTransormAndDisplay(ct,st)}else r.select("text").remove()}(t,e,R,l,w,$,H,W,G,rt,it,g,v),e.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),k,I,d.xcalendar,d.ycalendar)}));var W=!1===d.cliponaxis;s.setClipUrl(u,W?null:e.layerClipId,t)}));l.getComponentMethod("errorbars","plot")(t,D,e,g)},toMoveInsideBar:P}}}),eo=d({"src/traces/bar/hover.js"(t,e){var r=zr(),n=Vt(),i=q(),a=se().fillText,o=Ja().getLineWidth,s=nr().hoverLabelText,l=T().BADNUM;function c(t,e,n,i,o){var c,u,h,d,p,f,m,g=t.cd,y=g[0].trace,v=g[0].t,x="closest"===i,b="waterfall"===y.type,_=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(c=n,u=e,h="y",d="x",p=O,f=I):(c=e,u=n,h="x",d="y",f=O,p=I);var k=y[h+"period"],T=x||k;function S(t){return M(t,-1)}function A(t){return M(t,1)}function M(t,e){var r=t.w;return t[h]+e*r/2}function C(t){return t[h+"End"]-t[h+"Start"]}var E=x?S:k?function(t){return t.p-C(t)/2}:function(t){return Math.min(S(t),t.p-v.bardelta/2)},L=x?A:k?function(t){return t.p+C(t)/2}:function(t){return Math.max(A(t),t.p+v.bardelta/2)};function P(t,e,n){return o.finiteRange&&(n=0),r.inbox(t-c,e-c,n+Math.min(1,Math.abs(e-t)/m)-1)}function I(t){return P(E(t),L(t),_)}function z(t){var e=t[d];if(b){var r=Math.abs(t.rawS)||0;u>0?e+=r:u<0&&(e-=r)}return e}function O(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,_+(i-e)/(i-n)-1)}var D=t[h+"a"],R=t[d+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=r.getDistanceFunction(i,p,f,(function(t){return(p(t)+f(t))/2}));if(r.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==l){T||(E=function(t){return Math.min(S(t),t.p-v.bargroupwidth/2)},L=function(t){return Math.max(A(t),t.p+v.bargroupwidth/2)});var B=g[t.index],j=y.base?B.b+B.s:B.s;t[d+"0"]=t[d+"1"]=R.c2p(B[d],!0),t[d+"LabelVal"]=j;var N=v.extents[v.extents.round(B.p)];t[h+"0"]=D.c2p(x?E(B):N[0],!0),t[h+"1"]=D.c2p(x?L(B):N[1],!0);var U,V=void 0!==B.orig_p;return t[h+"LabelVal"]=V?B.orig_p:B.p,t.labelLabel=s(D,t[h+"LabelVal"],y[h+"hoverformat"]),t.valueLabel=s(R,t[d+"LabelVal"],y[d+"hoverformat"]),t.baseLabel=s(R,B.b,y[d+"hoverformat"]),t.spikeDistance=(function(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,w+(i-e)/(i-n)-1)}(B)+P(S(U=B),A(U),w))/2,t[h+"Spike"]=D.c2p(B.p,!0),a(B,y,t),t.hovertemplate=y.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=o(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i,a){var o=c(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),ro=d({"src/traces/bar/event_data.js"(t,e){e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}}),no=d({"src/traces/bar/select.js"(t,e){function r(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(n=0;n<i.length;n++)i[n].selected=0;else for(n=0;n<i.length;n++){var h=i[n],d="ct"in h?h.ct:r(h,a,o,c,l);e.contains(d,!1,n,t)?(u.push({pointNumber:n,x:a.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return u}}}),io=d({"src/traces/bar/index.js"(t,e){e.exports={attributes:$a(),layoutAttributes:Ha(),supplyDefaults:Ga().supplyDefaults,crossTraceDefaults:Ga().crossTraceDefaults,supplyLayoutDefaults:Ya(),calc:Xa(),crossTraceCalc:si().crossTraceCalc,colorbar:di(),arraysToCalcdata:Za(),plot:to().plot,style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:eo().hoverPoints,eventData:ro(),selectPoints:no(),moduleType:"trace",name:"bar",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}}),ao=d({"lib/bar.js"(t,e){e.exports=io()}}),oo=d({"src/traces/box/attributes.js"(t,e){var r=_n(),n=wn(),i=$a(),a=V(),o=Ce().axisHoverFormat,s=Ot().hovertemplateAttrs,l=D().extendFlat,c=n.marker,u=c.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:n.zorder}}}),so=d({"src/traces/box/layout_attributes.js"(t,e){e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}}),lo=d({"src/traces/box/defaults.js"(t,e){var r=se(),n=Vt(),i=q(),a=$n(),o=Jn(),s=er(),l=oo();function c(t,e,i,a){function o(t){var e=0;return t&&t.length&&(e+=1,r.isArrayOrTypedArray(t[0])&&t[0].length&&(e+=1)),e}function c(e){return r.validate(t[e],l[e])}var u,h=i("y"),d=i("x");if("box"===e.type){var p=i("q1"),f=i("median"),m=i("q3");e._hasPreCompStats=p&&p.length&&f&&f.length&&m&&m.length,u=Math.min(r.minRowLength(p),r.minRowLength(f),r.minRowLength(m))}var g,y,v=o(h),x=o(d),b=v&&r.minRowLength(h),_=x&&r.minRowLength(d),w=a.calendar,k={autotypenumbers:a.autotypenumbers};if(e._hasPreCompStats)switch(String(x)+String(v)){case"00":var T=c("x0")||c("dx");g=!c("y0")&&!c("dy")||T?"v":"h",y=u;break;case"10":g="v",y=Math.min(u,_);break;case"20":g="h",y=Math.min(u,d.length);break;case"01":g="h",y=Math.min(u,b);break;case"02":g="v",y=Math.min(u,h.length);break;case"12":g="v",y=Math.min(u,_,h.length);break;case"21":g="h",y=Math.min(u,d.length,b);break;case"11":y=0;break;case"22":var S,A=!1;for(S=0;S<d.length;S++)if("category"===s(d[S],w,k)){A=!0;break}if(A)g="v",y=Math.min(u,_,h.length);else{for(S=0;S<h.length;S++)if("category"===s(h[S],w,k)){A=!0;break}A?(g="h",y=Math.min(u,d.length,b)):(g="v",y=Math.min(u,_,h.length))}}else v>0?(g="v",y=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",y=Math.min(_)):y=0;if(y){e._length=y;var M=i("orientation",g);e._hasPreCompStats?"v"===M&&0===x?(i("x0",0),i("dx",1)):"h"===M&&0===v&&(i("y0",0),i("dy",1)):"v"===M&&0===x?i("x0"):"h"===M&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function u(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete e.marker;var h=n("hoveron");"all"!==h&&-1===h.indexOf("points")||n("hovertemplate"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,o){function s(n,i){return r.coerce(t,e,l,n,i)}if(c(t,e,s,o),!1!==e.visible){a(t,e,o,s),s("xhoverformat"),s("yhoverformat");var h=e._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var d=!1;if(h){var p=s("mean"),f=s("sd");p&&p.length&&(d=!0,f&&f.length&&(d="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",d)),s("showwhiskers","quartiles"===g),"sd"!==g&&"sd"!==m||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(t.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(t,e,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(t,e){var n,i;function a(t){return r.coerce(i._input,i,l,t)}for(var s=0;s<t.length;s++){var c=(i=t[s]).type;if("box"===c||"violin"===c){n=i._input;var u=e[c+"mode"];"group"===u&&o(n,i,e,a,u)}}},handleSampleDefaults:c,handlePointsDefaults:u}}}),co=d({"src/traces/box/layout_defaults.js"(t,e){var r=Vt(),n=se(),i=so();function a(t,e,n,i,a){for(var o=a+"Layout",s=!1,l=0;l<n.length;l++){var c=n[l];if(r.traceIs(c,o)){s=!0;break}}s&&(i(a+"mode"),i(a+"gap"),i(a+"groupgap"))}e.exports={supplyLayoutDefaults:function(t,e,r){a(0,0,r,(function(r,a){return n.coerce(t,e,i,r,a)}),"box")},_supply:a}}}),uo=d({"src/traces/box/calc.js"(t,e){var r=k(),n=nr(),i=ei(),a=se(),o=T().BADNUM,s=a._;e.exports=function(t,e){var l,y,v,x,b,_,w,k=t._fullLayout,T=n.getFromId(t,e.xaxis||"x"),S=n.getFromId(t,e.yaxis||"y"),A=[],M="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=T,x="x",b=S,_="y",w=!!e.yperiodalignment):(v=S,x="y",b=T,_="x",w=!!e.xperiodalignment);var C,E,L,P,I,z,O=function(t,e,n,o){var s,l=e in t,c=e+"0"in t,u="d"+e in t;if(l||c&&u){var h=n.makeCalcdata(t,e);return[i(t,n,e,h).vals,h]}s=c?t[e+"0"]:"name"in t&&("category"===n.type||r(t.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(t.name)&&"date"===n.type)?t.name:o;for(var d="multicategory"===n.type?n.r2c_just_indices(s):n.d2c(s,0,t[e+"calendar"]),p=t._length,f=new Array(p),m=0;m<p;m++)f[m]=d;return[f]}(e,_,b,k[M]),D=O[0],R=O[1],F=a.distinctVals(D,b),B=F.vals,j=F.minDiff/2,N="all"===(e.boxpoints||e.points)?a.identity:function(t){return t.v<C.lf||t.v>C.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[l])},q=1/0,$=-1/0;for(l=0;l<e._length;l++){var H=D[l];if(r(H)){if((C={}).pos=C[_]=H,w&&R&&(C.orig_p=R[l]),C.q1=V("q1"),C.med=V("median"),C.q3=V("q3"),E=[],U&&a.isArrayOrTypedArray(U[l]))for(y=0;y<U[l].length;y++)(z=v.d2c(U[l][y]))!==o&&(c(I={v:z,i:[l,y]},e,[l,y]),E.push(I));if(C.pts=E.sort(u),P=(L=C[x]=E.map(h)).length,C.med!==o&&C.q1!==o&&C.q3!==o&&C.med>=C.q1&&C.q3>=C.med){var W=V("lowerfence");C.lf=W!==o&&W<=C.q1?W:d(C,L,P);var G=V("upperfence");C.uf=G!==o&&G>=C.q3?G:p(C,L,P);var Y=V("mean");C.mean=Y!==o?Y:P?a.mean(L,P):(C.q1+C.q3)/2;var Z=V("sd");C.sd=Y!==o&&Z>=0?Z:P?a.stdev(L,P,C.mean):C.q3-C.q1,C.lo=f(C),C.uo=m(C);var X=V("notchspan");X=X!==o&&X>0?X:g(C,P),C.ln=C.med-X,C.un=C.med+X;var K=C.lf,J=C.uf;e.boxpoints&&L.length&&(K=Math.min(K,L[0]),J=Math.max(J,L[P-1])),e.notched&&(K=Math.min(K,C.ln),J=Math.max(J,C.un)),C.min=K,C.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+C.q1,"median = "+C.med,"q3 = "+C.q3].join("\n")),Q=C.med!==o?C.med:C.q1!==o?C.q3!==o?(C.q1+C.q3)/2:C.q1:C.q3!==o?C.q3:0,C.med=Q,C.q1=C.q3=Q,C.lf=C.uf=Q,C.mean=C.sd=Q,C.ln=C.un=Q,C.min=C.max=Q}q=Math.min(q,C.min),$=Math.max($,C.max),C.pts2=E.filter(N),A.push(C)}}e._extremes[v._id]=n.findExtremes(v,[q,$],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i<r;i++)n[i]=t[i]-e;return n[r]=t[r-1]+e,n}(B,j),rt=B.length,nt=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=[];return e}(rt);for(l=0;l<e._length;l++)if(z=tt[l],r(z)){var it=a.findBin(D[l],et);it>=0&&it<rt&&(c(I={v:z,i:l},e,l),nt[it].push(I))}var at=1/0,ot=-1/0,st=e.quartilemethod,lt="exclusive"===st,ct="inclusive"===st;for(l=0;l<rt;l++)if(nt[l].length>0){var ut,ht;(C={}).pos=C[_]=B[l],E=C.pts=nt[l].sort(u),P=(L=C[x]=E.map(h)).length,C.min=L[0],C.max=L[P-1],C.mean=a.mean(L,P),C.sd=a.stdev(L,P,C.mean)*e.sdmultiple,C.med=a.interp(L,.5),P%2&&(lt||ct)?(lt?(ut=L.slice(0,P/2),ht=L.slice(P/2+1)):ct&&(ut=L.slice(0,P/2+1),ht=L.slice(P/2)),C.q1=a.interp(ut,.5),C.q3=a.interp(ht,.5)):(C.q1=a.interp(L,.25),C.q3=a.interp(L,.75)),C.lf=d(C,L,P),C.uf=p(C,L,P),C.lo=f(C),C.uo=m(C);var dt=g(C,P);C.ln=C.med-dt,C.un=C.med+dt,at=Math.min(at,C.ln),ot=Math.max(ot,C.un),C.pts2=E.filter(N),A.push(C)}e.notched&&a.isTypedArray(tt)&&(tt=Array.from(tt)),e._extremes[v._id]=n.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r<t.length;r++){for(var n=t[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,e,i)}}(A,e),A.length>0?(A[0].t={num:k[M],dPos:j,posLetter:_,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean||"sd"===e.sizemode?s(t,"mean \xb1 \u03c3:").replace("\u03c3",1===e.sdmultiple?"\u03c3":e.sdmultiple+"\u03c3"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},k[M]++,A):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)a.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function d(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(a.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(a.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function f(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}}}),ho=d({"src/traces/box/cross_trace_calc.js"(t,e){var r=nr(),n=se(),i=en().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,c,u=e.calcdata,h=e._fullLayout,d=o._id,p=d.charAt(0),f=[],m=0;for(s=0;s<a.length;s++)for(c=u[a[s]],l=0;l<c.length;l++)f.push(o.c2l(c[l].pos,!0)),m+=(c[l].pts2||[]).length;if(f.length){var g=n.distinctVals(f);"category"!==o.type&&"multicategory"!==o.type||(g.minDiff=1);var y=g.minDiff/2;r.minDtick(o,g.minDiff,g.vals[0],!0);var v=h["violin"===t?"_numViolins":"_numBoxes"],x="group"===h[t+"mode"]&&v>1,b=1-h[t+"gap"],_=1-h[t+"groupgap"];for(s=0;s<a.length;s++){var w,k,T,S,A,M,C=(c=u[a[s]])[0].trace,E=c[0].t,L=C.width,P=C.side;if(L)w=k=S=L/2,T=0;else if(w=y,x){var I=i(h,o._id)+C.orientation,z=(h._alignmentOpts[I]||{})[C.alignmentgroup]||{},O=Object.keys(z.offsetGroups||{}).length,D=O||v;k=w*b*_/D,T=2*w*(((O?C._offsetIndex:E.num)+.5)/D-.5)*b,S=w*b/D}else k=w*b*_,T=0,S=w;E.dPos=w,E.bPos=T,E.bdPos=k,E.wHover=S;var R,F,B,j,N,U,V=T+k,q=Boolean(L);if("positive"===P?(A=w*(L?1:.5),R=V,M=R=T):"negative"===P?(A=R=T,M=w*(L?1:.5),F=V):(A=M=w,R=F=V),(C.boxpoints||C.points)&&m>0){var $=C.pointpos,H=C.jitter,W=C.marker.size/2,G=0;$+H>=0&&((G=V*($+H))>A?(q=!0,N=W,B=G):G>R&&(N=W,B=A)),G<=A&&(B=A);var Y=0;$-H<=0&&((Y=-V*($-H))>M?(q=!0,U=W,j=Y):Y>F&&(U=W,j=M)),Y<=M&&(j=M)}else B=A,j=M;var Z=new Array(c.length);for(l=0;l<c.length;l++)Z[l]=c[l].pos;C._extremes[d]=r.findExtremes(o,Z,{padded:q,vpadminus:j,vpadplus:B,vpadLinearized:!0,ppadminus:{x:U,y:N}[p],ppadplus:{x:N,y:U}[p]})}}}e.exports={crossTraceCalc:function(t,e){for(var r=t.calcdata,n=e.xaxis,i=e.yaxis,s=0;s<a.length;s++){for(var l=a[s],c="h"===l?i:n,u=[],h=0;h<r.length;h++){var d=r[h],p=d[0].t,f=d[0].trace;!0!==f.visible||"box"!==f.type&&"candlestick"!==f.type||p.empty||(f.orientation||"v")!==l||f.xaxis!==n._id||f.yaxis!==i._id||u.push(h)}o("box",t,u,c)}},setPositionOffset:o}}}),po=d({"src/traces/box/plot.js"(t,e){var r=v(),n=se(),i=Je();function a(t,e,i,a,o){var s,l,c="h"===i.orientation,u=e.val,h=e.pos,d=!!h.rangebreaks,p=a.bPos,f=a.wdPos||0,m=a.bPosPxOffset||0,g=i.whiskerwidth||0,y=!1!==i.showwhiskers,v=i.notched||!1,x=v?1-2*i.notchwidth:1;Array.isArray(a.bdPos)?(s=a.bdPos[0],l=a.bdPos[1]):(s=a.bdPos,l=a.bdPos);var b=t.selectAll("path.box").data("violin"!==i.type||i.box.visible?n.identity:[]);b.enter().append("path").style("vector-effect",o?"none":"non-scaling-stroke").attr("class","box"),b.exit().remove(),b.each((function(t){if(t.empty)return r.select(this).attr("d","M0,0Z");var e=h.c2l(t.pos+p,!0),a=h.l2p(e-s)+m,o=h.l2p(e+l)+m,b=d?(a+o)/2:h.l2p(e)+m,_=i.whiskerwidth,w=d?a*_+(1-_)*b:h.l2p(e-f)+m,k=d?o*_+(1-_)*b:h.l2p(e+f)+m,T=h.l2p(e-s*x)+m,S=h.l2p(e+l*x)+m,A="sd"===i.sizemode,M=u.c2p(A?t.mean-t.sd:t.q1,!0),C=A?u.c2p(t.mean+t.sd,!0):u.c2p(t.q3,!0),E=n.constrain(A?u.c2p(t.mean,!0):u.c2p(t.med,!0),Math.min(M,C)+1,Math.max(M,C)-1),L=void 0===t.lf||!1===i.boxpoints||A,P=u.c2p(L?t.min:t.lf,!0),I=u.c2p(L?t.max:t.uf,!0),z=u.c2p(t.ln,!0),O=u.c2p(t.un,!0);c?r.select(this).attr("d","M"+E+","+T+"V"+S+"M"+M+","+a+"V"+o+(v?"H"+z+"L"+E+","+S+"L"+O+","+o:"")+"H"+C+"V"+a+(v?"H"+O+"L"+E+","+T+"L"+z+","+a:"")+"Z"+(y?"M"+M+","+b+"H"+P+"M"+C+","+b+"H"+I+(0===g?"":"M"+P+","+w+"V"+k+"M"+I+","+w+"V"+k):"")):r.select(this).attr("d","M"+T+","+E+"H"+S+"M"+a+","+M+"H"+o+(v?"V"+z+"L"+S+","+E+"L"+o+","+O:"")+"V"+C+"H"+a+(v?"V"+O+"L"+T+","+E+"L"+a+","+z:"")+"Z"+(y?"M"+b+","+M+"V"+P+"M"+b+","+C+"V"+I+(0===g?"":"M"+w+","+P+"H"+k+"M"+w+","+I+"H"+k):""))}))}function o(t,e,r,a){var o=e.x,s=e.y,l=a.bdPos,c=a.bPos,u=r.boxpoints||r.points;n.seedPseudoRandom();var h=t.selectAll("g.points").data(u?function(t){return t.forEach((function(t){t.t=a,t.trace=r})),t}:[]);h.enter().append("g").attr("class","points"),h.exit().remove();var d=h.selectAll("path").data((function(t){var e,i,a=t.pts2,o=Math.max((t.max-t.min)/10,t.q3-t.q1),s=1e-9*o,h=.01*o,d=[],p=0;if(r.jitter){if(0===o)for(p=1,d=new Array(a.length),e=0;e<a.length;e++)d[e]=1;else for(e=0;e<a.length;e++){var f=Math.max(0,e-5),m=a[f].v,g=Math.min(a.length-1,e+5),y=a[g].v;"all"!==u&&(a[e].v<t.lf?y=Math.min(y,t.lf):m=Math.max(m,t.uf));var v=Math.sqrt(h*(g-f)/(y-m+s))||0;v=n.constrain(Math.abs(v),0,1),d.push(v),p=Math.max(v,p)}i=2*r.jitter/(p||1)}for(e=0;e<a.length;e++){var x=a[e],b=x.v,_=r.jitter?i*d[e]*(n.pseudoRandom()-.5):0,w=t.pos+c+l*(r.pointpos+_);"h"===r.orientation?(x.y=w,x.x=b):(x.x=w,x.y=b),"suspectedoutliers"===u&&b<t.uo&&b>t.lo&&(x.so=!0)}return a}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,s)}function s(t,e,i,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,h=a.bPos,d=a.bPosPxOffset||0,p=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var f=t.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);f.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),f.exit().remove(),f.each((function(t){var e=c.c2l(t.pos+h,!0),n=c.l2p(e-o)+d,a=c.l2p(e+s)+d,f=u?(n+a)/2:c.l2p(e)+d,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===p?"m0,0L"+g+","+f+"L"+m+","+n+"L"+y+","+f+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===p?"m0,0L"+f+","+g+"L"+n+","+m+"L"+f+","+y+"Z":""))}))}e.exports={plot:function(t,e,i,l){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(t){var e,n,i=r.select(this),l=t[0],d=l.t,p=l.trace;d.wdPos=d.bdPos*p.whiskerwidth,!0!==p.visible||d.empty?i.remove():("h"===p.orientation?(e=h,n=u):(e=u,n=h),a(i,{pos:e,val:n},p,d,c),o(i,{x:u,y:h},p,d),s(i,{pos:e,val:n},p,d))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),fo=d({"src/traces/box/style.js"(t,e){var r=v(),n=q(),i=Je();e.exports={style:function(t,e,a){var o=a||r.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var a=r.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,i){t.style("stroke-width",e+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(t){if(!t.empty){var e=r.select(this),n=o[t.dir];l(e,n.line.width,n.line.color,n.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}}}),mo=d({"src/traces/box/hover.js"(t,e){var r=nr(),n=se(),i=zr(),a=q(),o=n.fillText;function s(t,e,o,s){var l,c,u,h,d,p,f,m,g,y,v,x,b,_,w=t.cd,k=t.xa,T=t.ya,S=w[0].trace,A=w[0].t,M="violin"===S.type,C=A.bdPos,E=A.wHover,L=function(t){return u.c2l(t.pos)+A.bPos-u.c2l(p)};M&&"both"!==S.side?("positive"===S.side&&(g=function(t){var e=L(t);return i.inbox(e,e+E,y)},x=C,b=0),"negative"===S.side&&(g=function(t){var e=L(t);return i.inbox(e-E,e,y)},x=0,b=C)):(g=function(t){var e=L(t);return i.inbox(e-E,e+E,y)},x=b=C),_=M?function(t){return i.inbox(t.span[0]-d,t.span[1]-d,y)}:function(t){return i.inbox(t.min-d,t.max-d,y)},"h"===S.orientation?(d=e,p=o,f=_,m=g,l="y",u=T,c="x",h=k):(d=o,p=e,f=g,m=_,l="x",u=k,c="y",h=T);var P=Math.min(1,C/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function I(t){return(f(t)+m(t))/2}y=t.maxHoverDistance-P,v=t.maxSpikeDistance-P;var z=i.getDistanceFunction(s,f,m,I);if(i.getClosest(w,z,t),!1===t.index)return[];var O=w[t.index],D=S.line.color,R=(S.marker||{}).color;a.opacity(D)&&S.line.width?t.color=D:a.opacity(R)&&S.boxpoints?t.color=R:t.color=S.fillcolor,t[l+"0"]=u.c2p(O.pos+A.bPos-b,!0),t[l+"1"]=u.c2p(O.pos+A.bPos+x,!0),t[l+"LabelVal"]=void 0!==O.orig_p?O.orig_p:O.pos;var F=l+"Spike";t.spikeDistance=I(O)*v/y,t[F]=u.c2p(O.pos,!0);var B=S.boxmean||"sd"===S.sizemode||(S.meanline||{}).visible,j=S.boxpoints||S.points,N=j&&B?["max","uf","q3","med","mean","q1","lf","min"]:j&&!B?["max","uf","q3","med","q1","lf","min"]:!j&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]<h.range[0];S.orientation===(U?"v":"h")&&N.reverse();for(var V=t.spikeDistance,q=t[F],$=[],H=0;H<N.length;H++){var W=N[H];if(W in O){var G=O[W],Y=h.c2p(G,!0),Z=n.extendFlat({},t);Z.attr=W,Z[c+"0"]=Z[c+"1"]=Y,Z[c+"LabelVal"]=G,Z[c+"Label"]=(A.labels?A.labels[W]+" ":"")+r.hoverLabelText(h,G,S[c+"hoverformat"]),Z.hoverOnBox=!0,"mean"!==W||!("sd"in O)||"sd"!==S.boxmean&&"sd"!==S.sizemode||(Z[c+"err"]=O.sd),Z.hovertemplate=!1,$.push(Z)}}t.name="",t.spikeDistance=void 0,t[F]=void 0;for(var X=0;X<$.length;X++)"med"!==$[X].attr?($[X].name="",$[X].spikeDistance=void 0,$[X][F]=void 0):($[X].spikeDistance=V,$[X][F]=q);return $}function l(t,e,r){for(var a,s,l,c=t.cd,u=t.xa,h=t.ya,d=c[0].trace,p=u.c2p(e),f=h.c2p(r),m=i.quadrature((function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(u.c2p(t.x)-p)-e,1-3/e)}),(function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-f)-e,1-3/e)})),g=!1,y=0;y<c.length;y++){s=c[y];for(var v=0;v<(s.pts||[]).length;v++){var x=m(l=s.pts[v]);x<=t.distance&&(t.distance=x,g=[y,v])}}if(!g)return!1;l=(s=c[g[0]]).pts[g[1]];var b=u.c2p(l.x,!0),_=h.c2p(l.y,!0),w=l.mrc||1;a=n.extendFlat({},t,{index:l.i,color:(d.marker||{}).color,name:d.name,x0:b-w,x1:b+w,y0:_-w,y1:_+w,spikeDistance:t.distance,hovertemplate:d.hovertemplate});var k,T=s.orig_p,S=void 0!==T?T:s.pos;return"h"===d.orientation?(k=h,a.xLabelVal=l.x,a.yLabelVal=S):(k=u,a.xLabelVal=S,a.yLabelVal=l.y),a[k._id.charAt(0)+"Spike"]=k.c2p(s.pos,!0),o(l,d,a),a}e.exports={hoverPoints:function(t,e,r,n){var i,a=t.cd[0].trace.hoveron,o=[];return-1!==a.indexOf("boxes")&&(o=o.concat(s(t,e,r,n))),-1!==a.indexOf("points")&&(i=l(t,e,r)),"closest"===n?i?[i]:o:i?(o.push(i),o):o},hoverOnBoxes:s,hoverOnPoints:l}}}),go=d({"src/traces/box/event_data.js"(t,e){e.exports=function(t,e){return e.hoverOnBox&&(t.hoverOnBox=e.hoverOnBox),"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),yo=d({"src/traces/box/select.js"(t,e){e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],c=a.c2p(l.x),u=o.c2p(l.y);e.contains([c,u],null,l.i,t)?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}}}),vo=d({"src/traces/box/index.js"(t,e){e.exports={attributes:oo(),layoutAttributes:so(),supplyDefaults:lo().supplyDefaults,crossTraceDefaults:lo().crossTraceDefaults,supplyLayoutDefaults:co().supplyLayoutDefaults,calc:uo(),crossTraceCalc:ho().crossTraceCalc,plot:po().plot,style:fo().style,styleOnSelect:fo().styleOnSelect,hoverPoints:mo().hoverPoints,eventData:go(),selectPoints:yo(),moduleType:"trace",name:"box",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}}),xo=d({"lib/box.js"(t,e){e.exports=vo()}}),bo=d({"src/traces/heatmap/attributes.js"(t,e){var r=wn(),n=N(),i=R(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=Pe(),c=D().extendFlat;e.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},r.x,{impliedEdits:{xtype:"array"}}),x0:c({},r.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},r.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},r.y,{impliedEdits:{ytype:"array"}}),y0:c({},r.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},r.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},r.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},r.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},r.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},r.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},r.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},r.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},n.showlegend,{dflt:!1}),zorder:r.zorder},l("",{cLetter:"z",autoColorDflt:!1}))}}),_o=d({"src/traces/heatmap/xyz_defaults.js"(t,e){var r=k(),n=se(),i=Vt();function a(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,o,s,l,c){var u,h,d=o("z");if(l=l||"x",c=c||"y",void 0===d||!d.length)return 0;if(n.isArray1D(d)){u=o(l),h=o(c);var p=n.minRowLength(u),f=n.minRowLength(h);if(0===p||0===f)return 0;e._length=Math.min(p,f,d.length)}else{if(u=a(l,o),h=a(c,o),!function(t){for(var e,i=!0,a=!1,o=!1,s=0;s<t.length;s++){if(e=t[s],!n.isArrayOrTypedArray(e)){i=!1;break}e.length>0&&(a=!0);for(var l=0;l<e.length;l++)if(r(e[l])){o=!0;break}}return i&&a&&o}(d))return 0;o("transpose"),e._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,c],s),!0}}}),wo=d({"src/traces/heatmap/label_defaults.js"(t,e){var r=se();e.exports=function(t,e){t("texttemplate");var n=r.extendFlat({},e.font,{color:"auto",size:"auto"});r.coerceFont(t,"textfont",n)}}}),ko=d({"src/traces/heatmap/style_defaults.js"(t,e){e.exports=function(t,e,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}}}),To=d({"src/traces/heatmap/defaults.js"(t,e){var r=se(),n=_o(),i=wo(),a=$n(),o=ko(),s=Ve(),l=bo();e.exports=function(t,e,c,u){function h(n,i){return r.coerce(t,e,l,n,i)}n(t,e,h,u)?(a(t,e,u,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),i(h,u),o(t,e,h,u),h("hoverongaps"),h("connectgaps",r.isArray1D(e.z)&&!1!==e.zsmooth),s(t,e,u,h,{prefix:"",cLetter:"z"}),h("zorder")):e.visible=!1}}}),So=d({"src/traces/histogram/bin_functions.js"(t,e){var r=k();e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,n,i){var a=i[e];return r(a)?(a=Number(a),n[t]+=a,a):0},avg:function(t,e,n,i,a){var o=i[e];return r(o)&&(o=Number(o),n[t]+=o,a[t]++),0},min:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]>a){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]<a){var o=a-n[t];return n[t]=a,o}}return 0}}}}),Ao=d({"src/traces/histogram/norm_functions.js"(t,e){e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}}}}),Mo=d({"src/traces/histogram/average.js"(t,e){e.exports=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}}}),Co=d({"src/traces/histogram/bin_label_vals.js"(t,e){var r=T(),n=r.ONEAVGYEAR,i=r.ONEAVGMONTH,a=r.ONEDAY,o=r.ONEHOUR,s=r.ONEMIN,l=r.ONESEC,c=nr().tickIncrement;function u(t,e,r,n){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),a="date"===r.type,o=h(i,a),s=0;s<10;s++){var l=h(80*o,a);if(o===l)break;if(!d(l,t,e,a,r,n))break;o=l}return o}function h(t,e){return e&&t>l?t>a?t>1.1*n?n:t>1.1*i?i:a:t>o?o:t>s?s:l:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,i,o,s){if(i&&t>a){var l=p(e,o,s),c=p(r,o,s),u=t===n?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var i=e.c2d(t,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}e.exports=function(t,e,r,i,o){var s,l,h=-1.1*e,d=-.1*e,p=t-d,f=r[0],m=r[1],g=Math.min(u(f+d,f+p,i,o),u(m+d,m+p,i,o)),y=Math.min(u(f+h,f+d,i,o),u(m+h,m+d,i,o));if(g>y&&y<Math.abs(m-f)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===i.type&&s>a){var v=s===n?1:6,x=s===n?"M12":"M1";return function(e,r){var a=i.c2d(e,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(u<e){var h=c(u,x,!1,o);(u+h)/2<e+t&&(u=h)}return r&&l?c(u,x,!0,o):u}}return function(e,r){var n=s*Math.round(e/s);return n+s/10<e&&n+.9*s<e+t&&(n+=s),r&&l&&(n-=s),n}}}}),Eo=d({"src/traces/histogram/calc.js"(t,e){var r=k(),n=se(),i=Vt(),a=nr(),o=Za(),s=So(),l=Ao(),c=Mo(),u=Co();function h(t,e,o,s,l){var c,u,d,p,f,m,g,y=s+"bins",v=t._fullLayout,x=e["_"+s+"bingroup"],b=v._histogramBinOpts[x],_="overlay"===v.barmode,w=function(t){return o.r2c(t,0,p)},k=function(t){return o.c2r(t,0,p)},T="date"===o.type?function(t){return t||0===t?n.cleanDate(t,null,p):null}:function(t){return r(t)?Number(t):null};function S(t,e,r){e[t+"Found"]?(e[t]=T(e[t]),null===e[t]&&(e[t]=r[t])):(m[t]=e[t]=r[t],n.nestedProperty(u[0],y+"."+t).set(r[t]))}if(e["_"+s+"autoBinFinished"])delete e["_"+s+"autoBinFinished"];else{u=b.traces;var A=[],M=!0,C=!1,E=!1;for(c=0;c<u.length;c++)if((d=u[c]).visible){var L=b.dirs[c];f=d["_"+L+"pos0"]=o.makeCalcdata(d,L),A=n.concat(A,f),delete d["_"+s+"autoBinFinished"],!0===e.visible&&(M?M=!1:(delete d._autoBin,d["_"+s+"autoBinFinished"]=1),i.traceIs(d,"2dMap")&&(C=!0),"histogram2dcontour"===d.type&&(E=!0))}p=u[0][s+"calendar"];var P=a.autoBin(A,o,b.nbins,C,p,b.sizeFound&&b.size),I=u[0]._autoBin={};if(m=I[b.dirs[0]]={},E&&(b.size||(P.start=k(a.tickIncrement(w(P.start),P.size,!0,p))),void 0===b.end&&(P.end=k(a.tickIncrement(w(P.end),P.size,!1,p)))),_&&!i.traceIs(e,"2dMap")&&0===P._dataSpan&&"category"!==o.type&&"multicategory"!==o.type&&""===e.bingroup&&"undefined"===typeof e.xbins){if(l)return[P,f,!0];P=function(t,e,r,i,a){var o,s,l,c=t._fullLayout,u=function(t,e){for(var r=e.xaxis,n=e.yaxis,i=e.orientation,a=[],o=t._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===i&&l.xaxis===r&&l.yaxis===n&&a.push(l)}return a}(t,e),d=!1,p=1/0,f=[e];for(o=0;o<u.length;o++)if((s=u[o])===e)d=!0;else if(d){var m=h(t,s,r,i,!0),g=m[0],y=m[2];s["_"+i+"autoBinFinished"]=1,s["_"+i+"pos0"]=m[1],y?f.push(s):p=Math.min(p,g.size)}else l=c._histogramBinOpts[s["_"+i+"bingroup"]],p=Math.min(p,l.size||s[a].size);var v=new Array(f.length);for(o=0;o<f.length;o++)for(var x=f[o]["_"+i+"pos0"],b=0;b<x.length;b++)if(void 0!==x[b]){v[o]=x[b];break}for(isFinite(p)||(p=n.distinctVals(v).minDiff),o=0;o<f.length;o++){var _=(s=f[o])[i+"calendar"],w={start:r.c2r(v[o]-p/2,0,_),end:r.c2r(v[o]+p/2,0,_),size:p};s._input[a]=s[a]=w,(l=c._histogramBinOpts[s["_"+i+"bingroup"]])&&n.extendFlat(l,w)}return e[a]}(t,e,o,s,y)}(g=d.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?P.start=k(a.tickIncrement(w(P.start),P.size,!0,p)):P.end=k(a.tickIncrement(w(P.end),P.size,!1,p))),b.size=P.size,b.sizeFound||(m.size=P.size,n.nestedProperty(u[0],y+".size").set(P.size)),S("start",b,P),S("end",b,P)}f=e["_"+s+"pos0"],delete e["_"+s+"pos0"];var z=e._input[y]||{},O=n.extendFlat({},b),D=b.start,R=o.r2l(z.start),F=void 0!==R;if((b.startFound||F)&&R!==o.r2l(D)){var B=F?R:n.aggNums(Math.min,null,f),j={type:"category"===o.type||"multicategory"===o.type?"linear":o.type,r2l:o.r2l,dtick:b.size,tick0:D,calendar:p,range:[B,a.tickIncrement(B,b.size,!1,p)].map(o.l2r)},N=a.tickFirst(j);N>o.r2l(B)&&(N=a.tickIncrement(N,b.size,!0,p)),O.start=o.l2r(N),F||n.nestedProperty(e,y+".start").set(O.start)}var U=b.end,V=o.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==o.r2l(U)){var $=q?V:n.aggNums(Math.max,null,f);O.end=o.l2r($),q||n.nestedProperty(e,y+".start").set(O.end)}var H="autobin"+s;return!1===e._input[H]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[H],delete e[H]),[O,f]}e.exports={calc:function(t,e){var i,d,p,f,m=[],g=[],y="h"===e.orientation,v=a.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",b={x:"y",y:"x"}[x],_=e[x+"calendar"],w=e.cumulative,k=h(t,e,v,x),T=k[0],S=k[1],A="string"===typeof T.size,M=[],C=A?M:T,E=[],L=[],P=[],I=0,z=e.histnorm,O=e.histfunc,D=-1!==z.indexOf("density");w.enabled&&D&&(z=z.replace(/ ?density$/,""),D=!1);var R,F="max"===O||"min"===O?null:0,B=s.count,j=l[z],N=!1,U=function(t){return v.r2c(t,0,_)};for(n.isArrayOrTypedArray(e[b])&&"count"!==O&&(R=e[b],N="avg"===O,B=s[O]),i=U(T.start),p=U(T.end)+(i-a.tickIncrement(i,T.size,!1,_))/1e6;i<p&&m.length<1e6&&(d=a.tickIncrement(i,T.size,!1,_),m.push((i+d)/2),g.push(F),P.push([]),M.push(i),D&&E.push(1/(d-i)),N&&L.push(0),!(d<=i));)i=d;M.push(i),A||"date"!==v.type||(C={start:U(C.start),end:U(C.end),size:C.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var V=e["_"+x+"bingroup"],q={leftGap:1/0,rightGap:1/0};V&&(t._fullLayout._roundFnOpts[V]||(t._fullLayout._roundFnOpts[V]=q),q=t._fullLayout._roundFnOpts[V]);var $,H=g.length,W=!0,G=q.leftGap,Y=q.rightGap,Z={};for(i=0;i<S.length;i++){var X=S[i];(f=n.findBin(X,C))>=0&&f<H&&(I+=B(f,i,g,R,L),W&&P[f].length&&X!==S[P[f][0]]&&(W=!1),P[f].push(i),Z[i]=f,G=Math.min(G,X-M[f]),Y=Math.min(Y,M[f+1]-X))}q.leftGap=G,q.rightGap=Y,W||($=function(e,r){return function(){var n=t._fullLayout._roundFnOpts[V];return u(n.leftGap,n.rightGap,M,v,_)(e,r)}}),N&&(I=c(g,L)),j&&j(g,I,E),w.enabled&&function(t,e,r){var n,i,a;function o(e){a=t[e],t[e]/=2}function s(e){i=t[e],t[e]=a+i/2,a+=i}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)s(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)s(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;n>=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,tt=K-1;for(i=0;i<K;i++)if(g[i]){Q=i;break}for(i=K-1;i>=Q;i--)if(g[i]){tt=i;break}for(i=Q;i<=tt;i++)if(r(m[i])&&r(g[i])){var et={p:m[i],s:g[i],b:0};w.enabled||(et.pts=P[i],W?et.ph0=et.ph1=P[i].length?S[P[i][0]]:m[i]:(e._computePh=!0,et.ph0=$(M[i]),et.ph1=$(M[i+1],!0))),J.push(et)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),o(J,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(J,e,Z),J},calcAllAutoBins:h}}}),Lo=d({"src/traces/histogram2d/calc.js"(t,e){var r=se(),n=nr(),i=So(),a=Ao(),o=Mo(),s=Co(),l=Eo().calcAllAutoBins;function c(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;i<t;i++)a[i]=1/(e[i+1]-e[i]);else{var o=1/r;for(i=0;i<t;i++)a[i]=o}return a}function u(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function h(t,e,r,n,i,a){var o,l=t.length-1,c=new Array(l),u=s(r,n,t,i,a);for(o=0;o<l;o++){var h=(e||[])[o];c[o]=void 0===h?[u(t[o]),u(t[o+1],!0)]:[h,h]}return c}e.exports=function(t,e){var s,d,p,f,m=n.getFromId(t,e.xaxis),g=n.getFromId(t,e.yaxis),y=e.xcalendar,v=e.ycalendar,x=function(t){return m.r2c(t,0,y)},b=function(t){return g.r2c(t,0,v)},_=l(t,e,m,"x"),w=_[0],k=_[1],T=l(t,e,g,"y"),S=T[0],A=T[1],M=e._length;k.length>M&&k.splice(M,k.length-M),A.length>M&&A.splice(M,A.length-M);var C=[],E=[],L=[],P="string"===typeof w.size,I="string"===typeof S.size,z=[],O=[],D=P?z:w,R=I?O:S,F=0,B=[],j=[],N=e.histnorm,U=e.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,$=i.count,H=a[N],W=!1,G=[],Y=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(W="avg"===U,$=i[U]);var X=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,X,!1,y))/1e6;for(s=K;s<J;s=n.tickIncrement(s,X,!1,y))E.push(q),z.push(s),W&&L.push(0);z.push(s);var Q,tt=E.length,et=(s-K)/tt,rt=(Q=K+et/2,m.c2r(Q,0,y)),nt=S.size,it=b(S.start),at=b(S.end)+(it-n.tickIncrement(it,nt,!1,v))/1e6;for(s=it;s<at;s=n.tickIncrement(s,nt,!1,v)){C.push(E.slice()),O.push(s);var ot=new Array(tt);for(d=0;d<tt;d++)ot[d]=[];j.push(ot),W&&B.push(L.slice())}O.push(s);var st=C.length,lt=(s-it)/st,ct=function(t){return g.c2r(t,0,v)}(it+lt/2);V&&(G=c(E.length,D,et,P),Y=c(C.length,R,lt,I)),P||"date"!==m.type||(D=u(x,D)),I||"date"!==g.type||(R=u(b,R));var ut=!0,ht=!0,dt=new Array(tt),pt=new Array(st),ft=1/0,mt=1/0,gt=1/0,yt=1/0;for(s=0;s<M;s++){var vt=k[s],xt=A[s];p=r.findBin(vt,D),f=r.findBin(xt,R),p>=0&&p<tt&&f>=0&&f<st&&(F+=$(p,s,C[f],Z,B[f]),j[f][p].push(s),ut&&(void 0===dt[p]?dt[p]=vt:dt[p]!==vt&&(ut=!1)),ht&&(void 0===pt[f]?pt[f]=xt:pt[f]!==xt&&(ht=!1)),ft=Math.min(ft,vt-z[p]),mt=Math.min(mt,z[p+1]-vt),gt=Math.min(gt,xt-O[f]),yt=Math.min(yt,O[f+1]-xt))}if(W)for(f=0;f<st;f++)F+=o(C[f],B[f]);if(H)for(f=0;f<st;f++)H(C[f],F,G,Y[f]);return{x:k,xRanges:h(z,ut&&dt,ft,mt,m,y),x0:rt,dx:et,y:A,yRanges:h(O,ht&&pt,gt,yt,g,v),y0:ct,dy:lt,z:C,pts:j}}}}),Po=d({"src/traces/heatmap/convert_column_xyz.js"(t,e){var r=se(),n=T().BADNUM,i=ei();e.exports=function(t,e,a,o,s,l){var c=t._length,u=e.makeCalcdata(t,o),h=a.makeCalcdata(t,s);u=i(t,e,o,u).vals,h=i(t,a,s,h).vals;var d,p,f,m,g=t.text,y=void 0!==g&&r.isArray1D(g),v=t.hovertext,x=void 0!==v&&r.isArray1D(v),b=r.distinctVals(u),_=b.vals,w=r.distinctVals(h),k=w.vals,T=[],S=k.length,A=_.length;for(d=0;d<l.length;d++)T[d]=r.init2dArray(S,A);y&&(f=r.init2dArray(S,A)),x&&(m=r.init2dArray(S,A));var M=r.init2dArray(S,A);for(d=0;d<c;d++)if(u[d]!==n&&h[d]!==n){var C=r.findBin(u[d]+b.minDiff/2,_),E=r.findBin(h[d]+w.minDiff/2,k);for(p=0;p<l.length;p++){var L=t[l[p]];T[p][E][C]=L[d],M[E][C]=d}y&&(f[E][C]=g[d]),x&&(m[E][C]=v[d])}for(t["_"+o]=_,t["_"+s]=k,p=0;p<l.length;p++)t["_"+l[p]]=T[p];y&&(t._text=f),x&&(t._hovertext=m),e&&"category"===e.type&&(t["_"+o+"CategoryMap"]=_.map((function(t){return e._categories[t]}))),a&&"category"===a.type&&(t["_"+s+"CategoryMap"]=k.map((function(t){return a._categories[t]}))),t._after2before=M}}}),Io=d({"src/traces/heatmap/clean_2d_array.js"(t,e){var r=k(),n=se(),i=T().BADNUM;e.exports=function(t,e,a,o){var s,l,c,u,h,d;function p(t){if(r(t))return+t}if(e&&e.transpose){for(s=0,h=0;h<t.length;h++)s=Math.max(s,t[h].length);if(0===s)return!1;c=function(t){return t.length},u=function(t,e,r){return(t[r]||[])[e]}}else s=t.length,c=function(t,e){return t[e].length},u=function(t,e,r){return(t[e]||[])[r]};function f(t){if(e&&"carpet"!==e.type&&"contourcarpet"!==e.type&&t&&"category"===t.type&&e["_"+t._id.charAt(0)].length){var r=t._id.charAt(0),a={},o=e["_"+r+"CategoryMap"]||e[r];for(h=0;h<o.length;h++)a[o[h]]=h;return function(e){var r=a[t._categories[e]];return r+1?r:i}}return n.identity}var m=f(a),g=f(o);o&&"category"===o.type&&(s=o._categories.length);var y,v,x,b=new Array(s);for(h=0;h<s;h++)for(l=a&&"category"===a.type?a._categories.length:c(t,h),b[h]=new Array(l),d=0;d<l;d++)b[h][d]=p((y=t,v=g(h),x=m(d),v===i||x===i?i:u(y,v,x)));return b}}}),zo=d({"src/traces/heatmap/interp2d.js"(t,e){var r=se(),n=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function a(t,e,r){var i,a,o,s,l,c,u,h,d,p,f,m,g,y=0;for(s=0;s<e.length;s++){for(a=(i=e[s])[0],o=i[1],f=t[a][o],p=0,d=0,l=0;l<4;l++)(u=t[a+(c=n[l])[0]])&&void 0!==(h=u[o+c[1]])&&(0===p?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),d++,p+=h);if(0===d)throw"iterateInterp2d order is wrong: no defined neighbors";t[a][o]=p/d,void 0===f?d<4&&(y=1):(t[a][o]=(1+r)*t[a][o]-r*f,g>m&&(y=Math.max(y,Math.abs(t[a][o]-f)/(g-m))))}return y}e.exports=function(t,e){var n,o=1;for(a(t,e),n=0;n<e.length&&!(e[n][2]<4);n++);for(e=e.slice(n),n=0;n<100&&o>.01;n++)o=a(t,e,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}}),Oo=d({"src/traces/heatmap/find_empties.js"(t,e){var r=se().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,c,u=[],h={},d=[],p=t[0],f=[],m=[0,0,0],g=r(t);for(n=0;n<t.length;n++)for(e=f,f=p,p=t[n+1]||[],i=0;i<g;i++)void 0===f[i]&&((s=(void 0!==f[i-1]?1:0)+(void 0!==f[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==p[i]?1:0))?(0===n&&s++,0===i&&s++,n===t.length-1&&s++,i===f.length-1&&s++,s<4&&(h[[n,i]]=[n,i,s]),u.push([n,i,s])):d.push([n,i]));for(;d.length;){for(l={},c=!1,o=d.length-1;o>=0;o--)(s=((h[[(n=(a=d[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],d.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}}}),Do=d({"src/traces/heatmap/make_bound_array.js"(t,e){var r=Vt(),n=se().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,c,u,h=[],d=r.traceIs(t,"contour"),p=r.traceIs(t,"histogram");if(n(e)&&e.length>1&&!p&&"category"!==s.type){var f=e.length;if(!(f<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d)h=Array.from(e).slice(0,o);else if(1===o)h="log"===s.type?[.5*e[0],2*e[0]]:[e[0]-.5,e[0]+.5];else if("log"===s.type){for(h=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],u=1;u<f;u++)h.push(Math.sqrt(e[u-1]*e[u]));h.push(Math.pow(e[f-1],1.5)/Math.pow(e[f-2],.5))}else{for(h=[1.5*e[0]-.5*e[1]],u=1;u<f;u++)h.push(.5*(e[u-1]+e[u]));h.push(1.5*e[f-1]-.5*e[f-2])}if(f<o){var m,g=h[h.length-1];if("log"===s.type)for(m=g/h[h.length-2],u=f;u<o;u++)g*=m,h.push(g);else for(m=g-h[h.length-2],u=f;u<o;u++)g+=m,h.push(g)}}else{var y=t[s._id.charAt(0)+"calendar"];for(l=p?s.r2c(i,0,y):n(e)&&1===e.length?e[0]:void 0===i?0:("log"===s.type?s.d2c:s.r2c)(i,0,y),c=a||1,u=d?0:-.5;u<o;u++)h.push(l+c*u)}return h}}}),Ro=d({"src/traces/heatmap/calc.js"(t,e){var r=Vt(),n=se(),i=nr(),a=ei(),o=Lo(),s=He(),l=Po(),c=Io(),u=zo(),h=Oo(),d=Do(),p=T().BADNUM;function f(t){for(var e=[],r=t.length,n=0;n<r;n++){var i=t[n];i!==p&&e.push(i)}return e}e.exports=function(t,e){var m,g,y,v,x,b,_,w,k,T,S,A=i.getFromId(t,e.xaxis||"x"),M=i.getFromId(t,e.yaxis||"y"),C=r.traceIs(e,"contour"),E=r.traceIs(e,"histogram"),L=C?"best":e.zsmooth;if(A._minDtick=0,M._minDtick=0,E)v=(S=o(t,e)).orig_x,m=S.x,g=S.x0,y=S.dx,w=S.orig_y,x=S.y,b=S.y0,_=S.dy,k=S.z;else{var P=e.z;n.isArray1D(P)?(l(e,A,M,"x","y",["z"]),m=e._x,x=e._y,P=e._z):(v=e.x?A.makeCalcdata(e,"x"):[],w=e.y?M.makeCalcdata(e,"y"):[],m=a(e,A,"x",v).vals,x=a(e,M,"y",w).vals,e._x=m,e._y=x),g=e.x0,y=e.dx,b=e.y0,_=e.dy,k=c(P,e,A,M)}function I(t){L=e._input.zsmooth=e.zsmooth=!1,n.warn('cannot use zsmooth: "fast": '+t)}function z(t){if(t.length>1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(T=0;T<t.length-1;T++)if(Math.abs(t[T+1]-t[T]-e)>r)return!1}return!0}(A.rangebreaks||M.rangebreaks)&&(k=function(t,e,r){for(var n=[],i=-1,a=0;a<r.length;a++)if(e[a]!==p){n[++i]=[];for(var o=0;o<r[a].length;o++)t[o]!==p&&n[i].push(r[a][o])}return n}(m,x,k),E||(m=f(m),x=f(x),e._x=m,e._y=x)),E||!C&&!e.connectgaps||(e._emptypoints=h(k),u(k,e._emptypoints)),e._islinear=!1,"log"===A.type||"log"===M.type?"fast"===L&&I("log axis found"):z(m)?z(x)?e._islinear=!0:"fast"===L&&I("y scale is not linear"):"fast"===L&&I("x scale is not linear");var O=n.maxRowLength(k),D="scaled"===e.xtype?"":m,R=d(e,D,g,y,O,A),F="scaled"===e.ytype?"":x,B=d(e,F,b,_,k.length,M);e._extremes[A._id]=i.findExtremes(A,R),e._extremes[M._id]=i.findExtremes(M,B);var j={x:R,y:B,z:k,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(j.orig_x=v),e.yperiodalignment&&w&&(j.orig_y=w),D&&D.length===R.length-1&&(j.xCenter=D),F&&F.length===B.length-1&&(j.yCenter=F),E&&(j.xRanges=S.xRanges,j.yRanges=S.yRanges,j.pts=S.pts),C||s(t,e,{vals:k,cLetter:"z"}),C&&e.contours&&"heatmap"===e.contours.coloring){var N={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=d(N,D,g,y,O,A),j.yfill=d(N,F,b,_,k.length,M)}return[j]}}}),Fo=d({"src/constants/pixelated_image.js"(t){t.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],t.STYLE=t.CSS_DECLARATIONS.map((function(t){return t.join(": ")+"; "})).join("")}}),Bo=d({"src/lib/supports_pixelated_image.js"(t,e){var r=Fo(),n=Je(),i=se(),a=null;e.exports=function(){if(null!==a)return a;a=!1;var t=i.isSafari()||i.isIOS();if(window.navigator.userAgent&&!t){var e=Array.from(r.CSS_DECLARATIONS).reverse(),o=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"===typeof o)a=e.some((function(t){return o.apply(null,t)}));else{var s=n.tester.append("image").attr("style",r.STYLE),l=window.getComputedStyle(s.node()).imageRendering;a=e.some((function(t){var e=t[1];return l===e||l===e.toLowerCase()})),s.remove()}}return a}}}),jo=d({"src/traces/heatmap/plot.js"(t,e){var r=v(),n=O(),i=Vt(),a=Je(),o=nr(),s=se(),l=Ae(),c=pi(),u=q(),h=We().extractOpts,d=We().makeColorScaleFuncFromTrace,p=Te(),f=Se().LINE_SPACING,m=Bo(),g=Fo().STYLE,y="heatmap-label";function x(t){return t.selectAll("g."+y)}function b(t){x(t).remove()}function _(t,e){var r=e.length-2,n=s.constrain(s.findBin(t,e),0,r),i=e[n],a=e[n+1],o=s.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(o),c=Math.abs(o-l);return o&&o!==r&&c?{bin0:l,frac:c,bin1:Math.round(l+c/(o-l))}:{bin0:l,bin1:l,frac:0}}function w(t,e){var r=e.length-1,n=s.constrain(s.findBin(t,e),0,r),i=e[n],a=(t-i)/(e[n+1]-i)||0;return a<=0?{bin0:n,bin1:n,frac:0}:a<.5?{bin0:n,bin1:n+1,frac:a}:{bin0:n+1,bin1:n,frac:1-a}}function k(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}e.exports=function(t,e,v,T){var S=e.xaxis,A=e.yaxis;s.makeTraceGroups(T,v,"hm").each((function(e){var v,T,M,C,E,L,P,I,z=r.select(this),O=e[0],D=O.trace,R=D.xgap||0,F=D.ygap||0,B=O.z,j=O.x,N=O.y,U=O.xCenter,V=O.yCenter,q=i.traceIs(D,"contour"),$=q?"best":D.zsmooth,H=B.length,W=s.maxRowLength(B),G=!1,Y=!1;for(L=0;void 0===v&&L<j.length-1;)v=S.c2p(j[L]),L++;for(L=j.length-1;void 0===T&&L>0;)T=S.c2p(j[L]),L--;for(T<v&&(M=T,T=v,v=M,G=!0),L=0;void 0===C&&L<N.length-1;)C=A.c2p(N[L]),L++;for(L=N.length-1;void 0===E&&L>0;)E=A.c2p(N[L]),L--;E<C&&(M=C,C=E,E=M,Y=!0),q&&(U=j,V=N,j=O.xfill,N=O.yfill);var Z="default";if($?Z="best"===$?"smooth":"fast":D._islinear&&0===R&&0===F&&m()&&(Z="fast"),"fast"!==Z){var X="best"===$?0:.5;v=Math.max(-X*S._length,v),T=Math.min((1+X)*S._length,T),C=Math.max(-X*A._length,C),E=Math.min((1+X)*A._length,E)}var K,J,Q=Math.round(T-v),tt=Math.round(E-C);if(v>=S._length||T<=0||C>=A._length||E<=0)return z.selectAll("image").data([]).exit().remove(),void b(z);"fast"===Z?(K=W,J=H):(K=Q,J=tt);var et=document.createElement("canvas");et.width=K,et.height=J;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=d(D,{noNumericCheck:!0,returnArray:!0});"fast"===Z?(rt=G?function(t){return W-1-t}:s.identity,nt=Y?function(t){return H-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(S.c2p(j[t])-v),0,Q)},nt=function(t){return s.constrain(Math.round(A.c2p(N[t])-C),0,tt)});var ot,st,lt,ct,ut=nt(0),ht=[ut,ut],dt=G?0:1,pt=Y?0:1,ft=0,mt=0,gt=0,yt=0;function vt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),ft+=e,mt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return vt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,vt(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==Z){var bt,_t=0;try{bt=new Uint8Array(K*J*4)}catch(ge){bt=new Array(K*J*4)}if("smooth"===Z){var wt,kt,Tt,St=U||j,At=V||N,Mt=new Array(St.length),Ct=new Array(At.length),Et=new Array(Q),Lt=U?w:_,Pt=V?w:_;for(L=0;L<St.length;L++)Mt[L]=Math.round(S.c2p(St[L])-v);for(L=0;L<At.length;L++)Ct[L]=Math.round(A.c2p(At[L])-C);for(L=0;L<Q;L++)Et[L]=Lt(L,Mt);for(P=0;P<tt;P++)for(kt=B[(wt=Pt(P,Ct)).bin0],Tt=B[wt.bin1],L=0;L<Q;L++,_t+=4)k(bt,_t,ct=xt(kt,Tt,Et[L],wt))}else for(P=0;P<H;P++)for(lt=B[P],ht=nt(P),L=0;L<W;L++)ct=vt(lt[L],1),k(bt,_t=4*(ht*W+rt(L)),ct);var It=it.createImageData(K,J);try{It.data.set(bt)}catch(ge){var zt=It.data,Ot=zt.length;for(P=0;P<Ot;P++)zt[P]=bt[P]}it.putImageData(It,0,0)}else{var Dt=Math.floor(R/2),Rt=Math.floor(F/2);for(P=0;P<H;P++)if(lt=B[P],ht.reverse(),ht[pt]=nt(P+1),ht[0]!==ht[1]&&void 0!==ht[0]&&void 0!==ht[1])for(ot=[st=rt(0),st],L=0;L<W;L++)ot.reverse(),ot[dt]=rt(L+1),ot[0]!==ot[1]&&void 0!==ot[0]&&void 0!==ot[1]&&(ct=vt(lt[L],(ot[1]-ot[0])*(ht[1]-ht[0])),it.fillStyle="rgba("+ct.join(",")+")",it.fillRect(ot[0]+Dt,ht[0]+Rt,ot[1]-ot[0]-R,ht[1]-ht[0]-F))}mt=Math.round(mt/ft),gt=Math.round(gt/ft),yt=Math.round(yt/ft);var Ft=n("rgb("+mt+","+gt+","+yt+")");t._hmpixcount=(t._hmpixcount||0)+ft,t._hmlumcount=(t._hmlumcount||0)+ft*Ft.getLuminance();var Bt=z.selectAll("image").data(e);Bt.enter().append("svg:image").attr({xmlns:p.svg,preserveAspectRatio:"none"}),Bt.attr({height:tt,width:Q,x:v,y:C,"xlink:href":et.toDataURL("image/png")}),"fast"!==Z||$||Bt.attr("style",g),b(z);var jt=D.texttemplate;if(jt){var Nt=h(D),Ut={type:"linear",range:[Nt.min,Nt.max],_separators:S._separators,_numFormat:S._numFormat},Vt="histogram2dcontour"===D.type,qt="contour"===D.type,$t=qt?H-1:H,Ht=qt?1:0,Wt=qt?W-1:W,Gt=[];for(L=qt?1:0;L<$t;L++){var Yt;if(qt)Yt=O.y[L];else if(Vt){if(0===L||L===H-1)continue;Yt=O.y[L]}else if(O.yCenter)Yt=O.yCenter[L];else{if(L+1===H&&void 0===O.y[L+1])continue;Yt=(O.y[L]+O.y[L+1])/2}var Zt=Math.round(A.c2p(Yt));if(!(0>Zt||Zt>A._length))for(P=Ht;P<Wt;P++){var Xt;if(qt)Xt=O.x[P];else if(Vt){if(0===P||P===W-1)continue;Xt=O.x[P]}else if(O.xCenter)Xt=O.xCenter[P];else{if(P+1===W&&void 0===O.x[P+1])continue;Xt=(O.x[P]+O.x[P+1])/2}var Kt=Math.round(S.c2p(Xt));if(!(0>Kt||Kt>S._length)){var Jt=c({x:Xt,y:Yt},D,t._fullLayout);Jt.x=Xt,Jt.y=Yt;var Qt=O.z[L][P];void 0===Qt?(Jt.z="",Jt.zLabel=""):(Jt.z=Qt,Jt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=O.text&&O.text[L]&&O.text[L][P];void 0!==te&&!1!==te||(te=""),Jt.text=te;var ee=s.texttemplateString(jt,Jt,t._fullLayout._d3locale,Jt,D._meta||{});if(ee){var re=ee.split("<br>"),ne=re.length,ie=0;for(I=0;I<ne;I++)ie=Math.max(ie,re[I].length);Gt.push({l:ne,c:ie,t:ee,x:Kt,y:Zt,z:Qt})}}}}var ae=D.textfont,oe=ae.size,se=t._fullLayout.font.size;if(!oe||"auto"===oe){var le=1/0,ce=1/0,ue=0,he=0;for(I=0;I<Gt.length;I++){var de=Gt[I];if(ue=Math.max(ue,de.l),he=Math.max(he,de.c),I<Gt.length-1){var pe=Gt[I+1],fe=Math.abs(pe.x-de.x),me=Math.abs(pe.y-de.y);fe&&(le=Math.min(le,fe)),me&&(ce=Math.min(ce,me))}}isFinite(le)&&isFinite(ce)?(le-=R,ce-=F,le/=he,ce/=ue,le/=f/2,ce/=f,oe=Math.min(Math.floor(le),Math.floor(ce),se)):oe=se}if(oe<=0||!isFinite(oe))return;x(z).data(Gt).enter().append("g").classed(y,1).append("text").attr("text-anchor","middle").each((function(e){var n=r.select(this),i=ae.color;i&&"auto"!==i||(i=u.contrast(void 0===e.z?t._fullLayout.plot_bgcolor:"rgba("+at(e.z).join()+")")),n.attr("data-notex",1).call(l.positionText,function(t){return t.x}(e),function(t){return t.y-oe*(t.l*f/2-1)}(e)).call(a.font,{family:ae.family,size:oe,color:i,weight:ae.weight,style:ae.style,variant:ae.variant,textcase:ae.textcase,lineposition:ae.lineposition,shadow:ae.shadow}).text(e.t).call(l.convertToTspans,t)}))}}))}}}),No=d({"src/traces/heatmap/colorbar.js"(t,e){e.exports={min:"zmin",max:"zmax"}}}),Uo=d({"src/traces/heatmap/style.js"(t,e){var r=v();e.exports=function(t){r.select(t).selectAll(".hm image").style("opacity",(function(t){return t.trace.opacity}))}}}),Vo=d({"src/traces/heatmap/hover.js"(t,e){var r=zr(),n=se(),i=n.isArrayOrTypedArray,a=nr(),o=We().extractOpts;e.exports=function(t,e,s,l,c){c||(c={});var u,h,d,p,f=c.isContour,m=t.cd[0],g=m.trace,y=t.xa,v=t.ya,x=m.x,b=m.y,_=m.z,w=m.xCenter,k=m.yCenter,T=m.zmask,S=g.zhoverformat,A=x,M=b;if(!1!==t.index){try{d=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(N){return void n.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(d<0||d>=_[0].length||p<0||p>_.length)return}else{if(r.inbox(e-x[0],e-x[x.length-1],0)>0||r.inbox(s-b[0],s-b[b.length-1],0)>0)return;if(f){var C;for(A=[2*x[0]-x[1]],C=1;C<x.length;C++)A.push((x[C]+x[C-1])/2);for(A.push([2*x[x.length-1]-x[x.length-2]]),M=[2*b[0]-b[1]],C=1;C<b.length;C++)M.push((b[C]+b[C-1])/2);M.push([2*b[b.length-1]-b[b.length-2]])}d=Math.max(0,Math.min(A.length-2,n.findBin(e,A))),p=Math.max(0,Math.min(M.length-2,n.findBin(s,M)))}var E,L,P=y.c2p(x[d]),I=y.c2p(x[d+1]),z=v.c2p(b[p]),O=v.c2p(b[p+1]);f?(E=m.orig_x||x,L=m.orig_y||b,I=P,u=E[d],O=z,h=L[p]):(E=m.orig_x||w||x,L=m.orig_y||k||b,u=w?E[d]:(E[d]+E[d+1])/2,h=k?L[p]:(L[p]+L[p+1])/2,y&&"category"===y.type&&(u=x[d]),v&&"category"===v.type&&(h=b[p]),g.zsmooth&&(P=I=y.c2p(u),z=O=v.c2p(h)));var D=_[p][d];if(T&&!T[p][d]&&(D=void 0),void 0!==D||g.hoverongaps){var R;i(m.hovertext)&&i(m.hovertext[p])?R=m.hovertext[p][d]:i(m.text)&&i(m.text[p])&&(R=m.text[p][d]);var F=o(g),B={type:"linear",range:[F.min,F.max],hoverformat:S,_separators:y._separators,_numFormat:y._numFormat},j=a.tickText(B,D,"hover").text;return[n.extendFlat(t,{index:g._after2before?g._after2before[p][d]:[p,d],distance:t.maxHoverDistance,spikeDistance:t.maxSpikeDistance,x0:P,x1:I,y0:z,y1:O,xLabelVal:u,yLabelVal:h,zLabelVal:D,zLabel:j,text:R})]}}}}),qo=d({"src/traces/heatmap/index.js"(t,e){e.exports={attributes:bo(),supplyDefaults:To(),calc:Ro(),plot:jo(),colorbar:No(),style:Uo(),hoverPoints:Vo(),moduleType:"trace",name:"heatmap",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}}),$o=d({"lib/heatmap.js"(t,e){e.exports=qo()}}),Ho=d({"src/traces/histogram/bin_attributes.js"(t,e){e.exports=function(t,e){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}}),Wo=d({"src/traces/histogram/constants.js"(t,e){e.exports={eventDataKeys:["binNumber"]}}}),Go=d({"src/traces/histogram/attributes.js"(t,e){var r=$a(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=Ot().texttemplateAttrs,o=R(),s=Ho(),l=Wo(),c=D().extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:n("x"),yhoverformat:n("y"),text:c({},r.text,{}),hovertext:c({},r.hovertext,{}),orientation:r.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:s("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:s("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:l.eventDataKeys}),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:c({},r.textposition,{arrayOk:!1}),textfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:r.insidetextanchor,textangle:r.textangle,cliponaxis:r.cliponaxis,constraintext:r.constraintext,marker:r.marker,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,zorder:r.zorder}}}),Yo=d({"src/traces/histogram/defaults.js"(t,e){var r=Vt(),n=se(),i=q(),a=Ga().handleText,o=Wa(),s=Go();e.exports=function(t,e,l,c){function u(r,i){return n.coerce(t,e,s,r,i)}var h=u("x"),d=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var p=u("textposition");a(t,e,c,u,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u("hovertext"),u("hovertemplate"),u("xhoverformat"),u("yhoverformat");var f=u("orientation",d&&!h?"h":"v"),m="v"===f?"x":"y",g="v"===f?"y":"x",y=h&&d?Math.min(n.minRowLength(h)&&n.minRowLength(d)):n.minRowLength(e[m]||[]);if(y){e._length=y,r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e[g]&&u("histfunc"),u("histnorm"),u("autobin"+m),o(t,e,u,l,c),n.coerceSelectionMarkerOpacity(e,u);var v=(e.marker.line||{}).color,x=r.getComponentMethod("errorbars","supplyDefaults");x(t,e,v||i.defaultLine,{axis:"y"}),x(t,e,v||i.defaultLine,{axis:"x",inherit:"y"}),u("zorder")}else e.visible=!1}}}),Zo=d({"src/traces/histogram/cross_trace_defaults.js"(t,e){var r=se(),n=ve(),i=Vt().traceIs,a=Jn(),o=Ga().validateCornerradius,s=r.nestedProperty,l=en().getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];e.exports=function(t,e){var h,d,p,f,m,g,y,v=e._histogramBinOpts={},x=[],b={},_=[];function w(t,e){return r.coerce(h._input,h,h._module.attributes,t,e)}function k(t){return"v"===t.orientation?"x":"y"}function T(t,i,a){var o=t.uid+"__"+a;i||(i=o);var s=function(t,r){return n.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[i],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(i=o,s!==c.axType&&r.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&r.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[i]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=i}for(m=0;m<t.length;m++)if(h=t[m],i(h,"histogram")){if(x.push(h),delete h._xautoBinFinished,delete h._yautoBinFinished,"histogram"===h.type){var S=w("marker.cornerradius",e.barcornerradius);h.marker&&(h.marker.cornerradius=o(S))}i(h,"2dMap")||a(h._input,h,e,w,e.barmode)}var A=e._alignmentOpts||{};for(m=0;m<x.length;m++){if(h=x[m],p="",!i(h,"2dMap")){if(f=k(h),"group"===e.barmode&&h.alignmentgroup){var M=h[f+"axis"],C=l(e,M)+h.orientation;(A[C]||{})[h.alignmentgroup]&&(p=C)}p||"overlay"===e.barmode||(p=l(e,h.xaxis)+l(e,h.yaxis)+k(h))}p?(b[p]||(b[p]=[]),b[p].push(h)):_.push(h)}for(p in b)if(1!==(d=b[p]).length){var E=!1;for(d.length&&(h=d[0],E=w("bingroup")),p=E||p,m=0;m<d.length;m++){var L=(h=d[m])._input.bingroup;L&&L!==p&&r.warn(["Trace",h.index,"must match","within bingroup",p+".","Ignoring its bingroup:",L,"setting."].join(" ")),h.bingroup=p,T(h,p,k(h))}}else _.push(d[0]);for(m=0;m<_.length;m++){h=_[m];var P=w("bingroup");if(i(h,"2dMap"))for(y=0;y<2;y++){var I=w((f=u[y])+"bingroup",P?P+"__"+f:null);T(h,I,f)}else T(h,P,k(h))}for(p in v){var z=v[p];for(d=z.traces,g=0;g<c.length;g++){var O,D,R=c[g],F=R.name;if("nbins"!==F||!z.sizeFound){for(m=0;m<d.length;m++){if(h=d[m],f=z.dirs[m],O=R.aStr[f],void 0!==s(h._input,O).get()){z[F]=w(O),z[F+"Found"]=!0;break}(D=(h._autoBin||{})[f]||{})[F]&&s(h,O).set(D[F])}if("start"===F||"end"===F)for(;m<d.length;m++)(h=d[m])["_"+f+"bingroup"]&&w(O,(D=(h._autoBin||{})[f]||{})[F]);"nbins"!==F||z.sizeFound||z.nbinsFound||(h=d[0],z[F]=w(O))}}}}}}),Xo=d({"src/traces/histogram/hover.js"(t,e){var r=eo().hoverPoints,n=nr().hoverLabelText;e.exports=function(t,e,i,a,o){var s=r(t,e,i,a,o);if(s){var l=(t=s[0]).cd[t.index],c=t.cd[0].trace;if(!c.cumulative.enabled){var u="h"===c.orientation?"y":"x";t[u+"Label"]=n(t[u+"a"],[l.ph0,l.ph1],c[u+"hoverformat"])}return s}}}}),Ko=d({"src/traces/histogram/event_data.js"(t,e){e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"zLabelVal"in e&&(t.z=e.zLabelVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){a=[];for(var s=0;s<o.length;s++)a=a.concat(r._indexToPoints[o[s]])}else a=o;t.pointIndices=a}return t}}}),Jo=d({"src/traces/histogram/index.js"(t,e){e.exports={attributes:Go(),layoutAttributes:Ha(),supplyDefaults:Yo(),crossTraceDefaults:Zo(),supplyLayoutDefaults:Ya(),calc:Eo().calc,crossTraceCalc:si().crossTraceCalc,plot:to().plot,layerName:"barlayer",style:Qa().style,styleOnSelect:Qa().styleOnSelect,colorbar:di(),hoverPoints:Xo(),selectPoints:no(),eventData:Ko(),moduleType:"trace",name:"histogram",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}}),Qo=d({"lib/histogram.js"(t,e){e.exports=Jo()}}),ts=d({"src/traces/histogram2d/attributes.js"(t,e){var r=Go(),n=Ho(),i=bo(),a=N(),o=Ce().axisHoverFormat,s=Ot().hovertemplateAttrs,l=Ot().texttemplateAttrs,c=Pe(),u=D().extendFlat;e.exports=u({x:r.x,y:r.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:n("x"),nbinsy:r.nbinsy,ybins:n("y"),autobinx:r.autobinx,autobiny:r.autobiny,bingroup:u({},r.bingroup,{}),xbingroup:u({},r.bingroup,{}),ybingroup:u({},r.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s({},{keys:"z"}),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:i.textfont,showlegend:u({},a.showlegend,{dflt:!1})},c("",{cLetter:"z",autoColorDflt:!1}))}}),es=d({"src/traces/histogram2d/sample_defaults.js"(t,e){var r=Vt(),n=se();e.exports=function(t,e,i,a){var o=i("x"),s=i("y"),l=n.minRowLength(o),c=n.minRowLength(s);l&&c?(e._length=Math.min(l,c),r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a),(i("z")||i("marker.color"))&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")):e.visible=!1}}}),rs=d({"src/traces/histogram2d/defaults.js"(t,e){var r=se(),n=es(),i=ko(),a=Ve(),o=wo(),s=ts();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,c),a(t,e,c,u,{prefix:"",cLetter:"z"}),u("hovertemplate"),o(u,c),u("xhoverformat"),u("yhoverformat"))}}}),ns=d({"src/traces/histogram2d/hover.js"(t,e){var r=Vo(),n=nr().hoverLabelText;e.exports=function(t,e,i,a,o){var s=r(t,e,i,a,o);if(s){var l=(t=s[0]).index,c=l[0],u=l[1],h=t.cd[0],d=h.trace,p=h.xRanges[u],f=h.yRanges[c];return t.xLabel=n(t.xa,[p[0],p[1]],d.xhoverformat),t.yLabel=n(t.ya,[f[0],f[1]],d.yhoverformat),s}}}}),is=d({"src/traces/histogram2d/index.js"(t,e){e.exports={attributes:ts(),supplyDefaults:rs(),crossTraceDefaults:Zo(),calc:Ro(),plot:jo(),layerName:"heatmaplayer",colorbar:No(),style:Uo(),hoverPoints:ns(),eventData:Ko(),moduleType:"trace",name:"histogram2d",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}}),as=d({"lib/histogram2d.js"(t,e){e.exports=is()}}),os=d({"src/constants/filter_ops.js"(t,e){e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ss=d({"src/traces/contour/attributes.js"(t,e){var r=bo(),n=wn(),i=Ce(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Pe(),l=It().dash,c=R(),u=D().extendFlat,h=os(),d=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,f=n.line;e.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(d).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},f.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),ls=d({"src/traces/histogram2dcontour/attributes.js"(t,e){var r=ts(),n=ss(),i=Pe(),a=Ce().axisHoverFormat,o=D().extendFlat;e.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),cs=d({"src/traces/contour/contours_defaults.js"(t,e){e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}}}),us=d({"src/traces/contour/label_defaults.js"(t,e){var r=se();e.exports=function(t,e,n,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;r.coerceFont(t,"contours.labelfont",a,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}}}),hs=d({"src/traces/contour/style_defaults.js"(t,e){var r=Ve(),n=us();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,r(t,e,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),ds=d({"src/traces/histogram2dcontour/defaults.js"(t,e){var r=se(),n=es(),i=cs(),a=hs(),o=wo(),s=ls();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,(function(n){return r.coerce2(t,e,s,n)})),a(t,e,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(u,c))}}}),ps=d({"src/traces/contour/set_contours.js"(t,e){var r=nr(),n=se();function i(t,e,n){var i={type:"linear",range:[t,e]};return r.autoTicks(i,(e-t)/(n||15)),i}e.exports=function(t,e){var a=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,d=t._input.contours;u>h&&(a.start=d.start=h,h=a.end=d.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,t.ncontours).dtick,d.size=a.size=c)}}}}),fs=d({"src/traces/contour/end_plus.js"(t,e){e.exports=function(t){return t.end+t.size/1e6}}}),ms=d({"src/traces/contour/calc.js"(t,e){var r=We(),n=Ro(),i=ps(),a=fs();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,c=e.contours,u=r.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var h=c.start,d=a(c),p=c.size||1,f=Math.floor((d-h)/p)+1;isFinite(p)||(p=1,f=1);var m=h-p/2;l=[m,m+f*p]}else l=s;return r.calc(t,e,{vals:l,cLetter:"z"}),o}}}),gs=d({"src/traces/contour/constants.js"(t,e){e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),ys=d({"src/traces/contour/make_crossings.js"(t,e){var r=gs();function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,i,a,o,s,l,c,u,h,d=t[0].z,p=d.length,f=d[0].length,m=2===p||2===f;for(i=0;i<p-1;i++)for(o=[],0===i&&(o=o.concat(r.BOTTOMSTART)),i===p-2&&(o=o.concat(r.TOPSTART)),e=0;e<f-1;e++)for(a=o.slice(),0===e&&(a=a.concat(r.LEFTSTART)),e===f-2&&(a=a.concat(r.RIGHTSTART)),s=e+","+i,l=[[d[i][e],d[i][e+1]],[d[i+1][e],d[i+1][e+1]]],h=0;h<t.length;h++)(c=n((u=t[h]).level,l))&&(u.crossings[s]=c,-1!==a.indexOf(c)&&(u.starts.push([e,i]),m&&-1!==a.indexOf(c,a.indexOf(c)+1)&&u.starts.push([e,i])))}}}),vs=d({"src/traces/contour/find_all_paths.js"(t,e){var r=se(),n=gs();function i(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function a(t,e){var r=t[2]-e[2],n=t[3]-e[3];return Math.sqrt(r*r+n*n)}function o(t,e,o,l,c){var u,h=e.join(","),d=t.crossings[h],p=function(t,e,r){var i=0,a=0;return t>20&&e?208===t||1114===t?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(t)?a=1:-1!==n.LEFTSTART.indexOf(t)?i=1:-1!==n.TOPSTART.indexOf(t)?a=-1:i=-1,[i,a]}(d,o,e),f=[s(t,e,[-p[0],-p[1]])],m=t.z.length,g=t.z[0].length,y=e.slice(),v=p.slice();for(u=0;u<1e4;u++){if(d>20?(d=n.CHOOSESADDLE[d][(p[0]||p[1])<0?0:1],t.crossings[h]=n.SADDLEREMAINDER[d]):delete t.crossings[h],!(p=n.NEWDELTA[d])){r.log("Found bad marching index:",d,e,t.level);break}f.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],h=e.join(","),i(f[f.length-1],f[f.length-2],l,c)&&f.pop();var x=p[0]&&(e[0]<0||e[0]>g-2)||p[1]&&(e[1]<0||e[1]>m-2);if(e[0]===y[0]&&e[1]===y[1]&&p[0]===v[0]&&p[1]===v[1]||o&&x)break;d=t.crossings[h]}1e4===u&&r.log("Infinite loop in contour?");var b,_,w,k,T,S,A,M,C,E,L,P=i(f[0],f[f.length-1],l,c),I=0,z=.2*t.smoothing,O=[],D=0;for(u=1;u<f.length;u++)I+=A=a(f[u],f[u-1]),O.push(A);var R=I/O.length*z;function F(t){return f[t%f.length]}for(u=f.length-2;u>=D;u--)if((b=O[u])<R){for(w=0,_=u-1;_>=D&&b+O[_]<R;_--)b+=O[_];if(P&&u===f.length-2)for(w=0;w<_&&b+O[w]<R;w++)b+=O[w];T=u-_+w+1,S=Math.floor((u+_+w+2)/2),k=P||u!==f.length-2?P||-1!==_?T%2?F(S):[(F(S)[0]+F(S+1)[0])/2,(F(S)[1]+F(S+1)[1])/2]:f[0]:f[f.length-1],f.splice(_+1,u-_+1,k),u=_+1,w&&(D=w),P&&(u===f.length-2?f[w]=f[f.length-1]:0===u&&(f[f.length-1]=f[0]))}for(f.splice(0,D),u=0;u<f.length;u++)f[u].length=2;if(!(f.length<2))if(P)f.pop(),t.paths.push(f);else{o||r.log("Unclosed interior contour?",t.level,y.join(","),f.join("L"));var B=!1;for(M=0;M<t.edgepaths.length;M++)if(E=t.edgepaths[M],!B&&i(E[0],f[f.length-1],l,c)){f.pop(),B=!0;var j=!1;for(C=0;C<t.edgepaths.length;C++)if(i((L=t.edgepaths[C])[L.length-1],f[0],l,c)){j=!0,f.shift(),t.edgepaths.splice(M,1),C===M?t.paths.push(f.concat(L)):(C>M&&C--,t.edgepaths[C]=L.concat(f,E));break}j||(t.edgepaths[M]=f.concat(E))}for(M=0;M<t.edgepaths.length&&!B;M++)i((E=t.edgepaths[M])[E.length-1],f[0],l,c)&&(f.shift(),t.edgepaths[M]=E.concat(f),B=!0);B||t.edgepaths.push(f)}}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a),c=(1!==l?(1-l)*o.c2l(t.x[n]):0)+(0!==l?l*o.c2l(t.x[n+1]):0);return[o.c2p(o.l2c(c),!0),s.c2p(t.y[i],!0),n+l,i]}var u=(t.level-a)/(t.z[i+1][n]-a),h=(1!==u?(1-u)*s.c2l(t.y[i]):0)+(0!==u?u*s.c2l(t.y[i+1]):0);return[o.c2p(t.x[n],!0),s.c2p(s.l2c(h),!0),n,i+u]}e.exports=function(t,e,n){var i,a,s,l;for(e=e||.01,n=n||.01,a=0;a<t.length;a++){for(s=t[a],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",e,n);for(i=0;Object.keys(s.crossings).length&&i<1e4;)i++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,e,n);1e4===i&&r.log("Infinite loop in contour?")}}}}),xs=d({"src/traces/contour/constraint_mapping.js"(t,e){var r=os(),n=k();function i(t,e){var i,a=Array.isArray(e);function o(t){return n(t)?+t:null}return-1!==r.COMPARISON_OPS2.indexOf(t)?i=o(a?e[0]:e):-1!==r.INTERVAL_OPS.indexOf(t)?i=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==r.SET_OPS.indexOf(t)&&(i=a?e.map(o):[o(e)]),i}function a(t){return function(e){e=i(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function o(t){return function(e){return{start:e=i(t,e),end:1/0,size:1/0}}}e.exports={"[]":a("[]"),"][":a("]["),">":o(">"),"<":o("<"),"=":o("=")}}}),bs=d({"src/traces/contour/empty_pathinfo.js"(t,e){var r=se(),n=xs(),i=fs();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},d=o.start;d<c;d+=s)if(l.push(r.extendFlat({level:d,crossings:{},starts:[],edgepaths:[],paths:[],z:a.z,smoothing:a.trace.line.smoothing},h)),l.length>1e3){r.warn("Too many contours, clipping at 1000",t);break}return l}}}),_s=d({"src/traces/contour/convert_to_constraints.js"(t,e){var r=se();function n(t){return r.extendFlat({},t,{edgepaths:r.extendDeep([],t.edgepaths),paths:r.extendDeep([],t.paths),starts:r.extendDeep([],t.starts)})}e.exports=function(t,e){var i,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&r.warn("Contour data invalid for the specified inequality operation."),a=t[0],i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);return t;case"][":var c=s;s=l,l=c;case"[]":for(2!==t.length&&r.warn("Contour data invalid for the specified inequality range operation."),a=n(t[0]),o=n(t[1]),i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);for(;o.edgepaths.length;)a.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(l(o.paths.shift()));for(;o.starts.length;)a.starts.push(l(o.starts.shift()));return[a]}}}}),ws=d({"src/traces/contour/close_boundaries.js"(t,e){e.exports=function(t,e){var r,n=t[0],i=n.z;switch(e.type){case"levels":var a=Math.min(i[0][0],i[0][1]);for(r=0;r<t.length;r++){var o=t[r];o.prefixBoundary=!o.edgepaths.length&&(a>o.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r<l;r++)u=Math.min(u,i[r][0]),u=Math.min(u,i[r][s-1]),c=Math.max(c,i[r][0]),c=Math.max(c,i[r][s-1]);for(r=1;r<s-1;r++)u=Math.min(u,i[0][r]),u=Math.min(u,i[l-1][r]),c=Math.max(c,i[0][r]),c=Math.max(c,i[l-1][r]);var h,d,p=e.value;switch(e._operation){case">":p>c&&(n.prefixBoundary=!0);break;case"<":(p<u||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"[]":h=Math.min(p[0],p[1]),((d=Math.max(p[0],p[1]))<u||h>c||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),h<u&&d>c&&(n.prefixBoundary=!0)}}}}}),ks=d({"src/traces/contour/plot.js"(t){var e=v(),r=se(),n=Je(),i=We(),a=Ae(),o=nr(),s=tr(),l=jo(),c=ys(),u=vs(),h=bs(),d=_s(),p=ws(),f=gs(),m=f.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,c,u,h="",d=0,p=t.edgepaths.map((function(t,e){return e})),f=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=n.smoothopen(t.edgepaths[d],t.smoothing),h+=f?c:c.replace(/^M/,"L"),p.splice(p.indexOf(d),1),i=t.edgepaths[d][t.edgepaths[d].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",d,t);break}for(u=i,Math.abs(u[1]-e[0][1])<.01&&!y(i)?a=e[1]:g(i)?a=e[0]:m(i)?a=e[3]:y(i)&&(a=e[2]),l=0;l<t.edgepaths.length;l++){var v=t.edgepaths[l][0];Math.abs(i[0]-a[0])<.01?Math.abs(i[0]-v[0])<.01&&(v[1]-i[1])*(a[1]-v[1])>=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}d=s,(f=-1===p.indexOf(d))&&(d=p[0],h+="Z")}for(d=0;d<t.paths.length;d++)h+=n.smoothclosed(t.paths[d],t.smoothing);return h}function y(t,e,n,i){var a=e.width/2,o=e.height/2,s=t.x,l=t.y,c=t.theta,u=Math.cos(c)*a,h=Math.sin(c)*a,d=(s>i.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(d<1||p<1)return 1/0;var f=m.EDGECOST*(1/(d-1)+1/(p-1));f+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,b=0;b<n.length;b++){var _=n[b],w=Math.cos(_.theta)*_.width/2,k=Math.sin(_.theta)*_.width/2,T=2*r.segmentDistance(g,y,v,x,_.x-w,_.y-k,_.x+w,_.y+k)/(e.height+_.height),S=_.level===e.level,A=S?m.SAMELEVELDISTANCE:1;if(T<=A)return 1/0;f+=m.NEIGHBORCOST*(S?m.SAMELEVELFACTOR:1)/(T-A)}return f}function x(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)i[(r=n[e])[0]][r[1]]=0;return t.zmask=i,i}t.plot=function(i,a,o,s){var m=a.xaxis,y=a.yaxis;r.makeTraceGroups(s,o,"contour").each((function(o){var s=e.select(this),v=o[0],b=v.trace,_=v.x,w=v.y,k=b.contours,T=h(k,a,v),S=r.ensureSingle(s,"g","heatmapcoloring"),A=[];"heatmap"===k.coloring&&(A=[o]),l(i,a,A,S),c(T),u(T);var M=m.c2p(_[0],!0),C=m.c2p(_[_.length-1],!0),E=y.c2p(w[0],!0),L=y.c2p(w[w.length-1],!0),P=[[M,L],[C,L],[C,E],[M,E]],I=T;"constraint"===k.type&&(I=d(T,k._operation)),function(t,e,n){var i=r.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"===n.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(s,P,k),function(t,n,i,a){var o="fill"===a.coloring||"constraint"===a.type&&"="!==a._operation,s="M"+i.join("L")+"Z";o&&p(n,a);var l=r.ensureSingle(t,"g","contourfill").selectAll("path").data(o?n:[]);l.enter().append("path"),l.exit().remove(),l.each((function(t){var r=(t.prefixBoundary?s:"")+g(t,i);r?e.select(this).attr("d",r).style("stroke","none"):e.select(this).remove()}))}(s,I,P,k),function(i,a,o,s,l){var c=o._context.staticPlot,u=r.ensureSingle(i,"g","contourlines"),h=!1!==l.showlines,d=l.showlabels,p=h&&d,m=t.createLines(u,h||d,a,c),g=t.createLineClip(u,p,o,s.trace.uid),y=i.selectAll("g.contourlabels").data(d?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),d){var v=[],x=[];r.clearLocationCache();var b=t.labelFormatter(o,s),_=n.tester.append("text").attr("data-notex",1).call(n.font,l.labelfont),w=a[0].xaxis,k=a[0].yaxis,T=w._length,S=k._length,A=w.range,M=k.range,C=r.aggNums(Math.min,null,s.x),E=r.aggNums(Math.max,null,s.x),L=r.aggNums(Math.min,null,s.y),P=r.aggNums(Math.max,null,s.y),I=Math.max(w.c2p(C,!0),0),z=Math.min(w.c2p(E,!0),T),O=Math.max(k.c2p(P,!0),0),D=Math.min(k.c2p(L,!0),S),R={};A[0]<A[1]?(R.left=I,R.right=z):(R.left=z,R.right=I),M[0]<M[1]?(R.top=O,R.bottom=D):(R.top=D,R.bottom=O),R.middle=(R.top+R.bottom)/2,R.center=(R.left+R.right)/2,v.push([[R.left,R.top],[R.right,R.top],[R.right,R.bottom],[R.left,R.bottom]]);var F=Math.sqrt(T*T+S*S),B=f.LABELDISTANCE*F/Math.max(1,a.length/f.LABELINCREASE);m.each((function(n){var i=t.calcTextOpts(n.level,b,_,o);e.select(this).selectAll("path").each((function(){var e=this,n=r.getVisibleSegment(e,R,i.height/2);if(n&&!(n.len<(i.width+i.height)*f.LABELMIN))for(var a=Math.min(Math.ceil(n.len/B),f.LABELMAX),o=0;o<a;o++){var s=t.findBestTextLocation(e,n,i,x,R);if(!s)break;t.addLabelData(s,i,x,v)}}))})),_.remove(),t.drawLabels(y,x,o,g,p?v:null)}d&&!h&&m.remove()}(s,T,i,v,k),function(t,e,i,a,o){var s=a.trace,l=i._fullLayout._clips,h="clip"+s.uid,d=l.selectAll("#"+h).data(s.connectgaps?[]:[0]);if(d.enter().append("clipPath").classed("contourclip",!0).attr("id",h),d.exit().remove(),!1===s.connectgaps){var f={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y,z:x(a),smoothing:0};c([f]),u([f]),p([f],{type:"levels"}),r.ensureSingle(d,"path","").attr("d",(f.prefixBoundary?"M"+o.join("L")+"Z":"")+g(f,o))}else h=null;n.setClipUrl(t,h,i)}(s,a,i,v,P)}))},t.createLines=function(t,e,r,i){var a=r[0].smoothing,o=t.selectAll("g.contourlevel").data(e?r:[]);if(o.exit().remove(),o.enter().append("g").classed("contourlevel",!0),e){var s=o.selectAll("path.openline").data((function(t){return t.pedgepaths||t.edgepaths}));s.exit().remove(),s.enter().append("path").classed("openline",!0),s.attr("d",(function(t){return n.smoothopen(t,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke");var l=o.selectAll("path.closedline").data((function(t){return t.ppaths||t.paths}));l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",(function(t){return n.smoothclosed(t,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke")}return o},t.createLineClip=function(t,e,r,i){var a=e?"clipline"+i:null,o=r._fullLayout._clips.selectAll("#"+a).data(e?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),n.setClipUrl(t,a,r),o},t.labelFormatter=function(t,e){var n=t._fullLayout,a=e.trace,l=a.contours,c={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(l.labelformat)c.tickformat=l.labelformat,s(c,n);else{var u=i.extractOpts(a);if(u&&u.colorbar&&u.colorbar._axis)c=u.colorbar._axis;else{if("constraint"===l.type){var h=l.value;r.isArrayOrTypedArray(h)?c.range=[h[0],h[h.length-1]]:c.range=[h,h]}else c.range=[l.start,l.end],c.nticks=(l.end-l.start)/l.size;c.range[0]===c.range[1]&&(c.range[1]+=c.range[0]||1),c.nticks||(c.nticks=1e3),s(c,n),o.prepTicks(c),c._tmin=null,c._tmax=null}}return function(t){return o.tickText(c,t).text}},t.calcTextOpts=function(t,e,r,i){var o=e(t);r.text(o).call(a.convertToTspans,i);var s=r.node(),l=n.bBox(s,!0);return{text:o,width:l.width,height:l.height,fontSize:+s.style["font-size"].replace("px",""),level:t,dy:(l.top+l.bottom)/2}},t.findBestTextLocation=function(t,e,n,i,a){var o,s,l,c,u,h=n.width;e.isClosed?(s=e.len/m.INITIALSEARCHPOINTS,o=e.min+s/2,l=e.max):(s=(e.len-h)/(m.INITIALSEARCHPOINTS+1),o=e.min+s+h/2,l=e.max-(s+h)/2);for(var d=1/0,p=0;p<m.ITERATIONS;p++){for(var f=o;f<l;f+=s){var g=r.getTextLocation(t,e.total,f,h),v=y(g,n,i,a);v<d&&(d=v,u=g,c=f)}if(d>2*m.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(d<=m.MAXCOST)return u},t.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),d=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[d(-a/2,-o/2),d(-a/2,o/2),d(a/2,o/2),d(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},t.drawLabels=function(t,n,i,o,s){var l=t.selectAll("text").data(n,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var r=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u<s.length;u++)c+="M"+s[u].join("L")+"Z";r.ensureSingle(o,"path","").attr("d",c)}}}}),Ts=d({"src/traces/contour/make_color_map.js"(t,e){var r=v(),n=We(),i=fs();e.exports=function(t){var e=t.contours,a=e.start,o=i(e),s=e.size||1,l=Math.floor((o-a)/s)+1,c="lines"===e.coloring?0:1,u=n.extractOpts(t);isFinite(s)||(s=1,l=1);var h,d,p=u.reversescale?n.flipScale(u.colorscale):u.colorscale,f=p.length,m=new Array(f),g=new Array(f),y=u.min,v=u.max;if("heatmap"===e.coloring){for(d=0;d<f;d++)h=p[d],m[d]=h[0]*(v-y)+y,g[d]=h[1];var x=r.extent([y,v,e.start,e.start+s*(l-1)]),b=x[y<v?0:1],_=x[y<v?1:0];b!==y&&(m.splice(0,0,b),g.splice(0,0,g[0])),_!==v&&(m.push(_),g.push(g[g.length-1]))}else{var w=t._input&&"number"===typeof t._input.zmin&&"number"===typeof t._input.zmax;for(w&&(a<=y||o>=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),d=0;d<f;d++)h=p[d],m[d]=(h[0]*(l+c-1)-c/2)*s+a,g[d]=h[1];(w||t.autocontour)&&(m[0]>y&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]<v&&(m.push(v),g.push(g[g.length-1])))}return n.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}}}),Ss=d({"src/traces/contour/style.js"(t,e){var r=v(),n=Je(),i=Uo(),a=Ts();e.exports=function(t){var e=r.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=r.select(this),i=t[0].trace,o=i.contours,s=i.line,l=o.size||1,c=o.start,u="constraint"===o.type,h=!u&&"lines"===o.coloring,d=!u&&"fill"===o.coloring,p=h||d?a(i):null;e.selectAll("g.contourlevel").each((function(t){r.select(this).selectAll("path").call(n.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)}));var f=o.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){n.font(r.select(this),{weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow,family:f.family,size:f.size,color:f.color||(h?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",i.fillcolor);else if(d){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),i(t)}}}),As=d({"src/traces/contour/colorbar.js"(t,e){var r=We(),n=Ts(),i=fs();e.exports={min:"zmin",max:"zmax",calc:function(t,e,a){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=n(e,{isColorbar:!0});if("heatmap"===c){var h=r.extractOpts(e);a._fillgradient=h.reversescale?r.flipScale(h.colorscale):h.colorscale,a._zrange=[h.min,h.max]}else"fill"===c&&(a._fillcolor=u);a._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},a._levels={start:o.start,end:i(o),size:l}}}}}),Ms=d({"src/traces/contour/hover.js"(t,e){var r=q(),n=Vo();e.exports=function(t,e,i,a,o){o||(o={}),o.isContour=!0;var s=n(t,e,i,a,o);return s&&s.forEach((function(t){var e=t.trace;"constraint"===e.contours.type&&(e.fillcolor&&r.opacity(e.fillcolor)?t.color=r.addOpacity(e.fillcolor,1):e.contours.showlines&&r.opacity(e.line.color)&&(t.color=r.addOpacity(e.line.color,1)))})),s}}}),Cs=d({"src/traces/histogram2dcontour/index.js"(t,e){e.exports={attributes:ls(),supplyDefaults:ds(),crossTraceDefaults:Zo(),calc:ms(),plot:ks().plot,layerName:"contourlayer",style:Ss(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}}),Es=d({"lib/histogram2dcontour.js"(t,e){e.exports=Cs()}}),Ls=d({"src/traces/contour/constraint_defaults.js"(t,e){var r=k(),n=us(),i=q(),a=i.addOpacity,o=i.opacity,s=os(),l=se().isArrayOrTypedArray,c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;e.exports=function(t,e,i,s,h,d){var p,f,m,g=e.contours,y=i("contours.operation");g._operation=c[y],function(t,e){var n;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),l(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),r(e.value)||(l(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(i,g),"="===y?p=g.showlines=!0:(p=i("contours.showlines"),m=i("fillcolor",a((t.line||{}).color||h,.5))),p&&(f=i("line.color",m&&o(m)?a(e.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,f,d)}}}),Ps=d({"src/traces/contour/defaults.js"(t,e){var r=se(),n=_o(),i=$n(),a=Ls(),o=cs(),s=hs(),l=wo(),c=ss();e.exports=function(t,e,u,h){function d(n,i){return r.coerce(t,e,c,n,i)}if(n(t,e,d,h)){i(t,e,h,d),d("xhoverformat"),d("yhoverformat"),d("text"),d("hovertext"),d("hoverongaps"),d("hovertemplate");var p="constraint"===d("contours.type");d("connectgaps",r.isArray1D(e.z)),p?a(t,e,d,h,u):(o(t,e,d,(function(n){return r.coerce2(t,e,c,n)})),s(t,e,d,h)),e.contours&&"heatmap"===e.contours.coloring&&l(d,h),d("zorder")}else e.visible=!1}}}),Is=d({"src/traces/contour/index.js"(t,e){e.exports={attributes:ss(),supplyDefaults:Ps(),calc:ms(),plot:ks().plot,style:Ss(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"contour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),zs=d({"lib/contour.js"(t,e){e.exports=Is()}}),Os=d({"src/traces/scatterternary/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=wn(),o=N(),s=Pe(),l=It().dash,c=D().extendFlat,u=a.marker,h=a.line,d=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:d.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Ds=d({"src/traces/scatterternary/defaults.js"(t,e){var r=se(),n=bn(),i=Ge(),a=Wn(),o=Gn(),s=Yn(),l=Zn(),c=Xn(),u=Os();e.exports=function(t,e,h,d){function p(n,i){return r.coerce(t,e,u,n,i)}var f,m=p("a"),g=p("b"),y=p("c");if(m?(f=m.length,g?(f=Math.min(f,g.length),y&&(f=Math.min(f,y.length))):f=y?Math.min(f,y.length):0):g&&y&&(f=Math.min(g.length,y.length)),f){e._length=f,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",f<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(e)&&a(t,e,h,d,p,{gradient:!0}),i.hasLines(e)&&(o(t,e,h,d,p,{backoff:!0}),s(t,e,p),p("connectgaps")),i.hasText(e)&&(p("texttemplate"),l(t,e,d,p));var v=[];(i.hasMarkers(e)||i.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),v.push("points")),p("fill"),"none"!==e.fill&&(c(t,e,h,p),i.hasLines(e)||s(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||v.push("fills"),p("hoveron",v.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}}),Rs=d({"src/traces/scatterternary/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot;return i.aLabel=r.tickText(a.aaxis,t.a,!0).text,i.bLabel=r.tickText(a.baxis,t.b,!0).text,i.cLabel=r.tickText(a.caxis,t.c,!0).text,i}}}),Fs=d({"src/traces/scatterternary/calc.js"(t,e){var r=k(),n=ri(),i=ni(),a=ii(),o=ai().calcMarkerSize,s=["a","b","c"],l={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var c,u,h,d,p,f,m=t._fullLayout[e.subplot].sum,g=e.sum||m,y={a:e.a,b:e.b,c:e.c},v=e.ids;for(c=0;c<s.length;c++)if(!y[h=s[c]]){for(p=y[l[h][0]],f=y[l[h][1]],d=new Array(p.length),u=0;u<p.length;u++)d[u]=g-p[u]-f[u];y[h]=d}var x,b,_,w,k,T,S=e._length,A=new Array(S);for(c=0;c<S;c++)x=y.a[c],b=y.b[c],_=y.c[c],r(x)&&r(b)&&r(_)?(1!==(w=m/((x=+x)+(b=+b)+(_=+_)))&&(x*=w,b*=w,_*=w),T=x,k=_-b,A[c]={x:k,y:T,a:x,b:b,c:_},v&&(A[c].id=v[c])):A[c]={x:!1,y:!1};return o(e,S),n(t,e),i(A,e),a(A,e),A}}}),Bs=d({"src/traces/scatterternary/plot.js"(t,e){var r=hi();e.exports=function(t,e,n){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),c=0;c<n.length;c++){var u=n[c];u.length&&(u[0].trace._xA=a,u[0].trace._yA=o)}r(t,s,n,l)}}}),js=d({"src/traces/scatterternary/hover.js"(t,e){var r=gi();e.exports=function(t,e,n,i){var a=r(t,e,n,i);if(a&&!1!==a[0].index){var o=a[0];if(void 0===o.index){var s=1-o.y0/t.ya._length,l=t.xa._length,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),a}var h=o.cd[o.index],d=o.trace,p=o.subplot;o.a=h.a,o.b=h.b,o.c=h.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var f={};f[d.subplot]={_subplot:p};var m=d._module.formatLabels(h,d,f);o.aLabel=m.aLabel,o.bLabel=m.bLabel,o.cLabel=m.cLabel;var g=h.hi||d.hoverinfo,y=[];if(!d.hovertemplate){var v=g.split("+");-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&x(p.aaxis,o.aLabel),-1!==v.indexOf("b")&&x(p.baxis,o.bLabel),-1!==v.indexOf("c")&&x(p.caxis,o.cLabel)}return o.extraText=y.join("<br>"),o.hovertemplate=d.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}}}),Ns=d({"src/traces/scatterternary/event_data.js"(t,e){e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}}}),Us=d({"src/plots/ternary/ternary.js"(t,e){var r=v(),n=O(),i=Vt(),a=se(),o=a.strTranslate,s=a._,l=q(),c=Je(),u=tr(),h=D().extendFlat,d=ke(),p=nr(),f=hr(),m=zr(),g=Or(),y=g.freeMode,x=g.rectMode,b=Qe(),_=Mn().prepSelect,w=Mn().selectOnClick,k=Mn().clearOutline,T=Mn().clearSelectionsCache,S=ye();function A(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.updateFx(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=A;var M=A.prototype;M.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},M.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a<t.length;a++)if(!1===t[a][0].trace.cliponaxis){r._hasClipOnAxisFalse=!0;break}r.updateLayers(n),r.adjustLayout(n,i),d.generalUpdatePerTraceModule(r.graphDiv,r,t,n),r.layers.plotbg.select("path").call(l.fill,n.bgcolor)},M.makeFramework=function(t){var e=this,r=e.graphDiv,n=t[e.id],i=e.clipId="clip"+e.layoutId+e.id,o=e.clipIdRelative="clip-relative"+e.layoutId+e.id;e.clipDef=a.ensureSingleById(t._clips,"clipPath",i,(function(t){t.append("path").attr("d","M0,0Z")})),e.clipDefRelative=a.ensureSingleById(t._clips,"clipPath",o,(function(t){t.append("path").attr("d","M0,0Z")})),e.plotContainer=a.ensureSingle(e.container,"g",e.id),e.updateLayers(n),c.setClipUrl(e.layers.backplot,i,r),c.setClipUrl(e.layers.grids,i,r)},M.updateFx=function(t){t._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===t.dragmode?"move":"crosshair")},M.updateLayers=function(t){var e=this.layers,n=["draglayer","plotbg","backplot","grids"];"below traces"===t.aaxis.layer&&n.push("aaxis","aline"),"below traces"===t.baxis.layer&&n.push("baxis","bline"),"below traces"===t.caxis.layer&&n.push("caxis","cline"),n.push("frontplot"),"above traces"===t.aaxis.layer&&n.push("aaxis","aline"),"above traces"===t.baxis.layer&&n.push("baxis","bline"),"above traces"===t.caxis.layer&&n.push("caxis","cline");var i=this.plotContainer.selectAll("g.toplevel").data(n,String),a=["agrid","bgrid","cgrid"];i.enter().append("g").attr("class",(function(t){return"toplevel "+t})).each((function(t){var n=r.select(this);e[t]=n,"frontplot"===t?n.append("g").classed("scatterlayer",!0):"backplot"===t?n.append("g").classed("maplayer",!0):"plotbg"===t?n.append("path").attr("d","M0,0Z"):"aline"===t||"bline"===t||"cline"===t?n.append("path"):"grids"===t&&a.forEach((function(t){e[t]=n.append("g").classed("grid "+t,!0)}))})),i.order()};var C=Math.sqrt(4/3);M.adjustLayout=function(t,e){var r,n,i,a,s,d,p=this,f=t.domain,m=(f.x[0]+f.x[1])/2,g=(f.y[0]+f.y[1])/2,y=f.x[1]-f.x[0],v=f.y[1]-f.y[0],x=y*e.w,b=v*e.h,_=t.sum,w=t.aaxis.min,k=t.baxis.min,T=t.caxis.min;x>C*b?i=(a=b)*C:a=(i=x)/C,s=y*i/x,d=v*a/b,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*T-_,_-w-2*k],domain:[m-s/2,m+s/2],_id:"x"},u(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-k-T],domain:[g-d/2,g+d/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var S=p.yaxis.domain[0],A=p.aaxis=h({},t.aaxis,{range:[w,_-k-T],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[S,S+d*C],anchor:"free",position:0,_id:"y",_length:i});u(A,p.graphDiv._fullLayout),A.setScale();var M=p.baxis=h({},t.baxis,{range:[_-w-T,k],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(M,p.graphDiv._fullLayout),M.setScale();var E=p.caxis=h({},t.caxis,{range:[_-w-k,T],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[S,S+d*C],anchor:"free",position:0,_id:"y",_length:i});u(E,p.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",L),p.layers.plotbg.select("path").attr("d",L);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=o(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var z=o(r-M._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var O=o(r+i/2,n)+"rotate(30)"+o(0,-A._offset);p.layers.aaxis.attr("transform",O),p.layers.agrid.attr("transform",O);var D=o(r+i/2,n)+"rotate(-30)"+o(0,-E._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},M.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,l=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(l),t){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:e.x0-u,y:e.y0+e.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:l,propName:e.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+u,y:e.y0+e.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},M.drawAx=function(t){var e,r=this,n=r.graphDiv,i=t._name,o=i.charAt(0),s=t._id,l=r.layers[i],c=o+"tickLayout",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);r[c]!==u&&(l.selectAll("."+s+"tick").remove(),r[c]=u),t.setScale();var h=p.calcTicks(t),d=p.clipEnds(t,h),f=p.makeTransTickFn(t),m=p.getTickSigns(t)[2],g=a.deg2rad(30),y=m*(t.linewidth||1)/2,v=m*t.ticklen,x=r.w,b=r.h,_="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[o];p.drawTicks(n,t,{vals:"inside"===t.ticks?d:h,layer:l,path:_,transFn:f,crisp:!1}),p.drawGrid(n,t,{vals:d,layer:r.layers[o+"grid"],path:w,transFn:f,crisp:!1}),p.drawLabels(n,t,{vals:h,layer:l,transFn:f,labelFns:p.makeLabelFns(t,0,30)})};var E=S.MINZOOM/2+.87,L="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",P="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",I="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",z=!0;function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}M.clearOutline=function(){T(this.dragOptions),k(this.dragOptions.gd)},M.initInteractions=function(){var t,e,r,u,h,d,p,g,v,b,k,T,A=this,M=A.layers.plotbg.select("path").node(),E=A.graphDiv,O=E._fullLayout._zoomlayer;function D(t){var e={};return e[A.id+".aaxis.min"]=t.a,e[A.id+".baxis.min"]=t.b,e[A.id+".caxis.min"]=t.c,e}function F(t,e){var r=E._fullLayout.clickmode;R(E),2===t&&(E.emit("plotly_doubleclick",null),i.call("_guiRelayout",E,D({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,E,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&m.click(E,e,A.id)}function B(t,e){return 1-e/A.h}function j(t,e){return 1-(t+(A.h-e)/Math.sqrt(3))/A.w}function N(t,e){return(t-(A.h-e)/Math.sqrt(3))/A.w}function U(n,i){var a=r+n*t,o=u+i*e,s=Math.max(0,Math.min(1,B(0,u),B(0,o))),l=Math.max(0,Math.min(1,j(r,u),j(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),f=(s/2+c)*A.w,m=(1-s/2-l)*A.w,y=(f+m)/2,x=m-f,_=(1-s)*A.h,w=_-x/C;x<S.MINZOOM?(p=h,k.attr("d",v),T.attr("d","M0,0Z")):(p={a:h.a+s*d,b:h.b+l*d,c:h.c+c*d},k.attr("d",v+"M"+f+","+_+"H"+m+"L"+y+","+w+"L"+f+","+_+"Z"),T.attr("d","M"+r+","+u+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+f+","+_+L+"M"+m+","+_+P+"M"+y+","+w+I)),b||(k.transition().style("fill",g>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),T.transition().style("opacity",1).duration(200),b=!0),E.emit("plotly_relayouting",D(p))}function V(){R(E),p!==h&&(i.call("_guiRelayout",E,D(p)),z&&E.data&&E._context.showTips&&(a.notifier(s(E,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/A.xaxis._m,n=e/A.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(a.sorterAsc),s=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[s],b:i[l],c:i[u]},e=(h.a-p.a)*A.yaxis._m,t=(h.c-p.c-h.b+p.b)*A.xaxis._m);var d=o(A.x0+t,A.y0+e);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var f=o(-t,-e);A.clipDefRelative.select("path").attr("transform",f),A.aaxis.range=[p.a,A.sum-p.b-p.c],A.baxis.range=[A.sum-p.a-p.c,p.b],A.caxis.range=[A.sum-p.a-p.b,p.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,A),E.emit("plotly_relayouting",D(p))}function $(){i.call("_guiRelayout",E,D(p))}this.dragOptions={element:M,gd:E,plotinfo:{id:A.id,domain:E._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,c){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],t=E._fullLayout._invScaleX,e=E._fullLayout._invScaleY;var f=A.dragOptions.dragmode=E._fullLayout.dragmode;y(f)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===f?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=F,A.dragOptions.doneFn=V,function(t,e,i){var s=M.getBoundingClientRect();r=e-s.left,u=i-s.top,E._fullLayout._calcInverseTransform(E);var c=E._fullLayout._invTransform,f=a.apply3DTransform(c)(r,u);r=f[0],u=f[1],h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=h,d=A.aaxis.range[1]-h.a,g=n(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),v="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,k=O.append("path").attr("class","zoombox").attr("transform",o(A.x0,A.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),T=O.append("path").attr("class","zoombox-corners").attr("transform",o(A.x0,A.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearOutline(E)}(0,s,c)):"pan"===f?(A.dragOptions.moveFn=q,A.dragOptions.clickFn=F,A.dragOptions.doneFn=$,h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=h,A.clearOutline(E)):(x(f)||y(f))&&_(i,s,c,A.dragOptions,f)}},M.onmousemove=function(t){m.hover(E,t,A.id),E._fullLayout._lasthover=M,E._fullLayout._hoversubplot=A.id},M.onmouseout=function(t){E._dragging||f.unhover(E,t)},f.init(this.dragOptions)}}}),Vs=d({"src/plots/ternary/layout_attributes.js"(t,e){var r=V(),n=ka().attributes,i=Ee(),a=Pt().overrideAll,o=D().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=e.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),qs=d({"src/plots/subplot_defaults.js"(t,e){var r=se(),n=ge(),i=ka().defaults;e.exports=function(t,e,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,d=o.partition||"x",p=e._subplots[c],f=p.length,m=f&&p[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,u,t,e)}for(var y=0;y<f;y++){var v=p[y];s=t[v]?t[v]:t[v]={},l=n.newContainer(e,v,m),o.noUirevision||g("uirevision",e.uirevision);var x={};x[d]=[y/f,(y+1)/f],i(l,e,g,x),o.id=v,h(s,l,g,o)}}}}),$s=d({"src/plots/ternary/layout_defaults.js"(t,e){var r=q(),n=ge(),i=se(),a=qs(),o=je(),s=Ne(),l=Re(),c=De(),u=_i(),h=Vs(),d=["aaxis","baxis","caxis"];function p(t,e,i,a){var o,s,l,c=i("bgcolor"),u=i("sum");a.bgColor=r.combine(c,a.paper_bgcolor);for(var h=0;h<d.length;h++)s=t[o=d[h]]||{},(l=n.newContainer(e,o))._name=o,f(s,l,a,e);var p=e.aaxis,m=e.baxis,g=e.caxis;p.min+m.min+g.min>=u&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function f(t,e,r,n){var a=h[e._name];function d(r,n){return i.coerce(t,e,a,r,n)}d("uirevision",n.uirevision),e.type="linear";var p=d("color"),f=p!==a.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=d("title.text",g);e._hovertitle=y===g?y:m,i.coerceFont(d,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:f}}),d("min"),c(t,e,d,"linear"),s(t,e,d,"linear"),o(t,e,d,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(t,e,d,{outerTicks:!0}),d("showticklabels")&&(i.coerceFont(d,"tickfont",r.font,{overrideDflt:{color:f}}),d("tickangle"),d("tickformat")),u(t,e,d,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),d("hoverformat"),d("layer")}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}}}),Hs=d({"src/plots/ternary/index.js"(t){var e=Us(),r=_e().getSubplotCalcData,n=se().counterRegex,i="ternary";t.name=i;var a=t.attr="subplot";t.idRoot=i,t.idRegex=t.attrRegex=n(i),(t.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=Vs(),t.supplyLayoutDefaults=$s(),t.plot=function(t){for(var n=t._fullLayout,a=t.calcdata,o=n._subplots[i],s=0;s<o.length;s++){var l=o[s],c=r(a,i,l),u=n[l]._subplot;u||(u=new e({id:l,graphDiv:t,container:n._ternarylayer.node()},n),n[l]._subplot=u),u.plot(c,n,t._promises)}},t.clean=function(t,e,r,n){for(var a=n._subplots[i]||[],o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}},t.updateFx=function(t){var e=t._fullLayout;e._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===e.dragmode?"move":"crosshair")}}}),Ws=d({"src/traces/scatterternary/index.js"(t,e){e.exports={attributes:Os(),supplyDefaults:Ds(),colorbar:di(),formatLabels:Rs(),calc:Fs(),plot:Bs(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:js(),selectPoints:yi(),eventData:Ns(),moduleType:"trace",name:"scatterternary",basePlotModule:Hs(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}}),Gs=d({"lib/scatterternary.js"(t,e){e.exports=Ws()}}),Ys=d({"src/traces/violin/attributes.js"(t,e){var r=oo(),n=D().extendFlat,i=Ce().axisHoverFormat;e.exports={y:r.y,x:r.x,x0:r.x0,y0:r.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:n({},r.name,{}),orientation:n({},r.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,points:n({},r.boxpoints,{}),jitter:n({},r.jitter,{}),pointpos:n({},r.pointpos,{}),width:n({},r.width,{}),marker:r.marker,text:r.text,hovertext:r.hovertext,hovertemplate:r.hovertemplate,quartilemethod:r.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:r.zorder}}}),Zs=d({"src/traces/violin/layout_attributes.js"(t,e){var r=so(),n=se().extendFlat;e.exports={violinmode:n({},r.boxmode,{}),violingap:n({},r.boxgap,{}),violingroupgap:n({},r.boxgroupgap,{})}}}),Xs=d({"src/traces/violin/defaults.js"(t,e){var r=se(),n=q(),i=lo(),a=Ys();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}function c(n,i){return r.coerce2(t,e,a,n,i)}if(i.handleSampleDefaults(t,e,l,s),!1!==e.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",e.name),l("scalemode"));var u,h=l("span");Array.isArray(h)&&(u="manual"),l("spanmode",u);var d=l("line.color",(t.marker||{}).color||o),p=l("line.width"),f=l("fillcolor",n.addOpacity(e.line.color,.5));i.handlePointsDefaults(t,e,l,{prefix:""});var m=c("box.width"),g=c("box.fillcolor",f),y=c("box.line.color",d),v=c("box.line.width",p);l("box.visible",Boolean(m||g||y||v))||(e.box={visible:!1});var x=c("meanline.color",d),b=c("meanline.width",p);l("meanline.visible",Boolean(x||b))||(e.meanline={visible:!1}),l("quartilemethod"),l("zorder")}}}}),Ks=d({"src/traces/violin/layout_defaults.js"(t,e){var r=se(),n=Zs(),i=co();e.exports=function(t,e,a){i._supply(t,e,a,(function(i,a){return r.coerce(t,e,n,i,a)}),"violin")}}}),Js=d({"src/traces/violin/helpers.js"(t){var e=se(),r=function(t){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t)};t.makeKDE=function(t,e,n){var i=n.length,a=r,o=t.bandwidth,s=1/(i*o);return function(t){for(var e=0,r=0;r<i;r++)e+=a((t-n[r])/o);return s*e}},t.getPositionOnKdePath=function(t,r,n){var i,a;"h"===r.orientation?(i="y",a="x"):(i="x",a="y");var o=e.findPointOnPath(t.path,n,a,{pathLength:t.pathLength}),s=t.posCenterPx,l=o[i];return[l,"both"===r.side?2*s-l:s]},t.getKdeValue=function(e,r,n){var i=e.pts.map(t.extractVal);return t.makeKDE(e,r,i)(n)/e.posDensityScale},t.extractVal=function(t){return t.v}}}),Qs=d({"src/traces/violin/calc.js"(t,e){var r=se(),n=nr(),i=uo(),a=Js(),o=T().BADNUM;function s(t,e,n){var i=e.max-e.min;if(!i)return t.bandwidth?t.bandwidth:0;if(t.bandwidth)return Math.max(t.bandwidth,i/1e4);var a=n.length,o=r.stdev(n,a-1,e.mean);return Math.max(function(t,e,r){return 1.059*Math.min(e,r/1.349)*Math.pow(t,-.2)}(a,o,e.q3-e.q1),i/100)}function l(t,e,r,i){var a,s=t.spanmode,l=t.span||[],c=[e.min,e.max],u=[e.min-2*i,e.max+2*i];function h(n){var i=l[n],a="multicategory"===r.type?r.r2c(i):r.d2c(i,0,t[e.valLetter+"calendar"]);return a===o?u[n]:a}var d={type:"linear",range:a="soft"===s?u:"hard"===s?c:[h(0),h(1)]};return n.setConvert(d),d.cleanRange(),a}e.exports=function(t,e){var o=i(t,e);if(o[0].t.empty)return o;for(var c=t._fullLayout,u=n.getFromId(t,e["h"===e.orientation?"xaxis":"yaxis"]),h=1/0,d=-1/0,p=0,f=0,m=0;m<o.length;m++){var g=o[m],y=g.pts.map(a.extractVal),v=g.bandwidth=s(e,g,y),x=g.span=l(e,g,u,v);if(g.min===g.max&&0===v)x=g.span=[g.min,g.max],g.density=[{v:1,t:x[0]}],g.bandwidth=v,p=Math.max(p,1);else{var b=x[1]-x[0],_=Math.ceil(b/(v/3)),w=b/_;if(!isFinite(w)||!isFinite(_))return r.error("Something went wrong with computing the violin span"),o[0].t.empty=!0,o;var k=a.makeKDE(g,e,y);g.density=new Array(_);for(var T=0,S=x[0];S<x[1]+w/2;T++,S+=w){var A=k(S);g.density[T]={v:A,t:S},p=Math.max(p,A)}}f=Math.max(f,y.length),h=Math.min(h,x[0]),d=Math.max(d,x[1])}var M=n.findExtremes(u,[h,d],{padded:!0});if(e._extremes[u._id]=M,e.width)o[0].t.maxKDE=p;else{var C=c._violinScaleGroupStats,E=e.scalegroup,L=C[E];L?(L.maxKDE=Math.max(L.maxKDE,p),L.maxCount=Math.max(L.maxCount,f)):C[E]={maxKDE:p,maxCount:f}}return o[0].t.labels.kde=r._(t,"kde:"),o}}}),tl=d({"src/traces/violin/cross_trace_calc.js"(t,e){var r=ho().setPositionOffset,n=["v","h"];e.exports=function(t,e){for(var i=t.calcdata,a=e.xaxis,o=e.yaxis,s=0;s<n.length;s++){for(var l=n[s],c="h"===l?o:a,u=[],h=0;h<i.length;h++){var d=i[h],p=d[0].t,f=d[0].trace;!0!==f.visible||"violin"!==f.type||p.empty||f.orientation!==l||f.xaxis!==a._id||f.yaxis!==o._id||u.push(h)}r("violin",t,u,c)}}}}),el=d({"src/traces/violin/plot.js"(t,e){var r=v(),n=se(),i=Je(),a=po(),o=ci(),s=Js();e.exports=function(t,e,l,c){var u=t._context.staticPlot,h=t._fullLayout,d=e.xaxis,p=e.yaxis;function f(t,e){var r=o(t,{xaxis:d,yaxis:p,trace:e,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(r[0],1)}n.makeTraceGroups(c,l,"trace violins").each((function(t){var i=r.select(this),o=t[0],l=o.t,c=o.trace;if(!0!==c.visible||l.empty)i.remove();else{var m=l.bPos,g=l.bdPos,y=e[l.valLetter+"axis"],v=e[l.posLetter+"axis"],x="both"===c.side,b=x||"positive"===c.side,_=x||"negative"===c.side,w=i.selectAll("path.violin").data(n.identity);w.enter().append("path").style("vector-effect",u?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each((function(t){var e,n,i,a,o,s,u,d,p=r.select(this),w=t.density,k=w.length,T=v.c2l(t.pos+m,!0),S=v.l2p(T);if(c.width)e=l.maxKDE/g;else{var A=h._violinScaleGroupStats[c.scalegroup];e="count"===c.scalemode?A.maxKDE/g*(A.maxCount/t.pts.length):A.maxKDE/g}if(b){for(u=new Array(k),o=0;o<k;o++)(d=u[o]={})[l.posLetter]=T+w[o].v/e,d[l.valLetter]=y.c2l(w[o].t,!0);n=f(u,c)}if(_){for(u=new Array(k),s=0,o=k-1;s<k;s++,o--)(d=u[s]={})[l.posLetter]=T-w[o].v/e,d[l.valLetter]=y.c2l(w[o].t,!0);i=f(u,c)}if(x)a=n+"L"+i.substr(1)+"Z";else{var M=[S,y.c2p(w[0].t)],C=[S,y.c2p(w[k-1].t)];"h"===c.orientation&&(M.reverse(),C.reverse()),a=b?"M"+M+"L"+n.substr(1)+"L"+C:"M"+C+"L"+i.substr(1)+"L"+M}p.attr("d",a),t.posCenterPx=S,t.posDensityScale=e*g,t.path=p.node(),t.pathLength=t.path.getTotalLength()/(x?2:1)}));var k,T,S,A=c.box,M=A.width,C=(A.line||{}).width;x?(k=g*M,T=0):b?(k=[0,g*M/2],T=C*{x:1,y:-1}[l.posLetter]):(k=[g*M/2,0],T=C*{x:-1,y:1}[l.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:y},c,{bPos:m,bdPos:k,bPosPxOffset:T}),a.plotBoxMean(i,{pos:v,val:y},c,{bPos:m,bdPos:k,bPosPxOffset:T}),!c.box.visible&&c.meanline.visible&&(S=n.identity);var E=i.selectAll("path.meanline").data(S||[]);E.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",u?"none":"non-scaling-stroke"),E.exit().remove(),E.each((function(t){var e=y.c2p(t.mean,!0),n=s.getPositionOnKdePath(t,c,e);r.select(this).attr("d","h"===c.orientation?"M"+e+","+n[0]+"V"+n[1]:"M"+n[0]+","+e+"H"+n[1])})),a.plotPoints(i,{x:d,y:p},c,l)}}))}}}),rl=d({"src/traces/violin/style.js"(t,e){var r=v(),n=q(),i=fi().stylePoints;e.exports=function(t){var e=r.select(t).selectAll("g.trace.violins");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(e){var a=e[0].trace,o=r.select(this),s=a.box||{},l=s.line||{},c=a.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(n.stroke,a.line.color).call(n.fill,a.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(n.stroke,l.color).call(n.fill,s.fillcolor);var h={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(h).call(n.stroke,c.color),o.selectAll("path.meanline").style(h).call(n.stroke,c.color),i(o,a,t)}))}}}),nl=d({"src/traces/violin/hover.js"(t,e){var r=q(),n=se(),i=nr(),a=mo(),o=Js();e.exports=function(t,e,s,l,c){c||(c={});var u,h,d=c.hoverLayer,p=t.cd,f=p[0].trace,m=f.hoveron,g=-1!==m.indexOf("violins"),y=-1!==m.indexOf("kde"),v=[];if(g||y){var x=a.hoverOnBoxes(t,e,s,l);if(y&&x.length>0){var b,_,w,k,T,S=t.xa,A=t.ya;"h"===f.orientation?(T=e,b="y",w=A,_="x",k=S):(T=s,b="x",w=S,_="y",k=A);var M=p[t.index];if(T>=M.span[0]&&T<=M.span[1]){var C=n.extendFlat({},t),E=k.c2p(T,!0),L=o.getKdeValue(M,f,T),P=o.getPositionOnKdePath(M,f,E),I=w._offset,z=w._length;C[b+"0"]=P[0],C[b+"1"]=P[1],C[_+"0"]=C[_+"1"]=E,C[_+"Label"]=_+": "+i.hoverLabelText(k,T,f[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+L.toFixed(3);for(var O=0,D=0;D<x.length;D++)if("med"===x[D].attr){O=D;break}C.spikeDistance=x[O].spikeDistance;var R=b+"Spike";C[R]=x[O][R],x[O].spikeDistance=void 0,x[O][R]=void 0,C.hovertemplate=!1,v.push(C),(h={})[b+"1"]=n.constrain(I+P[0],I,I+z),h[b+"2"]=n.constrain(I+P[1],I,I+z),h[_+"1"]=h[_+"2"]=k._offset+E}}g&&(v=v.concat(x))}-1!==m.indexOf("points")&&(u=a.hoverOnPoints(t,e,s));var F=d.selectAll(".violinline-"+f.uid).data(h?[0]:[]);return F.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),F.exit().remove(),F.attr(h).call(r.stroke,t.color),"closest"===l?u?[u]:v:u?(v.push(u),v):v}}}),il=d({"src/traces/violin/index.js"(t,e){e.exports={attributes:Ys(),layoutAttributes:Zs(),supplyDefaults:Xs(),crossTraceDefaults:lo().crossTraceDefaults,supplyLayoutDefaults:Ks(),calc:Qs(),crossTraceCalc:tl(),plot:el(),style:rl(),styleOnSelect:fi().styleOnSelect,hoverPoints:nl(),selectPoints:yo(),moduleType:"trace",name:"violin",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}}),al=d({"lib/violin.js"(t,e){e.exports=il()}}),ol=d({"src/traces/funnel/constants.js"(t,e){e.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}}),sl=d({"src/traces/funnel/attributes.js"(t,e){var r=$a(),n=wn().line,i=N(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=ol(),c=D().extendFlat,u=q();e.exports={x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),text:r.text,textposition:r.textposition,insidetextanchor:c({},r.insidetextanchor,{dflt:"middle"}),textangle:c({},r.textangle,{dflt:0}),textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:c({},r.orientation,{}),offset:c({},r.offset,{arrayOk:!1}),width:c({},r.width,{arrayOk:!1}),marker:function(){var t=c({},r.marker);return delete t.pattern,delete t.cornerradius,t}(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{dflt:0,editType:"plot"}),dash:n.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),ll=d({"src/traces/funnel/layout_attributes.js"(t,e){e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),cl=d({"src/traces/funnel/defaults.js"(t,e){var r=se(),n=Jn(),i=Ga().handleText,a=qn(),o=$n(),s=sl(),l=q();e.exports={supplyDefaults:function(t,e,n,c){function u(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,c,u)){o(t,e,c,u),u("xhoverformat"),u("yhoverformat"),u("orientation",e.y&&!e.x?"v":"h"),u("offset"),u("width");var h=u("text");u("hovertext"),u("hovertemplate");var d=u("textposition");i(t,e,c,u,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"===e.textposition||e.texttemplate||u("textinfo",r.isArrayOrTypedArray(h)?"text+value":"value");var p=u("marker.color",n);u("marker.line.color",l.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(t){var e=r.isArrayOrTypedArray(t)?"#000":t;return l.addOpacity(e,.5*l.opacity(e))}(p)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))),u("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}for(var l=0;l<t.length;l++)"funnel"===(a=t[l]).type&&(i=a._input,n(i,a,e,o,e.funnelmode))}}}}),ul=d({"src/traces/funnel/layout_defaults.js"(t,e){var r=se(),n=ll();e.exports=function(t,e,i){var a=!1;function o(i,a){return r.coerce(t,e,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"funnel"===l.type){a=!0;break}}a&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}}}),hl=d({"src/traces/funnel/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;n<t.length;n++)t[n].i=n;r.mergeArray(e.text,t,"tx"),r.mergeArray(e.hovertext,t,"htx");var i=e.marker;if(i){r.mergeArray(i.opacity,t,"mo"),r.mergeArray(i.color,t,"mc");var a=i.line;a&&(r.mergeArray(a.color,t,"mlc"),r.mergeArrayCastPositive(a.width,t,"mlw"))}}}}),dl=d({"src/traces/funnel/calc.js"(t,e){var r=nr(),n=ei(),i=hl(),a=ii(),o=T().BADNUM;function s(t){return t===o?0:t}e.exports=function(t,e){var l,c,u,h,d,p,f,m,g=r.getFromId(t,e.xaxis||"x"),y=r.getFromId(t,e.yaxis||"y");"h"===e.orientation?(l=g.makeCalcdata(e,"x"),u=y.makeCalcdata(e,"y"),h=n(e,y,"y",u),d=!!e.yperiodalignment,p="y"):(l=y.makeCalcdata(e,"y"),u=g.makeCalcdata(e,"x"),h=n(e,g,"x",u),d=!!e.xperiodalignment,p="x"),c=h.vals;var v,x=Math.min(c.length,l.length),b=new Array(x);for(e._base=[],f=0;f<x;f++){l[f]<0&&(l[f]=o);var _=!1;l[f]!==o&&f+1<x&&l[f+1]!==o&&(_=!0),m=b[f]={p:c[f],s:l[f],cNext:_},e._base[f]=-.5*m.s,d&&(b[f].orig_p=u[f],b[f][p+"End"]=h.ends[f],b[f][p+"Start"]=h.starts[f]),e.ids&&(m.id=String(e.ids[f])),0===f&&(b[0].vTotal=0),b[0].vTotal+=s(m.s),m.begR=s(m.s)/s(b[0].s)}for(f=0;f<x;f++)(m=b[f]).s!==o&&(m.sumR=m.s/b[0].vTotal,m.difR=void 0!==v?m.s/v:1,v=m.s);return i(b,e),a(b,e),b}}}),pl=d({"src/traces/funnel/cross_trace_calc.js"(t,e){var r=si().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,c=e.yaxis,u=[],h=[],d=[];for(i=0;i<o.length;i++){var p=o[i],f="h"===p.orientation;!0===p.visible&&p.xaxis===l._id&&p.yaxis===c._id&&"funnel"===p.type&&(n=s[i],f?d.push(n):h.push(n),u.push(n))}var m={mode:a.funnelmode,norm:a.funnelnorm,gap:a.funnelgap,groupgap:a.funnelgroupgap};for(r(t,l,c,h,m),r(t,c,l,d,m),i=0;i<u.length;i++){n=u[i];for(var g=0;g<n.length;g++)g+1<n.length&&(n[g].nextP0=n[g+1].p0,n[g].nextS0=n[g+1].s0,n[g].nextP1=n[g+1].p1,n[g].nextS1=n[g+1].s1)}}}}),fl=d({"src/traces/funnel/plot.js"(t,e){var r=v(),n=se(),i=Je(),a=T().BADNUM,o=to(),s=Ka().clearMinTextSize;function l(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),i[2]=o.c2p(t.nextS0,!0),a[2]=s.c2p(t.nextP0,!0),i[3]=o.c2p(t.nextS1,!0),a[3]=s.c2p(t.nextP1,!0),n?[i,a]:[a,i]}e.exports=function(t,e,c,u){var h=t._fullLayout;s("funnel",h),function(t,e,o,s){var c=e.xaxis,u=e.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),h=o[0].trace,d=n.ensureSingle(s,"g","regions");if(h.connector&&h.connector.visible){var p="h"===h.orientation,f=d.selectAll("g.region").data(n.identity);f.enter().append("g").classed("region",!0),f.exit().remove();var m=f.size();f.each((function(o,s){if(s===m-1||o.cNext){var h=l(o,c,u,p),d=h[0],f=h[1],g="";d[0]!==a&&f[0]!==a&&d[1]!==a&&f[1]!==a&&d[2]!==a&&f[2]!==a&&d[3]!==a&&f[3]!==a&&(g+=p?"M"+d[0]+","+f[1]+"L"+d[2]+","+f[2]+"H"+d[3]+"L"+d[1]+","+f[1]+"Z":"M"+d[1]+","+f[1]+"L"+d[2]+","+f[3]+"V"+f[2]+"L"+d[1]+","+f[0]+"Z"),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,e.layerClipId,t)}}))}else d.remove()}))}(t,e,c,u),function(t,e,a,o){var s=e.xaxis,c=e.yaxis;n.makeTraceGroups(o,a,"trace bars").each((function(a){var o=r.select(this),u=a[0].trace,h=n.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var d="h"===u.orientation,p=h.selectAll("g.line").data(n.identity);p.enter().append("g").classed("line",!0),p.exit().remove();var f=p.size();p.each((function(a,o){if(o===f-1||a.cNext){var u=l(a,s,c,d),h=u[0],p=u[1],m="";void 0!==h[3]&&void 0!==p[3]&&(d?(m+="M"+h[0]+","+p[1]+"L"+h[2]+","+p[2],m+="M"+h[1]+","+p[1]+"L"+h[3]+","+p[2]):(m+="M"+h[1]+","+p[1]+"L"+h[2]+","+p[3],m+="M"+h[1]+","+p[0]+"L"+h[2]+","+p[2])),""===m&&(m="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",m).call(i.setClipUrl,e.layerClipId,t)}}))}else h.remove()}))}(t,e,c,u),o.plot(t,e,c,u,{mode:h.funnelmode,norm:h.funnelmode,gap:h.funnelgap,groupgap:h.funnelgroupgap})}}}),ml=d({"src/traces/funnel/style.js"(t,e){var r=v(),n=Je(),i=q(),a=$().DESELECTDIM,o=Qa(),s=Ka().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var c=o||r.select(t).selectAll('g[class^="funnellayer"]').selectAll("g.trace");s(t,c,"funnel"),c.style("opacity",(function(t){return t[0].trace.opacity})),c.each((function(e){var o=r.select(this),s=e[0].trace;o.selectAll(".point > path").each((function(t){if(!t.isBlank){var e=s.marker;r.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(n.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),yl=d({"src/traces/funnel/hover.js"(t,e){var r=q().opacity,n=eo().hoverOnBars,i=se().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,d=c[l.index];l[(h?"x":"y")+"LabelVal"]=d.s,l.percentInitial=d.begR,l.percentInitialLabel=i(d.begR,1),l.percentPrevious=d.difR,l.percentPreviousLabel=i(d.difR,1),l.percentTotal=d.sumR,l.percentTotalLabel=i(d.sumR,1);var p=d.hi||u.hoverinfo,f=[];if(p&&"none"!==p&&"skip"!==p){var m="all"===p,g=p.split("+"),y=function(t){return m||-1!==g.indexOf(t)};y("percent initial")&&f.push(l.percentInitialLabel+" of initial"),y("percent previous")&&f.push(l.percentPreviousLabel+" of previous"),y("percent total")&&f.push(l.percentTotalLabel+" of total")}return l.extraText=f.join("<br>"),l.color=function(t,e){var n=t.marker,i=e.mc||n.color,a=e.mlc||n.line.color,o=e.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,d),[l]}}}}),vl=d({"src/traces/funnel/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),xl=d({"src/traces/funnel/index.js"(t,e){e.exports={attributes:sl(),layoutAttributes:ll(),supplyDefaults:cl().supplyDefaults,crossTraceDefaults:cl().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:dl(),crossTraceCalc:pl(),plot:fl(),style:ml().style,hoverPoints:yl(),eventData:vl(),selectPoints:no(),moduleType:"trace",name:"funnel",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),bl=d({"lib/funnel.js"(t,e){e.exports=xl()}}),_l=d({"src/traces/waterfall/constants.js"(t,e){e.exports={eventDataKeys:["initial","delta","final"]}}}),wl=d({"src/traces/waterfall/attributes.js"(t,e){var r=$a(),n=wn().line,i=N(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=_l(),c=D().extendFlat,u=q();function h(t){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),kl=d({"src/traces/waterfall/layout_attributes.js"(t,e){e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),Tl=d({"src/constants/delta.js"(t,e){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}}}),Sl=d({"src/traces/waterfall/defaults.js"(t,e){var r=se(),n=Jn(),i=Ga().handleText,a=qn(),o=$n(),s=wl(),l=q(),c=Tl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function d(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,n,l){function c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,c)){o(t,e,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var p=c("textposition");i(t,e,l,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(c("texttemplate"),e.texttemplate||c("textinfo")),d(c,"increasing",u),d(c,"decreasing",h),d(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}if("group"===e.waterfallmode)for(var l=0;l<t.length;l++)i=(a=t[l])._input,n(i,a,e,o,e.waterfallmode)}}}}),Al=d({"src/traces/waterfall/layout_defaults.js"(t,e){var r=se(),n=kl();e.exports=function(t,e,i){var a=!1;function o(i,a){return r.coerce(t,e,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"waterfall"===l.type){a=!0;break}}a&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}}}),Ml=d({"src/traces/waterfall/calc.js"(t,e){var r=nr(),n=ei(),i=se().mergeArray,a=ii(),o=T().BADNUM;function s(t){return"a"===t||"absolute"===t}function l(t){return"t"===t||"total"===t}e.exports=function(t,e){var c,u,h,d,p,f,m=r.getFromId(t,e.xaxis||"x"),g=r.getFromId(t,e.yaxis||"y");"h"===e.orientation?(c=m.makeCalcdata(e,"x"),h=g.makeCalcdata(e,"y"),d=n(e,g,"y",h),p=!!e.yperiodalignment,f="y"):(c=g.makeCalcdata(e,"y"),h=m.makeCalcdata(e,"x"),d=n(e,m,"x",h),p=!!e.xperiodalignment,f="x"),u=d.vals;for(var y,v=Math.min(u.length,c.length),x=new Array(v),b=0,_=!1,w=0;w<v;w++){var k=c[w]||0,T=!1;(c[w]!==o||l(e.measure[w])||s(e.measure[w]))&&w+1<v&&(c[w+1]!==o||l(e.measure[w+1])||s(e.measure[w+1]))&&(T=!0);var S=x[w]={i:w,p:u[w],s:k,rawS:k,cNext:T};s(e.measure[w])?(b=S.s,S.isSum=!0,S.dir="totals",S.s=b):l(e.measure[w])?(S.isSum=!0,S.dir="totals",S.s=b):(S.isSum=!1,S.dir=S.rawS<0?"decreasing":"increasing",y=S.s,S.s=b+y,b+=y),"totals"===S.dir&&(_=!0),p&&(x[w].orig_p=h[w],x[w][f+"End"]=d.ends[w],x[w][f+"Start"]=d.starts[w]),e.ids&&(S.id=String(e.ids[w])),S.v=(e.base||0)+b}return x.length&&(x[0].hasTotals=_),i(e.text,x,"tx"),i(e.hovertext,x,"htx"),a(x,e),x}}}),Cl=d({"src/traces/waterfall/cross_trace_calc.js"(t,e){var r=si().setGroupPositions;e.exports=function(t,e){var n,i,a=t._fullLayout,o=t._fullData,s=t.calcdata,l=e.xaxis,c=e.yaxis,u=[],h=[],d=[];for(i=0;i<o.length;i++){var p=o[i];!0===p.visible&&p.xaxis===l._id&&p.yaxis===c._id&&"waterfall"===p.type&&(n=s[i],"h"===p.orientation?d.push(n):h.push(n),u.push(n))}var f={mode:a.waterfallmode,norm:a.waterfallnorm,gap:a.waterfallgap,groupgap:a.waterfallgroupgap};for(r(t,l,c,h,f),r(t,c,l,d,f),i=0;i<u.length;i++){n=u[i];for(var m=0;m<n.length;m++){var g=n[m];!1===g.isSum&&(g.s0+=0===m?0:n[m-1].s),m+1<n.length&&(n[m].nextP0=n[m+1].p0,n[m].nextS0=n[m+1].s0)}}}}}),El=d({"src/traces/waterfall/plot.js"(t,e){var r=v(),n=se(),i=Je(),a=T().BADNUM,o=to(),s=Ka().clearMinTextSize;e.exports=function(t,e,l,c){var u=t._fullLayout;s("waterfall",u),o.plot(t,e,l,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(t,e,o,s){var l=e.xaxis,c=e.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),u=o[0].trace,h=n.ensureSingle(s,"g","lines");if(u.connector&&u.connector.visible){var d="h"===u.orientation,p=u.connector.mode,f=h.selectAll("g.line").data(n.identity);f.enter().append("g").classed("line",!0),f.exit().remove();var m=f.size();f.each((function(o,s){if(s===m-1||o.cNext){var u=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),i[2]=o.c2p(t.nextS0,!0),a[2]=s.c2p(t.nextP0,!0),n?[i,a]:[a,i]}(o,l,c,d),h=u[0],f=u[1],g="";h[0]!==a&&f[0]!==a&&h[1]!==a&&f[1]!==a&&("spanning"===p&&!o.isSum&&s>0&&(g+=d?"M"+h[0]+","+f[1]+"V"+f[0]:"M"+h[1]+","+f[0]+"H"+h[0]),"between"!==p&&(o.isSum||s<m-1)&&(g+=d?"M"+h[1]+","+f[0]+"V"+f[1]:"M"+h[0]+","+f[1]+"H"+h[1]),h[2]!==a&&f[2]!==a&&(g+=d?"M"+h[1]+","+f[1]+"V"+f[2]:"M"+h[1]+","+f[1]+"H"+h[2])),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,e.layerClipId,t)}}))}else h.remove()}))}(t,e,l,c)}}}),Ll=d({"src/traces/waterfall/style.js"(t,e){var r=v(),n=Je(),i=q(),a=$().DESELECTDIM,o=Qa(),s=Ka().resizeText,l=o.styleTextPoints;e.exports={style:function(t,e,o){var c=o||r.select(t).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");s(t,c,"waterfall"),c.style("opacity",(function(t){return t[0].trace.opacity})),c.each((function(e){var o=r.select(this),s=e[0].trace;o.selectAll(".point > path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;r.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(n.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),Pl=d({"src/traces/waterfall/hover.js"(t,e){var r=nr().hoverLabelText,n=q().opacity,i=eo().hoverOnBars,a=Tl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,c){var u=i(t,e,a,l,c);if(u){var h=u.cd,d=h[0].trace,p="h"===d.orientation,f=p?"x":"y",m=p?t.xa:t.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=T(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=T(u.final),u.initialLabel=T(u.initial);var x=g.hi||d.hoverinfo,b=[];if(x&&"none"!==x&&"skip"!==x){var _="all"===x,w=x.split("+"),k=function(t){return _||-1!==w.indexOf(t)};g.isSum||(!k("final")||k(p?"x":"y")||b.push(u.finalLabel),k("delta")&&(y<0?b.push(u.deltaLabel+" "+s):b.push(u.deltaLabel+" "+o)),k("initial")&&b.push("Initial: "+u.initialLabel))}return b.length&&(u.extraText=b.join("<br>")),u.color=function(t,e){var r=t[e.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(d,g),[u]}function T(t){return r(m,t,d[f+"hoverformat"])}}}}),Il=d({"src/traces/waterfall/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),zl=d({"src/traces/waterfall/index.js"(t,e){e.exports={attributes:wl(),layoutAttributes:kl(),supplyDefaults:Sl().supplyDefaults,crossTraceDefaults:Sl().crossTraceDefaults,supplyLayoutDefaults:Al(),calc:Ml(),crossTraceCalc:Cl(),plot:El(),style:Ll().style,hoverPoints:Pl(),eventData:Il(),selectPoints:no(),moduleType:"trace",name:"waterfall",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Ol=d({"lib/waterfall.js"(t,e){e.exports=zl()}}),Dl=d({"src/traces/image/constants.js"(t,e){e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["\xb0","%","%",""]}}}}}),Rl=d({"src/traces/image/attributes.js"(t,e){var r,n,i=N(),a=wn().zorder,o=Ot().hovertemplateAttrs,s=D().extendFlat,l=Dl().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n<c.length;n++)r=l[c[n]],u.push("For the `"+c[n]+"` colormodel, it is ["+(r.zminDflt||r.min).join(", ")+"]."),h.push("For the `"+c[n]+"` colormodel, it is ["+(r.zmaxDflt||r.max).join(", ")+"].");e.exports=s({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:c,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:s({},i.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:o({},{keys:["z","color","colormodel"]}),zorder:a})}}),Fl=d({"src/traces/image/defaults.js"(t,e){var r=se(),n=Rl(),i=Dl(),a=On().IMAGE_URL_PREFIX;e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}o("source"),e.source&&!e.source.match(a)&&delete e.source,e._hasSource=!!e.source;var s,l=o("z");e._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),e._hasZ||e._hasSource?(o("x0"),o("y0"),o("dx"),o("dy"),e._hasZ?(o("colormodel","rgb"),o("zmin",(s=i.colormodel[e.colormodel]).zminDflt||s.min),o("zmax",s.zmaxDflt||s.max)):e._hasSource&&(e.colormodel="rgba256",s=i.colormodel[e.colormodel],e.zmin=s.zminDflt,e.zmax=s.zmaxDflt),o("zsmooth"),o("text"),o("hovertext"),o("hovertemplate"),e._length=null,o("zorder")):e.visible=!1}}}),Bl=d({"node_modules/inherits/inherits_browser.js"(t,e){"function"===typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}}}),jl=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js"(t,e){e.exports=he().EventEmitter}}),Nl=d({"node_modules/base64-js/index.js"(t){t.byteLength=function(t){var e=o(t),r=e[0],n=e[1];return 3*(r+n)/4-n},t.toByteArray=function(t){var e,r,a=o(t),s=a[0],l=a[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,l)),u=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,l=0,c=n-i;l<c;l+=o)a.push(s(t,l,l+o>c?c:l+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};var e,r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0;e<64;++e)r[e]=a[e],n[a.charCodeAt(e)]=e;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,n){for(var i,a,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),Ul=d({"node_modules/ieee754/index.js"(t){t.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=t[e+h];for(h+=d,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}}}),Vl=d({"node_modules/buffer/index.js"(t){var e=Nl(),r=Ul(),n="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,r)}function s(t,e,r){if("string"===typeof t)return function(t,e){if("string"===typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);const i=function(t){if(o.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!==typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),a(t<0?0:0|d(t))}function u(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,o.prototype),n}function d(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:$(t).length;e=(""+e).toLowerCase(),i=!0}}function f(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*o}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(c(t,a+n)!==c(e,n)){r=!1;break}if(r)return a}return-1}function v(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const a=e.length;let o;for(n>a/2&&(n=a/2),o=0;o<n;++o){const n=parseInt(e.substr(2*o,2),16);if(Y(n))return o;t[r+o]=n}return o}function x(t,e,r,n){return W($(e,t.length-r),t,r,n)}function b(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r,n){return W(H(e),t,r,n)}function w(t,e,r,n){return W(function(t,e){let r,n,i;const a=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function k(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let a=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[i+1],128===(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[i+1],n=t[i+2],128===(192&r)&&128===(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128===(192&r)&&128===(192&n)&&128===(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=S));return r}(n)}t.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||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."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"===typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},o.allocUnsafe=function(t){return c(t)},o.allocUnsafeSlow=function(t){return c(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(G(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=o.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(G(e,Uint8Array))i+e.length>n.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},o.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},o.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},o.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(G(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const l=Math.min(a,s),c=this.slice(n,i),u=t.slice(e,r);for(let o=0;o<l;++o)if(c[o]!==u[o]){a=c[o],s=u[o];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"===typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return b(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function A(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function M(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=e;a<r;++a)i+=Z[t[a]];return i}function E(t,e,r){const n=t.slice(e,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function L(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function z(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,n,i,a){return e=+e,n>>>=0,a||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function R(t,e,n,i,a){return e=+e,n>>>=0,a||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}o.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t],i=1,a=0;for(;++a<e&&(i*=256);)n+=this[t+a]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=X((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=X((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=this[t],i=1,a=0;for(;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let n=e,i=1,a=this[t+--n];for(;n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=X((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),o.prototype.readBigInt64BE=X((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),r.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),r.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=X((function(t){return I(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=X((function(t){return z(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,a=1,o=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=X((function(t){return I(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=X((function(t){return z(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},o.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"===typeof t?t&=255:"boolean"===typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(i=e;i<r;++i)this[i]=t;else{const a=o.isBuffer(t)?t:o.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var F={};function B(t,e,r){F[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function j(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function N(t,e,r,n,i,a){if(t>r||t<e){const n="bigint"===typeof e?"n":"";let i;throw i=a>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){U(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||V(e,t.length-(r+1))}(n,i,a)}function U(t,e){if("number"!==typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){if(Math.floor(t)!==t)throw U(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function $(t,e){let r;e=e||1/0;const n=t.length;let i=null;const a=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!==t}var Z=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"===typeof BigInt?K:t}function K(){throw new Error("BigInt not supported")}}}),ql=d({"node_modules/has-symbols/shams.js"(t,e){e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"===typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),$l=d({"node_modules/has-tostringtag/shams.js"(t,e){var r=ql();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),Hl=d({"node_modules/es-errors/index.js"(t,e){e.exports=Error}}),Wl=d({"node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),Gl=d({"node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),Yl=d({"node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),Zl=d({"node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),Xl=d({"node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),Kl=d({"node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),Jl=d({"node_modules/has-symbols/index.js"(t,e){var r="undefined"!==typeof Symbol&&Symbol,n=ql();e.exports=function(){return"function"===typeof r&&"function"===typeof Symbol&&"symbol"===typeof r("foo")&&"symbol"===typeof Symbol("bar")&&n()}}}),Ql=d({"node_modules/has-proto/index.js"(t,e){var r={foo:{}},n=Object;e.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),tc=d({"node_modules/function-bind/implementation.js"(t,e){var r=Object.prototype.toString,n=Math.max,i=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};e.exports=function(t){var e=this;if("function"!==typeof e||"[object Function]"!==r.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var a,o=function(t,e){for(var r=[],n=e||0,i=0;n<t.length;n+=1,i+=1)r[i]=t[n];return r}(arguments,1),s=n(0,e.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r}(l,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var r=e.apply(this,i(o,arguments));return Object(r)===r?r:this}return e.apply(t,i(o,arguments))})),e.prototype){var u=function(){};u.prototype=e.prototype,a.prototype=new u,u.prototype=null}return a}}}),ec=d({"node_modules/function-bind/index.js"(t,e){var r=tc();e.exports=Function.prototype.bind||r}}),rc=d({"node_modules/hasown/index.js"(t,e){var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=ec();e.exports=i.call(r,n)}}),nc=d({"node_modules/get-intrinsic/index.js"(t,e){var r,n=Hl(),i=Wl(),a=Gl(),o=Yl(),s=Zl(),l=Xl(),c=Kl(),u=Function,h=function(t){try{return u('"use strict"; return ('+t+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(O){d=null}var p,f=function(){throw new l},m=d?function(){try{return f}catch(t){try{return d(arguments,"callee").get}catch(e){return f}}}():f,g=Jl()(),y=Ql()(),v=Object.getPrototypeOf||(y?function(t){return t.__proto__}:null),x={},b="undefined"!==typeof Uint8Array&&v?v(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":g&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":x,"%AsyncGenerator%":x,"%AsyncGeneratorFunction%":x,"%AsyncIteratorPrototype%":x,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":x,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&v?v(v([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&g&&v?v((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&g&&v?v((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&v?v(""[Symbol.iterator]()):r,"%Symbol%":g?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":b,"%TypeError%":l,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(v)try{null.error}catch(O){p=v(v(O)),_["%Error.prototype%"]=p}var w=function t(e){var r;if("%AsyncFunction%"===e)r=h("async function () {}");else if("%GeneratorFunction%"===e)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=h("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&v&&(r=v(i.prototype))}return _[e]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=ec(),S=rc(),A=T.call(Function.call,Array.prototype.concat),M=T.call(Function.apply,Array.prototype.splice),C=T.call(Function.call,String.prototype.replace),E=T.call(Function.call,String.prototype.slice),L=T.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,z=function(t,e){var r,n=t;if(S(k,n)&&(n="%"+(r=k[n])[0]+"%"),S(_,n)){var i=_[n];if(i===x&&(i=w(n)),"undefined"===typeof i&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!==typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===L(/^%?[^%]*%?$/,t))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return C(t,P,(function(t,e,r,i){n[n.length]=r?C(i,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=z("%"+n+"%",e),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],M(r,A([0,1],u)));for(var h=1,p=!0;h<r.length;h+=1){var f=r[h],m=E(f,0,1),g=E(f,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new s("property names with quotes must have matching quotes");if("constructor"!==f&&p||(c=!0),S(_,a="%"+(n+="."+f)+"%"))o=_[a];else if(null!=o){if(!(f in o)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(d&&h+1>=r.length){var y=d(o,f);o=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[f]}else p=S(o,f),o=o[f];p&&!c&&(_[a]=o)}}return o}}}),ic=d({"node_modules/es-define-property/index.js"(t,e){var r=nc()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(n){r=!1}e.exports=r}}),ac=d({"node_modules/gopd/index.js"(t,e){var r=nc()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(n){r=null}e.exports=r}}),oc=d({"node_modules/define-data-property/index.js"(t,e){var r=ic(),n=Zl(),i=Xl(),a=ac();e.exports=function(t,e,o){if(!t||"object"!==typeof t&&"function"!==typeof t)throw new i("`obj` must be an object or a function`");if("string"!==typeof e&&"symbol"!==typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}}),sc=d({"node_modules/has-property-descriptors/index.js"(t,e){var r=ic(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},e.exports=n}}),lc=d({"node_modules/set-function-length/index.js"(t,e){var r=nc(),n=oc(),i=sc()(),a=ac(),o=Xl(),s=r("%Math.floor%");e.exports=function(t,e){if("function"!==typeof t)throw new o("`fn` is not a function");if("number"!==typeof e||e<0||e>4294967295||s(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}}),cc=d({"node_modules/call-bind/index.js"(t,e){var r=ec(),n=nc(),i=lc(),a=Xl(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ic(),u=n("%Math.max%");e.exports=function(t){if("function"!==typeof t)throw new a("a function is required");var e=l(r,s,arguments);return i(e,1+u(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h}}),uc=d({"node_modules/call-bind/callBound.js"(t,e){var r=nc(),n=cc(),i=n(r("String.prototype.indexOf"));e.exports=function(t,e){var a=r(t,!!e);return"function"===typeof a&&i(t,".prototype.")>-1?n(a):a}}}),hc=d({"node_modules/is-arguments/index.js"(t,e){var r=$l()(),n=uc()("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"===typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!i(t)||null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=o?i:a}}),dc=d({"node_modules/is-generator-function/index.js"(t,e){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=$l()(),s=Object.getPrototypeOf;e.exports=function(t){if("function"!==typeof t)return!1;if(a.test(i.call(t)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(t);if(!s)return!1;if("undefined"===typeof r){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&s(e)}return s(t)===r}}}),pc=d({"node_modules/is-callable/index.js"(t,e){var r,n,i=Function.prototype.toString,a="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof a&&"function"===typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(f){f!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(t){try{var e=i.call(t);return s.test(e)}catch(r){return!1}},c=function(t){try{return!l(t)&&(i.call(t),!0)}catch(e){return!1}},u=Object.prototype.toString,h="function"===typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),p=function(){return!1};"object"===typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(p=function(t){if((d||!t)&&("undefined"===typeof t||"object"===typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(r){}return!1})),e.exports=a?function(t){if(p(t))return!0;if(!t)return!1;if("function"!==typeof t&&"object"!==typeof t)return!1;try{a(t,null,r)}catch(e){if(e!==n)return!1}return!l(t)&&c(t)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!==typeof t&&"object"!==typeof t)return!1;if(h)return c(t);if(l(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}}}),fc=d({"node_modules/for-each/index.js"(t,e){var r=pc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,a){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(t)?function(t,e,r){for(var n=0,a=t.length;n<a;n++)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o):"string"===typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,o):function(t,e,r){for(var n in t)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,o)}}}),mc=d({"node_modules/available-typed-arrays/index.js"(t,e){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"===typeof globalThis?window:globalThis;e.exports=function(){for(var t=[],e=0;e<r.length;e++)"function"===typeof n[r[e]]&&(t[t.length]=r[e]);return t}}}),gc=d({"node_modules/which-typed-array/index.js"(t,e){var r=fc(),n=mc(),i=cc(),a=uc(),o=ac(),s=a("Object.prototype.toString"),l=$l()(),c="undefined"===typeof globalThis?window:globalThis,u=n(),h=a("String.prototype.slice"),d=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f={__proto__:null};r(u,l&&o&&d?function(t){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=o(r,Symbol.toStringTag);if(!n){var a=d(r);n=o(a,Symbol.toStringTag)}f["$"+t]=i(n.get)}}:function(t){var e=new c[t],r=e.slice||e.set;r&&(f["$"+t]=i(r))}),e.exports=function(t){if(!t||"object"!==typeof t)return!1;if(!l){var e=h(s(t),8,-1);return p(u,e)>-1?e:"Object"===e&&function(t){var e=!1;return r(f,(function(r,n){if(!e)try{r(t),e=h(n,1)}catch(i){}})),e}(t)}return o?function(t){var e=!1;return r(f,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=h(n,1))}catch(i){}})),e}(t):null}}}),yc=d({"node_modules/is-typed-array/index.js"(t,e){var r=fc(),n=mc(),i=uc(),a=i("Object.prototype.toString"),o=$l()(),s=ac(),l="undefined"===typeof globalThis?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},h=i("String.prototype.slice"),d={},p=Object.getPrototypeOf;o&&s&&p&&r(c,(function(t){var e=new l[t];if(Symbol.toStringTag in e){var r=p(e),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}d[t]=n.get}})),e.exports=function(t){if(!t||"object"!==typeof t)return!1;if(!o||!(Symbol.toStringTag in t)){var e=h(a(t),8,-1);return u(c,e)>-1}return!!s&&function(t){var e=!1;return r(d,(function(r,n){if(!e)try{e=r.call(t)===n}catch(i){}})),e}(t)}}}),vc=d({"node_modules/util/support/types.js"(t){var e=hc(),r=dc(),n=gc(),i=yc();function a(t){return t.call.bind(t)}var o,s,l="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);function f(t,e){if("object"!==typeof t)return!1;try{return e(t),!0}catch(r){return!1}}function m(t){return"[object Map]"===u(t)}function g(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function v(t){return"[object WeakSet]"===u(t)}function x(t){return"[object ArrayBuffer]"===u(t)}function b(t){return"undefined"!==typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function _(t){return"[object DataView]"===u(t)}function w(t){return"undefined"!==typeof DataView&&(_.working?_(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return"undefined"!==typeof Promise&&t instanceof Promise||null!==t&&"object"===typeof t&&"function"===typeof t.then&&"function"===typeof t.catch},t.isArrayBufferView=function(t){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||w(t)},t.isUint8Array=function(t){return"Uint8Array"===n(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},t.isUint16Array=function(t){return"Uint16Array"===n(t)},t.isUint32Array=function(t){return"Uint32Array"===n(t)},t.isInt8Array=function(t){return"Int8Array"===n(t)},t.isInt16Array=function(t){return"Int16Array"===n(t)},t.isInt32Array=function(t){return"Int32Array"===n(t)},t.isFloat32Array=function(t){return"Float32Array"===n(t)},t.isFloat64Array=function(t){return"Float64Array"===n(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},m.working="undefined"!==typeof Map&&m(new Map),t.isMap=function(t){return"undefined"!==typeof Map&&(m.working?m(t):t instanceof Map)},g.working="undefined"!==typeof Set&&g(new Set),t.isSet=function(t){return"undefined"!==typeof Set&&(g.working?g(t):t instanceof Set)},y.working="undefined"!==typeof WeakMap&&y(new WeakMap),t.isWeakMap=function(t){return"undefined"!==typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},v.working="undefined"!==typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working="undefined"!==typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=b,_.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var k="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function S(t){return"undefined"!==typeof k&&("undefined"===typeof T.working&&(T.working=T(new k)),T.working?T(t):t instanceof k)}function A(t){return f(t,h)}function M(t){return f(t,d)}function C(t){return f(t,p)}function E(t){return l&&f(t,o)}function L(t){return c&&f(t,s)}t.isSharedArrayBuffer=S,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},t.isGeneratorObject=function(t){return"[object Generator]"===u(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},t.isNumberObject=A,t.isStringObject=M,t.isBooleanObject=C,t.isBigIntObject=E,t.isSymbolObject=L,t.isBoxedPrimitive=function(t){return A(t)||M(t)||C(t)||E(t)||L(t)},t.isAnyArrayBuffer=function(t){return"undefined"!==typeof Uint8Array&&(b(t)||S(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))}}),xc=d({"node_modules/util/support/isBufferBrowser.js"(t,e){e.exports=function(t){return t&&"object"===typeof t&&"function"===typeof t.copy&&"function"===typeof t.fill&&"function"===typeof t.readUInt8}}}),bc=d({"(disabled):node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},r=/%[sdj%]/g;t.format=function(t){if(!g(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(t).replace(r,(function(t){if("%%"===t)return"%";if(n>=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return t}})),l=i[n];n<a;l=i[++n])f(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if("undefined"!==typeof process&&!0===process.noDeprecation)return e;if("undefined"===typeof process)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"\x1b["+o.colors[r][0]+"m"+t+"\x1b["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):f(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return d(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=T?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)A(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(h(t,e,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return h(e,r,n,s,t,T)})),e.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=f(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"===typeof t}function f(t){return null===t}function m(t){return"number"===typeof t}function g(t){return"string"===typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===k(t)}function x(t){return"object"===typeof t&&null!==t}function b(t){return x(t)&&"[object Date]"===k(t)}function _(t){return x(t)&&("[object Error]"===k(t)||t instanceof Error)}function w(t){return"function"===typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=d,t.isBoolean=p,t.isNull=f,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"===typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=b,t.types.isDate=b,t.isError=_,t.types.isNativeError=_,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},t.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){console.log("%s - %s",function(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}(),t.format.apply(t,arguments))},t.inherits=Bl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(M&&t[M]){var r;if("function"!==typeof(r=t[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(o){r(o)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),M&&Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=M,t.callbackify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!==typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};t.apply(this,e).then((function(t){process.nextTick(a.bind(null,null,t))}),(function(t){process.nextTick(C.bind(null,t,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}}),_c=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(t,e){function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=Vl().Buffer,o=bc().inspect,s=o&&o.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,l,c;return e=t,l=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,a=t>i.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0===(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:s,value:function(t,e){return o(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],l&&i(e.prototype,l),c&&i(e,c),t}()}}),wc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(t,e){function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var a=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(r,a,t)):process.nextTick(r,a,t):e?(process.nextTick(n,a),e(t)):process.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}}),kc=d({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(t,e){var r={};function n(t,e,n){n||(n=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"===typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,a,o,s;if("string"===typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var l=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(i(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r}}),Tc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(t,e){var r=kc().codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}}}),Sc=d({"node_modules/util-deprecate/browser.js"(t,e){function r(t){try{if(!window.localStorage)return!1}catch(r){return!1}var e=window.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}}),Ac=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(t,e){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=k,k.WritableState=w;var i,a={deprecate:Sc()},o=jl(),s=Vl().Buffer,l=window.Uint8Array||function(){},c=wc(),u=Tc().getHighWaterMark,h=kc().codes,d=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,f=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,b=c.errorOrDestroy;function _(){}function w(t,e,i){n=n||Mc(),t=t||{},"boolean"!==typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=u(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!==typeof i)throw new f;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(E,t,e),t._writableState.errorEmitted=!0,b(t,n)):(i(n),t._writableState.errorEmitted=!0,b(t,n),E(t,e))}(t,r,n,e,i);else{var a=M(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?process.nextTick(S,t,r,a,i):S(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(t){var e=this instanceof(n=n||Mc());if(!e&&!i.call(k,this))return new k(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),o.call(this)}function T(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function S(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),E(t,e)}function A(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,a=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,T(t,e,!0,e.length,a,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(T(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(r){e.pendingcb--,r&&b(t,r),e.prefinished=!0,t.emit("prefinish"),E(t,e)}))}function E(t,e){var r=M(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!==typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(C,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}Bl()(k,o),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===k&&t&&t._writableState instanceof w}})):i=function(t){return t instanceof this},k.prototype.pipe=function(){b(this,new m)},k.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,o=!i.objectMode&&(n=t,s.isBuffer(n)||n instanceof l);return o&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"===typeof e&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!==typeof r&&(r=_),i.ending?function(t,e){var r=new v;b(t,r),process.nextTick(e,r)}(this,r):(o||function(t,e,r,n){var i;return null===r?i=new y:"string"===typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(b(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=s.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=e.objectMode?1:n.length;e.length+=l;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else T(t,e,!1,l,n,i,a);return c}(this,i,o,t,e,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new p("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,E(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=c.destroy,k.prototype._undestroy=c.undestroy,k.prototype._destroy=function(t,e){e(t)}}}),Mc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(t,e){var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var n,i,a,o=zc(),s=Ac();for(Bl()(l,o),n=r(s.prototype),a=0;a<n.length;a++)i=n[a],l.prototype[i]||(l.prototype[i]=s.prototype[i]);function l(t){if(!(this instanceof l))return new l(t);o.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}}),Cc=d({"node_modules/safe-buffer/index.js"(t,e){var r=Vl(),n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),a.prototype=Object.create(n.prototype),i(n,a),a.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},a.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"===typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}}),Ec=d({"node_modules/stream-browserify/node_modules/string_decoder/lib/string_decoder.js"(t){var e=Cc().Buffer,r=e.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var n;switch(this.encoding=function(t){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof n&&(e.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return n||t}(t),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=a,n=4;break;case"base64":this.text=l,this.end=c,n=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function i(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\ufffd":e},n.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var a=i(e[n]);return a>=0?(a>0&&(t.lastNeed=a-1),a):--n<r||-2===a?0:(a=i(e[n]))>=0?(a>0&&(t.lastNeed=a-2),a):--n<r||-2===a?0:(a=i(e[n]))>=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}}),Lc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,e){var r=kc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function t(e,i,a){if("function"===typeof i)return t(e,null,i);i||(i={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(a||n);var o=i.readable||!1!==i.readable&&e.readable,s=i.writable||!1!==i.writable&&e.writable,l=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!0,o||a.call(e)},h=e._readableState&&e._readableState.endEmitted,d=function(){o=!1,h=!0,s||a.call(e)},p=function(t){a.call(e,t)},f=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new r),a.call(e,t)):s&&!c?(e._writableState&&e._writableState.ended||(t=new r),a.call(e,t)):void 0},m=function(){e.req.on("finish",u)};return function(t){return t.setHeader&&"function"===typeof t.abort}(e)?(e.on("complete",u),e.on("abort",f),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",d),e.on("finish",u),!1!==i.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",u),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",u),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("end",d),e.removeListener("error",p),e.removeListener("close",f)}}}}),Pc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(t,e){var r;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=Lc(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[c]=null,t[a]=null,t[o]=null,e(d(r,!1)))}}function f(t){process.nextTick(p,t)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((n(r={get stream(){return this[h]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[s]?r(t[s]):e(d(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[l]?r(d(void 0,!0)):e[u](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[u])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),n(r,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),r),m);e.exports=function(t){var e,r=Object.create(g,(n(e={},h,{value:t,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,o,{value:null,writable:!0}),n(e,s,{value:null,writable:!0}),n(e,l,{value:t._readableState.endEmitted,writable:!0}),n(e,u,{value:function(t,e){var n=r[h].read();n?(r[c]=null,r[a]=null,r[o]=null,t(d(n,!1))):(r[a]=t,r[o]=e)},writable:!0}),e));return r[c]=null,i(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[o];return null!==e&&(r[c]=null,r[a]=null,r[o]=null,e(t)),void(r[s]=t)}var n=r[a];null!==n&&(r[c]=null,r[a]=null,r[o]=null,n(d(void 0,!0))),r[l]=!0})),t.on("readable",f.bind(null,r)),r}}}),Ic=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js"(t,e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}}}),zc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js"(t,e){var r;e.exports=k,k.ReadableState=w,he().EventEmitter;var n,i=function(t,e){return t.listeners(e).length},a=jl(),o=Vl().Buffer,s=window.Uint8Array||function(){},l=bc();n=l&&l.debuglog?l.debuglog("stream"):function(){};var c,u,h,d=_c(),p=wc(),f=Tc().getHighWaterMark,m=kc().codes,g=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,x=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Bl()(k,a);var b=p.errorOrDestroy,_=["error","close","destroy","pause","resume"];function w(t,e,n){r=r||Mc(),t=t||{},"boolean"!==typeof n&&(n=e instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=f(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=Ec().StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function k(t){if(r=r||Mc(),!(this instanceof k))return new k(t);var e=this instanceof r;this._readableState=new w(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function T(t,e,r,i,a){n("readableAddChunk",e);var l,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,E(t)))}}(t,c);else if(a||(l=function(t,e){var r,n;return n=e,o.isBuffer(n)||n instanceof s||"string"===typeof e||void 0===e||t.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],e)),r}(c,e)),l)b(t,l);else if(c.objectMode||e&&e.length>0)if("string"===typeof e||c.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)c.endEmitted?b(t,new x):S(t,c,e,!0);else if(c.ended)b(t,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?S(t,c,e,!1):L(t,c)):S(t,c,e,!1)}else i||(c.reading=!1,L(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function S(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&C(t)),L(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=p.destroy,k.prototype._undestroy=p.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"===typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=o.from(t,e),e=""),r=!0),T(this,t,e,!1,r)},k.prototype.unshift=function(t){return T(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){c||(c=Ec().StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var A=1073741824;function M(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(E,t))}function E(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function L(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(n("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){n("readable nexttick read 0"),t.read(0)}function O(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function F(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(B,e,t))}function B(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}k.prototype.read=function(t){n("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):C(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&F(this),null;var i,a=e.needReadable;return n("need readable",a),(0===e.length||e.length-t<e.highWaterMark)&&n("length less than watermark",a=!0),e.ended||e.reading?n("reading or ended",a=!1):a&&(n("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=M(r,e))),null===(i=t>0?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&F(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(t){b(this,new v("_read()"))},k.prototype.pipe=function(t,e){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,e);var o=e&&!1===e.end||t===process.stdout||t===process.stderr?m:l;function s(e,i){n("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",f),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),u=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function l(){n("onend"),t.end()}a.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",c);var u=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==j(a.pipes,t))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function d(e){n("onerror",e),m(),t.removeListener("error",d),0===i(t,"error")&&b(t,e)}function p(){t.removeListener("finish",f),m()}function f(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",f),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=j(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},k.prototype.on=function(t,e){var r=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?C(this):i.reading||process.nextTick(z,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(I,this),r},k.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(I,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(O,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var a in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),(!r.objectMode||null!==a&&void 0!==a)&&(r.objectMode||a&&a.length)&&(e.push(a)||(i=!0,t.pause()))})),t)void 0===this[a]&&"function"===typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var o=0;o<_.length;o++)t.on(_[o],this.emit.bind(this,_[o]));return this._read=function(e){n("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"===typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=Pc()),u(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=R,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(k.from=function(t,e){return void 0===h&&(h=Ic()),h(k,t,e)})}}),Oc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(t,e){e.exports=c;var r=kc().codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=Mc();function l(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);s.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"===typeof t.transform&&(this._transform=t.transform),"function"===typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!==typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new o;if(t._transformState.transforming)throw new a;return t.push(null)}Bl()(c,s),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new n("_transform()"))},c.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,(function(t){e(t)}))}}}),Dc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"(t,e){e.exports=n;var r=Oc();function n(t){if(!(this instanceof n))return new n(t);r.call(this,t)}Bl()(n,r),n.prototype._transform=function(t,e,r){r(null,t)}}}),Rc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js"(t,e){var r,n=kc().codes,i=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(t){if(t)throw t}function s(t){t()}function l(t,e){return t.pipe(e)}e.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var c,u=function(t){return t.length?"function"!==typeof t[t.length-1]?o:t.pop():o}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new i("streams");var h=e.map((function(t,n){var i=n<e.length-1;return function(t,e,n,i){i=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(i);var o=!1;t.on("close",(function(){o=!0})),void 0===r&&(r=Lc()),r(t,{readable:e,writable:n},(function(t){if(t)return i(t);o=!0,i()}));var s=!1;return function(e){if(!o&&!s)return s=!0,function(t){return t.setHeader&&"function"===typeof t.abort}(t)?t.abort():"function"===typeof t.destroy?t.destroy():void i(e||new a("pipe"))}}(t,i,n>0,(function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),u(c))}))}));return e.reduce(l)}}}),Fc=d({"node_modules/stream-browserify/index.js"(t,e){e.exports=n;var r=he().EventEmitter;function n(){r.call(this)}Bl()(n,r),n.Readable=zc(),n.Writable=Ac(),n.Duplex=Mc(),n.Transform=Oc(),n.PassThrough=Dc(),n.finished=Lc(),n.pipeline=Rc(),n.Stream=n,n.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"===typeof t.destroy&&t.destroy())}function c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}}}),Bc=d({"node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},r=/%[sdj%]/g;t.format=function(t){if(!g(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(t).replace(r,(function(t){if("%%"===t)return"%";if(n>=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return t}})),l=i[n];n<a;l=i[++n])f(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},t.deprecate=function(e,r){if("undefined"!==typeof process&&!0===process.noDeprecation)return e;if("undefined"===typeof process)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"\x1b["+o.colors[r][0]+"m"+t+"\x1b["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):f(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return d(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=T?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)A(e,String(o))?a.push(h(t,e,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(h(t,e,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return h(e,r,n,s,t,T)})),e.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=f(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"===typeof t}function f(t){return null===t}function m(t){return"number"===typeof t}function g(t){return"string"===typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===k(t)}function x(t){return"object"===typeof t&&null!==t}function b(t){return x(t)&&"[object Date]"===k(t)}function _(t){return x(t)&&("[object Error]"===k(t)||t instanceof Error)}function w(t){return"function"===typeof t}function k(t){return Object.prototype.toString.call(t)}function T(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=d,t.isBoolean=p,t.isNull=f,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"===typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=b,t.types.isDate=b,t.isError=_,t.types.isNativeError=_,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},t.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){console.log("%s - %s",function(){var t=new Date,e=[T(t.getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}(),t.format.apply(t,arguments))},t.inherits=Bl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(M&&t[M]){var r;if("function"!==typeof(r=t[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(o){r(o)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),M&&Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,e(t))},t.promisify.custom=M,t.callbackify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!==typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};t.apply(this,e).then((function(t){process.nextTick(a.bind(null,null,t))}),(function(t){process.nextTick(C.bind(null,t,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,e(t)),r}}}),jc=d({"node_modules/assert/build/internal/errors.js"(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r(e)?e:String(e)}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=s(t);if(e){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===r(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var l,c,u={};function h(t,e,r){r||(r=Error);var i=function(r){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}(u,r);var i,s,l,c=o(u);function u(r,n,i){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a=c.call(this,function(t,r,n){return"string"===typeof e?e:e(t,r,n)}(r,n,i)),a.code=t,a}return i=u,s&&n(i.prototype,s),l&&n(i,l),Object.defineProperty(i,"prototype",{writable:!1}),i}(r);u[t]=i}function d(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}h("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),h("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,a,o,s;if(void 0===l&&(l=ru()),l("string"===typeof t,"'name' must be a string"),"string"===typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(d(e,"type"));else{var c=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(d(e,"type"))}return s+=". Received type ".concat(r(n))}),TypeError),h("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=Bc());var n=c.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),h("ERR_INVALID_RETURN_VALUE",(function(t,e,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),h("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];void 0===l&&(l=ru()),l(e.length>0,"At least one arg needs to be specified");var n="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,i-1).join(", "),n+=", and ".concat(e[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),e.exports.codes=u}}),Nc=d({"node_modules/assert/build/internal/assert/assertion_error.js"(t,e){function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=a(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}function o(t,e){if(e&&("object"===p(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l(t){var e="function"===typeof Map?new Map:void 0;return l=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,d(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},l(t)}function c(t,e,r){return(c=u()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i}).apply(null,arguments)}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var f=Bc().inspect,m=jc().codes.ERR_INVALID_ARG_TYPE;function g(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y="",v="",x="",b="",_={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:"};function w(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function k(t){return f(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function T(t,e,r){var n="",i="",a=0,o="",s=!1,l=k(t),c=l.split("\n"),u=k(e).split("\n"),h=0,d="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var f=c[0].length+u[0].length;if(f<=10){if(("object"!==p(t)||null===t)&&("object"!==p(e)||null===e)&&(0!==t||0!==e))return"".concat(_[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&f<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===u[0][h];)h++;h>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}for(var m=c[c.length-1],w=u[u.length-1];m===w&&(h++<2?o="\n ".concat(m).concat(o):n=m,c.pop(),u.pop(),0!==c.length&&0!==u.length);)m=c[c.length-1],w=u[u.length-1];var T=Math.max(c.length,u.length);if(0===T){var S=l.split("\n");if(S.length>30)for(S[26]="".concat(y,"...").concat(b);S.length>27;)S.pop();return"".concat(_.notIdentical,"\n\n").concat(S.join("\n"),"\n")}h>3&&(o="\n".concat(y,"...").concat(b).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var A=0,M=_[r]+"\n".concat(v,"+ actual").concat(b," ").concat(x,"- expected").concat(b),C=" ".concat(y,"...").concat(b," Lines skipped");for(h=0;h<T;h++){var E=h-a;if(c.length<h+1)E>1&&h>2&&(E>4?(i+="\n".concat(y,"...").concat(b),s=!0):E>3&&(i+="\n ".concat(u[h-2]),A++),i+="\n ".concat(u[h-1]),A++),a=h,n+="\n".concat(x,"-").concat(b," ").concat(u[h]),A++;else if(u.length<h+1)E>1&&h>2&&(E>4?(i+="\n".concat(y,"...").concat(b),s=!0):E>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(c[h]),A++;else{var L=u[h],P=c[h],I=P!==L&&(!g(P,",")||P.slice(0,-1)!==L);I&&g(L,",")&&L.slice(0,-1)===P&&(I=!1,P+=","),I?(E>1&&h>2&&(E>4?(i+="\n".concat(y,"...").concat(b),s=!0):E>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(P),n+="\n".concat(x,"-").concat(b," ").concat(L),A+=2):(i+=n,n="",1!==E&&0!==h||(i+="\n ".concat(P),A++))}if(A>20&&h<T-2)return"".concat(M).concat(C,"\n").concat(i,"\n").concat(y,"...").concat(b).concat(n,"\n")+"".concat(y,"...").concat(b)}return"".concat(M).concat(s?C:"","\n").concat(i).concat(n).concat(o).concat(d)}var S=function(t,e){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(g,t);var r,a,l,c=function(t){var e=u();return function(){var r,n=d(t);if(e){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}(g);function g(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,g),"object"!==p(t)||null===t)throw new m("options","Object",t);var r=t.message,n=t.operator,i=t.stackStartFn,a=t.actual,l=t.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)e=c.call(this,String(r));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(y="\x1b[34m",v="\x1b[32m",b="\x1b[39m",x="\x1b[31m"):(y="",v="",b="",x="")),"object"===p(a)&&null!==a&&"object"===p(l)&&null!==l&&"stack"in a&&a instanceof Error&&"stack"in l&&l instanceof Error&&(a=w(a),l=w(l)),"deepStrictEqual"===n||"strictEqual"===n)e=c.call(this,T(a,l,n));else if("notDeepStrictEqual"===n||"notStrictEqual"===n){var h=_[n],d=k(a).split("\n");if("notStrictEqual"===n&&"object"===p(a)&&null!==a&&(h=_.notStrictEqualObject),d.length>30)for(d[26]="".concat(y,"...").concat(b);d.length>27;)d.pop();e=1===d.length?c.call(this,"".concat(h," ").concat(d[0])):c.call(this,"".concat(h,"\n\n").concat(d.join("\n"),"\n"))}else{var f=k(a),S="",A=_[n];"notDeepEqual"===n||"notEqual"===n?(f="".concat(_[n],"\n\n").concat(f)).length>1024&&(f="".concat(f.slice(0,1021),"...")):(S="".concat(k(l)),f.length>512&&(f="".concat(f.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===n||"equal"===n?f="".concat(A,"\n\n").concat(f,"\n\nshould equal\n\n"):S=" ".concat(n," ").concat(S)),e=c.call(this,"".concat(f).concat(S))}return Error.stackTraceLimit=u,e.generatedMessage=!r,Object.defineProperty(s(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=l,e.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(e),i),e.stack,e.name="AssertionError",o(e)}return r=g,(a=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return f(this,n(n({},e),{},{customInspect:!1,depth:0}))}}])&&i(r.prototype,a),l&&i(r,l),Object.defineProperty(r,"prototype",{writable:!1}),g}(l(Error),f.custom);e.exports=S}}),Uc=d({"node_modules/object-keys/isArguments.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}}}),Vc=d({"node_modules/object-keys/implementation.js"(t,e){var r,n,i,a,o,s,l,c,u,h,d,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Uc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},h={$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},d=function(){if("undefined"===typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"===typeof window[t])try{u(window[t])}catch(e){return!0}}catch(e){return!0}return!1}(),p=function(t){if("undefined"===typeof window||!d)return u(t);try{return u(t)}catch(e){return!1}},r=function(t){var e=null!==t&&"object"===typeof t,r="[object Function]"===i.call(t),o=a(t),u=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(u&&t.length>0&&!n.call(t,0))for(var f=0;f<t.length;++f)h.push(String(f));if(o&&t.length>0)for(var m=0;m<t.length;++m)h.push(String(m));else for(var g in t)d&&"prototype"===g||!n.call(t,g)||h.push(String(g));if(s)for(var y=p(t),v=0;v<c.length;++v)y&&"constructor"===c[v]||!n.call(t,c[v])||h.push(c[v]);return h}),e.exports=r}}),qc=d({"node_modules/object-keys/index.js"(t,e){var r=Array.prototype.slice,n=Uc(),i=Object.keys,a=i?function(t){return i(t)}:Vc(),o=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return n(t)?o(r.call(t)):o(t)})}else Object.keys=a;return Object.keys||a},e.exports=a}}),$c=d({"node_modules/object.assign/implementation.js"(t,e){var r=qc(),n=ql()(),i=uc(),a=Object,o=i("Array.prototype.push"),s=i("Object.prototype.propertyIsEnumerable"),l=n?Object.getOwnPropertySymbols:null;e.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var i=a(t);if(1===arguments.length)return i;for(var c=1;c<arguments.length;++c){var u=a(arguments[c]),h=r(u),d=n&&(Object.getOwnPropertySymbols||l);if(d)for(var p=d(u),f=0;f<p.length;++f){var m=p[f];s(u,m)&&o(h,m)}for(var g=0;g<h.length;++g){var y=h[g];if(s(u,y)){var v=u[y];i[y]=v}}}return i}}}),Hc=d({"node_modules/object.assign/polyfill.js"(t,e){var r=$c();e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var i=Object.assign({},r),a="";for(var o in i)a+=o;return t!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch(e){return"y"===t[1]}return!1}()?r:Object.assign:r}}}),Wc=d({"node_modules/object-is/implementation.js"(t,e){var r=function(t){return t!==t};e.exports=function(t,e){return 0===t&&0===e?1/t===1/e:t===e||!(!r(t)||!r(e))}}}),Gc=d({"node_modules/object-is/polyfill.js"(t,e){var r=Wc();e.exports=function(){return"function"===typeof Object.is?Object.is:r}}}),Yc=d({"node_modules/define-properties/index.js"(t,e){var r=qc(),n="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=sc()(),l=o&&s,c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!==typeof(a=n)||"[object Function]"!==i.call(a)||!n())return;var a;l?o(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r},u=function(t,e){var i=arguments.length>2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)c(t,o[s],e[o[s]],i[o[s]])};u.supportsDescriptors=!!l,e.exports=u}}),Zc=d({"node_modules/object-is/shim.js"(t,e){var r=Gc(),n=Yc();e.exports=function(){var t=r();return n(Object,{is:t},{is:function(){return Object.is!==t}}),t}}}),Xc=d({"node_modules/object-is/index.js"(t,e){var r=Yc(),n=cc(),i=Wc(),a=Gc(),o=Zc(),s=n(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}}),Kc=d({"node_modules/is-nan/implementation.js"(t,e){e.exports=function(t){return t!==t}}}),Jc=d({"node_modules/is-nan/polyfill.js"(t,e){var r=Kc();e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}}}),Qc=d({"node_modules/is-nan/shim.js"(t,e){var r=Yc(),n=Jc();e.exports=function(){var t=n();return r(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}}}),tu=d({"node_modules/is-nan/index.js"(t,e){var r=cc(),n=Yc(),i=Kc(),a=Jc(),o=Qc(),s=r(a(),Number);n(s,{getPolyfill:a,implementation:i,shim:o}),e.exports=s}}),eu=d({"node_modules/assert/build/internal/util/comparisons.js"(t,e){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"===typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=void 0!==/a/g.flags,o=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},l=Object.is?Object.is:Xc(),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:tu();function h(t){return t.call.bind(t)}var d=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),f=h(Object.prototype.toString),m=Bc().types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,x=m.isMap,b=m.isRegExp,_=m.isSet,w=m.isNativeError,k=m.isBoxedPrimitive,T=m.isNumberObject,S=m.isStringObject,A=m.isBooleanObject,M=m.isBigIntObject,C=m.isSymbolObject,E=m.isFloat32Array,L=m.isFloat64Array;function P(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(P).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function O(t,e,r,n){if(t===e)return 0!==t||!r||l(t,e);if(r){if("object"!==i(t))return"number"===typeof t&&u(t)&&u(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var o,s,c,h,d=f(t);if(d!==f(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),m=I(e);return p.length===m.length&&R(t,e,r,n,1,p)}if("[object Object]"===d&&(!x(t)&&x(e)||!_(t)&&_(e)))return!1;if(v(t)){if(!v(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(b(t)){if(!b(e)||(c=t,h=e,!(a?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(w(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(y(t)){if(r||!E(t)&&!L(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===z(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var P=I(t),O=I(e);return P.length===O.length&&R(t,e,r,n,0,P)}if(_(t))return!(!_(e)||t.size!==e.size)&&R(t,e,r,n,2);if(x(t))return!(!x(e)||t.size!==e.size)&&R(t,e,r,n,3);if(g(t)){if(s=e,(o=t).byteLength!==s.byteLength||0!==z(new Uint8Array(o),new Uint8Array(s)))return!1}else if(k(t)&&!function(t,e){return T(t)?T(e)&&l(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):S(t)?S(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):A(t)?A(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):M(t)?M(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):C(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return R(t,e,r,n,0)}function D(t,e){return e.filter((function(e){return p(t,e)}))}function R(t,e,n,a,l,u){if(5===arguments.length){u=Object.keys(t);var h=Object.keys(e);if(u.length!==h.length)return!1}for(var f=0;f<u.length;f++)if(!d(e,u[f]))return!1;if(n&&5===arguments.length){var m=c(t);if(0!==m.length){var g=0;for(f=0;f<m.length;f++){var y=m[f];if(p(t,y)){if(!p(e,y))return!1;u.push(y),g++}else if(p(e,y))return!1}var v=c(e);if(m.length!==v.length&&D(e,v).length!==g)return!1}else{var x=c(e);if(0!==x.length&&0!==D(e,x).length)return!1}}if(0===u.length&&(0===l||1===l&&0===t.length||0===t.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var b=a.val1.get(t);if(void 0!==b){var _=a.val2.get(e);if(void 0!==_)return b===_}a.position++}a.val1.set(t,a.position),a.val2.set(e,a.position);var w=function(t,e,n,a,l,c){var u=0;if(2===c){if(!function(t,e,r,n){for(var a=null,s=o(t),l=0;l<s.length;l++){var c=s[l];if("object"===i(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!e.has(c)){if(r)return!1;if(!j(t,e,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=o(e),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!F(a,d,r,n))return!1}else if(!r&&!t.has(d)&&!F(a,d,r,n))return!1}return 0===a.size}return!0}(t,e,n,l))return!1}else if(3===c){if(!function(t,e,n,a){for(var o=null,l=s(t),c=0;c<l.length;c++){var u=r(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!O(d,p,n,a)){if(n)return!1;if(!N(t,e,h,d,a))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var f=s(e),m=0;m<f.length;m++){var g=r(f[m],2),y=g[0],v=g[1];if("object"===i(y)&&null!==y){if(!U(o,t,y,v,n,a))return!1}else if(!n&&(!t.has(y)||!O(t.get(y),v,!1,a))&&!U(o,t,y,v,!1,a))return!1}return 0===o.size}return!0}(t,e,n,l))return!1}else if(1===c)for(;u<t.length;u++){if(!d(t,u)){if(d(e,u))return!1;for(var h=Object.keys(t);u<h.length;u++){var p=h[u];if(!d(e,p)||!O(t[p],e[p],n,l))return!1}return h.length===Object.keys(e).length}if(!d(e,u)||!O(t[u],e[u],n,l))return!1}for(u=0;u<a.length;u++){var f=a[u];if(!O(t[f],e[f],n,l))return!1}return!0}(t,e,n,u,a,l);return a.val1.delete(t),a.val2.delete(e),w}function F(t,e,r,n){for(var i=o(t),a=0;a<i.length;a++){var s=i[a];if(O(e,s,r,n))return t.delete(s),!0}return!1}function B(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(u(t))return!1}return!0}function j(t,e,r){var n=B(r);return null!=n?n:e.has(n)&&!t.has(n)}function N(t,e,r,n,i){var a=B(r);if(null!=a)return a;var o=e.get(a);return!(void 0===o&&!e.has(a)||!O(n,o,!1,i))&&!t.has(a)&&O(n,o,!1,i)}function U(t,e,r,n,i,a){for(var s=o(t),l=0;l<s.length;l++){var c=s[l];if(O(r,c,i,a)&&O(n,e.get(c),i,a))return t.delete(c),!0}return!1}e.exports={isDeepEqual:function(t,e){return O(t,e,!1)},isDeepStrictEqual:function(t,e){return O(t,e,!0)}}}}),ru=d({"node_modules/assert/build/assert.js"(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r(e)?e:String(e)}var o,s,l=jc().codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,p=l.ERR_MISSING_ARGS,f=Nc(),m=Bc().inspect,g=Bc().types,y=g.isPromise,v=g.isRegExp,x=Hc()(),b=Gc()(),_=uc()("RegExp.prototype.test");function w(){var t=eu();o=t.isDeepEqual,s=t.isDeepStrictEqual}var k=!1,T=e.exports=C,S={};function A(t){if(t.message instanceof Error)throw t.message;throw new f(t)}function M(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw a.generatedMessage=i,a}}function C(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];M.apply(void 0,[C,e.length].concat(e))}T.fail=function t(e,r,n,i,a){var o,s=arguments.length;if(0===s?o="Failed":1===s?(n=e,e=void 0):(!1===k&&(k=!0,(process.emitWarning?process.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===s&&(i="!=")),n instanceof Error)throw n;var l={actual:e,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||t};void 0!==n&&(l.message=n);var c=new f(l);throw o&&(c.message=o,c.generatedMessage=!0),c},T.AssertionError=f,T.ok=C,T.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},T.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},T.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&w(),o(e,r)||A({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},T.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&w(),o(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},T.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&w(),s(e,r)||A({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},T.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===o&&w(),s(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},T.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");b(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},T.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");b(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var E=i((function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"===typeof n[t]&&v(e[t])&&_(e[t],n[t])?i[t]=n[t]:i[t]=e[t])}))}));function L(t,e,n,i){if("function"!==typeof e){if(v(e))return _(e,t);if(2===arguments.length)throw new u("expected",["Function","RegExp"],e);if("object"!==r(t)||null===t){var a=new f({actual:t,expected:e,message:n,operator:"deepStrictEqual",stackStartFn:i});throw a.operator=i.name,a}var l=Object.keys(e);if(e instanceof Error)l.push("name","message");else if(0===l.length)throw new h("error",e,"may not be an empty object");return void 0===o&&w(),l.forEach((function(r){"string"===typeof t[r]&&v(e[r])&&_(e[r],t[r])||function(t,e,r,n,i,a){if(!(r in t)||!s(t[r],e[r])){if(!n){var o=new E(t,i),l=new E(e,i,t),c=new f({actual:o,expected:l,operator:"deepStrictEqual",stackStartFn:a});throw c.actual=t,c.expected=e,c.operator=a.name,c}A({actual:t,expected:e,message:n,operator:a.name,stackStartFn:a})}}(t,e,r,n,l,i)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function P(t){if("function"!==typeof t)throw new u("fn","Function",t);try{t()}catch(e){return e}return S}function I(t){return y(t)||null!==t&&"object"===r(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function z(t){return Promise.resolve().then((function(){var e;if("function"===typeof t){if(!I(e=t()))throw new d("instance of Promise","promiseFn",e)}else{if(!I(t))throw new u("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return S})).catch((function(t){return t}))}))}function O(t,e,n,i){if("string"===typeof n){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],n);if("object"===r(e)&&null!==e){if(e.message===n)throw new c("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===n)throw new c("error/message",'The error "'.concat(e,'" is identical to the message.'));i=n,n=void 0}else if(null!=n&&"object"!==r(n)&&"function"!==typeof n)throw new u("error",["Object","Error","Function","RegExp"],n);if(e===S){var a="";n&&n.name&&(a+=" (".concat(n.name,")")),a+=i?": ".concat(i):".";var o="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:n,operator:t.name,message:"Missing expected ".concat(o).concat(a),stackStartFn:t})}if(n&&!L(e,n,i,t))throw e}function D(t,e,r,n){if(e!==S){if("string"===typeof r&&(n=r,r=void 0),!r||L(e,r)){var i=n?": ".concat(n):".",a="doesNotReject"===t.name?"rejection":"exception";A({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(a).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function R(t,e,n,i,a){if(!v(e))throw new u("regexp","RegExp",e);var o="match"===a;if("string"!==typeof t||_(e,t)!==o){if(n instanceof Error)throw n;var s=!n;n=n||("string"!==typeof t?'The "string" argument must be of type string. Received type '+"".concat(r(t)," (").concat(m(t),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(m(e),". Input:\n\n").concat(m(t),"\n"));var l=new f({actual:t,expected:e,message:n,operator:a,stackStartFn:i});throw l.generatedMessage=s,l}}function F(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];M.apply(void 0,[F,e.length].concat(e))}T.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];O.apply(void 0,[t,P(e)].concat(n))},T.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return z(e).then((function(e){return O.apply(void 0,[t,e].concat(n))}))},T.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[t,P(e)].concat(n))},T.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return z(e).then((function(e){return D.apply(void 0,[t,e].concat(n))}))},T.ifError=function t(e){if(null!==e&&void 0!==e){var n="ifError got unwanted exception: ";"object"===r(e)&&"string"===typeof e.message?0===e.message.length&&e.constructor?n+=e.constructor.name:n+=e.message:n+=m(e);var i=new f({actual:e,expected:null,operator:"ifError",message:n,stackStartFn:t}),a=e.stack;if("string"===typeof a){var o=a.split("\n");o.shift();for(var s=i.stack.split("\n"),l=0;l<o.length;l++){var c=s.indexOf(o[l]);if(-1!==c){s=s.slice(0,c);break}}i.stack="".concat(s.join("\n"),"\n").concat(o.join("\n"))}throw i}},T.match=function t(e,r,n){R(e,r,n,t,"match")},T.doesNotMatch=function t(e,r,n){R(e,r,n,t,"doesNotMatch")},T.strict=x(F,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict}}),nu=d({"node_modules/stream-parser/node_modules/ms/index.js"(t,e){var r=1e3,n=60*r,i=60*n,a=24*i,o=365.25*a;function s(t,e,r){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}e.exports=function(t,e){e=e||{};var l,c=typeof t;if("string"===c&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&!1===isNaN(t))return e.long?s(l=t,a,"day")||s(l,i,"hour")||s(l,n,"minute")||s(l,r,"second")||l+" ms":function(t){return t>=a?Math.round(t/a)+"d":t>=i?Math.round(t/i)+"h":t>=n?Math.round(t/n)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}}),iu=d({"node_modules/stream-parser/node_modules/debug/src/debug.js"(t,e){var r;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,a=i-(r||i);e.diff=a,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=t.coerce(o[0]),"string"!==typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;l++;var i=t.formatters[n];if("function"===typeof i){var a=o[l];r=i.call(e,a),o.splice(l,1),l--}return r})),t.formatArgs.call(e,o),(n.log||t.log||console.log.bind(console)).apply(e,o)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"===typeof t.init&&t.init(n),n}(t=e.exports=n.debug=n.default=n).coerce=function(t){return t instanceof Error?t.stack||t.message:t},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"===typeof e?e:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(e=r[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=nu(),t.names=[],t.skips=[],t.formatters={}}}),au=d({"node_modules/stream-parser/node_modules/debug/src/browser.js"(t,e){function r(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DEBUG),e}(t=e.exports=iu()).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),e.splice(a,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=r,t.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(r())}}),ou=d({"node_modules/stream-parser/index.js"(t,e){var r=ru(),n=au()("stream-parser");function i(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function a(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||i(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function s(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function l(t,e,r){this._parserInit||i(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function c(t,e,r){this._parserInit||i(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function u(t,e,r,i){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var a=t._parserCallback;if(a&&0===t._parserState&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),a){var o=[];e&&o.push(e),r&&o.push(r);var s=a.length>o.length;s&&o.push(d(i));var l=a.apply(t,o);if(!s||i===l)return i}}e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=a,t._skipBytes=o,e&&(t._passthrough=s),e?t._transform=c:t._write=l};var h=d((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return u(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return u(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function d(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}}),su=d({"node_modules/probe-image-size/lib/common.js"(t){var e=Fc().Transform,r=ou();function n(){e.call(this,{readableObjectMode:!0})}function i(t,e,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=t,e&&(this.code=e),r&&(this.statusCode=r)}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,r(n.prototype),t.ParserStream=n,t.sliceEq=function(t,e,r){for(var n=e,i=0;i<r.length;)if(t[n++]!==r[i++])return!1;return!0},t.str2arr=function(t,e){var r=[],n=0;if(e&&"hex"===e)for(;n<t.length;)r.push(parseInt(t.slice(n,n+2),16)),n+=2;else for(;n<t.length;n++)r.push(255&t.charCodeAt(n));return r},t.readUInt16LE=function(t,e){return t[e]|t[e+1]<<8},t.readUInt16BE=function(t,e){return t[e+1]|t[e]<<8},t.readUInt32LE=function(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|16777216*t[e+3]},t.readUInt32BE=function(t,e){return t[e+3]|t[e+2]<<8|t[e+1]<<16|16777216*t[e]},i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,t.ProbeError=i}}),lu=d({"node_modules/probe-image-size/lib/miaf_utils.js"(t,e){var r=su().readUInt16BE,n=su().readUInt32BE;function i(t,e){if(t.length<4+e)return null;var r=n(t,e);return t.length<r+e||r<8?null:{boxtype:String.fromCharCode.apply(null,t.slice(e+4,e+8)),data:t.slice(e+8,e+r),end:e+r}}function a(t,e){for(var r=0;;){var a=i(t,r);if(!a)break;switch(a.boxtype){case"ispe":e.sizes.push({width:n(a.data,4),height:n(a.data,8)});break;case"irot":e.transforms.push({type:"irot",value:3&a.data[0]});break;case"imir":e.transforms.push({type:"imir",value:1&a.data[0]})}r=a.end}}function o(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+(t[e+i]||0);return n}function s(t,e){for(var n=t[4]>>4&15,i=15&t[4],a=t[5]>>4&15,s=r(t,6),l=8,c=0;c<s;c++){var u=r(t,l),h=r(t,l+=2),d=o(t,l+=2,a),p=r(t,l+=a);if(l+=2,0===h&&1===p){var f=o(t,l,n),m=o(t,l+n,i);e.item_loc[u]={length:m,offset:f+d}}l+=p*(n+i)}}function l(t,e){for(var n=r(t,4),a=6,o=0;o<n;o++){var s=i(t,a);if(!s)break;if("infe"===s.boxtype){for(var l=r(s.data,4),c="",u=8;u<s.data.length&&s.data[u];u++)c+=String.fromCharCode(s.data[u]);e.item_inf[c]=l}a=s.end}}function c(t,e){for(var r=0;;){var n=i(t,r);if(!n)break;"ipco"===n.boxtype&&a(n.data,e),r=n.end}}e.exports.unbox=i,e.exports.readSizeFromMeta=function(t){var e={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(function(t,e){for(var r=4;;){var n=i(t,r);if(!n)break;"iprp"===n.boxtype&&c(n.data,e),"iloc"===n.boxtype&&s(n.data,e),"iinf"===n.boxtype&&l(n.data,e),r=n.end}}(t,e),e.sizes.length){var r=function(t){var e=t.reduce((function(t,e){return t.width>e.width||t.width===e.width&&t.height>e.height?t:e})),r=t.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e}));return e.width>r.height||e.width===r.height&&e.height>r.width?e:r}(e.sizes),n=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(n=0===t.value?r[n]:e[n=e[n=r[n]]]),"irot"===t.type)for(var i=0;i<t.value;i++)n=e[n]}));var a=null;return e.item_inf.Exif&&(a=e.item_loc[e.item_inf.Exif]),{width:r.width,height:r.height,orientation:e.transforms.length?n:null,variants:e.sizes,exif_location:a}}},e.exports.getMimeType=function(t){var e=String.fromCharCode.apply(null,t.slice(0,4)),r={};r[e]=!0;for(var n=8;n<t.length;n+=4)r[String.fromCharCode.apply(null,t.slice(n,n+4))]=!0;if(r.mif1||r.msf1||r.miaf)return"avif"===e||"avis"===e||"avio"===e?{type:"avif",mime:"image/avif"}:"heic"===e||"heix"===e?{type:"heic",mime:"image/heic"}:"hevc"===e||"hevx"===e?{type:"heic",mime:"image/heic-sequence"}:r.avif||r.avis?{type:"avif",mime:"image/avif"}:r.heic||r.heix||r.hevc||r.hevx||r.heis?r.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}}),cu=d({"node_modules/probe-image-size/lib/exif_utils.js"(t,e){function r(t,e){var r=new Error(t);return r.code=e,r}function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}function i(t,e,n){this.input=t.subarray(e,n),this.start=e;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw r("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}i.prototype.each=function(t){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},i.prototype.scan_ifd=function(t,e,i){var a=this.read_uint16(e);e+=2;for(var o=0;o<a;o++){var s=this.read_uint16(e),l=this.read_uint16(e+2),c=this.read_uint32(e+4),u=this.exif_format_length(l),h=c*u,d=h<=4?e+8:this.read_uint32(e+8),p=!1;if(d+h>this.input.length)throw r("unexpected EOF","EBADDATA");for(var f=[],m=d,g=0;g<c;g++,m+=u){var y=this.exif_format_read(l,m);if(null===y){f=null;break}f.push(y)}if(Array.isArray(f)&&2===l&&(f=n(String.fromCharCode.apply(null,f)))&&"\0"===f[f.length-1]&&(f=f.slice(0,-1)),this.is_subifd_link(t,s)&&Array.isArray(f)&&Number.isInteger(f[0])&&f[0]>0&&(this.ifds_to_read.push({id:s,offset:f[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:h,data_offset:d+this.start,value:f,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(r){return-1}}}}),uu=d({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=lu(),o=cu(),s=r("ftyp");e.exports=function(t){if(n(t,4,s)){var e=a.unbox(t,0);if(e){var r=a.getMimeType(e.data);if(r){for(var l,c=e.end;;){var u=a.unbox(t,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var d={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(d.variants=h.variants),h.orientation&&(d.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var p=i(t,h.exif_location.offset),f=t.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(f);m>0&&(d.orientation=m)}return d}}}}}}}}),hu=d({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("BM");e.exports=function(t){if(!(t.length<26)&&n(t,0,a))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),du=d({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");e.exports=function(t){if(!(t.length<10)&&(n(t,0,a)||n(t,0,o)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),pu=d({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,e){var r=su().readUInt16LE;e.exports=function(t){var e=r(t,0),n=r(t,2),i=r(t,4);if(0===e&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;s<i;s++){var l=t[6+16*s]||256,c=t[6+16*s+1]||256,u={width:l,height:c};a.push(u),(l>o.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),fu=d({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,e){var r=su().readUInt16BE,n=su().str2arr,i=su().sliceEq,a=cu(),o=n("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var n,s,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)n=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;n=r(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&n>=10&&i(t,e,o)&&(s=a.get_orientation(t.slice(e+6,e+n))),n>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e<n)return;var c={width:r(t,e+3),height:r(t,e+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return s>0&&(c.orientation=s),c}e+=n}}}}),mu=d({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("\x89PNG\r\n\x1a\n"),o=r("IHDR");e.exports=function(t){if(!(t.length<24)&&n(t,0,a)&&n(t,12,o))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gu=d({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&n(t,0,a))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),yu=d({"node_modules/probe-image-size/lib/parse_sync/svg.js"(t,e){function r(t){return"number"===typeof t&&isFinite(t)&&t>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(t){return l.test(t)?t.match(l)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r<n&&(32===(e=t[r])||9===e||13===e||10===e);)r++;return r!==n&&60===t[r]}(t)){for(var e="",l=0;l<t.length;l++)e+=String.fromCharCode(t[l]);var u=(e.match(n)||[""])[0];if(i.test(u)){var h=function(t){var e=t.match(a),r=t.match(o),n=t.match(s);return{width:e&&(e[1]||e[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}(u),d=parseFloat(h.width),p=parseFloat(h.height);if(h.width&&h.height){if(!r(d)||!r(p))return;return{width:d,height:p,type:"svg",mime:"image/svg+xml",wUnits:c(h.width),hUnits:c(h.height)}}var f=(h.viewbox||"").split(" "),m={width:f[2],height:f[3]},g=parseFloat(m.width),y=parseFloat(m.height);if(r(g)&&r(y)&&c(m.width)===c(m.height)){var v=g/y;if(h.width){if(!r(d))return;return{width:d,height:d/v,type:"svg",mime:"image/svg+xml",wUnits:c(h.width),hUnits:c(h.width)}}if(h.height){if(!r(p))return;return{width:p*v,height:p,type:"svg",mime:"image/svg+xml",wUnits:c(h.height),hUnits:c(h.height)}}return{width:g,height:y,type:"svg",mime:"image/svg+xml",wUnits:c(m.width),hUnits:c(m.height)}}}}}}}),vu=d({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=su().readUInt16BE,o=su().readUInt32LE,s=su().readUInt32BE,l=r("II*\0"),c=r("MM\0*");function u(t,e,r){return r?a(t,e):i(t,e)}function h(t,e,r){return r?s(t,e):o(t,e)}function d(t,e,r){var n=u(t,e+2,r);return 1!==h(t,e+4,r)||3!==n&&4!==n?null:3===n?u(t,e+8,r):h(t,e+8,r)}e.exports=function(t){if(!(t.length<8)&&(n(t,0,l)||n(t,0,c))){var e=77===t[0],r=h(t,4,e)-8;if(!(r<0)){var i=r+8;if(!(t.length-i<2)){var a=12*u(t,i+0,e);if(!(a<=0)&&(i+=2,!(t.length-i<a))){var o,s,p,f;for(o=0;o<a;o+=12)256===(f=u(t,i+o,e))?s=d(t,i+o,e):257===f&&(p=d(t,i+o,e));return s&&p?{width:s,height:p,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}:void 0}}}}}}}),xu=d({"node_modules/probe-image-size/lib/parse_sync/webp.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=su().readUInt32LE,o=cu(),s=r("RIFF"),l=r("WEBP");function c(t,e){if(157===t[e+3]&&1===t[e+4]&&42===t[e+5])return{width:16383&i(t,e+6),height:16383&i(t,e+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function u(t,e){if(47===t[e]){var r=a(t,e+1);return{width:1+(16383&r),height:1+(r>>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<<e|t[e+8]<<8|t[e+7]),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}e.exports=function(t){if(!(t.length<16)&&(n(t,0,s)||n(t,8,l))){var e=12,r=null,i=0,d=a(t,4)+8;if(!(d>t.length)){for(;e+8<d;)if(0!==t[e]){var p=String.fromCharCode.apply(null,t.slice(e,e+4)),f=a(t,e+4);"VP8 "===p&&f>=10?r=r||c(t,e+8):"VP8L"===p&&f>=9?r=r||u(t,e+8):"VP8X"===p&&f>=10?r=r||h(t,e+8):"EXIF"===p&&(i=o.get_orientation(t.slice(e+8,e+8+f)),e=1/0),e+=8+f}else e++;if(r)return i>0&&(r.orientation=i),r}}}}}),bu=d({"node_modules/probe-image-size/lib/parsers_sync.js"(t,e){e.exports={avif:uu(),bmp:hu(),gif:du(),ico:pu(),jpeg:fu(),png:mu(),psd:gu(),svg:yu(),tiff:vu(),webp:xu()}}}),_u=d({"node_modules/probe-image-size/sync.js"(t,e){var r=bu();e.exports=function(t){return function(t){for(var e=Object.keys(r),n=0;n<e.length;n++){var i=r[e[n]](t);if(i)return i}return null}(t)},e.exports.parsers=r}}),wu=d({"src/traces/image/helpers.js"(t){var e=_u(),r=On().IMAGE_URL_PREFIX,n=Vl().Buffer;t.getImageSize=function(t){var i=t.replace(r,""),a=new n(i,"base64");return e(a)}}}),ku=d({"src/traces/image/calc.js"(t,e){var r=se(),n=Dl(),i=k(),a=nr(),o=se().maxRowLength,s=wu().getImageSize;function l(t,e,n,i){return function(a){return r.constrain((a-t)*e,n,i)}}function c(t,e){return function(n){return r.constrain(n,t,e)}}e.exports=function(t,e){var r,u;if(e._hasZ)r=e.z.length,u=o(e.z);else if(e._hasSource){var h=s(e.source);r=h.height,u=h.width}var d,p=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),m=p.d2c(e.x0)-e.dx/2,g=f.d2c(e.y0)-e.dy/2,y=[m,m+u*e.dx],v=[g,g+r*e.dy];if(p&&"log"===p.type)for(d=0;d<u;d++)y.push(m+d*e.dx);if(f&&"log"===f.type)for(d=0;d<r;d++)v.push(g+d*e.dy);return e._extremes[p._id]=a.findExtremes(p,y),e._extremes[f._id]=a.findExtremes(f,v),e._scaler=function(t){var e=n.colormodel[t.colormodel],r=e.colormodel||t.colormodel,a=r.length;t._sArray=[];for(var o=0;o<a;o++)e.min[o]!==t.zmin[o]||e.max[o]!==t.zmax[o]?t._sArray.push(l(t.zmin[o],(e.max[o]-e.min[o])/(t.zmax[o]-t.zmin[o]),e.min[o],e.max[o])):t._sArray.push(c(e.min[o],e.max[o]));return function(e){for(var r=e.slice(0,a),n=0;n<a;n++){var o=r[n];if(!i(o))return!1;r[n]=t._sArray[n](o)}return r}}(e),[{x0:m,y0:g,z:e.z,w:u,h:r}]}}}),Tu=d({"src/traces/image/plot.js"(t,e){var r=v(),n=se(),i=n.strTranslate,a=Te(),o=Dl(),s=Bo(),l=Fo().STYLE;e.exports=function(t,e,c,u){var h=e.xaxis,d=e.yaxis,p=!t._context._exportedPlot&&s();n.makeTraceGroups(u,c,"im").each((function(e){var s=r.select(this),c=e[0],u=c.trace,f=("fast"===u.zsmooth||!1===u.zsmooth&&p)&&!u._hasZ&&u._hasSource&&"linear"===h.type&&"linear"===d.type;u._realImage=f;var m,g,y,v,x,b,_=c.z,w=c.x0,k=c.y0,T=c.w,S=c.h,A=u.dx,M=u.dy;for(b=0;void 0===m&&b<T;)m=h.c2p(w+b*A),b++;for(b=T;void 0===g&&b>0;)g=h.c2p(w+b*A),b--;for(b=0;void 0===v&&b<S;)v=d.c2p(k+b*M),b++;for(b=S;void 0===x&&b>0;)x=d.c2p(k+b*M),b--;g<m&&(y=g,g=m,m=y),x<v&&(y=v,v=x,x=y),f||(m=Math.max(-.5*h._length,m),g=Math.min(1.5*h._length,g),v=Math.max(-.5*d._length,v),x=Math.min(1.5*d._length,x));var C=Math.round(g-m),E=Math.round(x-v);if(C<=0||E<=0)s.selectAll("image").data([]).exit().remove();else{var L=s.selectAll("image").data([e]);L.enter().append("svg:image").attr({xmlns:a.svg,preserveAspectRatio:"none"}),L.exit().remove();var P=!1===u.zsmooth?l:"";if(f){var I=n.simpleMap(h.range,h.r2l),z=n.simpleMap(d.range,d.r2l),O=I[1]<I[0],D=z[1]>z[0];if(O||D){var R=m+C/2,F=v+E/2;P+="transform:"+i(R+"px",F+"px")+"scale("+(O?-1:1)+","+(D?-1:1)+")"+i(-R+"px",-F+"px")+";"}}L.attr("style",P);var B=new Promise((function(t){if(u._hasZ)t();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===T&&u._canvas.el.height===S&&u._canvas.source===u.source)t();else{var e=document.createElement("canvas");e.width=T,e.height=S;var r=e.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:e,source:u.source},t()},n.setAttribute("src",u.source)}})).then((function(){var t;if(u._hasZ)t=j((function(t,e){var r=_[e][t];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(f)t=u.source;else{var e=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,S).data;t=j((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:C,x:m,y:v})}));t._promises.push(B)}function j(t){var e=document.createElement("canvas");e.width=C,e.height=E;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*A)-m),0,C)},s=function(t){return n.constrain(Math.round(d.c2p(k+t*M)-v),0,E)},l=o.colormodel[u.colormodel],p=l.colormodel||u.colormodel,f=l.fmt;for(b=0;b<c.w;b++){var g=a(b),y=a(b+1);if(y!==g&&!isNaN(y)&&!isNaN(g))for(var x=0;x<c.h;x++){var _=s(x),T=s(x+1);T===_||isNaN(T)||isNaN(_)||!t(b,x)||(r=u._scaler(t(b,x)),i.fillStyle=r?p+"("+f(r).join(",")+")":"rgba(0,0,0,0)",i.fillRect(g,_,y-g,T-_))}}return e}}))}}}),Su=d({"src/traces/image/style.js"(t,e){var r=v();e.exports=function(t){r.select(t).selectAll(".im image").style("opacity",(function(t){return t[0].trace.opacity}))}}}),Au=d({"src/traces/image/hover.js"(t,e){var r=zr(),n=se(),i=n.isArrayOrTypedArray,a=Dl();e.exports=function(t,e,o){var s=t.cd[0],l=s.trace,c=t.xa,u=t.ya;if(!(r.inbox(e-s.x0,e-(s.x0+s.w*l.dx),0)>0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,d=Math.floor((e-s.x0)/l.dx),p=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[p][d]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(d,p,1,1).data),h){var f,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(f=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,b=x.length,_=l._scaler(h),w=v.suffix,k=[];(l.hovertemplate||f)&&(k.push("["+[_[0]+w[0],_[1]+w[1],_[2]+w[2]].join(", ")),4===b&&k.push(", "+_[3]+w[3]),k.push("]"),k=k.join(""),t.extraText=x.toUpperCase()+": "+k),i(l.hovertext)&&i(l.hovertext[p])?y=l.hovertext[p][d]:i(l.text)&&i(l.text[p])&&(y=l.text[p][d]);var T=u.c2p(s.y0+(p+.5)*l.dy),S=s.x0+(d+.5)*l.dx,A=s.y0+(p+.5)*l.dy,M="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[p,d],x0:c.c2p(s.x0+d*l.dx),x1:c.c2p(s.x0+(d+1)*l.dx),y0:T,y1:T,color:_,xVal:S,xLabelVal:S,yVal:A,yLabelVal:A,zLabelVal:M,text:y,hovertemplateLabels:{zLabel:M,colorLabel:k,"color[0]Label":_[0]+w[0],"color[1]Label":_[1]+w[1],"color[2]Label":_[2]+w[2],"color[3]Label":_[3]+w[3]}})]}}}}}),Mu=d({"src/traces/image/event_data.js"(t,e){e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}}}),Cu=d({"src/traces/image/index.js"(t,e){e.exports={attributes:Rl(),supplyDefaults:Fl(),calc:ku(),plot:Tu(),style:Su(),hoverPoints:Au(),eventData:Mu(),moduleType:"trace",name:"image",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Eu=d({"lib/image.js"(t,e){e.exports=Cu()}}),Lu=d({"src/traces/pie/attributes.js"(t,e){var r=N(),n=ka().attributes,i=R(),a=V(),o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=D().extendFlat,c=It().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Pu=d({"src/traces/pie/defaults.js"(t,e){var r=k(),n=se(),i=Lu(),a=ka().defaults,o=Ga().handleText,s=se().coercePattern;function l(t,e){var i=n.isArrayOrTypedArray(t),a=n.isArrayOrTypedArray(e),o=Math.min(i?t.length:1/0,a?e.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l<o;l++){var c=e[l];if(r(c)&&c>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,i,r,a)}var h=l(u("labels"),u("values")),d=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),d){e._length=d,c(t,e,s,u,!0),u("scalegroup");var p,f=u("text"),m=u("texttemplate");if(m||(p=u("textinfo",n.isArrayOrTypedArray(f)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||p&&"none"!==p){var g=u("textposition");o(t,e,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===p&&u("textposition","none");a(e,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");y||"middle center"!==v||(e.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else e.visible=!1}}}}),Iu=d({"src/traces/pie/layout_attributes.js"(t,e){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),zu=d({"src/traces/pie/layout_defaults.js"(t,e){var r=se(),n=Iu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("piecolorway",e.colorway),i("extendpiecolors")}}}),Ou=d({"src/traces/pie/calc.js"(t,e){var r=k(),n=O(),i=q(),a={};function o(t){return function(e,r){return!!e&&!!(e=n(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function s(t,e){var r,i=JSON.stringify(t),a=e[i];if(!a){for(a=t.slice(),r=0;r<t.length;r++)a.push(n(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)a.push(n(t[r]).darken(20).toHexString());e[i]=a}return a}e.exports={calc:function(t,e){var n,i,a=[],s=t._fullLayout,l=s.hiddenlabels||[],c=e.labels,u=e.marker.colors||[],h=e.values,d=e._length,p=e._hasValues&&d;if(e.dlabel)for(c=new Array(d),n=0;n<d;n++)c[n]=String(e.label0+n*e.dlabel);var f={},m=o(s["_"+e.type+"colormap"]),g=0,y=!1;for(n=0;n<d;n++){var v,x,b;if(p){if(v=h[n],!r(v))continue;v=+v}else v=1;void 0!==(x=c[n])&&""!==x||(x=n);var _=f[x=String(x)];void 0===_?(f[x]=a.length,(b=-1!==l.indexOf(x))||(g+=v),a.push({v:v,label:x,color:m(u[n],x),i:n,pts:[n],hidden:b})):(y=!0,(i=a[_]).v+=v,i.pts.push(n),i.hidden||(g+=v),!1===i.color&&u[n]&&(i.color=m(u[n],x)))}return a=a.filter((function(t){return t.v>=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u<i.length;u++){var h=i[u];if(h[0].trace.type===r)for(var d=0;d<h.length;d++){var p=h[d];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=o[c%o.length],c++))}}},makePullColorFn:o,generateExtendedColors:s}}}),Du=d({"src/traces/pie/event_data.js"(t,e){var r=Ze().appendArrayMultiPointValues;e.exports=function(t,e){var n={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return 1===t.pts.length&&(n.pointNumber=n.i=t.pts[0]),r(n,e,t.pts),"funnelarea"===e.type&&(delete n.v,delete n.i),n}}}),Ru=d({"src/traces/pie/plot.js"(t,e){var r=v(),n=ke(),i=zr(),a=q(),o=Je(),s=se(),l=s.strScale,c=s.strTranslate,u=Ae(),h=Ka(),d=h.recordMinTextSize,p=h.clearMinTextSize,f=qa().TEXTPAD,m=br(),g=Du(),y=se().isValidTextValue;function x(t,e,n){var a=n[0],o=a.cx,l=a.cy,c=a.trace,u="funnelarea"===c.type;"_hasHoverLabel"in c||(c._hasHoverLabel=!1),"_hasHoverEvent"in c||(c._hasHoverEvent=!1),t.on("mouseover",(function(t){var n=e._fullLayout,h=e._fullData[c.index];if(!e._dragging&&!1!==n.hovermode){var d=h.hoverinfo;if(Array.isArray(d)&&(d=i.castHoverinfo({hoverinfo:[m.castOption(d,t.pts)],_module:c._module},n,0)),"all"===d&&(d="label+text+value+percent+name"),h.hovertemplate||"none"!==d&&"skip"!==d&&d){var p=t.rInscribed||0,f=o+t.pxmid[0]*(1-p),y=l+t.pxmid[1]*(1-p),v=n.separators,x=[];if(d&&-1!==d.indexOf("label")&&x.push(t.label),t.text=m.castOption(h.hovertext||h.text,t.pts),d&&-1!==d.indexOf("text")){var b=t.text;s.isValidTextValue(b)&&x.push(b)}t.value=t.v,t.valueLabel=m.formatPieValue(t.v,v),d&&-1!==d.indexOf("value")&&x.push(t.valueLabel),t.percent=t.v/a.vTotal,t.percentLabel=m.formatPiePercent(t.percent,v),d&&-1!==d.indexOf("percent")&&x.push(t.percentLabel);var _=h.hoverlabel,w=_.font,k=[];i.loneHover({trace:c,x0:f-p*a.r,x1:f+p*a.r,y:y,_x0:u?o+t.TL[0]:f-p*a.r,_x1:u?o+t.TR[0]:f+p*a.r,_y0:u?l+t.TL[1]:y-p*a.r,_y1:u?l+t.BL[1]:y+p*a.r,text:x.join("<br>"),name:h.hovertemplate||-1!==d.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,t.pts)||t.color,borderColor:m.castOption(_.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(_.namelength,t.pts),textAlign:m.castOption(_.align,t.pts),hovertemplate:m.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,inOut_bbox:k}),t.bbox=k[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,h)],event:r.event})}})),t.on("mouseout",(function(t){var n=e._fullLayout,a=e._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var n=e._fullLayout,a=e._fullData[c.index];e._dragging||!1===n.hovermode||(e._hoverdata=[g(t,a)],i.click(e,r.event))}))}function b(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,o=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,s=m.castOption(t.insidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,l=m.castOption(t.insidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,c=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=m.castOption(t.insidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,h=m.castOption(t.insidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,d=m.castOption(t.insidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n||a.contrast(e.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:d}}function _(t,e){for(var r,n,i=0;i<t.length;i++)if((n=(r=t[i][0]).trace).title.text){var a=n.title.text;n._meta&&(a=s.templateString(a,n._meta));var l=o.tester.append("text").attr("data-notex",1).text(a).call(o.font,n.title.font).call(u.convertToTspans,e),c=o.bBox(l.node(),!0);r.titleBox={width:c.width,height:c.height},l.remove()}}function w(t,e,r){var n=r.r||e.rpx1,i=e.rInscribed;if(e.startangle===e.stopangle)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var a,o=e.ring,s=1===o&&Math.abs(e.startangle-e.stopangle)===2*Math.PI,l=e.halfangle,c=e.midangle,u=r.trace.insidetextorientation,h="horizontal"===u,d="tangential"===u,p="radial"===u,f="auto"===u,m=[];if(!f){var g,y=function(r,i){if(function(t,e){var r=t.startangle,n=t.stopangle;return r>e&&e>n||r<e&&e<n}(e,r)){var s=Math.abs(r-e.startangle),l=Math.abs(r-e.stopangle),c=s<l?s:l;(a="tan"===i?T(t,n,o,c,0):k(t,n,o,c,Math.PI/2)).textPosAngle=r,m.push(a)}};if(h||d){for(g=4;g>=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||f||h){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(f||p)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(f||d)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_<m.length;_++){var w=m[_].scale;if(b<w&&(b=w,x=_),!f&&b>=1)break}return m[x]}function k(t,e,r,n,i){e=Math.max(0,e-2*f);var a=t.width/t.height,o=M(a,n,e,r);return{scale:2*o/t.height,rCenter:S(a,o/e),rotate:A(i)}}function T(t,e,r,n,i){e=Math.max(0,e-2*f);var a=t.height/t.width,o=M(a,n,e,r);return{scale:2*o/t.width,rCenter:S(a,o/e),rotate:A(i+Math.PI/2)}}function S(t,e){return Math.cos(e)-t*e}function A(t){return(180/Math.PI*t+720)%180-90}function M(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function C(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function E(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function L(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function I(t){var e,r=t.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,e=0;e<t.pull.length;e++)t.pull[e]>r&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n][0],a=i.trace,o=a.domain,s=e.w*(o.x[1]-o.x[0]),l=e.h*(o.y[1]-o.y[0]);a.title.text&&"middle center"!==a.title.position&&(l-=P(i,e));var c=s/2,u=l/2;"funnelarea"!==a.type||a.scalegroup||(u/=a.aspectratio),i.r=Math.min(c,u)/(1+I(a)),i.cx=e.l+e.w*(a.domain.x[1]+a.domain.x[0])/2,i.cy=e.t+e.h*(1-a.domain.y[0])-l/2,a.title.text&&-1!==a.title.position.indexOf("bottom")&&(i.cy-=P(i,e)),a.scalegroup&&-1===r.indexOf(a.scalegroup)&&r.push(a.scalegroup)}!function(t,e){for(var r,n,i,a=0;a<e.length;a++){var o=1/0,s=e[a];for(n=0;n<t.length;n++)if((i=(r=t[n][0]).trace).scalegroup===s){var l;if("pie"===i.type)l=r.r*r.r;else if("funnelarea"===i.type){var c,u;i.aspectratio>1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n<t.length;n++)if((i=(r=t[n][0]).trace).scalegroup===s){var h=o*r.vTotal;"funnelarea"===i.type&&(h/=(1+i.baseratio)/2,h/=i.aspectratio),r.r=Math.sqrt(h)}}}(t,r)}function O(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function D(t,e,r){var n,i=t._fullLayout,a=r.trace,o=a.texttemplate,l=a.textinfo;if(!o&&l&&"none"!==l){var c,u=l.split("+"),h=function(t){return-1!==u.indexOf(t)},d=h("label"),p=h("text"),f=h("value"),g=h("percent"),v=i.separators;if(c=d?[e.label]:[],p){var x=m.getFirstFilled(a.text,e.pts);y(x)&&c.push(x)}f&&c.push(m.formatPieValue(e.v,v)),g&&c.push(m.formatPiePercent(e.v/r.vTotal,v)),e.text=c.join("<br>")}if(o){var b=s.castOption(a,e.i,"texttemplate");if(b){var _={label:(n=e).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,e.pts);(y(w)||""===w)&&(_.text=w),e.text=s.texttemplateString(b,_,t._fullLayout._d3locale,_,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var i=t._context.staticPlot,h=t._fullLayout,f=h._size;p("pie",h),_(e,t),z(e,f);var g=s.makeTraceGroups(h._pielayer,e,"trace").each((function(e){var p=r.select(this),g=e[0],y=g.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;e<t.length&&t[e].hidden;e++);if(e===t.length)return;s+=l*t[e].v,l*=-1,c="px1",u="px0"}for(n=O(a,s),e=0;e<t.length;e++)(r=t[e]).hidden||(r[c]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=O(a,s),r.midangle=s,n=O(a,s+=l*r.v/2),r.stopangle=s,r[u]=n,r.largeArc=r.v>i.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=C(r,i))}(e),p.attr("stroke-linejoin","round"),p.each((function(){var v=r.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],k=!1;v.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,_[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,p=r.select(this),f=p.selectAll("path.surface").data([n]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),p.call(x,t,e),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],c+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var T=y.hole;if(n.v===g.vTotal){var S="M"+(l+n.px0[0])+","+(c+n.px0[1])+P(n.px0,n.pxmid,!0,1)+P(n.pxmid,n.px0,!0,1)+"Z";T?f.attr("d","M"+(l+T*n.px0[0])+","+(c+T*n.px0[1])+P(n.px0,n.pxmid,!1,T)+P(n.pxmid,n.px0,!1,T)+"Z"+S):f.attr("d",S)}else{var A=P(n.px0,n.px1,!0,1);if(T){var M=1-T;f.attr("d","M"+(l+T*n.px1[0])+","+(c+T*n.px1[1])+P(n.px1,n.px0,!1,T)+"l"+M*n.px0[0]+","+M*n.px0[1]+A+"Z")}else f.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+A+"Z")}D(t,n,g);var C=m.castOption(y.textposition,n.pts),L=p.selectAll("g.slicetext").data(n.text&&"none"!==C?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=s.ensureUniformFontSize(t,"outside"===C?function(t,e,r){var n=m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,i=m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,o=m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,s=m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,l=m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,c=m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,u=m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,h=m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:c,lineposition:u,shadow:h}}(y,n,h.font):b(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(u.convertToTspans,t);var f,v=o.bBox(i.node());if("outside"===C)f=E(v,n);else if(f=w(v,n,g),"auto"===C&&f.scale<1){var x=s.ensureUniformFontSize(t,y.outsidetextfont);i.call(o.font,x),f=E(v=o.bBox(i.node()),n)}var _=f.textPosAngle,T=void 0===_?n.pxmid:O(g.r,_);if(f.targetX=l+T[0]*f.rCenter+(f.x||0),f.targetY=c+T[1]*f.rCenter+(f.y||0),R(f,v),f.outside){var S=f.targetY;n.yLabelMin=S-v.height/2,n.yLabelMid=S,n.yLabelMax=S+v.height/2,n.labelExtraX=0,n.labelExtraY=0,k=!0}f.fontSize=p.size,d(y.type,f,h),e[a].transform=f,s.setTransormAndDisplay(i,f)}))}function P(t,e,r,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var e,n=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(g):L(g,f),n.attr("transform",c(e.x,e.y)+l(Math.min(1,e.scale))+c(e.tx,e.ty))})),k&&function(t,e){var r,n,i,a,o,l,c,u,h,d,p,f,g;function y(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function x(t,r){r||(r={});var i,u,h,p,f=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),x=f-g;if(x*c>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(u=0;u<d.length;u++)(h=d[u])===t||(m.castOption(e.pull,t.pts)||0)>=(m.castOption(e.pull,h.pts)||0)||((t.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-d.indexOf(t)),(p=h.cxFinal+a(h.px0[0],h.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],d=h.concat(u),f=[],p=0;p<u.length;p++)void 0!==u[p].yLabelMid&&f.push(u[p]);for(g=!1,p=0;n&&p<h.length;p++)if(void 0!==h[p].yLabelMid){g=h[p];break}for(p=0;p<f.length;p++){var b=p&&f[p-1];g&&!p&&(b=g),x(f[p],b)}}}(_,y),function(t,e){t.each((function(t){var n=r.select(this);if(t.labelExtraX||t.labelExtraY){var i=n.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,s.setTransormAndDisplay(i,t.transform);var o=t.cxFinal+t.pxmid[0],l="M"+o+","+(t.cyFinal+t.pxmid[1]),c=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var u=t.labelExtraX*t.pxmid[1]/t.pxmid[0],h=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(u)>Math.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(v,y),k&&y.automargin){var S=o.bBox(p.node()),A=y.domain,M=f.w*(A.x[1]-A.x[0]),C=f.h*(A.y[1]-A.y[0]),P=(.5*M-g.r)/f.w,I=(.5*C-g.r)/f.h;n.autoMargin(t,"pie."+y.uid+".automargin",{xl:A.x[0]-P,xr:A.x[1]+P,yb:A.y[0]-I,yt:A.y[1]+I,l:Math.max(g.cx-g.r-S.left,0),r:Math.max(S.right-(g.cx+g.r),0),b:Math.max(S.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-S.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:L,prerenderTitles:_,layoutAreas:z,attachFxHandlers:x,computeTransform:R}}}),Fu=d({"src/traces/pie/style.js"(t,e){var r=v(),n=wr(),i=Ka().resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),Bu=d({"src/traces/pie/base_plot.js"(t){var e=ke();t.name="pie",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),ju=d({"src/traces/pie/index.js"(t,e){e.exports={attributes:Lu(),supplyDefaults:Pu().supplyDefaults,supplyLayoutDefaults:zu(),layoutAttributes:Iu(),calc:Ou().calc,crossTraceCalc:Ou().crossTraceCalc,plot:Ru().plot,style:Fu(),styleOne:wr(),moduleType:"trace",name:"pie",basePlotModule:Bu(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Nu=d({"lib/pie.js"(t,e){e.exports=ju()}}),Uu=d({"src/traces/sunburst/base_plot.js"(t){var e=ke();t.name="sunburst",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Vu=d({"src/traces/sunburst/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),qu=d({"src/traces/sunburst/attributes.js"(t,e){var r=N(),n=Ot().hovertemplateAttrs,i=Ot().texttemplateAttrs,a=Pe(),o=ka().attributes,s=Lu(),l=Vu(),c=D().extendFlat,u=It().pattern;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),$u=d({"src/traces/sunburst/layout_attributes.js"(t,e){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Hu=d({"src/traces/sunburst/defaults.js"(t,e){var r=se(),n=qu(),i=ka().defaults,a=Ga().handleText,o=Pu().handleMarkerDefaults,s=We(),l=s.hasColorscale,c=s.handleDefaults;e.exports=function(t,e,s,u){function h(i,a){return r.coerce(t,e,n,i,a)}var d=h("labels"),p=h("parents");if(d&&d.length&&p&&p.length){var f=h("values");f&&f.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(t,e,u,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&c(t,e,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(t,e,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(e,u,h),e._length=null}else e.visible=!1}}}),Wu=d({"src/traces/sunburst/layout_defaults.js"(t,e){var r=se(),n=$u();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}}),Gu=d({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(t,e){var r,n;r=t,n=function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),h=+t.value&&(u.value=t.value),d=[u];for(null==e&&(e=o);r=d.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)d.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(t){for(var e,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),e=i.children)for(r=0,n=e.length;r<n;++r)a.push(e[r]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var e,r,n=this,i=[n];n=i.pop();)if(t(n),e=n.children)for(r=e.length-1;r>=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n<i;)e=t[n],r&&f(r,e)?++n:(r=g(a=d(a,e)),n=0);return r}function d(t,e){var r,n;if(m(e,t))return[e];for(r=0;r<t.length;++r)if(p(e,t[r])&&m(y(t[r],e),t))return[t[r],e];for(r=0;r<t.length-1;++r)for(n=r+1;n<t.length;++n)if(p(y(t[r],t[n]),e)&&p(y(t[r],e),t[n])&&p(y(t[n],e),t[r])&&m(v(t[r],t[n],e),t))return[t[r],t[n],e];throw new Error}function p(t,e){var r=t.r-e.r,n=e.x-t.x,i=e.y-t.y;return r<0||r*r<n*n+i*i}function f(t,e){var r=t.r-e.r+1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r<e.length;++r)if(!f(t,e[r]))return!1;return!0}function g(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return y(t[0],t[1]);case 3:return v(t[0],t[1],t[2])}var e}function y(t,e){var r=t.x,n=t.y,i=t.r,a=e.x,o=e.y,s=e.r,l=a-r,c=o-n,u=s-i,h=Math.sqrt(l*l+c*c);return{x:(r+a+l/h*u)/2,y:(n+o+c/h*u)/2,r:(h+i+s)/2}}function v(t,e,r){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,l=e.r,c=r.x,u=r.y,h=r.r,d=n-o,p=n-c,f=i-s,m=i-u,g=l-a,y=h-a,v=n*n+i*i-a*a,x=v-o*o-s*s+l*l,b=v-c*c-u*u+h*h,_=p*f-d*m,w=(f*b-m*x)/(2*_)-n,k=(m*g-f*y)/_,T=(p*x-d*b)/(2*_)-i,S=(d*y-p*g)/_,A=k*k+S*S-1,M=2*(a+w*k+T*S),C=w*w+T*T-a*a,E=-(A?(M+Math.sqrt(M*M-4*A*C))/(2*A):C/M);return{x:n+w+k*E,y:i+T+S*E,r:E}}function x(t,e,r){var n,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+r.r,i*=i,o=t.r+r.r,i>(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function b(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function _(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function k(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,d;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;s<i;++s){x(e._,r._,n=t[s]),n=new w(n),l=r.next,c=e.previous,u=r._.r,d=e._.r;do{if(u<=d){if(b(l._,n._)){r=l,e.next=r,r.previous=e,--s;continue t}u+=l._.r,l=l.next}else{if(b(c._,n._)){(e=c).next=r,r.previous=e,--s;continue t}d+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=e,n.next=r,e.next=r.previous=r=n,a=_(e);(n=n.next)!==r;)(o=_(n))<a&&(e=n,a=o);r=e.next}for(e=[r._],n=r;(n=n.next)!==r;)e.push(n._);for(n=h(e),s=0;s<i;++s)(e=t[s]).x-=n.x,e.y-=n.y;return n.r}function T(t){if("function"!==typeof t)throw new Error;return t}function S(){return 0}function A(t){return function(){return t}}function M(t){return Math.sqrt(t.value)}function C(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function E(t,e){return function(r){if(n=r.children){var n,i,a,o=n.length,s=t(r)*e||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=k(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function L(t){return function(e){var r=e.parent;e.r*=t,r&&(e.x=r.x+t*e.x,e.y=r.y+t*e.y)}}function P(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function I(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(n-e)/t.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var z={depth:-1},O={};function D(t){return t.id}function R(t){return t.parentId}function F(t,e){return t.parent===e.parent?1:2}function B(t){var e=t.children;return e?e[0]:t.t}function j(t){var e=t.children;return e?e[e.length-1]:t.t}function N(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function U(t,e,r){return t.a.parent===e.parent?t.a:r}function V(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function q(t,e,r,n,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-r)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=n,a.y0=r,a.y1=r+=a.value*c}V.prototype=Object.create(c.prototype);var $=(1+Math.sqrt(5))/2;function H(t,e,r,n,i,a){for(var o,s,l,c,u,h,d,p,f,m,g,y=[],v=e.children,x=0,b=0,_=v.length,w=e.value;x<_;){l=i-r,c=a-n;do{u=v[b++].value}while(!u&&b<_);for(h=d=u,g=u*u*(m=Math.max(c/l,l/c)/(w*t)),f=Math.max(d/g,g/h);b<_;++b){if(u+=s=v[b].value,s<h&&(h=s),s>d&&(d=s),g=u*u*m,(p=Math.max(d/g,g/h))>f){u-=s;break}f=p}y.push(o={value:u,dice:l<c,children:v.slice(x,b)}),o.dice?I(o,r,n,i,w?n+=c*u/w:a):q(o,r,n,w?r+=l*u/w:i,a),w-=u,x=b}return y}var W=function t(e){function r(t,r,n,i,a){H(e,t,r,n,i,a)}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}($),G=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,d=o.length,p=t.value;++h<d;){for(l=(s=o[h]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?I(s,r,n,i,n+=(a-n)*s.value/p):q(s,r,n,r+=(i-r)*s.value/p,a),p-=s.value}else t._squarify=o=H(e,t,r,n,i,a),o.ratio=e}return r.ratio=function(e){return t((e=+e)>1?e:1)},r}($);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,d=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(d-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=S;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(C(t)).eachAfter(E(n,.5)).eachBefore(L(1)):i.eachBefore(C(M)).eachAfter(E(S,1)).eachAfter(E(n,i.r/Math.min(e,r))).eachBefore(L(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(r=e)?null:T(r),i):t;var r},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"===typeof t?t:A(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return k(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&I(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(e,a)),n&&i.eachBefore(P),i}return i.round=function(t){return arguments.length?(n=!!t,i):n},i.size=function(r){return arguments.length?(t=+r[0],e=+r[1],i):[t,e]},i.padding=function(t){return arguments.length?(r=+t,i):r},i},t.stratify=function(){var t=D,e=R;function r(r){var n,i,a,o,s,u,h,d=r.length,p=new Array(d),f={};for(i=0;i<d;++i)n=r[i],s=p[i]=new c(n),null!=(u=t(n,i,r))&&(u+="")&&(f[h="$"+(s.id=u)]=h in f?O:s);for(i=0;i<d;++i)if(s=p[i],null!=(u=e(r[i],i,r))&&(u+="")){if(!(o=f["$"+u]))throw new Error("missing: "+u);if(o===O)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error("multiple roots");a=s}if(!a)throw new Error("no root");if(a.parent=z,a.eachBefore((function(t){t.depth=t.parent.depth+1,--d})).eachBefore(l),a.parent=null,d>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=T(e),r):t},r.parentId=function(t){return arguments.length?(e=T(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new V(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new V(n[i],i)),r.parent=e;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)}));var d=c===u?1:t(c,u)/2,p=d-c.x,f=e/(u.x+d+p),m=r/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*f,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,d=l.m;s=j(s),a=B(a),s&&a;)l=B(l),(o=j(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(N(U(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,d+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),a&&!B(l)&&(l.t=a,l.m+=c-d,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=W,e=!1,r=1,n=1,i=[0],a=S,o=S,s=S,l=S,c=S;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(P),t}function h(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,d=e.y1-r;h<n&&(n=h=(n+h)/2),d<u&&(u=d=(u+d)/2),e.x0=n,e.y0=u,e.x1=h,e.y1=d,e.children&&(r=i[e.depth+1]=a(e)/2,n+=c(e)-r,u+=o(e)-r,(h-=s(e)-r)<n&&(n=h=(n+h)/2),(d-=l(e)-r)<u&&(u=d=(u+d)/2),t(e,n,u,h,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(r=+t[0],n=+t[1],u):[r,n]},u.tile=function(e){return arguments.length?(t=T(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"===typeof t?t:A(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"===typeof t?t:A(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"===typeof t?t:A(+t),u):s},u.paddingBottom=function(t){return arguments.length?(l="function"===typeof t?t:A(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"===typeof t?t:A(+t),u):c},u},t.treemapBinary=function(t,e,r,n,i){var a,o,s=t.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function t(e,r,n,i,a,o,l){if(e>=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[e],d=n/2+h,p=e+1,f=r-1;p<f;){var m=p+f>>>1;c[m]<d?p=m+1:f=m}d-c[p-1]<c[p]-d&&e+1<p&&--p;var g=c[p]-h,y=n-g;if(o-i>l-a){var v=(i*y+o*g)/n;t(e,p,g,i,a,v,l),t(p,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=I,t.treemapResquarify=G,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:I)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),Yu=d({"src/traces/sunburst/calc.js"(t){var e=Gu(),r=k(),n=se(),i=We().makeColorScaleFuncFromTrace,a=Ou().makePullColorFn,o=Ou().generateExtendedColors,s=We().calc,l=T().ALMOST_EQUAL,c={},u={},h={};function d(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o<a;o++)n+=d(i[o],e,r);r.branches&&n++}else r.leaves&&n++;return t.value=t.data.data.value=n,e._values||(e._values=[]),e._values[t.data.data.i]=n,n}t.calc=function(t,o){var c,u,h,p,f,m,g=t._fullLayout,y=o.ids,v=n.isArrayOrTypedArray(y),x=o.labels,b=o.parents,_=o.values,w=n.isArrayOrTypedArray(_),k=[],T={},S={},A=function(t){return t||"number"===typeof t},M=function(t){return!w||r(_[t])&&_[t]>=0};v?(c=Math.min(y.length,b.length),u=function(t){return A(y[t])&&M(t)},h=function(t){return String(y[t])}):(c=Math.min(x.length,b.length),u=function(t){return A(x[t])&&M(t)},h=function(t){return String(x[t])}),w&&(c=Math.min(c,_.length));for(var C=0;C<c;C++)if(u(C)){var E=h(C),L=A(b[C])?String(b[C]):"",P={i:C,id:E,pid:L,label:A(x[C])?String(x[C]):""};w&&(P.v=+_[C]),k.push(P),f=E,T[p=L]?T[p].push(f):T[p]=[f],S[f]=1}if(T[""]){if(T[""].length>1){for(var I=n.randstr(),z=0;z<k.length;z++)""===k[z].pid&&(k[z].pid=I);k.unshift({hasMultipleRoots:!0,id:I,pid:"",label:""})}}else{var O,D=[];for(O in T)S[O]||D.push(O);if(1!==D.length)return n.warn(["Multiple implied roots, cannot build",o.type,"hierarchy of",o.name+".","These roots include:",D.join(", ")].join(" "));O=D[0],k.unshift({hasImpliedRoot:!0,id:O,pid:"",label:O})}try{m=e.stratify().id((function(t){return t.id})).parentId((function(t){return t.pid}))(k)}catch(V){return n.warn(["Failed to build",o.type,"hierarchy of",o.name+".","Error:",V.message].join(" "))}var R=e.hierarchy(m),F=!1;if(w)switch(o.branchvalues){case"remainder":R.sum((function(t){return t.data.v}));break;case"total":R.each((function(t){var e=t.data.data,r=e.v;if(t.children){var i=t.children.reduce((function(t,e){return t+e.data.data.v}),0);if((e.hasImpliedRoot||e.hasMultipleRoots)&&(r=i),r<i*l)return F=!0,n.warn(["Total value for node",t.data.data.id,"of",o.name,"is smaller than the sum of its children.","\nparent value =",r,"\nchildren sum =",i].join(" "))}t.value=r}))}else d(R,o,{branches:-1!==o.count.indexOf("branches"),leaves:-1!==o.count.indexOf("leaves")});if(!F){var B,j;o.sort&&R.sort((function(t,e){return e.value-t.value}));var N=o.marker.colors||[],U=!!N.length;return o._hasColorscale?(U||(N=w?o.values:o._values),s(t,o,{vals:N,containerStr:"marker",cLetter:"c"}),j=i(o.marker)):B=a(g["_"+o.type+"colormap"]),R.each((function(t){var e=t.data.data;e.color=o._hasColorscale?j(N[e.i]):B(N[e.i],e.id)})),k[0].hierarchy=R,k}},t._runCrossTraceCalc=function(t,e){var r=e._fullLayout,n=e.calcdata,i=r[t+"colorway"],a=r["_"+t+"colormap"];r["extend"+t+"colors"]&&(i=o(i,"icicle"===t?h:"treemap"===t?u:c));var s,l=0;function d(t){var e=t.data.data,r=e.id;!1===e.color&&(a[r]?e.color=a[r]:t.parent?t.parent.parent?e.color=t.parent.data.data.color:(a[r]=e.color=i[l%i.length],l++):e.color=s)}for(var p=0;p<n.length;p++){var f=n[p][0];f.trace.type===t&&f.hierarchy&&(s=f.trace.root.color,f.hierarchy.each(d))}},t.crossTraceCalc=function(e){return t._runCrossTraceCalc("sunburst",e)}}});function Zu(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Xu(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}var Ku,Ju,Qu,th,eh,rh,nh,ih,ah,oh,sh,lh,ch,uh=h({"node_modules/d3-color/src/define.js"(){}});function hh(){}function dh(){return this.rgb().formatHex()}function ph(){return this.rgb().formatHex8()}function fh(){return Eh(this).formatHsl()}function mh(){return this.rgb().formatRgb()}function gh(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=rh.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?yh(e):3===r?new _h(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?vh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?vh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nh.exec(t))?new _h(e[1],e[2],e[3],1):(e=ih.exec(t))?new _h(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ah.exec(t))?vh(e[1],e[2],e[3],e[4]):(e=oh.exec(t))?vh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sh.exec(t))?Ch(e[1],e[2]/100,e[3]/100,1):(e=lh.exec(t))?Ch(e[1],e[2]/100,e[3]/100,e[4]):ch.hasOwnProperty(t)?yh(ch[t]):"transparent"===t?new _h(NaN,NaN,NaN,0):null}function yh(t){return new _h(t>>16&255,t>>8&255,255&t,1)}function vh(t,e,r,n){return n<=0&&(t=e=r=NaN),new _h(t,e,r,n)}function xh(t){return t instanceof hh||(t=gh(t)),t?new _h((t=t.rgb()).r,t.g,t.b,t.opacity):new _h}function bh(t,e,r,n){return 1===arguments.length?xh(t):new _h(t,e,r,null==n?1:n)}function _h(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function wh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}`}function kh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}${Mh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Th(){const t=Sh(this.opacity);return`${1===t?"rgb(":"rgba("}${Ah(this.r)}, ${Ah(this.g)}, ${Ah(this.b)}${1===t?")":`, ${t})`}`}function Sh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ah(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mh(t){return((t=Ah(t))<16?"0":"")+t.toString(16)}function Ch(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ph(t,e,r,n)}function Eh(t){if(t instanceof Ph)return new Ph(t.h,t.s,t.l,t.opacity);if(t instanceof hh||(t=gh(t)),!t)return new Ph;if(t instanceof Ph)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r<n):r===a?(n-e)/s+2:(e-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Ph(o,s,l,t.opacity)}function Lh(t,e,r,n){return 1===arguments.length?Eh(t):new Ph(t,e,r,null==n?1:n)}function Ph(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ih(t){return(t=(t||0)%360)<0?t+360:t}function zh(t){return Math.max(0,Math.min(1,t||0))}function Oh(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}var Dh,Rh,Fh,Bh,jh,Nh,Uh,Vh,qh,$h=h({"node_modules/d3-color/src/color.js"(){uh(),Ju=1/(Ku=.7),Qu="\\s*([+-]?\\d+)\\s*",th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,nh=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ih=new RegExp(`^rgb\\(${eh},${eh},${eh}\\)$`),ah=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${th}\\)$`),oh=new RegExp(`^rgba\\(${eh},${eh},${eh},${th}\\)$`),sh=new RegExp(`^hsl\\(${th},${eh},${eh}\\)$`),lh=new RegExp(`^hsla\\(${th},${eh},${eh},${th}\\)$`),ch={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Zu(hh,gh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dh,formatHex:dh,formatHex8:ph,formatHsl:fh,formatRgb:mh,toString:mh}),Zu(_h,bh,Xu(hh,{brighter(t){return t=null==t?Ju:Math.pow(Ju,t),new _h(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ku:Math.pow(Ku,t),new _h(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new _h(Ah(this.r),Ah(this.g),Ah(this.b),Sh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wh,formatHex:wh,formatHex8:kh,formatRgb:Th,toString:Th})),Zu(Ph,Lh,Xu(hh,{brighter(t){return t=null==t?Ju:Math.pow(Ju,t),new Ph(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ku:Math.pow(Ku,t),new Ph(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _h(Oh(t>=240?t-240:t+120,i,n),Oh(t,i,n),Oh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Ph(Ih(this.h),zh(this.s),zh(this.l),Sh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sh(this.opacity);return`${1===t?"hsl(":"hsla("}${Ih(this.h)}, ${100*zh(this.s)}%, ${100*zh(this.l)}%${1===t?")":`, ${t})`}`}}))}}),Hh=h({"node_modules/d3-color/src/math.js"(){Dh=Math.PI/180,Rh=180/Math.PI}});function Wh(t){if(t instanceof Yh)return new Yh(t.l,t.a,t.b,t.opacity);if(t instanceof td)return ed(t);t instanceof _h||(t=xh(t));var e,r,n=Jh(t.r),i=Jh(t.g),a=Jh(t.b),o=Zh((.2225045*n+.7168786*i+.0606169*a)/Bh);return n===i&&i===a?e=r=o:(e=Zh((.4360747*n+.3850649*i+.1430804*a)/Fh),r=Zh((.0139322*n+.0971045*i+.7141733*a)/jh)),new Yh(116*o-16,500*(e-o),200*(o-r),t.opacity)}function Gh(t,e,r,n){return 1===arguments.length?Wh(t):new Yh(t,e,r,null==n?1:n)}function Yh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Zh(t){return t>qh?Math.pow(t,1/3):t/Vh+Nh}function Xh(t){return t>Uh?t*t*t:Vh*(t-Nh)}function Kh(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jh(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qh(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof td)return new td(t.h,t.c,t.l,t.opacity);if(t instanceof Yh||(t=Wh(t)),0===t.a&&0===t.b)return new td(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Rh;return new td(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new td(t,e,r,null==n?1:n)}function td(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function ed(t){if(isNaN(t.h))return new Yh(t.l,0,0,t.opacity);var e=t.h*Dh;return new Yh(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}var rd,nd,id,ad,od,sd,ld,cd,ud=h({"node_modules/d3-color/src/lab.js"(){uh(),$h(),Hh(),Fh=.96422,Bh=1,jh=.82521,Nh=4/29,Vh=3*(Uh=6/29)*Uh,qh=Uh*Uh*Uh,Zu(Yh,Gh,Xu(hh,{brighter(t){return new Yh(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Yh(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new _h(Kh(3.1338561*(e=Fh*Xh(e))-1.6168667*(t=Bh*Xh(t))-.4906146*(r=jh*Xh(r))),Kh(-.9787684*e+1.9161415*t+.033454*r),Kh(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),Zu(td,Qh,Xu(hh,{brighter(t){return new td(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new td(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ed(this).rgb()}}))}});function hd(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof dd)return new dd(t.h,t.s,t.l,t.opacity);t instanceof _h||(t=xh(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(cd*n+sd*e-ld*r)/(cd+sd-ld),a=n-i,o=(od*(r-i)-id*a)/ad,s=Math.sqrt(o*o+a*a)/(od*i*(1-i)),l=s?Math.atan2(o,a)*Rh-120:NaN;return new dd(l<0?l+360:l,s,i,t.opacity)}(t):new dd(t,e,r,null==n?1:n)}function dd(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var pd=h({"node_modules/d3-color/src/cubehelix.js"(){uh(),$h(),Hh(),sd=(od=1.97294)*(ad=-.90649),ld=od*(nd=1.78277),cd=nd*(id=-.29227)-ad*(rd=-.14861),Zu(dd,hd,Xu(hh,{brighter(t){return t=null==t?Ju:Math.pow(Ju,t),new dd(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ku:Math.pow(Ku,t),new dd(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Dh,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new _h(255*(e+r*(rd*n+nd*i)),255*(e+r*(id*n+ad*i)),255*(e+r*(od*n)),this.opacity)}}))}}),fd=h({"node_modules/d3-color/src/index.js"(){$h(),ud(),pd()}});function md(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function gd(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n<e-1?t[n+2]:2*a-i;return md((r-n/e)*e,o,i,a,s)}}var yd=h({"node_modules/d3-interpolate/src/basis.js"(){}});function vd(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],o=t[(n+1)%e],s=t[(n+2)%e];return md((r-n/e)*e,i,a,o,s)}}var xd,bd=h({"node_modules/d3-interpolate/src/basisClosed.js"(){yd()}}),_d=h({"node_modules/d3-interpolate/src/constant.js"(){xd=t=>()=>t}});function wd(t,e){return function(r){return t+r*e}}function kd(t,e){var r=e-t;return r?wd(t,r>180||r<-180?r-360*Math.round(r/360):r):xd(isNaN(t)?e:t)}function Td(t){return 1===(t=+t)?Sd:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):xd(isNaN(e)?r:e)}}function Sd(t,e){var r=e-t;return r?wd(t,r):xd(isNaN(t)?e:t)}var Ad,Md,Cd,Ed=h({"node_modules/d3-interpolate/src/color.js"(){_d()}});function Ld(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=bh(e[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=t(a),o=t(o),s=t(s),n.opacity=1,function(t){return n.r=a(t),n.g=o(t),n.b=s(t),n+""}}}var Pd=h({"node_modules/d3-interpolate/src/rgb.js"(){fd(),yd(),bd(),Ed(),Ad=function t(e){var r=Td(e);function n(t,e){var n=r((t=bh(t)).r,(e=bh(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=Sd(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return n.gamma=t,n}(1),Md=Ld(gd),Cd=Ld(vd)}});function Id(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function zd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Od=h({"node_modules/d3-interpolate/src/numberArray.js"(){}});function Dd(t,e){return(zd(e)?Id:Rd)(t,e)}function Rd(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=Yd(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}}var Fd=h({"node_modules/d3-interpolate/src/array.js"(){Zd(),Od()}});function Bd(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}var jd=h({"node_modules/d3-interpolate/src/date.js"(){}});function Nd(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var Ud=h({"node_modules/d3-interpolate/src/number.js"(){}});function Vd(t,e){var r,n={},i={};for(r in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)r in t?n[r]=Yd(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}var qd,$d,Hd=h({"node_modules/d3-interpolate/src/object.js"(){Zd()}});function Wd(t,e){var r,n,i,a=qd.lastIndex=$d.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=qd.exec(t))&&(n=$d.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Nd(r,n)})),a=$d.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}var Gd=h({"node_modules/d3-interpolate/src/string.js"(){Ud(),qd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$d=new RegExp(qd.source,"g")}});function Yd(t,e){var r,n=typeof e;return null==e||"boolean"===n?xd(e):("number"===n?Nd:"string"===n?(r=gh(e))?(e=r,Ad):Wd:e instanceof gh?Ad:e instanceof Date?Bd:zd(e)?Id:Array.isArray(e)?Rd:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?Vd:Nd)(t,e)}var Zd=h({"node_modules/d3-interpolate/src/value.js"(){fd(),Pd(),Fd(),jd(),Ud(),Hd(),Gd(),_d(),Od()}});function Xd(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}}var Kd=h({"node_modules/d3-interpolate/src/discrete.js"(){}});function Jd(t,e){var r=kd(+t,+e);return function(t){var e=r(t);return e-360*Math.floor(e/360)}}var Qd=h({"node_modules/d3-interpolate/src/hue.js"(){Ed()}});function tp(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var ep,rp,np=h({"node_modules/d3-interpolate/src/round.js"(){}});function ip(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*ep,skewX:Math.atan(l)*ep,scaleX:o,scaleY:s}}var ap,op=h({"node_modules/d3-interpolate/src/transform/decompose.js"(){ep=180/Math.PI,rp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}});function sp(t){const e=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?rp:ip(e.a,e.b,e.c,e.d,e.e,e.f)}function lp(t){return null==t?rp:(ap||(ap=document.createElementNS("http://www.w3.org/2000/svg","g")),ap.setAttribute("transform",t),(t=ap.transform.baseVal.consolidate())?ip((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):rp)}var cp,up,hp=h({"node_modules/d3-interpolate/src/transform/parse.js"(){op()}});function dp(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:Nd(t,i)},{i:l-2,x:Nd(n,a)})}else(i||a)&&o.push("translate("+i+e+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:Nd(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:Nd(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Nd(t,r)},{i:s-2,x:Nd(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r<n;)s[(e=l[r]).i]=e.x(t);return s.join("")}}}var pp,fp=h({"node_modules/d3-interpolate/src/transform/index.js"(){Ud(),hp(),cp=dp(sp,"px, ","px)","deg)"),up=dp(lp,", ",")",")")}});function mp(t){return((t=Math.exp(t))+1/t)/2}var gp,yp,vp=h({"node_modules/d3-interpolate/src/zoom.js"(){pp=function t(e,r,n){function i(t,i){var a,o,s=t[0],l=t[1],c=t[2],u=i[0],h=i[1],d=i[2],p=u-s,f=h-l,m=p*p+f*f;if(m<1e-12)o=Math.log(d/c)/e,a=function(t){return[s+t*p,l+t*f,c*Math.exp(e*t*o)]};else{var g=Math.sqrt(m),y=(d*d-c*c+n*m)/(2*c*r*g),v=(d*d-c*c-n*m)/(2*d*r*g),x=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(v*v+1)-v);o=(b-x)/e,a=function(t){var n,i=t*o,a=mp(x),u=c/(r*g)*(a*(n=e*i+x,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[s+u*p,l+u*f,c*a/mp(e*i+x)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return i.rho=function(e){var r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},i}(Math.SQRT2,2,4)}});function xp(t){return function(e,r){var n=t((e=Lh(e)).h,(r=Lh(r)).h),i=Sd(e.s,r.s),a=Sd(e.l,r.l),o=Sd(e.opacity,r.opacity);return function(t){return e.h=n(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var bp=h({"node_modules/d3-interpolate/src/hsl.js"(){fd(),Ed(),gp=xp(kd),yp=xp(Sd)}});function _p(t,e){var r=Sd((t=Gh(t)).l,(e=Gh(e)).l),n=Sd(t.a,e.a),i=Sd(t.b,e.b),a=Sd(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=i(e),t.opacity=a(e),t+""}}var wp,kp,Tp=h({"node_modules/d3-interpolate/src/lab.js"(){fd(),Ed()}});function Sp(t){return function(e,r){var n=t((e=Qh(e)).h,(r=Qh(r)).h),i=Sd(e.c,r.c),a=Sd(e.l,r.l),o=Sd(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var Ap,Mp,Cp=h({"node_modules/d3-interpolate/src/hcl.js"(){fd(),Ed(),wp=Sp(kd),kp=Sp(Sd)}});function Ep(t){return function e(r){function n(e,n){var i=t((e=hd(e)).h,(n=hd(n)).h),a=Sd(e.s,n.s),o=Sd(e.l,n.l),s=Sd(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,r)),e.opacity=s(t),e+""}}return r=+r,n.gamma=e,n}(1)}var Lp=h({"node_modules/d3-interpolate/src/cubehelix.js"(){fd(),Ed(),Ap=Ep(kd),Mp=Ep(Sd)}});function Pp(t,e){void 0===e&&(e=t,t=Yd);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(t){var e=Math.max(0,Math.min(n-1,Math.floor(t*=n)));return a[e](t-e)}}var Ip=h({"node_modules/d3-interpolate/src/piecewise.js"(){Zd()}});function zp(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r}var Op=h({"node_modules/d3-interpolate/src/quantize.js"(){}}),Dp={};p(Dp,{interpolate:()=>Yd,interpolateArray:()=>Dd,interpolateBasis:()=>gd,interpolateBasisClosed:()=>vd,interpolateCubehelix:()=>Ap,interpolateCubehelixLong:()=>Mp,interpolateDate:()=>Bd,interpolateDiscrete:()=>Xd,interpolateHcl:()=>wp,interpolateHclLong:()=>kp,interpolateHsl:()=>gp,interpolateHslLong:()=>yp,interpolateHue:()=>Jd,interpolateLab:()=>_p,interpolateNumber:()=>Nd,interpolateNumberArray:()=>Id,interpolateObject:()=>Vd,interpolateRgb:()=>Ad,interpolateRgbBasis:()=>Md,interpolateRgbBasisClosed:()=>Cd,interpolateRound:()=>tp,interpolateString:()=>Wd,interpolateTransformCss:()=>cp,interpolateTransformSvg:()=>up,interpolateZoom:()=>pp,piecewise:()=>Pp,quantize:()=>zp});var Rp,Fp,Bp,jp=h({"node_modules/d3-interpolate/src/index.js"(){Zd(),Fd(),yd(),bd(),jd(),Kd(),Qd(),Ud(),Od(),Hd(),np(),Gd(),fp(),vp(),Pd(),bp(),Tp(),Cp(),Lp(),Ip(),Op()}}),Np=d({"src/traces/sunburst/fill_one.js"(t,e){var r=Je(),n=q();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,c=o||s.color;if(l>=0){e.i=s.i;var u=i.marker;u.pattern&&u.colors&&u.pattern.shape||(u.color=c,e.color=c),r.pointStyle(t,i,a,e)}else n.fill(t,c)}}}),Up=d({"src/traces/sunburst/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ka().resizeText,o=Np();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");a(t,e,"sunburst"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),Vp=d({"src/traces/sunburst/helpers.js"(t){var e=se(),r=q(),n=dr(),i=br();function a(t){return t.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a<i.length;a++){var o=i[a];if(t.getPtId(o)===r)return n=e.copy()}})),n||e},t.isEntry=function(t){return!t.parent},t.isLeaf=function(t){return!t.children},t.getPtId=function(t){return t.data.data.id},t.getPtLabel=function(t){return t.data.data.label},t.getValue=function(t){return t.value},t.isHierarchyRoot=function(t){return""===a(t)},t.setSliceCursor=function(e,r,i){var a=i.isTransitioning;if(!a){var o=e.datum();a=i.hideOnRoot&&t.isHierarchyRoot(o)||i.hideOnLeaves&&t.isLeaf(o)}n(e,a?null:"pointer")},t.getInsideTextFontKey=function(t,r,n,i,a){var o=(a||{}).onPathbar?"pathbar.textfont":"insidetextfont",s=n.data.data.i;return e.castOption(r,s,o+"."+t)||e.castOption(r,s,"textfont."+t)||i.size},t.getOutsideTextFontKey=function(t,r,n,i){var a=n.data.data.i;return e.castOption(r,a,"outsidetextfont."+t)||e.castOption(r,a,"textfont."+t)||i.size},t.isOutsideText=function(e,r){return!e._hasColorscale&&t.isHierarchyRoot(r)},t.determineTextFont=function(n,i,a,o){return t.isOutsideText(n,i)?function(e,r,n){return{color:t.getOutsideTextFontKey("color",e,r,n),family:t.getOutsideTextFontKey("family",e,r,n),size:t.getOutsideTextFontKey("size",e,r,n),weight:t.getOutsideTextFontKey("weight",e,r,n),style:t.getOutsideTextFontKey("style",e,r,n),variant:t.getOutsideTextFontKey("variant",e,r,n),textcase:t.getOutsideTextFontKey("textcase",e,r,n),lineposition:t.getOutsideTextFontKey("lineposition",e,r,n),shadow:t.getOutsideTextFontKey("shadow",e,r,n)}}(n,i,a):function(n,i,a,o){var s=(o||{}).onPathbar,l=i.data.data,c=l.i,u=e.castOption(n,c,(s?"pathbar.textfont":"insidetextfont")+".color");return!u&&n._input.textfont&&(u=e.castOption(n._input,c,"textfont.color")),{color:u||r.contrast(l.color),family:t.getInsideTextFontKey("family",n,i,a,o),size:t.getInsideTextFontKey("size",n,i,a,o),weight:t.getInsideTextFontKey("weight",n,i,a,o),style:t.getInsideTextFontKey("style",n,i,a,o),variant:t.getInsideTextFontKey("variant",n,i,a,o),textcase:t.getInsideTextFontKey("textcase",n,i,a,o),lineposition:t.getInsideTextFontKey("lineposition",n,i,a,o),shadow:t.getInsideTextFontKey("shadow",n,i,a,o)}}(n,i,a,o)},t.hasTransition=function(t){return!!(t&&t.duration>0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,a(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(t,r){var n=e.formatPercent(t,0);return"0%"===n&&(n=i.formatPiePercent(t,r)),n}}}),qp=d({"src/traces/sunburst/fx.js"(t,e){var r=v(),n=Vt(),i=Ze().appendArrayPointValue,a=zr(),o=se(),s=de(),l=Vp(),c=br().formatPieValue;function u(t,e,r){for(var n=t.data.data,a={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o<r.length;o++){var s=r[o];s in t&&(a[s]=t[s])}return"parentString"in t&&!l.isHierarchyRoot(t)&&(a.parent=t.parentString),i(a,e,n.i),a}e.exports=function(t,e,i,h,d){var p=h[0],f=p.trace,m=p.hierarchy,g="sunburst"===f.type,y="treemap"===f.type||"icicle"===f.type;"_hasHoverLabel"in f||(f._hasHoverLabel=!1),"_hasHoverEvent"in f||(f._hasHoverEvent=!1),t.on("mouseover",(function(n){var s=i._fullLayout;if(!i._dragging&&!1!==s.hovermode){var h,v=i._fullData[f.index],x=n.data.data,b=x.i,_=l.isHierarchyRoot(n),w=l.getParent(m,n),k=l.getValue(n),T=function(t){return o.castOption(v,b,t)},S=T("hovertemplate"),A=a.castHoverinfo(v,s,b),M=s.separators;if(S||A&&"none"!==A&&"skip"!==A){var C,E;g&&(C=p.cx+n.pxmid[0]*(1-n.rInscribed),E=p.cy+n.pxmid[1]*(1-n.rInscribed)),y&&(C=n._hoverX,E=n._hoverY);var L,P={},I=[],z=[],O=function(t){return-1!==I.indexOf(t)};A&&(I="all"===A?v._module.attributes.hoverinfo.flags:A.split("+")),P.label=x.label,O("label")&&P.label&&z.push(P.label),x.hasOwnProperty("v")&&(P.value=x.v,P.valueLabel=c(P.value,M),O("value")&&z.push(P.valueLabel)),P.currentPath=n.currentPath=l.getPath(n.data),O("current path")&&!_&&z.push(P.currentPath);var D=[],R=function(){-1===D.indexOf(L)&&(z.push(L),D.push(L))};P.percentParent=n.percentParent=k/l.getValue(w),P.parent=n.parentString=l.getPtLabel(w),O("percent parent")&&(L=l.formatPercent(P.percentParent,M)+" of "+P.parent,R()),P.percentEntry=n.percentEntry=k/l.getValue(e),P.entry=n.entry=l.getPtLabel(e),!O("percent entry")||_||n.onPathbar||(L=l.formatPercent(P.percentEntry,M)+" of "+P.entry,R()),P.percentRoot=n.percentRoot=k/l.getValue(m),P.root=n.root=l.getPtLabel(m),O("percent root")&&!_&&(L=l.formatPercent(P.percentRoot,M)+" of "+P.root,R()),P.text=T("hovertext")||T("text"),O("text")&&(L=P.text,o.isValidTextValue(L)&&z.push(L)),h=[u(n,v,d.eventDataKeys)];var F={trace:v,y:E,_x0:n._x0,_x1:n._x1,_y0:n._y0,_y1:n._y1,text:z.join("<br>"),name:S||O("name")?v.name:void 0,color:T("hoverlabel.bgcolor")||x.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),fontWeight:T("hoverlabel.font.weight"),fontStyle:T("hoverlabel.font.style"),fontVariant:T("hoverlabel.font.variant"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:S,hovertemplateLabels:P,eventData:h};g&&(F.x0=C-n.rInscribed*n.rpx1,F.x1=C+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=C,F.idealAlign=C<0?"left":"right");var B=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:B}),h[0].bbox=B[0],f._hasHoverLabel=!0}if(y){var j=t.select("path.surface");d.styleOne(j,n,v,i,{hovered:!0})}f._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,d.eventDataKeys)],event:r.event})}})),t.on("mouseout",(function(e){var n=i._fullLayout,o=i._fullData[f.index],s=r.select(this).datum();if(f._hasHoverEvent&&(e.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,d.eventDataKeys)],event:r.event}),f._hasHoverEvent=!1),f._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),f._hasHoverLabel=!1),y){var l=t.select("path.surface");d.styleOne(l,s,o,i,{hovered:!1})}})),t.on("click",(function(t){var e=i._fullLayout,o=i._fullData[f.index],c=g&&(l.isHierarchyRoot(t)||l.isLeaf(t)),h=l.getPtId(t),p=l.isEntry(t)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(p),v={points:[u(t,o,d.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+f.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[u(t,o,d.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,e._tracePreGUI[o.uid],{level:o.level});var b={data:[{level:y}],traces:[f.index]},_={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(e._hoverlayer.node()),n.call("animate",i,b,_)}}))}}}),$p=d({"src/traces/sunburst/plot.js"(t){var e=v(),r=Gu(),n=(jp(),m(Dp)).interpolate,i=Je(),a=se(),o=Ae(),s=Ka(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Ru(),h=br().getRotationAngle,d=u.computeTransform,p=u.transformInsideText,f=Up().styleOne,g=Qa().resizeText,y=qp(),x=Vu(),b=Vp();function _(s,c,u,m){var g=s._context.staticPlot,v=s._fullLayout,_=!v.uniformtext.mode&&b.hasTransition(m),k=e.select(u).selectAll("g.slice"),T=c[0],S=T.trace,A=T.hierarchy,M=b.findEntryWithLevel(A,S.level),C=b.getMaxDepth(S),E=v._size,L=S.domain,P=E.w*(L.x[1]-L.x[0]),I=E.h*(L.y[1]-L.y[0]),z=.5*Math.min(P,I),O=T.cx=E.l+E.w*(L.x[1]+L.x[0])/2,D=T.cy=E.t+E.h*(1-L.y[0])-I/2;if(!M)return k.remove();var R=null,F={};_&&k.each((function(t){F[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&b.isEntry(t)&&(R=t)}));var B=function(t){return r.partition().size([2*Math.PI,t.height+1])(t)}(M).descendants(),j=M.height+1,N=0,U=C;T.hasMultipleRoots&&b.isHierarchyRoot(M)&&(B=B.slice(1),j-=1,N=1,U+=1),B=B.filter((function(t){return t.y1<=U}));var V=h(S.rotation);V&&B.forEach((function(t){t.x0+=V,t.x1+=V}));var q=Math.min(j,C),$=function(t){return(t-N)/q*z},H=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},W=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,O,D)},G=function(t){return O+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Y=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(k=k.data(B,b.getPtId)).enter().append("g").classed("slice",!0),_?k.exit().transition().each((function(){var t=e.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),i=F[r],a=F[b.getPtId(M)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+V;e=t.rpx1<a.rpx1?{x0:t.x0,x1:t.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:t.rpx0,rpx1:t.rpx1}}else{var s,l=b.getPtId(t.parent);k.each((function(t){if(b.getPtId(t)===l)return s=t}));var c,u=s.children;u.forEach((function(t,e){if(b.getPtId(t)===r)return c=e}));var h=u.length,d=n(s.x0,s.x1);e={rpx0:z,rpx1:z,x0:d(c/h),x1:d((c+1)/h)}}return n(i,e)}(t);return function(t){return W(e(t))}})),t.select("g.slicetext").attr("opacity",0)})).remove():k.exit().remove(),k.order();var Z=null;if(_&&R){var X=b.getPtId(R);k.each((function(t){null===Z&&b.getPtId(t)===X&&(Z=t.x1)}))}var K=k;function J(t){var e=t.parent,r=F[b.getPtId(e)],i={};if(r){var a=e.children,o=a.indexOf(t),s=a.length,l=n(r.x0,r.x1);i.x0=l(o/s),i.x1=l(o/s)}else i.x0=i.x1=0;return i}_&&(K=K.transition().each("end",(function(){var t=e.select(this);b.setSliceCursor(t,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})}))),K.each((function(r){var u=e.select(this),h=a.ensureSingle(u,"path","surface",(function(t){t.style("pointer-events",g?"none":"all")}));r.rpx0=$(r.y0),r.rpx1=$(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=H(r.rpx1,r.xmid),r.midangle=-(r.xmid-Math.PI/2),r.startangle=-(r.x0-Math.PI/2),r.stopangle=-(r.x1-Math.PI/2),r.halfangle=.5*Math.min(a.angleDelta(r.x0,r.x1)||Math.PI,Math.PI),r.ring=1-r.rpx0/r.rpx1,r.rInscribed=function(t){return 0===t.rpx0&&a.isFullCircle([t.x0,t.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2))}(r),_?h.transition().attrTween("d",(function(t){var e=function(t){var e,r=F[b.getPtId(t)],i={x0:t.x0,x1:t.x1,rpx0:t.rpx0,rpx1:t.rpx1};if(r)e=r;else if(R)if(t.parent)if(Z){var o=(t.x1>Z?2*Math.PI:0)+V;e={x0:o,x1:o}}else e={rpx0:z,rpx1:z},a.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return n(e,i)}(t);return function(t){return W(e(t))}})):h.attr("d",W),u.call(y,M,s,c,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(f,r,S,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),k=a.ensureUniformFontSize(s,b.determineTextFont(S,r,v.font));w.text(t.formatSliceLabel(r,M,S,c,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,k).call(o.convertToTspans,s);var A=i.bBox(w.node());r.transform=p(A,r,T),r.transform.targetX=G(r),r.transform.targetY=Y(r);var C=function(t,e){var r=t.transform;return d(r,e),r.fontSize=k.size,l(S.type,r,v),a.getTextTransform(r)};_?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[b.getPtId(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(t.parent)if(Z){var o=t.x1>Z?2*Math.PI:0;e.x0=e.x1=o}else a.extendFlat(e,J(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var s=n(e.transform.textPosAngle,t.transform.textPosAngle),c=n(e.rpx1,t.rpx1),u=n(e.x0,t.x0),h=n(e.x1,t.x1),d=n(e.transform.scale,i.scale),p=n(e.transform.rotate,i.rotate),f=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,m=n(e.transform.rCenter,i.rCenter),g=function(t){return m(Math.pow(t,f))};return function(t){var e=c(t),r=u(t),n=h(t),a=g(t),o={pxmid:H(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:a,x:i.x,y:i.y}};return l(S.type,i,v),{transform:{targetX:G(o),targetY:Y(o),scale:d(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return C(e(t),A)}})):w.attr("transform",C(r,A))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}t.plot=function(t,r,n,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&b.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),e.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,n)}))}))):(a.each((function(e){_(t,e,this,n)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(t,e,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!o&&(!s||"none"===s))return"";var l=i.separators,c=n[0],u=t.data.data,h=c.hierarchy,d=b.isHierarchyRoot(t),p=b.getParent(h,t),f=b.getValue(t);if(!o){var m,g=s.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(b.formatValue(u.v,l)),!d){y("current path")&&v.push(b.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var _=x>1;if(x){var w,k=function(t){m=b.formatPercent(w,l),_&&(m+=" of "+t),v.push(m)};y("percent parent")&&!d&&(w=f/b.getValue(p),k("parent")),y("percent entry")&&(w=f/b.getValue(e),k("entry")),y("percent root")&&(w=f/b.getValue(h),k("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var T=a.castOption(r,u.i,"texttemplate");if(!T)return"";var S={};u.label&&(S.label=u.label),u.hasOwnProperty("v")&&(S.value=u.v,S.valueLabel=b.formatValue(u.v,l)),S.currentPath=b.getPath(t.data),d||(S.percentParent=f/b.getValue(p),S.percentParentLabel=b.formatPercent(S.percentParent,l),S.parent=b.getPtLabel(p)),S.percentEntry=f/b.getValue(e),S.percentEntryLabel=b.formatPercent(S.percentEntry,l),S.entry=b.getPtLabel(e),S.percentRoot=f/b.getValue(h),S.percentRootLabel=b.formatPercent(S.percentRoot,l),S.root=b.getPtLabel(h),u.hasOwnProperty("color")&&(S.color=u.color);var A=a.castOption(r,u.i,"text");return(a.isValidTextValue(A)||""===A)&&(S.text=A),S.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(T,S,i._d3locale,S,r._meta||{})}}}),Hp=d({"src/traces/sunburst/index.js"(t,e){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:Uu(),categories:[],animatable:!0,attributes:qu(),layoutAttributes:$u(),supplyDefaults:Hu(),supplyLayoutDefaults:Wu(),calc:Yu().calc,crossTraceCalc:Yu().crossTraceCalc,plot:$p().plot,style:Up().style,colorbar:di(),meta:{}}}}),Wp=d({"lib/sunburst.js"(t,e){e.exports=Hp()}}),Gp=d({"src/traces/treemap/base_plot.js"(t){var e=ke();t.name="treemap",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Yp=d({"src/traces/treemap/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Zp=d({"src/traces/treemap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=ka().attributes,o=Lu(),s=qu(),l=Yp(),c=D().extendFlat,u=It().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Xp=d({"src/traces/treemap/layout_attributes.js"(t,e){e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Kp=d({"src/traces/treemap/defaults.js"(t,e){var r=se(),n=Zp(),i=q(),a=ka().defaults,o=Ga().handleText,s=qa().TEXTPAD,l=Pu().handleMarkerDefaults,c=We(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,d){function p(i,a){return r.coerce(t,e,n,i,a)}var f=p("labels"),m=p("parents");if(f&&f.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,d,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==e.textposition.indexOf("bottom");l(t,e,d,p),(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,d,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(e.marker.colors||[]).length);var b=2*e.textfont.size;p("marker.pad.t",x?b/4:b),p("marker.pad.l",b/4),p("marker.pad.r",b/4),p("marker.pad.b",x?b:b/4),p("marker.cornerradius"),e._hovered={marker:{line:{width:2,color:i.contrast(d.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,d,p),e._length=null}else e.visible=!1}}}),Jp=d({"src/traces/treemap/layout_defaults.js"(t,e){var r=se(),n=Xp();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("treemapcolorway",e.colorway),i("extendtreemapcolors")}}}),Qp=d({"src/traces/treemap/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}}),tf=d({"src/traces/treemap/flip_tree.js"(t,e){e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o<a.length;o++)t(a[o],r,n)}}}),ef=d({"src/traces/treemap/partition.js"(t,e){var r=Gu(),n=tf();e.exports=function(t,e,i){var a,o=i.flipX,s=i.flipY,l="dice-slice"===i.packing,c=i.pad[s?"bottom":"top"],u=i.pad[o?"right":"left"],h=i.pad[o?"left":"right"],d=i.pad[s?"top":"bottom"];l&&(a=u,u=c,c=a,a=h,h=d,d=a);var p=r.treemap().tile(function(t,e){switch(t){case"squarify":return r.treemapSquarify.ratio(e);case"binary":return r.treemapBinary;case"dice":return r.treemapDice;case"slice":return r.treemapSlice;default:return r.treemapSliceDice}}(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(u).paddingRight(h).paddingTop(c).paddingBottom(d).size(l?[e[1],e[0]]:e)(t);return(l||o||s)&&n(p,e,{swapXY:l,flipX:o,flipY:s}),p}}}),rf=d({"src/traces/treemap/style.js"(t,e){var r=v(),n=q(),i=se(),a=Vp(),o=Ka().resizeText,s=Np();function l(t,e,r,o,l){var c,u,h=(l||{}).hovered,d=e.data.data,p=d.i,f=d.color,m=a.isHierarchyRoot(e),g=1;if(h)c=r._hovered.marker.line.color,u=r._hovered.marker.line.width;else if(m&&f===r.root.color)g=100,c="rgba(0,0,0,0)",u=0;else if(c=i.castOption(r,p,"marker.line.color")||n.defaultLine,u=i.castOption(r,p,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var y=r.marker.depthfade;if(y){var v,x=n.combine(n.addOpacity(r._backgroundColor,.75),f);if(!0===y){var b=a.getMaxDepth(r);v=isFinite(b)?a.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else v=e.data.depth-r._entryDepth,r._atRootLevel||v++;if(v>0)for(var _=0;_<v;_++){var w=.5*_/v;f=n.combine(n.addOpacity(x,w),f)}}}t.call(s,e,r,o,f).style("stroke-width",u).call(n.stroke,c).style("opacity",g)}e.exports={style:function(t){var e=t._fullLayout._treemaplayer.selectAll(".trace");o(t,e,"treemap"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(l,e,i,t,{hovered:!1})}))}))},styleOne:l}}}),nf=d({"src/traces/treemap/draw_ancestors.js"(t,e){var r=v(),n=se(),i=Je(),a=Ae(),o=ef(),s=rf().styleOne,l=Yp(),c=Vp(),u=qp(),h=!0;e.exports=function(t,e,d,p,f){var m=f.barDifY,g=f.width,y=f.height,v=f.viewX,x=f.viewY,b=f.pathSlice,_=f.toMoveInsideSlice,w=f.strTransform,k=f.hasTransition,T=f.handleSlicesExit,S=f.makeUpdateSliceInterpolator,A=f.makeUpdateTextInterpolator,M={},C=t._context.staticPlot,E=t._fullLayout,L=e[0],P=L.trace,I=L.hierarchy,z=g/P._entryDepth,O=c.listPath(d.data,"id"),D=o(I.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(D=D.filter((function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=z*e,t.x1=z*(e+1),t.y0=m,t.y1=m+y,t.onPathbar=!0,!0)}))).reverse(),(p=p.data(D,c.getPtId)).enter().append("g").classed("pathbar",!0),T(p,h,M,[g,y],b),p.order();var R=p;k&&(R=R.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),R.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-Math.min(g,y)/2),o._hoverY=x(o.y1-y/2);var p=r.select(this),f=n.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events",C?"none":"all")}));k?f.transition().attrTween("d",(function(t){var e=S(t,h,M,[g,y]);return function(t){return b(e(t))}})):f.attr("d",b),p.call(u,d,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),f.call(s,o,P,t,{hovered:!1}),o._text=(c.getPtLabel(o)||"").split("<br>").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),T=n.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),L=n.ensureUniformFontSize(t,c.determineTextFont(P,o,E.font,{onPathbar:!0}));T.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,L).call(a.convertToTspans,t),o.textBB=i.bBox(T.node()),o.transform=_(o,{fontSize:L.size,onPathbar:!0}),o.transform.fontSize=L.size,k?T.transition().attrTween("transform",(function(t){var e=A(t,h,M,[g,y]);return function(t){return w(e(t))}})):T.attr("transform",w(o))}))}}}),af=d({"src/traces/treemap/plot_one.js"(t,e){var r=v(),n=(jp(),m(Dp)).interpolate,i=Vp(),a=se(),o=qa().TEXTPAD,s=to().toMoveInsideBar,l=Ka().recordMinTextSize,c=Yp(),u=nf();function h(t){return i.isHierarchyRoot(t)?"":i.getPtId(t)}e.exports=function(t,e,d,p,f){var m=t._fullLayout,g=e[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,b=i.findEntryWithLevel(x,y.level),_=r.select(d),w=_.selectAll("g.pathbar"),k=_.selectAll("g.slice");if(!b)return w.remove(),void k.remove();var T=i.isHierarchyRoot(b),S=!m.uniformtext.mode&&i.hasTransition(p),A=i.getMaxDepth(y),M=m._size,C=y.domain,E=M.w*(C.x[1]-C.x[0]),L=M.h*(C.y[1]-C.y[0]),P=E,I=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,O=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?L+z:-(I+z):0,D={x0:P,x1:P,y0:O,y1:O+I},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},j={},N=null,U=function(t,e){return e?B[h(t)]:j[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=j[y.level]||r;return function(t){return t.data.depth-b.data.depth<A}(t)?R(t,i,n):{}};g.hasMultipleRoots&&T&&A++,y._maxDepth=A,y._backgroundColor=m.paper_bgcolor,y._entryDepth=b.data.depth,y._atRootLevel=T;var q=-E/2+M.l+M.w*(C.x[1]+C.x[0])/2,$=-L/2+M.t+M.h*(1-(C.y[1]+C.y[0])/2),H=function(t){return q+t},W=function(t){return $+t},G=W(0),Y=H(0),Z=function(t){return Y+t},X=function(t){return G+t};function K(t,e){return t+","+e}var J=Z(0),Q=function(t){t.x=Math.max(J,t.x)},tt=y.pathbar.edgeshape,et=y[v?"tiling":"marker"].pad,rt=function(t){return-1!==y.textposition.indexOf(t)},nt=rt("top"),it=rt("left"),at=rt("right"),ot=rt("bottom"),st=function(t,e){var r=t.x0,n=t.x1,i=t.y0,a=t.y1,c=t.textBB,u=nt||e.isHeader&&!ot?"start":ot?"end":"middle",h=rt("right"),d=rt("left")||e.onPathbar?-1:h?1:0;if(e.isHeader){if((r+=(v?et:et.l)-o)>=(n-=(v?et:et.r)-o)){var p=(r+n)/2;r=p,n=p}var f;ot?i<(f=a-(v?et:et.b))&&f<a&&(i=f):i<(f=i+(v?et:et.t))&&f<a&&(a=f)}var g=s(r,n,i,a,c,{isHorizontal:!1,constrained:!0,angle:0,anchor:u,leftToRight:d});return g.fontSize=e.fontSize,g.targetX=H(g.targetX),g.targetY=W(g.targetY),isNaN(g.targetX)||isNaN(g.targetY)?{}:(r!==n&&i!==a&&l(y.type,g,m),{scale:g.scale,rotate:g.rotate,textX:g.textX,textY:g.textY,anchorX:g.anchorX,anchorY:g.anchorY,targetX:g.targetX,targetY:g.targetY})},lt=function(t,e){for(var r,n=0,i=t;!r&&n<A;)n++,(i=i.parent)?r=U(i,e):n=A;return r||{}},ct=function(t,e,r,i,o){var s,l=U(t,e);if(l)s=l;else if(e)s=D;else if(F)if(t.parent){var c=N||r;c&&!e?s=R(t,c,i):(s={},a.extendFlat(s,lt(t,e)))}else s=a.extendFlat({},t),v&&("h"===o.orientation?o.flipX?s.x0=t.x1:s.x1=0:o.flipY?s.y0=t.y1:s.y1=0);else s={};return n(s,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})},ut=function(t,e,r,o){var s=U(t,e),c={},u=V(t,e,r,o);a.extendFlat(c,{transform:st({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:t.textBB,_text:t._text},{isHeader:i.isHeader(t,y)})}),s?c=s:t.parent&&a.extendFlat(c,lt(t,e));var h=t.transform;return t.x0!==t.x1&&t.y0!==t.y1&&l(y.type,h,m),n(c,{transform:{scale:h.scale,rotate:h.rotate,textX:h.textX,textY:h.textY,anchorX:h.anchorX,anchorY:h.anchorY,targetX:h.targetX,targetY:h.targetY}})},ht=function(t,e,i,a,o){var s=a[0],l=a[1];S?t.exit().transition().each((function(){var t=r.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var r=function(t,e,r,i){var a,o=U(t,e);if(e)a=D;else{var s=U(b,e);a=s?R(t,s,i):{}}return n(o,a)}(t,e,0,[s,l]);return function(t){return o(r(t))}})),t.select("g.slicetext").attr("opacity",0)})).remove():t.exit().remove()},dt=function(t){var e=t.transform;return t.x0!==t.x1&&t.y0!==t.y1&&l(y.type,e,m),a.getTextTransform({textX:e.textX,textY:e.textY,anchorX:e.anchorX,anchorY:e.anchorY,targetX:e.targetX,targetY:e.targetY,scale:e.scale,rotate:e.rotate})};S&&(w.each((function(t){B[h(t)]={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1},t.transform&&(B[h(t)].transform={textX:t.transform.textX,textY:t.transform.textY,anchorX:t.transform.anchorX,anchorY:t.transform.anchorY,targetX:t.transform.targetX,targetY:t.transform.targetY,scale:t.transform.scale,rotate:t.transform.rotate})})),k.each((function(t){j[h(t)]={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1},t.transform&&(j[h(t)].transform={textX:t.transform.textX,textY:t.transform.textY,anchorX:t.transform.anchorX,anchorY:t.transform.anchorY,targetX:t.transform.targetX,targetY:t.transform.targetY,scale:t.transform.scale,rotate:t.transform.rotate}),!F&&i.isEntry(t)&&(F=t)}))),N=f(t,e,b,k,{width:E,height:L,viewX:H,viewY:W,pathSlice:function(t){var e=H(t.x0),r=H(t.x1),n=W(t.y0),i=W(t.y1),a=r-e,o=i-n;if(!a||!o)return"";var s=y.marker.cornerradius||0,l=Math.min(s,a/2,o/2);l&&t.data&&t.data.data&&t.data.data.label&&(nt&&(l=Math.min(l,et.t)),it&&(l=Math.min(l,et.l)),at&&(l=Math.min(l,et.r)),ot&&(l=Math.min(l,et.b)));var c=function(t,e){return l?"a"+K(l,l)+" 0 0 1 "+K(t,e):""};return"M"+K(e,n+l)+c(l,-l)+"L"+K(r-l,n)+c(l,l)+"L"+K(r,i-l)+c(-l,l)+"L"+K(e+l,i)+c(-l,-l)+"Z"},toMoveInsideSlice:st,prevEntry:F,makeUpdateSliceInterpolator:ct,makeUpdateTextInterpolator:ut,handleSlicesExit:ht,hasTransition:S,strTransform:dt}),y.pathbar.visible?u(t,e,b,w,{barDifY:O,width:P,height:I,viewX:Z,viewY:X,pathSlice:function(t){var e=Z(Math.max(Math.min(t.x0,t.x0),0)),r=Z(Math.min(Math.max(t.x1,t.x1),P)),n=X(t.y0),i=X(t.y1),a=I/2,o={},s={};o.x=e,s.x=r,o.y=s.y=(n+i)/2;var l={x:e,y:n},c={x:r,y:n},u={x:r,y:i},h={x:e,y:i};return">"===tt?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===tt?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(c),Q(u),Q(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(h.x,h.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:st,makeUpdateSliceInterpolator:ct,makeUpdateTextInterpolator:ut,handleSlicesExit:ht,hasTransition:S,strTransform:dt}):w.remove()}}}),of=d({"src/traces/treemap/draw.js"(t,e){var r=v(),n=Vp(),i=Ka().clearMinTextSize,a=Qa().resizeText,o=af();e.exports=function(t,e,s,l,c){var u,h,d=c.type,p=c.drawDescendants,f=t._fullLayout,m=f["_"+d+"layer"],g=!s;i(d,f),(u=m.selectAll("g.trace."+d).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(d,!0),u.order(),!f.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(e){o(t,e,this,s,p)}))}))):(u.each((function(e){o(t,e,this,s,p)})),f.uniformtext.mode&&a(t,m.selectAll(".trace"),d)),g&&u.exit().remove()}}}),sf=d({"src/traces/treemap/draw_descendants.js"(t,e){var r=v(),n=se(),i=Je(),a=Ae(),o=ef(),s=rf().styleOne,l=Yp(),c=Vp(),u=qp(),h=$p().formatSliceLabel,d=!1;e.exports=function(t,e,p,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,C=t._context.staticPlot,E=t._fullLayout,L=e[0].trace,P=-1!==L.textposition.indexOf("left"),I=-1!==L.textposition.indexOf("right"),z=-1!==L.textposition.indexOf("bottom"),O=!z&&!L.marker.pad.t||z&&!L.marker.pad.b,D=o(p,[g,y],{packing:L.tiling.packing,squarifyratio:L.tiling.squarifyratio,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,pad:{inner:L.tiling.pad,top:L.marker.pad.t,left:L.marker.pad.l,right:L.marker.pad.r,bottom:L.marker.pad.b}}).descendants(),R=1/0,F=-1/0;D.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))})),f=f.data(D,c.getPtId),L._maxVisibleLayers=isFinite(F)?F-R+1:0,f.enter().append("g").classed("slice",!0),T(f,d,{},[g,y],b),f.order();var B=null;if(k&&M){var j=c.getPtId(M);f.each((function(t){null===B&&c.getPtId(t)===j&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return B||{x0:0,x1:g,y0:0,y1:y}},U=f;return k&&(U=U.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var f=c.isHeader(o,L);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-L.marker.pad.r),o._hoverY=x(z?o.y1-L.marker.pad.b/2:o.y0+L.marker.pad.t/2);var m=r.select(this),T=n.ensureSingle(m,"path","surface",(function(t){t.style("pointer-events",C?"none":"all")}));k?T.transition().attrTween("d",(function(t){var e=S(t,d,N(),[g,y]);return function(t){return b(e(t))}})):T.attr("d",b),m.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(s,o,L,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=f?O?"":c.getPtLabel(o)||"":h(o,p,L,e,E)||"";var M=n.ensureSingle(m,"g","slicetext"),D=n.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),R=n.ensureUniformFontSize(t,c.determineTextFont(L,o,E.font)),F=o._text||" ",B=f&&-1===F.indexOf("<br>");D.text(F).classed("slicetext",!0).attr("text-anchor",I?"end":P||B?"start":"middle").call(i.font,R).call(a.convertToTspans,t),o.textBB=i.bBox(D.node()),o.transform=_(o,{fontSize:R.size,isHeader:f}),o.transform.fontSize=R.size,k?D.transition().attrTween("transform",(function(t){var e=A(t,d,N(),[g,y]);return function(t){return w(e(t))}})):D.attr("transform",w(o))})),B}}}),lf=d({"src/traces/treemap/plot.js"(t,e){var r=of(),n=sf();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"treemap",drawDescendants:n})}}}),cf=d({"src/traces/treemap/index.js"(t,e){e.exports={moduleType:"trace",name:"treemap",basePlotModule:Gp(),categories:[],animatable:!0,attributes:Zp(),layoutAttributes:Xp(),supplyDefaults:Kp(),supplyLayoutDefaults:Jp(),calc:Qp().calc,crossTraceCalc:Qp().crossTraceCalc,plot:lf(),style:rf().style,colorbar:di(),meta:{}}}}),uf=d({"lib/treemap.js"(t,e){e.exports=cf()}}),hf=d({"src/traces/icicle/base_plot.js"(t){var e=ke();t.name="icicle",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),df=d({"src/traces/icicle/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=ka().attributes,o=Lu(),s=qu(),l=Zp(),c=Yp(),u=D().extendFlat,h=It().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),pf=d({"src/traces/icicle/layout_attributes.js"(t,e){e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ff=d({"src/traces/icicle/defaults.js"(t,e){var r=se(),n=df(),i=q(),a=ka().defaults,o=Ga().handleText,s=qa().TEXTPAD,l=Pu().handleMarkerDefaults,c=We(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,d){function p(i,a){return r.coerce(t,e,n,i,a)}var f=p("labels"),m=p("parents");if(f&&f.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,d,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),l(t,e,d,p);var x=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,d,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:i.contrast(d.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,d,p),e._length=null}else e.visible=!1}}}),mf=d({"src/traces/icicle/layout_defaults.js"(t,e){var r=se(),n=pf();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("iciclecolorway",e.colorway),i("extendiciclecolors")}}}),gf=d({"src/traces/icicle/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}}),yf=d({"src/traces/icicle/partition.js"(t,e){var r=Gu(),n=tf();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}}),vf=d({"src/traces/icicle/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ka().resizeText,o=Np();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");a(t,e,"icicle"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),xf=d({"src/traces/icicle/draw_descendants.js"(t,e){var r=v(),n=se(),i=Je(),a=Ae(),o=yf(),s=vf().styleOne,l=Yp(),c=Vp(),u=qp(),h=$p().formatSliceLabel,d=!1;e.exports=function(t,e,p,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,C=t._context.staticPlot,E=t._fullLayout,L=e[0].trace,P=-1!==L.textposition.indexOf("left"),I=-1!==L.textposition.indexOf("right"),z=-1!==L.textposition.indexOf("bottom"),O=o(p,[g,y],{flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,orientation:L.tiling.orientation,pad:{inner:L.tiling.pad},maxDepth:L._maxDepth}).descendants(),D=1/0,R=-1/0;O.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))})),f=f.data(O,c.getPtId),L._maxVisibleLayers=isFinite(R)?R-D+1:0,f.enter().append("g").classed("slice",!0),T(f,d,{},[g,y],b),f.order();var F=null;if(k&&M){var B=c.getPtId(M);f.each((function(t){null===F&&c.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var j=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=f;return k&&(N=N.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-L.tiling.pad),o._hoverY=x(z?o.y1-L.tiling.pad/2:o.y0+L.tiling.pad/2);var f=r.select(this),m=n.ensureSingle(f,"path","surface",(function(t){t.style("pointer-events",C?"none":"all")}));k?m.transition().attrTween("d",(function(t){var e=S(t,d,j(),[g,y],{orientation:L.tiling.orientation,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1});return function(t){return b(e(t))}})):m.attr("d",b),f.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(s,o,L,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,p,L,e,E)||"";var T=n.ensureSingle(f,"g","slicetext"),M=n.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),O=n.ensureUniformFontSize(t,c.determineTextFont(L,o,E.font));M.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":P?"start":"middle").call(i.font,O).call(a.convertToTspans,t),o.textBB=i.bBox(M.node()),o.transform=_(o,{fontSize:O.size}),o.transform.fontSize=O.size,k?M.transition().attrTween("transform",(function(t){var e=A(t,d,j(),[g,y]);return function(t){return w(e(t))}})):M.attr("transform",w(o))})),F}}}),bf=d({"src/traces/icicle/plot.js"(t,e){var r=of(),n=xf();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}}),_f=d({"src/traces/icicle/index.js"(t,e){e.exports={moduleType:"trace",name:"icicle",basePlotModule:hf(),categories:[],animatable:!0,attributes:df(),layoutAttributes:pf(),supplyDefaults:ff(),supplyLayoutDefaults:mf(),calc:gf().calc,crossTraceCalc:gf().crossTraceCalc,plot:bf(),style:vf().style,colorbar:di(),meta:{}}}}),wf=d({"lib/icicle.js"(t,e){e.exports=_f()}}),kf=d({"src/traces/funnelarea/base_plot.js"(t){var e=ke();t.name="funnelarea",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Tf=d({"src/traces/funnelarea/attributes.js"(t,e){var r=Lu(),n=N(),i=ka().attributes,a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=D().extendFlat;e.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),Sf=d({"src/traces/funnelarea/layout_attributes.js"(t,e){var r=Iu().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Af=d({"src/traces/funnelarea/defaults.js"(t,e){var r=se(),n=Tf(),i=ka().defaults,a=Ga().handleText,o=Pu().handleLabelsAndValues,s=Pu().handleMarkerDefaults;e.exports=function(t,e,l,c){function u(i,a){return r.coerce(t,e,n,i,a)}var h=u("labels"),d=u("values"),p=o(h,d),f=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),f){e._length=f,s(t,e,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(t,e,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(e,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else e.visible=!1}}}),Mf=d({"src/traces/funnelarea/layout_defaults.js"(t,e){var r=se(),n=Sf();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",e.colorway),i("extendfunnelareacolors")}}}),Cf=d({"src/traces/funnelarea/calc.js"(t,e){var r=Ou();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}}),Ef=d({"src/traces/funnelarea/plot.js"(t,e){var r=v(),n=Je(),i=se(),a=i.strScale,o=i.strTranslate,s=Ae(),l=to().toMoveInsideBar,c=Ka(),u=c.recordMinTextSize,h=c.clearMinTextSize,d=br(),p=Ru(),f=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,x=p.positionTitleOutside,b=p.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}function w(t,e){return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}e.exports=function(t,e){var c=t._context.staticPlot,p=t._fullLayout;h("funnelarea",p),y(e,t),g(e,p._size),i.makeTraceGroups(p._funnelarealayer,e,"trace").each((function(e){var h=r.select(this),g=e[0],y=g.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=e.vTotal,u=c,h=c*l/(1-l)/c,d=[];for(d.push(C()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/u;h+=p,d.push(C())}var f=1/0,m=-1/0;for(o=0;o<d.length;o++)a=d[o],f=Math.min(f,a[1]),m=Math.max(m,a[1]);for(o=0;o<d.length;o++)d[o][1]-=(m+f)/2;var g=d[d.length-1][0],y=e.r,v=(m-f)/2,x=y/g,b=y/v*n;for(e.r=b*v,o=0;o<d.length;o++)d[o][0]*=x,d[o][1]*=b;var _=[-(a=d[0])[0],a[1]],k=[a[0],a[1]],T=0;for(o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var S=d[T+=1][0],A=d[T][1];s.TL=[-S,A],s.TR=[S,A],s.BL=_,s.BR=k,s.pxmid=w(s.TR,s.BR),_=s.TL,k=s.TR}}function M(){var t=Math.sqrt(h);return{x:t,y:-t}}function C(){var t=M();return[t.x,t.y]}}(e),h.each((function(){var h=r.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(f,t,e);var k="M"+(h+a.TR[0])+","+(v+a.TR[1])+_(a.TR,a.BR)+_(a.BR,a.BL)+_(a.BL,a.TL)+"Z";w.attr("d",k),b(t,a,g);var T=d.castOption(y.textposition,a.pts),S=x.selectAll("g.slicetext").data(a.text&&"none"!==T?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),d=i.ensureUniformFontSize(t,m(y,a,p.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,d).call(s.convertToTspans,t);var f,g,x,b=n.bBox(c.node()),_=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(f=l(g,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=d.size,u(y.type,f,p),e[o].transform=f,i.setTransormAndDisplay(c,f)}))}}));var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),e.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,t);var c=x(g,p._size);e.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Lf=d({"src/traces/funnelarea/style.js"(t,e){var r=v(),n=wr(),i=Ka().resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),Pf=d({"src/traces/funnelarea/index.js"(t,e){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:kf(),categories:["pie-like","funnelarea","showLegend"],attributes:Tf(),layoutAttributes:Sf(),supplyDefaults:Af(),supplyLayoutDefaults:Mf(),calc:Cf().calc,crossTraceCalc:Cf().crossTraceCalc,plot:Ef(),style:Lf(),styleOne:wr(),meta:{}}}}),If=d({"lib/funnelarea.js"(t,e){e.exports=Pf()}}),zf=d({"stackgl_modules/index.js"(t,e){!function(){var t={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}function a(t,e,r){return e=s(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,r||[],s(t).constructor):e.apply(t,r))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!t})()}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=r(7507),h=r(3778),d="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=m,e.IS=50;var p=2147483647;function f(t){if(t>p)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,m.prototype),e}function m(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return v(t)}return g(t,e,r)}function g(t,e,r){if("string"===typeof t)return function(t,e){if("string"===typeof e&&""!==e||(e="utf8"),!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|w(t,e),n=f(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(rt(t,Uint8Array)){var e=new Uint8Array(t);return b(e.buffer,e.byteOffset,e.byteLength)}return x(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t));if(rt(t,ArrayBuffer)||t&&rt(t.buffer,ArrayBuffer))return b(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(rt(t,SharedArrayBuffer)||t&&rt(t.buffer,SharedArrayBuffer)))return b(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return m.from(n,e,r);var i=function(t){if(m.isBuffer(t)){var e=0|_(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!==typeof t.length||nt(t.length)?f(0):x(t):"Buffer"===t.type&&Array.isArray(t.data)?x(t.data):void 0}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return m.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t))}function y(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function v(t){return y(t),f(t<0?0:0|_(t))}function x(t){for(var e=t.length<0?0:0|_(t.length),r=f(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function b(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,m.prototype),n}function _(t){if(t>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|t}function w(t,e){if(m.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||rt(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function k(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return z(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function T(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function S(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),nt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=m.from(e,n)),m.isBuffer(e))return 0===e.length?-1:A(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):A(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var h=!0,d=0;d<l;d++)if(c(t,a+d)!==c(e,d)){h=!1;break}if(h)return a}return-1}function M(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(nt(s))return a;t[r+a]=s}return a}function C(t,e,r,n){return et(Q(e,t.length-r),t,r,n)}function E(t,e,r,n){return et(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function L(t,e,r,n){return et(tt(e),t,r,n)}function P(t,e,r,n){return et(function(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function I(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function z(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128===(192&l)&&128===(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128===(192&l)&&128===(192&c)&&128===(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}m.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(r){return!1}}(),m.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||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."),Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(t,e,r){return g(t,e,r)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(t,e,r){return function(t,e,r){return y(t),t<=0?f(t):void 0!==e?"string"===typeof r?f(t).fill(e,r):f(t).fill(e):f(t)}(t,e,r)},m.allocUnsafe=function(t){return v(t)},m.allocUnsafeSlow=function(t){return v(t)},m.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==m.prototype},m.compare=function(t,e){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),rt(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(t)||!m.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return m.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=m.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(rt(a,Uint8Array))i+a.length>n.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)T(this,e,e+1);return this},m.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)T(this,e,e+3),T(this,e+1,e+2);return this},m.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)T(this,e,e+7),T(this,e+1,e+6),T(this,e+2,e+5),T(this,e+3,e+4);return this},m.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?z(this,0,t):k.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===m.compare(this,t)},m.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},d&&(m.prototype[d]=m.prototype.inspect),m.prototype.compare=function(t,e,r,n,i){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),l=this.slice(n,i),u=t.slice(e,r),h=0;h<s;++h)if(l[h]!==u[h]){a=l[h],o=u[h];break}return a<o?-1:o<a?1:0},m.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},m.prototype.indexOf=function(t,e,r){return S(this,t,e,r,!0)},m.prototype.lastIndexOf=function(t,e,r){return S(this,t,e,r,!1)},m.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"===typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return M(this,t,e,r);case"utf8":case"utf-8":return C(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return L(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function F(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=it[t[a]];return i}function B(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function j(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,a){if(!m.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i){Z(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function V(t,e,r,n,i){Z(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function q(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,8),h.write(t,e,r,n,52,8),r+8}m.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,m.prototype),n},m.prototype.readUintLE=m.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},m.prototype.readUintBE=m.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t>>>=0,e||j(t,1,this.length),this[t]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t>>>=0,e||j(t,2,this.length),this[t]|this[t+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t>>>=0,e||j(t,2,this.length),this[t]<<8|this[t+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t>>>=0,e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t>>>=0,e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},m.prototype.readBigUInt64LE=at((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<<BigInt(32))})),m.prototype.readBigUInt64BE=at((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),m.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},m.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||j(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},m.prototype.readInt8=function(t,e){return t>>>=0,e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},m.prototype.readInt16LE=function(t,e){t>>>=0,e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(t,e){t>>>=0,e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(t,e){return t>>>=0,e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},m.prototype.readInt32BE=function(t,e){return t>>>=0,e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},m.prototype.readBigInt64LE=at((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24))})),m.prototype.readBigInt64BE=at((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r)})),m.prototype.readFloatLE=function(t,e){return t>>>=0,e||j(t,4,this.length),h.read(this,t,!0,23,4)},m.prototype.readFloatBE=function(t,e){return t>>>=0,e||j(t,4,this.length),h.read(this,t,!1,23,4)},m.prototype.readDoubleLE=function(t,e){return t>>>=0,e||j(t,8,this.length),h.read(this,t,!0,52,8)},m.prototype.readDoubleBE=function(t,e){return t>>>=0,e||j(t,8,this.length),h.read(this,t,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigUInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeBigUInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},m.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},m.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeBigInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeFloatLE=function(t,e,r){return $(this,t,e,!0,r)},m.prototype.writeFloatBE=function(t,e,r){return $(this,t,e,!1,r)},m.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},m.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},m.prototype.copy=function(t,e,r,n){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},m.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!m.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"===typeof t?t&=255:"boolean"===typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(a=e;a<r;++a)this[a]=t;else{var o=m.isBuffer(t)?t:m.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<r-e;++a)this[a+e]=o[a%s]}return this};var W={};function G(t,e,r){W[t]=function(r){function i(){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),r=a(this,i),Object.defineProperty(r,"message",{value:e.apply(r,arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(t,"]"),r.stack,delete r.name,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(i,r),o=i,(s=[{key:"code",get:function(){return t},set:function(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}])&&n(o.prototype,s),c&&n(o,c),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,s,c}(r)}function Y(t){for(var e="",r=t.length,n="-"===t[0]?1:0;r>=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function Z(t,e,r,n,i,a){if(t>r||t<e){var o,s="bigint"===typeof e?"n":"";throw o=a>3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){X(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,a)}function X(t,e){if("number"!==typeof t)throw new W.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw X(t,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(c(e))}),TypeError),G("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function tt(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function et(t,e,r,n){var i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function rt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function nt(t){return t!==t}var it=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function at(t){return"undefined"===typeof BigInt?ot:t}function ot(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),d=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:d},c)};var n=r(7261),i=r(9977),a=r(1811);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r<e.length;++r)e[r].flush(t)},s.idle=function(t){for(var e=this._controllerList,r=0;r<e.length;++r)e[r].idle(t)},s.lookAt=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].lookAt(t,e,r,n)},s.rotate=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].rotate(t,e,r,n)},s.pan=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].pan(t,e,r,n)},s.translate=function(t,e,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].translate(t,e,r,n)},s.setMatrix=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setMatrix(t,e)},s.setDistanceLimits=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistanceLimits(t,e)},s.setDistance=function(t,e){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistance(t,e)},s.recalcMatrix=function(t){this._active.recalcMatrix(t)},s.getDistance=function(t){return this._active.getDistance(t)},s.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},s.lastT=function(){return this._active.lastT()},s.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},s.getMode=function(){return this._mode}},7169:function(t,e,r){var n="undefined"===typeof WeakMap?r(1538):WeakMap,i=r(2762),a=r(8116),o=new n;t.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},1085:function(t,e,r){var n=r(1371);t.exports=function(t,e,r){e="number"===typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map((function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t})).join("\n")}},3952:function(t,e,r){t.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o<e;++o)if(n.push(t[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=r(3250);function i(t,e){for(var r=new Array(e+1),i=0;i<t.length;++i)r[i]=t[i];for(i=0;i<=t.length;++i){for(var a=t.length;a<=e;++a){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},5995:function(t,e,r){t.exports=function(t,e){return n(e).filter((function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=e[r[a]];return i(n)*t<1}))};var n=r(7642),i=r(6037)},3502:function(t,e,r){t.exports=function(t,e){return i(n(t,e))};var n=r(5995),i=r(9127)},6468:function(t){t.exports=function(t){return atob(t)}},2642:function(t,e,r){t.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];a[o]=s}for(a[r]=new Array(r+1),o=0;o<=r;++o)a[r][o]=1;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=e[o];c[r]=1;var u=n(a,c),h=i(u[r+1]);0===h&&(h=1);var d=new Array(r+1);for(o=0;o<=r;++o)d[o]=i(u[o])/h;return d};var n=r(727);function i(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}},7507:function(t,e){e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,a=s(t),o=a[0],l=a[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),u=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(l(t,s,s+o>c?c:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,a,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(i(e))c=e.clone();else if("string"===typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"===typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(t,e,r){var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a<e;a++)i+=r[a]*Math.pow(67108864,a);return n(t)*i}},4025:function(t,e,r){var n=r(2361),i=r(8828).countTrailingZeros;t.exports=function(t){var e=i(n.lo(t));if(e<32)return e;var r=i(n.hi(t));return r>20?52:r+32}},1533:function(t,e,r){r(6859),t.exports=function(t){return t&&"object"===typeof t&&Boolean(t.words)}},2651:function(t,e,r){var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},6768:function(t,e,r){var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(d=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,d=n(l.ushln(h).divRound(r));return h<1023?c*d*Math.pow(2,-h):c*(d*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"===typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1)&&!!t},e.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(n),e.reverse=function(t){return n[255&t]<<24|n[t>>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"===typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7790).Buffer}catch(S){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"===typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=l(t,e,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2===0?e+1:e;n<t.length;n+=2)i=l(t,e,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u<s;u+=n)l=c(t,u,u+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=c(t,u,t.length,e),u=0;u<o;u++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,h=67108863&l,d=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=d;p++){var f=c-p|0;u+=(o=(i=0|t.words[f])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],p=d[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modn(p).toString(t);r=(f=f.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n("undefined"!==typeof o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o<n.length;o++)a=(e=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&e;for(;0!==a&&o<r.length;o++)a=(e=(0|r.words[o])+a)>>26,this.words[o]=67108863&e;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,c=0,u=0|o[0],h=8191&u,d=u>>>13,p=0|o[1],f=8191&p,m=p>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,S=0|o[5],A=8191&S,M=S>>>13,C=0|o[6],E=8191&C,L=C>>>13,P=0|o[7],I=8191&P,z=P>>>13,O=0|o[8],D=8191&O,R=O>>>13,F=0|o[9],B=8191&F,j=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],$=8191&q,H=q>>>13,W=0|s[2],G=8191&W,Y=W>>>13,Z=0|s[3],X=8191&Z,K=Z>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,dt=ut>>>13,pt=0|s[9],ft=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(d,U)|0))<<13)|0;c=((a=Math.imul(d,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(f,U),i=(i=Math.imul(f,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var yt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,H)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,H)|0;var vt=(c+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,H)|0,n=n+Math.imul(f,G)|0,i=(i=i+Math.imul(f,Y)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,Y)|0;var xt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(d,X)|0))<<13)|0;c=((a=a+Math.imul(d,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,V))+Math.imul(T,U)|0,a=Math.imul(T,V),n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,G)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(f,X)|0,i=(i=i+Math.imul(f,K)|0)+Math.imul(m,X)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((a=a+Math.imul(d,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(M,U)|0,a=Math.imul(M,V),n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,H)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(f,Q)|0,i=(i=i+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((a=a+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,V))+Math.imul(L,U)|0,a=Math.imul(L,V),n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,X)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(f,rt)|0,i=(i=i+Math.imul(f,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,at)|0))<<13)|0;c=((a=a+Math.imul(d,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,H)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,K)|0)+Math.imul(T,X)|0,a=a+Math.imul(T,K)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(f,at)|0,i=(i=i+Math.imul(f,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var kt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,lt)|0))<<13)|0;c=((a=a+Math.imul(d,ct)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,H)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(L,G)|0,a=a+Math.imul(L,Y)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(M,X)|0,a=a+Math.imul(M,K)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(f,lt)|0,i=(i=i+Math.imul(f,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var Tt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((a=a+Math.imul(d,dt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,H)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(z,G)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(L,X)|0,a=a+Math.imul(L,K)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(T,rt)|0,a=a+Math.imul(T,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ct)|0,n=n+Math.imul(f,ht)|0,i=(i=i+Math.imul(f,dt)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,dt)|0;var St=(c+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,ft)|0))<<13)|0;c=((a=a+Math.imul(d,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,H))+Math.imul(j,$)|0,a=Math.imul(j,H),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(R,G)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(z,X)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(M,rt)|0,a=a+Math.imul(M,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(T,at)|0,a=a+Math.imul(T,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,a=a+Math.imul(v,dt)|0;var At=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,G),i=(i=Math.imul(B,Y))+Math.imul(j,G)|0,a=Math.imul(j,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,X)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(T,lt)|0,a=a+Math.imul(T,ct)|0,n=n+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,dt)|0;var Mt=(c+(n=n+Math.imul(y,ft)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,ft)|0))<<13)|0;c=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,K))+Math.imul(j,X)|0,a=Math.imul(j,K),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(M,lt)|0,a=a+Math.imul(M,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(T,ht)|0,a=a+Math.imul(T,dt)|0;var Ct=(c+(n=n+Math.imul(b,ft)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,ft)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(j,Q)|0,a=Math.imul(j,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(M,ht)|0,a=a+Math.imul(M,dt)|0;var Et=(c+(n=n+Math.imul(k,ft)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(T,ft)|0))<<13)|0;c=((a=a+Math.imul(T,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(L,ht)|0,a=a+Math.imul(L,dt)|0;var Lt=(c+(n=n+Math.imul(A,ft)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(M,ft)|0))<<13)|0;c=((a=a+Math.imul(M,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,dt)|0;var Pt=(c+(n=n+Math.imul(E,ft)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(L,ft)|0))<<13)|0;c=((a=a+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,dt)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,dt)|0;var It=(c+(n=n+Math.imul(I,ft)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(z,ft)|0))<<13)|0;c=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(j,ht)|0,a=Math.imul(j,dt);var zt=(c+(n=n+Math.imul(D,ft)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(R,ft)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Ot=(c+(n=Math.imul(B,ft))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(j,ft)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=Tt,l[9]=St,l[10]=At,l[11]=Mt,l[12]=Ct,l[13]=Et,l[14]=Lt,l[15]=Pt,l[16]=It,l[17]=zt,l[18]=Ot,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(f=p),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?f(this,t,e):n<63?p(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=l;c++){var u=a-c,h=(0|t.words[u])*(0|e.words[c]),d=67108863&h;s=67108863&(d=d+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var h=l,d=c,p=0;p<o;p++){var f=r[u+p],m=n[u+p],g=r[u+p+o],y=n[u+p+o],v=h*g-d*y;y=h*y+d*g,g=v,r[u+p]=f+g,n[u+p]=m+y,r[u+p+o]=f-g,n[u+p+o]=m-y,p!==s&&(v=l*h-c*d,d=l*d+c*h,h=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0===(-8192&a))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,h,n,i);for(var p=0;p<n;p++){var f=s[p]*u[p]-l[p]*h[p];l[p]=s[p]*h[p]+l[p]*u[p],s[p]=f}return this.conjugate(s,l,n),this.transform(s,l,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),m(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"===typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"===typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n("number"===typeof t&&t>=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"===typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a,o=t.length+r;this._expand(o);var s=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;s=((a-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var d=0,p=1;0===(e.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var f=0,m=1;0===(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0===(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,d=1;0===(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new k(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"===typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(x,v),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=a&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,v),i(_,v),i(w,v),w.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),d=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),f=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<f);var y=this.pow(h,new a(1).iushln(f-g-1));d=d.redMul(y),h=y.redSqr(),p=p.redMul(h),f=g}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,k),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),h=0;for(n=0;n<c;++n)n!==r&&(u[h++]=l[n]);if(1&r){var d=u[1];u[1]=u[0],u[0]=d}}}return o}},6867:function(t,e,r){t.exports=function(t,e,r){switch(arguments.length){case 1:return n=[],c(i=t,i,u,!0),n;case 2:return"function"===typeof e?c(t,t,e,!0):function(t,e){return n=[],c(t,e,u,!1),n}(t,e);case 3:return c(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}var i};var n,i=r(1888),a=r(855),o=r(7150);function s(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var i=0,a=0,o=0,l=t.length;o<l;++o){var c=t[o];if(!s(e,c)){for(var u=0;u<2*e;++u)r[i++]=c[u];n[a++]=o}}return a}function c(t,e,r,n){var s=t.length,c=e.length;if(!(s<=0||c<=0)){var u=t[0].length>>>1;if(!(u<=0)){var h,d=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,d,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,d,p,0,s,d,p);else{var f=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,f,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,d,p,0,c,f,m):o(u,r,n,s,d,p,c,f,m),i.free(f),i.free(m))}i.free(d),i.free(p)}return h}}}function u(t,e){n.push([t,e])}},2455:function(t,e){function r(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=n,p=h*n;d<i;++d,p+=h){var f=a[e+p],m=a[e+p+t],g=o[d];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[e+v],b=c[e+v+t],_=u[y];if(!(b<f||m<x)){for(var w=e+1;w<t;++w){var k=a[w+p],T=a[w+t+p],S=c[w+v],A=c[w+t+v];if(T<S||A<k)continue t}var M=r(g,_);if(void 0!==M)return M}}}}(t,e,r,n,i,a,o,s,l,c,u):function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=s,p=h*s;d<l;++d,p+=h){var f=c[e+p],m=c[e+p+t],g=u[d];t:for(var y=n,v=h*n;y<i;++y,v+=h){var x=a[e+v],b=a[e+v+t],_=o[y];if(!(m<x||b<f)){for(var w=e+1;w<t;++w){var k=a[w+v],T=a[w+t+v],S=c[w+p],A=c[w+t+p];if(T<S||A<k)continue t}var M=r(_,g);if(void 0!==M)return M}}}}(t,e,r,n,i,a,o,s,l,c,u)}:function(t,e,r,n,i,a,o,s,l,c,u,h){return a-i>c-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=n,p=h*n;d<i;++d,p+=h){var f=a[e+p],m=a[e+p+t],g=o[d];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[e+v],b=u[y];if(!(x<=f||m<x)){for(var _=e+1;_<t;++_){var w=a[_+p],k=a[_+t+p],T=c[_+v],S=c[_+t+v];if(k<T||S<w)continue t}var A=r(b,g);if(void 0!==A)return A}}}}(t,e,r,i,a,o,s,l,c,u,h):function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=n,p=h*n;d<i;++d,p+=h){var f=a[e+p],m=a[e+p+t],g=o[d];t:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[e+v],b=u[y];if(!(x<f||m<x)){for(var _=e+1;_<t;++_){var w=a[_+p],k=a[_+t+p],T=c[_+v],S=c[_+t+v];if(k<T||S<w)continue t}var A=r(g,b);if(void 0!==A)return A}}}}(t,e,r,i,a,o,s,l,c,u,h):n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=s,p=h*s;d<l;++d,p+=h){var f=c[e+p],m=u[d];t:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[e+y],x=a[e+y+t],b=o[g];if(!(f<=v||x<f)){for(var _=e+1;_<t;++_){var w=a[_+y],k=a[_+t+y],T=c[_+p],S=c[_+t+p];if(k<T||S<w)continue t}var A=r(m,b);if(void 0!==A)return A}}}}(t,e,r,i,a,o,s,l,c,u,h):function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,d=s,p=h*s;d<l;++d,p+=h){var f=c[e+p],m=u[d];t:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[e+y],x=a[e+y+t],b=o[g];if(!(f<v||x<f)){for(var _=e+1;_<t;++_){var w=a[_+y],k=a[_+t+y],T=c[_+p],S=c[_+t+p];if(k<T||S<w)continue t}var A=r(b,m);if(void 0!==A)return A}}}}(t,e,r,i,a,o,s,l,c,u,h)}}e.partial=r(!1),e.full=r(!0)},7150:function(t,e,r){t.exports=function(t,e,r,a,u,M,C,E,L){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(b*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(_*r);k.length<o&&(n.free(k),k=n.mallocDouble(o))}(t,a+C);var P,I=0,z=2*t;for(T(I++,0,0,a,0,C,r?16:0,-1/0,1/0),r||T(I++,0,0,C,0,a,1,-1/0,1/0);I>0;){var O=(I-=1)*b,D=w[O],R=w[O+1],F=w[O+2],B=w[O+3],j=w[O+4],N=w[O+5],U=I*_,V=k[U],q=k[U+1],$=1&N,H=!!(16&N),W=u,G=M,Y=E,Z=L;if($&&(W=E,G=L,Y=u,Z=M),!(2&N&&R>=(F=g(t,D,R,F,W,G,q)))&&!(4&N&&(R=y(t,D,R,F,W,G,V))>=F)){var X=F-R,K=j-B;if(H){if(t*X*(X+K)<p){if(void 0!==(P=l.scanComplete(t,D,e,R,F,W,G,B,j,Y,Z)))return P;continue}}else{if(t*Math.min(X,K)<h){if(void 0!==(P=o(t,D,e,$,R,F,W,G,B,j,Y,Z)))return P;continue}if(t*X*K<d){if(void 0!==(P=l.scanBipartite(t,D,e,$,R,F,W,G,B,j,Y,Z)))return P;continue}}var J=f(t,D,R,F,W,G,V,q);if(R<J)if(t*(J-R)<h){if(void 0!==(P=s(t,D+1,e,R,J,W,G,B,j,Y,Z)))return P}else if(D===t-2){if(void 0!==(P=$?l.sweepBipartite(t,e,B,j,Y,Z,R,J,W,G):l.sweepBipartite(t,e,R,J,W,G,B,j,Y,Z)))return P}else T(I++,D+1,R,J,B,j,$,-1/0,1/0),T(I++,D+1,B,j,R,J,1^$,-1/0,1/0);if(J<F){var Q=c(t,D,B,j,Y,Z),tt=Y[z*Q+D],et=m(t,D,Q,j,Y,Z,tt);if(et<j&&T(I++,D,J,F,et,j,(4|$)+(H?16:0),tt,q),B<Q&&T(I++,D,J,F,B,Q,(2|$)+(H?16:0),V,tt),Q+1===et){if(void 0!==(P=H?A(t,D,e,J,F,W,G,Q,Y,Z[Q]):S(t,D,e,$,J,F,W,G,Q,Y,Z[Q])))return P}else if(Q<et){var rt;if(H){if(J<(rt=v(t,D,J,F,W,G,tt))){var nt=m(t,D,J,rt,W,G,tt);if(D===t-2){if(J<nt&&void 0!==(P=l.sweepComplete(t,e,J,nt,W,G,Q,et,Y,Z)))return P;if(nt<rt&&void 0!==(P=l.sweepBipartite(t,e,nt,rt,W,G,Q,et,Y,Z)))return P}else J<nt&&T(I++,D+1,J,nt,Q,et,16,-1/0,1/0),nt<rt&&(T(I++,D+1,nt,rt,Q,et,0,-1/0,1/0),T(I++,D+1,Q,et,nt,rt,1,-1/0,1/0))}}else J<(rt=$?x(t,D,J,F,W,G,tt):v(t,D,J,F,W,G,tt))&&(D===t-2?P=$?l.sweepBipartite(t,e,Q,et,Y,Z,J,rt,W,G):l.sweepBipartite(t,e,J,rt,W,G,Q,et,Y,Z):(T(I++,D+1,J,rt,Q,et,$,-1/0,1/0),T(I++,D+1,Q,et,J,rt,1^$,-1/0,1/0)))}}}}};var n=r(1888),i=r(8828),a=r(2455),o=a.partial,s=a.full,l=r(855),c=r(3545),u=r(8105),h=128,d=1<<22,p=1<<22,f=u("!(lo>=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo<p0"),y=u("hi<=p0"),v=u("lo<=p0&&p0<=hi"),x=u("lo<p0&&p0<=hi"),b=6,_=2,w=n.mallocInt32(1024),k=n.mallocDouble(1024);function T(t,e,r,n,i,a,o,s,l){var c=b*t;w[c]=e,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=_*t;k[u]=s,k[u+1]=l}function S(t,e,r,n,i,a,o,s,l,c,u){var h=2*t,d=l*h,p=c[d+e];t:for(var f=i,m=i*h;f<a;++f,m+=h){var g=o[m+e],y=o[m+e+t];if(!(p<g||y<p)&&(!n||p!==g)){for(var v,x=s[f],b=e+1;b<t;++b){g=o[m+b],y=o[m+b+t];var _=c[d+b],w=c[d+b+t];if(y<_||w<g)continue t}if(void 0!==(v=n?r(u,x):r(x,u)))return v}}}function A(t,e,r,n,i,a,o,s,l,c){var u=2*t,h=s*u,d=l[h+e];t:for(var p=n,f=n*u;p<i;++p,f+=u){var m=o[p];if(m!==c){var g=a[f+e],y=a[f+e+t];if(!(d<g||y<d)){for(var v=e+1;v<t;++v){g=a[f+v],y=a[f+v+t];var x=l[h+v],b=l[h+v+t];if(y<x||b<g)continue t}var _=r(m,c);if(void 0!==_)return _}}}}},3545:function(t,e,r){t.exports=function(t,e,r,o,s,l){if(o<=r+1)return r;for(var c=r,u=o,h=o+r>>>1,d=2*t,p=h,f=s[d*h+e];c<u;){if(u-c<i){a(t,e,c,u,s,l),f=s[d*h+e];break}var m=u-c,g=Math.random()*m+c|0,y=s[d*g+e],v=Math.random()*m+c|0,x=s[d*v+e],b=Math.random()*m+c|0,_=s[d*b+e];y<=x?_>=x?(p=v,f=x):y>=_?(p=g,f=y):(p=b,f=_):x>=_?(p=v,f=x):_>=y?(p=g,f=y):(p=b,f=_);for(var w=d*(u-1),k=d*p,T=0;T<d;++T,++w,++k){var S=s[w];s[w]=s[k],s[k]=S}var A=l[u-1];for(l[u-1]=l[p],l[p]=A,w=d*(u-1),k=d*(p=n(t,e,c,u-1,s,l,f)),T=0;T<d;++T,++w,++k)S=s[w],s[w]=s[k],s[k]=S;if(A=l[u-1],l[u-1]=l[p],l[p]=A,h<p){for(u=p-1;c<u&&s[d*(u-1)+e]===f;)u-=1;u+=1}else{if(!(p<h))break;for(c=p+1;c<u&&s[d*c+e]===f;)c+=1}}return n(t,e,r,h,s,l,s[d*h+e])};var n=r(8105)("lo<p0"),i=8;function a(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var c=i[s],u=l,h=o*(l-1);u>r&&i[h+e]>c;--u,h-=o){for(var d=h,p=h+o,f=0;f<o;++f,++d,++p){var m=i[d];i[d]=i[p],i[p]=m}var g=a[u];a[u]=a[u-1],a[u-1]=g}}},8105:function(t){t.exports=function(t){return e[t]};var e={"lo===p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,d=r;n>d;++d,l+=s)if(i[l+h]===o)if(u===d)u+=1,c+=s;else{for(var p=0;s>p;++p){var f=i[l+p];i[l+p]=i[c],i[c++]=f}var m=a[d];a[d]=a[u],a[u++]=m}return u},"lo<p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,d=r;n>d;++d,l+=s)if(i[l+h]<o)if(u===d)u+=1,c+=s;else{for(var p=0;s>p;++p){var f=i[l+p];i[l+p]=i[c],i[c++]=f}var m=a[d];a[d]=a[u],a[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,d=r;n>d;++d,l+=s)if(i[l+h]<=o)if(u===d)u+=1,c+=s;else{for(var p=0;s>p;++p){var f=i[l+p];i[l+p]=i[c],i[c++]=f}var m=a[d];a[d]=a[u],a[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,d=r;n>d;++d,l+=s)if(i[l+h]<=o)if(u===d)u+=1,c+=s;else{for(var p=0;s>p;++p){var f=i[l+p];i[l+p]=i[c],i[c++]=f}var m=a[d];a[d]=a[u],a[u++]=m}return u},"lo<p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,d=t+e,p=r;n>p;++p,l+=s){var f=i[l+h],m=i[l+d];if(f<o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,d=t+e,p=r;n>p;++p,l+=s){var f=i[l+h],m=i[l+d];if(f<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,d=e,p=t+e,f=r;n>f;++f,c+=l){var m=i[c+d],g=i[c+p];if(!(m>=o)&&!(s>=g))if(h===f)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[f];a[f]=a[h],a[h++]=x}}return h}}},4192:function(t){t.exports=function(t,n){n<=4*e?r(0,n-1,t):c(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function n(t,e,r){e*=2;var n=r[t*=2],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function i(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function a(t,e,r,n){e*=2,r*=2;var i=n[t*=2],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function o(t,e,r,n,i){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function s(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function l(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}function c(t,u,h){var d=(u-t+1)/6|0,p=t+d,f=u-d,m=t+u>>1,g=m-d,y=m+d,v=p,x=g,b=m,_=y,w=f,k=t+1,T=u-1,S=0;s(v,x,h)&&(S=v,v=x,x=S),s(_,w,h)&&(S=_,_=w,w=S),s(v,b,h)&&(S=v,v=b,b=S),s(x,b,h)&&(S=x,x=b,b=S),s(v,_,h)&&(S=v,v=_,_=S),s(b,_,h)&&(S=b,b=_,_=S),s(x,w,h)&&(S=x,x=w,w=S),s(x,b,h)&&(S=x,x=b,b=S),s(_,w,h)&&(S=_,_=w,w=S);for(var A=h[2*x],M=h[2*x+1],C=h[2*_],E=h[2*_+1],L=2*v,P=2*b,I=2*w,z=2*p,O=2*m,D=2*f,R=0;R<2;++R){var F=h[L+R],B=h[P+R],j=h[I+R];h[z+R]=F,h[O+R]=B,h[D+R]=j}i(g,t,h),i(y,u,h);for(var N=k;N<=T;++N)if(l(N,A,M,h))N!==k&&n(N,k,h),++k;else if(!l(N,C,E,h))for(;;){if(l(T,C,E,h)){l(T,A,M,h)?(a(N,k,T,h),++k,--T):(n(N,T,h),--T);break}if(--T<N)break}o(t,k-1,A,M,h),o(u,T+1,C,E,h),k-2-t<=e?r(t,k-2,h):c(t,k-2,h),u-(T+2)<=e?r(T+2,u,h):c(T+2,u,h),T-k<=e?r(k,T,h):c(k,T,h)}},855:function(t,e,r){t.exports={init:function(t){var e=i.nextPow2(t);l.length<e&&(n.free(l),l=n.mallocInt32(e)),c.length<e&&(n.free(c),c=n.mallocInt32(e)),u.length<e&&(n.free(u),u=n.mallocInt32(e)),h.length<e&&(n.free(h),h=n.mallocInt32(e)),d.length<e&&(n.free(d),d=n.mallocInt32(e)),p.length<e&&(n.free(p),p=n.mallocInt32(e));var r=8*e;f.length<r&&(n.free(f),f=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,s,d,p,y,v){for(var x=0,b=2*t,_=t-1,w=b-1,k=r;k<n;++k){var T=s[k],S=b*k;f[x++]=i[S+_],f[x++]=-(T+1),f[x++]=i[S+w],f[x++]=T}for(k=d;k<p;++k){T=v[k]+o;var A=b*k;f[x++]=y[A+_],f[x++]=-T,f[x++]=y[A+w],f[x++]=T}var M=x>>>1;a(f,M);var C=0,E=0;for(k=0;k<M;++k){var L=0|f[2*k+1];if(L>=o)m(u,h,E--,L=L-o|0);else if(L>=0)m(l,c,C--,L);else if(L<=-o){L=-L-o|0;for(var P=0;P<C;++P)if(void 0!==(I=e(l[P],L)))return I;g(u,h,E++,L)}else{for(L=-L-1|0,P=0;P<E;++P){var I;if(void 0!==(I=e(L,u[P])))return I}g(l,c,C++,L)}}},sweepComplete:function(t,e,r,n,i,o,s,y,v,x){for(var b=0,_=2*t,w=t-1,k=_-1,T=r;T<n;++T){var S=o[T]+1<<1,A=_*T;f[b++]=i[A+w],f[b++]=-S,f[b++]=i[A+k],f[b++]=S}for(T=s;T<y;++T){S=x[T]+1<<1;var M=_*T;f[b++]=v[M+w],f[b++]=1|-S,f[b++]=v[M+k],f[b++]=1|S}var C=b>>>1;a(f,C);var E=0,L=0,P=0;for(T=0;T<C;++T){var I=0|f[2*T+1],z=1&I;if(T<C-1&&I>>1===f[2*T+3]>>1&&(z=2,T+=1),I<0){for(var O=-(I>>1)-1,D=0;D<P;++D)if(void 0!==(R=e(d[D],O)))return R;if(0!==z)for(D=0;D<E;++D)if(void 0!==(R=e(l[D],O)))return R;if(1!==z)for(D=0;D<L;++D){var R;if(void 0!==(R=e(u[D],O)))return R}0===z?g(l,c,E++,O):1===z?g(u,h,L++,O):2===z&&g(d,p,P++,O)}else O=(I>>1)-1,0===z?m(l,c,E--,O):1===z?m(u,h,L--,O):2===z&&m(d,p,P--,O)}},scanBipartite:function(t,e,r,n,i,s,u,h,d,p,y,v){var x=0,b=2*t,_=e,w=e+t,k=1,T=1;n?T=o:k=o;for(var S=i;S<s;++S){var A=S+k,M=b*S;f[x++]=u[M+_],f[x++]=-A,f[x++]=u[M+w],f[x++]=A}for(S=d;S<p;++S){A=S+T;var C=b*S;f[x++]=y[C+_],f[x++]=-A}var E=x>>>1;a(f,E);var L=0;for(S=0;S<E;++S){var P=0|f[2*S+1];if(P<0){var I=!1;if((A=-P)>=o?(I=!n,A-=o):(I=!!n,A-=1),I)g(l,c,L++,A);else{var z=v[A],O=b*A,D=y[O+e+1],R=y[O+e+1+t];t:for(var F=0;F<L;++F){var B=l[F],j=b*B;if(!(R<u[j+e+1]||u[j+e+1+t]<D)){for(var N=e+2;N<t;++N)if(y[O+N+t]<u[j+N]||u[j+N+t]<y[O+N])continue t;var U,V=h[B];if(void 0!==(U=n?r(z,V):r(V,z)))return U}}}}else m(l,c,L--,P-k)}},scanComplete:function(t,e,r,n,i,s,c,u,h,d,p){for(var m=0,g=2*t,y=e,v=e+t,x=n;x<i;++x){var b=x+o,_=g*x;f[m++]=s[_+y],f[m++]=-b,f[m++]=s[_+v],f[m++]=b}for(x=u;x<h;++x){b=x+1;var w=g*x;f[m++]=d[w+y],f[m++]=-b}var k=m>>>1;a(f,k);var T=0;for(x=0;x<k;++x){var S=0|f[2*x+1];if(S<0)if((b=-S)>=o)l[T++]=b-o;else{var A=p[b-=1],M=g*b,C=d[M+e+1],E=d[M+e+1+t];t:for(var L=0;L<T;++L){var P=l[L],I=c[P];if(I===A)break;var z=g*P;if(!(E<s[z+e+1]||s[z+e+1+t]<C)){for(var O=e+2;O<t;++O)if(d[M+O+t]<s[z+O]||s[z+O+t]<d[M+O])continue t;var D=r(I,A);if(void 0!==D)return D}}}else{for(b=S-o,L=T-1;L>=0;--L)if(l[L]===b){for(O=L+1;O<T;++O)l[O-1]=l[O];break}--T}}}};var n=r(1888),i=r(8828),a=r(4192),o=1<<28,s=1024,l=n.mallocInt32(s),c=n.mallocInt32(s),u=n.mallocInt32(s),h=n.mallocInt32(s),d=n.mallocInt32(s),p=n.mallocInt32(s),f=n.mallocDouble(8192);function m(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function g(t,e,r,n){t[r]=n,e[n]=r}},2538:function(t,e,r){var n=r(8902),i=r(5542),a=r(2272),o=r(5023);function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}t.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),d=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!d||0===t.length)return[];var f=n(t,e);if(u||h!==d||p){for(var m=i(t.length,function(t){return t.map(s).sort(l)}(e)),g=0;g<f.length;++g){var y=f[g];m.addTriangle(y[0],y[1],y[2])}return u&&a(t,m),d?h?p?o(m,0,p):m.cells():o(m,1,p):o(m,-1)}return f}},2272:function(t,e,r){var n=r(2646)[4];function i(t,e,r,i,a,o){var s=e.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}e.isConstraint(i,a)||n(t[i],t[a],t[o],t[s])<0&&r.push(i,a)}}r(2478),t.exports=function(t,e){for(var r=[],a=t.length,o=e.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2)if(!((p=l[c])<s)&&!e.isConstraint(s,p)){for(var u=l[c-1],h=-1,d=1;d<l.length;d+=2)if(l[d-1]===p){h=l[d];break}h<0||n(t[s],t[p],t[u],t[h])<0&&r.push(s,p)}for(;r.length>0;){for(var p=r.pop(),f=(u=-1,h=-1,l=o[s=r.pop()],1);f<l.length;f+=2){var m=l[f-1],g=l[f];m===p?h=g:g===p&&(u=m)}u<0||h<0||n(t[s],t[p],t[u],t[h])>=0||(e.flip(s,p),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,p,u),i(t,e,r,p,u,h))}}},5023:function(t,e,r){var n=r(2478);function i(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,o=0;o<n;++o){var s=(y=r[o])[0],l=y[1],c=y[2];l<c?l<s&&(y[0]=l,y[1]=c,y[2]=s):c<s&&(y[0]=c,y[1]=s,y[2]=l)}r.sort(a);var u=new Array(n);for(o=0;o<u.length;++o)u[o]=0;var h=[],d=[],p=new Array(3*n),f=new Array(3*n),m=null;e&&(m=[]);var g=new i(r,p,f,u,h,d,m);for(o=0;o<n;++o)for(var y=r[o],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var x=p[3*o+v]=g.locate(l,s,t.opposite(l,s)),b=f[3*o+v]=t.isConstraint(s,l);x<0&&(b?d.push(o):(h.push(o),u[o]=1),e&&m.push([l,s,-1]))}return g}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var o=1,s=n.active,l=n.next,c=n.flags,u=n.cells,h=n.constraint,d=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-o){c[p]=o,u[p];for(var f=0;f<3;++f){var m=d[3*p+f];m>=0&&0===c[m]&&(h[3*p+f]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var y=function(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}(u,c,e);return r?y.concat(n.boundary):y},i.prototype.locate=function(){var t=[0,0,0];return function(e,r,i){var o=e,s=r,l=i;return r<i?r<e&&(o=r,s=i,l=e):i<e&&(o=i,s=e,l=r),o<0?-1:(t[0]=o,t[1]=s,t[2]=l,n.eq(this.cells,t,a))}}()},8902:function(t,e,r){var n=r(2478),i=r(3250)[3];function a(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(0!==t.type&&(r=i(t.a,t.b,e.b))?r:t.idx-e.idx)}function l(t,e){return i(t.a,t.b,e)}function c(t,e,r,a,o){for(var s=n.lt(e,a,l),c=n.gt(e,a,l),u=s;u<c;++u){for(var h=e[u],d=h.lowerIds,p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)>0;)t.push([d[p-1],d[p-2],o]),p-=1;d.length=p,d.push(o);var f=h.upperIds;for(p=f.length;p>1&&i(r[f[p-2]],r[f[p-1]],a)<0;)t.push([f[p-2],f[p-1],o]),p-=1;f.length=p,f.push(o)}}function u(t,e){var r;return(r=t.a[0]<e.a[0]?i(t.a,t.b,e.a):i(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?i(t.a,t.b,e.b):i(e.b,e.a,t.b))||t.idx-e.idx}function h(t,e,r){var i=n.le(t,r,u),o=t[i],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(i+1,0,new a(r.a,r.b,r.idx,[l],s))}function d(t,e,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,u),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}t.exports=function(t,e){for(var r=t.length,n=e.length,i=[],l=0;l<r;++l)i.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var u=e[l],p=t[u[0]],f=t[u[1]];p[0]<f[0]?i.push(new o(p,f,2,l),new o(f,p,1,l)):p[0]>f[0]&&i.push(new o(f,p,2,l),new o(p,f,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l<v;++l){var x=i[l],b=x.type;0===b?c(y,g,t,x.a,x.idx):2===b?h(g,0,x):d(g,0,x)}return y}},5542:function(t,e,r){var n=r(2478);function i(t,e){this.stars=t,this.edges=e}t.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new i(r,e)};var a=i.prototype;function o(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}a.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,i){return t[0]=Math.min(r,i),t[1]=Math.max(r,i),n.eq(this.edges,t,e)>=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},a.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},a.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},a.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},2419:function(t){t.exports=function(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}},3628:function(t,e,r){var n=r(1338),i=r(727);function a(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function o(t){var e=t.length;if(0===e)return[];t[0].length;var r=n([t.length+1,t.length+1],1),o=n([t.length+1],1);r[e][e]=0;for(var s=0;s<e;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(t[s],t[l]);o[s]=a(t[s],t[s])}var c=i(r,o),u=0,h=c[e+1];for(s=0;s<h.length;++s)u+=h[s];var d=new Array(e);for(s=0;s<e;++s){h=c[s];var p=0;for(l=0;l<h.length;++l)p+=h[l];d[s]=p/u}return d}function s(t){if(0===t.length)return[];for(var e=t[0].length,r=n([e]),i=o(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*i[a];return r}s.barycenetric=o,t.exports=s},6037:function(t,e,r){t.exports=function(t){for(var e=n(t),r=0,i=0;i<t.length;++i)for(var a=t[i],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)};var n=r(3628)},332:function(t,e,r){t.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}for(var s=function(t,e,r){var n=f(t,[],p(t));return y(e,n,r),!!n}(t,e,!!r);v(t,e,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,a=0;a<e.length;++a)o=e[a],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=r(1755),i=r(6867),a=r(1125),o=r(7842),s=r(1318),l=r(946),c=r(5838),u=r(1278),h=r(3637);function d(t){var e=l(t);return[u(e,-1/0),u(e,1/0)]}function p(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return e}function f(t,e,r){for(var a=e.length,o=new n(a),s=[],l=0;l<e.length;++l){var c=e[l],h=d(c[0]),p=d(c[1]);s.push([u(h[0],-1/0),u(p[0],-1/0),u(h[1],1/0),u(p[1],1/0)])}i(s,(function(t,e){o.link(t,e)}));var f=!0,m=new Array(a);for(l=0;l<a;++l)(y=o.find(l))!==l&&(f=!1,t[y]=[Math.min(t[l][0],t[y][0]),Math.min(t[l][1],t[y][1])]);if(f)return null;var g=0;for(l=0;l<a;++l){var y;(y=o.find(l))===l?(m[l]=g,t[g++]=t[l]):m[l]=-1}for(t.length=g,l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(t,e){return t[0]-e[0]||t[1]-e[1]}function g(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=e[(o=t[n])[0]],a=e[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<t.length;++n){var o;i=(o=t[n])[0],a=o[1],o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?t.sort(g):t.sort(m);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],c=t[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(t[s++]=c)}t.length=s}}function v(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return r}(t,e),d=function(t,e,r){var n=[];return i(r,(function(r,i){var o=e[r],s=e[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],c=t[o[1]],u=t[s[0]],h=t[s[1]];a(l,c,u,h)&&n.push([r,i])}})),n}(t,e,n),m=p(t),g=function(t,e,r,n){var o=[];return i(r,n,(function(r,n){var i=e[r];if(i[0]!==n&&i[1]!==n){var s=t[n],l=t[i[0]],c=t[i[1]];a(l,c,s,s)&&o.push([r,n])}})),o}(t,e,n,m),v=function(t,e,r,n,i){var a,u,d=t.map((function(t){return[o(t[0]),o(t[1])]}));for(a=0;a<r.length;++a){var p=r[a];u=p[0];var f=p[1],m=e[u],g=e[f],y=h(c(t[m[0]]),c(t[m[1]]),c(t[g[0]]),c(t[g[1]]));if(y){var v=t.length;t.push([l(y[0]),l(y[1])]),d.push(y),n.push([u,v],[f,v])}}for(n.sort((function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=d[t[1]],n=d[e[1]];return s(r[0],n[0])||s(r[1],n[1])})),a=n.length-1;a>=0;--a){var x=e[u=(M=n[a])[0]],b=x[0],_=x[1],w=t[b],k=t[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var S,A=x[1]=M[1];for(i&&(S=x[2]);a>0&&n[a-1][0]===u;){var M,C=(M=n[--a])[1];i?e.push([A,C,S]):e.push([A,C]),A=C}i?e.push([A,_,S]):e.push([A,_])}return d}(t,e,d,g,r),x=f(t,v);return y(e,x,r),!!x||d.length>0||g.length>0}},3637:function(t,e,r){t.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),d=u(a,h);if(0===o(d))return null;var p=s(t,r),f=u(h,p),m=i(f,d),g=c(a,m);return l(t,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,c,u,h,d,p,f,m;if(t||(t={}),p=(t.nshades||72)-1,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"===typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);f=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"===typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map((function(t){return Math.round(t.index*p)})),f[0]=Math.min(Math.max(f[0],0),1),f[1]=Math.min(Math.max(f[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=f[0]+(f[1]-f[0])*r),n})),y=[];for(m=0;m<e.length-1;++m){c=e[m+1]-e[m],r=g[m],l=g[m+1];for(var v=0;v<c;v++){var x=v/c;y.push([Math.round(i(r[0],l[0],x)),Math.round(i(r[1],l[1],x)),Math.round(i(r[2],l[2],x)),i(r[3],l[3],x)])}}return y.push(u[u.length-1].rgb.concat(f[1])),"hex"===d?y=y.map(o):"rgbaString"===d?y=y.map(s):"float"===d&&(y=y.map(a)),y}},3140:function(t,e,r){t.exports=function(t,e,r,a){var o=n(e,r,a);if(0===o){var s=i(n(t,e,r)),c=i(n(t,e,a));if(s===c){if(0===s){var u=l(t,e,r);return u===l(t,e,a)?0:u?1:-1}return 0}return 0===c?s>0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(t){t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],o)-e(c+n[2],s);case 4:var u=t[0],h=t[1],d=t[2],p=t[3],f=n[0],m=n[1],g=n[2],y=n[3];return u+h+d+p-(f+m+g+y)||e(u,h,d,p)-e(f,m,g,y,f)||e(u+h,u+d,u+p,h+d,h+p,d+p)-e(f+m,f+g,f+y,m+g,m+y,g+y)||e(u+h+d,u+h+p,u+d+p,h+d+p)-e(f+m+g,f+m+y,f+g+y,m+g+y);default:for(var v=t.slice().sort(r),x=n.slice().sort(r),b=0;b<i;++b)if(a=v[b]-x[b])return a;return 0}};var e=Math.min;function r(t,e){return t-e}},3788:function(t,e,r){var n=r(8507),i=r(2419);t.exports=function(t,e){return n(t,e)||i(t)-i(e)}},7352:function(t,e,r){var n=r(5721),i=r(4750),a=r(2690);t.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?n(t):2===r?i(t):a(t,r)}},5721:function(t){t.exports=function(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}},4750:function(t,e,r){t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];i[o]=[a,s],a=s}return i};var n=r(3090)},2690:function(t,e,r){t.exports=function(t,e){try{return n(t,!0)}catch(o){var r=i(t);if(r.length<=e)return[];var a=function(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];var a=e.length;for(i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}(t,r);return function(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),d=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+h*r[p]+d*n[p];return a}return c*t+u*e+h*r+d*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},7642:function(t,e,r){var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}t.exports=function(t,e){var r=t.length;if(0===r)return[];var s=t[0].length;if(s<1)return[];if(1===s)return function(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map((function(t,e){return[t[0],e]}));n.sort((function(t,e){return t[0]-e[0]}));for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}(r,t,e);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var h=t[u],d=new Array(s+1),p=0,f=0;f<s;++f){var m=h[f];d[f]=m,p+=m*m}d[s]=p,l[u]=new a(d,u),c=Math.max(p,c)}i(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;for(x[s]=v,g[0]=x.slice(),y[0]=-1,u=0;u<=s;++u)(d=x.slice())[u]=1,g[u+1]=d,y[u+1]=-1;for(u=0;u<r;++u){var b=l[u];g[u+s+1]=b.point,y[u+s+1]=b.index}var _=n(g,!1);if(_=e?_.filter((function(t){for(var e=0,r=0;r<=s;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(u=0;u<_.length;++u)d=(b=_[u])[0],b[0]=b[1],b[1]=d;return _}},2361:function(t){var e=!1;if("undefined"!==typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);if(r[0]=1,e=!0,1072693248===n[1]){let e=function(t,e){return n[0]=t,n[1]=e,r[0]},i=function(t){return r[0]=t,n[0]},a=function(t){return r[0]=t,n[1]};t.exports=function(t){return r[0]=t,[n[0],n[1]]},t.exports.pack=e,t.exports.lo=i,t.exports.hi=a}else if(1072693248===n[0]){let e=function(t,e){return n[1]=t,n[0]=e,r[0]},i=function(t){return r[0]=t,n[1]},a=function(t){return r[0]=t,n[0]};t.exports=function(t){return r[0]=t,[n[1],n[0]]},t.exports.pack=e,t.exports.lo=i,t.exports.hi=a}else e=!1}if(!e){let e=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},r=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},n=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);t.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=e,t.exports.lo=r,t.exports.hi=n}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=e(t,r,n+1);return o}t.exports=function(t,r){switch("undefined"===typeof r&&(r=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,r);break;case"object":if("number"===typeof t.length)return e(t,r,0)}return[]}},3134:function(t,e,r){t.exports=function(t,e){var r=t.length;if("number"!==typeof e){e=0;for(var i=0;i<r;++i){var a=t[i];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(i=0;i<e;++i)o[i]=[];for(i=0;i<r;++i)o[(a=t[i])[0]].push(a[1]),o[a[1]].push(a[0]);for(var s=0;s<e;++s)n(o[s],(function(t,e){return t-e}));return o};var n=r(1682)},5033:function(t){t.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},9215:function(t,e,r){t.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"===typeof t?new o(n=l(t),n,0):new o(t,l(t.length),0);case 2:var n;if("number"===typeof e)return new o(t,n=l(t.length),+e);r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=r(4769),i=r(2478);function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}var s=o.prototype;function l(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}s.flush=function(t){var e=i.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},s.curve=function(t){var e=this._time,r=e.length,o=i.le(e,t),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,h=this.bounds;if(o<0)for(var d=u-1,p=0;p<u;++p,--d)s[p]=l[d];else if(o>=r-1){d=l.length-1;var f=t-e[r-1];for(p=0;p<u;++p,--d)s[p]=l[d]+f*c[d]}else{d=u*(o+1)-1;var m=e[o],g=e[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],x=this._scratch[3],b=this._scratch[4],_=!0;for(p=0;p<u;++p,--d)y[p]=l[d],x[p]=c[d]*g,v[p]=l[d+u],b[p]=c[d+u]*g,_=_&&y[p]===v[p]&&x[p]===b[p]&&0===x[p];if(_)for(p=0;p<u;++p)s[p]=y[p];else n(y,x,v,b,(t-m)/g,s)}var w=h[0],k=h[1];for(p=0;p<u;++p)s[p]=a(w[p],k[p],s[p]);return s},s.dcurve=function(t){var e=this._time,r=e.length,a=i.le(e,t),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,h=(e[r-1],0);h<c;++h,--u)o[h]=l[u];else{u=c*(a+1)-1;var d=e[a],p=e[a+1]-d||1,f=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(h=0;h<c;++h,--u)f[h]=s[u],g[h]=l[u]*p,m[h]=s[u+c],y[h]=l[u+c]*p,v=v&&f[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<c;++h)o[h]=0;else for(n.derivative(f,g,m,y,(t-d)/p,o),h=0;h<c;++h)o[h]/=p}return o},s.lastT=function(){var t=this._time;return t[t.length-1]},s.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(e,t);for(var u=0;u<2;++u)for(var h=0;h<r;++h)n.push(n[o++]),i.push(0);for(this._time.push(t),h=r;h>0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=t-e,l=this.bounds,c=l[0],u=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var d=r;d>0;--d){var p=a(c[d-1],u[d-1],arguments[d]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(t);for(var l=e;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var d=r;d>0;--d){var p=arguments[d];n.push(a(l[d-1],c[d-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(t){function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||p,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(t,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var d=l[h-1];if(s=l[h],1===d._color||1===s._color)break;var p=l[h-2];if(p.left===d)if(d.left===s){if(!(f=p.right)||0!==f._color){p._color=0,p.left=d.right,d._color=1,d.right=p,l[h-2]=d,l[h-1]=s,i(p),i(d),h>=3&&((m=l[h-3]).left===p?m.left=d:m.right=d);break}d._color=1,p.right=n(1,f),p._color=0,h-=1}else{if(!(f=p.right)||0!==f._color){d.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=d,s.right=p,l[h-2]=s,l[h-1]=d,i(p),i(d),i(s),h>=3&&((m=l[h-3]).left===p?m.left=s:m.right=s);break}d._color=1,p.right=n(1,f),p._color=0,h-=1}else if(d.right===s){if(!(f=p.left)||0!==f._color){p._color=0,p.right=d.left,d._color=1,d.left=p,l[h-2]=d,l[h-1]=s,i(p),i(d),h>=3&&((m=l[h-3]).right===p?m.right=d:m.left=d);break}d._color=1,p.left=n(1,f),p._color=0,h-=1}else{var f;if(!(f=p.left)||0!==f._color){var m;d.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=d,s.left=p,l[h-2]=s,l[h-1]=d,i(p),i(d),i(s),h>=3&&((m=l[h-3]).right===p?m.right=s:m.left=s);break}d._color=1,p.left=n(1,f),p._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),o.at=function(t){if(t<0)return new u(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new u(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new u(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return t<e?-1:t>e?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l<o.length;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(s.left||s.right){for(s.left?d(s,s.left):s.right&&d(s,s.right),s._color=1,l=0;l<o.length-1;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(1===o.length)return new a(this.tree._compare,null);for(l=0;l<o.length;++l)o[l]._count--;var p=o[o.length-2];return function(t){for(var e,a,o,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).left===a?c.left=s:c.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),t[l-1]=o,t[l]=a,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if((o=a.left).left&&0===o.left._color)return s=(o=a.left=r(o)).left=r(o.left),a.left=o.right,o.right=a,o.left=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).right===a?c.right=s:c.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.left=o),t[l-1]=o,t[l]=a,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}(o),p.left===s?p.left=null:p.right=null,new a(this.tree._compare,o[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){t.exports=function(t,e){var r=new p(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(t)}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var f=p.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,d=!1;if("bounds"in t)for(var p=t.bounds,f=0;f<2;++f)for(var m=0;m<3;++m)p[f][m]!==this.bounds[f][m]&&(d=!0),this.bounds[f][m]=p[f][m];if("ticks"in t)for(r=t.ticks,u=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else a("tickSpacing")&&(this.autoTicks=!0,d=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),d=!0,u=!0,this._firstInit=!1),d&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(f=0;f<3;++f)r[f].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=a,d=s,p=o,f=l;c&1<<u&&(h=s,d=a,p=l,f=o),h[u]=r[0][u],d[u]=r[1][u],i[u]>0?(p[u]=-1,f[u]=0):(p[u]=0,f[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var b=[0,0,0],_=[0,0,0],w=[0,0,0];f.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,p=n[12],f=n[13],m=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*f+i[11]*m+i[15]*k)/e.drawingBufferHeight,S=0;S<3;++S)this.lastCubeProps.cubeEdges[S]=u[S],this.lastCubeProps.axis[S]=h[S];var A=g;for(S=0;S<3;++S)y(g[S],S,this.bounds,u,h);e=this.gl;var M,C,E,L=v;for(S=0;S<3;++S)this.backgroundEnable[S]?L[S]=h[S]:L[S]=0;for(this._background.draw(r,n,i,a,L,this.backgroundColor),this._lines.bind(r,n,i,this),S=0;S<3;++S){var P=[0,0,0];h[S]>0?P[S]=a[1][S]:P[S]=a[0][S];for(var I=0;I<2;++I){var z=(S+1+I)%3,O=(S+1+(1^I))%3;this.gridEnable[z]&&this._lines.drawGrid(z,O,this.bounds,P,this.gridColor[z],this.gridWidth[z]*this.pixelRatio)}for(I=0;I<2;++I)z=(S+1+I)%3,O=(S+1+(1^I))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(z,O,this.bounds,P,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(S=0;S<3;++S){this.lineEnable[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].primalOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio),this.lineMirror[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].mirrorOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio);var D=d(b,A[S].primalMinor),R=d(_,A[S].mirrorMinor),F=this.lineTickLength;for(I=0;I<3;++I){var B=T/r[5*I];D[I]*=F[I]*B,R[I]*=F[I]*B}this.lineTickEnable[S]&&this._lines.drawAxisTicks(S,A[S].primalOffset,D,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio),this.lineTickMirror[S]&&this._lines.drawAxisTicks(S,A[S].mirrorOffset,R,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio)}function j(t){(E=[0,0,0])[t]=1}function N(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?j(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&j(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),S=0;S<3;++S){var U=A[S].primalMinor,V=A[S].mirrorMinor,q=d(w,A[S].primalOffset);for(I=0;I<3;++I)this.lineTickEnable[S]&&(q[I]+=T*U[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);var $=[0,0,0];if($[S]=1,this.tickEnable[S]){for(-3600===this.tickAngle[S]?(this.tickAngle[S]=0,this.tickAlign[S]="auto"):this.tickAlign[S]=-1,C=1,"auto"===(M=[this.tickAlign[S],.5,C])[0]?M[0]=0:M[0]=parseInt(""+M[0]),E=[0,0,0],N(S,U,V),I=0;I<3;++I)q[I]+=T*U[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(S,this.tickSize[S],this.tickAngle[S],q,this.tickColor[S],$,E,M)}if(this.labelEnable[S]){for(C=0,E=[0,0,0],this.labels[S].length>4&&(j(S),C=1),"auto"===(M=[this.labelAlign[S],.5,C])[0]?M[0]=0:M[0]=parseInt(""+M[0]),I=0;I<3;++I)q[I]+=T*U[I]*this.labelPad[I]/r[5*I];q[S]+=.5*(a[0][S]+a[1][S]),this._text.drawLabel(S,this.labelSize[S],this.labelAngle[S],q,this.labelColor[S],[0,0,0],E,M)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],d=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,d[l]=p;for(var f=-1;f<=1;f+=2){h[c]=f;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],d[0],d[1],d[2]),s+=1}var g=c;c=u,u=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,y,x,b)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){t.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],d(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)c[x][T]=l[x][T]/k;p&&(c[x][2]*=-1),k<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var S=0;S<3;++S){for(var A=(S+2)%3,M=(S+1)%3,C=-1,E=-1,L=0;L<2;++L){var P=(z=L<<S)+(L<<A)+(1-L<<M),I=z+(1-L<<A)+(L<<M);o(c[z],c[P],c[I],h)<0||(L?C=1:E=1)}if(C<0||E<0)E>C&&(w|=1<<S);else{for(L=0;L<2;++L){P=(z=L<<S)+(L<<A)+(1-L<<M),I=z+(1-L<<A)+(L<<M);var z,O=f([l[z],l[P],l[I],l[z+(1<<A)+(1<<M)]]);L?C=O:E=O}E>C&&(w|=1<<S)}}}var D=7^w,R=-1;for(x=0;x<8;++x)x!==w&&x!==D&&(R<0||c[R][1]>c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(j=R^1<<x)!==w&&j!==D&&(F<0&&(F=j),(M=c[j])[0]<c[F][0]&&(F=j));var B=-1;for(x=0;x<3;++x){var j;(j=R^1<<x)!==w&&j!==D&&j!==F&&(B<0&&(B=j),(M=c[j])[0]>c[B][0]&&(B=j))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,N[n.log2(B^U)]=U&B):N[n.log2(F^U)]=U&F;var V=g,q=w;for(S=0;S<3;++S)V[S]=q&1<<S?-1:1;return y};var n=r(8828),i=r(6760),a=r(5202),o=r(3250),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),h=[0,0,0];function d(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}!function(){for(var t=0;t<8;++t)l[t]=[1,1,1,1],c[t]=[1,1,1]}();var p=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function f(t){for(var e=0;e<p.length;++e)if((t=a.positive(t,p[e])).length<3)return 0;var r=t[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(e=1;e+1<t.length;++e){var s=t[e],l=t[e+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,h=l[0]/l[3]-n,d=l[1]/l[3]-i;o+=Math.abs(c*d-u*h)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},501:function(t,e,r){t.exports=function(t,e,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;h<3;++h){for(var d=o.length/3|0,f=0;f<r[h].length;++f){var m=+r[h][f].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[h]=d,l[h]=g-d,d=o.length/3|0;for(var y=0;y<r[h].length;++y)m=+r[h][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,c[h]=d,u[h]=g-d}var v=n(t,new Float32Array(o)),x=i(t,[{buffer:v,type:t.FLOAT,size:3,stride:0,offset:0}]),b=a(t);return b.attributes.position.location=0,new p(t,v,x,b,l,s,u,c)};var n=r(2762),i=r(8116),a=r(1879).n,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function h(t){return t[0]=t[1]=t[2]=0,t}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var f=p.prototype;f.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},f.unbind=function(){this.vao.unbind()},f.drawAxisLine=function(t,e,r,n,i){var a=h(s);this.shader.uniforms.majorAxis=s,a[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=a;var o,u=d(c,r);u[t]+=e[0][t],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=h(l))[(t+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(t+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},f.drawAxisTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=h(o);a[t]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=h(l);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},f.drawGrid=function(t,e,r,n,i,a){if(this.gridCount[t]){var u=h(s);u[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=u;var p=d(c,n);p[e]+=r[0][e],this.shader.uniforms.offset=p;var f=h(o);f[t]=1,this.shader.uniforms.majorAxis=f;var m=h(l);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},f.drawZero=function(t,e,r,n,i,a){var o=h(s);this.shader.uniforms.majorAxis=o,o[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=o;var u=d(c,n);u[t]+=r[0][t],this.shader.uniforms.offset=u;var p=h(l);p[e]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},f.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},1879:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.n=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=function(t,e,r,a,s,l){var u=n(t),h=i(t,[{buffer:u,size:3}]),d=o(t);d.attributes.position.location=0;var p=new c(t,d,u,h);return p.update(e,r,a,s,l),p};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,h=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[e];h||(h=u[e]=function(t,e){try{return a(t,e)}catch(r){return console.warn('error vectorizing text:"'+t+'" error:',r),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var d=(n||12)/12,p=h.positions,f=h.cells,m=0,g=f.length;m<g;++m)for(var y=f[m],v=2;v>=0;--v){var x=p[y[v]];o.push(d*x[0],-d*x[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},f=0;f<3;++f){h[f]=o.length/3|0,s(.5*(t[0][f]+t[1][f]),e[f],r[f],12,1.25,p),d[f]=(o.length/3|0)-h[f],c[f]=o.length/3|0;for(var m=0;m<n[f].length;++m)if(n[f][m].text){var g={family:n[f][m].font||i[f].family,style:i[f].fontStyle||i[f].style,weight:i[f].fontWeight||i[f].weight,variant:i[f].fontVariant||i[f].variant};s(n[f][m].x,n[f][m].text,g,n[f][m].fontSize||12,1.25,p)}u[f]=(o.length/3|0)-c[f]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=h,this.labelCount=d},u.drawTicks=function(t,e,r,n,i,a,o,s){this.tickCount[t]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t]))},u.drawLabel=function(t,e,r,n,i,a,o,s){this.labelCount[t]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}},6444:function(t,e){function r(t,e){var r=t+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length<i;)h="0"+h;return u+"."+h}return u}e.create=function(t,e){for(var n=[],i=0;i<3;++i){for(var a=[],o=(t[0][i],t[1][i],0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:r(e[i],o)});for(o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},5445:function(t,e,r){t.exports=function(t,e,r,l,h){var d=e.model||c,p=e.view||c,y=e.projection||c,v=e._ortho||!1,x=t.bounds,b=(h=h||a(d,p,y,x,v)).axis;o(u,p,d),o(u,y,u);for(var _=m,w=0;w<3;++w)_[w].lo=1/0,_[w].hi=-1/0,_[w].pixelsPerDataUnit=1/0;var k=n(s(u,u));s(u,u);for(var T=0;T<3;++T){var S=(T+1)%3,A=(T+2)%3,M=g;t:for(w=0;w<2;++w){var C=[];if(b[T]<0!==!!w){M[T]=x[w][T];for(var E=0;E<2;++E){M[S]=x[E^w][S];for(var L=0;L<2;++L)M[A]=x[L^E^w][A],C.push(M.slice())}var P=v?5:4;for(E=P;E===P;++E){if(0===C.length)continue t;C=i.positive(C,k[E])}for(E=0;E<C.length;++E){A=C[E];var I=f(g,u,A,r,l);for(L=0;L<3;++L)_[L].lo=Math.min(_[L].lo,A[L]),_[L].hi=Math.max(_[L].hi,A[L]),L!==T&&(_[L].pixelsPerDataUnit=Math.min(_[L].pixelsPerDataUnit,Math.abs(I[L])))}}}}return _};var n=r(5033),i=r(5202),a=r(6429),o=r(6760),s=r(5665),l=r(5352),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function h(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}var d=[0,0,0,1],p=[0,0,0,1];function f(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=d,s=p,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,l(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+h*h)}return t}var m=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],g=[0,0,0]},2762:function(t,e,r){var n=r(1888),i=r(5298),a=r(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a<i;++a)r[a]=t[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!==typeof e&&(e=-1),this.bind(),"object"===typeof t&&"undefined"!==typeof t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"===typeof t&&"number"===typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!==typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,d=-1/0,p=null,f=null,m=[],g=1/0,y=!1,v="raw"===t.coneSizemode,x=0;x<r.length;x++){var b=r[x];s=Math.min(b[0],s),l=Math.max(b[0],l),c=Math.min(b[1],c),u=Math.max(b[1],u),h=Math.min(b[2],h),d=Math.max(b[2],d);var _=i[x];if(n.length(_)>o&&(o=n.length(_)),x&&!v){var w=2*n.distance(p,b)/(n.length(f)+n.length(_));w?(g=Math.min(g,w),y=!1):y=!0}y||(p=b,f=_),m.push(_)}var k=[s,c,h],T=[l,u,d];e&&(e[0]=k,e[1]=T),0===o&&(o=1);var S=1/o;isFinite(g)||(g=1),a.vectorScale=g;var A=t.coneSize||(v?1:.5);t.absoluteConeSize&&(A=t.absoluteConeSize*S),a.coneScale=A,x=0;for(var M=0;x<r.length;x++)for(var C=(b=r[x])[0],E=b[1],L=b[2],P=m[x],I=n.length(P)*S,z=0;z<8;z++){a.positions.push([C,E,L,M++]),a.positions.push([C,E,L,M++]),a.positions.push([C,E,L,M++]),a.positions.push([C,E,L,M++]),a.positions.push([C,E,L,M++]),a.positions.push([C,E,L,M++]),a.vectors.push(P),a.vectors.push(P),a.vectors.push(P),a.vectors.push(P),a.vectors.push(P),a.vectors.push(P),a.vertexIntensity.push(I,I,I),a.vertexIntensity.push(I,I,I);var O=a.positions.length;a.cells.push([O-6,O-5,O-4],[O-3,O-2,O-1])}return a};var i=r(614);t.exports.createMesh=r(9060),t.exports.createConeMesh=function(e,r){return t.exports.createMesh(e,r,{shaders:i,traceType:"cone"})}},9060:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(6760),l=r(7608),c=r(9618),u=r(6729),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e,r,n,i,a,o,s,l,c,u){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=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.traceType=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=h,this._view=h,this._projection=h,this._resolution=[1,1]}var p=d.prototype;p.isOpaque=function(){return this.opacity>=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var d=t.meshColor||[1,1,1,1],p=t.vertexIntensity,f=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)f=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g<p.length;++g){var y=p[g];f=Math.min(f,y),m=Math.max(m,y)}else for(g=0;g<n.length;++g)y=n[g][2],f=Math.min(f,y),m=Math.max(m,y);for(this.intensity=p||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=0;g<n.length;++g)for(var v=n[g],x=0;x<3;++x)!isNaN(v[x])&&isFinite(v[x])&&(this.bounds[0][x]=Math.min(this.bounds[0][x],v[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],v[x]));var b=0;t:for(g=0;g<r.length;++g){var _=r[g];if(3===_.length){for(x=0;x<3;++x){v=n[k=_[x]];for(var w=0;w<3;++w)if(isNaN(v[w])||!isFinite(v[w]))continue t}for(x=0;x<3;++x){var k;v=n[k=_[2-x]],a.push(v[0],v[1],v[2],v[3]);var T=i[k];o.push(T[0],T[1],T[2],T[3]||0);var S,A=d;3===A.length?s.push(A[0],A[1],A[2],1):s.push(A[0],A[1],A[2],A[3]),S=p?[(p[k]-f)/(m-f),0]:[(v[2]-f)/(m-f),0],l.push(S[0],S[1]),h.push(g)}b+=1}}this.triangleCount=b,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(h))}},p.drawTransparent=p.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var c={model:r,view:n,projection:i,inverseModel:h.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};c.inverseModel=l(c.inverseModel,c.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(s(u,c.view,c.model),s(u,c.projection,u),l(u,u),o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var d=u[15];for(o=0;o<3;++o)d+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],f=0;f<3;++f)p+=u[4*f+o]*this.lightPosition[f];c.lightPosition[o]=p/d}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var p=i(t),f=i(t),m=i(t),g=i(t),y=i(t),v=new d(t,h,l,u,p,f,y,m,g,a(t,[{buffer:p,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:f,type:t.FLOAT,size:4}]),r.traceType||"cone");return v.update(e),v}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.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",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=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.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}l.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;t:for(var l=0;l<a;++l){for(var u=r[l],d=0;d<3;++d)if(isNaN(u[d])||!isFinite(u[d]))continue t;var p,f=n[l],m=e[s];if(Array.isArray(m[0])&&(m=e[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),!isNaN(f[0][s])&&!isNaN(f[1][s]))f[0][s]<0&&((p=u.slice())[s]+=f[0][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s)),f[1][s]>0&&((p=u.slice())[s]+=f[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=t.NONE;l[n]=i}}(t,c),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),"number"!==typeof e)throw new Error("gl-fbo: Missing shape parameter");var u=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var d=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");d=t.FLOAT}else n.preferFloat&&h>0&&p&&(d=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new f(t,e,r,d,h,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function f(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var f=0;f<i;++f)this.color[f]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,g=[0|e,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(t){return m.width=t}},1:{get:function(){return m._shape[1]},set:function(t){return m.height=t}}}),this._shapeVector=g,function(t){var e=c(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),i=t._shape[0],a=t._shape[1],o=t.color.length,s=t._ext,f=t._useStencil,m=t._useDepth,g=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)t.color[y]=d(r,i,a,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(t._color_rb=p(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?f?t.depth=d(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=d(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&f?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):f&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;y<t.color.length;++y)t.color[y].dispose(),t.color[y]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),u(r,e),h(x)}u(r,e)}(this)}var m=f.prototype;function g(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var n=t.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),u(n,a),h(s)),u(n,a)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return g(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return g(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,g(this,this._shape[0],t),t},enumerable:!1}}),m.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},2992:function(t,e,r){var n=r(3387).sprintf,i=r(5171),a=r(1848),o=r(1085);t.exports=function(t,e,r){var s=a(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===i.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,t),h=t.split("\n"),d={},p=0;p<h.length;p++){var f=h[p];if(""!==f&&"\0"!==f){var m=parseInt(f.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",f));d[m]=f}}var g=o(e).split("\n");for(p=0;p<g.length;p++)if((d[p+3]||d[p+2]||d[p+1])&&(c+=g[p]+"\n",d[p+1])){var y=d[p+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}return{long:c.trim(),short:u.trim()}}},7319:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=d(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var f=a(e,u);f.wrap=e.REPEAT;var m=new y(e,r,o,s,l,f);return m.update(t),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,d=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,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=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],d=t.position||t.positions;if(d){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e<d.length;++e){var y,v,x,b=d[e-1],_=d[e];for(a.push(s),o.push(b.slice()),r=0;r<3;++r){if(isNaN(b[r])||isNaN(_[r])||!isFinite(b[r])||!isFinite(_[r])){if(!n&&i.length>0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],b[r],_[r]),h[1][r]=Math.max(h[1][r],b[r],_[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var k=s;if(s+=f(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(d[d.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var T=t.dashes.slice();for(T.unshift(0),e=1;e<T.length;++e)T[e]=T[e-1]+T[e];var S=c(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)S.set(e,0,r,0);1&l.le(T,T[T.length-1]*e/255)?S.set(e,0,0,0):S.set(e,0,0,255)}this.texture.setPixels(S)}},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},v.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=function(t,e,r,n){return o[0]=n,o[1]=r,o[2]=e,o[3]=t,s[0]}(t.value[0],t.value[1],t.value[2],0),r=l.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new g(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-a,u=[0,0,0],h=0;h<3;++h)u[h]=c*n[h]+a*i[h];var d=Math.min(a<.5?r:r+1,this.points.length-1);return new g(e,u,d,this.points[d])}},1903:function(t){t.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},6864:function(t){t.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},9921:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-r*a)*(h*g-d*m)-(e*s-n*a)*(u*g-d*f)+(e*l-i*a)*(u*m-h*f)+(r*s-n*o)*(c*g-d*p)-(r*l-i*o)*(c*m-h*p)+(n*l-i*s)*(c*f-u*p)}},7399:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,d=i*o,p=i*s,f=i*l,m=a*o,g=a*s,y=a*l;return t[0]=1-h-f,t[1]=u+y,t[2]=d-g,t[3]=0,t[4]=u-y,t[5]=1-c-f,t[6]=p+m,t[7]=0,t[8]=d+g,t[9]=p-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},6743:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,d=n*c,p=i*l,f=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return t[0]=1-(p+m),t[1]=h+v,t[2]=d-y,t[3]=0,t[4]=h-v,t[5]=1-(u+m),t[6]=f+g,t[7]=0,t[8]=d+y,t[9]=f-g,t[10]=1-(u+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},7894:function(t){t.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},7608:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-d*f,A=u*y-p*f,M=h*g-d*m,C=h*y-p*m,E=d*y-p*g,L=v*E-x*C+b*M+_*A-w*S+k*T;return L?(L=1/L,t[0]=(s*E-l*C+c*M)*L,t[1]=(i*C-n*E-a*M)*L,t[2]=(m*k-g*w+y*_)*L,t[3]=(d*w-h*k-p*_)*L,t[4]=(l*A-o*E-c*S)*L,t[5]=(r*E-i*A+a*S)*L,t[6]=(g*b-f*k-y*x)*L,t[7]=(u*k-d*b+p*x)*L,t[8]=(o*C-s*A+c*T)*L,t[9]=(n*A-r*C-a*T)*L,t[10]=(f*w-m*b+y*v)*L,t[11]=(h*b-u*w-p*v)*L,t[12]=(s*S-o*M-l*T)*L,t[13]=(r*M-n*S+i*T)*L,t[14]=(m*x-f*_-g*v)*L,t[15]=(u*_-h*x+d*v)*L,t):null}},6582:function(t,e,r){var n=r(7894);t.exports=function(t,e,r,i){var a,o,s,l,c,u,h,d,p,f,m=e[0],g=e[1],y=e[2],v=i[0],x=i[1],b=i[2],_=r[0],w=r[1],k=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?n(t):(h=m-_,d=g-w,p=y-k,f=1/Math.sqrt(h*h+d*d+p*p),a=x*(p*=f)-b*(d*=f),o=b*(h*=f)-v*p,s=v*d-x*h,(f=Math.sqrt(a*a+o*o+s*s))?(a*=f=1/f,o*=f,s*=f):(a=0,o=0,s=0),l=d*s-p*o,c=p*a-h*s,u=h*o-d*a,(f=Math.sqrt(l*l+c*c+u*u))?(l*=f=1/f,c*=f,u*=f):(l=0,c=0,u=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=c,t[6]=d,t[7]=0,t[8]=s,t[9]=u,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+c*g+u*y),t[14]=-(h*m+d*g+p*y),t[15]=1,t)}},6760:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*d+w*g,t[2]=x*a+b*c+_*p+w*y,t[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*d+w*g,t[6]=x*a+b*c+_*p+w*y,t[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*d+w*g,t[10]=x*a+b*c+_*p+w*y,t[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*d+w*g,t[14]=x*a+b*c+_*p+w*y,t[15]=x*o+b*u+_*f+w*v,t}},4040:function(t){t.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t}},4772:function(t){t.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},6079:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M,C=n[0],E=n[1],L=n[2],P=Math.sqrt(C*C+E*E+L*L);return Math.abs(P)<1e-6?null:(C*=P=1/P,E*=P,L*=P,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],c=e[2],u=e[3],h=e[4],d=e[5],p=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],x=C*C*o+a,b=E*C*o+L*i,_=L*C*o-E*i,w=C*E*o-L*i,k=E*E*o+a,T=L*E*o+C*i,S=C*L*o+E*i,A=E*L*o-C*i,M=L*L*o+a,t[0]=s*x+h*b+m*_,t[1]=l*x+d*b+g*_,t[2]=c*x+p*b+y*_,t[3]=u*x+f*b+v*_,t[4]=s*w+h*k+m*T,t[5]=l*w+d*k+g*T,t[6]=c*w+p*k+y*T,t[7]=u*w+f*k+v*T,t[8]=s*S+h*A+m*M,t[9]=l*S+d*A+g*M,t[10]=c*S+p*A+y*M,t[11]=u*S+f*A+v*M,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}},5567:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+d*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=d*i-l*n,t}},2408:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-c*n,t[1]=o*i-u*n,t[2]=s*i-h*n,t[3]=l*i-d*n,t[8]=a*n+c*i,t[9]=o*n+u*i,t[10]=s*n+h*i,t[11]=l*n+d*i,t}},7089:function(t){t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+d*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=d*i-l*n,t}},2504:function(t){t.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},7656:function(t){t.exports=function(t,e,r){var n,i,a,o,s,l,c,u,h,d,p,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+d*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+f*y+e[15]),t}},5665:function(t){t.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},7626:function(t,e,r){var n=r(2642),i=r(9346);function a(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function o(t,e,r,n,i){for(var o=a(n,a(r,a(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}function s(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}t.exports=function(t,e,r,a,l,c){if(1===t.length)return[0,t[0].slice()];for(var u=new Array(t.length),h=0;h<t.length;++h)u[h]=o(t[h],r,a,l,c);var d=0,p=1/0;for(h=0;h<u.length;++h){for(var f=0,m=0;m<2;++m)f+=Math.pow(u[h][m]-e[m],2);f<p&&(p=f,d=h)}var g=function(t,e){if(2===t.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(e[o]-t[0][o],2),a+=Math.pow(e[o]-t[1][o],2);return(r=Math.sqrt(r))+(a=Math.sqrt(a))<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===t.length){var s=[0,0];return i(t[0],t[1],t[2],e,s),n(t,s)}return[]}(u,e),y=0;for(h=0;h<3;++h){if(g[h]<-.001||g[h]>1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[d,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:p,fragment:f,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),d=r(7765),p=r(1888),f=r(840),m=r(7626),g=f.meshShader,y=f.wireShader,v=f.pointShader,x=f.pickShader,b=f.pointPickShader,_=f.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,k,T,S,A,M){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=d,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=S,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=M,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=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.prototype;function S(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(t){this.pickId=t},T.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var h=c[0];2===c.length&&(h=c[u]);for(var f=n[h][0],m=n[h][1],g=i[h],y=1-g,v=this.positions[f],x=this.positions[m],b=0;b<3;++b)o[s++]=g*v[b]+y*x[b]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),p.free(o)}else this.contourCount=0},T.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),this.hasAlpha=!1,"opacity"in t&&(this.opacity=t.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in t&&(this.opacityscale=t.opacityscale,this.hasAlpha=!0),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=o(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t,e){for(var r=h({colormap:t,nshades:256,format:"rgba"}),n=new Uint8Array(1024),i=0;i<256;++i){for(var a=r[i],o=0;o<3;++o)n[4*i+o]=a[o];n[4*i+3]=e?255*S(i/255,e):255*a[3]}return u(n,[256,256,4],[4,0,1])}(t.colormap,this.opacityscale)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var i=[],a=[],l=[],c=[],d=[],p=[],f=[],m=[],g=[],y=[],v=[],x=[],b=[],_=[];this.cells=r,this.positions=n;var w=t.vertexNormals,k=t.cellNormals,T=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,A=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!k&&(k=s.faceNormals(r,n,A)),k||w||(w=s.vertexNormals(r,n,T));var M=t.vertexColors,C=t.cellColors,E=t.meshColor||[1,1,1,1],L=t.vertexUVs,P=t.vertexIntensity,I=t.cellUVs,z=t.cellIntensity,O=1/0,D=-1/0;if(!L&&!I)if(P)if(t.vertexIntensityBounds)O=+t.vertexIntensityBounds[0],D=+t.vertexIntensityBounds[1];else for(var R=0;R<P.length;++R){var F=P[R];O=Math.min(O,F),D=Math.max(D,F)}else if(z)if(t.cellIntensityBounds)O=+t.cellIntensityBounds[0],D=+t.cellIntensityBounds[1];else for(R=0;R<z.length;++R)F=z[R],O=Math.min(O,F),D=Math.max(D,F);else for(R=0;R<n.length;++R)F=n[R][2],O=Math.min(O,F),D=Math.max(D,F);this.intensity=P||z||function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}(n),this.pickVertex=!(z||C);var B=t.pointSizes,j=t.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],R=0;R<n.length;++R)for(var N=n[R],U=0;U<3;++U)!isNaN(N[U])&&isFinite(N[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],N[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],N[U]));var V=0,q=0,$=0;t:for(R=0;R<r.length;++R){var H=r[R];switch(H.length){case 1:for(N=n[G=H[0]],U=0;U<3;++U)if(isNaN(N[U])||!isFinite(N[U]))continue t;y.push(N[0],N[1],N[2]),Y=M?M[G]:C?C[R]:E,this.opacityscale&&P?a.push(Y[0],Y[1],Y[2],this.opacity*S((P[G]-O)/(D-O),this.opacityscale)):3===Y.length?v.push(Y[0],Y[1],Y[2],this.opacity):(v.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)),Z=L?L[G]:P?[(P[G]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(N[2]-O)/(D-O),0],x.push(Z[0],Z[1]),B?b.push(B[G]):b.push(j),_.push(R),$+=1;break;case 2:for(U=0;U<2;++U){N=n[G=H[U]];for(var W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue t}for(U=0;U<2;++U)N=n[G=H[U]],p.push(N[0],N[1],N[2]),Y=M?M[G]:C?C[R]:E,this.opacityscale&&P?a.push(Y[0],Y[1],Y[2],this.opacity*S((P[G]-O)/(D-O),this.opacityscale)):3===Y.length?f.push(Y[0],Y[1],Y[2],this.opacity):(f.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)),Z=L?L[G]:P?[(P[G]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(N[2]-O)/(D-O),0],m.push(Z[0],Z[1]),g.push(R);q+=1;break;case 3:for(U=0;U<3;++U)for(N=n[G=H[U]],W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue t;for(U=0;U<3;++U){var G,Y,Z,X;N=n[G=H[2-U]],i.push(N[0],N[1],N[2]),(Y=M?M[G]:C?C[R]:E)?this.opacityscale&&P?a.push(Y[0],Y[1],Y[2],this.opacity*S((P[G]-O)/(D-O),this.opacityscale)):3===Y.length?a.push(Y[0],Y[1],Y[2],this.opacity):(a.push(Y[0],Y[1],Y[2],Y[3]*this.opacity),Y[3]<1&&(this.hasAlpha=!0)):a.push(.5,.5,.5,1),Z=L?L[G]:P?[(P[G]-O)/(D-O),0]:I?I[R]:z?[(z[R]-O)/(D-O),0]:[(N[2]-O)/(D-O),0],c.push(Z[0],Z[1]),X=w?w[G]:k[R],l.push(X[0],X[1],X[2]),d.push(R)}V+=1}}this.pointCount=$,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(x),this.pointSizes.update(b),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(p),this.edgeColors.update(f),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(d))}},T.drawTransparent=T.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,inverseModel:w.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=c(s.inverseModel,s.model),e.disable(e.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(l(u,s.view,s.model),l(u,s.projection,u),c(u,u),o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var h,d=u[15];for(o=0;o<3;++o)d+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var p=u[12+o],f=0;f<3;++f)p+=u[4*f+o]*this.lightPosition[f];s.lightPosition[o]=p/d}this.triangleCount>0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=t.coord[0],s=t.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],h=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:e,cell:r,cellId:e,intensity:this.intensity[e],dataCoordinate:h}}var d=m(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!d)return null;var p=d[2],f=0;for(a=0;a<r.length;++a)f+=p[a]*this.intensity[r[a]];return{position:d[1],index:r[d[0]],cell:r,cellId:e,intensity:f,dataCoordinate:this.positions[r[d[0]]]}},T.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},t.exports=function(t,e){if(1===arguments.length&&(t=(e=t).gl),!(t.getExtension("OES_standard_derivatives")||t.getExtension("MOZ_OES_standard_derivatives")||t.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=function(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}(t),s=function(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}(t),l=function(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}(t),c=function(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}(t),h=function(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}(t),d=function(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}(t),p=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=t.LINEAR_MIPMAP_LINEAR,p.magFilter=t.LINEAR;var f=i(t),m=i(t),w=i(t),T=i(t),S=i(t),A=a(t,[{buffer:f,type:t.FLOAT,size:3},{buffer:S,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2},{buffer:T,type:t.FLOAT,size:3}]),M=i(t),C=i(t),E=i(t),L=i(t),P=a(t,[{buffer:M,type:t.FLOAT,size:3},{buffer:L,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:C,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2}]),I=i(t),z=i(t),O=i(t),D=i(t),R=i(t),F=a(t,[{buffer:I,type:t.FLOAT,size:3},{buffer:R,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:t.FLOAT,size:4},{buffer:O,type:t.FLOAT,size:2},{buffer:D,type:t.FLOAT,size:1}]),B=i(t),j=new k(t,p,r,s,l,c,h,d,f,S,m,w,T,A,M,L,C,E,P,I,R,z,O,D,F,B,a(t,[{buffer:B,type:t.FLOAT,size:3}]));return j.update(e),j}},4437:function(t,e,r){t.exports=function(t,e){t=t||document.body;var r=[.01,1/0];"distanceLimits"in(e=e||{})&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var c=i({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,d=t.clientWidth,p=t.clientHeight,f={keyBindingMode:"rotate",enableWheel:!0,view:c,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:c.modes,_ortho:e._ortho||e.projection&&"orthographic"===e.projection.type||!1,tick:function(){var e=n(),r=this.delay,i=e-2*r;c.idle(e-r),c.recalcMatrix(i),c.flush(e-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=t.clientWidth===d&&t.clientHeight===p;return d=t.clientWidth,p=t.clientHeight,a?!l:(h=Math.exp(c.computedRadius[0]),!0)},lookAt:function(t,e,r){c.lookAt(c.lastT(),t,e,r)},rotate:function(t,e,r){c.rotate(c.lastT(),t,e,r)},pan:function(t,e,r){c.pan(c.lastT(),t,e,r)},translate:function(t,e,r){c.translate(c.lastT(),t,e,r)}};return Object.defineProperties(f,{matrix:{get:function(){return c.computedMatrix},set:function(t){return c.setMatrix(c.lastT(),t),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(t){var e=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(t),"turntable"===t){var a=n();c._active.lookAt(a,r,i,e),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(t){return c.lookAt(c.lastT(),null,t),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(t){return c.lookAt(c.lastT(),t),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(t){return c.lookAt(c.lastT(),null,null,t),c.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return c.setDistance(c.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(t){return c.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),f._lastX=-1,f._lastY=-1,f._lastMods={shift:!1,control:!1,alt:!1,meta:!1},f.enableMouseListeners=function(){function e(e,r,i,a){var o=f.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,d=!!a.control,p=!!a.alt,m=!!a.shift,g=!!(1&e),y=!!(2&e),v=!!(4&e),x=1/t.clientHeight,b=x*(r-f._lastX),_=x*(i-f._lastY),w=f.flipX?1:-1,k=f.flipY?1:-1,T=Math.PI*f.rotateSpeed,S=n();if(-1!==f._lastX&&-1!==f._lastY&&((s&&g&&!d&&!p&&!m||g&&!d&&!p&&m)&&c.rotate(S,w*T*b,-k*T*_,0),(l&&g&&!d&&!p&&!m||y||g&&d&&!p&&!m)&&c.pan(S,-f.translateSpeed*b*h,f.translateSpeed*_*h,0),u&&g&&!d&&!p&&!m||v||g&&!d&&p&&!m)){var A=-f.zoomSpeed*_/window.innerHeight*(S-c.lastT())*100;c.pan(S,0,0,h*(Math.exp(A)-1))}return f._lastX=r,f._lastY=i,f._lastMods=a,!0}}f.mouseListener=a(t,e),t.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],t);e(0,n[0],n[1],f._lastMods),e(1,n[0],n[1],f._lastMods)}),!!l&&{passive:!0}),t.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],t);e(1,n[0],n[1],f._lastMods),r.preventDefault()}),!!l&&{passive:!1}),t.addEventListener("touchend",(function(t){e(0,f._lastX,f._lastY,f._lastMods)}),!!l&&{passive:!0}),f.wheelListener=o(t,(function(t,e){if(!1!==f.keyBindingMode&&f.enableWheel){var r=f.flipX?1:-1,i=f.flipY?1:-1,a=n();if(Math.abs(t)>Math.abs(e))c.rotate(a,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else if(!f._ortho){var o=-f.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},f.enableMouseListeners(),f};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),d=r(4040),p=r(799),f=r(9216)({tablet:!0,featureDetect:!0});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 g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!==typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(f=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(n){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:f})),!r)throw new Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!f}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,k={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},T=t.axes||{},S=i(r,T);S.enable=!T.disable;var A=t.spikes||{},M=o(r,A),C=[],E=[],L=[],P=[],I=!0,z=!0,O=new Array(16),D=new Array(16),R={view:null,projection:O,model:D,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,k),j={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:S,axesPixels:null,spikes:M,bounds:v,objects:C,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},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)}},N=[r.drawingBufferWidth/j.pixelRatio|0,r.drawingBufferHeight/j.pixelRatio|0];function U(){if(!j._stopped&&j.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*j.pixelRatio),a=0|Math.ceil(n*j.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}function V(){for(var t=C.length,e=P.length,n=0;n<e;++n)L[n]=0;t:for(n=0;n<t;++n){var i=C[n],a=i.pickSlots;if(a){for(var o=0;o<e;++o)if(L[o]+a<255){E[n]=o,i.setPickBase(L[o]+1),L[o]+=a;continue t}var l=s(r,F);E[n]=e,P.push(l),L.push(a),i.setPickBase(1),e+=1}else E[n]=-1}for(;e>0&&0===L[e-1];)L.pop(),P.pop().dispose()}function q(){if(j.contextLost)return!0;r.isContextLost()&&(j.contextLost=!0,j.mouseListener.enabled=!1,j.selection.object=null,j.oncontextloss&&j.oncontextloss())}j.autoResize&&U(),window.addEventListener("resize",U),j.update=function(t){j._stopped||(t=t||{},I=!0,z=!0)},j.add=function(t){j._stopped||(t.axes=S,C.push(t),E.push(-1),I=!0,z=!0,V())},j.remove=function(t){if(!j._stopped){var e=C.indexOf(t);e<0||(C.splice(e,1),E.pop(),I=!0,z=!0,V())}},j.dispose=function(){if(!j._stopped&&(j._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),j.mouseListener.enabled=!1,!j.contextLost)){S.dispose(),M.dispose();for(var t=0;t<C.length;++t)C[t].dispose();for(b.dispose(),t=0;t<P.length;++t)P[t].dispose();_.dispose(),r=null,S=null,M=null,C=[]}},j._mouseRotating=!1,j._prevButtons=0,j.enableMouseListeners=function(){j.mouseListener=u(e,(function(t,e,r){if(!j._stopped){var n=P.length,i=C.length,a=x.object;x.distance=1/0,x.mouse[0]=e,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(t&&j._prevButtons)j._mouseRotating=!0;else{j._mouseRotating&&(z=!0),j._mouseRotating=!1;for(var s=0;s<n;++s){var l=P[s].query(e,N[1]-r-1,j.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<i;++c){var u=C[c];if(E[c]===s){var h=u.pick(l);h&&(x.buttons=t,x.screen=l.coord,x.distance=l.distance,x.object=u,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}a&&a!==x.object&&(a.highlight&&a.highlight(null),I=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),I=!0),(o=o||x.object!==a)&&j.onselect&&j.onselect(x),1&t&&!(1&j._prevButtons)&&j.onclick&&j.onclick(x),j._prevButtons=t}}))},e.addEventListener("webglcontextlost",q);var $=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],H=[$[0].slice(),$[1].slice()];function W(){if(!q()){U();var t=j.camera.tick();R.view=j.camera.matrix,I=I||t,z=z||t,S.pixelRatio=j.pixelRatio,M.pixelRatio=j.pixelRatio;var e=C.length,n=$[0],i=$[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<e;++o){(L=C[o]).pixelRatio=j.pixelRatio,L.axes=j.axes,I=I||!!L.dirty,z=z||!!L.dirty;var s=L.bounds;if(s)for(var l=s[0],u=s[1],p=0;p<3;++p)n[p]=Math.min(n[p],l[p]),i[p]=Math.max(i[p],u[p])}var f=j.bounds;if(j.autoBounds)for(p=0;p<3;++p){if(i[p]<n[p])n[p]=-1,i[p]=1;else{n[p]===i[p]&&(n[p]-=1,i[p]+=1);var m=.05*(i[p]-n[p]);n[p]=n[p]-m,i[p]=i[p]+m}f[0][p]=n[p],f[1][p]=i[p]}var y=!1;for(p=0;p<3;++p)y=y||H[0][p]!==f[0][p]||H[1][p]!==f[1][p],H[0][p]=f[0][p],H[1][p]=f[1][p];if(z=z||y,I=I||y){if(y){var v=[0,0,0];for(o=0;o<3;++o)v[o]=g((f[1][o]-f[0][o])/10);S.autoTicks?S.update({bounds:f,tickSpacing:v}):S.update({bounds:f})}var k=r.drawingBufferWidth,T=r.drawingBufferHeight;for(F[0]=k,F[1]=T,N[0]=0|Math.max(k/j.pixelRatio,1),N[1]=0|Math.max(T/j.pixelRatio,1),function(t,e){var r=t.bounds,n=t.cameraParams,i=n.projection,a=n.model,o=t.gl.drawingBufferWidth,s=t.gl.drawingBufferHeight,l=t.zNear,c=t.zFar,u=t.fovy,p=o/s;e?(d(i,-p,p,-1,1,l,c),n._ortho=!0):(h(i,u,p,l,c),n._ortho=!1);for(var f=0;f<16;++f)a[f]=0;a[15]=1;var m=0;for(f=0;f<3;++f)m=Math.max(m,r[1][f]-r[0][f]);for(f=0;f<3;++f)t.autoScale?a[5*f]=t.aspect[f]/(r[1][f]-r[0][f]):a[5*f]=1/m,t.autoCenter&&(a[12+f]=.5*-a[5*f]*(r[0][f]+r[1][f]))}(j,w),o=0;o<e;++o)(L=C[o]).axesBounds=f,j.clipToBounds&&(L.clipBounds=f);x.object&&(j.snapToData?M.position=x.dataCoordinate:M.position=x.dataPosition,M.bounds=f),z&&(z=!1,function(){if(!q()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var t=C.length,e=P.length,n=0;n<e;++n){var i=P[n];i.shape=N,i.begin();for(var a=0;a<t;++a)if(E[a]===n){var o=C[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(R))}i.end()}}}()),j.axesPixels=a(j.axes,R,k,T),j.onrender&&j.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,k,T),j.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var A=!1;for(S.enable&&(A=A||S.isTransparent(),S.draw(R)),M.axes=S,x.object&&M.draw(R),r.disable(r.CULL_FACE),o=0;o<e;++o)(L=C[o]).axes=S,L.pixelRatio=j.pixelRatio,L.isOpaque&&L.isOpaque()&&L.draw(R),L.isTransparent&&L.isTransparent()&&(A=!0);if(A){for(b.shape=F,b.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),S.enable&&S.isTransparent()&&S.drawTransparent(R),o=0;o<e;++o)(L=C[o]).isOpaque&&L.isOpaque()&&L.draw(R);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),S.isTransparent()&&S.drawTransparent(R),o=0;o<e;++o){var L;(L=C[o]).isTransparent&&L.isTransparent()&&L.drawTransparent(R)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),_.bind(),b.color[0].bind(0),_.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}for(I=!1,o=0;o<e;++o)C[o].dirty=!1}}}return j.enableMouseListeners(),function t(){j._stopped||j.contextLost||(W(),requestAnimationFrame(t))}(),j.redraw=function(){j._stopped||(I=!0,W())},j},createCamera:n}},783:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],d=e[3],p=r[0],f=r[1],m=r[2],g=r[3];return(a=c*p+u*f+h*m+d*g)<0&&(a=-a,p=-p,f=-f,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*p,t[1]=s*u+l*f,t[2]=s*h+l*m,t[3]=s*d+l*g,t}},5964:function(t){t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var c,u,h=n(t,s);if(r&&1!==r){for(c=0;c<l.positions.length;++c)for(u=0;u<l.positions[c].length;++u)l.positions[c][u]/=r;for(c=0;c<h.positions.length;++c)for(u=0;u<h.positions[c].length;++u)h.positions[c][u]/=r}var d=[[1/0,1/0],[-1/0,-1/0]],p=h.positions.length;for(c=0;c<p;++c){var f=h.positions[c];for(u=0;u<2;++u)d[0][u]=Math.min(d[0][u],f[u]),d[1][u]=Math.max(d[1][u],f[u])}return o[t]=[l,h,d]};var i={}},1283:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},d={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},f={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,h)},e.createOrtho=function(t){return y(t,d)},e.createProject=function(t){return y(t,p)},e.createPickPerspective=function(t){return y(t,f)},e.createPickOrtho=function(t){return y(t,m)},e.createPickProject=function(t){return y(t,g)}},8418:function(t,e,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],d=ArrayBuffer,p=DataView;function f(t){return Array.isArray(t)||function(t){return d.isView(t)&&!(t instanceof p)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function y(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(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}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),d=i(e),p=i(e),f=i(e),m=a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:d,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new x(e,r,n,o,h,d,p,f,m,s,c,u);return g.update(t),g};var b=x.prototype;b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],k=[0,0,0],T=[0,0,0,1],S=[0,0,0,1],A=h.slice(),M=[0,0,0],C=[[0,0,0],[0,0,0]];function E(t){return t[0]=t[1]=t[2]=0,t}function L(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function P(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function I(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,d=r.projection||h,p=e.axesBounds,f=function(t){for(var e=C,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],_[0]=2/o.drawingBufferWidth,_[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=d,l.screenSize=_,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=f,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var y=A,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=p[0][m]:y[12+m]=p[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,b=(m+2)%3,I=E(w),z=E(k);I[x]=1,z[b]=1;var O=g(0,0,0,L(T,I)),D=g(0,0,0,L(S,z));if(Math.abs(O[1])>Math.abs(D[1])){var R=O;O=D,D=R,R=I,I=z,z=R;var F=x;x=b,b=F}O[0]<0&&(I[x]=-1),D[1]>0&&(z[b]=-1);var B=0,j=0;for(v=0;v<4;++v)B+=Math.pow(c[4*x+v],2),j+=Math.pow(c[4*b+v],2);I[x]/=Math.sqrt(B),z[b]/=Math.sqrt(j),l.axes[0]=I,l.axes[1]=z,l.fragClipBounds[0]=P(M,f[0],m,-1e8),l.fragClipBounds[1]=P(M,f[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&I(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,_[0]=2/s.drawingBufferWidth,_[1]=2/s.drawingBufferHeight,l.screenSize=_,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function D(t,e,r,i){var a;a=f(t)?e<t.length?t[e]:void 0:t,a=u(a);var o=!0;n(a)&&(a="\u25bc",o=!1),r||(r={});var s=r.family;f(s)&&(s=s[e]),s||(s="normal");var l=r.weight;f(l)&&(l=l[e]),l||(l="normal");var h=r.style;f(h)&&(h=h[e]),h||(h="normal");var d=r.variant;f(d)&&(d=d[e]),d||(d="normal");var p=c(a,{family:s,weight:l,style:h,variant:d},i);return{mesh:(p=c(a,r,i))[0],lines:p[1],bounds:p[2],visible:o}}b.draw=function(t){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!1,!1)},b.drawTransparent=function(t){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,this.pixelRatio,!0,!1)},b.drawPick=function(t){O(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,1,!0,!0)},b.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},b.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(f(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(f(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){f(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n<c.length;++n)i[n]=c[n][0],a[n]=c[n][1];var u=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],d=t.glyph,p=t.color,m=t.size,g=t.angle,y=t.lineColor,x=-1,b=0,_=0,w=0;if(s.length){w=s.length;t:for(n=0;n<w;++n){for(var k=s[n],T=0;T<3;++T)if(isNaN(k[T])||!isFinite(k[T]))continue t;var S=(N=D(d,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;b+=3*S.cells.length,_+=2*A.edges.length}}var C=b+_,E=o.mallocFloat(3*C),L=o.mallocFloat(4*C),P=o.mallocFloat(2*C),I=o.mallocUint32(C);if(C>0){var z=0,O=b,R=[0,0,0,1],F=[0,0,0,1],B=f(p)&&f(p[0]),j=f(y)&&f(y[0]);t:for(n=0;n<w;++n){for(x+=1,k=s[n],T=0;T<3;++T){if(isNaN(k[T])||!isFinite(k[T]))continue t;h[T]=Math.max(h[T],k[T]),u[T]=Math.min(u[T],k[T])}S=(N=D(d,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,U=N.visible;if(U)if(f(p)){if(3===(V=B?n<p.length?p[n]:[0,0,0,0]:p).length){for(T=0;T<3;++T)R[T]=V[T];R[3]=1}else if(4===V.length){for(T=0;T<4;++T)R[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else R[0]=R[1]=R[2]=0,R[3]=1;else R=[1,1,1,0];if(U)if(f(y)){var V;if(3===(V=j?n<y.length?y[n]:[0,0,0,0]:y).length){for(T=0;T<3;++T)F[T]=V[T];F[T]=1}else if(4===V.length){for(T=0;T<4;++T)F[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else F[0]=F[1]=F[2]=0,F[3]=1;else F=[1,1,1,0];var q=.5;U?f(m)?q=n<m.length?+m[n]:12:m?q=+m:this.useOrtho&&(q=12):q=0;var $=0;f(g)?$=n<g.length?+g[n]:0:g&&($=+g);var H=Math.cos($),W=Math.sin($);for(k=s[n],T=0;T<3;++T)h[T]=Math.max(h[T],k[T]),u[T]=Math.min(u[T],k[T]);var G=i,Y=a;G=0,f(i)?G=n<i.length?i[n]:0:i&&(G=i),Y=0,f(a)?Y=n<a.length?a[n]:0:a&&(Y=a);var Z=[G*=G>0?1-M[0][0]:G<0?1+M[1][0]:1,Y*=Y>0?1-M[0][1]:Y<0?1+M[1][1]:1],X=S.cells||[],K=S.positions||[];for(T=0;T<X.length;++T)for(var J=X[T],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)E[3*z+tt]=k[tt];for(tt=0;tt<4;++tt)L[4*z+tt]=R[tt];I[z]=x;var et=K[J[Q]];P[2*z]=q*(H*et[0]-W*et[1]+Z[0]),P[2*z+1]=q*(W*et[0]+H*et[1]+Z[1]),z+=1}for(X=A.edges,K=A.positions,T=0;T<X.length;++T)for(J=X[T],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)E[3*O+tt]=k[tt];for(tt=0;tt<4;++tt)L[4*O+tt]=F[tt];I[O]=x,et=K[J[Q]],P[2*O]=q*(H*et[0]-W*et[1]+Z[0]),P[2*O+1]=q*(W*et[0]+H*et[1]+Z[1]),O+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=b,this.lineVertexCount=_,this.pointBuffer.update(E),this.colorBuffer.update(L),this.glyphBuffer.update(P),this.idBuffer.update(I),o.free(E),o.free(L),o.free(P),o.free(I)},b.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(t,e,r){t.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;a<r*e*4;++a)n[a]=255}return t}}}),c.begin=function(){var t=this.gl;this.shape,t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},c.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!==typeof r&&(r=1);var i=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),c=0|Math.min(Math.max(e+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],h=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),d=function(t,e,r){for(var n=1e8,i=-1,a=-1,o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=t.get(l,c,0),h=t.get(l,c,1),d=t.get(l,c,2),p=t.get(l,c,3);if(u<255||h<255||d<255||p<255){var f=e-l,m=r-c,g=f*f+m*m;g<n&&(n=g,i=l,a=c)}}return[i,a,n]}(h.hi(u[0],u[1],1),r,r),p=d[0],f=d[1];return p<0||Math.pow(this.radius,2)<d[2]?null:new s(p+i|0,f+l|0,h.get(p,f,0),[h.get(p,f,1),h.get(p,f,2),h.get(p,f,3)],Math.sqrt(d[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},9405:function(t,e,r){var n=r(3327),i=r(8731),a=r(216),o=r(5091),s=r(2145),l=r(8866);function c(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function h(t,e){return t.name<e.name?-1:1}u.bind=function(){var t;this.program||this._relink();var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},u.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},u.update=function(t,e,r,c){if(!e||1===arguments.length){var u=t;t=u.vertex,e=u.fragment,r=u.uniforms,c=u.attributes}var d=this,p=d.gl,f=d._vref;d._vref=o.shader(p,p.VERTEX_SHADER,t),f&&f.dispose(),d.vertShader=d._vref.shader;var m=this._fref;if(d._fref=o.shader(p,p.FRAGMENT_SHADER,e),m&&m.dispose(),d.fragShader=d._fref.shader,!r||!c){var g=p.createProgram();if(p.attachShader(g,d.fragShader),p.attachShader(g,d.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(p,g),c=c||s.attributes(p,g),p.deleteProgram(g)}(c=c.slice()).sort(h);var v,x=[],b=[],_=[];for(v=0;v<c.length;++v){var w=c[v];if(w.type.indexOf("mat")>=0){for(var k=0|w.type.charAt(w.type.length-1),T=new Array(k),S=0;S<k;++S)T[S]=_.length,b.push(w.name+"["+S+"]"),"number"===typeof w.location?_.push(w.location+S):Array.isArray(w.location)&&w.location.length===k&&"number"===typeof w.location[S]?_.push(0|w.location[S]):_.push(-1);x.push({name:w.name,type:w.type,locations:T})}else x.push({name:w.name,type:w.type,locations:[_.length]}),b.push(w.name),"number"===typeof w.location?_.push(0|w.location):_.push(-1)}var A=0;for(v=0;v<_.length;++v)if(_[v]<0){for(;_.indexOf(A)>=0;)A+=1;_[v]=A}var M=new Array(r.length);function C(){d.program=o.program(p,d._vref,d._fref,b,_);for(var t=0;t<r.length;++t)M[t]=p.getUniformLocation(d.program,r[t].name)}C(),d._relink=C,d.types={uniforms:a(r),attributes:a(c)},d.attributes=i(p,d,x,_),Object.defineProperty(d,"uniforms",n(p,d,r,M))},t.exports=function(t,e,r,n,i){var a=new c(t);return a.update(e,r,n,i),a}},8866:function(t){function e(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}e.prototype=new Error,e.prototype.name="GLError",e.prototype.constructor=e,t.exports=e},8731:function(t,e,r){t.exports=function(t,e,r,i){for(var a={},o=0,c=r.length;o<c;++o){var u=r[o],h=u.name,d=u.type,p=u.locations;switch(d){case"bool":case"int":case"float":s(t,e,p[0],i,1,a,h);break;default:if(d.indexOf("vec")>=0){if((f=d.charCodeAt(d.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+d);s(t,e,p[0],i,f,a,h)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+d);var f;if((f=d.charCodeAt(d.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+d);l(t,e,p,i,f,a,h)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)s(t,e,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<i;++e)c[e].location=t[e];else for(e=0;e<i;++e)c[e].location=t+e;return t},get:function(){for(var t=new Array(i),e=0;e<i;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,a,o,s){e=e||t.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];t.vertexAttribPointer(c,i,e,a,o,s+l*i),t.enableVertexAttribArray(c)}};var h=new Array(i),d=t["vertexAttrib"+i+"fv"];Object.defineProperty(a,o,{set:function(e){for(var a=0;a<i;++a){var o=n[r[a]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))d.call(t,o,e[a]);else{for(var s=0;s<i;++s)h[s]=e[i*a+s];d.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}},3327:function(t,e,r){var n=r(216),i=r(8866);function a(t){return function(){return t}}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}t.exports=function(t,e,r,s){function l(e){return function(n){for(var a=c("",e),o=0;o<a.length;++o){var l=a[o],u=l[0],h=l[1];if(s[h]){var d=n;if("string"===typeof u&&(0===u.indexOf(".")||0===u.indexOf("["))){var p=u;if(0===u.indexOf(".")&&(p=u.slice(1)),p.indexOf("]")===p.length-1){var f=p.indexOf("["),m=p.slice(0,f),g=p.slice(f+1,p.length-1);d=m?n[m][g]:n[g]}else d=n[p]}var y,v=r[h].type;switch(v){case"bool":case"int":case"sampler2D":case"samplerCube":t.uniform1i(s[h],d);break;case"float":t.uniform1f(s[h],d);break;default:var x=v.indexOf("vec");if(!(0<=x&&x<=1&&v.length===4+x)){if(0===v.indexOf("mat")&&4===v.length){if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](s[h],!1,d);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[h],d);break;case"v":t["uniform"+y+"fv"](s[h],d);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e){if("object"!==typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(t,e,n){if("object"===typeof n){var c=h(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(u=n,function(t,e,r){return t.getUniform(e.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var u}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)u(e,r,t[r])}else for(var n in e={},t)u(e,n,t[n]);return e}var d=n(r,!0);return{get:a(h(d)),set:l(d),enumerable:!0,configurable:!0}}},216:function(t){t.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name.split("."),a=r,o=0;o<i.length;++o){var s=i[o].split("[");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<i.length-1?(c in a||(l<s.length-1?a[c]=[]:a[c]={}),a=a[c]):a[c]=e?n:t[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=e?n:t[n].type}return r}},2145:function(t,e){e.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=i(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},e.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&n.push({name:o.name,type:i(t,o.type)})}return n};var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},n=null;function i(t,e){if(!n){var i=Object.keys(r);n={};for(var a=0;a<i.length;++a){var o=i[a];n[t[o]]=r[o]}}return n[e]}},5091:function(t,e,r){e.shader=function(t,e,r){return u(t).getShaderReference(e,r)},e.program=function(t,e,r,n,i){return u(t).getProgram(e,r,n,i)};var n=r(8866),i=r(2992),a=new("undefined"===typeof WeakMap?r(606):WeakMap),o=0;function s(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0===--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(t){var e=a.get(t);return e||(e=new l(t),a.set(t,e)),e}c.getShaderReference=function(t,e){var r=this.gl,a=this.shaders[t===r.FRAGMENT_SHADER|0],l=a[e];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(t,e,r){var a=t.createShader(e);if(t.shaderSource(a,r),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(a);try{var s=i(o,r,e)}catch(l){throw console.warn("Failed to format compiler error: "+l),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return a}(r,t,e);l=a[e]=new s(o++,e,t,c,[],1,this)}return l},c.getProgram=function(t,e,r,i){var a=[t.id,e.id,r.join(":"),i.join(":")].join("@"),o=this.programs[a];return o&&this.gl.isProgram(o)||(this.programs[a]=o=function(t,e,r,i,a){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<i.length;++s)t.bindAttribLocation(o,a[s],i[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,i),t.programs.push(a),e.programs.push(a)),o}},1493:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));\n vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(t,e,r){var n=r(2762),i=r(8116),a=r(1493);t.exports=function(t,e){var r=[];function o(t,e,n,i,a,o){var s=[t,e,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(t,r),c=i(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=a(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new s(t,l,c,u);return h.update(e),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,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=s.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||o,s=t.view||o,l=t.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var d=c,p=u,f=0;f<3;++f)i&&i[f]<0?(d[f]=this.bounds[0][f],p[f]=this.bounds[1][f]):(d[f]=this.bounds[1][f],p[f]=this.bounds[0][f]);for(h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,d,p],n.uniforms.colors=this.colors,n.uniforms.screenShape=h,f=0;f<3;++f)n.uniforms.lineWidth=this.lineWidth[f]*this.pixelRatio,this.enabled[f]&&(r.draw(e.TRIANGLES,6,6*f),this.drawSides[f]&&r.draw(e.TRIANGLES,12,18+12*f));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6740:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // 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).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s<t.length;s++)for(var l=t[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=t.map((function(t){return function(t,e,r,a){for(var o=t.points,s=t.velocities,l=t.divergences,c=[],u=[],h=[],d=[],p=[],f=[],m=0,g=0,y=i.create(),v=i.create(),x=0;x<o.length;x++){var b=o[x],_=s[x],w=l[x];0===e&&(w=.05*r),g=n.length(_)/a,y=i.create(),n.copy(y,_),y[3]=w;for(var k=0;k<8;k++)p[k]=[b[0],b[1],b[2],k];if(d.length>0)for(k=0;k<8;k++){var T=(k+1)%8;c.push(d[k],p[k],p[T],p[T],d[T],d[k]),h.push(v,y,y,y,v,v),f.push(m,g,g,g,m,m);var S=c.length;u.push([S-6,S-5,S-4],[S-3,S-2,S-1])}var A=d;d=p,p=A;var M=v;v=y,y=M;var C=m;m=g,g=C}return{positions:c,cells:u,vectors:h,vertexIntensity:f}}(t,r,a,o)})),h=[],d=[],p=[],f=[];for(s=0;s<u.length;s++){var m=u[s],g=h.length;for(h=h.concat(m.positions),p=p.concat(m.vectors),f=f.concat(m.vertexIntensity),c=0;c<m.cells.length;c++){var y=m.cells[c],v=[];d.push(v);for(var x=0;x<y.length;x++)v.push(y[x]+g)}}return{positions:h,cells:d,vectors:p,vertexIntensity:f,colormap:e}},s=function(t,e){var r,n=t.length;for(r=0;r<n;r++){var i=t[r];if(i===e)return r;if(i>e)return r-1}return r},l=function(t,e,r){return t<e?e:t>r?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;n<r;n++){var i=Math.abs(t[n]-t[n-1]);i<e&&(e=i)}return e};t.exports=function(t,e){var r=t.startingPositions,i=t.maxLength||1e3,u=t.tubeSize||1,h=t.absoluteTubeSize,d=t.gridFill||"+x+y+z",p={};-1!==d.indexOf("-x")&&(p.reversedX=!0),-1!==d.indexOf("-y")&&(p.reversedY=!0),-1!==d.indexOf("-z")&&(p.reversedZ=!0),p.filled=a.indexOf(d.replace(/-/g,"").replace(/\+/g,""));var f=t.getVelocity||function(e){return function(t,e,r){var i=e.vectors,a=e.meshgrid,o=t[0],c=t[1],u=t[2],h=a[0].length,d=a[1].length,p=a[2].length,f=s(a[0],o),m=s(a[1],c),g=s(a[2],u),y=f+1,v=m+1,x=g+1;if(f=l(f,0,h-1),y=l(y,0,h-1),m=l(m,0,d-1),v=l(v,0,d-1),g=l(g,0,p-1),x=l(x,0,p-1),f<0||m<0||g<0||y>h-1||v>d-1||x>p-1)return n.create();var b,_,w,k,T,S,A=a[0][f],M=a[0][y],C=a[1][m],E=a[1][v],L=a[2][g],P=(o-A)/(M-A),I=(c-C)/(E-C),z=(u-L)/(a[2][x]-L);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(z)||(z=.5),r.reversedX&&(f=h-1-f,y=h-1-y),r.reversedY&&(m=d-1-m,v=d-1-v),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:T=g,S=x,w=m*p,k=v*p,b=f*p*d,_=y*p*d;break;case 4:T=g,S=x,b=f*p,_=y*p,w=m*p*h,k=v*p*h;break;case 3:w=m,k=v,T=g*d,S=x*d,b=f*d*p,_=y*d*p;break;case 2:w=m,k=v,b=f*d,_=y*d,T=g*d*h,S=x*d*h;break;case 1:b=f,_=y,T=g*h,S=x*h,w=m*h*p,k=v*h*p;break;default:b=f,_=y,w=m*h,k=v*h,T=g*h*d,S=x*h*d}var O=i[b+w+T],D=i[b+w+S],R=i[b+k+T],F=i[b+k+S],B=i[_+w+T],j=i[_+w+S],N=i[_+k+T],U=i[_+k+S],V=n.create(),q=n.create(),$=n.create(),H=n.create();n.lerp(V,O,B,P),n.lerp(q,D,j,P),n.lerp($,R,N,P),n.lerp(H,F,U,P);var W=n.create(),G=n.create();n.lerp(W,V,$,I),n.lerp(G,q,H,I);var Y=n.create();return n.lerp(Y,W,G,z),Y}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=f(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=f(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=f(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],y=e[0][0],v=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],k=function(t){var e=t[0],r=t[1],n=t[2];return!(e<y||e>b||r<v||r>_||n<x||n>w)},T=10*n.distance(e[0],e[1])/i,S=T*T,A=1,M=0,C=r.length;C>1&&(A=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;l<s;l++){var u=t[l],h=u[0],d=u[1],p=u[2];i[h]||(e.push(h),i[h]=!0),a[d]||(r.push(d),a[d]=!0),o[p]||(n.push(p),o[p]=!0)}var f=c(e),m=c(r),g=c(n),y=Math.min(f,m,g);return isFinite(y)?y:1}(r));for(var E=0;E<C;E++){var L=n.create();n.copy(L,r[E]);var P=[L],I=[],z=f(L),O=L;I.push(z);var D=[],R=m(L,z),F=n.length(R);isFinite(F)&&F>M&&(M=F),D.push(F),g.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*i&&P.length<i&&k(L);){B++;var j=n.clone(z),N=n.squaredLength(j);if(0===N)break;N>S&&n.scale(j,j,T/Math.sqrt(N)),n.add(j,j,L),z=f(j),n.squaredDistance(O,j)-S>-1e-4*S&&(P.push(j),O=j,I.push(z),R=m(j,z),F=n.length(R),isFinite(F)&&F>M&&(M=F),D.push(F)),L=j}}var U=o(g,t.colormap,M,A);return h?U.tubeScale=h:(0===M&&(M=1),U.tubeScale=.5*u*A/M),U};var u=r(6740),h=r(6405).createMesh;t.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:u,traceType:"streamtube"})}},990:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){t.exports=function(t){var e=t.gl,r=v(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),d=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),f=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,M,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new C(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,d,p,f,[0,0,0]),y={levels:[[],[],[]]};for(var k in t)y[k]=t[k];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),d=r(3711),p=r(6760),f=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,b=y.createPickShader,_=y.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],S=[[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 A(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=S[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var M=256;function C(t,e,r,n,i,a,o,l,c,u,d,p,f,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=d,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=f,this._dynamicVAO=m,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.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 E=C.prototype;E.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:M,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;r<e.length;++r){if(e.length<2)return 1;if(e[r][0]===t)return e[r][1];if(e[r][0]>t&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},E.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},E.isOpaque=function(){return!this.isTransparent()},E.pickSlots=1,E.setPickBase=function(t){this.pickId=t};var L=[0,0,0],P={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=P.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=P.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return P.showSurface=o,P.showContour=s,P}var z={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),D=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=f(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(p(s,n.view,n.model),p(s,n.projection,s),f(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=I(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(h.uniforms.permutation=S[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(h.uniforms.contourColor=this.highlightColor[i],h.uniforms.contourTint=this.highlightTint[i]):0!==o&&o-1!==this.highlightLevel[i]||(h.uniforms.contourColor=this.contourColor[i],h.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(h.uniforms.height=this.contourLevels[i][o],d.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(h.uniforms.model=u.projections[i],h.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){h.uniforms.permutation=S[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(h.uniforms.height=this.contourLevels[o][m],d.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(d.unbind(),(d=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=S[i],r.lineWidth(this.dynamicWidth[i]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(h.uniforms.model=u.projections[o],h.uniforms.clipBounds=u.clipBounds[o],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}E.draw=function(t){return R.call(this,t,!1)},E.drawTransparent=function(t){return R.call(this,t,!0)};var F={model:k,view:k,projection:k,inverseModel:k,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function B(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function j(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function N(t){if(Array.isArray(t)){if(Array.isArray(t))return[j(t[0]),j(t[1]),j(t[2])];var e=j(t);return[e.slice(),e.slice(),e.slice()]}}E.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=F;r.model=t.model||k,r.view=t.view||k,r.projection=t.projection||k,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=D;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=I(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=S[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=S[a],e.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},E.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,d=0;d<2;++d)for(var p=i+u,f=s+d,g=h*(d?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(p,f)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]<this.contourLevels[x].length-1){var b=this.contourLevels[x][v[x]],_=this.contourLevels[x][v[x]+1];Math.abs(b-c[x])>Math.abs(_-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},E.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},E.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=N(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,(function(t){return B(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=N(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var f=h(p.data,a);f.stride[o]=p.stride[0],f.stride[1^o]=0,this.padField(this._field[o],f)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var v=this._field,x=h(s.mallocFloat(3*v[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)g(x.pick(o),v[o],"mirror");var b=h(s.mallocFloat(3*v[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var _=x.get(0,o,y,0),w=x.get(0,o,y,1),k=x.get(1,o,y,0),S=x.get(1,o,y,1),A=x.get(2,o,y,0),M=x.get(2,o,y,1),C=k*M-S*A,E=A*w-M*_,L=_*S-w*k,P=Math.sqrt(C*C+E*E+L*L);P<1e-8?(P=Math.max(Math.abs(C),Math.abs(E),Math.abs(L)))<1e-8?(L=1,E=C=0,P=1):P=1/P:P=1/Math.sqrt(P),b.set(o,y,0,C*P),b.set(o,y,1,E*P),b.set(o,y,2,L*P)}s.free(x.data);var I=[1/0,1/0,1/0],z=[-1/0,-1/0,-1/0],O=1/0,D=-1/0,R=(a[0]-1)*(a[1]-1)*6,F=s.mallocFloat(n.nextPow2(10*R)),j=0,U=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var V=0;V<2;++V)for(var q=0;q<2;++q)for(var $=0;$<3;++$){var H=this._field[$].get(1+o+V,1+y+q);if(isNaN(H)||!isFinite(H))continue t}for($=0;$<6;++$){var W=o+T[$][0],G=y+T[$][1],Y=this._field[0].get(W+1,G+1),Z=this._field[1].get(W+1,G+1);H=this._field[2].get(W+1,G+1),C=b.get(W+1,G+1,0),E=b.get(W+1,G+1,1),L=b.get(W+1,G+1,2),t.intensity&&(X=t.intensity.get(W,G));var X=t.intensity?t.intensity.get(W,G):H+this.objectOffset[2];F[j++]=W,F[j++]=G,F[j++]=Y,F[j++]=Z,F[j++]=H,F[j++]=0,F[j++]=X,F[j++]=C,F[j++]=E,F[j++]=L,I[0]=Math.min(I[0],Y+this.objectOffset[0]),I[1]=Math.min(I[1],Z+this.objectOffset[1]),I[2]=Math.min(I[2],H+this.objectOffset[2]),O=Math.min(O,X),z[0]=Math.max(z[0],Y+this.objectOffset[0]),z[1]=Math.max(z[1],Z+this.objectOffset[1]),z[2]=Math.max(z[2],H+this.objectOffset[2]),D=Math.max(D,X),U+=1}}for(t.intensityBounds&&(O=+t.intensityBounds[0],D=+t.intensityBounds[1]),o=6;o<j;o+=10)F[o]=(F[o]-O)/(D-O);this._vertexCount=U,this._coordinateBuffer.update(F.subarray(0,j)),s.freeFloat(F),s.free(b.data),this.bounds=[I,z],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===O&&this.intensityBounds[1]===D||(r=!0),this.intensityBounds=[O,D]}if("levels"in t){var K=t.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(t,e){return t-e}));for(o=0;o<3;++o)for(y=0;y<K[o].length;++y)K[o][y]-=this.objectOffset[o];t:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<K[o].length;++y)if(K[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=K}if(r){v=this._field,a=this.shape;for(var J=[],Q=0;Q<3;++Q){var tt=this.contourLevels[Q],et=[],rt=[],nt=[0,0,0];for(o=0;o<tt.length;++o){var it=d(this._field[Q],tt[o]);et.push(J.length/5|0),U=0;t:for(y=0;y<it.cells.length;++y){var at=it.cells[y];for($=0;$<2;++$){var ot=it.positions[at[$]],st=ot[0],lt=0|Math.floor(st),ct=st-lt,ut=ot[1],ht=0|Math.floor(ut),dt=ut-ht,pt=!1;e:for(var ft=0;ft<3;++ft){nt[ft]=0;var mt=(Q+ft+1)%3;for(V=0;V<2;++V){var gt=V?ct:1-ct;for(W=0|Math.min(Math.max(lt+V,0),a[0]),q=0;q<2;++q){var yt=q?dt:1-dt;if(G=0|Math.min(Math.max(ht+q,0),a[1]),H=ft<2?this._field[mt].get(W,G):(this.intensity.get(W,G)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(H)||isNaN(H)){pt=!0;break e}var vt=gt*yt;nt[ft]+=vt*H}}}if(pt){if($>0){for(var xt=0;xt<5;++xt)J.pop();U-=1}continue t}J.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var bt=s.mallocFloat(J.length);for(o=0;o<J.length;++o)bt[o]=J[o];this._contourBuffer.update(bt),s.freeFloat(bt)}},E.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)s.freeFloat(this._field[t].data)},E.highlight=function(t){var e,r;if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;for(r=this.snapToData?t.dataCoordinate:t.position,e=0;e<3;++e)r[e]-=this.objectOffset[e];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],h=this._field[l],p=this._field[c],f=d(u,r[o]),m=f.cells,g=f.positions;for(this._dynamicOffsets[o]=n,e=0;e<m.length;++e)for(var y=m[e],v=0;v<2;++v){var x=g[y[v]],b=+x[0],_=0|b,w=0|Math.min(_+1,i[0]),k=b-_,T=1-k,S=+x[1],A=0|S,M=0|Math.min(A+1,i[1]),C=S-A,E=1-C,L=T*E,P=T*C,I=k*E,z=k*C,O=L*h.get(_,A)+P*h.get(_,M)+I*h.get(w,A)+z*h.get(w,M),D=L*p.get(_,A)+P*p.get(_,M)+I*p.get(w,A)+z*p.get(w,M);if(isNaN(O)||isNaN(D)){v&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=D,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),s.freeFloat(a)}}},7766:function(t,e,r){var n=r(9618),i=r(5298),a=r(1888);t.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"===typeof arguments[1])return g(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"===typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return function(t,e,r,n,i,a){var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new d(t,o,r,n,i,a)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=f(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,p,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var y=e.size;if(l)h=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];p=a.malloc(y,r);var x=n(p,o,v,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),h=p.subarray(0,y)}var b=m(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,c,h),l||a.free(p),new d(t,b,o[0],o[1],g,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function d(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=d.prototype;function f(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new d(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,h){var d=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=f(p,h.stride.slice());if("float32"===d?m=t.FLOAT:"float64"===d?(m=t.FLOAT,y=!1,d="float32"):"uint8"===d?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,d="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var b;b=l===t.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var _=n(b,p,[p[2],p[2]*p[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,h):i.assign(_,h),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,v)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,c=!!a.normalized,u=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,c,u,h)}else{if("number"===typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else for(t.bindBuffer(t.ARRAY_BUFFER,null),i=0;i<n;++i)t.disableVertexAttribArray(i)}},870:function(t,e,r){var n=r(1433);function i(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},t.exports=function(t){return new i(t)}},7518:function(t,e,r){var n=r(1433);function i(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function a(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}i.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(t,e,r){if(this.bind(),n(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var a=0;a<t.length;++a){var o=t[a];"number"===typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},t.exports=function(t,e){return new a(t,e,e.createVertexArrayOES())}},8116:function(t,e,r){var n=r(7518),i=r(870);function a(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}t.exports=function(t,e,r,o){var s,l=t.createVertexArray?new a(t):t.getExtension("OES_vertex_array_object");return(s=l?n(t,l):i(t)).update(e,r,o),s}},5632:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}},8192:function(t,e,r){t.exports=function(t,e){var r=n(t[0],t[1],t[2]),o=n(e[0],e[1],e[2]);i(r,r),i(o,o);var s=a(r,o);return s>1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s<l;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],a(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t};var n=r(1091)()},2825:function(t){t.exports=function(t,e,r){var n=new Float32Array(3);return n[0]=t,n[1]=e,n[2]=r,n}},2931:function(t,e,r){t.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}},868:function(t,e,r){t.exports=r(1387)},1387:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}},6658:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}},7417:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}},8107:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}},4505:function(t,e,r){t.exports=r(5847)},5847:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}},5093:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}},3536:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,d=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-d*-s,t[1]=h*c+p*-s+d*-o-u*-l,t[2]=d*c+p*-l+u*-s-h*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,d=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-d*-s,t[1]=h*c+p*-s+d*-o-u*-l,t[2]=d*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r<e.length;r++){var a=e[r];if("preprocessor"===a.type){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},5874:function(t,e,r){t.exports=function(t){var e,r,k,T=0,S=0,A=l,M=[],C=[],E=1,L=0,P=0,I=!1,z=!1,O="",D=a,R=n;"300 es"===(t=t||{}).version&&(D=s,R=o);var F={},B={};for(T=0;T<D.length;T++)F[D[T]]=!0;for(T=0;T<R.length;T++)B[R[T]]=!0;return function(t){return C=[],null!==t?function(t){var r;for(T=0,t.toString&&(t=t.toString()),O+=t.replace(/\r\n/g,"\n"),k=O.length;e=O[T],T<k;){switch(r=T,A){case u:T=$();break;case h:T=q();break;case d:T=V();break;case p:T=H();break;case f:T=Y();break;case _:T=G();break;case m:T=Z();break;case c:T=X();break;case x:T=U();break;case l:T=N()}r!==T&&("\n"===O[r]?(L=0,++E):++L)}return S+=T,O=O.slice(T),C}(t):(M.length&&j(M.join("")),A=b,j("(eof)"),C)};function j(t){t.length&&C.push({type:w[A],data:t,position:P,line:E,column:L})}function N(){return M=M.length?[]:M,"/"===r&&"*"===e?(P=S+T-1,A=u,r=e,T+1):"/"===r&&"/"===e?(P=S+T-1,A=h,r=e,T+1):"#"===e?(A=d,P=S+T,T):/\s/.test(e)?(A=x,P=S+T,T):(I=/\d/.test(e),z=/[^\w_]/.test(e),P=S+T,A=I?f:z?p:c,T)}function U(){return/[^\s]/g.test(e)?(j(M.join("")),A=l,T):(M.push(e),r=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===r?(M.push(e),r=e,T+1):(j(M.join("")),A=l,T)}function q(){return V()}function $(){return"/"===e&&"*"===r?(M.push(e),j(M.join("")),A=l,T+1):(M.push(e),r=e,T+1)}function H(){if("."===r&&/\d/.test(e))return A=m,T;if("/"===r&&"*"===e)return A=u,T;if("/"===r&&"/"===e)return A=h,T;if("."===e&&M.length){for(;W(M););return A=m,T}if(";"===e||")"===e||"("===e){if(M.length)for(;W(M););return j(e),A=l,T+1}var t=2===M.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;W(M););return A=l,T}return M.push(e),r=e,T+1}function W(t){for(var e,r,n=0;;){if(e=i.indexOf(t.slice(0,t.length+n).join("")),r=i[e],-1===e){if(n--+t.length>0)continue;r=t.slice(0,1).join("")}return j(r),P+=r.length,(M=M.slice(r.length)).length}}function G(){return/[^a-fA-F0-9]/.test(e)?(j(M.join("")),A=l,T):(M.push(e),r=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(M.push(e),A=m,r=e,T+1):"x"===e&&1===M.length&&"0"===M[0]?(A=_,M.push(e),r=e,T+1):/[^\d]/.test(e)?(j(M.join("")),A=l,T):(M.push(e),r=e,T+1)}function Z(){return"f"===e&&(M.push(e),r=e,T+=1),/[eE]/.test(e)?(M.push(e),r=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(j(M.join("")),A=l,T):(M.push(e),r=e,T+1)}function X(){if(/[^\d\w_]/.test(e)){var t=M.join("");return A=B[t]?v:F[t]?y:g,j(M.join("")),A=l,T}return M.push(e),r=e,T+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,d=2,p=3,f=4,m=5,g=6,y=7,v=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.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"])},6852:function(t){t.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","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"===typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},7520:function(t,e,r){var n=r(9507);t.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(r){t=!1}return t}()},3778:function(t,e){e.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=t[e+h];for(h+=d,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}},8954:function(t,e,r){t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),d=h.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var f=l.slice(),m=0;m<=i;++m)m===u&&(f[m]=-1);var g=f[0];f[0]=f[1],f[1]=g;var y=new a(f,new Array(i+1),!0);d[u]=y,p[u]=y}for(p[i+1]=h,u=0;u<=i;++u){f=d[u].vertices;var v=d[u].adjacent;for(m=0;m<=i;++m){var x=f[m];if(x<0)v[m]=h;else for(var b=0;b<=i;++b)d[b].vertices.indexOf(x)<0&&(v[m]=d[b])}}var _=new c(i,o,p),w=!!e;for(u=i+1;u<r;++u)_.insert(t[u],w);return _.boundary()};var n=r(3250),i=r(6803).Fw;function a(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function o(t,e,r){this.vertices=t,this.cell=e,this.index=r}function s(t,e){return i(t.vertices,e.vertices)}a.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var l=[];function c(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter((function(t){return!t.boundary})),this.tuple=new Array(t+1);for(var i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var a=l[t];a||(a=l[t]=function(t){var e=n[t+1];return e||(e=n),function(t){return function(){var e=this.tuple;return t.apply(this,e)}}(e)}(t)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var d=u[h];i[h]=d<0?e:a[d]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var d=a[u];a[u]=t;var p=this.orient();if(a[u]=d,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var d=[];h.length>0;){var p=(e=h.pop()).vertices,f=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=f[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)v[b]<0?(x=b,l[b]=t):l[b]=i[v[b]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=p.slice(),k=f.slice(),T=new a(w,k,!0);u.push(T);var S=_.indexOf(e);if(!(S<0))for(_[S]=T,k[m]=y,w[g]=-1,k[g]=e,f[g]=T,T.flip(),b=0;b<=n;++b){var A=w[b];if(!(A<0||A===r)){for(var M=new Array(n-1),C=0,E=0;E<=n;++E){var L=w[E];L<0||E===b||(M[C++]=L)}d.push(new o(M,T,b))}}}}}for(d.sort(s),g=0;g+1<d.length;g+=2){var P=d[g],I=d[g+1],z=P.index,O=I.index;z<0||O<0||(P.cell.adjacent[P.index]=I.cell,I.cell.adjacent[I.index]=P.cell)}},u.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},u.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,c=0,u=0;u<=t;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},3352:function(t,e,r){var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function h(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function d(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function p(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function m(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function g(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(p);var n=e[e.length>>1],a=[],o=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?a.push(l):n<l[0]?o.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(f),u.sort(m),new i(n,g(a),g(o),c,u)}function y(t){this.root=t}a.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},a.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,f),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,f);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t)for(this.count-=1,this.leftPoints.splice(a,1),s=n.ge(this.rightPoints,t,m);s<this.rightPoints.length&&this.rightPoints[s][1]===t[1];++s)if(this.rightPoints[s]===t)return this.rightPoints.splice(s,1),1;return 0},a.queryPoint=function(t,e){return t<this.mid?this.left&&(r=this.left.queryPoint(t,e))?r:u(this.leftPoints,t,e):t>this.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):d(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r))||e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:e<this.mid?u(this.leftPoints,e,r):t>this.mid?h(this.rightPoints,t,r):d(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(t){t.exports=!0},7163:function(t){function e(t){return!!t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"===typeof t.readFloatLE&&"function"===typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},5219:function(t){t.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),d=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],f=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,t))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,x,b=u[3],_=u[7],w=u[11],k=u[12],T=u[13],S=u[14],A=u[15];if(0!==b||0!==_||0!==w){if(d[0]=b,d[1]=_,d[2]=w,d[3]=A,!s(h,h))return!1;l(h,h),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,d,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=k,e[1]=T,e[2]=S,x=u,(v=p)[0][0]=x[0],v[0][1]=x[1],v[0][2]=x[2],v[1][0]=x[4],v[1][1]=x[5],v[1][2]=x[6],v[2][0]=x[8],v[2][1]=x[9],v[2][2]=x[10],r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(f,p[1],p[2]),c.dot(p[0],f)<0)for(var M=0;M<3;M++)r[M]*=-1,p[M][0]*=-1,p[M][1]*=-1,p[M][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var d=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!d||!p)&&(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},1811:function(t,e,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),d=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.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]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var f=p.prototype;f.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],d=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)d[c]=s[l++];var f=this.nextMatrix;for(c=0;c<16;++c)f[c]=s[l++],p=p&&d[c]===f[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=d[c];else i(o,d,f,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*b}},f.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},f.flush=function(t){var e=n.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},f.lastT=function(){return this._time[this._time.length-1]},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||d,n=n||this.computedUp,this.setMatrix(t,c(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},f.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&s(i,i,e),r&&o(i,i,r),n&&l(i,i,n),this.setMatrix(t,a(this.computedMatrix,i))};var m=[0,0,0];f.pan=function(t,e,r,n){m[0]=-(e||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;u(i,i,m),this.setMatrix(t,a(i,i))},f.translate=function(t,e,r,n){m[0]=e||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;u(i,i,m),this.setMatrix(t,i)},f.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},f.setDistance=function(t,e){this.computedRadius[0]=e},f.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},f.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},3090:function(t,e,r){t.exports=function(t){var e=t.length;if(e<3){for(var r=new Array(e),i=0;i<e;++i)r[i]=i;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}var a=new Array(e);for(i=0;i<e;++i)a[i]=i;a.sort((function(e,r){var n=t[e][0]-t[r][0];return n||t[e][1]-t[r][1]}));var o=[a[0],a[1]],s=[a[0],a[1]];for(i=2;i<e;++i){for(var l=a[i],c=t[l],u=o.length;u>1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,d=(i=0,o.length);i<d;++i)r[h++]=o[i];for(var p=s.length-2;p>0;--p)r[h++]=s[p];return r};var n=r(3250)[3]},351:function(t,e,r){t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function d(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function f(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",f),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",d),t.addEventListener("keydown",d),t.addEventListener("keypress",d),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",f),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",d),t.removeEventListener("keydown",d),t.removeEventListener("keypress",d),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(t,e){function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"===typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},e.element=r,e.x=function(t){if("object"===typeof t){if("offsetX"in t)return t.offsetX;var e=r(t).getBoundingClientRect();return t.clientX-e.left}return 0},e.y=function(t){if("object"===typeof t){if("offsetY"in t)return t.offsetY;var e=r(t).getBoundingClientRect();return t.clientY-e.top}return 0}},8512:function(t,e,r){var n=r(665);t.exports=function(t,e,r){"function"===typeof t&&(r=!!e,e=t,t=window);var i=n("ex",t),a=function(t){r&&t.preventDefault();var n=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=1;switch(t.deltaMode){case 1:s=i;break;case 2:s=window.innerHeight}if(a*=s,o*=s,(n*=s)||a||o)return e(n,a,o,t)};return t.addEventListener("wheel",a),a}},2640:function(t,e,r){var n=r(1888);t.exports=function(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!==typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var a=t.arrayArguments||1;a<1&&e("Must have at least one array argument");var o=t.scalarArguments||0;o<0&&e("Scalar arg count must be > 0"),"function"!==typeof t.vertex&&e("Must specify vertex creation function"),"function"!==typeof t.cell&&e("Must specify cell creation function"),"function"!==typeof t.phase&&e("Must specify phase function");for(var s=t.getters||[],l=new Array(a),c=0;c<a;++c)s.indexOf(c)>=0?l[c]=!0:l[c]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],d=a.data,p=0|a.offset,f=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-f,v=0,x=0|-m,b=0,_=-f-m|0,w=0,k=0|f,T=m-f*u|0,S=0,A=0,M=0,C=2*u|0,E=n(C),L=n(C),P=0,I=0,z=-1,O=-1,D=0,R=0|-u,F=0|u,B=0,j=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(S=0;S<u;++S)E[P++]=r(d[g],o,s,l),g+=k;if(g+=T,h>0){if(A=1,E[P++]=r(d[g],o,s,l),g+=k,u>0)for(S=1,c=d[g],I=E[P]=r(c,o,s,l),D=E[P+z],B=E[P+R],U=E[P+j],I===D&&I===B&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,D,B,U,o,s,l),V=L[P]=M++),P+=1,g+=k,S=2;S<u;++S)c=d[g],I=E[P]=r(c,o,s,l),D=E[P+z],B=E[P+R],U=E[P+j],I===D&&I===B&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,D,B,U,o,s,l),V=L[P]=M++,U!==D&&e(L[P+z],V,w,v,U,D,o,s,l)),P+=1,g+=k;for(g+=T,P=0,q=z,z=O,O=q,q=R,R=F,F=q,q=j,j=N,N=q,A=2;A<h;++A){if(E[P++]=r(d[g],o,s,l),g+=k,u>0)for(S=1,c=d[g],I=E[P]=r(c,o,s,l),D=E[P+z],B=E[P+R],U=E[P+j],I===D&&I===B&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,D,B,U,o,s,l),V=L[P]=M++,U!==B&&e(L[P+R],V,b,w,B,U,o,s,l)),P+=1,g+=k,S=2;S<u;++S)c=d[g],I=E[P]=r(c,o,s,l),D=E[P+z],B=E[P+R],U=E[P+j],I===D&&I===B&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,D,B,U,o,s,l),V=L[P]=M++,U!==B&&e(L[P+R],V,b,w,B,U,o,s,l),U!==D&&e(L[P+z],V,w,v,U,D,o,s,l)),P+=1,g+=k;1&A&&(P=0),q=z,z=O,O=q,q=R,R=F,F=q,q=j,j=N,N=q,g+=T}}i(L),i(E)}},"false,1,0":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],d=a.data,p=0|a.offset,f=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-f,v=0,x=0|-m,b=0,_=-f-m|0,w=0,k=0|m,T=f-m*h|0,S=0,A=0,M=0,C=2*h|0,E=n(C),L=n(C),P=0,I=0,z=-1,O=-1,D=0,R=0|-h,F=0|h,B=0,j=-h-1|0,N=h-1|0,U=0,V=0,q=0;for(A=0;A<h;++A)E[P++]=r(d[g],o,s,l),g+=k;if(g+=T,u>0){if(S=1,E[P++]=r(d[g],o,s,l),g+=k,h>0)for(A=1,c=d[g],I=E[P]=r(c,o,s,l),B=E[P+R],D=E[P+z],U=E[P+j],I===B&&I===D&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,B,D,U,o,s,l),V=L[P]=M++),P+=1,g+=k,A=2;A<h;++A)c=d[g],I=E[P]=r(c,o,s,l),B=E[P+R],D=E[P+z],U=E[P+j],I===B&&I===D&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,B,D,U,o,s,l),V=L[P]=M++,U!==D&&e(L[P+z],V,b,w,D,U,o,s,l)),P+=1,g+=k;for(g+=T,P=0,q=R,R=F,F=q,q=z,z=O,O=q,q=j,j=N,N=q,S=2;S<u;++S){if(E[P++]=r(d[g],o,s,l),g+=k,h>0)for(A=1,c=d[g],I=E[P]=r(c,o,s,l),B=E[P+R],D=E[P+z],U=E[P+j],I===B&&I===D&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,B,D,U,o,s,l),V=L[P]=M++,U!==B&&e(L[P+R],V,w,v,U,B,o,s,l)),P+=1,g+=k,A=2;A<h;++A)c=d[g],I=E[P]=r(c,o,s,l),B=E[P+R],D=E[P+z],U=E[P+j],I===B&&I===D&&I===U||(v=d[g+y],b=d[g+x],w=d[g+_],t(S,A,c,v,b,w,I,B,D,U,o,s,l),V=L[P]=M++,U!==D&&e(L[P+z],V,b,w,D,U,o,s,l),U!==B&&e(L[P+R],V,w,v,U,B,o,s,l)),P+=1,g+=k;1&S&&(P=0),q=R,R=F,F=q,q=z,z=O,O=q,q=j,j=N,N=q,g+=T}}i(L),i(E)}}}},6199:function(t,e,r){var n=r(1338),i={zero:function(t,e,r,n){var i=t[0];n|=0;var a=0,o=r[0];for(a=0;a<i;++a)e[n]=0,n+=o},fdTemplate1:function(t,e,r,n,i,a,o){var s=t[0],l=r[0],c=-1*l,u=l;n|=0,o|=0;var h=0,d=l,p=a[0];for(h=0;h<s;++h)i[o]=.5*(e[n+c]-e[n+u]),n+=d,o+=p},fdTemplate2:function(t,e,r,n,i,a,o,s,l,c){var u=t[0],h=t[1],d=r[0],p=r[1],f=a[0],m=a[1],g=l[0],y=l[1],v=-1*d,x=d,b=-1*p,_=p;n|=0,o|=0,c|=0;var w=0,k=0,T=p,S=d-h*p,A=m,M=f-h*m,C=y,E=g-h*y;for(k=0;k<u;++k){for(w=0;w<h;++w)i[o]=.5*(e[n+v]-e[n+x]),s[c]=.5*(e[n+b]-e[n+_]),n+=T,o+=A,c+=C;n+=S,o+=M,c+=E}}},a={cdiff:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),d=e[h];return d||(e[h]=d=t([a,o,s,l,c,u])),d(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},zero:function(t){var e={};return function(r){var n=r.dtype,i=r.order,a=[n,i.join()].join(),o=e[a];return o||(e[a]=o=t([n,i])),o(r.shape.slice(0),r.data,r.stride,0|r.offset)}},fdTemplate1:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=e[l];return c||(e[l]=c=t([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}},fdTemplate2:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),d=e[h];return d||(e[h]=d=t([a,o,s,l,c,u])),d(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}}};function o(t){return(0,a[t.funcName])(s.bind(void 0,t))}function s(t){return i[t.funcName]}function l(t){return o({funcName:t.funcName})}var c={},u={},h=l({funcName:"cdiff"}),d=l({funcName:"zero"});function p(t){return t in c?c[t]:c[t]=l({funcName:"fdTemplate"+t})}function f(t,e,r,n){return function(t,i){var a=i.shape.slice();return a[0]>2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"===typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[h,d],i=1;i<=r;++i)n.push(p(i));var a=f.apply(void 0,n);return u[e]=a,a}(r)(t,e)}},4317:function(t){function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r<t.shape[0],a=0<=r+1&&r+1<t.shape[0];return(1-n)*(i?+t.get(r):0)+n*(a?+t.get(r+1):0)}function r(t,e,r){var n=Math.floor(e),i=e-n,a=0<=n&&n<t.shape[0],o=0<=n+1&&n+1<t.shape[0],s=Math.floor(r),l=r-s,c=0<=s&&s<t.shape[1],u=0<=s+1&&s+1<t.shape[1],h=a&&c?t.get(n,s):0,d=a&&u?t.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&c?t.get(n+1,s):0))+l*((1-i)*d+i*(o&&u?t.get(n+1,s+1):0))}function n(t,e,r,n){var i=Math.floor(e),a=e-i,o=0<=i&&i<t.shape[0],s=0<=i+1&&i+1<t.shape[0],l=Math.floor(r),c=r-l,u=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],d=Math.floor(n),p=n-d,f=0<=d&&d<t.shape[2],m=0<=d+1&&d+1<t.shape[2],g=o&&u&&f?t.get(i,l,d):0,y=o&&h&&f?t.get(i,l+1,d):0,v=s&&u&&f?t.get(i+1,l,d):0,x=s&&h&&f?t.get(i+1,l+1,d):0,b=o&&u&&m?t.get(i,l,d+1):0,_=o&&h&&m?t.get(i,l+1,d+1):0;return(1-p)*((1-c)*((1-a)*g+a*v)+c*((1-a)*y+a*x))+p*((1-c)*((1-a)*b+a*(s&&u&&m?t.get(i+1,l,d+1):0))+c*((1-a)*_+a*(s&&h&&m?t.get(i+1,l+1,d+1):0)))}function i(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,c,u,h=0;t:for(e=0;e<1<<n;++e){for(c=1,u=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;c*=a[l],u+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;c*=1-a[l],u+=t.stride[l]*i[l]}h+=c*t.data[u]}return h}t.exports=function(t,a,o,s){switch(t.shape.length){case 0:return 0;case 1:return e(t,a);case 2:return r(t,a,o);case 3:return n(t,a,o,s);default:return i.apply(void 0,arguments)}},t.exports.d1=e,t.exports.d2=r,t.exports.d3=n},5298:function(t,e){var r={"float64,2,1,0":function(){return function(t,e,r,n,i){var a=t[0],o=t[1],s=t[2],l=r[0],c=r[1],u=r[2];n|=0;var h=0,d=0,p=0,f=u,m=c-s*u,g=l-o*c;for(p=0;p<a;++p){for(d=0;d<o;++d){for(h=0;h<s;++h)e[n]/=i,n+=f;n+=m}n+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(t,e,r,n,i,a,o,s){for(var l=t[0],c=t[1],u=t[2],h=r[0],d=r[1],p=r[2],f=a[0],m=a[1],g=a[2],y=n|=0,v=o|=0,x=0|t[0];x>0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|t[1];b>0;){b<64?(c=b,b=0):(c=64,b-=64),n=y+x*h+b*d,o=v+x*f+b*m;var _=0,w=0,k=0,T=p,S=h-u*p,A=d-l*h,M=g,C=f-u*g,E=m-l*f;for(k=0;k<c;++k){for(w=0;w<l;++w){for(_=0;_<u;++_)e[n]=i[o]*s,n+=T,o+=M;n+=S,o+=C}n+=A,o+=E}}}}},"float32,1,0,float32,1,0":function(){return function(t,e,r,n,i,a,o){var s=t[0],l=t[1],c=r[0],u=r[1],h=a[0],d=a[1];n|=0,o|=0;var p=0,f=0,m=u,g=c-l*u,y=d,v=h-l*d;for(f=0;f<s;++f){for(p=0;p<l;++p)e[n]=i[o],n+=m,o+=y;n+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(t,e,r,n,i,a,o){for(var s=t[0],l=t[1],c=r[0],u=r[1],h=a[0],d=a[1],p=n|=0,f=o|=0,m=0|t[1];m>0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=f+m*d+g*h;var y=0,v=0,x=u,b=c-l*u,_=d,w=h-l*d;for(v=0;v<s;++v){for(y=0;y<l;++y)e[n]=i[o],n+=x,o+=_;n+=b,o+=w}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(t,e,r,n,i,a,o){for(var s=t[0],l=t[1],c=t[2],u=r[0],h=r[1],d=r[2],p=a[0],f=a[1],m=a[2],g=n|=0,y=o|=0,v=0|t[2];v>0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|t[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+v*d+x*u+b*h,o=y+v*m+x*p+b*f;var _=0,w=0,k=0,T=d,S=u-c*d,A=h-s*u,M=m,C=p-c*m,E=f-s*p;for(k=0;k<l;++k){for(w=0;w<s;++w){for(_=0;_<c;++_)e[n]=i[o],n+=T,o+=M;n+=S,o+=C}n+=A,o+=E}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(t,e,r,n,i,a,o){var s=t[0],l=t[1],c=t[2],u=r[0],h=r[1],d=r[2],p=a[0],f=a[1],m=a[2];n|=0,o|=0;var g=0,y=0,v=0,x=d,b=u-c*d,_=h-s*u,w=m,k=p-c*m,T=f-s*p;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<c;++g)e[n]=i[o],n+=x,o+=w;n+=b,o+=k}n+=_,o+=T}}}},n=function(t,e){var n=e.join(",");return(0,r[n])()},i={mul:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),d=e[h];return d||(e[h]=d=t([a,o,s,l,c,u])),d(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},muls:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=e[c];return u||(e[c]=u=t([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},mulseq:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},div:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),d=e[h];return d||(e[h]=d=t([a,o,s,l,c,u])),d(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},divs:function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=e[c];return u||(e[c]=u=t([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},divseq:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},assign:function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=e[l];return c||(e[l]=c=t([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}}};function a(t){return e={funcName:t.funcName},(0,i[e.funcName])(n.bind(void 0,e));var e}var o={mul:"*",div:"/"};!function(){for(var t in o)e[t]=a({funcName:t}),e[t+"s"]=a({funcName:t+"s"}),e[t+"seq"]=a({funcName:t+"seq"})}(),e.assign=a({funcName:"assign"})},9994:function(t,e,r){var n=r(9618),i=r(8277);t.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},8277:function(t){var e=function(){return function(t,e,r,n,i){var a=t[0],o=t[1],s=t[2],l=r[0],c=r[1],u=r[2],h=[0,0,0];n|=0;var d=0,p=0,f=0,m=u,g=c-s*u,y=l-o*c;for(f=0;f<a;++f){for(p=0;p<o;++p){for(d=0;d<s;++d){var v,x=i;for(v=0;v<h.length-1;++v)x=x[h[v]];e[n]=x[h[h.length-1]],n+=m,++h[2]}n+=g,h[2]-=s,++h[1]}n+=y,h[1]-=o,++h[0]}}};t.exports=function(t){return r={funcName:t.funcName},function(t){var e={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=e[o];return s||(e[o]=s=t([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}}(e.bind(void 0,r));var r}({funcName:"convert"})},7640:function(t,e,r){var n=r(1888);function i(t){return"uint32"===t?[n.mallocUint32,n.freeUint32]:null}var a={"uint32,1,0":function(t,e){return function(r,n,i,a,o,s,l,c,u,h,d){var p,f,m,g,y,v,x,b,_=r*o+a,w=t(c);for(p=r+1;p<=n;++p){for(f=p,m=_+=o,y=0,v=_,g=0;g<c;++g)w[y++]=i[v],v+=u;t:for(;f-- >r;){y=0,v=m-o;e:for(g=0;g<c;++g){if((x=i[v])<(b=w[y]))break t;if(x>b)break e;v+=h,y+=d}for(y=m,v=m-o,g=0;g<c;++g)i[y]=i[v],y+=u,v+=u;m-=o}for(y=m,v=0,g=0;g<c;++g)i[y]=w[v++],y+=u}e(w)}}},o={"uint32,1,0":function(t,e,r){return function n(i,a,o,s,l,c,u,h,d,p,f){var m,g,y,v,x,b,_,w,k,T,S,A,M,C,E,L,P,I,z,O,D,R,F,B,j,N=(a-i+1)/6|0,U=i+N,V=a-N,q=i+a>>1,$=q-N,H=q+N,W=U,G=$,Y=q,Z=H,X=V,K=i+1,J=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);S=l*W,A=l*G,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=W,W=G,G=g;break t}if(rt<0)break t;j+=p}S=l*Z,A=l*X,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=Z,Z=X,X=g;break t}if(rt<0)break t;j+=p}S=l*W,A=l*Y,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=W,W=Y,Y=g;break t}if(rt<0)break t;j+=p}S=l*G,A=l*Y,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=G,G=Y,Y=g;break t}if(rt<0)break t;j+=p}S=l*W,A=l*Z,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=W,W=Z,Z=g;break t}if(rt<0)break t;j+=p}S=l*Y,A=l*Z,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;j+=p}S=l*G,A=l*X,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=G,G=X,X=g;break t}if(rt<0)break t;j+=p}S=l*G,A=l*Y,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=G,G=Y,Y=g;break t}if(rt<0)break t;j+=p}S=l*Z,A=l*X,j=s;t:for(T=0;T<h;++T){if(w=A+j,(rt=o[_=S+j]-o[w])>0){g=Z,Z=X,X=g;break t}if(rt<0)break t;j+=p}for(S=l*W,A=l*G,M=l*Y,C=l*Z,E=l*X,L=l*U,P=l*q,I=l*V,B=0,j=s,T=0;T<h;++T)_=S+j,w=A+j,k=M+j,z=C+j,O=E+j,D=L+j,R=P+j,F=I+j,it[B]=o[w],at[B]=o[z],Q=Q&&it[B]===at[B],y=o[_],v=o[k],x=o[O],o[D]=y,o[R]=v,o[F]=x,++B,j+=d;for(S=l*$,A=l*i,j=s,T=0;T<h;++T)w=A+j,o[_=S+j]=o[w],j+=d;for(S=l*H,A=l*a,j=s,T=0;T<h;++T)w=A+j,o[_=S+j]=o[w],j+=d;if(Q)for(b=K;b<=J;++b){for(_=s+b*l,B=0,T=0;T<h&&0===(rt=o[_]-it[B]);++T)B+=f,_+=p;if(0!==rt)if(rt<0){if(b!==K)for(S=l*b,A=l*K,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;++K}else for(;;){for(_=s+J*l,B=0,T=0;T<h&&0===(rt=o[_]-it[B]);++T)B+=f,_+=p;if(!(rt>0)){if(rt<0){for(S=l*b,A=l*K,M=l*J,j=s,T=0;T<h;++T)w=A+j,k=M+j,m=o[_=S+j],o[_]=o[w],o[w]=o[k],o[k]=m,j+=d;++K,--J;break}for(S=l*b,A=l*J,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;--J;break}J--}}else for(b=K;b<=J;++b){for(_=s+b*l,B=0,T=0;T<h&&0===(tt=o[_]-it[B]);++T)B+=f,_+=p;if(tt<0){if(b!==K)for(S=l*b,A=l*K,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;++K}else{for(_=s+b*l,B=0,T=0;T<h&&0===(et=o[_]-at[B]);++T)B+=f,_+=p;if(et>0)for(;;){for(_=s+J*l,B=0,T=0;T<h&&0===(rt=o[_]-at[B]);++T)B+=f,_+=p;if(!(rt>0)){for(_=s+J*l,B=0,T=0;T<h&&0===(rt=o[_]-it[B]);++T)B+=f,_+=p;if(rt<0){for(S=l*b,A=l*K,M=l*J,j=s,T=0;T<h;++T)w=A+j,k=M+j,m=o[_=S+j],o[_]=o[w],o[w]=o[k],o[k]=m,j+=d;++K,--J}else{for(S=l*b,A=l*J,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;--J}break}if(--J<b)break}}}for(S=l*i,A=l*(K-1),B=0,j=s,T=0;T<h;++T)w=A+j,o[_=S+j]=o[w],o[w]=it[B],++B,j+=d;for(S=l*a,A=l*(J+1),B=0,j=s,T=0;T<h;++T)w=A+j,o[_=S+j]=o[w],o[w]=at[B],++B,j+=d;if(K-2-i<=32?t(i,K-2,o,s,l,c,u,h,d,p,f):n(i,K-2,o,s,l,c,u,h,d,p,f),a-(J+2)<=32?t(J+2,a,o,s,l,c,u,h,d,p,f):n(J+2,a,o,s,l,c,u,h,d,p,f),Q)return r(it),void r(at);if(K<U&&J>V){t:for(;;){for(_=s+K*l,B=0,j=s,T=0;T<h;++T){if(o[_]!==it[B])break t;++B,_+=d}++K}t:for(;;){for(_=s+J*l,B=0,j=s,T=0;T<h;++T){if(o[_]!==at[B])break t;++B,_+=d}--J}for(b=K;b<=J;++b){for(_=s+b*l,B=0,T=0;T<h&&0===(tt=o[_]-it[B]);++T)B+=f,_+=p;if(0===tt){if(b!==K)for(S=l*b,A=l*K,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;++K}else{for(_=s+b*l,B=0,T=0;T<h&&0===(et=o[_]-at[B]);++T)B+=f,_+=p;if(0===et)for(;;){for(_=s+J*l,B=0,T=0;T<h&&0===(rt=o[_]-at[B]);++T)B+=f,_+=p;if(0!==rt){for(_=s+J*l,B=0,T=0;T<h&&0===(rt=o[_]-it[B]);++T)B+=f,_+=p;if(rt<0){for(S=l*b,A=l*K,M=l*J,j=s,T=0;T<h;++T)w=A+j,k=M+j,m=o[_=S+j],o[_]=o[w],o[w]=o[k],o[k]=m,j+=d;++K,--J}else{for(S=l*b,A=l*J,j=s,T=0;T<h;++T)w=A+j,m=o[_=S+j],o[_]=o[w],o[w]=m,j+=d;--J}break}if(--J<b)break}}}}r(it),r(at),J-K<=32?t(K,J,o,s,l,c,u,h,d,p,f):n(K,J,o,s,l,c,u,h,d,p,f)}}},s={"uint32,1,0":function(t,e){return function(r){var n=r.data,i=0|r.offset,a=r.shape,o=r.stride,s=0|o[0],l=0|a[0],c=0|o[1],u=0|a[1],h=c,d=c;l<=32?t(0,l-1,n,i,s,c,l,u,h,d,1):e(0,l-1,n,i,s,c,l,u,h,d,1)}}};t.exports=function(t,e){var r=[e,t].join(","),n=s[r],l=function(t,e){var r=i(e),n=[e,t].join(","),o=a[n];return r?o(r[0],r[1]):o()}(t,e),c=function(t,e,r){var n=i(e),a=[e,t].join(","),s=o[a];return t.length>1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},446:function(t,e,r){var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!==typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(a);var n=new Array(r.length);for(t=0;t<n.length;++t)n[t]=r[t][1];return n}var s={T:function(t){function e(t){this.data=t}var r=e.prototype;return r.dtype=t,r.index=function(){return-1},r.size=0,r.dimension=-1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new e(this.data)},r.get=r.set=function(){},r.pick=function(){return null},function(t){return new e(t)}},0:function(t,e){function r(t,e){this.data=t,this.offset=e}var n=r.prototype;return n.dtype=t,n.index=function(){return this.offset},n.dimension=0,n.size=1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new r(this.data,this.offset)},n.pick=function(){return e(this.data)},n.valueOf=n.get=function(){return"generic"===t?this.data.get(this.offset):this.data[this.offset]},n.set=function(e){return"generic"===t?this.data.set(this.offset,e):this.data[this.offset]=e},function(t,e,n,i){return new r(t,i)}},1:function(t,e,r){function n(t,e,r,n){this.data=t,this.shape=[e],this.stride=[r],this.offset=0|n}var i=n.prototype;return i.dtype=t,i.dimension=1,Object.defineProperty(i,"size",{get:function(){return this.shape[0]}}),i.order=[0],i.set=function(e,r){return"generic"===t?this.data.set(this.offset+this.stride[0]*e,r):this.data[this.offset+this.stride[0]*e]=r},i.get=function(e){return"generic"===t?this.data.get(this.offset+this.stride[0]*e):this.data[this.offset+this.stride[0]*e]},i.index=function(t){return this.offset+this.stride[0]*t},i.hi=function(t){return new n(this.data,"number"!==typeof t||t<0?this.shape[0]:0|t,this.stride[0],this.offset)},i.lo=function(t){var e=this.offset,r=0,i=this.shape[0],a=this.stride[0];return"number"===typeof t&&t>=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"===typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!==typeof t||t<0?this.shape[0]:0|t,"number"!==typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"===typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"===typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"===typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"===typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!==typeof t||t<0?this.shape[0]:0|t,"number"!==typeof e||e<0?this.shape[1]:0|e,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"===typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"===typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"===typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,d=Math.ceil;return"number"===typeof t&&((h=0|t)<0?(u+=s*(i-1),i=d(-i/h)):i=d(i/h),s*=h),"number"===typeof e&&((h=0|e)<0?(u+=l*(a-1),a=d(-a/h)):a=d(a/h),l*=h),"number"===typeof r&&((h=0|r)<0?(u+=c*(o-1),o=d(-o/h)):o=d(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"===typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!==typeof t||t<0?this.shape[0]:0|t,"number"!==typeof e||e<0?this.shape[1]:0|e,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],d=this.stride[1],p=this.stride[2],f=this.stride[3];return"number"===typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"===typeof e&&e>=0&&(a+=d*(o=0|e),l-=o),"number"===typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"===typeof i&&i>=0&&(a+=f*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,d,p,f,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],d=this.stride[3],p=this.offset,f=0,m=Math.ceil;return"number"===typeof t&&((f=0|t)<0?(p+=c*(a-1),a=m(-a/f)):a=m(a/f),c*=f),"number"===typeof e&&((f=0|e)<0?(p+=u*(o-1),o=m(-o/f)):o=m(o/f),u*=f),"number"===typeof r&&((f=0|r)<0?(p+=h*(s-1),s=m(-s/f)):s=m(s/f),h*=f),"number"===typeof i&&((f=0|i)<0?(p+=d*(l-1),l=m(-l/f)):l=m(l/f),d*=f),new n(this.data,a,o,s,l,c,u,h,d,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!==typeof t||t<0?this.shape[0]:0|t,"number"!==typeof e||e<0?this.shape[1]:0|e,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],d=this.shape[4],p=this.stride[0],f=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"===typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"===typeof e&&e>=0&&(o+=f*(s=0|e),c-=s),"number"===typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"===typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"===typeof a&&a>=0&&(o+=y*(s=0|a),d-=s),new n(this.data,l,c,u,h,d,p,f,m,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],d=this.stride[1],p=this.stride[2],f=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"===typeof t&&((y=0|t)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"===typeof e&&((y=0|e)<0?(g+=d*(s-1),s=v(-s/y)):s=v(s/y),d*=y),"number"===typeof r&&((y=0|r)<0?(g+=p*(l-1),l=v(-l/y)):l=v(l/y),p*=y),"number"===typeof i&&((y=0|i)<0?(g+=f*(c-1),c=v(-c/y)):c=v(c/y),f*=y),"number"===typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,d,p,f,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"===typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a)for(a=0,s=0;s<o;++s)r[s]<0&&(a-=(e[s]-1)*r[s]);for(var h=function(t){if(n(t))return"buffer";if(i)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(t)?"array":"generic"}(t),d=c[h];d.length<=o+1;)d.push(l(h,d.length-1));return(0,d[o+1])(t,e,r,a)}},1278:function(t,e,r){var n=r(2361),i=Math.pow(2,-1074),a=-1>>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t===t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(o=0;o<t.length;++o)for(var s=t[o],l=0,c=s[s.length-1],u=s[0],h=0;h<s.length;++h){l=c,c=u,u=s[(h+1)%s.length];for(var d=e[l],p=e[c],f=e[u],m=new Array(3),g=0,y=new Array(3),v=0,x=0;x<3;++x)m[x]=d[x]-p[x],g+=m[x]*m[x],y[x]=f[x]-p[x],v+=y[x]*y[x];if(g*v>a){var b=i[c],_=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(y[w]*m[k]-y[k]*m[w])}}}for(o=0;o<n;++o){b=i[o];var T=0;for(x=0;x<3;++x)T+=b[x]*b[x];if(T>a)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=t[o],l=new Array(3),c=0;c<3;++c)l[c]=e[s[c]];var u=new Array(3),h=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],h[c]=l[2][c]-l[0][c];var d=new Array(3),p=0;for(c=0;c<3;++c){var f=(c+1)%3,m=(c+2)%3;d[c]=u[f]*h[m]-u[m]*h[f],p+=d[c]*d[c]}for(p=p>a?1/Math.sqrt(p):0,c=0;c<3;++c)d[c]*=p;i[o]=d}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var d=Math.max(e,a,c);h=Math.sqrt(2*d-u+1),e>=d?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=d?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var d=h.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],d=i[8],p=u*a+h*o+d*s,f=l(u-=a*p,h-=o*p,d-=s*p);u/=f,h/=f,d/=f;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*d,b=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*d);m/=b,g/=b,y/=b;var _=u*e+a*r,w=h*e+o*r,k=d*e+s*r;this.center.move(t,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(t,Math.log(T))},d.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],d=i[9],p=i[2],f=i[6],m=i[10],g=e*a+r*u,y=e*o+r*h,v=e*s+r*d,x=-(f*v-m*y),b=-(m*g-p*v),_=-(p*y-f*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=c(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,S=T[0],A=T[1],M=T[2],C=T[3],E=S*w+C*x+A*_-M*b,L=A*w+C*b+M*x-S*_,P=M*w+C*_+S*b-A*x,I=C*w-S*x-A*b-M*_;if(n){x=p,b=f,_=m;var z=Math.sin(n)/l(x,b,_);x*=z,b*=z,_*=z,I=I*(w=Math.cos(e))-(E=E*w+I*x+L*_-P*b)*x-(L=L*w+I*b+P*x-E*_)*b-(P=P*w+I*_+E*b-L*x)*_}var O=c(E,L,P,I);O>1e-6?(E/=O,L/=O,P/=O,I/=O):(E=L=P=0,I=1),this.rotation.set(t,E,L,P,I)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){var n=r(3233);t.exports=function(t,e,r){return n(r="undefined"!==typeof r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o<r;++o)a[0][o]=[],a[1][o]=[];for(o=0;o<i;++o){var s=t[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}var l,c=[];for(o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&c.push([o]);function u(t,e){var r=a[e][t[e]];r.splice(r.indexOf(t),1)}function h(t,r,i){for(var o,s,l,c=0;c<2;++c)if(a[c][r].length>0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var d=a[h][r],p=0;p<d.length;++p){var f=d[p],m=f[1^h];n(e[t],e[r],e[s],e[m])>0&&(o=f,s=m,l=h)}return i||o&&u(o,l),s}function d(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],c=t,d=o[1],p=h(l,c,!0);if(n(e[l],e[c],e[d],e[p])<0)break;o.push(t),s=h(l,c)}return o}for(o=0;o<r;++o)for(var p=0;p<2;++p){for(var f=[];a[p][o].length>0;){a[0][o].length;var m=d(o,p);(l=m)[1]===l[l.length-1]?f.push.apply(f,m):(f.length>0&&c.push(f),f=m)}f.length>0&&c.push(f)}return c};var n=r(3140)},5609:function(t,e,r){t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,i[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){i[p=o.pop()]=!1;var c=r[p];for(s=0;s<c.length;++s){var u=c[s];0===--a[u]&&o.push(u)}}var h=new Array(e.length),d=[];for(s=0;s<e.length;++s)if(i[s]){var p=d.length;h[s]=p,d.push(e[s])}else h[s]=-1;var f=[];for(s=0;s<t.length;++s){var m=t[s];i[m[0]]&&i[m[1]]&&f.push([h[m[0]],h[m[1]]])}return[f,d]};var n=r(3134)},2095:function(t,e,r){t.exports=function(t,e){var r=c(t,e);t=r[0];for(var h=(e=r[1]).length,d=(t.length,n(t,e.length)),p=0;p<h;++p)if(d[p].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var f=i(t,e),m=(f=f.filter((function(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],l=e[t[(i+1)%r]],c=o(-a[0],a[1]),u=o(-a[0],l[1]),h=o(l[0],a[1]),d=o(l[0],l[1]);n=s(n,s(s(c,u),s(h,d)))}return n[n.length-1]>0}))).length,g=new Array(m),y=new Array(m);for(p=0;p<m;++p){g[p]=p;var v=new Array(m),x=f[p].map((function(t){return e[t]})),b=a([x]),_=0;t:for(var w=0;w<m;++w)if(v[w]=0,p!==w){for(var k=(q=f[w]).length,T=0;T<k;++T){var S=b(e[q[T]]);if(0!==S){S<0&&(v[w]=1,_+=1);continue t}}v[w]=1,_+=1}y[p]=[_,p,v]}for(y.sort((function(t,e){return e[0]-t[0]})),p=0;p<m;++p){var A=(v=y[p])[1],M=v[2];for(w=0;w<m;++w)M[w]&&(g[w]=A)}var C=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}(m);for(p=0;p<m;++p)C[p].push(g[p]),C[g[p]].push(p);var E={},L=u(h,!1);for(p=0;p<m;++p)for(k=(q=f[p]).length,w=0;w<k;++w){var P=q[w],I=q[(w+1)%k],z=Math.min(P,I)+":"+Math.max(P,I);if(z in E){var O=E[z];C[O].push(p),C[p].push(O),L[P]=L[I]=!0}else E[z]=p}function D(t){for(var e=t.length,r=0;r<e;++r)if(!L[t[r]])return!1;return!0}var R=[],F=u(m,-1);for(p=0;p<m;++p)g[p]!==p||D(f[p])?F[p]=-1:(R.push(p),F[p]=0);for(r=[];R.length>0;){var B=R.pop(),j=C[B];l(j,(function(t,e){return t-e}));var N,U=j.length,V=F[B];for(0===V&&(N=[q=f[B]]),p=0;p<U;++p){var q,$=j[p];F[$]>=0||(F[$]=1^V,R.push($),0===V&&(D(q=f[$])||(q.reverse(),N.push(q))))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}},5085:function(t,e,r){t.exports=function(t){for(var e=t.length,r=[],a=[],s=0;s<e;++s)for(var u=t[s],h=u.length,d=h-1,p=0;p<h;d=p++){var f=u[d],m=u[p];f[0]===m[0]?a.push([f,m]):r.push([f,m])}if(0===r.length)return 0===a.length?c:(g=l(a),function(t){return g(t[0],t[1])?0:1});var g,y=i(r),v=function(t,e){return function(r){var i=o.le(e,r[0]);if(i<0)return 1;var a=t[i];if(!a){if(!(i>0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)a=a.left;else{if(!(c>0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),v)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r<t.length;++r){var n=t[r],i=n[0][0],o=n[0][1],l=n[1][1],c=[Math.min(o,l),Math.max(o,l)];i in e?e[i].push(c):e[i]=[c]}var u={},h=Object.keys(e);for(r=0;r<h.length;++r){var d=e[h[r]];u[h[r]]=a(d)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(t){return 1}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),n=new Float64Array(4);t.exports=function(t,i,a,o,s){e.length<o.length&&(e=new Float64Array(o.length),r=new Float64Array(o.length),n=new Float64Array(o.length));for(var l=0;l<o.length;++l)e[l]=t[l]-o[l],r[l]=i[l]-t[l],n[l]=a[l]-t[l];var c=0,u=0,h=0,d=0,p=0,f=0;for(l=0;l<o.length;++l){var m=r[l],g=n[l],y=e[l];c+=m*m,u+=m*g,h+=g*g,d+=y*m,p+=y*g,f+=y*y}var v,x,b,_,w,k=Math.abs(c*h-u*u),T=u*p-h*d,S=u*d-c*p;if(T+S<=k)if(T<0)S<0&&d<0?(S=0,-d>=c?(T=1,v=c+2*d+f):v=d*(T=-d/c)+f):(T=0,p>=0?(S=0,v=f):-p>=h?(S=1,v=h+2*p+f):v=p*(S=-p/h)+f);else if(S<0)S=0,d>=0?(T=0,v=f):-d>=c?(T=1,v=c+2*d+f):v=d*(T=-d/c)+f;else{var A=1/k;v=(T*=A)*(c*T+u*(S*=A)+2*d)+S*(u*T+h*S+2*p)+f}else T<0?(b=h+p)>(x=u+d)?(_=b-x)>=(w=c-2*u+h)?(T=1,S=0,v=c+2*d+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*d)+S*(u*T+h*S+2*p)+f:(T=0,b<=0?(S=1,v=h+2*p+f):p>=0?(S=0,v=f):v=p*(S=-p/h)+f):S<0?(b=c+d)>(x=u+p)?(_=b-x)>=(w=c-2*u+h)?(S=1,T=0,v=h+2*p+f):v=(T=1-(S=_/w))*(c*T+u*S+2*d)+S*(u*T+h*S+2*p)+f:(S=0,b<=0?(T=1,v=c+2*d+f):d>=0?(T=0,v=f):v=d*(T=-d/c)+f):(_=h+p-u-d)<=0?(T=0,S=1,v=h+2*p+f):_>=(w=c-2*u+h)?(T=1,S=0,v=c+2*d+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*d)+S*(u*T+h*S+2*p)+f;var M=1-T-S;for(l=0;l<o.length;++l)s[l]=M*t[l]+T*i[l]+S*a[l];return v<0?0:v}},8648:function(t,e,r){t.exports=r(783)},2653:function(t,e,r){var n=r(3865);t.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},5838:function(t,e,r){t.exports=function(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=n(t[r]);return e};var n=r(7842)},8987:function(t,e,r){var n=r(7842),i=r(6504);t.exports=function(t,e){for(var r=n(e),a=t.length,o=new Array(a),s=0;s<a;++s)o[s]=i(t[s],r);return o}},544:function(t,e,r){var n=r(5572);t.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a<r;++a)i[a]=n(t[a],e[a]);return i}},5771:function(t,e,r){var n=r(8507),i=r(3788),a=r(2419);t.exports=function(t){t.sort(i);for(var e=t.length,r=0,o=0;o<e;++o){var s=t[o],l=a(s);if(0!==l){if(r>0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){var e,r="";t.exports=function(t,n){if("string"!==typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||"undefined"===typeof e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i<e;++i){var s,l;(l=(s=r)-((r=(a=t[i])+s)-a))&&(t[o++]=l)}return t[o++]=r,t.length=o,t}},2962:function(t,e,r){var n=r(5250),i=r(8210),a=r(3012),o=r(7004);function s(t,e,r,n){return function(e){return n(t(r(e[0][0],e[1][1]),r(-e[0][1],e[1][0])))}}function l(t,e,r,n){return function(i){return n(t(e(t(r(i[1][1],i[2][2]),r(-i[1][2],i[2][1])),i[0][0]),t(e(t(r(i[1][0],i[2][2]),r(-i[1][2],i[2][0])),-i[0][1]),e(t(r(i[1][0],i[2][1]),r(-i[1][1],i[2][0])),i[0][2]))))}}function c(t,e,r,n){return function(i){return n(t(t(e(t(e(t(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][1]),t(e(t(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),-i[1][2]),e(t(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),e(t(e(t(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][0]),t(e(t(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][2]),e(t(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),t(e(t(e(t(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),i[1][0]),t(e(t(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][1]),e(t(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),e(t(e(t(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][0]),t(e(t(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),-i[1][1]),e(t(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function u(t,e,r,n){return function(i){return n(t(t(e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),t(e(t(t(e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),e(t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i[0][2]),t(e(t(t(e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][0]),e(t(e(t(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][2]),e(t(e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][4]))),-i[0][3]),e(t(t(e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),i[1][0]),e(t(e(t(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][1])),t(e(t(e(t(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),i[1][2]),e(t(e(t(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),t(e(t(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),e(t(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][3]))),i[0][4])))))}}function h(t){return(2===t?s:3===t?l:4===t?c:5===t?u:void 0)(i,a,n,o)}var d=[function(){return[0]},function(t){return[t[0][0]]}];function p(t,e,r,n,i,a,o,s){return function(l){switch(l.length){case 0:return t(l);case 1:return e(l);case 2:return r(l);case 3:return n(l);case 4:return i(l);case 5:return a(l)}var c=o[l.length];return c||(c=o[l.length]=s(l.length)),c(l)}}!function(){for(;d.length<6;)d.push(h(d.length));t.exports=p.apply(void 0,d.concat([d,h]));for(var e=0;e<d.length;++e)t.exports[e]=d[e]}()},1944:function(t,e,r){var n=r(5250),i=r(8210);t.exports=function(t,e){for(var r=n(t[0],e[0]),a=1;a<t.length;++a)r=i(r,n(t[a],e[a]));return r}},2646:function(t,e,r){var n=r(5250),i=r(8210),a=r(8545),o=r(3012);function s(t){return(3===t?l:4===t?c:5===t?u:h)(i,a,n,o)}function l(t,e,r,n){return function(i,a,o){var s=r(i[0],i[0]),l=n(s,a[0]),c=n(s,o[0]),u=r(a[0],a[0]),h=n(u,i[0]),d=n(u,o[0]),p=r(o[0],o[0]),f=n(p,i[0]),m=n(p,a[0]),g=t(e(m,d),e(h,l)),y=e(f,c),v=e(g,y);return v[v.length-1]}}function c(t,e,r,n){return function(i,a,o,s){var l=t(r(i[0],i[0]),r(i[1],i[1])),c=n(l,a[0]),u=n(l,o[0]),h=n(l,s[0]),d=t(r(a[0],a[0]),r(a[1],a[1])),p=n(d,i[0]),f=n(d,o[0]),m=n(d,s[0]),g=t(r(o[0],o[0]),r(o[1],o[1])),y=n(g,i[0]),v=n(g,a[0]),x=n(g,s[0]),b=t(r(s[0],s[0]),r(s[1],s[1])),_=n(b,i[0]),w=n(b,a[0]),k=n(b,o[0]),T=t(t(n(e(k,x),a[1]),t(n(e(w,m),-o[1]),n(e(v,f),s[1]))),t(n(e(w,m),i[1]),t(n(e(_,h),-a[1]),n(e(p,c),s[1])))),S=t(t(n(e(k,x),i[1]),t(n(e(_,h),-o[1]),n(e(y,u),s[1]))),t(n(e(v,f),i[1]),t(n(e(y,u),-a[1]),n(e(p,c),o[1])))),A=e(T,S);return A[A.length-1]}}function u(t,e,r,n){return function(i,a,o,s,l){var c=t(r(i[0],i[0]),t(r(i[1],i[1]),r(i[2],i[2]))),u=n(c,a[0]),h=n(c,o[0]),d=n(c,s[0]),p=n(c,l[0]),f=t(r(a[0],a[0]),t(r(a[1],a[1]),r(a[2],a[2]))),m=n(f,i[0]),g=n(f,o[0]),y=n(f,s[0]),v=n(f,l[0]),x=t(r(o[0],o[0]),t(r(o[1],o[1]),r(o[2],o[2]))),b=n(x,i[0]),_=n(x,a[0]),w=n(x,s[0]),k=n(x,l[0]),T=t(r(s[0],s[0]),t(r(s[1],s[1]),r(s[2],s[2]))),S=n(T,i[0]),A=n(T,a[0]),M=n(T,o[0]),C=n(T,l[0]),E=t(r(l[0],l[0]),t(r(l[1],l[1]),r(l[2],l[2]))),L=n(E,i[0]),P=n(E,a[0]),I=n(E,o[0]),z=n(E,s[0]),O=t(t(t(n(t(n(e(z,C),o[1]),t(n(e(I,k),-s[1]),n(e(M,w),l[1]))),a[2]),t(n(t(n(e(z,C),a[1]),t(n(e(P,v),-s[1]),n(e(A,y),l[1]))),-o[2]),n(t(n(e(I,k),a[1]),t(n(e(P,v),-o[1]),n(e(_,g),l[1]))),s[2]))),t(n(t(n(e(M,w),a[1]),t(n(e(A,y),-o[1]),n(e(_,g),s[1]))),-l[2]),t(n(t(n(e(z,C),a[1]),t(n(e(P,v),-s[1]),n(e(A,y),l[1]))),i[2]),n(t(n(e(z,C),i[1]),t(n(e(L,p),-s[1]),n(e(S,d),l[1]))),-a[2])))),t(t(n(t(n(e(P,v),i[1]),t(n(e(L,p),-a[1]),n(e(m,u),l[1]))),s[2]),t(n(t(n(e(A,y),i[1]),t(n(e(S,d),-a[1]),n(e(m,u),s[1]))),-l[2]),n(t(n(e(M,w),a[1]),t(n(e(A,y),-o[1]),n(e(_,g),s[1]))),i[2]))),t(n(t(n(e(M,w),i[1]),t(n(e(S,d),-o[1]),n(e(b,h),s[1]))),-a[2]),t(n(t(n(e(A,y),i[1]),t(n(e(S,d),-a[1]),n(e(m,u),s[1]))),o[2]),n(t(n(e(_,g),i[1]),t(n(e(b,h),-a[1]),n(e(m,u),o[1]))),-s[2]))))),D=t(t(t(n(t(n(e(z,C),o[1]),t(n(e(I,k),-s[1]),n(e(M,w),l[1]))),i[2]),n(t(n(e(z,C),i[1]),t(n(e(L,p),-s[1]),n(e(S,d),l[1]))),-o[2])),t(n(t(n(e(I,k),i[1]),t(n(e(L,p),-o[1]),n(e(b,h),l[1]))),s[2]),n(t(n(e(M,w),i[1]),t(n(e(S,d),-o[1]),n(e(b,h),s[1]))),-l[2]))),t(t(n(t(n(e(I,k),a[1]),t(n(e(P,v),-o[1]),n(e(_,g),l[1]))),i[2]),n(t(n(e(I,k),i[1]),t(n(e(L,p),-o[1]),n(e(b,h),l[1]))),-a[2])),t(n(t(n(e(P,v),i[1]),t(n(e(L,p),-a[1]),n(e(m,u),l[1]))),o[2]),n(t(n(e(_,g),i[1]),t(n(e(b,h),-a[1]),n(e(m,u),o[1]))),-l[2])))),R=e(O,D);return R[R.length-1]}}function h(t,e,r,n){return function(i,a,o,s,l,c){var u=t(t(r(i[0],i[0]),r(i[1],i[1])),t(r(i[2],i[2]),r(i[3],i[3]))),h=n(u,a[0]),d=n(u,o[0]),p=n(u,s[0]),f=n(u,l[0]),m=n(u,c[0]),g=t(t(r(a[0],a[0]),r(a[1],a[1])),t(r(a[2],a[2]),r(a[3],a[3]))),y=n(g,i[0]),v=n(g,o[0]),x=n(g,s[0]),b=n(g,l[0]),_=n(g,c[0]),w=t(t(r(o[0],o[0]),r(o[1],o[1])),t(r(o[2],o[2]),r(o[3],o[3]))),k=n(w,i[0]),T=n(w,a[0]),S=n(w,s[0]),A=n(w,l[0]),M=n(w,c[0]),C=t(t(r(s[0],s[0]),r(s[1],s[1])),t(r(s[2],s[2]),r(s[3],s[3]))),E=n(C,i[0]),L=n(C,a[0]),P=n(C,o[0]),I=n(C,l[0]),z=n(C,c[0]),O=t(t(r(l[0],l[0]),r(l[1],l[1])),t(r(l[2],l[2]),r(l[3],l[3]))),D=n(O,i[0]),R=n(O,a[0]),F=n(O,o[0]),B=n(O,s[0]),j=n(O,c[0]),N=t(t(r(c[0],c[0]),r(c[1],c[1])),t(r(c[2],c[2]),r(c[3],c[3]))),U=n(N,i[0]),V=n(N,a[0]),q=n(N,o[0]),$=n(N,s[0]),H=n(N,l[0]),W=t(t(t(n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),o[2]),n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),-s[2])),t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),l[2]),n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),-c[2]))),a[3]),t(n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),a[2]),n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),-s[2])),t(n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),l[2]),n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),-c[2]))),-o[3]),n(t(t(n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),a[2]),n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),-o[2])),t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),l[2]),n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),-c[2]))),s[3]))),t(t(n(t(t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),a[2]),n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),-o[2])),t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),s[2]),n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),-c[2]))),-l[3]),n(t(t(n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),a[2]),n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),-o[2])),t(n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),s[2]),n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),-l[2]))),c[3])),t(n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),a[2]),n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),-s[2])),t(n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),l[2]),n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),-c[2]))),i[3]),n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-s[2])),t(n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),l[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-c[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),l[2]),n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),-c[2]))),s[3]),n(t(t(n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),i[2]),n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),s[2]),n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),-c[2]))),-l[3])),t(n(t(t(n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),i[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-a[2])),t(n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),s[2]),n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),-l[2]))),c[3]),n(t(t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),a[2]),n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),-o[2])),t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),s[2]),n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),-c[2]))),i[3]))),t(t(n(t(t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),i[2]),n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),-o[2])),t(n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),s[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-c[2]))),-a[3]),n(t(t(n(t(n(e($,z),a[1]),t(n(e(V,_),-s[1]),n(e(L,x),c[1]))),i[2]),n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),s[2]),n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),-c[2]))),o[3])),t(n(t(t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),i[2]),n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-c[2]))),-s[3]),n(t(t(n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),i[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-a[2])),t(n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-s[2]))),c[3]))))),G=t(t(t(n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),o[2]),n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),-s[2])),t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),l[2]),n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),-c[2]))),i[3]),t(n(t(t(n(t(n(e(H,j),s[1]),t(n(e($,z),-l[1]),n(e(B,I),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-s[2])),t(n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),l[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-c[2]))),-o[3]),n(t(t(n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-o[2])),t(n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),l[2]),n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),-c[2]))),s[3]))),t(t(n(t(t(n(t(n(e($,z),o[1]),t(n(e(q,M),-s[1]),n(e(P,S),c[1]))),i[2]),n(t(n(e($,z),i[1]),t(n(e(U,m),-s[1]),n(e(E,p),c[1]))),-o[2])),t(n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),s[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-c[2]))),-l[3]),n(t(t(n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),i[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-o[2])),t(n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),s[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-l[2]))),c[3])),t(n(t(t(n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),a[2]),n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),-o[2])),t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),l[2]),n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),-c[2]))),i[3]),n(t(t(n(t(n(e(H,j),o[1]),t(n(e(q,M),-l[1]),n(e(F,A),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-o[2])),t(n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),l[2]),n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),-c[2]))),-a[3])))),t(t(t(n(t(t(n(t(n(e(H,j),a[1]),t(n(e(V,_),-l[1]),n(e(R,b),c[1]))),i[2]),n(t(n(e(H,j),i[1]),t(n(e(U,m),-l[1]),n(e(D,f),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),l[2]),n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),-c[2]))),o[3]),n(t(t(n(t(n(e(q,M),a[1]),t(n(e(V,_),-o[1]),n(e(T,v),c[1]))),i[2]),n(t(n(e(q,M),i[1]),t(n(e(U,m),-o[1]),n(e(k,d),c[1]))),-a[2])),t(n(t(n(e(V,_),i[1]),t(n(e(U,m),-a[1]),n(e(y,h),c[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-c[2]))),-l[3])),t(n(t(t(n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),i[2]),n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),-a[2])),t(n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-l[2]))),c[3]),n(t(t(n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),a[2]),n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),-o[2])),t(n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),s[2]),n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),-l[2]))),i[3]))),t(t(n(t(t(n(t(n(e(B,I),o[1]),t(n(e(F,A),-s[1]),n(e(P,S),l[1]))),i[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-o[2])),t(n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),s[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-l[2]))),-a[3]),n(t(t(n(t(n(e(B,I),a[1]),t(n(e(R,b),-s[1]),n(e(L,x),l[1]))),i[2]),n(t(n(e(B,I),i[1]),t(n(e(D,f),-s[1]),n(e(E,p),l[1]))),-a[2])),t(n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),s[2]),n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),-l[2]))),o[3])),t(n(t(t(n(t(n(e(F,A),a[1]),t(n(e(R,b),-o[1]),n(e(T,v),l[1]))),i[2]),n(t(n(e(F,A),i[1]),t(n(e(D,f),-o[1]),n(e(k,d),l[1]))),-a[2])),t(n(t(n(e(R,b),i[1]),t(n(e(D,f),-a[1]),n(e(y,h),l[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-l[2]))),-s[3]),n(t(t(n(t(n(e(P,S),a[1]),t(n(e(L,x),-o[1]),n(e(T,v),s[1]))),i[2]),n(t(n(e(P,S),i[1]),t(n(e(E,p),-o[1]),n(e(k,d),s[1]))),-a[2])),t(n(t(n(e(L,x),i[1]),t(n(e(E,p),-a[1]),n(e(y,h),s[1]))),o[2]),n(t(n(e(T,v),i[1]),t(n(e(k,d),-a[1]),n(e(y,h),o[1]))),-s[2]))),l[3]))))),Y=e(W,G);return Y[Y.length-1]}}var d=[function(){return 0},function(){return 0},function(){return 0}];function p(t){var e=d[t.length];return e||(e=d[t.length]=s(t.length)),e.apply(void 0,t)}function f(t,e,r,n,i,a,o,s){return function(e,r,l,c,u,h){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,l);case 4:return a(e,r,l,c);case 5:return o(e,r,l,c,u);case 6:return s(e,r,l,c,u,h)}for(var d=new Array(arguments.length),p=0;p<arguments.length;++p)d[p]=arguments[p];return t(d)}}!function(){for(;d.length<=6;)d.push(s(d.length));t.exports=f.apply(void 0,[p].concat(d));for(var e=0;e<=6;++e)t.exports[e]=d[e]}()},727:function(t,e,r){var n=r(2962);function i(t){var e=2===t?a:3===t?o:4===t?s:5===t?l:c;return e(t<6?n[t]:n)}function a(t){return function(e,r){return[t([[+r[0],+e[0][1]],[+r[1],+e[1][1]]]),t([[+e[0][0],+r[0]],[+e[1][0],+r[1]]]),t(e)]}}function o(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2]],[+r[1],+e[1][1],+e[1][2]],[+r[2],+e[2][1],+e[2][2]]]),t([[+e[0][0],+r[0],+e[0][2]],[+e[1][0],+r[1],+e[1][2]],[+e[2][0],+r[2],+e[2][2]]]),t([[+e[0][0],+e[0][1],+r[0]],[+e[1][0],+e[1][1],+r[1]],[+e[2][0],+e[2][1],+r[2]]]),t(e)]}}function s(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3]],[+r[1],+e[1][1],+e[1][2],+e[1][3]],[+r[2],+e[2][1],+e[2][2],+e[2][3]],[+r[3],+e[3][1],+e[3][2],+e[3][3]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3]],[+e[1][0],+r[1],+e[1][2],+e[1][3]],[+e[2][0],+r[2],+e[2][2],+e[2][3]],[+e[3][0],+r[3],+e[3][2],+e[3][3]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3]],[+e[1][0],+e[1][1],+r[1],+e[1][3]],[+e[2][0],+e[2][1],+r[2],+e[2][3]],[+e[3][0],+e[3][1],+r[3],+e[3][3]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+r[3]]]),t(e)]}}function l(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3],+e[0][4]],[+r[1],+e[1][1],+e[1][2],+e[1][3],+e[1][4]],[+r[2],+e[2][1],+e[2][2],+e[2][3],+e[2][4]],[+r[3],+e[3][1],+e[3][2],+e[3][3],+e[3][4]],[+r[4],+e[4][1],+e[4][2],+e[4][3],+e[4][4]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3],+e[0][4]],[+e[1][0],+r[1],+e[1][2],+e[1][3],+e[1][4]],[+e[2][0],+r[2],+e[2][2],+e[2][3],+e[2][4]],[+e[3][0],+r[3],+e[3][2],+e[3][3],+e[3][4]],[+e[4][0],+r[4],+e[4][2],+e[4][3],+e[4][4]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3],+e[0][4]],[+e[1][0],+e[1][1],+r[1],+e[1][3],+e[1][4]],[+e[2][0],+e[2][1],+r[2],+e[2][3],+e[2][4]],[+e[3][0],+e[3][1],+r[3],+e[3][3],+e[3][4]],[+e[4][0],+e[4][1],+r[4],+e[4][3],+e[4][4]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0],+e[0][4]],[+e[1][0],+e[1][1],+e[1][2],+r[1],+e[1][4]],[+e[2][0],+e[2][1],+e[2][2],+r[2],+e[2][4]],[+e[3][0],+e[3][1],+e[3][2],+r[3],+e[3][4]],[+e[4][0],+e[4][1],+e[4][2],+r[4],+e[4][4]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+r[3]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+r[4]]]),t(e)]}}function c(t){return function(e,r){return[t([[+r[0],+e[0][1],+e[0][2],+e[0][3],+e[0][4],+e[0][5]],[+r[1],+e[1][1],+e[1][2],+e[1][3],+e[1][4],+e[1][5]],[+r[2],+e[2][1],+e[2][2],+e[2][3],+e[2][4],+e[2][5]],[+r[3],+e[3][1],+e[3][2],+e[3][3],+e[3][4],+e[3][5]],[+r[4],+e[4][1],+e[4][2],+e[4][3],+e[4][4],+e[4][5]],[+r[5],+e[5][1],+e[5][2],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+r[0],+e[0][2],+e[0][3],+e[0][4],+e[0][5]],[+e[1][0],+r[1],+e[1][2],+e[1][3],+e[1][4],+e[1][5]],[+e[2][0],+r[2],+e[2][2],+e[2][3],+e[2][4],+e[2][5]],[+e[3][0],+r[3],+e[3][2],+e[3][3],+e[3][4],+e[3][5]],[+e[4][0],+r[4],+e[4][2],+e[4][3],+e[4][4],+e[4][5]],[+e[5][0],+r[5],+e[5][2],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+r[0],+e[0][3],+e[0][4],+e[0][5]],[+e[1][0],+e[1][1],+r[1],+e[1][3],+e[1][4],+e[1][5]],[+e[2][0],+e[2][1],+r[2],+e[2][3],+e[2][4],+e[2][5]],[+e[3][0],+e[3][1],+r[3],+e[3][3],+e[3][4],+e[3][5]],[+e[4][0],+e[4][1],+r[4],+e[4][3],+e[4][4],+e[4][5]],[+e[5][0],+e[5][1],+r[5],+e[5][3],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+r[0],+e[0][4],+e[0][5]],[+e[1][0],+e[1][1],+e[1][2],+r[1],+e[1][4],+e[1][5]],[+e[2][0],+e[2][1],+e[2][2],+r[2],+e[2][4],+e[2][5]],[+e[3][0],+e[3][1],+e[3][2],+r[3],+e[3][4],+e[3][5]],[+e[4][0],+e[4][1],+e[4][2],+r[4],+e[4][4],+e[4][5]],[+e[5][0],+e[5][1],+e[5][2],+r[5],+e[5][4],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+r[0],+e[0][5]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+r[1],+e[1][5]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+r[2],+e[2][5]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+r[3],+e[3][5]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+r[4],+e[4][5]],[+e[5][0],+e[5][1],+e[5][2],+e[5][3],+r[5],+e[5][5]]]),t([[+e[0][0],+e[0][1],+e[0][2],+e[0][3],+e[0][4],+r[0]],[+e[1][0],+e[1][1],+e[1][2],+e[1][3],+e[1][4],+r[1]],[+e[2][0],+e[2][1],+e[2][2],+e[2][3],+e[2][4],+r[2]],[+e[3][0],+e[3][1],+e[3][2],+e[3][3],+e[3][4],+r[3]],[+e[4][0],+e[4][1],+e[4][2],+e[4][3],+e[4][4],+r[4]],[+e[5][0],+e[5][1],+e[5][2],+e[5][3],+e[5][4],+r[5]]]),t(e)]}}var u=[function(){return[[0]]},function(t,e){return[[e[0]],[t[0][0]]]}];function h(t,e,r,n,i,a,o,s){return function(l,c){switch(l.length){case 0:return t(l,c);case 1:return e(l,c);case 2:return r(l,c);case 3:return n(l,c);case 4:return i(l,c);case 5:return a(l,c)}var u=o[l.length];return u||(u=o[l.length]=s(l.length)),u(l,c)}}!function(){for(;u.length<6;)u.push(i(u.length));t.exports=h.apply(void 0,u.concat([u,i]));for(var e=0;e<6;++e)t.exports[e]=u[e]}()},3250:function(t,e,r){var n=r(5250),i=r(8210),a=r(3012),o=r(8545);function s(t,e,r,n){return function(r,i,a){var o=t(t(e(i[1],a[0]),e(-a[1],i[0])),t(e(r[1],i[0]),e(-i[1],r[0]))),s=t(e(r[1],a[0]),e(-a[1],r[0])),l=n(o,s);return l[l.length-1]}}function l(t,e,r,n){return function(i,a,o,s){var l=t(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2])))),c=t(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2])))),u=n(l,c);return u[u.length-1]}}function c(t,e,r,n){return function(i,a,o,s,l){var c=t(t(t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(r(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),r(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),a[3]),t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),r(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),-o[3]),r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),s[3]))),t(r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),-l[3]),t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),r(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),i[3]),r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),r(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-a[3])))),t(t(r(t(r(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),s[3]),t(r(t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),-l[3]),r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),a[2]),t(r(t(e(a[1],s[0]),e(-s[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),s[2]))),i[3]))),t(r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),-a[3]),t(r(t(r(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),o[3]),r(t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2]))),-s[3]))))),u=t(t(t(r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(r(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),r(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),i[3]),r(t(r(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),r(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-o[3])),t(r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),s[3]),r(t(r(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(r(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),-l[3]))),t(t(r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),a[2]),t(r(t(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),r(t(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),i[3]),r(t(r(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),r(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),-a[3])),t(r(t(r(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(r(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),o[3]),r(t(r(t(e(a[1],o[0]),e(-o[1],a[0])),i[2]),t(r(t(e(i[1],o[0]),e(-o[1],i[0])),-a[2]),r(t(e(i[1],a[0]),e(-a[1],i[0])),o[2]))),-l[3])))),h=n(c,u);return h[h.length-1]}}function u(t){return(3===t?s:4===t?l:c)(i,n,a,o)}var h=u(3),d=u(4),p=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],f=a*c,m=o*l,g=o*s,y=i*c,v=i*l,x=a*s,b=u*(f-m)+h*(g-y)+p*(v-x),_=7771561172376103e-31*((Math.abs(f)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(p));return b>_||-b>_?b:d(t,e,r,n)}];function f(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h<arguments.length;++h)u[h]=arguments[h];return t(u)}}!function(){for(;p.length<=5;)p.push(u(p.length));t.exports=m.apply(void 0,[f].concat(p));for(var e=0;e<=5;++e)t.exports[e]=p[e]}()},5382:function(t,e,r){var n=r(8210),i=r(3012);t.exports=function(t,e){if(1===t.length)return i(e,t[0]);if(1===e.length)return i(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var a=0;a<t.length;++a)r=n(r,i(e,t[a]));else for(a=0;a<e.length;++a)r=n(r,i(t,e[a]));return r}},3012:function(t,e,r){var n=r(5250),i=r(9362);t.exports=function(t,e){var r=t.length;if(1===r){var a=n(t[0],e);return a[0]?a:[a[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;n(t[0],e,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(t[u],e,l);var h=s[1];i(h,l[0],s),s[0]&&(o[c++]=s[0]);var d=l[1],p=s[1],f=d+p,m=p-(f-d);s[1]=f,m&&(o[c++]=m)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}},1125:function(t,e,r){t.exports=function(t,e,r,i){var a=n(t,r,i),o=n(e,r,i);if(a>0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)<s||l<h)return!1}return!0}(t,e,r,i))};var n=r(3250)[3]},8545:function(t){t.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}(t[0],-e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=t[l],d=u(h),p=-e[c],f=u(p);d<f?(a=h,(l+=1)<r&&(d=u(h=t[l]))):(a=p,(c+=1)<n&&(f=u(p=-e[c]))),l<r&&d<f||c>=n?(i=h,(l+=1)<r&&(d=u(h=t[l]))):(i=p,(c+=1)<n&&(f=u(p=-e[c])));for(var m,g,y=i+a,v=y-i,x=a-v,b=x,_=y;l<r&&c<n;)d<f?(i=h,(l+=1)<r&&(d=u(h=t[l]))):(i=p,(c+=1)<n&&(f=u(p=-e[c]))),(x=(a=b)-(v=(y=i+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(x=(a=b)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(h=t[l]);for(;c<n;)(x=(a=b)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(p=-e[c]);return b&&(o[s++]=b),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},8210:function(t){t.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}(t[0],e[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=t[l],d=u(h),p=e[c],f=u(p);d<f?(a=h,(l+=1)<r&&(d=u(h=t[l]))):(a=p,(c+=1)<n&&(f=u(p=e[c]))),l<r&&d<f||c>=n?(i=h,(l+=1)<r&&(d=u(h=t[l]))):(i=p,(c+=1)<n&&(f=u(p=e[c])));for(var m,g,y=i+a,v=y-i,x=a-v,b=x,_=y;l<r&&c<n;)d<f?(i=h,(l+=1)<r&&(d=u(h=t[l]))):(i=p,(c+=1)<n&&(f=u(p=e[c]))),(x=(a=b)-(v=(y=i+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(x=(a=b)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(h=t[l]);for(;c<n;)(x=(a=b)-(v=(y=(i=p)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(p=e[c]);return b&&(o[s++]=b),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},9127:function(t,e,r){t.exports=function(t){return i(n(t))};var n=r(6204),i=r(5771)},7765:function(t,e,r){t.exports=function(t,e,r,s){if(r=r||0,"undefined"===typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}(t)),0===t.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(t,e){for(var r=t.length,n=i.mallocUint8(r),a=0;a<r;++a)n[a]=t[a]<e|0;return n}(e,+r),c=function(t,e){for(var r=t.length,o=e*(e+1)/2*r|0,s=i.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=t[c],h=(e=u.length,0);h<e;++h)for(var d=0;d<h;++d){var p=u[d],f=u[h];s[l++]=0|Math.min(p,f),s[l++]=0|Math.max(p,f)}a(n(s,[l/2|0,2]));var m=2;for(c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(t,s),u=function(t,e,r,a){for(var o=t.data,s=t.shape[0],l=i.mallocDouble(s),c=0,u=0;u<s;++u){var h=o[2*u],d=o[2*u+1];if(r[h]!==r[d]){var p=e[h],f=e[d];o[2*c]=h,o[2*c+1]=d,l[c++]=(f-a)/(f-p)}}return t.shape[0]=c,n(l,[c])}(c,e,l,+r),h=function(t,e){var r=i.mallocInt32(2*e),n=t.shape[0],a=t.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=a[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<e;)r[2*o]=r[2*o+1]=n;return r}(c,0|e.length),d=o(s)(t,c.data,h,l),p=function(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}(c),f=[].slice.call(u.data,0,u.shape[0]);return i.free(l),i.free(c.data),i.free(u.data),i.free(h),{cells:d,vertexIds:p,vertexWeights:f}};var n=r(9618),i=r(1888),a=r(446),o=r(1570)},1570:function(t){t.exports=function(t){return e[t]()};var e=[function(){return function(t,e,r,n){for(var i=t.length,a=0;a<i;++a)t[a].length;return[]}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,c=e[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s];if(2===l.length){var c=(0|i[l[0]])+(i[l[1]]<<1);if(0===c||3===c)continue;switch(c){case 0:case 3:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,c=e[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s],c=l.length;if(3===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([t(n,r,l[0],l[2]),t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0]),t(n,r,l[1],l[2])]);break;case 3:o.push([t(n,r,l[0],l[2]),t(n,r,l[1],l[2])]);break;case 4:o.push([t(n,r,l[2],l[1]),t(n,r,l[2],l[0])]);break;case 5:o.push([t(n,r,l[2],l[1]),t(n,r,l[0],l[1])]);break;case 6:o.push([t(n,r,l[1],l[0]),t(n,r,l[2],l[0])])}}else if(2===c){var u;if(0===(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}},function(){function t(t,e,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=t[2*i],s=t[2*i+1];o<s;){var l=o+s>>1,c=e[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(e,r,n,i){for(var a=e.length,o=[],s=0;s<a;++s){var l=e[s],c=l.length;if(4===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2)+(i[l[3]]<<3))||15===u)continue;switch(u){case 0:case 15:break;case 1:o.push([t(n,r,l[0],l[1]),t(n,r,l[0],l[2]),t(n,r,l[0],l[3])]);break;case 2:o.push([t(n,r,l[1],l[2]),t(n,r,l[1],l[0]),t(n,r,l[1],l[3])]);break;case 3:o.push([t(n,r,l[1],l[2]),t(n,r,l[0],l[2]),t(n,r,l[0],l[3])],[t(n,r,l[1],l[3]),t(n,r,l[1],l[2]),t(n,r,l[0],l[3])]);break;case 4:o.push([t(n,r,l[2],l[0]),t(n,r,l[2],l[1]),t(n,r,l[2],l[3])]);break;case 5:o.push([t(n,r,l[0],l[1]),t(n,r,l[2],l[1]),t(n,r,l[0],l[3])],[t(n,r,l[2],l[1]),t(n,r,l[2],l[3]),t(n,r,l[0],l[3])]);break;case 6:o.push([t(n,r,l[2],l[0]),t(n,r,l[1],l[0]),t(n,r,l[1],l[3])],[t(n,r,l[2],l[3]),t(n,r,l[2],l[0]),t(n,r,l[1],l[3])]);break;case 7:o.push([t(n,r,l[0],l[3]),t(n,r,l[1],l[3]),t(n,r,l[2],l[3])]);break;case 8:o.push([t(n,r,l[3],l[1]),t(n,r,l[3],l[0]),t(n,r,l[3],l[2])]);break;case 9:o.push([t(n,r,l[3],l[1]),t(n,r,l[0],l[1]),t(n,r,l[0],l[2])],[t(n,r,l[3],l[2]),t(n,r,l[3],l[1]),t(n,r,l[0],l[2])]);break;case 10:o.push([t(n,r,l[1],l[0]),t(n,r,l[3],l[0]),t(n,r,l[1],l[2])],[t(n,r,l[3],l[0]),t(n,r,l[3],l[2]),t(n,r,l[1],l[2])]);break;case 11:o.push([t(n,r,l[1],l[2]),t(n,r,l[0],l[2]),t(n,r,l[3],l[2])]);break;case 12:o.push([t(n,r,l[3],l[0]),t(n,r,l[2],l[0]),t(n,r,l[2],l[1])],[t(n,r,l[3],l[1]),t(n,r,l[3],l[0]),t(n,r,l[2],l[1])]);break;case 13:o.push([t(n,r,l[0],l[1]),t(n,r,l[2],l[1]),t(n,r,l[3],l[1])]);break;case 14:o.push([t(n,r,l[2],l[0]),t(n,r,l[1],l[0]),t(n,r,l[3],l[0])])}}else if(3===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([t(n,r,l[0],l[2]),t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0]),t(n,r,l[1],l[2])]);break;case 3:o.push([t(n,r,l[0],l[2]),t(n,r,l[1],l[2])]);break;case 4:o.push([t(n,r,l[2],l[1]),t(n,r,l[2],l[0])]);break;case 5:o.push([t(n,r,l[2],l[1]),t(n,r,l[0],l[1])]);break;case 6:o.push([t(n,r,l[1],l[0]),t(n,r,l[2],l[0])])}}else if(2===c){var u;if(0===(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([t(n,r,l[0],l[1])]);break;case 2:o.push([t(n,r,l[1],l[0])])}}}return o}}]},6803:function(t,e,r){r(8828),r(1755);function n(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var d=0;d<r;++d)if(n=u[d]-h[d])return n;return 0}}e.Fw=n},3105:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1)&&!!t},e.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(n),e.reverse=function(t){return n[255&t]<<24|n[t>>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var d=0;d<r;++d)if(n=u[d]-h[d])return n;return 0}}function o(t,e){return a(t[0],e[0])}function s(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];for(n.sort(o),i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(a),t}function l(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(a(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var o=r+n>>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i<o;++i)r[i]=[];for(var s=[],l=(i=0,e.length);i<l;++i)for(var u=e[i],h=u.length,d=1,p=1<<h;d<p;++d){s.length=n.popCount(d);for(var f=0,m=0;m<h;++m)d&1<<m&&(s[f++]=u[m]);var g=c(t,s);if(!(g<0))for(;r[g++].push(i),!(g>=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<<e+1)-1,a=0;a<t.length;++a)for(var o=t[a],l=i;l<1<<o.length;l=n.nextCombination(l)){for(var c=new Array(e+1),u=0,h=0;h<o.length;++h)l&1<<h&&(c[u++]=o[h]);r.push(c)}return s(r)}e.dimension=function(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1},e.countVertices=function(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1},e.cloneCells=function(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e},e.compareCells=a,e.normalize=s,e.unique=l,e.findCell=c,e.incidence=u,e.dual=function(t,e){if(!e)return u(l(h(t,0)),t);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];n=0;for(var i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r},e.explode=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,l=1<<a;o<l;++o){for(var c=[],u=0;u<a;++u)o>>>u&1&&c.push(i[u]);e.push(c)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var l=new Array(i.length-1),c=0,u=0;c<o;++c)c!==a&&(l[u++]=i[c]);e.push(l)}return s(e)},e.connectedComponents=function(t,e){return e?function(t,e){for(var r=new i(e),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)r.link(a[o],a[s]);var l=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<t.length;++n){var u=r.find(t[n][0]);c[u]<0?(c[u]=l.length,l.push([t[n].slice(0)])):l[c[u]].push(t[n].slice(0))}return l}(t,e):function(t){for(var e=l(s(h(t,0))),r=new i(e.length),n=0;n<t.length;++n)for(var a=t[n],o=0;o<a.length;++o)for(var u=c(e,[a[o]]),d=o+1;d<a.length;++d)r.link(u,c(e,[a[d]]));var p=[],f=r.ranks;for(n=0;n<f.length;++n)f[n]=-1;for(n=0;n<t.length;++n){var m=r.find(c(e,[t[n][0]]));f[m]<0?(f[m]=p.length,p.push([t[n].slice(0)])):p[f[m]].push(t[n].slice(0))}return p}(t)}},4623:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=e,e.prototype.length=function(){return this.roots.length},e.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},e.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},e.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},5878:function(t,e,r){t.exports=function(t,e,r){for(var a=e.length,o=t.length,s=new Array(a),l=new Array(a),c=new Array(a),u=new Array(a),h=0;h<a;++h)s[h]=l[h]=-1,c[h]=1/0,u[h]=!1;for(h=0;h<o;++h){var d=t[h];if(2!==d.length)throw new Error("Input must be a graph");var p=d[1],f=d[0];-1!==l[f]?l[f]=-2:l[f]=p,-1!==s[p]?s[p]=-2:s[p]=f}function m(t){if(u[t])return 1/0;var r=s[t],i=l[t];return r<0||i<0?1/0:function(t,e,r){var i=Math.abs(n(t,e,r)),a=Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2));return i/a}(e[t],e[r],e[i])}function g(t,e){var r=T[t],n=T[e];T[t]=n,T[e]=r,S[r]=e,S[n]=t}function y(t){return c[T[t]]}function v(t){return 1&t?t-1>>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n<A){var o=y(n);o<r&&(a=n,r=o)}if(i<A&&y(i)<r&&(a=i),a===t)return t;g(t,a),t=a}}function b(t){for(var e=y(t);t>0;){var r=v(t);if(!(r>=0&&e<y(r)))return t;g(t,r),t=r}}function _(){if(A>0){var t=T[0];return g(0,A-1),A-=1,x(0),t}return-1}function w(t,e){var r=T[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((A+=1)-1))}function k(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),S[e]>=0&&w(S[e],m(e)),S[r]>=0&&w(S[r],m(r))}}var T=[],S=new Array(a);for(h=0;h<a;++h)(c[h]=m(h))<1/0?(S[h]=T.length,T.push(h)):S[h]=-1;var A=T.length;for(h=A>>1;h>=0;--h)x(h);for(;;){var M=_();if(M<0||c[M]>r)break;k(M)}var C=[];for(h=0;h<a;++h)u[h]||(S[h]=C.length,C.push(e[h].slice()));function E(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!u[n]||i<0||i===n)break;if(i=t[n=i],!u[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}C.length;var L=[];return t.forEach((function(t){var e=E(s,t[0]),r=E(l,t[1]);if(e>=0&&r>=0&&e!==r){var n=S[e],i=S[r];n!==i&&L.push([n,i])}})),i.unique(i.normalize(L)),{positions:C,edges:L}};var n=r(3250),i=r(2014)},1303:function(t,e,r){t.exports=function(t,e){var r,a,o,s;if(e[0][0]<e[1][0])r=e[0],a=e[1];else{if(!(e[0][0]>e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return l<c?l-c:s>u?s-u:l-u}r=e[1],i=e[0]}t[0][1]<t[1][1]?(a=t[0],o=t[1]):(a=t[1],o=t[0]);var h=n(i,r,a);return h||(h=n(i,r,o))||o-i}},4209:function(t,e,r){t.exports=function(t){for(var e=t.length,r=2*e,n=new Array(r),a=0;a<e;++a){var l=t[a],c=l[0][0]<l[1][0];n[2*a]=new h(l[0][0],l,c,a),n[2*a+1]=new h(l[1][0],l,!c,a)}n.sort((function(t,e){var r=t.x-e.x;return r||(r=t.create-e.create)||Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1])}));var d=i(o),p=[],f=[],m=[];for(a=0;a<r;){for(var g=n[a].x,y=[];a<r;){var v=n[a];if(v.x!==g)break;a+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(y.push(new u(v.segment[0][1],v.index,!0,!0)),y.push(new u(v.segment[1][1],v.index,!1,!1))):(y.push(new u(v.segment[1][1],v.index,!0,!1)),y.push(new u(v.segment[0][1],v.index,!1,!0)))):d=v.create?d.insert(v.segment,v.index):d.remove(v.segment)}p.push(d.root),f.push(g),m.push(y)}return new s(p,f,m)};var n=r(2478),i=r(3840),a=r(3250),o=r(1303);function s(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function l(t,e){return t.y-e}function c(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=a(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var d=n.ge(h,t[1],l);if(d<h.length){var p=h[d];if(t[1]===p.y){if(p.closed)return p.index;for(;d<h.length-1&&h[d+1].y===t[1];)if((p=h[d+=1]).closed)return p.index;if(p.y===t[1]&&!p.start){if((d+=1)>=h.length)return i;p=h[d]}}if(p.start)if(s){var f=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(f=-f),f>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},5202:function(t,e,r){var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l<o;++l)s[l]=i*t[l]+a*r[l];return s}t.exports=function(t,e){for(var r=[],n=[],i=a(t[t.length-1],e),s=t[t.length-1],l=t[0],c=0;c<t.length;++c,s=l){var u=a(l=t[c],e);if(i<0&&u>0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l<t.length;++l,i=s){var c=a(s=t[l],e);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,c,u,h,d,p=1,f=t.length,m="";for(n=0;n<f;n++)if("string"===typeof t[n])m+=t[n];else if("object"===typeof t[n]){if((s=t[n]).keys)for(r=e[p],o=0;o<s.keys.length;o++){if(void 0==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?e[s.param_no]:e[p++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(h=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?d="":(d=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(d+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?d+r+l:"0"===c?d+l+r:l+d+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()},3711:function(t,e,r){t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(t,e);var r=t.order.join()+"-"+t.dtype,s=o[r];return e=+e||0,s||(s=o[r]=function(t,e){var r=t.length+"d",i=a[r];if(i)return i(n,t,e)}(t.order,t.dtype)),s(t,e)};var n=r(2640),i=r(781),a={"2d":function(t,e,r){var n=t({order:e,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(t,e,r,n){return t>n|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,d){var p=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*d)/(r-n),e-.25-.25*(i+r-2*d)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*d)/(n-r),e-.25-.25*(a+n-2*d)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*d)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*d)/(i-a),e-.75-.25*(-i-r+2*d)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*d)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*d)/(i-a),e-.75-.25*(a+n-2*d)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*d)/(a-i),e-.75-.25*(-a-n+2*d)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*d)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*d)/(a-i),e-.75-.25*(i+r-2*d)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*d)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*d)/(r-n),e-.25-.25*(-a-n+2*d)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*d)/(n-r),e-.25-.25*(-i-r+2*d)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},665:function(t,e,r){var n=r(3202);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),i=t.radius||1,a=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var p=t.eye,f=[p[0]-e[0],p[1]-e[1],p[2]-e[2]];o(n,f,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(f[0],f[1],f[2]);var m=l(r,f)/i,g=l(n,f)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new d(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function d(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=d.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var d=this.computedToward;o(d,e,r),s(d,d);var p=Math.exp(this.computedRadius[0]),f=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(f),y=Math.sin(f),v=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*v,w=y*v,k=x,T=-g*x,S=-y*x,A=v,M=this.computedEye,C=this.computedMatrix;for(a=0;a<3;++a){var E=_*r[a]+w*d[a]+k*e[a];C[4*a+1]=T*r[a]+S*d[a]+A*e[a],C[4*a+2]=E,C[4*a+3]=0}var L=C[1],P=C[5],I=C[9],z=C[2],O=C[6],D=C[10],R=P*D-I*O,F=I*z-L*D,B=L*O-P*z,j=c(R,F,B);for(R/=j,F/=j,B/=j,C[0]=R,C[4]=F,C[8]=B,a=0;a<3;++a)M[a]=b[a]+C[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=C[a+4*N]*M[N];C[12+a]=-u}C[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var f=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;f[0]=i[2],f[1]=i[6],f[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,f),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],d=i[8],p=u*a+h*o+d*s,f=c(u-=a*p,h-=o*p,d-=s*p),m=(u/=f)*e+a*r,g=(h/=f)*e+o*r,y=(d/=f)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var d=Math.abs(s),p=Math.abs(l),f=Math.abs(h),m=Math.max(d,p,f);d===m?(s=s<0?-1:1,l=h=0):f===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*h,k=c(x-=s*w,b-=l*w,_-=h*w),T=l*(_/=k)-h*(b/=k),S=h*(x/=k)-s*_,A=s*b-l*x,M=c(T,S,A);if(T/=M,S/=M,A/=M,this.center.jump(t,$,H,W),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,b,_),2===a){var C=e[1],E=e[5],L=e[9],P=C*x+E*b+L*_,I=C*T+E*S+L*A;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(I,P)}else{var z=e[2],O=e[6],D=e[10],R=z*s+O*l+D*h,F=z*x+O*b+D*_,B=z*T+O*S+D*A;y=Math.asin(u(R)),v=Math.atan2(B,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var j=e[2],N=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],$=V[12]/q,H=V[13]/q,W=V[14]/q,G=Math.exp(this.computedRadius[0]);this.center.jump(t,$-j*G,H-N*G,W-U*G)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],d=e[2]-r[2],p=c(l,h,d);if(!(p<1e-6)){l/=p,h/=p,d/=p;var f=this.computedRight,m=f[0],g=f[1],y=f[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(x=c(m=a*d-o*h,g=o*l-i*d,y=i*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*y-o*g,_=o*m-i*y,w=i*g-a*m,k=c(b,_,w),T=i*l+a*h+o*d,S=m*l+g*h+y*d,A=(b/=k)*l+(_/=k)*h+(w/=k)*d,M=Math.asin(u(T)),C=Math.atan2(A,S),E=this.angle._state,L=E[E.length-1],P=E[E.length-2];L%=2*Math.PI;var I=Math.abs(L+2*Math.PI-C),z=Math.abs(L-C),O=Math.abs(L-2*Math.PI-C);I<z&&(L+=2*Math.PI),O<z&&(L-=2*Math.PI),this.angle.jump(this.angle.lastT(),L,P),this.angle.set(t,C,M)}}}}},5250:function(t){t.exports=function(t,r,n){var i=t*r,a=e*t,o=a-(a-t),s=t-o,l=e*r,c=l-(l-r),u=r-c,h=s*u-(i-o*c-s*c-o*u);return n?(n[0]=h,n[1]=i,n):[h,i]};var e=+(Math.pow(2,27)+1)},9362:function(t){t.exports=function(t,e,r){var n=t+e,i=n-t,a=e-i,o=t-(n-i);return r?(r[0]=o+a,r[1]=n,r):[o+a,n]}},1888:function(t,e,r){var n=r(8828),i=r(1338),a=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,h=c.BUFFER;function d(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function v(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):f(t)}function k(t){return s?new BigUint64Array(p(8*t),0,t):null}function T(t){return l?new BigInt64Array(p(8*t),0,t):null}function S(t){return new DataView(p(t),0,t)}function A(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){d(t.buffer)},e.freeArrayBuffer=d,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return f(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return k(t);case"buffer":return A(t);case"data":case"dataview":return S(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=f,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=v,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=b,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=k,e.mallocBigInt64=T,e.mallocDataView=S,e.mallocBuffer=A,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},1755:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}t.exports=e;var r=e.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},r.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},r.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},1682:function(t){t.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,e(i=t[o],a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}(t,e)):(r||t.sort(),function(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,(n=t[a])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}(t))}},4359:function(t,e,r){t.exports=function(t,e){return"object"===typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=r(7718),i=null,a=null;"undefined"!==typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},7718:function(t,e,r){t.exports=function(t,e,r,n){var a=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",_(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(k=0;k<r.length;++k)l[k]=s;!0===o.bolds&&(l=x(c,u,r,l)),!0===o.italics&&(l=x(h,d,r,l)),!0===o.superscripts&&(l=x(p,m,r,l)),!0===o.subscripts&&(l=x(g,v,r,l));var b=[],_="";for(k=0;k<r.length;++k)null!==l[k]&&(_+=r[k],b.push(l[k]));var w,k,T,S,A,M=_.split("\n"),C=M.length,E=Math.round(a*n),L=n,P=2*n,I=0,z=C*E+P;t.height<z&&(t.height=z),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff";var O=0,D="";function R(){if(""!==D){var t=e.measureText(D).width;e.fillText(D,L+T,P+S),T+=t}}function F(){return Math.round(A)+"px "}function B(t,r){var n=""+e.font;if(!0===o.subscripts){var i=t.indexOf(y),a=r.indexOf(y),s=i>-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),A*=Math.pow(.75,l-s),n=n.replace("?px ",F())),S+=.25*E*(l-s)}if(!0===o.superscripts){var c=t.indexOf(f),h=r.indexOf(f),p=c>-1?parseInt(t[1+c]):0,m=h>-1?parseInt(r[1+h]):0;p!==m&&(n=n.replace(F(),"?px "),A*=Math.pow(.75,m-p),n=n.replace("?px ",F())),S-=.25*E*(m-p)}if(!0===o.bolds){var g=t.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(d)>-1,b=r.indexOf(d)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w<C;++w){var j=M[w]+"\n";for(T=0,S=w*E,A=n,D="",k=0;k<j.length;++k){var N=k+O<b.length?b[k+O]:b[b.length-1];s===N?D+=j[k]:(R(),D=j[k],void 0!==N&&(B(s,N),s=N))}R(),O+=j.length;var U=0|Math.round(T+2*L);I<U&&(I=U)}var V=I,q=P+E*C;return i(e.getImageData(0,0,V,q).data,[q,V,4]).pick(-1,-1,0).transpose(1,0)}(e,r,t,a,o,s),n,a)},t.exports.processPixels=_;var n=r(3711),i=r(9618),a=r(5878),o=r(332),s=r(2538),l=r(2095),c="b",u="b|",h="i",d="i|",p="sup",f="+",m="+1",g="sub",y="-",v="-1";function x(t,e,r,n){for(var i="<"+t+">",a="</"+t+">",o=i.length,s=a.length,l=e[0]===f||e[0]===y,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h<u+s;++h)if(h<c+o||h>=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var d=n[h].indexOf(e[0]);-1===d?n[h]+=e:l&&(n[h]=n[h].substr(0,d+1)+(1+parseInt(n[h][d+1]))+n[h].substr(d+2))}var p=c+o,m=r.substr(p,u-p).indexOf(i);c=-1!==m?m:u+s}return n}function b(t,e,r,i){var c=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),u=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var c=t[l],u=0;u<2;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var d=0;switch(i){case"hanging":case"top":d=-a[1];break;case"middle":d=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":d=-3*r;break;case"bottom":d=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var p=1/r;return"lineHeight"in e?p*=+e.lineHeight:"width"in e?p=e.width/(o[0]-a[0]):"height"in e&&(p=e.height/(o[1]-a[1])),t.map((function(t){return[p*(t[0]+h),p*(t[1]+d)]}))}(c.positions,e,r),h=c.edges,d="ccw"===e.orientation;if(o(u,h),e.polygons||e.polygon||e.polyline){for(var p=l(h,u),f=new Array(p.length),m=0;m<p.length;++m){for(var g=p[m],y=new Array(g.length),v=0;v<g.length;++v){for(var x=g[v],b=new Array(x.length),_=0;_<x.length;++_)b[_]=u[x[_]].slice();d&&b.reverse(),y[v]=b}f[m]=y}return f}return e.triangles||e.triangulate||e.triangle?{cells:s(u,h,{delaunay:!1,exterior:!1,interior:!0}),positions:u}:{edges:h,positions:u}}function _(t,e,r){try{return b(t,e,r,!0)}catch(n){}try{return b(t,e,r,!1)}catch(n){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},1538:function(t){!function(){if("undefined"===typeof ses||!ses.ok||ses.ok()){"undefined"!==typeof ses&&(ses.weakMapPermitHostObjects=g);var e=!1;if("function"===typeof WeakMap){var r=WeakMap;if("undefined"!==typeof navigator&&/Firefox/.test(navigator.userAgent));else{var n=new r,i=Object.freeze({});if(n.set(i,1),1===n.get(i))return void(t.exports=WeakMap);e=!0}}Object.prototype.hasOwnProperty;var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",c=l+"ident:"+Math.random()+"___";if("undefined"!==typeof crypto&&"function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array){var u=new ArrayBuffer(25),h=new Uint8Array(u);crypto.getRandomValues(h),c=l+"rand:"+Array.prototype.map.call(h,(function(t){return(t%36).toString(36)})).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(t){return a(t).filter(y)}}),"getPropertyNames"in Object){var d=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(t){return d(t).filter(y)}})}!function(){var t=Object.freeze;o(Object,"freeze",{value:function(e){return v(e),t(e)}});var e=Object.seal;o(Object,"seal",{value:function(t){return v(t),e(t)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(t){return v(t),r(t)}})}();var p=!1,f=0,m=function(){this instanceof m||b();var t=[],e=[],r=f++;return Object.create(m.prototype,{get___:{value:x((function(n,i){var a,o=v(n);return o?r in o?o[r]:i:(a=t.indexOf(n))>=0?e[a]:i}))},has___:{value:x((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0)&&(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,!0)}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof m||b();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:x((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:x(t)},delete___:{value:x((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}e&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(r){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){p||"undefined"===typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!==typeof e||null===e)&&"function"!==typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){var e=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u<o;++u){var d=e[n]-a,p=e[n+c]-a;d>=0!==p>=0&&i.push(l[0]+.5+.5*(d+p)/(d-p)),n+=h,++l[0]}}};t.exports=function(t){return r={funcName:t.funcName},function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(e.bind(void 0,r));var r}({funcName:"zeroCrossings"})},781:function(t,e,r){t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}(),n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var i=n(1964);e.exports=i}()}}),Of=d({"node_modules/color-name/index.js"(t,e){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Df=d({"node_modules/color-normalize/node_modules/color-parse/index.js"(t,e){var r=Of();e.exports=function(t){var e,i,a=[],o=1;if("string"===typeof t)if(t=t.toLowerCase(),r[t])a=r[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==n[t])return n[t]}return parseFloat(t)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],i="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(i="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(i="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Rf=d({"node_modules/color-normalize/node_modules/color-rgba/index.js"(t,e){var r=Df();e.exports=function(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw.apply(null,arguments));var n=r(t);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(e=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(e=function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}}}),Ff=d({"node_modules/clamp/index.js"(t,e){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}}}),Bf=d({"node_modules/dtype/index.js"(t,e){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),jf=d({"node_modules/color-normalize/index.js"(t,e){var r=Rf(),n=Ff(),i=Bf();e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var a=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!==typeof t||((t=r(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(o?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:1):(a[0]=n(Math.floor(255*t[0]),0,255),a[1]=n(Math.floor(255*t[1]),0,255),a[2]=n(Math.floor(255*t[2]),0,255),a[3]=null==t[3]?255:n(Math.floor(255*t[3]),0,255)),a)}}}),Nf=d({"src/lib/str2rgbarray.js"(t,e){var r=jf();e.exports=function(t){return t?r(t):[0,0,0,1]}}}),Uf=d({"src/lib/gl_format_color.js"(t,e){var r=k(),n=O(),i=jf(),a=We(),o=V().defaultLine,s=M().isArrayOrTypedArray,l=i(o);function c(t,e){var r=t;return r[3]*=e,r}function u(t){if(r(t))return l;var e=i(t);return e.length?e:l}function h(t){return r(t)?t:1}e.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var o,d,p,f,m,g=s(n),y=s(e),v=a.extractOpts(t),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(t):u,d=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:u,p=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var b=0;b<r;b++)f=d(n,b),m=p(e,b),x[b]=c(f,m);else x=c(i(n),e);return x},parseColorScale:function(t){var e=a.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=a.flipScale(e.colorscale)),r.map((function(t){var e=t[0],r=n(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,r.a]}}))}}}}),Vf=d({"src/constants/gl3d_dashes.js"(t,e){e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}}),qf=d({"src/constants/gl3d_markers.js"(t,e){e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}}}),$f=d({"src/traces/scatter3d/calc_errors.js"(t,e){var r=Vt();function n(t,e,n,i){if(!e||!e.visible)return null;for(var a=r.getComponentMethod("errorbars","makeComputeError")(e),o=new Array(t.length),s=0;s<t.length;s++){var l=a(+t[s],s);if("log"===i.type){var c=i.c2l(t[s]),u=t[s]-l[0],h=t[s]+l[1];if(o[s]=[(i.c2l(u,!0)-c)*n,(i.c2l(h,!0)-c)*n],u>0){var d=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=d),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,d)}}else o[s]=[-l[0]*n,l[1]*n]}return o}e.exports=function(t,e,r){var i=[n(t.x,t.error_x,e[0],r.xaxis),n(t.y,t.error_y,e[1],r.yaxis),n(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}(i);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],c=0;c<3;c++)if(i[c])for(var u=0;u<2;u++)l[u][c]=i[c][s][u];o[s]=l}return o}}}),Hf=d({"src/traces/scatter3d/convert.js"(t,e){var r=zf().gl_line3d,n=zf().gl_scatter3d,i=zf().gl_error3d,a=zf().gl_mesh3d,o=zf().delaunay_triangulate,s=se(),l=Nf(),c=Uf().formatColor,u=Ye(),h=Vf(),d=qf(),p=nr(),f=Ze().appendArrayPointValue,m=$f();function g(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var y=g.prototype;function v(t){return null===t||void 0===t?0:t.indexOf("left")>-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null===t||void 0===t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function b(t,e){return e(4*t)}function _(t){return d[t]}function w(t,e,r,n,i){var a=null;if(s.isArrayOrTypedArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,s.identity);return a}function k(t,e){var r,n,i,a,o,h,d=[],g=t.fullSceneLayout,y=t.dataScale,k=g.xaxis,T=g.yaxis,S=g.zaxis,A=e.marker,M=e.line,C=e.x||[],E=e.y||[],L=e.z||[],P=C.length,I=e.xcalendar,z=e.ycalendar,O=e.zcalendar;for(o=0;o<P;o++)r=k.d2l(C[o],0,I)*y[0],n=T.d2l(E[o],0,z)*y[1],i=S.d2l(L[o],0,O)*y[2],d[o]=[r,n,i];if(Array.isArray(e.text))h=e.text;else if(s.isTypedArray(e.text))h=Array.from(e.text);else if(void 0!==e.text)for(h=new Array(P),o=0;o<P;o++)h[o]=e.text;function D(t,e){var r=g[t];return p.tickText(r,r.d2l(e),!0).text}var R=e.texttemplate;if(R){var F=t.fullLayout._d3locale,B=Array.isArray(R),j=B?Math.min(R.length,P):P,N=B?function(t){return R[t]}:function(){return R};for(h=new Array(j),o=0;o<j;o++){var U={x:C[o],y:E[o],z:L[o]},V={xLabel:D("xaxis",C[o]),yLabel:D("yaxis",E[o]),zLabel:D("zaxis",L[o])},q={};f(q,e,o);var $=e._meta||{};h[o]=s.texttemplateString(N(o),V,F,q,U,$)}}if(a={position:d,mode:e.mode,text:h},"line"in e&&(a.lineColor=c(M,1,P),a.lineWidth=M.width,a.lineDashes=M.dash),"marker"in e){var H=u(e);a.scatterColor=c(A,1,P),a.scatterSize=w(A.size,P,b,20,H),a.scatterMarker=w(A.symbol,P,_,"\u25cf"),a.scatterLineWidth=A.line.width,a.scatterLineColor=c(A.line,1,P),a.scatterAngle=0}"textposition"in e&&(a.textOffset=function(t){var e=[0,0];if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=[0,0],t[r]&&(e[r][0]=v(t[r]),e[r][1]=x(t[r]));else e[0]=v(t),e[1]=x(t);return e}(e.textposition),a.textColor=c(e.textfont,1,P),a.textSize=w(e.textfont.size,P,s.identity,12),a.textFontFamily=e.textfont.family,a.textFontWeight=e.textfont.weight,a.textFontStyle=e.textfont.style,a.textFontVariant=e.textfont.variant,a.textAngle=0);var W=["x","y","z"];for(a.project=[!1,!1,!1],a.projectScale=[1,1,1],a.projectOpacity=[1,1,1],o=0;o<3;++o){var G=e.projection[W[o]];(a.project[o]=G.show)&&(a.projectOpacity[o]=G.opacity,a.projectScale[o]=G.scale)}a.errorBounds=m(e,y,g);var Y=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&!1!==t[2].visible&&(a=t[2]),a&&a.visible&&(e[i]=a.width/2,r[i]=l(a.color),n[i]=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return a.errorColor=Y.color,a.errorLineWidth=Y.lineWidth,a.errorCapSize=Y.capSize,a.delaunayAxis=e.surfaceaxis,a.delaunayColor=l(e.surfacecolor),a}function T(t){if(s.isArrayOrTypedArray(t)){var e=t[0];return s.isArrayOrTypedArray(e)&&(t=e),"rgb("+t.slice(0,3).map((function(t){return Math.round(255*t)}))+")"}return null}function S(t){return s.isArrayOrTypedArray(t)?4===t.length&&"number"===typeof t[0]?T(t):t.map(T):null}y.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){var e=t.index=t.data.index;return t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),t.textLabel="",this.textLabels&&(s.isArrayOrTypedArray(this.textLabels)?(this.textLabels[e]||0===this.textLabels[e])&&(t.textLabel=this.textLabels[e]):t.textLabel=this.textLabels),t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},y.update=function(t){var e,s,l,c,u=this.scene.glplot.gl,d=h.solid;this.data=t;var p=k(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in h&&(d=h[p.lineDashes]),this.color=S(p.scatterColor)||S(p.lineColor),this.dataPoints=p.position,e={gl:this.scene.glplot.gl,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:d[0],dashScale:d[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=r(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var f=t.opacity;if(t.marker&&void 0!==t.marker.opacity&&(f*=t.marker.opacity),s={gl:this.scene.glplot.gl,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:f,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(s):(this.scatterPlot=n(s),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),c={gl:this.scene.glplot.gl,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFontFamily,fontWeight:p.textFontWeight,fontStyle:p.textFontStyle,fontVariant:p.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(c):(this.textMarkers=n(c),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:this.scene.glplot.gl,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=i(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n<t.length;++n){var c=t[n];!isNaN(c[i])&&isFinite(c[i])&&!isNaN(c[a])&&isFinite(c[a])&&(s.push([c[i],c[a]]),l.push(n))}var u=o(s);for(n=0;n<u.length;++n)for(var h=u[n],d=0;d<h.length;++d)h[d]=l[h[d]];return{positions:t,cells:u,meshColor:e}}(p.position,p.delaunayColor,p.delaunayAxis);m.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=u,this.delaunayMesh=a(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=function(t,e){var r=new g(t,e.uid);return r.update(e),r}}}),Wf=d({"src/traces/scatter3d/attributes.js"(t,e){var r=wn(),n=R(),i=Pe(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=N(),c=Vf(),u=qf(),h=D().extendFlat,d=Pt().overrideAll,p=Wt(),f=r.line,m=r.marker,g=m.line,y=h({width:f.width,dash:{valType:"enumerated",values:p(c),dflt:"solid"}},i("line")),v=e.exports=d({x:r.x,y:r.y,z:{valType:"data_array"},text:h({},r.text,{}),texttemplate:s({},{}),hovertext:h({},r.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:h({},r.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:r.connectgaps,line:y,marker:h({symbol:{valType:"enumerated",values:p(u),dflt:"circle",arrayOk:!0},size:h({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:h({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:h({width:h({},g.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:h({},r.textposition,{dflt:"top center"}),textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:h({},l.hoverinfo)},"calc","nested");v.x.editType=v.y.editType=v.z.editType="calc+clearAxisTypes"}}),Gf=d({"src/traces/scatter3d/defaults.js"(t,e){var r=Vt(),n=se(),i=Ge(),a=Wn(),o=Gn(),s=Zn(),l=Wf();e.exports=function(t,e,c,u){function h(r,i){return n.coerce(t,e,l,r,i)}var d=function(t,e,n,i){var a=0,o=n("x"),s=n("y"),l=n("z");return r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),e._length=e._xlength=e._ylength=e._zlength=a),a}(t,e,h,u);if(d){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),i.hasMarkers(e)&&a(t,e,c,u,h,{noSelect:!0,noAngle:!0}),i.hasLines(e)&&(h("connectgaps"),o(t,e,c,u,h)),i.hasText(e)&&(h("texttemplate"),s(t,e,u,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var p=(e.line||{}).color,f=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",p||f);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(t,e,p||f||c,{axis:"z"}),v(t,e,p||f||c,{axis:"y",inherit:"z"}),v(t,e,p||f||c,{axis:"x",inherit:"z"})}else e.visible=!1}}}),Yf=d({"src/traces/scatter3d/calc.js"(t,e){var r=ni(),n=ri();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}}),Zf=d({"node_modules/get-canvas-context/index.js"(t,e){e.exports=function(t,e){if("string"!==typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"===typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"===typeof e.width&&(r.width=e.width),"number"===typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(s){n=null}return n||null}}}),Xf=d({"node_modules/webgl-context/index.js"(t,e){var r=Zf();e.exports=function(t){return r("webgl",t)}}}),Kf=d({"src/lib/show_no_webgl_msg.js"(t,e){var r=q(),n=function(){};e.exports=function(t){for(var e in t)"function"===typeof t[e]&&(t[e]=n);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var i=document.createElement("div");i.className="no-webgl",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=r.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=r.lightLine,i.style["z-index"]=30;var a=document.createElement("p");return a.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",a.style.position="relative",a.style.top="50%",a.style.left="50%",a.style.height="30%",a.style.width="50%",a.style.margin="-15% 0 0 -25%",i.appendChild(a),t.container.appendChild(i),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}}}),Jf=d({"src/plots/gl3d/layout/convert.js"(t,e){var r=Nf(),n=se(),i=["xaxis","yaxis","zaxis"];function a(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}a.prototype.merge=function(t,e){for(var a=this,o=0;o<3;++o){var s=e[i[o]];s.visible?(a.labels[o]=t._meta?n.templateString(s.title.text,t._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(a.labelColor[o]=r(s.title.font.color)),s.title.font.family&&(a.labelFont[o]=s.title.font.family),s.title.font.size&&(a.labelSize[o]=s.title.font.size),s.title.font.weight&&(a.labelFontWeight[o]=s.title.font.weight),s.title.font.style&&(a.labelFontStyle[o]=s.title.font.style),s.title.font.variant&&(a.labelFontVariant[o]=s.title.font.variant)),"showline"in s&&(a.lineEnable[o]=s.showline),"linecolor"in s&&(a.lineColor[o]=r(s.linecolor)),"linewidth"in s&&(a.lineWidth[o]=s.linewidth),"showgrid"in s&&(a.gridEnable[o]=s.showgrid),"gridcolor"in s&&(a.gridColor[o]=r(s.gridcolor)),"gridwidth"in s&&(a.gridWidth[o]=s.gridwidth),"log"===s.type?a.zeroEnable[o]=!1:"zeroline"in s&&(a.zeroEnable[o]=s.zeroline),"zerolinecolor"in s&&(a.zeroLineColor[o]=r(s.zerolinecolor)),"zerolinewidth"in s&&(a.zeroLineWidth[o]=s.zerolinewidth),"ticks"in s&&s.ticks?a.lineTickEnable[o]=!0:a.lineTickEnable[o]=!1,"ticklen"in s&&(a.lineTickLength[o]=a._defaultLineTickLength[o]=s.ticklen),"tickcolor"in s&&(a.lineTickColor[o]=r(s.tickcolor)),"tickwidth"in s&&(a.lineTickWidth[o]=s.tickwidth),"tickangle"in s&&(a.tickAngle[o]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(a.tickEnable[o]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(a.tickColor[o]=r(s.tickfont.color)),s.tickfont.family&&(a.tickFont[o]=s.tickfont.family),s.tickfont.size&&(a.tickSize[o]=s.tickfont.size),s.tickfont.weight&&(a.tickFontWeight[o]=s.tickfont.weight),s.tickfont.style&&(a.tickFontStyle[o]=s.tickfont.style),s.tickfont.variant&&(a.tickFontVariant[o]=s.tickfont.variant)),"mirror"in s?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(a.lineTickMirror[o]=!0,a.lineMirror[o]=!0):!0===s.mirror?(a.lineTickMirror[o]=!1,a.lineMirror[o]=!0):(a.lineTickMirror[o]=!1,a.lineMirror[o]=!1):a.lineMirror[o]=!1,"showbackground"in s&&!1!==s.showbackground?(a.backgroundEnable[o]=!0,a.backgroundColor[o]=r(s.backgroundcolor)):a.backgroundEnable[o]=!1):(a.tickEnable[o]=!1,a.labelEnable[o]=!1,a.lineEnable[o]=!1,a.lineTickEnable[o]=!1,a.gridEnable[o]=!1,a.zeroEnable[o]=!1,a.backgroundEnable[o]=!1)}},e.exports=function(t,e){var r=new a;return r.merge(t,e),r}}}),Qf=d({"src/plots/gl3d/layout/spikes.js"(t,e){var r=Nf(),n=["xaxis","yaxis","zaxis"];function i(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}i.prototype.merge=function(t){for(var e=0;e<3;++e){var i=t[n[e]];i.visible?(this.enabled[e]=i.showspikes,this.colors[e]=r(i.spikecolor),this.drawSides[e]=i.spikesides,this.lineWidth[e]=i.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new i;return e.merge(t),e}}}),tm=d({"src/plots/gl3d/layout/tick_marks.js"(t,e){e.exports=function(t){for(var e=t.axesOptions,o=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(o[c].hi-o[c].lo)*o[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=o[c].lo/t.dataScale[c],u.range[1]=o[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*o[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var d=u.nticks||n.constrain(u._length/40,4,9);r.autoTicks(u,Math.abs(u.range[1]-u.range[0])/d)}for(var p=r.calcTicks(u,{msUTC:!0}),f=0;f<p.length;++f)p[f].x=p[f].x*t.dataScale[c],"date"===u.type&&(p[f].text=p[f].text.replace(/\<br\>/g," "));l[c]=p,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),f=0;f<2;++f)e.bounds[f][c]=t.glplot.bounds[f][c];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}(l)};var r=nr(),n=se(),i=["xaxis","yaxis","zaxis"],a=[0,0,0]}}),em=d({"src/plots/gl3d/scene.js"(t,e){var r,n,i=zf().gl_plot3d,a=i.createCamera,o=i.createScene,s=Xf(),l=sr(),c=Vt(),u=se(),h=u.preserveDrawingBuffer(),d=nr(),p=zr(),f=Nf(),m=Kf(),g=ji(),y=Jf(),v=Qf(),x=tm(),b=rr().applyAutorangeOptions,_=!1;function w(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=y(e,e[this.id]),this.spikeOptions=v(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=c.getComponentMethod("annotations3d","convert"),this.drawAnnotations=c.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var k=w.prototype;k.prepareOptions=function(){var t=this,e={canvas:t.canvas,gl:t.gl,glOptions:{preserveDrawingBuffer:h,premultipliedAlpha:!0,antialias:!0},container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:t.camera,pixelRatio:t.pixelRatio};if(t.staticMode){if(!n&&(r=document.createElement("canvas"),!(n=s({canvas:r,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");e.gl=n,e.canvas=r}return e};var T=!0;k.tryCreatePlot=function(){var t=this,e=t.prepareOptions(),r=!0;try{t.glplot=o(e)}catch(n){if(t.staticMode||!T||h)r=!1;else{u.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{h=e.glOptions.preserveDrawingBuffer=!0,t.glplot=o(e)}catch(i){h=e.glOptions.preserveDrawingBuffer=!1,r=!1}}}return T=!1,r},k.initializeGLCamera=function(){var t=this,e=t.fullSceneLayout.camera,r="orthographic"===e.projection.type;t.camera=a(t.container,{center:[e.center.x,e.center.y,e.center.z],eye:[e.eye.x,e.eye.y,e.eye.z],up:[e.up.x,e.up.y,e.up.z],_ortho:r,zoomMin:.01,zoomMax:100,mode:"orbit"})},k.initializeGLPlot=function(){var t=this;if(t.initializeGLCamera(),!t.tryCreatePlot())return m(t);t.traces={},t.make4thDimension();var e=t.graphDiv,r=e.layout,n=function(){var e={};return t.isCameraChanged(r)&&(e[t.id+".camera"]=t.getCamera()),t.isAspectChanged(r)&&(e[t.id+".aspectratio"]=t.glplot.getAspectratio(),"manual"!==r[t.id].aspectmode&&(t.fullSceneLayout.aspectmode=r[t.id].aspectmode=e[t.id+".aspectmode"]="manual")),e},i=function(t){if(!1!==t.fullSceneLayout.dragmode){var e=n();t.saveLayout(r),t.graphDiv.emit("plotly_relayout",e)}};return t.glplot.canvas&&(t.glplot.canvas.addEventListener("mouseup",(function(){i(t)})),t.glplot.canvas.addEventListener("touchstart",(function(){_=!0})),t.glplot.canvas.addEventListener("wheel",(function(r){if(e._context._scrollZoom.gl3d){if(t.camera._ortho){var n=r.deltaX>r.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},k.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),h=null,f=e.glplot.selection,m=0;m<c.length;++m)"skip"!==(t=e.traces[c[m]]).data.hoverinfo&&t.handlePick(f)&&(h=t),t.setContourLevels&&t.setContourLevels();function y(t,r,n){var i=e.fullSceneLayout[t+"axis"];return"log"!==i.type&&(r=i.d2l(r)),d.hoverLabelText(i,r,n)}if(null!==h){var v=g(e.glplot.cameraParams,f.dataCoordinate);t=h.data;var b,w=r._fullData[t.index],k=f.index,T={xLabel:y("x",f.traceCoordinate[0],t.xhoverformat),yLabel:y("y",f.traceCoordinate[1],t.yhoverformat),zLabel:y("z",f.traceCoordinate[2],t.zhoverformat)},S=p.castHoverinfo(w,e.fullLayout,k),A=(S||"").split("+"),M=S&&"all"===S;w.hovertemplate||M||(-1===A.indexOf("x")&&(T.xLabel=void 0),-1===A.indexOf("y")&&(T.yLabel=void 0),-1===A.indexOf("z")&&(T.zLabel=void 0),-1===A.indexOf("text")&&(f.textLabel=void 0),-1===A.indexOf("name")&&(h.name=void 0));var C=[];"cone"===t.type||"streamtube"===t.type?(T.uLabel=y("x",f.traceCoordinate[3],t.uhoverformat),(M||-1!==A.indexOf("u"))&&C.push("u: "+T.uLabel),T.vLabel=y("y",f.traceCoordinate[4],t.vhoverformat),(M||-1!==A.indexOf("v"))&&C.push("v: "+T.vLabel),T.wLabel=y("z",f.traceCoordinate[5],t.whoverformat),(M||-1!==A.indexOf("w"))&&C.push("w: "+T.wLabel),T.normLabel=f.traceCoordinate[6].toPrecision(3),(M||-1!==A.indexOf("norm"))&&C.push("norm: "+T.normLabel),"streamtube"===t.type&&(T.divergenceLabel=f.traceCoordinate[7].toPrecision(3),(M||-1!==A.indexOf("divergence"))&&C.push("divergence: "+T.divergenceLabel)),f.textLabel&&C.push(f.textLabel),b=C.join("<br>")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(f.traceCoordinate[3]),t.valuehoverformat),C.push("value: "+T.valueLabel),f.textLabel&&C.push(f.textLabel),b=C.join("<br>")):b=f.textLabel;var E={x:f.traceCoordinate[0],y:f.traceCoordinate[1],z:f.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:k};p.appendArrayPointValue(E,w,k),t._module.eventData&&(E=w._module.eventData(E,f,w,{},k));var L={points:[E]};if(e.fullSceneLayout.hovermode){var P=[];p.loneHover({trace:w,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:b,name:h.name,color:p.castHoverOption(w,k,"bgcolor")||h.color,borderColor:p.castHoverOption(w,k,"bordercolor"),fontFamily:p.castHoverOption(w,k,"font.family"),fontSize:p.castHoverOption(w,k,"font.size"),fontColor:p.castHoverOption(w,k,"font.color"),nameLength:p.castHoverOption(w,k,"namelength"),textAlign:p.castHoverOption(w,k,"align"),hovertemplate:u.castOption(w,k,"hovertemplate"),hovertemplateLabels:u.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:P}),E.bbox=P[0]}f.distance<5&&(f.buttons||_)?r.emit("plotly_click",L):r.emit("plotly_hover",L),this.oldEventData=L}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},k.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var S=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=S[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],h=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var d,p=0;p<(h||l.length);p++)if(u.isArrayOrTypedArray(l[p]))for(var f=0;f<l[p].length;++f)d=s.d2l(l[p][f],0,c),!isNaN(d)&&isFinite(d)&&(r[0][i]=Math.min(r[0][i],d),r[1][i]=Math.max(r[1][i],d));else d=s.d2l(l[p],0,c),!isNaN(d)&&isFinite(d)&&(r[0][i]=Math.min(r[0][i],d),r[1][i]=Math.max(r[1][i],d));else r[0][i]=Math.min(r[0][i],0),r[1][i]=Math.max(r[1][i],h-1)}}k.plot=function(t,e,r){var n=this;if(n.plotArgs=[t,e,r],!n.glplot.contextLost){var i,a,o,s,l,c,u=e[n.id],h=r[n.id];n.fullLayout=e,n.fullSceneLayout=u,n.axesOptions.merge(e,u),n.spikeOptions.merge(u),n.setViewport(u),n.updateFx(u.dragmode,u.hovermode),n.camera.enableWheel=n.graphDiv._context._scrollZoom.gl3d,n.glplot.setClearColor(f(u.bgcolor)),n.setConvert(l),t?Array.isArray(t)||(t=[t]):t=[];var d=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;o<t.length;++o)!0===(i=t[o]).visible&&0!==i._length&&A(this,i,d);!function(t,e){for(var r=t.fullSceneLayout,n=r.annotations||[],i=0;i<3;i++)for(var a=S[i],o=a.charAt(0),s=r[a],l=0;l<n.length;l++){var c=n[l];if(c.visible){var u=s.r2l(c[o]);!isNaN(u)&&isFinite(u)&&(e[0][i]=Math.min(e[0][i],u),e[1][i]=Math.max(e[1][i],u))}}}(this,d);var p=[1,1,1];for(s=0;s<3;++s)d[1][s]===d[0][s]?p[s]=1:p[s]=1/(d[1][s]-d[0][s]);for(n.dataScale=p,n.convertAnnotations(this),o=0;o<t.length;++o)!0===(i=t[o]).visible&&0!==i._length&&((a=n.traces[i.uid])?a.data.type===i.type?a.update(i):(a.dispose(),a=i._module.plot(this,i),n.traces[i.uid]=a):(a=i._module.plot(this,i),n.traces[i.uid]=a),a.name=i.name);var m=Object.keys(n.traces);t:for(o=0;o<m.length;++o){for(s=0;s<t.length;++s)if(t[s].uid===m[o]&&!0===t[s].visible&&0!==t[s]._length)continue t;(a=n.traces[m[o]]).dispose(),delete n.traces[m[o]]}n.glplot.objects.sort((function(t,e){return t._trace.data.index-e._trace.data.index}));var g,y=[[0,0,0],[0,0,0]],v=[],x={};for(o=0;o<3;++o){var _;if((c=(l=u[S[o]]).type)in x?(x[c].acc*=p[o],x[c].count+=1):x[c]={acc:p[o],count:1},l.autorange){y[0][o]=1/0,y[1][o]=-1/0;var w=n.glplot.objects,k=n.fullSceneLayout.annotations||[],T=l._name.charAt(0);for(s=0;s<w.length;s++){var M=w[s],C=M.bounds,E=M._trace.data._pad||0;"ErrorBars"===M.constructor.name&&l._lowerLogErrorBound?y[0][o]=Math.min(y[0][o],l._lowerLogErrorBound):y[0][o]=Math.min(y[0][o],C[0][o]/p[o]-E),y[1][o]=Math.max(y[1][o],C[1][o]/p[o]+E)}for(s=0;s<k.length;s++){var L=k[s];if(L.visible){var P=l.r2l(L[T]);y[0][o]=Math.min(y[0][o],P),y[1][o]=Math.max(y[1][o],P)}}if("rangemode"in l&&"tozero"===l.rangemode&&(y[0][o]=Math.min(y[0][o],0),y[1][o]=Math.max(y[1][o],0)),y[0][o]>y[1][o])y[0][o]=-1,y[1][o]=1;else{var I=y[1][o]-y[0][o];y[0][o]-=I/32,y[1][o]+=I/32}if(_=[y[0][o],y[1][o]],_=b(_,l),y[0][o]=_[0],y[1][o]=_[1],l.isReversed()){var z=y[0][o];y[0][o]=y[1][o],y[1][o]=z}}else _=l.range,y[0][o]=l.r2l(_[0]),y[1][o]=l.r2l(_[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var O=u.aspectmode;if("cube"===O)g=[1,1,1];else if("manual"===O){var D=u.aspectratio;g=[D.x,D.y,D.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=x[c=(l=u[S[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}g="data"===O||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var B=u.domain||null,j=e._size||null;if(B&&j){var N=n.container.style;N.position="absolute",N.left=j.l+B.x[0]*j.w+"px",N.top=j.t+(1-B.y[1])*j.h+"px",N.width=j.w*(B.x[1]-B.x[0])+"px",N.height=j.h*(B.y[1]-B.y[0])+"px"}n.glplot.redraw()}},k.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},k.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},k.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},k.isCameraChanged=function(t){var e=this.getCamera(),r=u.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},k.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=u.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},k.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(t),d=s.isAspectChanged(t),p=h||d;if(p){var f={};h&&(e=s.getCamera(),n=(r=u.nestedProperty(t,s.id+".camera")).get(),f[s.id+".camera"]=n),d&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(t,s.id+".aspectratio")).get(),f[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,f),h&&(r.set(e),u.nestedProperty(l,s.id+".camera").set(e)),d&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},k.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var d=r.id+".camera.up",p={x:0,y:0,z:1},f={};f[d]=p;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,f),o.up=p,u.nestedProperty(m,d).set(p)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},k.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(r),e.glplot.redraw();var n=e.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n<i;++n,--i)for(var a=0;a<e;++a)for(var o=0;o<4;++o){var s=4*(e*n+a)+o,l=4*(e*i+a)+o,c=t[s];t[s]=t[l],t[l]=c}}(o,i,a),function(t,e,r){for(var n=0;n<r;++n)for(var i=0;i<e;++i){var a=4*(e*n+i),o=t[a+3];if(o>0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(r),l},k.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[S[t]];d.setConvert(e,this.fullLayout),e.setScale=u.noop}},k.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t._mockAxis,e)},e.exports=w}}),rm=d({"src/plots/gl3d/layout/attributes.js"(t,e){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),nm=d({"src/plots/gl3d/layout/axis_attributes.js"(t,e){var r=q(),n=Ee(),i=D().extendFlat,a=Pt().overrideAll;e.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),im=d({"src/plots/gl3d/layout/layout_attributes.js"(t,e){var r=nm(),n=ka().attributes,i=D().extendFlat,a=se().counterRegex;function o(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),am=d({"src/plots/gl3d/layout/axis_defaults.js"(t,e){var r=O().mix,n=se(),i=ge(),a=nm(),o=xi(),s=wi(),l=["xaxis","yaxis","zaxis"],c=13600/187;e.exports=function(t,e,u){var h,d;function p(t,e){return n.coerce(h,d,a,t,e)}for(var f=0;f<l.length;f++){var m=l[f];h=t[m]||{},(d=i.newContainer(e,m))._id=m[0]+u.scene,d._name=m,o(h,d,p,u),s(h,d,p,{font:u.font,letter:m[0],data:u.data,showGrid:!0,noAutotickangles:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,bgColor:u.bgColor,calendar:u.calendar},u.fullLayout),p("gridcolor",r(d.color,u.bgColor,c).toRgbString()),p("title.text",m[0]),d.setScale=n.noop,p("showspikes")&&(p("spikesides"),p("spikethickness"),p("spikecolor",d.color)),p("showaxeslabels"),p("showbackground")&&p("backgroundcolor")}}}}),om=d({"src/plots/gl3d/layout/defaults.js"(t,e){var r=se(),n=q(),i=Vt(),a=qs(),o=am(),s=im(),l=_e().getSubplotData,c="gl3d";function u(t,e,r,a){for(var s=r("bgcolor"),u=n.combine(s,a.paper_bgcolor),h=["up","center","eye"],d=0;d<h.length;d++)r("camera."+h[d]+".x"),r("camera."+h[d]+".y"),r("camera."+h[d]+".z");r("camera.projection.type");var p=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),f=r("aspectmode",p?"manual":"auto");p||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===f&&(e.aspectmode="auto"),t.aspectmode=e.aspectmode);var m=l(a.fullData,c,a.id);o(t,e,{font:a.font,scene:a.id,data:m,bgColor:u,calendar:a.calendar,autotypenumbersDflt:a.autotypenumbersDflt,fullLayout:a.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(t,e,a);var g=a.getDfltFromLayout("dragmode");if(!1!==g&&!g)if(g="orbit",t.camera&&t.camera.up){var y=t.camera.up.x,v=t.camera.up.y,x=t.camera.up.z;0!==x&&(y&&v&&x?x/Math.sqrt(y*y+v*v+x*x)>.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}e.exports=function(t,e,n){var i=e._basePlotModules.length>1;a(t,e,n,{type:c,attributes:s,handleDefaults:u,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!i)return r.validate(t[e],s[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}}}),sm=d({"src/plots/gl3d/index.js"(t){var e=Pt().overrideAll,r=B(),n=em(),i=_e().getSubplotData,a=se(),o=Te(),s="gl3d",l="scene";t.name=s,t.attr=l,t.idRoot=l,t.idRegex=t.attrRegex=a.counterRegex("scene"),t.attributes=rm(),t.layoutAttributes=im(),t.baseLayoutAttrOverrides=e({hoverlabel:r.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=om(),t.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],c=i(r,s,l),u=e[l],h=u.camera,d=u._scene;d||(d=new n({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio,camera:h},e),u._scene=d),d.viewInitial||(d.viewInitial={up:{x:h.up.x,y:h.up.y,z:h.up.z},eye:{x:h.eye.x,y:h.eye.y,z:h.eye.z},center:{x:h.center.x,y:h.center.y,z:h.center.z}}),d.plot(c,e,t.layout)}},t.clean=function(t,e,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},t.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots[s],n=e._size,i=0;i<r.length;i++){var a=e[r[i]],l=a.domain,c=a._scene,u=c.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":u,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),c.destroy()}},t.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),l+e}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[s],n=0;n<r.length;n++)e[r[n]]._scene.updateFx(e.dragmode,e.hovermode)}}}),lm=d({"src/traces/scatter3d/index.js"(t,e){e.exports={plot:Hf(),attributes:Wf(),markerSymbols:qf(),supplyDefaults:Gf(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:Yf(),moduleType:"trace",name:"scatter3d",basePlotModule:sm(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}}),cm=d({"lib/scatter3d.js"(t,e){e.exports=lm()}}),um=d({"src/traces/surface/attributes.js"(t,e){var r=q(),n=Pe(),i=Ce().axisHoverFormat,a=Ot().hovertemplateAttrs,o=N(),s=D().extendFlat,l=Pt().overrideAll;function c(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:r.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:r.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=e.exports=l(s({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},n("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes"}}),hm=d({"src/traces/surface/defaults.js"(t,e){var r=Vt(),n=se(),i=Ve(),a=um();function o(t,e,r,n){var i=n("opacityscale");"max"===i?e.opacityscale=[[0,.1],[1,1]]:"min"===i?e.opacityscale=[[0,1],[1,.1]]:"extremes"===i?e.opacityscale=function(t,e){for(var r=[],n=0;n<32;n++){var i=n/31,a=e+(1-e)*(1-Math.pow(Math.sin(t*i*Math.PI),2));r.push([i,Math.max(0,Math.min(1,a))])}return r}(1,.1):function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!==+t[0][0]||1!==+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var n=t[r];if(2!==n.length||+n[0]<e)return!1;e=+n[0]}return!0}(i)||(e.opacityscale=void 0)}e.exports={supplyDefaults:function(t,e,s,l){var c,u;function h(r,i){return n.coerce(t,e,a,r,i)}var d=h("x"),p=h("y"),f=h("z");if(!f||!f.length||d&&d.length<1||p&&p.length<1)e.visible=!1;else{e._xlength=Array.isArray(d)&&n.isArrayOrTypedArray(d[0])?f.length:f[0].length,e._ylength=f.length,r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],l),h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach((function(t){h(t)})),h("surfacecolor");var m=["x","y","z"];for(c=0;c<3;++c){var g="contours."+m[c],y=h(g+".show"),v=h(g+".highlight");if(y||v)for(u=0;u<3;++u)h(g+".project."+m[u]);y&&(h(g+".color"),h(g+".width"),h(g+".usecolormap")),v&&(h(g+".highlightcolor"),h(g+".highlightwidth")),h(g+".start"),h(g+".end"),h(g+".size")}i(t,e,l,h,{prefix:"",cLetter:"c"}),o(0,e,0,h),e._length=null}},opacityscaleDefaults:o}}}),dm=d({"src/traces/surface/calc.js"(t,e){var r=He();e.exports=function(t,e){e.surfacecolor?r(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):r(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}}}),pm=d({"src/traces/surface/convert.js"(t,e){var r=zf().gl_surface3d,n=zf().ndarray,i=zf().ndarray_linear_interpolate.d2,a=zo(),o=Oo(),s=se().isArrayOrTypedArray,l=Uf().parseColorScale,c=Nf(),u=We().extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var d=h.prototype;d.getXat=function(t,e,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},d.getYat=function(t,e,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},d.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},d.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!==o&&void 0!==o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var l=this.data.hovertext||this.data.text;return s(l)&&l[i]&&void 0!==l[i][n]?t.textLabel=l[i][n]:t.textLabel=l||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var p=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function f(t,e){if(t<e)return 0;for(var r=0;0===Math.floor(t%e);)t/=e,r++;return r}function m(t){for(var e=[],r=0;r<p.length;r++){var n=p[r];e.push(f(t,n))}return e}function g(t){for(var e=m(t),r=t,n=0;n<p.length;n++)if(e[n]>0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a<p.length;a++)i*=Math.pow(p[a],Math.max(r[a],n[a]));return i}}d.calcXnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getXat(e-1,0),i=this.getXat(e,0);r[e-1]=i!==n&&void 0!==n&&null!==n&&void 0!==i&&null!==i?Math.abs(i-n):0}var a=0;for(e=1;e<t;e++)a+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(a/r[e-1]);return r},d.calcYnums=function(t){var e,r=[];for(e=1;e<t;e++){var n=this.getYat(0,e-1),i=this.getYat(0,e);r[e-1]=i!==n&&void 0!==n&&null!==n&&void 0!==i&&null!==i?Math.abs(i-n):0}var a=0;for(e=1;e<t;e++)a+=r[e-1];for(e=1;e<t;e++)0===r[e-1]?r[e-1]=1:r[e-1]=Math.round(a/r[e-1]);return r};var v=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=v[9],b=v[13];function _(t,e,r){var n=r[8]+r[2]*e[0]+r[5]*e[1];return t[0]=(r[6]+r[0]*e[0]+r[3]*e[1])/n,t[1]=(r[7]+r[1]*e[0]+r[4]*e[1])/n,t}function w(t,e,r){return function(t,e,r,n){for(var a=[0,0],o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++)r(a,[l,c],n),t.set(l,c,i(e,a[0],a[1]))}(t,e,_,r),t}function k(t,e){for(var r=!1,n=0;n<t.length;n++)if(e===t[n]){r=!0;break}!1===r&&t.push(e)}d.estimateScale=function(t,e){for(var r=1+function(t){if(0!==t.length){for(var e=1,r=0;r<t.length;r++)e=y(e,t[r]);return e}}(0===e?this.calcXnums(t):this.calcYnums(t));r<x;)r*=2;for(;r>b;)r--,r/=g(r),++r<x&&(r=b);var n=Math.round(r/t);return n>1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,i=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],d=0;d<t.length;++d){this.surface.padField(u,t[d]);var p=n(new Float32Array(o*s),[o,s]);w(p,u,h),t[d]=p}},d.setContourLevels=function(){var t,e,r,n=[[],[],[]],i=[!1,!1,!1],a=!1;for(t=0;t<3;++t)if(this.showContour[t]&&(a=!0,this.contourSize[t]>0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];e<this.contourEnd[t];e+=this.contourSize[t])r=e*this.scene.dataScale[t],k(n[t],r);if(a){var o=[[],[],[]];for(t=0;t<3;++t)this.showContour[t]&&(o[t]=i[t]?n[t]:this.scene.contourLevels[t]);this.surface.update({levels:o})}},d.update=function(t){var e,r,i,s,h=this.scene,d=h.fullSceneLayout,p=this.surface,f=l(t),m=h.dataScale,g=t.z[0].length,y=t._ylength,v=h.contourLevels;this.data=t;var x=[];for(e=0;e<3;e++)for(x[e]=[],r=0;r<g;r++)x[e][r]=[];for(r=0;r<g;r++)for(i=0;i<y;i++)x[0][r][i]=this.getXat(r,i,t.xcalendar,d.xaxis),x[1][r][i]=this.getYat(r,i,t.ycalendar,d.yaxis),x[2][r][i]=this.getZat(r,i,t.zcalendar,d.zaxis);if(t.connectgaps)for(t._emptypoints=o(x[2]),a(x[2],t._emptypoints),t._interpolatedZ=[],r=0;r<g;r++)for(t._interpolatedZ[r]=[],i=0;i<y;i++)t._interpolatedZ[r][i]=x[2][r][i];for(e=0;e<3;e++)for(r=0;r<g;r++)for(i=0;i<y;i++)null===(s=x[e][r][i])||void 0===s?x[e][r][i]=NaN:s=x[e][r][i]*=m[e];for(e=0;e<3;e++)for(r=0;r<g;r++)for(i=0;i<y;i++)null!==(s=x[e][r][i])&&void 0!==s&&(this.minValues[e]>s&&(this.minValues[e]=s),this.maxValues[e]<s&&(this.maxValues[e]=s));for(e=0;e<3;e++)this.objectOffset[e]=.5*(this.minValues[e]+this.maxValues[e]);for(e=0;e<3;e++)for(r=0;r<g;r++)for(i=0;i<y;i++)null!==(s=x[e][r][i])&&void 0!==s&&(x[e][r][i]-=this.objectOffset[e]);var _=[n(new Float32Array(g*y),[g,y]),n(new Float32Array(g*y),[g,y]),n(new Float32Array(g*y),[g,y])];for(e=0;e<3;e++)for(r=0;r<g;r++)for(i=0;i<y;i++)_[e].set(r,i,x[e][r][i]);x=[];var w={colormap:f,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:t.opacityscale,opacity:t.opacity},k=u(t);if(w.intensityBounds=[k.min,k.max],t.surfacecolor){var T=n(new Float32Array(g*y),[g,y]);for(r=0;r<g;r++)for(i=0;i<y;i++)T.set(r,i,t.surfacecolor[i][r]);_.push(T)}else w.intensityBounds[0]*=m[2],w.intensityBounds[1]*=m[2];(b<_[0].shape[0]||b<_[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(_[0].shape[0],0),this.dataScaleY=this.estimateScale(_[0].shape[1],1),1===this.dataScaleX&&1===this.dataScaleY||this.refineCoords(_)),t.surfacecolor&&(w.intensity=_.pop());var S=[!0,!0,!0],A=["x","y","z"];for(e=0;e<3;++e){var M=t.contours[A[e]];S[e]=M.highlight,w.showContour[e]=M.show||M.highlight,w.showContour[e]&&(w.contourProject[e]=[M.project.x,M.project.y,M.project.z],M.show?(this.showContour[e]=!0,w.levels[e]=v[e],p.highlightColor[e]=w.contourColor[e]=c(M.color),M.usecolormap?p.highlightTint[e]=w.contourTint[e]=0:p.highlightTint[e]=w.contourTint[e]=1,w.contourWidth[e]=M.width,this.contourStart[e]=M.start,this.contourEnd[e]=M.end,this.contourSize[e]=M.size):(this.showContour[e]=!1,this.contourStart[e]=null,this.contourEnd[e]=null,this.contourSize[e]=0),M.highlight&&(w.dynamicColor[e]=c(M.highlightcolor),w.dynamicWidth[e]=M.highlightwidth))}(function(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]})(f)&&(w.vertexColor=!0),w.objectOffset=this.objectOffset,w.coords=_,p.update(w),p.visible=t.visible,p.enableDynamic=S,p.enableHighlight=S,p.snapToData=!0,"lighting"in t&&(p.ambientLight=t.lighting.ambient,p.diffuseLight=t.lighting.diffuse,p.specularLight=t.lighting.specular,p.roughness=t.lighting.roughness,p.fresnel=t.lighting.fresnel),"lightposition"in t&&(p.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z])},d.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new h(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),fm=d({"src/traces/surface/index.js"(t,e){e.exports={attributes:um(),supplyDefaults:hm().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:dm(),plot:pm(),moduleType:"trace",name:"surface",basePlotModule:sm(),categories:["gl3d","2dMap","showLegend"],meta:{}}}}),mm=d({"lib/surface.js"(t,e){e.exports=fm()}}),gm=d({"src/traces/mesh3d/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=um(),o=N(),s=D().extendFlat;e.exports=s({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"}),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},r("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})}}),ym=d({"src/traces/isosurface/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=gm(),o=N(),s=D().extendFlat,l=Pt().overrideAll,c=e.exports=l(s({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:i(),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),valuehoverformat:n("value",1),showlegend:s({},o.showlegend,{dflt:!1})},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes"}}),vm=d({"src/traces/isosurface/defaults.js"(t,e){var r=se(),n=Vt(),i=ym(),a=Ve();function o(t,e,r,i,o){var s=o("isomin"),l=o("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(e.isomin=null,e.isomax=null);var c=o("x"),u=o("y"),h=o("z"),d=o("value");c&&c.length&&u&&u.length&&h&&h.length&&d&&d.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(t){o(t+"hoverformat");var e="caps."+t;o(e+".show")&&o(e+".fill");var r="slices."+t;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){o(t)})),a(t,e,i,o,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,n,a){o(t,e,0,a,(function(n,a){return r.coerce(t,e,i,n,a)}))},supplyIsoDefaults:o}}}),xm=d({"src/traces/streamtube/calc.js"(t,e){var r=se(),n=He();function i(t){var e,n,i,o,s,l,c,u,h,d,p,f,m=t._x,g=t._y,y=t._z,v=t._len,x=-1/0,b=1/0,_=-1/0,w=1/0,k=-1/0,T=1/0,S="";for(v&&(c=m[0],h=g[0],p=y[0]),v>1&&(u=m[v-1],d=g[v-1],f=y[v-1]),e=0;e<v;e++)x=Math.max(x,m[e]),b=Math.min(b,m[e]),_=Math.max(_,g[e]),w=Math.min(w,g[e]),k=Math.max(k,y[e]),T=Math.min(T,y[e]),o||m[e]===c||(o=!0,S+="x"),s||g[e]===h||(s=!0,S+="y"),l||y[e]===p||(l=!0,S+="z");o||(S+="x"),s||(S+="y"),l||(S+="z");var A=a(t._x),M=a(t._y),C=a(t._z);S=(S=(S=S.replace("x",(c>u?"-":"+")+"x")).replace("y",(h>d?"-":"+")+"y")).replace("z",(p>f?"-":"+")+"z");var E=function(){v=0,A=[],M=[],C=[]};(!v||v<A.length*M.length*C.length)&&E();var L=function(t){return"x"===t?m:"y"===t?g:y},P=function(t){return"x"===t?A:"y"===t?M:C},I=function(t){return t[v-1]<t[0]?-1:1},z=L(S[1]),O=L(S[3]),D=L(S[5]),R=P(S[1]).length,F=P(S[3]).length,B=P(S[5]).length,j=!1,N=function(t,e,r){return R*(F*t+e)+r},U=I(L(S[1])),V=I(L(S[3])),q=I(L(S[5]));for(e=0;e<B-1;e++){for(n=0;n<F-1;n++){for(i=0;i<R-1;i++){var $=N(e,n,i),H=N(e,n,i+1),W=N(e,n+1,i),G=N(e+1,n,i);if(z[$]*U<z[H]*U&&O[$]*V<O[W]*V&&D[$]*q<D[G]*q||(j=!0),j)break}if(j)break}if(j)break}return j&&(r.warn("Encountered arbitrary coordinates! Unable to input data grid."),E()),{xMin:b,yMin:w,zMin:T,xMax:x,yMax:_,zMax:k,Xs:A,Ys:M,Zs:C,len:v,fill:S}}function a(t){return r.distinctVals(t).vals}function o(t,e){if(void 0===e&&(e=t.length),r.isTypedArray(t))return t.subarray(0,e);for(var n=[],i=0;i<e;i++)n[i]=+t[i];return n}e.exports={calc:function(t,e){e._len=Math.min(e.u.length,e.v.length,e.w.length,e.x.length,e.y.length,e.z.length),e._u=o(e.u,e._len),e._v=o(e.v,e._len),e._w=o(e.w,e._len),e._x=o(e.x,e._len),e._y=o(e.y,e._len),e._z=o(e.z,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;var a,s,l,c=0;e.starts&&(a=o(e.starts.x||[]),s=o(e.starts.y||[]),l=o(e.starts.z||[]),c=Math.min(a.length,s.length,l.length)),e._startsX=a||[],e._startsY=s||[],e._startsZ=l||[];var u,h=0,d=1/0;for(u=0;u<e._len;u++){var p=e._u[u],f=e._v[u],m=e._w[u],g=Math.sqrt(p*p+f*f+m*m);h=Math.max(h,g),d=Math.min(d,g)}for(n(t,e,{vals:[d,h],containerStr:"",cLetter:"c"}),u=0;u<c;u++){var y=a[u];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=s[u];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var x=l[u];r.zMax=Math.max(r.zMax,x),r.zMin=Math.min(r.zMin,x)}e._slen=c,e._normMax=h,e._xbnds=[r.xMin,r.xMax],e._ybnds=[r.yMin,r.yMax],e._zbnds=[r.zMin,r.zMax]},filter:o,processGrid:i}}}),bm=d({"src/traces/isosurface/calc.js"(t,e){var r=He(),n=xm().processGrid,i=xm().filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=i(e.x,e._len),e._y=i(e.y,e._len),e._z=i(e.z,e._len),e._value=i(e.value,e._len);var a=n(e);e._gridFill=a.fill,e._Xs=a.Xs,e._Ys=a.Ys,e._Zs=a.Zs,e._len=a.len;for(var o=1/0,s=-1/0,l=0;l<e._len;l++){var c=e._value[l];o=Math.min(o,c),s=Math.max(s,c)}e._minValues=o,e._maxValues=s,e._vMin=void 0===e.isomin||null===e.isomin?o:e.isomin,e._vMax=void 0===e.isomax||null===e.isomax?s:e.isomax,r(t,e,{vals:[e._vMin,e._vMax],containerStr:"",cLetter:"c"})}}}),_m=d({"src/plots/gl3d/zip3.js"(t,e){e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a<n;a++)i[a]=[t[a],e[a],r[a]];return i}}}),wm=d({"src/traces/isosurface/convert.js"(t,e){var r=zf().gl_mesh3d,n=Uf().parseColorScale,i=se().isArrayOrTypedArray,a=Nf(),o=We().extractOpts,s=_m(),l=function(t,e){for(var r=e.length-1;r>0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n<t&&t<=i)return{id:r,distRatio:(i-t)/(i-n)}}return{id:0,distRatio:0}};function c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var u=c.prototype;u.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,d=t.index=h+s*u+s*o*c;t.traceCoordinate=[this.data._meshX[d],this.data._meshY[d],this.data._meshZ[d],this.data._value[d]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[d]?t.textLabel=p[d]:p&&(t.textLabel=p),!0}},u.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=d(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},c=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=n(t),this.mesh.update(l)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var h=["xyz","xzy","yxz","yzx","zxy","zyx"];function d(t){t._meshI=[],t._meshJ=[],t._meshK=[];var e,r,n,i,a,o,s,c=t.surface.show,u=t.spaceframe.show,d=t.surface.fill,p=t.spaceframe.fill,f=!1,m=!1,g=0,y=t._Xs,v=t._Ys,x=t._Zs,b=y.length,_=v.length,w=x.length,k=h.indexOf(t._gridFill.replace(/-/g,"").replace(/\+/g,"")),T=function(t,e,r){switch(k){case 5:return r+w*e+w*_*t;case 4:return r+w*t+w*b*e;case 3:return e+_*r+_*w*t;case 2:return e+_*t+_*b*r;case 1:return t+b*r+b*w*e;default:return t+b*e+b*_*r}},S=t._minValues,A=t._maxValues,M=t._vMin,C=t._vMax;function E(t,e,s){for(var l=o.length,c=r;c<l;c++)if(t===n[c]&&e===i[c]&&s===a[c])return c;return-1}function L(){r=e}function P(){n=[],i=[],a=[],o=[],e=0,L()}function I(t,r,s,l){return n.push(t),i.push(r),a.push(s),o.push(l),++e-1}function z(t,e,r){for(var n=[],i=0;i<t.length;i++)n[i]=t[i]*(1-r)+r*e[i];return n}function O(t){s=t}function D(t,e){return"all"===t||null===t||t.indexOf(e)>-1}function R(t,e){return null===t?e:t}function F(e,r,n){L();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i<t.length;i++)n[i]=(t[i]+e[i]+r[i])/3;return n}(r,n,i),o=Math.sqrt(1-s),l=z(a,r,o),c=z(a,n,o),u=z(a,i,o),h=e[0],d=e[1],p=e[2];return{xyzv:[[r,n,c],[c,l,r],[n,i,u],[u,c,n],[i,r,l],[l,u,i]],abc:[[h,d,-1],[-1,-1,h],[d,p,-1],[-1,-1,d],[p,h,-1],[-1,-1,p]]}}(r,n);l=u.xyzv,c=u.abc}for(var h=0;h<l.length;h++){r=l[h],n=c[h];for(var d=[],p=0;p<3;p++){var f=r[p][0],m=r[p][1],y=r[p][2],v=r[p][3],x=n[p]>-1?n[p]:E(f,m,y);d[p]=x>-1?x:I(f,m,y,R(e,v))}i=d[0],a=d[1],o=d[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];i<r&&(i=r),i>n&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function j(t,e,r){return t>=e&&t<=r}function N(t){var e=.001*(C-M);return t>=M-e&&t<=C+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[j(e[0][3],n,i),j(e[1][3],n,i),j(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,M,C,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],d=e[a[2]],p=B(d,u,n,i),f=B(d,h,n,i);o=l(t,[f,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,f],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],d=e[a[2]],p=B(h,u,n,i),f=B(d,u,n,i);o=l(t,[f,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(t,e,r,n){var i=!1,a=U(e),o=[j(a[0][3],r,n),j(a[1][3],r,n),j(a[2][3],r,n),j(a[3][3],r,n)];if(!o[0]&&!o[1]&&!o[2]&&!o[3])return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],d=a[l[3]];if(m)i=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=B(d,c,r,n),f=B(d,u,r,n),g=B(d,h,r,n);i=F(null,[p,f,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],d=a[l[3]],p=B(h,c,r,n),f=B(h,u,r,n),g=B(d,u,r,n),y=B(d,c,r,n);m?(i=F(t,[c,y,p],[e[l[0]],-1,-1])||i,i=F(t,[u,f,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,f,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],d=a[l[3]],p=B(u,c,r,n),f=B(h,c,r,n),g=B(d,c,r,n);m?(i=F(t,[c,p,f],[e[l[0]],-1,-1])||i,i=F(t,[c,f,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,f,g],[-1,-1,-1])||i,s=!0}}))),i}function $(t,e,r,n,i,a,o,s,l,c,u){var h=!1;return f&&(D(t,"A")&&(h=q(null,[e,r,n,a],c,u)||h),D(t,"B")&&(h=q(null,[r,n,i,l],c,u)||h),D(t,"C")&&(h=q(null,[r,a,o,l],c,u)||h),D(t,"D")&&(h=q(null,[n,a,s,l],c,u)||h),D(t,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(t,[r,n,a,l],c,u)||h),h}function H(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function W(t,e,r,n,i,a,o,s,l){return s?H(t,e,r,i,n,a,o,l):H(t,r,i,n,e,a,o,l)}function G(t,e,r,n,i,a,o){var s,l,c,u,h=!1,d=function(){h=V(t,[s,l,c],[-1,-1,-1],i,a)||h,h=V(t,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],f=o[1],m=o[2];return p&&(s=z(U([T(e,r-0,n-0)])[0],U([T(e-1,r-0,n-0)])[0],p),l=z(U([T(e,r-0,n-1)])[0],U([T(e-1,r-0,n-1)])[0],p),c=z(U([T(e,r-1,n-1)])[0],U([T(e-1,r-1,n-1)])[0],p),u=z(U([T(e,r-1,n-0)])[0],U([T(e-1,r-1,n-0)])[0],p),d()),f&&(s=z(U([T(e-0,r,n-0)])[0],U([T(e-0,r-1,n-0)])[0],f),l=z(U([T(e-0,r,n-1)])[0],U([T(e-0,r-1,n-1)])[0],f),c=z(U([T(e-1,r,n-1)])[0],U([T(e-1,r-1,n-1)])[0],f),u=z(U([T(e-1,r,n-0)])[0],U([T(e-1,r-1,n-0)])[0],f),d()),m&&(s=z(U([T(e-0,r-0,n)])[0],U([T(e-0,r-0,n-1)])[0],m),l=z(U([T(e-0,r-1,n)])[0],U([T(e-0,r-1,n-1)])[0],m),c=z(U([T(e-1,r-1,n)])[0],U([T(e-1,r-1,n-1)])[0],m),u=z(U([T(e-1,r-0,n)])[0],U([T(e-1,r-0,n-1)])[0],m),d()),h}function Y(t,e,r,n,i,a,o,s,l,c,u,h){var d=t;return h?(f&&"even"===t&&(d=null),$(d,e,r,n,i,a,o,s,l,c,u)):(f&&"odd"===t&&(d=null),$(d,l,s,o,a,i,n,r,e,c,u))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],c=1;c<w;c++)for(var u=1;u<_;u++)a.push(W(t,T(l,u-1,c-1),T(l,u-1,c),T(l,u,c-1),T(l,u,c),r,n,(l+u+c)%2,i&&i[o]?i[o]:[])),o++;return a}function X(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],c=1;c<b;c++)for(var u=1;u<w;u++)a.push(W(t,T(c-1,l,u-1),T(c,l,u-1),T(c-1,l,u),T(c,l,u),r,n,(c+l+u)%2,i&&i[o]?i[o]:[])),o++;return a}function K(t,e,r,n,i){for(var a=[],o=0,s=0;s<e.length;s++)for(var l=e[s],c=1;c<_;c++)for(var u=1;u<b;u++)a.push(W(t,T(u-1,c-1,l),T(u-1,c,l),T(u,c-1,l),T(u,c,l),r,n,(u+c+l)%2,i&&i[o]?i[o]:[])),o++;return a}function J(t,e,r){for(var n=1;n<w;n++)for(var i=1;i<_;i++)for(var a=1;a<b;a++)Y(t,T(a-1,i-1,n-1),T(a-1,i-1,n),T(a-1,i,n-1),T(a-1,i,n),T(a,i-1,n-1),T(a,i-1,n),T(a,i,n-1),T(a,i,n),e,r,(a+i+n)%2)}function Q(t,e,r){f=!0,J(t,e,r),f=!1}function tt(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var c=e[l],u=1;u<w;u++)for(var h=1;h<_;h++)o.push(G(t,c,h,u,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function et(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var c=e[l],u=1;u<b;u++)for(var h=1;h<w;h++)o.push(G(t,u,c,h,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function rt(t,e,r,n,i,a){for(var o=[],s=0,l=0;l<e.length;l++)for(var c=e[l],u=1;u<_;u++)for(var h=1;h<b;h++)o.push(G(t,h,u,c,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function nt(t,e){for(var r=[],n=t;n<e;n++)r.push(n);return r}return function(){P(),function(){for(var e=0;e<b;e++)for(var r=0;r<_;r++)for(var n=0;n<w;n++){var i=T(e,r,n);I(t._x[i],t._y[i],t._z[i],t._value[i])}}();var e=null;if(u&&p&&(O(p),m=!0,J(e,M,C),m=!1),c&&d){O(d);for(var r=t.surface.pattern,s=t.surface.count,h=0;h<s;h++){var f=1===s?.5:h/(s-1),k=(1-f)*M+f*C,E=Math.abs(k-S)>Math.abs(k-A)?[S,k]:[k,A];Q(r,E[0],E[1])}}var L=[[Math.min(M,A),Math.max(M,A)],[Math.min(S,C),Math.max(S,C)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i<L.length;i++){var a=0,o=L[i][0],s=L[i][1],c=t.slices[r];if(c.show&&c.fill){O(c.fill);var u=[],h=[],d=[];if(c.locations.length)for(var p=0;p<c.locations.length;p++){var f=l(c.locations[p],"x"===r?y:"y"===r?v:x);0===f.distRatio?u.push(f.id):f.id>0&&(h.push(f.id),"x"===r?d.push([f.distRatio,0,0]):"y"===r?d.push([0,f.distRatio,0]):d.push([0,0,f.distRatio]))}else u=nt(1,"x"===r?b-1:"y"===r?_-1:w-1);h.length>0&&(n[a]="x"===r?tt(e,h,o,s,d,n[a]):"y"===r?et(e,h,o,s,d,n[a]):rt(e,h,o,s,d,n[a]),a++),u.length>0&&(n[a]="x"===r?Z(e,u,o,s,n[a]):"y"===r?X(e,u,o,s,n[a]):K(e,u,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?Z(e,[0,b-1],o,s,n[a]):"y"===r?X(e,[0,_-1],o,s,n[a]):K(e,[0,w-1],o,s,n[a]),a++)}})),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:d,createIsosurfaceTrace:function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}}),km=d({"src/traces/isosurface/index.js"(t,e){e.exports={attributes:ym(),supplyDefaults:vm().supplyDefaults,calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:wm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Tm=d({"lib/isosurface.js"(t,e){e.exports=km()}}),Sm=d({"src/traces/volume/attributes.js"(t,e){var r=Pe(),n=ym(),i=um(),a=N(),o=D().extendFlat,s=Pt().overrideAll,l=e.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Am=d({"src/traces/volume/defaults.js"(t,e){var r=se(),n=Sm(),i=vm().supplyIsoDefaults,a=hm().opacityscaleDefaults;e.exports=function(t,e,o,s){function l(i,a){return r.coerce(t,e,n,i,a)}i(t,e,o,s,l),a(t,e,s,l)}}}),Mm=d({"src/traces/volume/convert.js"(t,e){var r=zf().gl_mesh3d,n=Uf().parseColorScale,i=se().isArrayOrTypedArray,a=Nf(),o=We().extractOpts,s=_m(),l=wm().findNearestOnAxis,c=wm().generateIsoMeshes;function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,d=t.index=h+s*u+s*o*c;t.traceCoordinate=[this.data._meshX[d],this.data._meshY[d],this.data._meshZ[d],this.data._value[d]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[d]?t.textLabel=p[d]:p&&(t.textLabel=p),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=c(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Cm=d({"src/traces/volume/index.js"(t,e){e.exports={attributes:Sm(),supplyDefaults:Am(),calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:Mm(),moduleType:"trace",name:"volume",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Em=d({"lib/volume.js"(t,e){e.exports=Cm()}}),Lm=d({"src/traces/mesh3d/defaults.js"(t,e){var r=Vt(),n=se(),i=Ve(),a=gm();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function c(t){var e=t.map((function(t){var e=l(t);return e&&n.isArrayOrTypedArray(e)?e:null}));return e.every((function(t){return t&&t.length===e[0].length}))&&e}c(["x","y","z"])?(c(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(t){l(t)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in t?(l("intensity"),l("intensitymode"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),e._length=null):e.visible=!1):e.visible=!1}}}),Pm=d({"src/traces/mesh3d/calc.js"(t,e){var r=He();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}}),Im=d({"src/traces/mesh3d/convert.js"(t,e){var r=zf().gl_mesh3d,n=zf().delaunay_triangulate,i=zf().alpha_shape,a=zf().convex_hull,o=Uf().parseColorScale,s=se().isArrayOrTypedArray,l=Nf(),c=We().extractOpts,u=_m();function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=l(t[n]);return e}function f(t,e,r,n){for(var i=[],a=e.length,o=0;o<a;o++)i[o]=t.d2l(e[o],0,n)*r;return i}function m(t){for(var e=[],r=t.length,n=0;n<r;n++)e[n]=Math.round(t[n]);return e}function g(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n]<=-.5||t[n]>=e-.5)return!1;return!0}d.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},d.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var s,h=t.x.length,d=u(f(r.xaxis,t.x,e.dataScale[0],t.xcalendar),f(r.yaxis,t.y,e.dataScale[1],t.ycalendar),f(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;s=u(m(t.i),m(t.j),m(t.k))}else s=0===t.alphahull?a(d):t.alphahull>0?i(t.alphahull,d):function(t,e){for(var r=["x","y","z"].indexOf(t),i=[],a=e.length,o=0;o<a;o++)i[o]=[e[o][(r+1)%3],e[o][(r+2)%3]];return n(i)}(t.delaunayaxis,d);var y={positions:d,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};if(t.intensity){var v=c(t);this.color="#fff";var x=t.intensitymode;y[x+"Intensity"]=t.intensity,y[x+"IntensityBounds"]=[v.min,v.max],y.colormap=o(t)}else t.vertexcolor?(this.color=t.vertexcolor[0],y.vertexColors=p(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],y.cellColors=p(t.facecolor)):(this.color=t.color,y.meshColor=l(t.color));this.mesh.update(y)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new h(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),zm=d({"src/traces/mesh3d/index.js"(t,e){e.exports={attributes:gm(),supplyDefaults:Lm(),calc:Pm(),colorbar:{min:"cmin",max:"cmax"},plot:Im(),moduleType:"trace",name:"mesh3d",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Om=d({"lib/mesh3d.js"(t,e){e.exports=zm()}}),Dm=d({"src/traces/cone/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=gm(),o=N(),s=D().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),e.exports=l}}),Rm=d({"src/traces/cone/defaults.js"(t,e){var r=se(),n=Ve(),i=Dm();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),d=s("y"),p=s("z");if(l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&d&&d.length&&p&&p.length){var f=s("sizemode");s("sizeref","raw"===f?1:.5),s("anchor"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),e._length=null}else e.visible=!1}}}),Fm=d({"src/traces/cone/calc.js"(t,e){var r=He();e.exports=function(t,e){for(var n=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,n.length,i.length,a.length),s=-1/0,l=1/0,c=0;c<o;c++){var u=n[c],h=i[c],d=a[c],p=Math.sqrt(u*u+h*h+d*d);s=Math.max(s,p),l=Math.min(l,p)}e._len=o,e._normMax=s,r(t,e,{vals:[l,s],containerStr:"",cLetter:"c"})}}}),Bm=d({"src/traces/cone/convert.js"(t,e){var r=zf().gl_cone3d,n=zf().gl_cone3d.createConeMesh,i=se().simpleMap,a=Uf().parseColorScale,o=We().extractOpts,s=se().isArrayOrTypedArray,l=_m();function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var u=c.prototype;u.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index,r=this.data.x[e],n=this.data.y[e],i=this.data.z[e],a=this.data.u[e],o=this.data.v[e],l=this.data.w[e];t.traceCoordinate=[r,n,i,a,o,l,Math.sqrt(a*a+o*o+l*l)];var c=this.data.hovertext||this.data.text;return s(c)&&void 0!==c[e]?t.textLabel=c[e]:c&&(t.textLabel=c),!0}};var h={xaxis:0,yaxis:1,zaxis:2},d={tip:1,tail:0,cm:.25,center:.5},p={tip:1,tail:1,cm:.75,center:.5};function f(t,e){var n=t.fullSceneLayout,s=t.dataScale,c={};function u(t,e){var r=n[e],a=s[h[e]];return i(t,(function(t){return r.d2l(t)*a}))}c.vectors=l(u(e.u,"xaxis"),u(e.v,"yaxis"),u(e.w,"zaxis"),e._len),c.positions=l(u(e.x,"xaxis"),u(e.y,"yaxis"),u(e.z,"zaxis"),e._len);var f=o(e);c.colormap=a(e),c.vertexIntensityBounds=[f.min/e._normMax,f.max/e._normMax],c.coneOffset=d[e.anchor];var m=e.sizemode;"scaled"===m?c.coneSize=e.sizeref||.5:"absolute"===m?c.coneSize=e.sizeref&&e._normMax?e.sizeref/e._normMax:.5:"raw"===m&&(c.coneSize=e.sizeref),c.coneSizemode=m;var g=r(c),y=e.lightposition;return g.lightPosition=[y.x,y.y,y.z],g.ambient=e.lighting.ambient,g.diffuse=e.lighting.diffuse,g.specular=e.lighting.specular,g.roughness=e.lighting.roughness,g.fresnel=e.lighting.fresnel,g.opacity=e.opacity,e._pad=p[e.anchor]*g.vectorScale*g.coneScale*e._normMax,g}u.update=function(t){this.data=t;var e=f(this.scene,t);this.mesh.update(e)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=f(t,e),a=n(r,i),o=new c(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}}),jm=d({"src/traces/cone/index.js"(t,e){e.exports={moduleType:"trace",name:"cone",basePlotModule:sm(),categories:["gl3d","showLegend"],attributes:Dm(),supplyDefaults:Rm(),colorbar:{min:"cmin",max:"cmax"},calc:Fm(),plot:Bm(),eventData:function(t,e){return t.norm=e.traceCoordinate[6],t},meta:{}}}}),Nm=d({"lib/cone.js"(t,e){e.exports=jm()}}),Um=d({"src/traces/streamtube/attributes.js"(t,e){var r=Pe(),n=Ce().axisHoverFormat,i=Ot().hovertemplateAttrs,a=gm(),o=N(),s=D().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){l[t]=a[t]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),e.exports=l}}),Vm=d({"src/traces/streamtube/defaults.js"(t,e){var r=se(),n=Ve(),i=Um();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),d=s("y"),p=s("z");l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&d&&d.length&&p&&p.length?(s("starts.x"),s("starts.y"),s("starts.z"),s("maxdisplayed"),s("sizeref"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(t,e,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),e._length=null):e.visible=!1}}}),qm=d({"src/traces/streamtube/convert.js"(t,e){var r=zf().gl_streamtube3d,n=r.createTubeMesh,i=se(),a=Uf().parseColorScale,o=We().extractOpts,s=_m(),l={xaxis:0,yaxis:1,zaxis:2};function c(t,e){this.scene=t,this.uid=e,this.mesh=null,this.data=null}var u=c.prototype;function h(t){var e=t.length;return e>2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var n=t.fullSceneLayout,c=t.dataScale,u=e._len,p={};function f(t,e){var r=n[e],a=c[l[e]];return i.simpleMap(t,(function(t){return r.d2l(t)*a}))}if(p.vectors=s(f(e._u,"xaxis"),f(e._v,"yaxis"),f(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=f(e._Xs,"xaxis"),g=f(e._Ys,"yaxis"),y=f(e._Zs,"zaxis");if(p.meshgrid=[m,g,y],p.gridFill=e._gridFill,e._slen)p.startingPositions=s(f(e._startsX,"xaxis"),f(e._startsY,"yaxis"),f(e._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),b=h(y),_=new Array(x.length*b.length),w=0,k=0;k<x.length;k++)for(var T=0;T<b.length;T++)_[w++]=[x[k],v,b[T]];p.startingPositions=_}p.colormap=a(e),p.tubeSize=e.sizeref,p.maxLength=e.maxdisplayed;var S=f(e._xbnds,"xaxis"),A=f(e._ybnds,"yaxis"),M=f(e._zbnds,"zaxis"),C=d(m),E=d(g),L=d(y),P=[[S[0]-C[0],A[0]-E[0],M[0]-L[0]],[S[1]+C[1],A[1]+E[1],M[1]+L[1]]],I=r(p,P),z=o(e);I.vertexIntensityBounds=[z.min/e._normMax,z.max/e._normMax];var O=e.lightposition;return I.lightPosition=[O.x,O.y,O.z],I.ambient=e.lighting.ambient,I.diffuse=e.lighting.diffuse,I.specular=e.lighting.specular,I.roughness=e.lighting.roughness,I.fresnel=e.lighting.fresnel,I.opacity=e.opacity,e._pad=I.tubeScale*e.sizeref*2,I}u.handlePick=function(t){var e=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(t,n){var i=e[n],a=r[l[n]];return i.l2c(t)/a}if(t.object===this.mesh){var i=t.data.position,a=t.data.velocity;return t.traceCoordinate=[n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),t.data.intensity*this.data._normMax,t.data.divergence],t.textLabel=this.data.hovertext||this.data.text,!0}},u.update=function(t){this.data=t;var e=p(this.scene,t);this.mesh.update(e)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=p(t,e),a=n(r,i),o=new c(t,e.uid);return o.mesh=a,o.data=e,a._trace=o,t.glplot.add(a),o}}}),$m=d({"src/traces/streamtube/index.js"(t,e){e.exports={moduleType:"trace",name:"streamtube",basePlotModule:sm(),categories:["gl3d","showLegend"],attributes:Um(),supplyDefaults:Vm(),colorbar:{min:"cmin",max:"cmax"},calc:xm().calc,plot:qm(),eventData:function(t,e){return t.tubex=t.x,t.tubey=t.y,t.tubez=t.z,t.tubeu=e.traceCoordinate[3],t.tubev=e.traceCoordinate[4],t.tubew=e.traceCoordinate[5],t.norm=e.traceCoordinate[6],t.divergence=e.traceCoordinate[7],delete t.x,delete t.y,delete t.z,t},meta:{}}}}),Hm=d({"lib/streamtube.js"(t,e){e.exports=$m()}}),Wm=d({"src/traces/scattergeo/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=wn(),o=N(),s=Pe(),l=It().dash,c=D().extendFlat,u=Pt().overrideAll,h=a.marker,d=a.line,p=h.line;e.exports=u({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:c({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:d.color,width:d.width,dash:l},connectgaps:a.connectgaps,marker:c({symbol:h.symbol,opacity:h.opacity,angle:h.angle,angleref:c({},h.angleref,{values:["previous","up","north"]}),standoff:h.standoff,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,colorbar:h.colorbar,line:c({width:p.width},s("marker.line")),gradient:h.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:i(),selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:r()},"calc","nested")}}),Gm=d({"src/traces/scattergeo/defaults.js"(t,e){var r=se(),n=Ge(),i=Wn(),a=Gn(),o=Zn(),s=Xn(),l=Wm();e.exports=function(t,e,c,u){function h(n,i){return r.coerce(t,e,l,n,i)}var d,p=h("locations");if(p&&p.length){var f,m=h("geojson");("string"===typeof m&&""!==m||r.isPlainObject(m))&&(f="geojson-id"),"geojson-id"===h("locationmode",f)&&h("featureidkey"),d=p.length}else{var g=h("lon")||[],y=h("lat")||[];d=Math.min(g.length,y.length)}d?(e._length=d,h("text"),h("hovertext"),h("hovertemplate"),h("mode"),n.hasMarkers(e)&&i(t,e,c,u,h,{gradient:!0}),n.hasLines(e)&&(a(t,e,c,u,h),h("connectgaps")),n.hasText(e)&&(h("texttemplate"),o(t,e,u,h)),h("fill"),"none"!==e.fill&&s(t,e,c,h),r.coerceSelectionMarkerOpacity(e,h)):e.visible=!1}}}),Ym=d({"src/traces/scattergeo/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.geo]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),Zm=d({"src/traces/scattergeo/calc.js"(t,e){var r=k(),n=T().BADNUM,i=ri(),a=ni(),o=ii(),s=se().isArrayOrTypedArray,l=se()._;function c(t){return t&&"string"===typeof t}e.exports=function(t,e){var u,h=s(e.locations),d=h?e.locations.length:e._length,p=new Array(d);u=e.geojson?function(t){return c(t)||r(t)}:c;for(var f=0;f<d;f++){var m=p[f]={};if(h){var g=e.locations[f];m.loc=u(g)?g:null}else{var y=e.lon[f],v=e.lat[f];r(y)&&r(v)?m.lonlat=[+y,+v]:m.lonlat=[n,n]}}return a(p,e),i(t,e),o(p,e),d&&(p[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),p}}}),Xm=d({"src/plots/geo/constants.js"(t){t.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},t.axesNames=["lonaxis","lataxis"],t.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},t.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},t.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},t.clipPad=.001,t.precision=.1,t.landColor="#F0DC82",t.waterColor="#3399FF",t.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},t.sphereSVG={type:"Sphere"},t.fillLayers={ocean:1,land:1,lakes:1},t.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},t.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],t.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],t.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}}),Km=d({"node_modules/topojson-client/dist/topojson-client.js"(t,e){var r,n;r=t,n=function(t){function e(t){return t}function r(t){if(null==t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(r+=t[0])*i+o,u[1]=(n+=t[1])*a+s;l<c;)u[l]=t[l],++l;return u}}function n(t){var e,n=r(t.transform),i=1/0,a=i,o=-i,s=-i;function l(t){(t=n(t))[0]<i&&(i=t[0]),t[0]>o&&(o=t[0]),t[1]<a&&(a=t[1]),t[1]>s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++r<l;)(e=n(t[r],r))[0]<i&&(i=e[0]),e[0]>o&&(o=e[0]),e[1]<a&&(a=e[1]),e[1]>s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a<o;++a)e.push(n(r[a],a));t<0&&function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r}(e,o)}function o(t){return n(t)}function s(t){for(var e=[],r=0,n=t.length;r<n;++r)a(t[r],e);return e.length<2&&e.push(e[0]),e}function l(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function c(t){return t.map(l)}return function t(e){var r,n=e.type;switch(n){case"GeometryCollection":return{type:n,geometries:e.geometries.map(t)};case"Point":r=o(e.coordinates);break;case"MultiPoint":r=e.coordinates.map(o);break;case"LineString":r=s(e.arcs);break;case"MultiLineString":r=e.arcs.map(s);break;case"Polygon":r=c(e.arcs);break;case"MultiPolygon":r=e.arcs.map(c);break;default:return null}return{type:n,coordinates:r}}(e)}function o(t,e){var r={},n={},i={},a=[],o=-1;function s(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){r[t<0?~t:t]=1})),a.push(i)}}return e.forEach((function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++o],e[o]=r,e[n]=i)})),e.forEach((function(e){var r,a,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach((function(t){r[0]+=t[0],r[1]+=t[1]}))):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(e),r.end=l,a=n[l]){delete n[a.start];var c=a===r?r:r.concat(a);n[c.start=r.start]=i[c.end=a.end]=c}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(e),r.start=s,a=i[s]){delete i[a.end];var u=a===r?r:a.concat(r);n[u.start=a.start]=i[u.end=r.end]=u}else n[r.start]=i[r.end]=r;else n[(r=[e]).start=s]=i[r.end=l]=r})),s(i,n),s(n,i),e.forEach((function(t){r[t<0?~t:t]||a.push([t])})),a}function s(t,e,r){var n,i,a;if(arguments.length>1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}function c(t){t.forEach(l)}function u(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":c(t.arcs)}}return u(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:o(t,n)}}function l(t,e){var r={},n=[],i=[];function s(t){t.forEach((function(e){e.forEach((function(e){(r[e=e<0?~e:e]||(r[e]=[])).push(t)}))})),n.push(t)}function l(e){return function(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach((function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":s(e.arcs);break;case"MultiPolygon":e.arcs.forEach(s)}})),n.forEach((function(t){if(!t._){var e=[],n=[t];for(t._=1,i.push(e);t=n.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){r[t<0?~t:t].forEach((function(t){t._||(t._=1,n.push(t))}))}))}))}})),n.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:i.map((function(e){var n,i=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){r[t<0?~t:t].length<2&&i.push(t)}))}))})),(n=(i=o(t,i)).length)>1)for(var a,s,c=1,u=l(i[0]);c<n;++c)(a=l(i[c]))>u&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function c(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r}function u(t){if(null==t)return e;var r,n,i=t.scale[0],a=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,e){e||(r=n=0);var l=2,c=t.length,u=new Array(c),h=Math.round((t[0]-o)/i),d=Math.round((t[1]-s)/a);for(u[0]=h-r,r=h,u[1]=d-n,n=d;l<c;)u[l]=t[l],++l;return u}}t.bbox=n,t.feature=function(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return i(t,e)}))}:i(t,e)},t.merge=function(t){return a(t,l.apply(this,arguments))},t.mergeArcs=l,t.mesh=function(t){return a(t,s.apply(this,arguments))},t.meshArcs=s,t.neighbors=function(t){var e={},r=t.map((function(){return[]}));function n(t,r){t.forEach((function(t){t<0&&(t=~t);var n=e[t];n?n.push(r):e[t]=[r]}))}function i(t,e){t.forEach((function(t){n(t,e)}))}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach((function(t){i(t,e)}))}};for(var o in t.forEach((function t(e,r){"GeometryCollection"===e.type?e.geometries.forEach((function(e){t(e,r)})):e.type in a&&a[e.type](e.arcs,r)})),e)for(var s=e[o],l=s.length,u=0;u<l;++u)for(var h=u+1;h<l;++h){var d,p=s[u],f=s[h];(d=r[p])[o=c(d,f)]!==f&&d.splice(o,0,f),(d=r[f])[o=c(d,p)]!==p&&d.splice(o,0,p)}return r},t.quantize=function(t,e){if(t.transform)throw new Error("already quantized");if(e&&e.scale)l=t.bbox;else{if(!((r=Math.floor(e))>=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(e),d=t.objects,p={};function f(t){return h(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:f(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(f)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in d)p[c]=m(d[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=h(t[0],0);++r<i;)((e=h(t[r],r))[0]||e[1])&&(a[n++]=e);return 1===n&&(a[n++]=[0,0]),a.length=n,a}))}},t.transform=r,t.untransform=u,Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).topojson=r.topojson||{})}}),Jm=d({"src/lib/topojson_utils.js"(t,e){var r=e.exports={},n=Xm().locationmodeToLayer,i=Km().feature;r.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(t,e){return t+e+".json"},r.getTopojsonFeatures=function(t,e){var r=n[t.locationmode],a=e.objects[r];return i(e,a).features}}}),Qm=d({"src/lib/geojson_utils.js"(t){var e=T().BADNUM;t.calcTraceToLineCoords=function(t){for(var r=t[0].trace.connectgaps,n=[],i=[],a=0;a<t.length;a++){var o=t[a].lonlat;o[0]!==e?i.push(o):!r&&i.length>0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},t.makeBlank=function(){return{type:"Point",coordinates:[]}}}}),tg=d({"node_modules/country-regex/index.js"(t,e){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}}),eg=d({"node_modules/@turf/helpers/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=6371008.8,r={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*e,kilometers:6371.0088,kilometres:6371.0088,meters:e,metres:e,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:e/1852,radians:1,yards:6967335.223679999},n={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function a(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!m(t[0])||!m(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,r)}function o(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(const n of t){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let t=0;t<n[n.length-1].length;t++)if(n[n.length-1][t]!==n[0][t])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:t},e,r)}function s(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:t},e,r)}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function c(t,e){return i({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function u(t,e){return i({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function h(t,e){return i({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function d(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function f(t){return t%(2*Math.PI)*180/Math.PI}function m(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}t.areaFactors=n,t.azimuthToBearing=function(t){return(t%=360)>0?t>180?t-360:t:t<-180?t+360:t},t.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},t.convertArea=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number");const i=n[e];if(!i)throw new Error("invalid original units");const a=n[r];if(!a)throw new Error("invalid final units");return t/i*a},t.convertLength=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number");return d(p(t,e),r)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=e,t.factors=r,t.feature=i,t.featureCollection=l,t.geometry=function(t,e){switch(t){case"Point":return a(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},t.geometryCollection=function(t,e){return i({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"===typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,e){return f(p(t,e))},t.lengthToRadians=p,t.lineString=s,t.lineStrings=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(t.map((t=>s(t,e))),r)},t.multiLineString=c,t.multiPoint=u,t.multiPolygon=h,t.point=a,t.points=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(t.map((t=>a(t,e))),r)},t.polygon=o,t.polygons=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(t.map((t=>o(t,e))),r)},t.radiansToDegrees=f,t.radiansToLength=d,t.round=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");const r=Math.pow(10,e||0);return Math.round(t*r)/r},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((t=>{if(!m(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}}),rg=d({"node_modules/@turf/meta/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg();function r(t,e,n){if(null!==t)for(var i,a,o,s,l,c,u,h,d=0,p=0,f=t.type,m="FeatureCollection"===f,g="Feature"===f,y=m?t.features.length:1,v=0;v<y;v++){l=(h=!!(u=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var b=0,_=0;if(null!==(s=h?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(c,p,v,b,_))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(!1===e(c[i],p,v,b,_))return!1;p++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(a=0;a<c[i].length-d;a++){if(!1===e(c[i][a],p,v,b,_))return!1;p++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(_=0,a=0;a<c[i].length;a++){for(o=0;o<c[i][a].length-d;o++){if(!1===e(c[i][a][o],p,v,b,_))return!1;p++}_++}b++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===r(s.geometries[i],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function i(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function a(t,e){var r,n,i,a,o,s,l,c,u,h,d=0,p="FeatureCollection"===t.type,f="Feature"===t.type,m=p?t.features.length:1;for(r=0;r<m;r++){for(s=p?t.features[r].geometry:f?t.geometry:t,c=p?t.features[r].properties:f?t.properties:{},u=p?t.features[r].bbox:f?t.bbox:void 0,h=p?t.features[r].id:f?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(a,d,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],d,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,d,c,u,h))return!1;d++}}function o(t,r){a(t,(function(t,n,i,a,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==r(e.feature.call(void 0,t,i,{bbox:a,id:o}),n,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<t.coordinates.length;c++){var u={type:s,coordinates:t.coordinates[c]};if(!1===r(e.feature.call(void 0,u,i),n,c))return!1}}))}function s(t,n){o(t,(function(t,i,a){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,h=0;return!1!==r(t,(function(r,s,d,p,f){if(void 0===l||i>c||p>u||f>h)return l=r,c=i,u=p,h=f,void(o=0);var m=e.lineString.call(void 0,[l,r],t.properties);if(!1===n(m,i,a,f,o))return!1;o++,l=r}))&&void 0}}}))}function l(t,r){if(!t)throw new Error("geojson is required");o(t,(function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===r(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===r(e.lineString.call(void 0,o[s],t.properties),n,i,s))return!1}}}))}t.coordAll=function(t){var e=[];return r(t,(function(t){e.push(t)})),e},t.coordEach=r,t.coordReduce=function(t,e,n,i){var a=n;return r(t,(function(t,r,i,o,s){a=0===r&&void 0===n?t:e(a,t,r,i,o,s)}),i),a},t.featureEach=i,t.featureReduce=function(t,e,r){var n=r;return i(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},t.findPoint=function(t,r){if(r=r||{},!e.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.coordIndex||0,l=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":return e.point.call(void 0,c,l,r);case"MultiPoint":return a<0&&(a=c.length+a),e.point.call(void 0,c[a],l,r);case"LineString":return s<0&&(s=c.length+s),e.point.call(void 0,c[s],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),e.point.call(void 0,c[o][s],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),e.point.call(void 0,c[a][s],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s),e.point.call(void 0,c[a][o][s],l,r)}throw new Error("geojson is invalid")},t.findSegment=function(t,r){if(r=r||{},!e.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.segmentIndex||0,l=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":l=l||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),e.lineString.call(void 0,[c[s],c[s+1]],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),e.lineString.call(void 0,[c[o][s],c[o][s+1]],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s-1),e.lineString.call(void 0,[c[a][s],c[a][s+1]],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s-1),e.lineString.call(void 0,[c[a][o][s],c[a][o][s+1]],l,r)}throw new Error("geojson is invalid")},t.flattenEach=o,t.flattenReduce=function(t,e,r){var n=r;return o(t,(function(t,i,a){n=0===i&&0===a&&void 0===r?t:e(n,t,i,a)})),n},t.geomEach=a,t.geomReduce=function(t,e,r){var n=r;return a(t,(function(t,i,a,o,s){n=0===i&&void 0===r?t:e(n,t,i,a,o,s)})),n},t.lineEach=l,t.lineReduce=function(t,e,r){var n=r;return l(t,(function(t,i,a,o){n=0===i&&void 0===r?t:e(n,t,i,a,o)})),n},t.propEach=n,t.propReduce=function(t,e,r){var i=r;return n(t,(function(t,n){i=0===n&&void 0===r?t:e(i,t,n)})),i},t.segmentEach=s,t.segmentReduce=function(t,e,r){var n=r,i=!1;return s(t,(function(t,a,o,s,l){n=!1===i&&void 0===r?t:e(n,t,a,o,s,l),i=!0})),n}}}),ng=d({"node_modules/@turf/area/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg(),r=rg();function n(t){return r.geomReduce.call(void 0,t,((t,e)=>t+function(t){let e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=i(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)),0)}function i(t){let e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(let r=1;r<t.length;r++)e-=Math.abs(s(t[r]))}return e}var a=e.earthRadius*e.earthRadius/2,o=Math.PI/180;function s(t){const e=t.length-1;if(e<=2)return 0;let r=0,n=0;for(;n<e;){const i=t[n],a=t[n+1===e?0:n+1],s=t[n+2>=e?(n+2)%e:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;t.area=n,t.default=l}}),ig=d({"node_modules/@turf/centroid/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg(),r=rg();function n(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=0,a=0,o=0;return r.coordEach.call(void 0,t,(function(t){i+=t[0],a+=t[1],o++}),!0),e.point.call(void 0,[i/o,a/o],n.properties)}var i=n;t.centroid=n,t.default=i}}),ag=d({"node_modules/@turf/bbox/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=rg();function r(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==r.recompute)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return e.coordEach.call(void 0,t,(t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])})),n}var n=r;t.bbox=r,t.default=n}}),og=d({"src/lib/geo_location_utils.js"(t,e){var r=v(),n=tg(),{area:i}=ng(),{centroid:a}=ig(),{bbox:o}=ag(),s=$t(),l=Z(),c=A(),u=C(),h=fn(),d=Object.keys(n),p={"ISO-3":s,"USA-states":s,"country names":function(t){for(var e=0;e<d.length;e++){var r=d[e];if(new RegExp(n[r]).test(t.trim().toLowerCase()))return r}return l.log("Unrecognized country name: "+t+"."),!1}};function f(t){var e=t.geojson,r=window.PlotlyGeoAssets||{},n="string"===typeof e?r[e]:e;return c(n)?n:(l.error("Oops ... something went wrong when fetching "+e),!1)}e.exports={locationToFeature:function(t,e,r){if(!e||"string"!==typeof e)return!1;var n,i,a,o=p[t](e);if(o){if("USA-states"===t)for(n=[],a=0;a<r.length;a++)(i=r[a]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(a=0;a<n.length;a++)if((i=n[a]).id===o)return i;l.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(t){var e,r,n,i,a=t.geometry,o=a.coordinates,s=t.id,l=[];function c(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];l.push(h.tester(e))}:"ATA"===s?function(t){var e=c(t);if(null===e)return l.push(h.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)e(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)e(o[r])}return l},getTraceGeojson:f,extractTraceFeature:function(t){var e=t[0].trace,r=f(e);if(!r)return!1;var n,o={},s=[];for(n=0;n<e._length;n++){var c=t[n];(c.loc||0===c.loc)&&(o[c.loc]=c)}function h(t){var r=u(t,e.featureidkey||"id").get(),n=o[r];if(n){var c=t.geometry;if("Polygon"===c.type||"MultiPolygon"===c.type){var h={type:"Feature",id:r,geometry:c,properties:{}};h.geometry.coordinates.length>0?h.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},c=i(l);c>o&&(o=c,e=l)}else e=r;return a(e).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n<d.length;n++)h(d[n]);break;case"Feature":h(r);break;default:return l.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var p in o)l.log(["Location *"+p+"*","does not have a matching feature with id-key","*"+e.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(t){var e=window.PlotlyGeoAssets||{},n=[];function i(t){return new Promise((function(n,i){r.json(t,(function(r,a){if(r){delete e[t];var o=404===r.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t;return i(new Error(o))}return e[t]=a,n(a)}))}))}function a(t){return new Promise((function(r,n){var i=0,a=setInterval((function(){return e[t]&&"pending"!==e[t]?(clearInterval(a),r(e[t])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o<t.length;o++){var s=t[o][0].trace.geojson;"string"===typeof s&&(e[s]?"pending"===e[s]&&n.push(a(s)):(e[s]="pending",n.push(i(s))))}return n},computeBbox:function(t){return o(t)}}}}),sg=d({"src/traces/scattergeo/style.js"(t,e){var r=v(),n=Je(),i=q(),a=fi(),o=a.stylePoints,s=a.styleText;e.exports=function(t,e){e&&function(t,e){var a=e[0].trace,l=e[0].node3;l.style("opacity",e[0].trace.opacity),o(l,a,t),s(l,a,t),l.selectAll("path.js-line").style("fill","none").each((function(t){var e=r.select(this),a=t.trace,o=a.line||{};e.call(i.stroke,o.color).call(n.dashLine,o.dash||"",o.width||0),"none"!==a.fill&&e.call(i.fill,a.fillcolor)}))}(t,e)}}}),lg=d({"src/traces/scattergeo/plot.js"(t,e){var r=v(),n=se(),i=Jm().getTopojsonFeatures,a=Qm(),o=og(),s=rr().findExtremes,l=T().BADNUM,c=ai().calcMarkerSize,u=Ge(),h=sg();e.exports={calcGeoJSON:function(t,e){var r,a,u=t[0].trace,h=e[u.geo],d=h._subplot,p=u._length;if(n.isArrayOrTypedArray(u.locations)){var f=u.locationmode,m="geojson-id"===f?o.extractTraceFeature(t):i(u,d.topojson);for(r=0;r<p;r++){a=t[r];var g="geojson-id"===f?a.fOut:o.locationToFeature(f,a.loc,m);a.lonlat=g?g.properties.ct:[l,l]}}var y,v,x={padded:!0};if("geojson"===h.fitbounds&&"geojson-id"===u.locationmode){var b=o.computeBbox(o.getTraceGeojson(u));y=[b[0],b[2]],v=[b[1],b[3]]}else{for(y=new Array(p),v=new Array(p),r=0;r<p;r++)a=t[r],y[r]=a.lonlat[0],v[r]=a.lonlat[1];x.ppad=c(u,p)}u._extremes.lon=s(h.lonaxis._ax,y,x),u._extremes.lat=s(h.lataxis._ax,v,x)},plot:function(t,e,i){var o=e.layers.frontplot.select(".scatterlayer"),s=n.makeTraceGroups(o,i,"trace scattergeo");function c(t,e){t.lonlat[0]===l&&r.select(e).remove()}s.selectAll("*").remove(),s.each((function(e){var i=r.select(this),o=e[0].trace;if(u.hasLines(o)||"none"!==o.fill){var s=a.calcTraceToLineCoords(e),l="none"!==o.fill?a.makePolygon(s):a.makeLine(s);i.selectAll("path.js-line").data([{geojson:l,trace:o}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}u.hasMarkers(o)&&i.selectAll("path.point").data(n.identity).enter().append("path").classed("point",!0).each((function(t){c(t,this)})),u.hasText(o)&&i.selectAll("g").data(n.identity).enter().append("g").append("text").each((function(t){c(t,this)})),h(t,e)}))}}}}),cg=d({"src/traces/scattergeo/hover.js"(t,e){var r=zr(),n=T().BADNUM,i=mi(),a=se().fillText,o=Wm();e.exports=function(t,e,s){var l=t.cd,c=l[0].trace,u=t.xa,h=t.ya,d=t.subplot,p=d.projection.isLonLatOverEdges,f=d.project;if(r.getClosest(l,(function(t){var r=t.lonlat;if(r[0]===n)return 1/0;if(p(r))return 1/0;var i=f(r),a=f([e,s]),o=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(o*o+l*l)-c,1-3/c)}),t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[u.c2p(g),h.c2p(g)],v=m.mrc||1;t.x0=y[0]-v,t.x1=y[0]+v,t.y0=y[1]-v,t.y1=y[1]+v,t.loc=m.loc,t.lon=g[0],t.lat=g[1];var x={};x[c.geo]={_subplot:d};var b=c._module.formatLabels(m,c,x);return t.lonLabel=b.lonLabel,t.latLabel=b.latLabel,t.color=i(c,m),t.extraText=function(t,e,r,n){if(!t.hovertemplate){var i=e.hi||t.hoverinfo,s="all"===i?o.hoverinfo.flags:i.split("+"),l=-1!==s.indexOf("location")&&Array.isArray(t.locations),c=-1!==s.indexOf("lon"),u=-1!==s.indexOf("lat"),h=-1!==s.indexOf("text"),d=[];return l?d.push(e.loc):c&&u?d.push("("+p(r.latLabel)+", "+p(r.lonLabel)+")"):c?d.push(n.lon+p(r.lonLabel)):u&&d.push(n.lat+p(r.latLabel)),h&&a(e,t,d),d.join("<br>")}function p(t){return t+"\xb0"}}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),ug=d({"src/traces/scattergeo/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}}}),hg=d({"src/traces/scattergeo/select.js"(t,e){var r=Ge(),n=T().BADNUM;e.exports=function(t,e){var i,a,o,s,l,c=t.cd,u=t.xaxis,h=t.yaxis,d=[],p=c[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===e)for(l=0;l<c.length;l++)c[l].selected=0;else for(l=0;l<c.length;l++)(a=(i=c[l]).lonlat)[0]!==n&&(o=u.c2p(a),s=h.c2p(a),e.contains([o,s],null,l,t)?(d.push({pointNumber:l,lon:a[0],lat:a[1]}),i.selected=1):i.selected=0);return d}}}),dg=d({"node_modules/d3-array/dist/d3-array.js"(t,e){var r,n;r=t,n=function(t){function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o<i;)isNaN(r=s(t[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(e(t[o],o,t)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]}var h=Array.prototype,d=h.slice,p=h.map;function f(t){return function(){return t}}function m(t){return t}function g(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a}var y=Math.sqrt(50),v=Math.sqrt(10),x=Math.sqrt(2);function b(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),e<t?-i:i}function w(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function k(t,e,r){if(null==r&&(r=s),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function T(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n}function S(t){if(!(i=t.length))return[];for(var e=-1,r=T(t,A),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n}function A(t){return t.length}t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=r,t.cross=function(t,e,r){var n,i,a,s,l=t.length,c=e.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=t[n],i=0;i<c;++i,++a)u[a]=r(s,e[i]);return u},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=t(n[a],a,n);var c=e(l),u=c[0],h=c[1],d=r(l,u,h);Array.isArray(d)||(d=_(u,h,d),d=g(Math.ceil(u/d)*d,h,d));for(var p=d.length;d[0]<=u;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var f,m=new Array(p+1);for(a=0;a<=p;++a)(f=m[a]=[]).x0=a>0?d[a-1]:u,f.x1=a<p?d[a]:h;for(a=0;a<s;++a)u<=(o=l[a])&&o<=h&&m[i(d,o,0,p)].push(n[a]);return m}return n.value=function(e){return arguments.length?(t="function"===typeof e?e:f(e),n):t},n.domain=function(t){return arguments.length?(e="function"===typeof t?t:f([t[0],t[1]]),n):e},n.thresholds=function(t){return arguments.length?(r="function"===typeof t?t:Array.isArray(t)?f(d.call(t)):f(t),n):r},n},t.thresholdFreedmanDiaconis=function(t,r,n){return t=p.call(t,s).sort(e),Math.ceil((n-r)/(2*(k(t,.75)-k(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,r){return Math.ceil((r-e)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=w,t.max=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=s(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},t.median=function(t,r){var n,i=t.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(t[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(t[a],a,t)))||o.push(n);return k(o.sort(e),.5)},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=T,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return a},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.quantile=k,t.range=g,t.scan=function(t,r){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==r&&(r=e);++a<n;)(r(i=t[a],s)<0||0!==r(s,s))&&(s=i,o=a);return 0===r(s,s)?o:void 0}},t.shuffle=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.sum=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},t.ticks=function(t,e,r){var n,i,a,o,s=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(o=b(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return n&&a.reverse(),a},t.tickIncrement=b,t.tickStep=_,t.transpose=S,t.variance=l,t.zip=function(){return S(arguments)},Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:r.d3=r.d3||{})}}),pg=d({"node_modules/d3-geo/dist/d3-geo.js"(t,e){var r,n;r=t,n=function(t,e){function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){a(i,t,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(t,e,r){var n=t.s=e+r,i=n-e,a=n-i;t.t=e-a+(r-i)}var o=1e-6,s=1e-12,l=Math.PI,c=l/2,u=l/4,h=2*l,d=180/l,p=l/180,f=Math.abs,m=Math.atan,g=Math.atan2,y=Math.cos,v=Math.ceil,x=Math.exp,b=Math.log,_=Math.pow,w=Math.sin,k=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,S=Math.tan;function A(t){return t>1?0:t<-1?l:Math.acos(t)}function M(t){return t>1?c:t<-1?-c:Math.asin(t)}function C(t){return(t=w(t/2))*t}function E(){}function L(t,e){t&&I.hasOwnProperty(t.type)&&I[t.type](t,e)}var P={Feature:function(t,e){L(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)L(r[n].geometry,e)}},I={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){z(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)z(r[n],e,0)},Polygon:function(t,e){O(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)O(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)L(r[n],e)}};function z(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function O(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)z(t[r],e,1);e.polygonEnd()}function D(t,e){t&&P.hasOwnProperty(t.type)?P[t.type](t,e):L(t,e)}var R,F,B,j,N,U=r(),V=r(),q={point:E,lineStart:E,lineEnd:E,polygonStart:function(){U.reset(),q.lineStart=$,q.lineEnd=H},polygonEnd:function(){var t=+U;V.add(t<0?h+t:t),this.lineStart=this.lineEnd=this.point=E},sphere:function(){V.add(h)}};function $(){q.point=W}function H(){G(R,F)}function W(t,e){q.point=G,R=t,F=e,B=t*=p,j=y(e=(e*=p)/2+u),N=w(e)}function G(t,e){var r=(t*=p)-B,n=r>=0?1:-1,i=n*r,a=y(e=(e*=p)/2+u),o=w(e),s=N*o,l=j*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),B=t,j=a,N=o}function Y(t){return[g(t[1],t[0]),M(t[2])]}function Z(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*w(e),w(r)]}function X(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function K(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,rt,nt,it,at,ot,st,lt,ct,ut,ht,dt,pt,ft,mt,gt,yt,vt,xt,bt,_t,wt,kt,Tt,St,At,Mt=r(),Ct={point:Et,lineStart:Pt,lineEnd:It,polygonStart:function(){Ct.point=zt,Ct.lineStart=Ot,Ct.lineEnd=Dt,Mt.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),Ct.point=Et,Ct.lineStart=Pt,Ct.lineEnd=It,U<0?(et=-(nt=180),rt=-(it=90)):Mt>o?it=90:Mt<-o&&(rt=-90),ut[0]=et,ut[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function Et(t,e){ct.push(ut=[et=t,nt=t]),e<rt&&(rt=e),e>it&&(it=e)}function Lt(t,e){var r=Z([t*p,e*p]);if(lt){var n=K(lt,r),i=K([n[1],-n[0],0],n);tt(i),i=Y(i);var a,o=t-at,s=o>0?1:-1,l=i[0]*d*s,c=f(o)>180;c^(s*at<l&&l<s*t)?(a=i[1]*d)>it&&(it=a):c^(s*at<(l=(l+360)%360-180)&&l<s*t)?(a=-i[1]*d)<rt&&(rt=a):(e<rt&&(rt=e),e>it&&(it=e)),c?t<at?Rt(et,t)>Rt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t):nt>=et?(t<et&&(et=t),t>nt&&(nt=t)):t>at?Rt(et,t)>Rt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t)}else ct.push(ut=[et=t,nt=t]);e<rt&&(rt=e),e>it&&(it=e),lt=r,at=t}function Pt(){Ct.point=Lt}function It(){ut[0]=et,ut[1]=nt,Ct.point=Et,lt=null}function zt(t,e){if(lt){var r=t-at;Mt.add(f(r)>180?r+(r>0?360:-360):r)}else ot=t,st=e;q.point(t,e),Lt(t,e)}function Ot(){q.lineStart()}function Dt(){zt(ot,st),q.lineEnd(),f(Mt)>o&&(et=-(nt=180)),ut[0]=et,ut[1]=nt,lt=null}function Rt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function Bt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var jt={sphere:E,point:Nt,lineStart:Vt,lineEnd:Ht,polygonStart:function(){jt.lineStart=Wt,jt.lineEnd=Gt},polygonEnd:function(){jt.lineStart=Vt,jt.lineEnd=Ht}};function Nt(t,e){t*=p;var r=y(e*=p);Ut(r*y(t),r*w(t),w(e))}function Ut(t,e,r){++ht,pt+=(t-pt)/ht,ft+=(e-ft)/ht,mt+=(r-mt)/ht}function Vt(){jt.point=qt}function qt(t,e){t*=p;var r=y(e*=p);Tt=r*y(t),St=r*w(t),At=w(e),jt.point=$t,Ut(Tt,St,At)}function $t(t,e){t*=p;var r=y(e*=p),n=r*y(t),i=r*w(t),a=w(e),o=g(T((o=St*a-At*i)*o+(o=At*n-Tt*a)*o+(o=Tt*i-St*n)*o),Tt*n+St*i+At*a);dt+=o,gt+=o*(Tt+(Tt=n)),yt+=o*(St+(St=i)),vt+=o*(At+(At=a)),Ut(Tt,St,At)}function Ht(){jt.point=Nt}function Wt(){jt.point=Yt}function Gt(){Zt(wt,kt),jt.point=Nt}function Yt(t,e){wt=t,kt=e,t*=p,e*=p,jt.point=Zt;var r=y(e);Tt=r*y(t),St=r*w(t),At=w(e),Ut(Tt,St,At)}function Zt(t,e){t*=p;var r=y(e*=p),n=r*y(t),i=r*w(t),a=w(e),o=St*a-At*i,s=At*n-Tt*a,l=Tt*i-St*n,c=T(o*o+s*s+l*l),u=M(c),h=c&&-u/c;xt+=h*o,bt+=h*s,_t+=h*l,dt+=u,gt+=u*(Tt+(Tt=n)),yt+=u*(St+(St=i)),vt+=u*(At+(At=a)),Ut(Tt,St,At)}function Xt(t){return function(){return t}}function Kt(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Jt(t,e){return[f(t)>l?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Kt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Jt}function te(t){return function(e,r){return[(e+=t)>l?e-h:e<-l?e+h:e,r]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function re(t,e){var r=y(t),n=w(t),i=y(e),a=w(e);function o(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),M(u*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),M(u*r-s*n)]},o}function ne(t){function e(e){return(e=t(e[0]*p,e[1]*p))[0]*=d,e[1]*=d,e}return t=Qt(t[0]*p,t[1]*p,t.length>2?t[2]*p:0),e.invert=function(e){return(e=t.invert(e[0]*p,e[1]*p))[0]*=d,e[1]*=d,e},e}function ie(t,e,r,n,i,a){if(r){var o=y(e),s=w(e),l=n*r;null==i?(i=e+n*h,a=e-l/2):(i=ae(o,i),a=ae(o,a),(n>0?i<a:i>a)&&(i+=n*h));for(var c,u=i;n>0?u>a:u<a;u-=l)c=Y([o,-s*y(u),-s*w(u)]),t.point(c[0],c[1])}}function ae(t,e){(e=Z(e))[0]-=t,tt(e);var r=A(-e[1]);return((-e[2]<0?-r:r)+h-o)%h}function oe(){var t,e=[];return{point:function(e,r,n){t.push([e,r,n])},lineStart:function(){e.push(t=[])},lineEnd:E,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function se(t,e){return f(t[0]-e[0])<o&&f(t[1]-e[1])<o}function le(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ce(t,e,r,n,i){var a,o,s=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r,n=t[0],o=t[e];if(se(n,o)){if(!n[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((n=t[a])[0],n[1]);return void i.lineEnd()}o[0]+=2e-6}s.push(r=new le(n,t,null,!0)),l.push(r.o=new le(n,null,r,!1)),s.push(r=new le(o,t,null,!1)),l.push(r.o=new le(o,null,r,!0))}})),s.length){for(l.sort(e),ue(s),ue(l),a=0,o=l.length;a<o;++a)l[a].e=r=!r;for(var c,u,h=s[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(a=0,o=c.length;a<o;++a)i.point((u=c[a])[0],u[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p)for(c=d.p.z,a=c.length-1;a>=0;--a)i.point((u=c[a])[0],u[1]);else n(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function ue(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}Jt.invert=Jt;var he=r();function de(t){return f(t[0])<=l?t[0]:k(t[0])*((f(t[0])+l)%h-l)}function pe(t,e){var r=de(e),n=e[1],i=w(n),a=[w(r),-y(r),0],s=0,d=0;he.reset(),1===i?n=c+o:-1===i&&(n=-c-o);for(var p=0,f=t.length;p<f;++p)if(v=(m=t[p]).length)for(var m,v,x=m[v-1],b=de(x),_=x[1]/2+u,k=w(_),T=y(_),S=0;S<v;++S,b=C,k=L,T=P,x=A){var A=m[S],C=de(A),E=A[1]/2+u,L=w(E),P=y(E),I=C-b,z=I>=0?1:-1,O=z*I,D=O>l,R=k*L;if(he.add(g(R*z*w(O),T*P+R*y(O))),s+=D?I+z*h:I,D^b>=r^C>=r){var F=K(Z(x),Z(A));tt(F);var B=K(a,F);tt(B);var j=(D^I>=0?-1:1)*M(B[2]);(n>j||n===j&&(F[0]||F[1]))&&(d+=D^I>=0?1:-1)}}return(s<-o||s<o&&he<-o)^1&d}function fe(t,r,n,i){return function(a){var o,s,l,c=r(a),u=oe(),h=r(u),d=!1,p={point:f,lineStart:g,lineEnd:y,polygonStart:function(){p.point=v,p.lineStart=x,p.lineEnd=b,s=[],o=[]},polygonEnd:function(){p.point=f,p.lineStart=g,p.lineEnd=y,s=e.merge(s);var t=pe(o,i);s.length?(d||(a.polygonStart(),d=!0),ce(s,ge,t,n,a)):t&&(d||(a.polygonStart(),d=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),d&&(a.polygonEnd(),d=!1),s=o=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function f(e,r){t(e,r)&&a.point(e,r)}function m(t,e){c.point(t,e)}function g(){p.point=m,c.lineStart()}function y(){p.point=f,c.lineEnd()}function v(t,e){l.push([t,e]),h.point(t,e)}function x(){h.lineStart(),l=[]}function b(){v(l[0][0],l[0][1]),h.lineEnd();var t,e,r,n,i=h.clean(),c=u.result(),p=c.length;if(l.pop(),o.push(l),l=null,p)if(1&i){if((e=(r=c[0]).length-1)>0){for(d||(a.polygonStart(),d=!0),a.lineStart(),t=0;t<e;++t)a.point((n=r[t])[0],n[1]);a.lineEnd()}}else p>1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(me))}return p}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-c-o:c-t[1])-((e=e.x)[0]<0?e[1]-c-o:c-e[1])}var ye=fe((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var u=a>0?l:-l,h=f(a-r);f(h-l)<o?(t.point(r,n=(n+s)/2>0?c:-c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=l&&(f(r-i)<o&&(r-=i*o),f(a-u)<o&&(a-=u*o),n=function(t,e,r,n){var i,a,s=w(t-r);return f(s)>o?m((w(e)*(a=y(n))*w(r)-w(n)*(i=y(e))*w(t))/(i*a*s)):(e+n)/2}(r,n,a,s),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=s),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(f(t[0]-e[0])>o){var a=t[0]<e[0]?l:-l;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}),[-l,-c]);function ve(t){var e=y(t),r=6*p,n=e>0,i=f(e)>o;function a(t,r){return y(t)*y(r)>e}function s(t,r,n){var i=[1,0,0],a=K(Z(t),Z(r)),s=X(a,a),c=a[0],u=s-c*c;if(!u)return!n&&t;var h=e*s/u,d=-e*c/u,p=K(i,a),m=Q(i,h);J(m,Q(a,d));var g=p,y=X(m,g),v=X(g,g),x=y*y-v*(X(m,m)-1);if(!(x<0)){var b=T(x),_=Q(g,(-y-b)/v);if(J(_,m),_=Y(_),!n)return _;var w,k=t[0],S=r[0],A=t[1],M=r[1];S<k&&(w=k,k=S,S=w);var C=S-k,E=f(C-l)<o;if(!E&&M<A&&(w=A,A=M,M=w),E||C<o?E?A+M>0^_[1]<(f(_[0]-k)<o?A:M):A<=_[1]&&_[1]<=M:C>l^(k<=_[0]&&_[0]<=S)){var L=Q(g,(-y+b)/v);return J(L,m),[_,Y(L)]}}}function c(e,r){var i=n?t:l-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return fe(a,(function(t){var e,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(d,p){var f,m=[d,p],g=a(d,p),y=n?g?0:c(d,p):g?c(d+(d<0?l:-l),p):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(f=s(e,m))||se(e,f)||se(m,f))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),f=s(m,e),t.point(f[0],f[1])):(f=s(e,m),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&n^g){var v;y&r||!(v=s(m,e,!0))||(h=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&se(e,m)||t.point(m[0],m[1]),e=m,o=g,r=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(u&&o)<<1}}}),(function(e,n,i,a){ie(a,t,r,i,e,n)}),n?[0,-t]:[-l,t-l])}var xe=1e9,be=-xe;function _e(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return f(e[0]-t)<o?i>0?0:3:f(e[0]-n)<o?i>0?2:1:f(e[1]-r)<o?i>0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(o){var l,u,h,d,p,f,m,g,y,v,x,b=o,_=oe(),w={point:k,lineStart:function(){w.point=T,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(T(d,p),f&&y&&_.rejoin(),l.push(_.result())),w.point=k,y&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;r<n;++r)for(var a,o,s=u[r],l=1,c=s.length,h=s[0],d=h[0],p=h[1];l<c;++l)a=d,o=p,d=(h=s[l])[0],p=h[1],o<=i?p>i&&(d-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(d-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ce(l,c,r,s,o),o.polygonEnd()),b=o,l=u=h=null}};function k(t,e){a(t,e)&&b.point(t,e)}function T(e,o){var s=a(e,o);if(u&&h.push([e,o]),v)d=e,p=o,f=s,v=!1,s&&(b.lineStart(),b.point(e,o));else if(s&&y)b.point(e,o);else{var l=[m=Math.max(be,Math.min(xe,m)),g=Math.max(be,Math.min(xe,g))],c=[e=Math.max(be,Math.min(xe,e)),o=Math.max(be,Math.min(xe,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,d=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=n-l,d||!(o>0)){if(o/=d,d<0){if(o<c)return;o<u&&(u=o)}else if(d>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,d||!(o<0)){if(o/=d,d<0){if(o>u)return;o>c&&(c=o)}else if(d>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*d),u<1&&(e[0]=s+u*h,e[1]=l+u*d),!0}}}}}(l,c,t,r,n,i)?s&&(b.lineStart(),b.point(e,o),x=!1):(y||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,ke,Te,Se=r(),Ae={sphere:E,point:E,lineStart:function(){Ae.point=Ce,Ae.lineEnd=Me},lineEnd:E,polygonStart:E,polygonEnd:E};function Me(){Ae.point=Ae.lineEnd=E}function Ce(t,e){we=t*=p,ke=w(e*=p),Te=y(e),Ae.point=Ee}function Ee(t,e){t*=p;var r=w(e*=p),n=y(e),i=f(t-we),a=y(i),o=n*w(i),s=Te*r-ke*n*a,l=ke*r+Te*n*a;Se.add(g(T(o*o+s*s),l)),we=t,ke=r,Te=n}function Le(t){return Se.reset(),D(t,Ae),+Se}var Pe=[null,null],Ie={type:"LineString",coordinates:Pe};function ze(t,e){return Pe[0]=t,Pe[1]=e,Le(Ie)}var Oe={Feature:function(t,e){return Re(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)if(Re(r[n].geometry,e))return!0;return!1}},De={Sphere:function(){return!0},Point:function(t,e){return Fe(t.coordinates,e)},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(Fe(r[n],e))return!0;return!1},LineString:function(t,e){return Be(t.coordinates,e)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(Be(r[n],e))return!0;return!1},Polygon:function(t,e){return je(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)if(je(r[n],e))return!0;return!1},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)if(Re(r[n],e))return!0;return!1}};function Re(t,e){return!(!t||!De.hasOwnProperty(t.type))&&De[t.type](t,e)}function Fe(t,e){return 0===ze(t,e)}function Be(t,e){for(var r,n,i,a=0,o=t.length;a<o;a++){if(0===(n=ze(t[a],e)))return!0;if(a>0&&(i=ze(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<s*i)return!0;r=n}return!1}function je(t,e){return!!pe(t.map(Ne),Ue(e))}function Ne(t){return(t=t.map(Ue)).pop(),t}function Ue(t){return[t[0]*p,t[1]*p]}function Ve(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function qe(t,r,n){var i=e.range(t,r-o,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function $e(){var t,r,n,i,a,s,l,c,u,h,d,p,m=10,g=m,y=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(v(i/y)*y,n,y).map(d).concat(e.range(v(c/x)*x,l,x).map(p)).concat(e.range(v(r/m)*m,t,m).filter((function(t){return f(t%y)>o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return f(t%x)>o})).map(h))}return _.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[d(i).concat(p(l).slice(1),d(n).reverse().slice(1),p(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),_.precision(b)):[[r,s],[t,a]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],_):[y,x]},_.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.precision=function(e){return arguments.length?(b=+e,u=Ve(s,a,90),h=qe(r,t,b),d=Ve(c,l,90),p=qe(i,n,b),_):b},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function He(t){return t}var We,Ge,Ye,Ze,Xe=r(),Ke=r(),Je={point:E,lineStart:E,lineEnd:E,polygonStart:function(){Je.lineStart=Qe,Je.lineEnd=rr},polygonEnd:function(){Je.lineStart=Je.lineEnd=Je.point=E,Xe.add(f(Ke)),Ke.reset()},result:function(){var t=Xe/2;return Xe.reset(),t}};function Qe(){Je.point=tr}function tr(t,e){Je.point=er,We=Ye=t,Ge=Ze=e}function er(t,e){Ke.add(Ze*t-Ye*e),Ye=t,Ze=e}function rr(){er(We,Ge)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(t,e){t<sr&&(sr=t),t>cr&&(cr=t),e<lr&&(lr=e),e>ur&&(ur=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E,result:function(){var t=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),t}},dr=0,pr=0,fr=0,mr=0,gr=0,yr=0,vr=0,xr=0,br=0,_r={point:wr,lineStart:kr,lineEnd:Ar,polygonStart:function(){_r.lineStart=Mr,_r.lineEnd=Cr},polygonEnd:function(){_r.point=wr,_r.lineStart=kr,_r.lineEnd=Ar},result:function(){var t=br?[vr/br,xr/br]:yr?[mr/yr,gr/yr]:fr?[dr/fr,pr/fr]:[NaN,NaN];return dr=pr=fr=mr=gr=yr=vr=xr=br=0,t}};function wr(t,e){dr+=t,pr+=e,++fr}function kr(){_r.point=Tr}function Tr(t,e){_r.point=Sr,wr(ar=t,or=e)}function Sr(t,e){var r=t-ar,n=e-or,i=T(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,wr(ar=t,or=e)}function Ar(){_r.point=wr}function Mr(){_r.point=Er}function Cr(){Lr(nr,ir)}function Er(t,e){_r.point=Lr,wr(nr=ar=t,ir=or=e)}function Lr(t,e){var r=t-ar,n=e-or,i=T(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,vr+=(i=or*t-ar*e)*(ar+t),xr+=i*(or+e),br+=3*i,wr(ar=t,or=e)}function Pr(t){this._context=t}Pr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,h)}},result:E};var Ir,zr,Or,Dr,Rr,Fr=r(),Br={point:E,lineStart:function(){Br.point=jr},lineEnd:function(){Ir&&Nr(zr,Or),Br.point=E},polygonStart:function(){Ir=!0},polygonEnd:function(){Ir=null},result:function(){var t=+Fr;return Fr.reset(),t}};function jr(t,e){Br.point=Nr,zr=Dr=t,Or=Rr=e}function Nr(t,e){Dr-=t,Rr-=e,Fr.add(T(Dr*Dr+Rr*Rr)),Dr=t,Rr=e}function Ur(){this._string=[]}function Vr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function qr(t){return function(e){var r=new $r;for(var n in t)r[n]=t[n];return r.stream=e,r}}function $r(){}function Hr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),D(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Wr(t,e,r){return Hr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Gr(t,e,r){return Wr(t,[[0,0],e],r)}function Yr(t,e,r){return Hr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Zr(t,e,r){return Hr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},$r.prototype={constructor:$r,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Xr=y(30*p);function Kr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,d,p,m,y,v,x){var b=u-n,_=h-i,w=b*b+_*_;if(w>4*e&&v--){var k=s+p,S=l+m,A=c+y,C=T(k*k+S*S+A*A),E=M(A/=C),L=f(f(A)-1)<o||f(a-d)<o?(a+d)/2:g(S,k),P=t(L,E),I=P[0],z=P[1],O=I-n,D=z-i,R=_*O-b*D;(R*R/w>e||f((b*O+_*D)/w-.5)>.3||s*p+l*m+c*y<Xr)&&(r(n,i,a,s,l,c,I,z,L,k/=C,S/=C,A,v,x),x.point(I,z),r(I,z,L,k,S,A,u,h,d,p,m,y,v,x))}}return function(e){var n,i,a,o,s,l,c,u,h,d,p,f,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),m.lineStart=b},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){u=NaN,m.point=v,e.lineStart()}function v(n,i){var a=Z([n,i]),o=t(n,i);r(u,h,c,d,p,f,u=o[0],h=o[1],c=n,d=a[0],p=a[1],f=a[2],16,e),e.point(u,h)}function x(){m.point=g,e.lineEnd()}function b(){y(),m.point=_,m.lineEnd=w}function _(t,e){v(n=t,e),i=u,a=h,o=d,s=p,l=f,m.point=v}function w(){r(u,h,c,d,p,f,i,a,n,o,s,l,16,e),m.lineEnd=x,x()}return m}}(t,e):function(t){return qr({point:function(e,r){e=t(e,r),this.stream.point(e[0],e[1])}})}(t)}var Jr=qr({point:function(t,e){this.stream.point(t*p,e*p)}});function Qr(t,e,r,n,i){function a(a,o){return[e+t*(a*=n),r-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*n,(r-o)/t*i]},a}function tn(t,e,r,n,i,a){var o=y(a),s=w(a),l=o*t,c=s*t,u=o/t,h=s/t,d=(s*r-o*e)/t,p=(s*e+o*r)/t;function f(t,a){return[l*(t*=n)-c*(a*=i)+e,r-c*t-l*a]}return f.invert=function(t,e){return[n*(u*t-h*e+d),i*(p-h*t-u*e)]},f}function en(t){return rn((function(){return t}))()}function rn(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,m=250,g=0,y=0,v=0,x=0,b=0,_=0,w=1,k=1,S=null,A=ye,M=null,C=He,E=.5;function L(t){return l(t[0]*p,t[1]*p)}function P(t){return(t=l.invert(t[0],t[1]))&&[t[0]*d,t[1]*d]}function I(){var t=tn(h,0,0,w,k,_).apply(null,e(g,y)),n=(_?tn:Qr)(h,f-t[0],m-t[1],w,k,_);return r=Qt(v,x,b),s=Kt(e,n),l=Kt(r,s),o=Kr(s,E),z()}function z(){return c=u=null,L}return L.stream=function(t){return c&&u===t?c:c=Jr(function(t){return qr({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}})}(r)(A(o(C(u=t)))))},L.preclip=function(t){return arguments.length?(A=t,S=void 0,z()):A},L.postclip=function(t){return arguments.length?(C=t,M=n=i=a=null,z()):C},L.clipAngle=function(t){return arguments.length?(A=+t?ve(S=t*p):(S=null,ye),z()):S*d},L.clipExtent=function(t){return arguments.length?(C=null==t?(M=n=i=a=null,He):_e(M=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),z()):null==M?null:[[M,n],[i,a]]},L.scale=function(t){return arguments.length?(h=+t,I()):h},L.translate=function(t){return arguments.length?(f=+t[0],m=+t[1],I()):[f,m]},L.center=function(t){return arguments.length?(g=t[0]%360*p,y=t[1]%360*p,I()):[g*d,y*d]},L.rotate=function(t){return arguments.length?(v=t[0]%360*p,x=t[1]%360*p,b=t.length>2?t[2]%360*p:0,I()):[v*d,x*d,b*d]},L.angle=function(t){return arguments.length?(_=t%360*p,I()):_*d},L.reflectX=function(t){return arguments.length?(w=t?-1:1,I()):w<0},L.reflectY=function(t){return arguments.length?(k=t?-1:1,I()):k<0},L.precision=function(t){return arguments.length?(o=Kr(s,E=t*t),z()):T(E)},L.fitExtent=function(t,e){return Wr(L,t,e)},L.fitSize=function(t,e){return Gr(L,t,e)},L.fitWidth=function(t,e){return Yr(L,t,e)},L.fitHeight=function(t,e){return Zr(L,t,e)},function(){return e=t.apply(this,arguments),L.invert=e.invert&&P,I()}}function nn(t){var e=0,r=l/3,n=rn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*p,r=t[1]*p):[e*d,r*d]},i}function an(t,e){var r=w(t),n=(r+w(e))/2;if(f(n)<o)return function(t){var e=y(t);function r(t,r){return[t*e,w(r)/e]}return r.invert=function(t,r){return[t/e,M(r*e)]},r}(t);var i=1+r*(2*n-r),a=T(i)/n;function s(t,e){var r=T(i-2*n*w(e))/n;return[r*w(t*=n),a-r*y(t)]}return s.invert=function(t,e){var r=a-e,o=g(t,f(r))*k(r);return r*n<0&&(o-=l*k(t)*k(r)),[o/n,M((i-(t*t+r*r)*n*n)/(2*n))]},s}function on(){return nn(an).scale(155.424).center([0,33.6442])}function sn(){return on().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ln(t){return function(e,r){var n=y(e),i=y(r),a=t(n*i);return[a*i*w(e),a*w(r)]}}function cn(t){return function(e,r){var n=T(e*e+r*r),i=t(n),a=w(i),o=y(i);return[g(e*a,n*o),M(n&&r*a/n)]}}var un=ln((function(t){return T(2/(1+t))}));un.invert=cn((function(t){return 2*M(t/2)}));var hn=ln((function(t){return(t=A(t))&&t/w(t)}));function dn(t,e){return[t,b(S((c+e)/2))]}function pn(t){var e,r,n,i=en(t),a=i.center,o=i.scale,s=i.translate,c=i.clipExtent,u=null;function h(){var a=l*o(),s=i(ne(i.rotate()).invert([0,0]));return c(null==u?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:t===dn?[[Math.max(s[0]-a,u),e],[Math.min(s[0]+a,r),n]]:[[u,Math.max(s[1]-a,e)],[r,Math.min(s[1]+a,n)]])}return i.scale=function(t){return arguments.length?(o(t),h()):o()},i.translate=function(t){return arguments.length?(s(t),h()):s()},i.center=function(t){return arguments.length?(a(t),h()):a()},i.clipExtent=function(t){return arguments.length?(null==t?u=e=r=n=null:(u=+t[0][0],e=+t[0][1],r=+t[1][0],n=+t[1][1]),h()):null==u?null:[[u,e],[r,n]]},h()}function fn(t){return S((c+t)/2)}function mn(t,e){var r=y(t),n=t===e?w(t):b(r/y(e))/b(fn(e)/fn(t)),i=r*_(fn(t),n)/n;if(!n)return dn;function a(t,e){i>0?e<-c+o&&(e=-c+o):e>c-o&&(e=c-o);var r=i/_(fn(e),n);return[r*w(n*t),i-r*y(n*t)]}return a.invert=function(t,e){var r=i-e,a=k(n)*T(t*t+r*r),o=g(t,f(r))*k(r);return r*n<0&&(o-=l*k(t)*k(r)),[o/n,2*m(_(i/a,1/n))-c]},a}function gn(t,e){return[t,e]}function yn(t,e){var r=y(t),n=t===e?w(t):(r-y(e))/(e-t),i=r/n+t;if(f(n)<o)return gn;function a(t,e){var r=i-e,a=n*t;return[r*w(a),i-r*y(a)]}return a.invert=function(t,e){var r=i-e,a=g(t,f(r))*k(r);return r*n<0&&(a-=l*k(t)*k(r)),[a/n,i-k(n)*T(t*t+r*r)]},a}hn.invert=cn((function(t){return t})),dn.invert=function(t,e){return[t,2*m(x(e))-c]},gn.invert=gn;var vn=1.340264,xn=-.081106,bn=893e-6,_n=.003796,wn=T(3)/2;function kn(t,e){var r=M(wn*w(e)),n=r*r,i=n*n*n;return[t*y(r)/(wn*(vn+3*xn*n+i*(7*bn+9*_n*n))),r*(vn+xn*n+i*(bn+_n*n))]}function Tn(t,e){var r=y(e),n=y(t)*r;return[r*w(t)/n,w(e)/n]}function Sn(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function An(t,e){return[y(e)*w(t),w(e)]}function Mn(t,e){var r=y(e),n=1+y(t)*r;return[r*w(t)/n,w(e)/n]}function Cn(t,e){return[b(S((c+e)/2)),-t]}kn.invert=function(t,e){for(var r,n=e,i=n*n,a=i*i*i,o=0;o<12&&(a=(i=(n-=r=(n*(vn+xn*i+a*(bn+_n*i))-e)/(vn+3*xn*i+a*(7*bn+9*_n*i)))*n)*i*i,!(f(r)<s));++o);return[wn*t*(vn+3*xn*i+a*(7*bn+9*_n*i))/y(n),M(w(n)/wn)]},Tn.invert=cn(m),Sn.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,s=a*a;n-=r=(n*(1.007226+a*(.015085+s*(.028874*a-.044475-.005916*s)))-e)/(1.007226+a*(.045255+s*(.259866*a-.311325-.005916*11*s)))}while(f(r)>o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},An.invert=cn(M),Mn.invert=cn((function(t){return 2*m(t)})),Cn.invert=function(t,e){return[-e,2*m(x(t))-c]},t.geoAlbers=sn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function d(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:t=function(t){var e=t.length;return{point:function(r,n){for(var i=-1;++i<e;)t[i].point(r,n)},sphere:function(){for(var r=-1;++r<e;)t[r].sphere()},lineStart:function(){for(var r=-1;++r<e;)t[r].lineStart()},lineEnd:function(){for(var r=-1;++r<e;)t[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<e;)t[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<e;)t[r].polygonEnd()}}}([s.stream(e=r),l.stream(r),c.stream(r)])},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),d()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){if(!arguments.length)return s.translate();var e=s.scale(),a=+t[0],h=+t[1];return r=s.translate(t).clipExtent([[a-.455*e,h-.238*e],[a+.455*e,h+.238*e]]).stream(u),n=l.translate([a-.307*e,h+.201*e]).clipExtent([[a-.425*e+o,h+.12*e+o],[a-.214*e-o,h+.234*e-o]]).stream(u),i=c.translate([a-.205*e,h+.212*e]).clipExtent([[a-.214*e+o,h+.166*e+o],[a-.115*e-o,h+.234*e-o]]).stream(u),d()},h.fitExtent=function(t,e){return Wr(h,t,e)},h.fitSize=function(t,e){return Gr(h,t,e)},h.fitWidth=function(t,e){return Yr(h,t,e)},h.fitHeight=function(t,e){return Zr(h,t,e)},h.scale(1070)},t.geoArea=function(t){return V.reset(),D(t,q),2*V},t.geoAzimuthalEqualArea=function(){return en(un).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=un,t.geoAzimuthalEquidistant=function(){return en(hn).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=hn,t.geoBounds=function(t){var e,r,n,i,a,o,s;if(it=nt=-(et=rt=1/0),ct=[],D(t,Ct),r=ct.length){for(ct.sort(Ft),e=1,a=[n=ct[0]];e<r;++e)Bt(n,(i=ct[e])[0])||Bt(n,i[1])?(Rt(n[0],i[1])>Rt(n[0],n[1])&&(n[1]=i[1]),Rt(i[0],n[1])>Rt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Rt(n[1],i[0]))>o&&(o=s,et=i[0],nt=n[1])}return ct=ut=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){ht=dt=pt=ft=mt=gt=yt=vt=xt=bt=_t=0,D(t,jt);var e=xt,r=bt,n=_t,i=e*e+r*r+n*n;return i<s&&(e=gt,r=yt,n=vt,dt<o&&(e=pt,r=ft,n=mt),(i=e*e+r*r+n*n)<s)?[NaN,NaN]:[g(r,e)*d,M(n/T(i))*d]},t.geoCircle=function(){var t,e,r=Xt([0,0]),n=Xt(90),i=Xt(6),a={point:function(r,n){t.push(r=e(r,n)),r[0]*=d,r[1]*=d}};function o(){var o=r.apply(this,arguments),s=n.apply(this,arguments)*p,l=i.apply(this,arguments)*p;return t=[],e=Qt(-o[0]*p,-o[1]*p,0).invert,ie(a,s,l,1),o={type:"Polygon",coordinates:[t]},t=e=null,o}return o.center=function(t){return arguments.length?(r="function"===typeof t?t:Xt([+t[0],+t[1]]),o):r},o.radius=function(t){return arguments.length?(n="function"===typeof t?t:Xt(+t),o):n},o.precision=function(t){return arguments.length?(i="function"===typeof t?t:Xt(+t),o):i},o},t.geoClipAntimeridian=ye,t.geoClipCircle=ve,t.geoClipExtent=function(){var t,e,r,n=0,i=0,a=960,o=500;return r={stream:function(r){return t&&e===r?t:t=_e(n,i,a,o)(e=r)},extent:function(s){return arguments.length?(n=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,r):[[n,i],[a,o]]}}},t.geoClipRectangle=_e,t.geoConicConformal=function(){return nn(mn).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=mn,t.geoConicEqualArea=on,t.geoConicEqualAreaRaw=an,t.geoConicEquidistant=function(){return nn(yn).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=yn,t.geoContains=function(t,e){return(t&&Oe.hasOwnProperty(t.type)?Oe[t.type]:Re)(t,e)},t.geoDistance=ze,t.geoEqualEarth=function(){return en(kn).scale(177.158)},t.geoEqualEarthRaw=kn,t.geoEquirectangular=function(){return en(gn).scale(152.63)},t.geoEquirectangularRaw=gn,t.geoGnomonic=function(){return en(Tn).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=Tn,t.geoGraticule=$e,t.geoGraticule10=function(){return $e()()},t.geoIdentity=function(){var t,e,r,n,i,a,o,s=1,l=0,c=0,u=1,h=1,f=0,m=null,g=1,v=1,x=qr({point:function(t,e){var r=k([t,e]);this.stream.point(r[0],r[1])}}),b=He;function _(){return g=s*u,v=s*h,a=o=null,k}function k(r){var n=r[0]*g,i=r[1]*v;if(f){var a=i*t-n*e;n=n*t+i*e,i=a}return[n+l,i+c]}return k.invert=function(r){var n=r[0]-l,i=r[1]-c;if(f){var a=i*t+n*e;n=n*t-i*e,i=a}return[n/g,i/v]},k.stream=function(t){return a&&o===t?a:a=x(b(o=t))},k.postclip=function(t){return arguments.length?(b=t,m=r=n=i=null,_()):b},k.clipExtent=function(t){return arguments.length?(b=null==t?(m=r=n=i=null,He):_e(m=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),_()):null==m?null:[[m,r],[n,i]]},k.scale=function(t){return arguments.length?(s=+t,_()):s},k.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],_()):[l,c]},k.angle=function(r){return arguments.length?(e=w(f=r%360*p),t=y(f),_()):f*d},k.reflectX=function(t){return arguments.length?(u=t?-1:1,_()):u<0},k.reflectY=function(t){return arguments.length?(h=t?-1:1,_()):h<0},k.fitExtent=function(t,e){return Wr(k,t,e)},k.fitSize=function(t,e){return Gr(k,t,e)},k.fitWidth=function(t,e){return Yr(k,t,e)},k.fitHeight=function(t,e){return Zr(k,t,e)},k},t.geoInterpolate=function(t,e){var r=t[0]*p,n=t[1]*p,i=e[0]*p,a=e[1]*p,o=y(n),s=w(n),l=y(a),c=w(a),u=o*y(r),h=o*w(r),f=l*y(i),m=l*w(i),v=2*M(T(C(a-n)+o*l*C(i-r))),x=w(v),b=v?function(t){var e=w(t*=v)/x,r=w(v-t)/x,n=r*u+e*f,i=r*h+e*m,a=r*s+e*c;return[g(i,n)*d,g(a,T(n*n+i*i))*d]}:function(){return[r*d,n*d]};return b.distance=v,b},t.geoLength=Le,t.geoMercator=function(){return pn(dn).scale(961/h)},t.geoMercatorRaw=dn,t.geoNaturalEarth1=function(){return en(Sn).scale(175.295)},t.geoNaturalEarth1Raw=Sn,t.geoOrthographic=function(){return en(An).scale(249.5).clipAngle(90.000001)},t.geoOrthographicRaw=An,t.geoPath=function(t,e){var r,n,i=4.5;function a(t){return t&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),D(t,r(n))),n.result()}return a.area=function(t){return D(t,r(Je)),Je.result()},a.measure=function(t){return D(t,r(Br)),Br.result()},a.bounds=function(t){return D(t,r(hr)),hr.result()},a.centroid=function(t){return D(t,r(_r)),_r.result()},a.projection=function(e){return arguments.length?(r=null==e?(t=null,He):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new Ur):new Pr(e=t),"function"!==typeof i&&n.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"===typeof t?t:(n.pointRadius(+t),+t),a):i},a.projection(t).context(e)},t.geoProjection=en,t.geoProjectionMutator=rn,t.geoRotation=ne,t.geoStereographic=function(){return en(Mn).scale(250).clipAngle(142)},t.geoStereographicRaw=Mn,t.geoStream=D,t.geoTransform=function(t){return{stream:qr(t)}},t.geoTransverseMercator=function(){var t=pn(Cn),e=t.center,r=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Cn,Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,dg()):n((r=r||self).d3=r.d3||{},r.d3)}}),fg=d({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(t,e){var r,n;r=t,n=function(t,e,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,d=Math.pow,p=Math.round,f=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,b=x/2,_=x/4,w=Math.SQRT1_2,k=L(2),T=L(x),S=2*x,A=180/x,M=x/180;function C(t){return t>1?b:t<-1?-b:Math.asin(t)}function E(t){return t>1?0:t<-1?x:Math.acos(t)}function L(t){return t>0?Math.sqrt(t):0}function P(t){return(s(t)-s(-t))/2}function I(t){return(s(t)+s(-t))/2}function z(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=L(e*e+i*i),u=-t/2,h=50;if(!l)return[0,0];do{var d=u/2,p=o(d),f=m(d),g=f/p,v=-c(n(p));u-=s=(2/g*v-r*g-l)/(-v/(f*f)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(e*x,l*o(u)),C(i*x/l)]},i}function O(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(E(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function D(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,d=50;do{var p=o(u),f=m(u),g=o(h),v=m(h),x=1+g,b=x*f-t,_=l+v*r-x*e*p-c,w=x*p/2,k=-f*v,T=e*x*f/2,S=r*g+e*p*v,A=k*T-S*w,M=(_*k-b*S)/A/2,C=(b*T-_*w)/A;n(C)>2&&(C/=2),u-=M,h-=C}while((n(M)>y||n(C)>y)&&--d>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function R(t,e){var r=g(e/2),n=L(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}O.invert=function(t,e){if(!(t*t+4*e*e>x*x+y)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),d=o(i),p=m(2*i),f=h*h,g=d*d,v=c*c,b=1-g*u*u,_=b?E(d*u)*L(s=1/b):s=0,w=2*_*d*c-t,k=_*h-e,T=s*(g*v+_*d*u*f),S=s*(.5*l*p-2*_*h*c),A=.25*s*(p*c-_*h*g*l),M=s*(f*u+_*v*d),C=S*A-M*T;if(!C)break;var P=(k*S-w*M)/C,I=(w*A-k*T)/C;r-=P,i-=I}while((n(P)>y||n(I)>y)&&--a>0);return[r,i]}},R.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=L((r-L(r*r-4*e*e))/2),s=C(i)/3,l=i?function(t){return c(t+L(t*t-1))}(n(e/i))/3:function(t){return c(t+L(t*t+1))}(n(t))/3,u=o(s),h=I(l),d=h*h-u*u;return[2*f(t)*a(P(l)*u,.25-d),2*f(e)*a(h*m(s),.25+d)]};var F=L(8),B=c(1+k);function j(t,e){var r=n(e);return r<_?[t,c(g(_+e/2))]:[t*o(r)*(2*k-1/m(r)),f(e)*(2*k*(r-_)-c(g(r/2)))]}function N(t){var r=2*x/t;function s(t,i){var s=e.geoAzimuthalEquidistantRaw(t,i);if(n(t)>b){var l=a(s[1],s[0]),c=L(s[0]*s[0]+s[1]*s[1]),u=r*p((l-b)/r)+b,h=a(m(l-=u),2-o(l));l=u+C(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=L(t*t+n*n);if(s>b){var l=a(n,t),c=r*p((l-b)/r)+b,u=l>c?-1:1,h=s*o(c-l),d=1/g(u*E((h-x)/L(x*(x-2*h)+s*s)));l=c+2*i((d+u*L(d*d-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function U(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function V(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function q(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+y))&&(o=a+y),r-=i=-1e-6*(a-e)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function $(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;h<e;h++){var d=t(o,s),p=d[0]-i,f=d[1]-a;if(n(p)<r&&n(f)<r)break;var m=p*p+f*f;if(m>l)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=t(o+g,s),x=t(o,s+y),b=(v[0]-d[0])/g,_=(v[1]-d[1])/g,w=(x[0]-d[0])/y,k=(x[1]-d[1])/y,T=k*b-_*w,S=(n(T)<.5?.5:1)/T;if(o+=c=(f*w-p*k)*S,s+=u=(p*_-f*b)*S,n(c)<r&&n(u)<r)break}}return[o,s]}}function H(){var t=U(1.68,2);function e(e,r){if(e+r<-1.4){var n=(e-r+1.6)*(e+r+1.4)/8;e+=n,r-=.8*n*m(r+x/2)}var i=t(e,r),a=(1-o(e*r))/12;return i[1]<0&&(i[0]*=1+a),i[1]>0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=$(e),e}function W(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>y&&--a>0);return e/2}function G(t,e,r){function n(n,i){return[t*n*o(i=W(r,i)),e*m(i)]}return n.invert=function(n,i){return i=C(i/e),[n/(t*o(i)),C((2*i+m(2*i))/r)]},n}j.invert=function(t,e){if((a=n(e))<B)return[t,2*i(s(e))-b];var r,a,l=_,u=25;do{var h=o(l/2),d=g(l/2);l-=r=(F*(l-_)-c(d)-a)/(F-h*h/(2*d))}while(n(r)>v&&--u>0);return[t/(o(l)*(F-1/m(l))),f(e)*l]},V.invert=function(t,e){var r=2*C(e/2);return[t*o(r/2)/o(r),r]};var Y=G(k/b,k,x),Z=2.00276,X=1.11072;function K(t,e){var r=W(x,e);return[Z*t/(1/o(e)+X/o(r)),(e+k*m(r))/Z]}function J(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*M):r*A},i}function Q(t,e){return[t*o(e),e]}function tt(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=L(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function et(t){function e(e,r){var n=b-r,i=n?e*t*m(n)/n:n;return[n*m(i)/t,b-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=b-r,o=L(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,b-o]},e}K.invert=function(t,e){var r,i,a=Z*e,s=e<0?-_:_,l=25;do{i=a-k*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*k*o(s))}while(n(r)>y&&--l>0);return i=a-k*m(s),[t*(1/o(i)+X/o(s))/Z,i]},Q.invert=function(t,e){return[t/o(e),e]};var rt=G(1,4/x,x);function nt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=E(r*s+e*i*u);else{var h=m(t/2),d=m(l/2);c=2*C(L(h*h+e*i*d*d))}return n(c)>y?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function it(t,e,r){return E((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*x*l((t+x)/(2*x))}function ot(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=nt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=it(i[0].v[0],i[2].v[0],i[1].v[0]),c=it(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=nt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var d=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,f=it(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(f=-f),r?1==r?(f=c-f,d[0]-=s[r][0]*o(f),d[1]-=s[r][0]*m(f)):(f=u-f,d[0]+=s[r][0]*o(f),d[1]+=s[r][0]*m(f)):(d[0]+=s[r][0]*o(f),d[1]-=s[r][0]*m(f))}return d[0]/=3,d[1]/=3,d}}function st(t){return t[0]*=M,t[1]*=M,t}function lt(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=ot(st(o(t)),st(o(r)),st(o(n)));s.invert=$(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function ct(t,e){var r=L(1-m(e));return[2/T*t*r,T*(1-r)]}function ut(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(L(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,C(t?e*g(t)/t:e)]},r}ct.invert=function(t,e){var r=(r=e/T-1)*r;return[r>0?t*L(x/r)/2:0,C(1-r)]};var ht=L(3);function dt(t,e){return[ht*t*(2*o(2*e/3)-1)/T,ht*T*m(e/3)]}function pt(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,C(r*e)]},r}function ft(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function mt(t,e){var r=L(8/(3*x));return[r*t*(1-n(e)/x),r*e]}function gt(t,e){var r=L(4-3*m(n(e)));return[2/L(6*x)*t*r,f(e)*L(2*x/3)*(2-r)]}function yt(t,e){var r=L(x*(4+x));return[2/r*t*(1+L(1-4*e*e/(x*x))),4/r*e]}function vt(t,e){var r=(2+b)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/L(x*(4+x))*t*(1+o(e)),2*L(x/(4+x))*m(e)]}function xt(t,e){return[t*(1+o(e))/L(2+x),2*e/L(2+x)]}function bt(t,e){for(var r=(1+b)*m(e),i=0,a=1/0;i<10&&n(a)>y;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=L(2+x),[t*(1+o(e))/r,2*e/r]}dt.invert=function(t,e){var r=3*C(e/(ht*T));return[T*t/(ht*(2*o(2*r/3)-1)),r]},mt.invert=function(t,e){var r=L(8/(3*x)),i=e/r;return[t/(r*(1-n(i)/x)),i]},gt.invert=function(t,e){var r=2-n(e)/L(2*x/3);return[t*L(6*x)/(2*r),f(e)*C((4-r*r)/3)]},yt.invert=function(t,e){var r=L(x*(4+x))/2;return[t*r/(1+L(1-e*e*(4+x)/(4*x))),e*r/2]},vt.invert=function(t,e){var r=e*L((4+x)/x)/2,n=C(r),i=o(n);return[t/(2/L(x*(4+x))*(1+i)),C((n+r*(i+2))/(2+b))]},xt.invert=function(t,e){var r=L(2+x),n=e*r/2;return[r*t/(1+o(n)),n]},bt.invert=function(t,e){var r=1+b,n=L(r/2);return[2*t*n/(1+o(e*=n)),C((e+m(e))/r)]};var _t=3+2*k;function wt(t,e){var r=m(t/=2),n=o(t),a=L(o(e)),s=o(e/=2),l=m(e)/(s+k*n*a),u=L(2/(1+l*l)),h=L((k*s+(n+r)*a)/(k*s+(n-r)*a));return[_t*(u*(h-1/h)-2*c(h)),_t*(u*l*(h+1/h)-2*i(l))]}wt.invert=function(t,e){if(!(r=R.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=_t,e/=_t;do{var d=a/2,p=s/2,f=m(d),g=o(d),v=m(p),x=o(p),_=o(s),T=L(_),S=v/(x+k*g*T),A=S*S,M=L(2/(1+A)),C=(k*x+(g+f)*T)/(k*x+(g-f)*T),E=L(C),P=E-1/E,I=E+1/E,z=M*P-2*c(E)-t,O=M*S*I-2*i(S)-e,D=v&&w*T*f*A/v,F=(k*g*x+T)/(2*(x+k*g*T)*(x+k*g*T)*T),B=-.5*S*M*M*M,j=B*D,N=B*F,U=(U=2*x+k*T*(g-f))*U*E,V=(k*g*x*T+_)/U,q=-k*f*v/(T*U),$=P*j-2*V/E+M*(V+V/C),H=P*N-2*q/E+M*(q+q/C),W=S*I*j-2*D/(1+A)+M*I*D+M*S*(V-V/C),G=S*I*N-2*F/(1+A)+M*I*F+M*S*(q-q/C),Y=H*W-G*$;if(!Y)break;var Z=(O*H-z*G)/Y,X=(z*W-O*$)/Y;a-=Z,s=u(-b,h(b,s-X))}while((n(Z)>y||n(X)>y)&&--l>0);return n(n(s)-b)<y?[0,s]:l&&[a,s]};var kt=o(35*M);function Tt(t,e){var r=g(e/2);return[t*kt*L(1-r*r),(1+kt)*r]}function St(t,e){var r=e/2,n=o(r);return[2*t/T*o(e)*n*n,T*g(r)]}function At(t){var e=1-t,r=i(x,0)[0]-i(-x,0)[0],n=L(2*(i(0,b)[1]-i(0,-b)[1])/r);function i(r,n){var i=o(n),a=m(n);return[i/(e+t*i)*r,e*n+t*a]}function a(t,e){var r=i(t,e);return[r[0]*n,r[1]/n]}function s(t){return a(0,t)[1]}return a.invert=function(r,i){var a=q(s,i);return[r/n*(t+e/o(a)),a]},a}function Mt(t){return[t[0]/2,C(g(t[1]/2*M))*A]}function Ct(t){return[2*t[0],2*i(m(t[1]*M))*A]}function Et(t,r){var i=2*x/r,s=t*t;function l(r,l){var c=e.geoAzimuthalEquidistantRaw(r,l),u=c[0],h=c[1],d=u*u+h*h;if(d>s){var f=L(d),g=a(h,u),v=i*p(g/i),_=g-v,w=t*o(_),k=(t*m(_)-_*m(w))/(b-w),T=Lt(_,k),S=(x-t)/Pt(T,w,x);u=f;var A,M=50;do{u-=A=(t+Pt(T,w,u)*S-f)/(T(u)*S)}while(n(A)>y&&--M>0);h=_*m(u),u<b&&(h-=k*(u-b));var C=m(v),E=o(v);c[0]=u*E-h*C,c[1]=u*C+h*E}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=L(c),h=a(l,r),d=i*p(h/i),f=h-d;r=u*o(f),l=u*m(f);for(var g=r-b,y=m(r),_=l/y,w=r<b?1/0:0,k=10;;){var T=t*m(_),S=t*o(_),A=m(S),M=b-S,C=(T-_*A)/M,E=Lt(_,C);if(n(w)<v||! --k)break;_-=w=(_*y-C*g-l)/(y-2*g*(M*(S+_*T*o(S)-A)-T*(T-_*A))/(M*M))}r=(u=t+Pt(E,S,r)*(x-t)/Pt(E,S,x))*o(h=d+_),l=u*m(h)}return e.geoAzimuthalEquidistantRaw.invert(r,l)},l}function Lt(t,e){return function(r){var n=t*o(r);return r<b&&(n-=e),L(1+n*n)}}function Pt(t,e,r){for(var n=(r-e)/50,i=t(e)+t(r),a=1,o=e;a<50;++a)i+=2*t(o+=n);return.5*i*n}function It(t,e,r,i,a,s,l,c){function u(n,u){if(!u)return[t*n/x,0];var h=u*u,d=t+h*(e+h*(r+h*i)),p=u*(a-1+h*(s-c+h*l)),f=(d*d+p*p)/(2*p),g=n*C(d/f)/x;return[f*m(g),u*(1+h*c)+f*(1-o(g))]}return arguments.length<8&&(c=0),u.invert=function(u,h){var d,p,f=x*u/t,g=h,v=50;do{var b=g*g,_=t+b*(e+b*(r+b*i)),w=g*(a-1+b*(s-c+b*l)),k=_*_+w*w,T=2*w,S=k/T,A=S*S,M=C(_/S)/x,E=f*M,P=_*_,I=(2*e+b*(4*r+6*b*i))*g,z=a+b*(3*s+5*b*l),O=(2*(_*I+w*(z-1))*T-k*(2*(z-1)))/(T*T),D=o(E),R=m(E),F=S*D,B=S*R,j=f/x*(1/L(1-P/A))*(I*S-_*O)/A,N=B-u,U=g*(1+b*c)+S-F-h,V=O*R+F*j,q=F*M,$=1+O-(O*D-B*j),H=B*M,W=V*H-$*q;if(!W)break;f-=d=(U*V-N*$)/W,g-=p=(N*H-U*q)/W}while((n(d)>y||n(p)>y)&&--v>0);return[f,g]},u}Tt.invert=function(t,e){var r=e/(1+kt);return[t&&t/(kt*L(1-r*r)),2*i(r)]},St.invert=function(t,e){var r=i(e/T),n=o(r),a=2*r;return[t*T/2/(o(a)*n*n),a]};var zt=It(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ot=It(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Dt=It(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Rt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Rt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>y&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Ft=It(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Bt(t){var e=t(b,0)[0]-t(-b,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*x,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function jt(t,e){var r=f(t),i=f(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=C(l),n(t-b)>y&&(t%=b);var h=function(t,e){if(e===b)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,d=C(1/L(c)),p=h+s*c*d,f=(1-a)/p,g=L(f),v=f*c,_=L(v),w=g*h;if(0===t)return[0,-(w+s*_)];var k,T=o(e),S=1/T,A=2*a*T,M=(-3*s+d*u)*A,E=(-p*T-(1-a)*M)/(p*p),P=-S*A,I=-S*(s*c*E+f*u*A),z=-2*S*(h*(.5*E/g)-2*s*g*A),O=4*t/x;if(t>.222*x||e<x/4&&t>.175*x){if(r=(w+s*L(v*(1+l)-w*w))/(1+l),t>x/4)return[r,r];var D=r,R=.5*r;r=.5*(R+D),i=50;do{var F=r*(z+P*L(v-r*r))+I*C(r/_)-O;if(!F)break;F<0?R=r:D=r,r=.5*(R+D)}while(n(D-R)>y&&--i>0)}else{r=y,i=25;do{var B=r*r,j=L(v-B),N=z+P*j,U=r*N+I*C(r/_)-O;r-=k=j?U/(N+(I-P*B)/j):0}while(n(k)>y&&--i>0)}return[r,-w-s*L(v-r*r)]}(t>x/4?b-t:t,e);return t>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Nt(t,e){var r,a,l,c,u,h;if(e<y)return[(c=m(t))-(r=e*(t-c*(a=o(t)))/4)*a,a+r*c,1-e*c*c/2,t-r];if(e>=.999999)return r=(1-e)/4,l=1/(a=I(t)),[(c=((h=s(2*(h=t)))-1)/(h+1))+r*((u=a*P(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-b+r*(u-t)/a];var d=[1,0,0,0,0,0,0,0,0],p=[L(e),0,0,0,0,0,0,0,0],f=0;for(a=L(1-e),u=1;n(p[f]/d[f])>y&&f<8;)r=d[f++],p[f]=(r-a)/2,d[f]=(r+a)/2,a=L(r*a),u*=2;l=u*d[f]*t;do{l=(C(c=p[f]*m(a=l)/d[f])+l)/2}while(--f);return[m(l),c=o(l),c/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return c(g(t/2+_));for(var r=1,a=L(1-e),o=L(e),s=0;n(o)>y;s++){if(t%x){var l=i(a*g(t)/r);l<0&&(l+=x),t+=l+~~(t/x)*x}else t+=t;o=(r+a)/2,a=L(r*a),o=((r=o)-a)/2}return t/(d(2,s)*r)}function Vt(t,e){var r=(k-1)/(k+1),l=L(1-r*r),u=Ut(b,l*l),h=c(g(x/4+n(e)/2)),d=s(-1*h)/L(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?b:-b)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(d*o(-1*t),d*m(-1*t)),y=function(t,e,r){var a=n(t),o=P(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+L(c*c-(r-1)*l*4))/2;return[Ut(i(1/L(u)),r)*f(t),Ut(i(L((u/l-1)/r)),1-r)*f(e)]}return[0,Ut(i(o),1-r)*f(e)]}(p[0],p[1],l*l);return[-y[1],(e>=0?1:-1)*(.5*u-y[0])]}function qt(t){var e=m(t),r=o(t),i=$t(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),h=E(e*l+r*c*u),d=m(h),p=n(d)>y?h/d:1;return[p*r*m(t),(n(t)>b?p:-p)*(e*c-r*l*u)]}return i.invert=$t(-t),s.invert=function(t,r){var n=L(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,d=L(c*c+u*u-h*h),p=a(c*h+u*d,u*h-c*d),f=(n>b?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(f,p)},s}function $t(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),C(c*r+s*e)]}}jt.invert=function(t,e){n(t)>1&&(t=2*f(t)-t),n(e)>1&&(e=2*f(e)-e);var r=f(t),i=f(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=L(a),u=C(1/L(1+l)),h=1-l+a*(1+l)*u,d=(1-c)/h,p=L(d),f=d*(1+l),m=p*(1-l),g=L(f-t*t),y=e+m+a*g;if(n(i-r)<v||0===--s||0===y)break;y>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var b=C(c),_=o(b),w=1/_,k=2*c*_,T=(-h*_-(-3*a+u*(1+3*l))*k*(1-c))/(h*h),S=.5*T/p,A=(1-l)*S-2*a*p*k;return[x/4*(t*(-2*w*A+-w*k*g)+-w*(a*(1+l)*T+d*(1+3*l)*k)*C(t/L(f))),b]}(c?l:s,c?s:l),h=u[0],d=u[1],p=o(d);return c&&(h=-b-h),[r*(a(m(h)*p,-m(d))+x),i*C(o(h)*p)]},Vt.invert=function(t,e){var r=(k-1)/(k+1),n=L(1-r*r),o=function(t,e,r){var n,i,a;return t?(n=Nt(t,r),e?(a=(i=Nt(e,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Nt(e,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ut(b,n*n)-e,-t,n*n),l=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*c(r*l[0]*l[0]+r*l[1]*l[1])))-b]};var Ht=C(1-1/3)*A,Wt=pt(0);function Gt(t){var e=Ht*M,r=ct(x,e)[0]-ct(-x,e)[0],i=Wt(0,e)[1],a=ct(0,e)[1],o=T-a,s=S/t,c=4/S,d=i+o*o*4/S;function p(p,f){var m,g=n(f);if(g>e){var y=h(t-1,u(0,l((p+x)/s)));(m=ct(p+=x*(t-1)/t-y*s,g))[0]=m[0]*S/r-S*(t-1)/(2*t)+y*S/t,m[1]=i+4*(m[1]-a)*o/S,f<0&&(m[1]=-m[1])}else m=Wt(p,f);return m[0]*=c,m[1]/=d,m}return p.invert=function(e,p){e/=c;var f=n(p*=d);if(f>i){var m=h(t-1,u(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/S;var g=ct.invert(e,.25*(f-i)*S/o+a);return g[0]-=x*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Wt.invert(e,p)},p}function Yt(t,e){return[t,1&e?89.999999:Ht]}function Zt(t,e){return[t,1&e?-89.999999:-Ht]}function Xt(t){return[.999999*t[0],t[1]]}function Kt(t){var e,r=1+t,i=C(m(1/r)),s=2*L(x/(e=x+4*i*r)),l=.5*s*(r+L(t*(2+t))),c=t*t,u=r*r;function h(h,d){var p,f,g=1-m(d);if(g&&g<2){var y,_=b-d,w=25;do{var k=m(_),T=o(_),S=i+a(k,r-T),A=1+u-2*r*T;_-=y=(_-c*i-r*k+A*S-.5*g*e)/(2*r*k*S)}while(n(y)>v&&--w>0);p=s*L(A),f=h*S/x}else p=s*(t+g),f=h*i/x;return[p*m(f),l-p*o(f)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),d=E(h),p=m(d),f=i+a(p,r-h);return[C(t/L(o))*x/f,C(1-2*(d-c*i-r*p+(1+u-2*r*h)*f)/e)]},h}var Jt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Jt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Jt?((t=Y(t,e))[1]-=e>0?Qt:-Qt,t):Q(t,e)}function re(t,e,r,n){var i=L(4*x/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=L(n*m(r)*L((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return L(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(c,s*m(e)/r,e/x);isNaN(n)&&(n=r*f(e));var u=i*l(n);return[u*a*t/x*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=q(u,e*a/i);return[t*x/(o(n)*i*a*l(n)),C(r*c(n/r)/s)]},0===r&&(i=L(n/x),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,C(e*i)]}),h}function ne(t,e,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,d,p,f,m,g,y,v,x,b;if(d=t(e+.25*(h=r-e)),p=t(r-.25*h),isNaN(d))u.nanEncountered=!0;else{if(!isNaN(p))return b=((g=(f=h*(n+4*d+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+b):Math.abs(b)<s?g+b:(v=ne(t,e,y=e+.5*h,n,d,i,f,.5*s,l,c+1,u),isNaN(v)?(u.nanEncountered=!0,NaN):(x=ne(t,y,r,i,p,a,m,.5*s,l,c+1,u),isNaN(x)?(u.nanEncountered=!0,NaN):v+x));u.nanEncountered=!0}}function ie(t,e,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=t(e),o=t(.5*(e+r)),s=t(r);return ne(t,e,r,a,o,s,(a+4*o+s)*(r-e)/6,n,i,1,{maxDepthCount:0,nanEncountered:!1})}function ae(t,e,r){function i(r){return t+(1-t)*d(1-d(r,e),1/e)}function a(t){return ie(i,0,t,1e-4)}for(var o=1/a(1),s=1e3,l=(1+1e-8)*o,c=[],u=0;u<=s;u++)c.push(a(u/s)*l);function h(t){var e=0,r=s,n=500;do{c[n]>t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*h(1)/x*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=f(e)*C(a(n(e))*o)),[t/i(n(e)),r]},g}function oe(t,e){return n(t[0]-e[0])<y&&n(t[1]-e[1])<y}function se(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){n=((r=t[a])[0]-s[0])/e,i=(r[1]-s[1])/e;for(var c=0;c<e;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function le(t,n,i){var a,o;function s(e,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;o<s&&e>a[o][2][0];++o);var l=t(e-a[o][1][0],r);return l[0]+=t(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):t.invert&&(s.invert=function(e,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l<c;++l){var u=i[l];if(u[0][0]<=e&&e<u[1][0]&&u[0][1]<=r&&r<u[1][1]){var h=t.invert(e-t(a[l][1][0],0)[0],r);return h[0]+=a[l][1][0],oe(s(h[0],h[1]),[e,r])?h:null}}});var l=e.geoProjection(s),c=l.stream;return l.stream=function(t){var r=l.rotate(),n=c(t),i=(l.rotate([0,0]),c(t));return l.rotate(r),n.sphere=function(){e.geoStream(a,i)},n},l.lobes=function(e){return arguments.length?(a=function(t){var e,n,i,a,o,s,l,c=[],u=t[0].length;for(l=0;l<u;++l)n=(e=t[0][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(se([[n+y,i+y],[n+y,a-y],[o-y,a-y],[o-y,s+y]],30));for(l=t[1].length-1;l>=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(se([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(e),n=e.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))})),o=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(t){return t.map((function(t){return[[t[0][0]*A,t[0][1]*A],[t[1][0]*A,t[1][1]*A],[t[2][0]*A,t[2][1]*A]]}))}))},null!=n&&l.lobes(n),l}te.invert=function(t,e){return e>-Jt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Jt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var ce=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ue=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],he=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],de=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],pe=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],fe=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function me(t,e){return[3/S*t*L(x*x/3-e*e),e]}function ge(t){function e(e,r){if(n(n(r)-b)<y)return[0,r<0?-2:2];var i=m(r),a=d((1+i)/(1-i),t/2),s=.5*(a+1/a)+o(e*=t);return[2*m(e)/s,(a-1/a)/s]}return e.invert=function(e,r){var i=n(r);if(n(i-2)<y)return e?null:[0,f(r)*b];if(i>2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=d((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,C((l-1)/(l+1))]},e}me.invert=function(t,e){return[S/3*t/L(x*x/3-e*e),e]};var ye=x/k;function ve(t,e){return[t*(1+L(o(e)))/2,e/(o(e/2)*o(t/6))]}function xe(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function be(t,e){return[m(t)/o(e),g(e)*o(t)]}function _e(t){var e=o(t),r=g(_+t/2);function i(i,a){var o=a-t,s=n(o)<y?i*e:n(s=_+a/2)<y||n(n(s)-b)<y?0:i*o/c(g(s)/r);return[s,o]}return i.invert=function(i,a){var o,s=a+t;return[n(a)<y?i/e:n(o=_+s/2)<y||n(n(o)-b)<y?0:i*c(g(o)/r)/a,s]},i}function we(t,e){return[t,1.25*c(g(_+.4*e))]}function ke(t){var e=t.length-1;function r(r,n){for(var i,a=o(n),s=2/(1+a*o(r)),l=s*a*m(r),c=s*m(n),u=e,h=t[u],d=h[0],p=h[1];--u>=0;)d=(h=t[u])[0]+l*(i=d)-c*p,p=h[1]+l*p+c*i;return[d=l*(i=d)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,d=e,p=t[d],f=p[0],g=p[1],y=0,v=0;--d>=0;)y=f+c*(h=y)-u*v,v=g+c*v+u*h,f=(p=t[d])[0]+c*(h=f)-u*g,g=p[1]+c*g+u*h;var x,b,_=(y=f+c*(h=y)-u*v)*y+(v=g+c*v+u*h)*v;c-=x=((f=c*(h=f)-u*g-r)*y+(g=c*g+u*h-s)*v)/_,u-=b=(g*y-f*v)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=L(c*c+u*u),k=2*i(.5*w),T=m(k);return[a(c*T,w*o(k)),w?C(u*T/w):0]}},r}ve.invert=function(t,e){var r=n(t),i=n(e),a=y,s=b;i<ye?s*=i/ye:a+=6*E(ye/i);for(var l=0;l<25;l++){var c=m(s),u=L(o(s)),h=m(s/2),d=o(s/2),p=m(a/6),f=o(a/6),g=.5*a*(1+u)-r,v=s/(d*f)-i,x=u?-.25*a*c/u:0,_=.5*(1+u),w=(1+.5*s*h/d)/(d*f),k=s/d*(p/6)/(f*f),T=x*k-w*_,S=(g*k-v*_)/T,A=(v*x-g*w)/T;if(s-=S,a-=A,n(S)<y&&n(A)<y)break}return[t<0?-a:a,e<0?-s:s]},xe.invert=function(t,e){var r=f(t)*x,i=e/2,a=50;do{var o=r*r,s=i*i,l=r*i,c=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-t,u=i*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-e,h=.975534-s*(.119161+3*o*.0143059+.0547009*s),d=-l*(.238322+.2188036*s+.0286118*o),p=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=d*p-m*h,v=(u*d-c*m)/g,b=(c*p-u*h)/g;r-=v,i-=b}while((n(v)>y||n(b)>y)&&--a>0);return a&&[r,i]},be.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?w*L((i-L(i*i-4*r))/r):1/L(n);return[C(t*a),f(e)*E(a)]},we.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*x]};var Te=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Se=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ae=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Me=[[.9245,0],[0,0],[.01943,0]],Ce=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ee(t,r){var n=e.geoProjection(ke(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Le=L(6),Pe=L(7);function Ie(t,e){var r=C(7*m(e)/(3*Le));return[Le*t*(2*o(2*r/3)-1)/Pe,9*m(r/3)/Pe]}function ze(t,e){for(var r,i=(1+w)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)<y));s++);return[t*(1+2*o(a)/o(a/2))/(3*k),2*L(3)*m(a/2)/L(2+k)]}function Oe(t,e){for(var r,i=L(6/(4+x)),a=(1+x/4)*m(e),s=e/2,l=0;l<25&&(s-=r=(s/2+m(s)-a)/(.5+o(s)),!(n(r)<y));l++);return[i*(.5+o(s))*t/1.5,i*s]}function De(t,e){var r=e*e,n=r*r,i=r*n;return[t*(.84719-.13063*r+i*i*(.05494*r-.04515-.02326*n+.00331*i)),e*(1.01183+n*n*(.01926*r-.02625-.00396*n))]}function Re(t,e){return[t*(1+o(e))/2,2*(e-g(e/2))]}Ie.invert=function(t,e){var r=3*C(e*Pe/9);return[t*Pe/(Le*(2*o(2*r/3)-1)),C(3*m(r)*Le/7)]},ze.invert=function(t,e){var r=e*L(2+k)/(2*L(3)),n=2*C(r);return[3*k*t/(1+2*o(n)/o(n/2)),C((r+m(n))/(1+w))]},Oe.invert=function(t,e){var r=L(6/(4+x)),i=e/r;return n(n(i)-b)<y&&(i=i<0?-b:b),[1.5*t/(r*(.5+o(i))),C((i/2+m(i))/(1+x/4))]},De.invert=function(t,e){var r,i,a,o,s=e,l=25;do{s-=r=(s*(1.01183+(a=(i=s*s)*i)*a*(.01926*i-.02625-.00396*a))-e)/(1.01183+a*a*(.21186*i-.23625+-.05148*a))}while(n(r)>v&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Re.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var Fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Be(t,e){var r=m(e),i=o(e),a=f(t);if(0===t||n(e)===b)return[0,e];if(0===e)return[t,0];if(n(t)===b)return[t*i,b*r];var s=x/(2*t)-2*t/x,l=2*e/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,d=1+u/h,p=1+h/u,g=(s*r/c-s/2)/d,y=(h*r/u+c/2)/p,v=y*y-(h*r*r/u+c*r-1)/p;return[b*(g+L(g*g+i*i/d)*a),b*(y+L(v<0?0:v)*f(-e*s)*a)]}Be.invert=function(t,e){var r=(t/=b)*t,n=r+(e/=b)*e,i=x*x;return[t?(n-1+L((1-n)*(1-n)+4*r))/(2*t)*b:0,q((function(t){return n*(x*m(t)-2*t)*x+4*t*t*(e-m(t))+2*x*t-i*e}),0)]};var je=1.0148,Ne=.23185,Ue=-.14499,Ve=.02406,qe=je,$e=5*Ne,He=1.790857183;function We(t,e){var r=e*e;return[t,e*(je+r*r*(Ne+r*(Ue+Ve*r)))]}function Ge(t,e){if(n(e)<y)return[t,0];var r=g(e),i=t*m(e);return[m(i)/r,e+(1-o(i))/r]}function Ye(t,e){var r=Xe(t[1],t[0]),n=Xe(e[1],e[0]),i=function(t,e){return a(t[0]*e[1]-t[1]*e[0],t[0]*e[0]+t[1]*e[1])}(r,n),s=Ke(r)/Ke(n);return Ze([1,0,t[0][0],0,1,t[0][1]],Ze([s,0,0,0,s,0],Ze([o(i),m(i),0,-m(i),o(i),0],[1,0,-e[0][0],0,1,-e[0][1]])))}function Ze(t,e){return[t[0]*e[0]+t[1]*e[3],t[0]*e[1]+t[1]*e[4],t[0]*e[2]+t[1]*e[5]+t[2],t[3]*e[0]+t[4]*e[3],t[3]*e[1]+t[4]*e[4],t[3]*e[2]+t[4]*e[5]+t[5]]}function Xe(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ke(t){return L(t[0]*t[0]+t[1]*t[1])}function Je(t,r,n){function i(t,e){var n,i=r(t,e),a=i.project([t*A,e*A]);return(n=i.transform)?[n[0]*a[0]+n[1]*a[1]+n[2],-(n[3]*a[0]+n[4]*a[1]+n[5])]:(a[1]=-a[1],a)}function a(t,e){var n=t.project.invert,i=t.transform,o=e;if(i&&(o=[(i=function(t){var e=1/(t[0]*t[4]-t[1]*t[3]);return[e*t[4],-e*t[1],e*(t[1]*t[5]-t[2]*t[4]),-e*t[3],e*t[0],e*(t[2]*t[3]-t[0]*t[5])]}(i))[0]*o[0]+i[1]*o[1]+i[2],i[3]*o[0]+i[4]*o[1]+i[5]]),n&&t===function(t){return r(t[0]*M,t[1]*M)}(s=n(o)))return s;for(var s,l=t.children,c=0,u=l&&l.length;c<u;++c)if(s=a(l[c],e))return s}!function t(e,r){if(e.edges=function(t){for(var e=t.length,r=[],n=t[e-1],i=0;i<e;++i)r.push([n,n=t[i]]);return r}(e.face),r.face){var n=e.shared=function(t,e){for(var r,n,i=t.length,a=null,o=0;o<i;++o){r=t[o];for(var s=e.length;--s>=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Ye(n.map(r.project),n.map(e.project));e.transform=r.transform?Ze(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o<s;++o)tr(n[0],a[o][1])&&tr(n[1],a[o][0])&&(a[o]=e),tr(n[0],a[o][0])&&tr(n[1],a[o][1])&&(a[o]=e);for(o=0,s=(a=e.edges).length;o<s;++o)tr(n[0],a[o][0])&&tr(n[1],a[o][1])&&(a[o]=r),tr(n[0],a[o][1])&&tr(n[1],a[o][0])&&(a[o]=r)}else e.transform=r.transform;return e.children&&e.children.forEach((function(r){t(r,e)})),e}(t,{transform:null}),er(t)&&(i.invert=function(e,r){var n=a(t,[e,-r]);return n&&(n[0]*=M,n[1]*=M,n)});var o=e.geoProjection(i),s=o.stream;return o.stream=function(e){var r=o.rotate(),n=s(e),i=(o.rotate([0,0]),s(e));return o.rotate(r),n.sphere=function(){i.polygonStart(),i.lineStart(),Qe(i,t),i.lineEnd(),i.polygonEnd()},n},o.angle(null==n?-30:n*A)}function Qe(t,r,i){var a,o,s=r.edges,l=s.length,c={type:"MultiPoint",coordinates:r.face},u=r.face.filter((function(t){return 90!==n(t[1])})),h=e.geoBounds({type:"MultiPoint",coordinates:u}),d=!1,p=-1,f=h[1][0]-h[0][0],m=180===f||360===f?[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]:e.geoCentroid(c);if(i)for(;++p<l&&s[p]!==i;);++p;for(var g=0;g<l;++g)o=s[(g+p)%l],Array.isArray(o)?(d||(t.point((a=e.geoInterpolate(o[0],m)(y))[0],a[1]),d=!0),t.point((a=e.geoInterpolate(o[1],m)(y))[0],a[1])):(d=!1,o!==i&&Qe(t,o,r))}function tr(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}function er(t){return t.project.invert||t.children&&t.children.some(er)}We.invert=function(t,e){e>He?e=He:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(je+a*a*(Ne+a*(Ue+Ve*a)))-e)/(qe+a*a*($e+a*(.21654*a-1.01493)))}while(n(r)>y);return[t,i]},Ge.invert=function(t,e){if(n(e)<y)return[t,0];var r,i=t*t+e*e,a=.5*e,s=10;do{var l=g(a),c=1/o(a),u=i-2*e*a+a*a;a-=r=(l*u+2*(a-e))/(2+u*c*c+2*(a-e)*l)}while(n(r)>y&&--s>0);return l=g(a),[(n(e)<n(a+1/l)?C(t*l):f(e)*f(t)*(E(n(t*l))+b))/m(a),a]};var rr=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],nr=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map((function(t){return t.map((function(t){return rr[t]}))})),ir=2/L(3);function ar(t,e){var r=ct(t,e);return[r[0]*ir,r[1]]}function or(t,e){for(var r=0,n=t.length,i=0;r<n;++r)i+=t[r]*e[r];return i}function sr(t){return[a(t[1],t[0])*A,C(u(-1,h(1,t[2])))*A]}function lr(t){var e=t[0]*M,r=t[1]*M,n=o(r);return[n*o(e),n*m(e),m(r)]}function cr(){}function ur(t,e){return{type:"FeatureCollection",features:t.features.map((function(t){return hr(t,e)}))}}function hr(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:dr(t.geometry,e)}}function dr(t,r){if(!t)return null;if("GeometryCollection"===t.type)return function(t,e){return{type:"GeometryCollection",geometries:t.geometries.map((function(t){return dr(t,e)}))}}(t,r);var n;switch(t.type){case"Point":case"MultiPoint":n=mr;break;case"LineString":case"MultiLineString":n=gr;break;case"Polygon":case"MultiPolygon":case"Sphere":n=yr;break;default:return null}return e.geoStream(t,r(n)),n.result()}ar.invert=function(t,e){return ct.invert(t/ir,e)};var pr=[],fr=[],mr={point:function(t,e){pr.push([t,e])},result:function(){var t=pr.length?pr.length<2?{type:"Point",coordinates:pr[0]}:{type:"MultiPoint",coordinates:pr}:null;return pr=[],t}},gr={lineStart:cr,point:function(t,e){pr.push([t,e])},lineEnd:function(){pr.length&&(fr.push(pr),pr=[])},result:function(){var t=fr.length?fr.length<2?{type:"LineString",coordinates:fr[0]}:{type:"MultiLineString",coordinates:fr}:null;return fr=[],t}},yr={polygonStart:cr,lineStart:cr,point:function(t,e){pr.push([t,e])},lineEnd:function(){var t=pr.length;if(t){do{pr.push(pr[0].slice())}while(++t<4);fr.push(pr),pr=[]}},polygonEnd:cr,result:function(){if(!fr.length)return null;var t=[],e=[];return fr.forEach((function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}(r)?e.push(r):t.push([r])})),e.forEach((function(e){var r=e[0];t.some((function(t){if(function(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],c=l[0],u=l[1],h=t[s],d=h[0],p=h[1];u>n^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),fr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function vr(t){var r=t(b,0)[0]-t(-b,0)[0];function i(e,i){var a=n(e)<b,o=t(a?e:e>0?e-x:e+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-f(l)*c,u*l-f(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*w,o=(i-e)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var d=t.invert(a,o);return s||(d[0]+=a>0?x:-x),d}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function xr(){return vr(Vt).scale(111.48)}function br(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)<y)return[e?2*i(e*r/2)/e:r,0];var s,l=r*r+a*a,c=0,u=10;do{var h=g(c),d=1/o(c),p=l-2*a*c+c*c;c-=s=(h*p+2*(c-a))/(2+p*d*d+2*(c-a)*h)}while(n(s)>y&&--u>0);var f=r*(h=g(c)),v=g(n(a)<n(c+1/h)?.5*C(f):.5*E(f)+x/4)/m(c);return[e?2*i(e*v)/e:2*v,c]},r}var _r=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function wr(t,e){var r,i=h(18,36*n(e)/x),a=l(i),o=i-a,s=(r=_r[a])[0],c=r[1],u=(r=_r[++a])[0],d=r[1],p=(r=_r[h(19,++a)])[0],f=r[1];return[t*(u+o*(p-s)/2+o*o*(p-2*u+s)/2),(e>0?b:-b)*(d+o*(f-c)/2+o*o*(f-2*d+c)/2)]}function kr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=L(n),o=(t-L(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*L(1-o*o)),i?C(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}_r.forEach((function(t){t[1]*=1.0144})),wr.invert=function(t,e){var r=e/b,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=_r[o][1],c=_r[o+1][1],d=_r[h(19,o+2)][1],p=d-s,f=d-2*c+s,m=2*(n(r)-c)/p,g=f/p,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(e>=0?5:-5)*(y+a);var x,_=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=_r[o][1],c=_r[o+1][1],d=_r[h(19,o+2)][1],i-=(x=(e>=0?b:-b)*(c+y*(d-s)/2+y*y*(d-2*c+s)/2)-e)*A}while(n(x)>v&&--_>0);break}}while(--o>=0);var w=_r[o][0],k=_r[o+1][0],T=_r[h(19,o+2)][0];return[t/(k+y*(T-w)/2+y*y*(T-2*k+w)/2),i*M]};var Tr=-180,Sr=-179.9999,Ar=179.9999,Mr=-89.9999,Cr=89.9999;function Er(t){return t.length>0}function Lr(t){return-90===t||90===t?[0,t]:[Tr,(e=t,Math.floor(1e4*e)/1e4)];var e}function Pr(t){var e=t[0],r=t[1],n=!1;return e<=Sr?(e=Tr,n=!0):e>=Ar&&(e=180,n=!0),r<=Mr?(r=-90,n=!0):r>=Cr&&(r=90,n=!0),n?[e,r]:t}function Ir(t){return t.map(Pr)}function zr(t,e,r){for(var n=0,i=t.length;n<i;++n){var a=t[n].slice();r.push({index:-1,polygon:e,ring:a});for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l[0],u=l[1];if(c<=Sr||c>=Ar||u<=Mr||u>=Cr){a[o]=Pr(l);for(var h=o+1;h<s;++h){var d=a[h],p=d[0],f=d[1];if(p>Sr&&p<Ar&&f>Mr&&f<Cr)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:e,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=Lr(u),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=Lr(a[0][1]),o=-1,s=a.length}}}}function Or(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e<s;++e)n=(r=t[e]).ring[0],a=r.ring[r.ring.length-1],n[0]!==a[0]||n[1]!==a[1]?(r.index=e,l[n]=c[a]=r):(r.polygon.push(r.ring),t[e]=null);for(e=0;e<s;++e)if(r=t[e]){if(n=r.ring[0],a=r.ring[r.ring.length-1],i=c[n],o=l[a],delete l[n],delete c[a],n[0]===a[0]&&n[1]===a[1]){r.polygon.push(r.ring);continue}i?(delete c[n],delete l[i.ring[0]],i.ring.pop(),t[i.index]=null,r={index:-1,polygon:i.polygon,ring:i.ring.concat(r.ring)},i===o?r.polygon.push(r.ring):(r.index=s++,t.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r))):o?(delete l[a],delete c[o.ring[o.ring.length-1]],r.ring.pop(),r={index:s++,polygon:o.polygon,ring:r.ring.concat(o.ring)},t[o.index]=null,t.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function Dr(t){var e={type:"Feature",geometry:Rr(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function Rr(t){if(null==t)return t;var e,r,n,i;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(Rr)};break;case"Point":e={type:"Point",coordinates:Pr(t.coordinates)};break;case"MultiPoint":case"LineString":e={type:t.type,coordinates:Ir(t.coordinates)};break;case"MultiLineString":e={type:"MultiLineString",coordinates:t.coordinates.map(Ir)};break;case"Polygon":var a=[];zr(t.coordinates,a,r=[]),Or(r),e={type:"Polygon",coordinates:a};break;case"MultiPolygon":r=[],n=-1,i=t.coordinates.length;for(var o=new Array(i);++n<i;)zr(t.coordinates[n],o[n]=[],r);Or(r),e={type:"MultiPolygon",coordinates:o.filter(Er)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function Fr(t,e){var r=g(e/2),n=m(_*r);return[t*(.74482-.34588*n*n),1.70711*r]}function Br(t,r,n){var i=e.geoInterpolate(r,n),a=i(.5),o=e.geoRotation([-a[0],-a[1]])(r),s=i.distance/2,l=-C(m(o[1]*M)/m(s)),c=[-a[0],-a[1],-(o[0]>0?x-l:l)*A],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),d=u.center;return delete u.rotate,u.center=function(t){return arguments.length?d(h(t)):h.invert(d())},u.clipAngle(90)}function jr(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Nr(t,e){return Br(jr,t,e)}function Ur(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=E(o(a)*o(e-r)),l=E(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*L(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,h=o(L(u+(i=t+r)*i)),d=o(L(u+(i=t+n)*i));return[a(c=h-d,i=(h+d)*s),(e<0?-1:1)*E(L(i*i+c*c)*l)]},c}function Vr(t,e){return Br(Ur,t,e)}function qr(t,e){if(n(e)<y)return[t,0];var r=n(e/b),i=C(r);if(n(t)<y||n(n(e)-b)<y)return[0,f(e)*x*g(i/2)];var a=o(i),s=n(x/t-t/x)/2,l=s*s,c=a/(r+a-1),u=c*(2/r-1),h=u*u,d=h+l,p=c-h,m=l+c;return[f(t)*x*(s*p+L(l*p*p-d*(c*c-h)))/d,f(e)*x*(u*m-s*L((l+1)*d-m*m))/d]}function $r(t,e){if(n(e)<y)return[t,0];var r=n(e/b),i=C(r);if(n(t)<y||n(n(e)-b)<y)return[0,f(e)*x*g(i/2)];var a=o(i),s=n(x/t-t/x)/2,l=s*s,c=a*(L(1+l)-s*a)/(1+l*r*r);return[f(t)*x*c,f(e)*x*L(1-c*(2*s+c))]}function Hr(t,e){if(n(e)<y)return[t,0];var r=e/b,i=C(r);if(n(t)<y||n(n(e)-b)<y)return[0,x*g(i/2)];var a=(x/t-t/x)/2,s=r/(1+o(i));return[x*(f(t)*L(a*a+1-s*s)-a),x*s]}function Wr(t,e){if(!e)return[t,0];var r=n(e);if(!t||r===b)return[0,e];var i=r/b,a=i*i,o=(8*i-a*(a+2)-5)/(2*a*(i-1)),s=o*o,l=i*o,c=a+s+2*l,u=i+3*o,h=t/b,d=h+1/h,p=f(n(t)-b)*L(d*d-4),m=p*p,g=(p*(c+s-1)+2*L(c*(a+s*m-1)+(1-a)*(a*(u*u+4*s)+12*l*s+4*s*s)))/(4*c+m);return[f(t)*b*g,f(e)*b*L(1+p*n(g)-g*g)]}function Gr(t,e,r,n){var i=x/3;t=u(t,y),e=u(e,y),t=h(t,b),e=h(e,x-y),r=u(r,0),r=h(r,99.999999);var s=(n=u(n,y))/100,l=E((r/100+1)*o(i))/i,c=m(t)/m(l*b),d=e/x,p=L(s*m(t/2)/m(e/2));return function(t,e,r,n,i){function s(a,s){var l=r*m(n*s),c=L(1-l*l),u=L(2/(1+c*o(a*=i)));return[t*c*u*m(a),e*l*u]}return s.invert=function(o,s){var l=o/t,c=s/e,u=L(l*l+c*c),h=2*C(u/2);return[a(o*g(h),t*u)/i,u&&C(s*m(h)/(e*r*u))/n]},s}(p/L(d*c*l),1/(p*L(d*c*l)),c,l,d)}function Yr(){var t=65*M,r=60*M,n=20,i=200,a=e.geoProjectionMutator(Gr),o=a(t,r,n,i);return o.poleline=function(e){return arguments.length?a(t=+e*M,r,n,i):t*A},o.parallels=function(e){return arguments.length?a(t,r=+e*M,n,i):r*A},o.inflation=function(e){return arguments.length?a(t,r,n=+e,i):n},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(163.775)}Fr.invert=function(t,e){var r=e/1.70711,n=m(_*r);return[t/(.74482-.34588*n*n),2*i(r)]},qr.invert=function(t,e){if(n(e)<y)return[t,0];if(n(t)<y)return[0,b*m(2*i(e/x))];var r=(t/=x)*t,a=(e/=x)*e,s=r+a,l=s*s,c=-n(e)*(1+s),u=c-2*a+r,h=-2*c+1+2*a+l,d=a/h+(2*u*u*u/(h*h*h)-9*c*u/(h*h))/27,p=(c-u*u/(3*h))/h,g=2*L(-p/3),v=E(3*d/(p*g))/3;return[x*(s-1+L(1+2*(r-a)+l))/(2*t),f(e)*x*(-g*o(v+x/3)-u/(3*h))]},$r.invert=function(t,e){if(!t)return[0,b*m(2*i(e/x))];var r=n(t/x),o=(1-r*r-(e/=x)*e)/(2*r),s=L(o*o+1);return[f(t)*x*(s-o),f(e)*b*m(2*a(L((1-2*o*r)*(o+s)-r),L(s+o+r)))]},Hr.invert=function(t,e){if(!e)return[t,0];var r=e/x,n=(x*x*(1-r*r)-t*t)/(2*x*t);return[t?x*(f(t)*L(n*n+1)-n):0,b*m(2*i(r))]},Wr.invert=function(t,e){var r;if(!t||!e)return[t,e];e/=x;var i=f(t)*t/b,a=(i*i-1+4*e*e)/n(i),o=a*a,s=2*e,l=50;do{var c=s*s,u=(8*s-c*(c+2)-5)/(2*c*(s-1)),h=(3*s-c*s-10)/(2*c*s),d=u*u,p=s*u,m=s+u,g=m*m,v=s+3*u,_=-2*m*(4*p*d+(1-4*c+3*c*c)*(1+h)+d*(14*c-6-o+(8*c-8-2*o)*h)+p*(12*c-8+(10*c-10-o)*h)),w=L(g*(c+d*o-1)+(1-c)*(c*(v*v+4*d)+d*(12*p+4*d)));s-=r=(a*(g+d-1)+2*w-i*(4*g+o))/(a*(2*u*h+2*m*(1+h))+_/w-8*m*(a*(-1+d+g)+2*w)*(1+h)/(o+4*g))}while(r>y&&--l>0);return[f(t)*(L(a*a+4)+a)*x/4,b*s]};var Zr=4*x+3*L(3),Xr=2*L(2*x*L(3)/Zr),Kr=G(Xr*L(3)/x,Xr,Zr/6);function Jr(t,e){return[t*L(1-3*e*e/(x*x)),e]}function Qr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=L(1-n*n))-s*i,-s*r-l*i]}function tn(t,e){var r=O(t,e);return[(r[0]+t/b)/2,(r[1]+e)/2]}Jr.invert=function(t,e){return[t/L(1-3*e*e/(x*x)),e]},Qr.invert=function(t,e){var r=(t*t+e*e)/-2,n=L(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=L(o*o+i*i);return[a(n*i,s*(1+r)),s?-C(n*o/s):0]},tn.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,d=l*l,p=m(r),f=o(r/2),g=m(r/2),v=g*g,x=1-d*f*f,_=x?E(l*f)*L(s=1/x):s=0,w=.5*(2*_*l*g+r/b)-t,k=.5*(_*c+i)-e,T=.5*s*(d*v+_*l*f*h)+.5/b,S=s*(p*u/4-_*c*g),A=.125*s*(u*g-_*c*d*p),M=.5*s*(h*f+_*v*l)+.5,C=S*A-M*T,P=(k*S-w*M)/C,I=(w*A-k*T)/C;r-=P,i-=I}while((n(P)>y||n(I)>y)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=b,r=e.geoProjectionMutator(z),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*M):t*A},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=z,t.geoAitoff=function(){return e.geoProjection(O).scale(152.63)},t.geoAitoffRaw=O,t.geoArmadillo=function(){var t=20*M,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(D),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*M)>=0?1:-1)*t),i(t)):t*A},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*M/2),n)*A);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=D,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(j).scale(112.314)},t.geoBakerRaw=j,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=.01,l=-o(s*M),c=m(s*M);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),u=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,u=b;e<t;++e,i-=r,u-=n)h.point(a(c*o(u),l)*A,C(c*m(u))*A),i<-90?(h.point(-90,-180-i-s),h.point(-90,-180-i+s)):(h.point(90,i+s),h.point(90,i-s));h.lineEnd(),h.polygonEnd()},u},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},t.geoBerghausRaw=N,t.geoBertin1953=function(){return e.geoProjection(H()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},t.geoBertin1953Raw=H,t.geoBoggs=function(){return e.geoProjection(K).scale(160.857)},t.geoBoggsRaw=K,t.geoBonne=function(){return J(tt).scale(123.082).center([0,26.1441]).parallel(45)},t.geoBonneRaw=tt,t.geoBottomley=function(){var t=.5,r=e.geoProjectionMutator(et),n=r(t);return n.fraction=function(e){return arguments.length?r(t=+e):t},n.scale(158.837)},t.geoBottomleyRaw=et,t.geoBromley=function(){return e.geoProjection(rt).scale(152.63)},t.geoBromleyRaw=rt,t.geoChamberlin=lt,t.geoChamberlinRaw=ot,t.geoChamberlinAfrica=function(){return lt([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},t.geoCollignon=function(){return e.geoProjection(ct).scale(95.6464).center([0,30])},t.geoCollignonRaw=ct,t.geoCraig=function(){return J(ut).scale(249.828).clipAngle(90)},t.geoCraigRaw=ut,t.geoCraster=function(){return e.geoProjection(dt).scale(156.19)},t.geoCrasterRaw=dt,t.geoCylindricalEqualArea=function(){return J(pt).parallel(38.58).scale(195.044)},t.geoCylindricalEqualAreaRaw=pt,t.geoCylindricalStereographic=function(){return J(ft).scale(124.75)},t.geoCylindricalStereographicRaw=ft,t.geoEckert1=function(){return e.geoProjection(mt).scale(165.664)},t.geoEckert1Raw=mt,t.geoEckert2=function(){return e.geoProjection(gt).scale(165.664)},t.geoEckert2Raw=gt,t.geoEckert3=function(){return e.geoProjection(yt).scale(180.739)},t.geoEckert3Raw=yt,t.geoEckert4=function(){return e.geoProjection(vt).scale(180.739)},t.geoEckert4Raw=vt,t.geoEckert5=function(){return e.geoProjection(xt).scale(173.044)},t.geoEckert5Raw=xt,t.geoEckert6=function(){return e.geoProjection(bt).scale(173.044)},t.geoEckert6Raw=bt,t.geoEisenlohr=function(){return e.geoProjection(wt).scale(62.5271)},t.geoEisenlohrRaw=wt,t.geoFahey=function(){return e.geoProjection(Tt).scale(137.152)},t.geoFaheyRaw=Tt,t.geoFoucaut=function(){return e.geoProjection(St).scale(135.264)},t.geoFoucautRaw=St,t.geoFoucautSinusoidal=function(){var t=.5,r=e.geoProjectionMutator(At),n=r(t);return n.alpha=function(e){return arguments.length?r(t=+e):t},n.scale(168.725)},t.geoFoucautSinusoidalRaw=At,t.geoGilbert=function(t){null==t&&(t=e.geoOrthographic);var r=t(),n=e.geoEquirectangular().scale(A).precision(0).clipAngle(null).translate([0,0]);function i(t){return r(Mt(t))}function a(t){i[t]=function(){return arguments.length?(r[t].apply(r,arguments),i):r[t]()}}return r.invert&&(i.invert=function(t){return Ct(r.invert(t))}),i.stream=function(t){var e=r.stream(t),i=n.stream({point:function(t,r){e.point(t/2,C(g(-r/2*M))*A)},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}});return i.sphere=e.sphere,i},i.rotate=function(t){return arguments.length?(n.rotate(t),i):n.rotate()},i.center=function(t){return arguments.length?(r.center(Mt(t)),i):Ct(r.center())},a("angle"),a("clipAngle"),a("clipExtent"),a("fitExtent"),a("fitHeight"),a("fitSize"),a("fitWidth"),a("scale"),a("translate"),a("precision"),i.scale(249.5)},t.geoGingery=function(){var t=6,r=30*M,n=o(r),i=m(r),s=e.geoProjectionMutator(Et),l=s(r,t),c=l.stream,u=-o(.01*M),h=m(.01*M);return l.radius=function(e){return arguments.length?(n=o(r=e*M),i=m(r),s(r,t)):r*A},l.lobes=function(e){return arguments.length?s(r,t=+e):t},l.stream=function(e){var r=l.rotate(),s=c(e),d=(l.rotate([0,0]),c(e));return l.rotate(r),s.sphere=function(){d.polygonStart(),d.lineStart();for(var e=0,r=2*x/t,s=0;e<t;++e,s-=r)d.point(a(h*o(s),u)*A,C(h*m(s))*A),d.point(a(i*o(s-r/2),n)*A,C(i*m(s-r/2))*A);d.lineEnd(),d.polygonEnd()},s},l.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},t.geoGingeryRaw=Et,t.geoGinzburg4=function(){return e.geoProjection(zt).scale(149.995)},t.geoGinzburg4Raw=zt,t.geoGinzburg5=function(){return e.geoProjection(Ot).scale(153.93)},t.geoGinzburg5Raw=Ot,t.geoGinzburg6=function(){return e.geoProjection(Dt).scale(130.945)},t.geoGinzburg6Raw=Dt,t.geoGinzburg8=function(){return e.geoProjection(Rt).scale(131.747)},t.geoGinzburg8Raw=Rt,t.geoGinzburg9=function(){return e.geoProjection(Ft).scale(131.087)},t.geoGinzburg9Raw=Ft,t.geoGringorten=function(){return e.geoProjection(Bt(jt)).scale(239.75)},t.geoGringortenRaw=jt,t.geoGuyou=function(){return e.geoProjection(Bt(Vt)).scale(151.496)},t.geoGuyouRaw=Vt,t.geoHammer=function(){var t=2,r=e.geoProjectionMutator(U),n=r(t);return n.coefficient=function(e){return arguments.length?r(t=+e):t},n.scale(169.529)},t.geoHammerRaw=U,t.geoHammerRetroazimuthal=function(){var t=0,r=e.geoProjectionMutator(qt),n=r(t),i=n.rotate,a=n.stream,o=e.geoCircle();return n.parallel=function(e){if(!arguments.length)return t*A;var i=n.rotate();return r(t=e*M).rotate(i)},n.rotate=function(e){return arguments.length?(i.call(n,[e[0],e[1]-t*A]),o.center([-e[0],-e[1]]),n):((e=i.call(n))[1]+=t*A,e)},n.stream=function(t){return(t=a(t)).sphere=function(){t.polygonStart();var e,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(t.lineStart();++i<n;)t.point((e=r[i])[0],e[1]);for(t.lineEnd(),n=(r=o.radius(90.01)().coordinates[0]).length-1,t.lineStart();--i>=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=qt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Gt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){e.geoStream(function(t){var e=[].concat(r.range(-180,180+t/2,t).map(Yt),r.range(180,-180-t/2,-t).map(Zt));return{type:"Polygon",coordinates:[180===t?e.map(Xt):e]}}(180/t),l)},s},i.scale(239.75)},t.geoHealpixRaw=Gt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Kt,t.geoHomolosine=function(){return e.geoProjection(ee).scale(152.63)},t.geoHomolosineRaw=ee,t.geoHufnagel=function(){var t=1,r=0,n=45*M,i=2,a=e.geoProjectionMutator(re),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*M,i):n*A},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=re,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ae),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ae,t.geoInterrupt=le,t.geoInterruptedBoggs=function(){return le(K,ce).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ue).scale(152.63)},t.geoInterruptedMollweide=function(){return le(Y,he).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return le(Y,de).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return le(te,pe,$).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return le(Q,fe).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(me).scale(158.837)},t.geoKavrayskiy7Raw=me,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(ge),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=ge,t.geoLarrivee=function(){return e.geoProjection(ve).scale(97.2672)},t.geoLarriveeRaw=ve,t.geoLaskowski=function(){return e.geoProjection(xe).scale(139.98)},t.geoLaskowskiRaw=xe,t.geoLittrow=function(){return e.geoProjection(be).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=be,t.geoLoximuthal=function(){return J(_e).parallel(40).scale(158.837)},t.geoLoximuthalRaw=_e,t.geoMiller=function(){return e.geoProjection(we).scale(108.318)},t.geoMillerRaw=we,t.geoModifiedStereographic=Ee,t.geoModifiedStereographicRaw=ke,t.geoModifiedStereographicAlaska=function(){return Ee(Te,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ee(Se,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ee(Ae,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ee(Me,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ee(Ce,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Y).scale(169.529)},t.geoMollweideRaw=Y,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Ie).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Ie,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(ze).scale(188.209)},t.geoMtFlatPolarQuarticRaw=ze,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(Oe).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=Oe,t.geoNaturalEarth2=function(){return e.geoProjection(De).scale(175.295)},t.geoNaturalEarth2Raw=De,t.geoNellHammer=function(){return e.geoProjection(Re).scale(152.63)},t.geoNellHammerRaw=Re,t.geoInterruptedQuarticAuthalic=function(){return le(U(1/0),Fe).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(Be).scale(127.267)},t.geoNicolosiRaw=Be,t.geoPatterson=function(){return e.geoProjection(We).scale(139.319)},t.geoPattersonRaw=We,t.geoPolyconic=function(){return e.geoProjection(Ge).scale(103.74)},t.geoPolyconicRaw=Ge,t.geoPolyhedral=Je,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5]})).angle(-30).scale(101.858).center([0,45])},t.geoPolyhedralCollignon=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoProjection(ar).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5]})).angle(-30).scale(121.906).center([0,48.5904])},t.geoPolyhedralWaterman=function(t){t=t||function(t){var r=6===t.length?e.geoCentroid({type:"MultiPoint",coordinates:t}):t[0];return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(t){for(var e,r=t.map(lr),n=r.length,i=r[n-1],a=[],o=0;o<n;++o)e=r[o],a.push(sr([.9486832980505138*i[0]+.31622776601683794*e[0],.9486832980505138*i[1]+.31622776601683794*e[1],.9486832980505138*i[2]+.31622776601683794*e[2]]),sr([.9486832980505138*e[0]+.31622776601683794*i[0],.9486832980505138*e[1]+.31622776601683794*i[1],.9486832980505138*e[2]+.31622776601683794*i[2]])),i=e;return a})),n=[],i=[-1,0,0,1,0,1,4,5];r.forEach((function(t,e){for(var a,o,s=nr[e],l=s.length,c=n[e]=[],u=0;u<l;++u)r.push([s[u],t[(2*u+2)%(2*l)],t[(2*u+1)%(2*l)]]),i.push(e),c.push((a=lr(t[(2*u+2)%(2*l)]),o=lr(t[(2*u+1)%(2*l)]),[a[1]*o[2]-a[2]*o[1],a[2]*o[0]-a[0]*o[2],a[0]*o[1]-a[1]*o[0]]))}));var a=r.map((function(e){return{project:t(e),face:e}}));return i.forEach((function(t,e){var r=a[t];r&&(r.children||(r.children=[])).push(a[e])})),Je(a[0],(function(t,e){var r=o(e),i=[r*o(t),r*m(t),m(e)],s=t<-x/2?e<0?6:4:t<0?e<0?2:0:t<x/2?e<0?3:1:e<0?7:5,l=n[s];return a[or(l[0],i)<0?8+3*s:or(l[1],i)<0?8+3*s+1:or(l[2],i)<0?8+3*s+2:s]})).angle(-30).scale(110.625).center([0,45])},t.geoProject=function(t,e){var r,n=e.stream;if(!n)throw new Error("invalid projection");switch(t&&t.type){case"Feature":r=hr;break;case"FeatureCollection":r=ur;break;default:r=dr}return r(t,n)},t.geoGringortenQuincuncial=function(){return vr(jt).scale(176.423)},t.geoPeirceQuincuncial=xr,t.geoPierceQuincuncial=xr,t.geoQuantize=function(t,e){if(!(0<=(e=+e)&&e<=20))throw new Error("invalid digits");function r(t){var r=t.length,n=2,i=new Array(r);for(i[0]=+t[0].toFixed(e),i[1]=+t[1].toFixed(e);n<r;)i[n]=t[n],++n;return i}function n(t){return t.map(r)}function i(t){for(var e=r(t[0]),n=[e],i=1;i<t.length;i++){var a=r(t[i]);(a.length>2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=vr,t.geoRectangularPolyconic=function(){return J(br).scale(131.215)},t.geoRectangularPolyconicRaw=br,t.geoRobinson=function(){return e.geoProjection(wr).scale(152.63)},t.geoRobinsonRaw=wr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(kr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*M):r*A},i.scale(432.147).clipAngle(E(1/t)*A-1e-6)},t.geoSatelliteRaw=kr,t.geoSinuMollweide=function(){return e.geoProjection(te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=te,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return Dr(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Dr)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Rr(t)}},t.geoTimes=function(){return e.geoProjection(Fr).scale(146.153)},t.geoTimesRaw=Fr,t.geoTwoPointAzimuthal=Nr,t.geoTwoPointAzimuthalRaw=jr,t.geoTwoPointAzimuthalUsa=function(){return Nr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Vr,t.geoTwoPointEquidistantRaw=Ur,t.geoTwoPointEquidistantUsa=function(){return Vr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(qr).scale(79.4183)},t.geoVanDerGrintenRaw=qr,t.geoVanDerGrinten2=function(){return e.geoProjection($r).scale(79.4183)},t.geoVanDerGrinten2Raw=$r,t.geoVanDerGrinten3=function(){return e.geoProjection(Hr).scale(79.4183)},t.geoVanDerGrinten3Raw=Hr,t.geoVanDerGrinten4=function(){return e.geoProjection(Wr).scale(127.16)},t.geoVanDerGrinten4Raw=Wr,t.geoWagner=Yr,t.geoWagner7=function(){return Yr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=Gr,t.geoWagner4=function(){return e.geoProjection(Kr).scale(176.84)},t.geoWagner4Raw=Kr,t.geoWagner6=function(){return e.geoProjection(Jr).scale(152.63)},t.geoWagner6Raw=Jr,t.geoWiechel=function(){return e.geoProjection(Qr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=Qr,t.geoWinkel3=function(){return e.geoProjection(tn).scale(158.837)},t.geoWinkel3Raw=tn,Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,pg(),dg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),mg=d({"src/plots/geo/zoom.js"(t,e){var r=v(),n=se(),i=Vt(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},d={};function p(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,t);r.get()!==e&&(r.set(e),n.nestedProperty(l,t).set(e),d[a+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function h(t,e){var n=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){e.scale(r.event.scale).translate(r.event.translate),t.render(!0);var n=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(t,e,i)})),n}function d(t,e){var n,i,a,o,h,d,p,f,m,g=c(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(n)})).on("zoom",(function(){if(d=r.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n))return g.scale(e.scale()),void g.translate(e.translate());e.scale(r.event.scale),e.translate([a[0],r.event.translate[1]]),h?y(d)&&(f=y(d),p=[o[0]+(f[0]-h[0]),i[1],i[2]],e.rotate(p),o=p):h=y(n=d),m=!0,t.render(!0);var s=e.rotate(),l=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(t,e,v)})),g}function p(t,e){var n,i={r:e.rotate(),k:e.scale()},h=c(0,e),d=function(t){for(var e=0,n=arguments.length,i=[];++e<n;)i.push(arguments[e]);var a=r.dispatch.apply(null,i);return a.of=function(e,n){return function(i){var o;try{o=i.sourceEvent=r.event,i.target=t,r.event=i,a[i.type].apply(e,n)}finally{r.event=o}}},a}(h,"zoomstart","zoom","zoomend"),p=0,g=h.on;function v(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}return h.on("zoomstart",(function(){r.select(this).style(s);var t=r.mouse(this),l=e.rotate(),c=l,u=e.translate(),v=function(t){var e=.5*t[0]*a,r=.5*t[1]*a,n=.5*t[2]*a,i=Math.sin(e),o=Math.cos(e),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return[o*l*u+i*s*c,i*l*u-o*s*c,o*s*u+i*l*c,o*l*c-i*s*u]}(l);n=f(e,t),g.call(h,"zoom",(function(){var a=r.mouse(this);if(e.scale(i.k=r.event.scale),n){if(f(e,a)){e.rotate(l).translate(u);var s=f(e,a),h=function(t,e){if(t&&e){var r=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}(t,e),n=Math.sqrt(x(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,x(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}(n,s),p=function(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*o,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*o,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*o]}(function(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],c=e[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}(v,h)),g=i.r=function(t,e,r){var n=y(e,2,t[0]);n=y(n,1,t[1]),n=y(n,0,t[2]-r[2]);var i,a,s=e[0],l=e[1],c=e[2],u=n[0],h=n[1],d=n[2],p=Math.atan2(l,s)*o,f=Math.sqrt(s*s+l*l);Math.abs(h)>f?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/f)*o-p,i=Math.sqrt(f*f-h*h));var g=180-a-2*p,v=(Math.atan2(d,u)-Math.atan2(c,i))*o,x=(Math.atan2(d,u)-Math.atan2(c,-i))*o,b=m(r[0],r[1],a,v),_=m(r[0],r[1],g,x);return b<=_?[a,v,r[2]]:[g,x,r[2]]}(p,n,c);isFinite(g[0])&&isFinite(g[1])&&isFinite(g[2])||(g=c),e.rotate(g),c=g}}else n=f(e,t=a);!function(t){t({type:"zoom"})}(d.of(this,arguments))})),function(t){p++||t({type:"zoomstart"})}(d.of(this,arguments))})).on("zoomend",(function(){r.select(this).style(l),g.call(h,"zoom",null),function(t){--p||t({type:"zoomend"})}(d.of(this,arguments)),u(t,e,v)})).on("zoom.redraw",(function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,d,"on")}function f(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=g(r-t),a=g(n-e);return Math.sqrt(i*i+a*a)}function g(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function x(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}e.exports=function(t,e){var r=t.projection;return(e._isScoped?h:e._isClipped?p:d)(t,r)}}}),gg=d({"src/plots/geo/geo.js"(t,e){var r=v(),n=pg(),i=n.geoPath,a=n.geoDistance,o=fg(),s=Vt(),l=se(),c=l.strTranslate,u=q(),h=Je(),d=zr(),p=ke(),f=nr(),m=rr().getAutoRange,g=hr(),y=Mn().prepSelect,x=Mn().clearOutline,b=Mn().selectOnClick,_=mg(),w=Xm(),k=og(),T=Jm(),S=Km().feature;function A(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.isStatic=t.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var M=A.prototype;function C(t,e){var r=w.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new A(t)},M.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u<t.length;u++){var h=t[0][0].trace;h._geo=i,h.locationmode&&(s=!0);var d=h.marker;if(d){var p=d.angle,f=d.angleref;(p||"north"===f||"previous"===f)&&(c=!0)}}if(this._hasMarkerAngles=c,s){var m=T.getTopojsonName(a);null!==i.topojson&&m===i.topojsonName||(i.topojsonName=m,void 0===PlotlyGeoAssets.topojson[i.topojsonName]&&o.push(i.fetchTopojson()))}o=o.concat(k.fetchTraceGeoData(t)),r.push(new Promise((function(r,n){Promise.all(o).then((function(){i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.update(t,e),r()})).catch(n)})))},M.fetchTopojson=function(){var t=this,e=T.getTopojsonPath(t.topojsonURL,t.topojsonName);return new Promise((function(n,i){r.json(e,(function(r,a){if(r)return 404===r.status?i(new Error(["plotly.js could not find topojson file at",e+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):i(new Error(["unexpected error while fetching topojson file at",e].join(" ")));PlotlyGeoAssets.topojson[t.topojsonName]=a,n()}))}))},M.update=function(t,e,r){var n=e[this.id];this.hasChoropleth=!1;for(var i=0;i<t.length;i++){var a=t[i],o=a[0].trace;"choropleth"===o.type&&(this.hasChoropleth=!0),!0===o.visible&&o._length>0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},M.updateProjection=function(t,e){var r=this.graphDiv,s=e[this.id],c=e._size,u=s.domain,h=s.projection,d=s.lonaxis,p=s.lataxis,f=d._ax,g=p._ax,y=this.projection=function(t){var e=t.projection,r=e.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],d=function(t){return t?c:[]},p=0;p<h.length;p++){var f=h[p];"function"!==typeof c[f]&&(c[f]=d)}return c.isLonLatOverEdges=function(t){if(null===c(t))return!0;if(u){var e=c.rotate();return a(t,[-e[0],-e[1]])>u*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(t){return c.getPath().bounds(t)},c.precision(w.precision),t._isSatellite&&c.tilt(e.tilt).distance(e.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},b=h.rotation||{},_=d.range||[],k=p.range||[];if(s.fitbounds){f._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],f.range=m(r,f),g.range=m(r,g);var T=(f.range[0]+f.range[1])/2,S=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:T,lat:S};else if(s._isClipped){x={lon:T,lat:S},b={lon:T,lat:S,roll:b.roll};var A=h.type,M=w.lonaxisSpan[A]/2||180,E=w.lataxisSpan[A]/2||90;_=[T-M,T+M],k=[S-E,S+E]}else x={lon:T,lat:S},b={lon:T,lat:b.lat,roll:b.roll}}y.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(h.parallels);var L=C(_,k);y.fitExtent(v,L);var P=this.bounds=y.getBounds(L),I=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var O=y.getBounds(C(f.range,g.range)),D=Math.min((P[1][0]-P[0][0])/(O[1][0]-O[0][0]),(P[1][1]-P[0][1])/(O[1][1]-O[0][1]));isFinite(D)?y.scale(D*I):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(P),s._isAlbersUsa){var F=y([x.lon,x.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},M.updateBaseLayers=function(t,e){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var d=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=n.framework.selectAll(".layer").data(d,String);p.exit().each((function(t){delete a[t],delete o[t],r.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=r.select(this);"bg"===t?n.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(S(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=1e-6,s=2.5,l=e[t],c=w.scopeDefaults[e.scope];"lonaxis"===t?(n=c.lonaxisRange,i=c.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=c.lataxisRange,i=c.lonaxisRange,a=function(t,e){return[e,t]});var u={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};f.setConvert(u,r);var h=f.calcTicks(u);e.isScoped||"lonaxis"!==t||h.pop();for(var d=h.length,p=new Array(d),m=0;m<d;m++)for(var g=h[m].x,y=p[m]=[],v=i[0];v<i[1]+s;v+=s)y.push(a(g,v));return{type:"MultiLineString",coordinates:p}}(r,e,t)).call(u.stroke,e[r].gridcolor).call(h.dashLine,e[r].griddash,e[r].gridwidth),l(r)?n.call(u.stroke,e[a+"color"]).call(h.dashLine,"",e[a+"width"]):c(r)&&n.call(u.fill,e[a+"color"])}))},M.updateDims=function(t,e){var r=this.bounds,n=(e.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;h.setRect(this.clipRect,i,a,o,s),this.bgRect.call(h.setRect,i,a,o,s).call(u.fill,e.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},M.updateFx=function(t,e){var n=this,i=n.graphDiv,a=n.bgRect,o=t.dragmode,c=t.clickmode;if(!n.isStatic){var u={element:n.bgRect.node(),gd:i,plotinfo:{id:n.id,xaxis:n.xaxis,yaxis:n.yaxis,fillRangeItems:function(t,e){e.isRect?(t.range={})[n.id]=[h([e.xmin,e.ymin]),h([e.xmax,e.ymax])]:(t.lassoPoints={})[n.id]=e.map(h)}},xaxes:[n.xaxis],yaxes:[n.yaxis],subplot:n.id,clickFn:function(t){2===t&&x(i)}};"pan"===o?(a.node().onmousedown=null,a.call(_(n,e)),a.on("dblclick.zoom",(function(){var t=n.viewInitial,e={};for(var r in t)e[n.id+"."+r]=t[r];s.call("_guiRelayout",i,e),i.emit("plotly_doubleclick",null)})),i._context._scrollZoom.geo||a.on("wheel.zoom",null)):"select"!==o&&"lasso"!==o||(a.on(".zoom",null),u.prepFn=function(t,e,r){y(t,e,r,u,o)},g.init(u)),a.on("mousemove",(function(){var t=n.projection.invert(l.getPositionFromD3Event());if(!t)return g.unhover(i,r.event);n.xaxis.p2c=function(){return t[0]},n.yaxis.p2c=function(){return t[1]},d.hover(i,r.event,n.id)})),a.on("mouseout",(function(){i._dragging||g.unhover(i,r.event)})),a.on("click",(function(){"select"!==o&&"lasso"!==o&&(c.indexOf("select")>-1&&b(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&d.click(i,r.event))}))}function h(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},M.makeFramework=function(){var t=this,e=t.graphDiv,n=e._fullLayout,i="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=r.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(t.mockAxis,n)},M.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,e)},M.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},M._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?c(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}}}),yg=d({"src/plots/geo/layout_attributes.js"(t,e){var r=V(),n=ka().attributes,i=It().dash,a=Xm(),o=Pt().overrideAll,s=Wt(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(e.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),vg=d({"src/plots/geo/layout_defaults.js"(t,e){var r=se(),n=qs(),i=_e().getSubplotData,a=Xm(),o=yg(),s=a.axesNames;function l(t,e,n,o){var l=i(o.fullData,"geo",o.id).map((function(t){return t.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],d=n("projection.type",h.projType),p=e._isAlbersUsa="albers usa"===d;p&&(u=e.scope="usa");var f=e._isScoped="world"!==u,m=e._isSatellite="satellite"===d,g=e._isConic=-1!==d.indexOf("conic")||"albers"===d,y=e._isClipped=!!a.lonaxisSpan[d];if(!1===t.visible){var v=r.extendDeep({},e._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),e._template=v}for(var x=n("visible"),b=0;b<s.length;b++){var _,w=s[b],k=[30,10][b];if(f)_=h[w+"Range"];else{var T=a[w+"Span"],S=(T[d]||T["*"])/2,A=n("projection.rotation."+w.substr(0,3),h.projRotate[b]);_=[A-S,A+S]}var M=n(w+".range",_);n(w+".tick0"),n(w+".dtick",k),n(w+".showgrid",!!x&&void 0)&&(n(w+".gridcolor"),n(w+".gridwidth"),n(w+".griddash")),e[w]._ax={type:"linear",_id:w.slice(0,3),_traceIndices:l,setScale:r.identity,c2l:r.identity,r2l:r.identity,autorange:!0,range:M.slice(),_m:1,_input:{}}}var C=e.lonaxis.range,E=e.lataxis.range,L=C[0],P=C[1];L>0&&P<0&&(P+=360);var I,z,O,D=(L+P)/2;if(!p){var R=f?h.projRotate:[D,0,0];I=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!f&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}p?(z=-96.6,O=38.7):(z=f?D:I,O=(E[0]+E[1])/2),n("center.lon",z),n("center.lat",O),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",f&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),f||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete e.projection.scale,f?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),xg=d({"src/plots/geo/index.js"(t,e){var r=_e().getSubplotCalcData,n=se().counterRegex,i=gg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},e.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:yg(),supplyLayoutDefaults:vg(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,o=e._subplots[a],s=0;s<o.length;s++){var l=o[s],c=r(n,a,l),u=e[l]._subplot;u||(u=i({id:l,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL,staticPlot:t._context.staticPlot}),e[l]._subplot=u),u.plot(c,e,t._promises)}},updateFx:function(t){for(var e=t._fullLayout,r=e._subplots[a],n=0;n<r.length;n++){var i=e[r[n]];i._subplot.updateFx(e,i)}},clean:function(t,e,r,n){for(var i=n._subplots[a]||[],o=0;o<i.length;o++){var s=i[o],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}}}}),bg=d({"src/traces/scattergeo/index.js"(t,e){e.exports={attributes:Wm(),supplyDefaults:Gm(),colorbar:di(),formatLabels:Ym(),calc:Zm(),calcGeoJSON:lg().calcGeoJSON,plot:lg().plot,style:sg(),styleOnSelect:fi().styleOnSelect,hoverPoints:cg(),eventData:ug(),selectPoints:hg(),moduleType:"trace",name:"scattergeo",basePlotModule:xg(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}}),_g=d({"lib/scattergeo.js"(t,e){e.exports=bg()}}),wg=d({"src/traces/choropleth/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Wm(),i=Pe(),a=N(),o=V().defaultLine,s=D().extendFlat,l=n.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},n.geojson,{}),featureidkey:n.featureidkey,text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),marker:{line:{color:s({},l.color,{dflt:o}),width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},a.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:r(),showlegend:s({},a.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),kg=d({"src/traces/choropleth/defaults.js"(t,e){var r=se(),n=Ve(),i=wg();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),c=s("z");if(l&&l.length&&r.isArrayOrTypedArray(c)&&c.length){e._length=Math.min(l.length,c.length);var u,h=s("geojson");("string"===typeof h&&""!==h||r.isPlainObject(h))&&(u="geojson-id"),"geojson-id"===s("locationmode",u)&&s("featureidkey"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(t,e,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,s)}else e.visible=!1}}}),Tg=d({"src/traces/choropleth/calc.js"(t,e){var r=k(),n=T().BADNUM,i=He(),a=ni(),o=ii();function s(t){return t&&"string"===typeof t}e.exports=function(t,e){var l,c=e._length,u=new Array(c);l=e.geojson?function(t){return s(t)||r(t)}:s;for(var h=0;h<c;h++){var d=u[h]={},p=e.locations[h],f=e.z[h];l(p)&&r(f)?(d.loc=p,d.z=f):(d.loc=null,d.z=n),d.index=h}return a(u,e),i(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),o(u,e),u}}}),Sg=d({"src/traces/choropleth/style.js"(t,e){var r=v(),n=q(),i=Je(),a=We();function o(t,e){var o=e[0].trace,s=e[0].node3.selectAll(".choroplethlocation"),l=o.marker||{},c=l.line||{},u=a.makeColorScaleFuncFromTrace(o);s.each((function(t){r.select(this).attr("fill",u(t.z)).call(n.stroke,t.mlc||c.color).call(i.dashLine,"",t.mlw||c.width||0).style("opacity",l.opacity)})),i.selectedPointStyle(s,o)}e.exports={style:function(t,e){e&&o(0,e)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n):o(0,e)}}}}),Ag=d({"src/traces/choropleth/plot.js"(t,e){var r=v(),n=se(),i=og(),a=Jm().getTopojsonFeatures,o=rr().findExtremes,s=Sg().style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],s=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(t):a(r,s.topojson),h=[],d=[],p=0;p<c;p++){var f=t[p],m="geojson-id"===l?f.fOut:i.locationToFeature(l,f.loc,u);if(m){f.geojson=m,f.ct=m.properties.ct,f._polygons=i.feature2polygons(m);var g=i.computeBbox(m);h.push(g[0],g[2]),d.push(g[1],g[3])}else f.geojson=null}if("geojson"===n.fitbounds&&"geojson-id"===l){var y=i.computeBbox(i.getTraceGeojson(r));h=[y[0],y[2]],d=[y[1],y[3]]}var v={padded:!0};r._extremes.lon=o(n.lonaxis._ax,h,v),r._extremes.lat=o(n.lataxis._ax,d,v)},plot:function(t,e,i){var a=e.layers.backplot.select(".choroplethlayer");n.makeTraceGroups(a,i,"trace choropleth").each((function(e){var i=r.select(this).selectAll("path.choroplethlocation").data(n.identity);i.enter().append("path").classed("choroplethlocation",!0),i.exit().remove(),s(t,e)}))}}}}),Mg=d({"src/traces/choropleth/hover.js"(t,e){var r=nr(),n=wg(),i=se().fillText;e.exports=function(t,e,a){var o,s,l,c,u=t.cd,h=u[0].trace,d=t.subplot,p=[e,a],f=[e+360,a];for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(p)&&(c=!c),o._polygons[l].contains(f)&&(c=!c);if(c)break}if(c&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,t.zLabel=r.tickText(d.mockAxis,d.mockAxis.c2l(o.z),"hover").text,t.hovertemplate=o.hovertemplate,function(t,e,r){if(!e.hovertemplate){var a=r.hi||e.hoverinfo,o=String(r.loc),s="all"===a?n.hoverinfo.flags:a.split("+"),l=-1!==s.indexOf("name"),c=-1!==s.indexOf("location"),u=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),d=[];!l&&c?t.nameOverride=o:(l&&(t.nameOverride=e.name),c&&d.push(o)),u&&d.push(t.zLabel),h&&i(r,e,d),t.extraText=d.join("<br>")}}(t,h,o),[t]}}}),Cg=d({"src/traces/choropleth/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}}}),Eg=d({"src/traces/choropleth/select.js"(t,e){e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=c.c2p(i),e.contains([a,o],null,r,t)?(u.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return u}}}),Lg=d({"src/traces/choropleth/index.js"(t,e){e.exports={attributes:wg(),supplyDefaults:kg(),colorbar:No(),calc:Tg(),calcGeoJSON:Ag().calcGeoJSON,plot:Ag().plot,style:Sg().style,styleOnSelect:Sg().styleOnSelect,hoverPoints:Mg(),eventData:Cg(),selectPoints:Eg(),moduleType:"trace",name:"choropleth",basePlotModule:xg(),categories:["geo","noOpacity","showLegend"],meta:{}}}}),Pg=d({"lib/choropleth.js"(t,e){e.exports=Lg()}}),Ig=d({"src/traces/scattergl/hover.js"(t,e){var r=Vt(),n=se(),i=mi();function a(t,e,a,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,h=t.index,d={pointNumber:h,x:e[h],y:a[h]};d.tx=n.isArrayOrTypedArray(o.text)?o.text[h]:o.text,d.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,d.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,d.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var p=o.textfont;p&&(d.ts=n.isArrayOrTypedArray(p.size)?p.size[h]:p.size,d.tc=n.isArrayOrTypedArray(p.color)?p.color[h]:p.color,d.tf=Array.isArray(p.family)?p.family[h]:p.family,d.tw=Array.isArray(p.weight)?p.weight[h]:p.weight,d.ty=Array.isArray(p.style)?p.style[h]:p.style,d.tv=Array.isArray(p.variant)?p.variant[h]:p.variant);var f=o.marker;f&&(d.ms=n.isArrayOrTypedArray(f.size)?f.size[h]:f.size,d.mo=n.isArrayOrTypedArray(f.opacity)?f.opacity[h]:f.opacity,d.mx=n.isArrayOrTypedArray(f.symbol)?f.symbol[h]:f.symbol,d.ma=n.isArrayOrTypedArray(f.angle)?f.angle[h]:f.angle,d.mc=n.isArrayOrTypedArray(f.color)?f.color[h]:f.color);var m=f&&f.line;m&&(d.mlc=Array.isArray(m.color)?m.color[h]:m.color,d.mlw=n.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=f&&f.gradient;g&&"none"!==g.type&&(d.mgt=Array.isArray(g.type)?g.type[h]:g.type,d.mgc=Array.isArray(g.color)?g.color[h]:g.color);var y=s.c2p(d.x,!0),v=l.c2p(d.y,!0),x=d.mrc||1,b=o.hoverlabel;b&&(d.hbg=Array.isArray(b.bgcolor)?b.bgcolor[h]:b.bgcolor,d.hbc=Array.isArray(b.bordercolor)?b.bordercolor[h]:b.bordercolor,d.hts=n.isArrayOrTypedArray(b.font.size)?b.font.size[h]:b.font.size,d.htc=Array.isArray(b.font.color)?b.font.color[h]:b.font.color,d.htf=Array.isArray(b.font.family)?b.font.family[h]:b.font.family,d.hnl=n.isArrayOrTypedArray(b.namelength)?b.namelength[h]:b.namelength);var _=o.hoverinfo;_&&(d.hi=Array.isArray(_)?_[h]:_);var w=o.hovertemplate;w&&(d.ht=Array.isArray(w)?w[h]:w);var k={};k[t.index]=d;var T=o._origX,S=o._origY,A=n.extendFlat({},t,{color:i(o,d),x0:y-x,x1:y+x,xLabelVal:T?T[h]:d.x,y0:v-x,y1:v+x,yLabelVal:S?S[h]:d.y,cd:k,distance:c,spikeDistance:u,hovertemplate:d.ht});return d.htx?A.text=d.htx:d.tx?A.text=d.tx:o.text&&(A.text=o.text),n.fillText(d,o,A),r.getComponentMethod("errorbars","hoverInfo")(d,o,A),A}e.exports={hoverPoints:function(t,e,r,n){var i,o,s,l,c,u,h,d,p,f,m=t.cd,g=m[0].t,y=m[0].trace,v=t.xa,x=t.ya,b=g.x,_=g.y,w=v.c2p(e),k=x.c2p(r),T=t.distance;if(g.tree){var S=v.p2c(w-T),A=v.p2c(w+T),M=x.p2c(k-T),C=x.p2c(k+T);i="x"===n?g.tree.range(Math.min(S,A),Math.min(x._rl[0],x._rl[1]),Math.max(S,A),Math.max(x._rl[0],x._rl[1])):g.tree.range(Math.min(S,A),Math.min(M,C),Math.max(S,A),Math.max(M,C))}else i=g.ids;var E=T;if("x"===n){var L=!!y.xperiodalignment,P=!!y.yperiodalignment;for(u=0;u<i.length;u++){if(l=b[o=i[u]],h=Math.abs(v.c2p(l)-w),L){var I=v.c2p(y._xStarts[o]),z=v.c2p(y._xEnds[o]);h=w>=Math.min(I,z)&&w<=Math.max(I,z)?0:1/0}if(h<E){if(E=h,c=_[o],d=x.c2p(c)-k,P){var O=x.c2p(y._yStarts[o]),D=x.c2p(y._yEnds[o]);d=k>=Math.min(O,D)&&k<=Math.max(O,D)?0:1/0}f=Math.sqrt(h*h+d*d),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[o=i[u]],c=_[o],h=v.c2p(l)-w,d=x.c2p(c)-k,(p=Math.sqrt(h*h+d*d))<E&&(E=f=p,s=o);return t.index=s,t.distance=E,t.dxy=f,void 0===s?[t]:[a(t,b,_,y)]},calcHover:a}}}),zg=d({"src/traces/scattergl/constants.js"(t,e){e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}}),Og=d({"src/traces/scattergl/attributes.js"(t,e){var r=N(),n=R(),i=_n(),a=wn(),o=Ce().axisHoverFormat,s=Pe(),l=Wt(),c=D().extendFlat,u=Pt().overrideAll,h=zg().DASHES,d=a.line,p=a.marker,f=p.line,m=e.exports=u({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:d.color,width:d.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:l(h),dflt:"solid"}},marker:c({},s("marker"),{symbol:p.symbol,angle:p.angle,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:p.opacity,colorbar:p.colorbar,line:c({},s("marker.line"),{width:f.width})}),connectgaps:a.connectgaps,fill:c({},a.fill,{dflt:"none"}),fillcolor:i(),selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:r.opacity},"calc","nested");m.x.editType=m.y.editType=m.x0.editType=m.y0.editType="calc+clearAxisTypes",m.hovertemplate=a.hovertemplate,m.texttemplate=a.texttemplate}}),Dg=d({"src/traces/scattergl/helpers.js"(t){var e=zg();t.isOpenSymbol=function(t){return"string"===typeof t?e.OPEN_RE.test(t):t%200>100},t.isDotSymbol=function(t){return"string"===typeof t?e.DOT_RE.test(t):t>200}}}),Rg=d({"src/traces/scattergl/defaults.js"(t,e){var r=se(),n=Vt(),i=Dg(),a=Og(),o=bn(),s=Ge(),l=qn(),c=$n(),u=Wn(),h=Gn(),d=Xn(),p=Zn();e.exports=function(t,e,f,m){function g(n,i){return r.coerce(t,e,a,n,i)}var y=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=s.isBubble(t),x=l(t,e,m,g);if(x){c(t,e,m,g),g("xhoverformat"),g("yhoverformat");var b=x<o.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("hovertemplate"),g("mode",b),s.hasMarkers(e)&&(u(t,e,f,m,g,{noAngleRef:!0,noStandOff:!0}),g("marker.line.width",y||v?1:0)),s.hasLines(e)&&(g("connectgaps"),h(t,e,f,m,g),g("line.shape")),s.hasText(e)&&(g("texttemplate"),p(t,e,m,g,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var _=(e.line||{}).color,w=(e.marker||{}).color;g("fill"),"none"!==e.fill&&d(t,e,f,g);var k=n.getComponentMethod("errorbars","supplyDefaults");k(t,e,_||w||f,{axis:"y"}),k(t,e,_||w||f,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(e,g)}else e.visible=!1}}}),Fg=d({"src/traces/scattergl/format_labels.js"(t,e){var r=pi();e.exports=function(t,e,n){var i=t.i;return"x"in t||(t.x=e._x[i]),"y"in t||(t.y=e._y[i]),r(t,e,n)}}}),Bg=d({"node_modules/binary-search-bounds/search-bounds.js"(t,e){function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(t,e,r,n,i,a){return"function"===typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,n,i,a){return s(t,e,n,i,a,r)},gt:function(t,e,r,i,a){return s(t,e,r,i,a,n)},lt:function(t,e,r,n,a){return s(t,e,r,n,a,i)},le:function(t,e,r,n,i){return s(t,e,r,n,i,a)},eq:function(t,e,r,n,i){return s(t,e,r,n,i,o)}}}}),jg=d({"node_modules/pick-by-alias/index.js"(t,e){e.exports=function(t,e,r){var i,a,o={};if("string"===typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a<e.length;a++)s[e[a]]=!0;e=s}for(i in e)e[i]=n(e[i]);var l={};for(i in e){var c=e[i];if(Array.isArray(c))for(a=0;a<c.length;a++){var u=c[a];if(r&&(l[u]=!0),u in t){if(o[i]=t[u],r)for(var h=a;h<c.length;h++)l[c[h]]=!0;break}}else i in t&&(e[i]&&(o[i]=t[i]),r&&(l[i]=!0))}if(r)for(i in t)l[i]||(o[i]=t[i]);return o};var r={};function n(t){return r[t]?r[t]:("string"===typeof t&&(t=r[t]=t.split(/\s*,\s*|\s+/)),t)}}}),Ng=d({"node_modules/parse-rect/index.js"(t,e){var r=jg();e.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"===typeof t?t=t.split(/\s/).map(parseFloat):"number"===typeof t&&(t=[t]),t.length&&"number"===typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=r(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}}}),Ug=d({"node_modules/array-bounds/index.js"(t,e){e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var i=-1/0,a=1/0,o=n,s=t.length;o<s;o+=e)t[o]>i&&(i=t[o]),t[o]<a&&(a=t[o]);r[n]=a,r[e+n]=i}return r}}}),Vg=d({"node_modules/defined/index.js"(t,e){e.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}}}),qg=d({"node_modules/flatten-vertex-data/index.js"(t,e){var r=Bf();e.exports=function(t,e,n){if(!t)throw new TypeError("must specify data as first parameter");if(n=0|+(n||0),Array.isArray(t)&&t[0]&&"number"===typeof t[0][0]){var i,a,o,s,l=t[0].length,c=t.length*l;e&&"string"!==typeof e||(e=new(r(e||"float32"))(c+n));var u=e.length-n;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(i=0,o=n;i<t.length;i++)for(a=0;a<l;a++)e[o++]=null===t[i][a]?NaN:t[i][a]}else if(e&&"string"!==typeof e)e.set(t,n);else{var h=r(e||"float32");if(Array.isArray(t)||"array"===e)for(i=0,o=n,s=(e=new h(t.length+n)).length;o<s;o++,i++)e[o]=null===t[i]?NaN:t[i];else 0===n?e=new h(t):(e=new h(t.length+n)).set(t,n)}return e}}}),$g=d({"node_modules/is-obj/index.js"(t,e){e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}}}),Hg=d({"node_modules/math-log2/index.js"(t,e){e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}}}),Wg=d({"node_modules/@plotly/point-cluster/quad.js"(t,e){var r=Bg(),n=Ff(),i=Ng(),a=Ug(),o=jg(),s=Vg(),l=qg(),c=$g(),u=Bf(),h=Hg();function d(t,e){let[r,i,a,o]=e,s=1/(a-r),l=1/(o-i),c=new Array(t.length);for(let u=0,h=t.length/2;u<h;u++)c[2*u]=n((t[2*u]-r)*s,0,1),c[2*u+1]=n((t[2*u+1]-i)*l,0,1);return c}e.exports=function(t,e){e||(e={}),t=l(t,"float64"),e=o(e,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let n=s(e.maxDepth,255),p=s(e.bounds,a(t,2));p[0]===p[2]&&p[2]++,p[1]===p[3]&&p[3]++;let f,m=d(t,p),g=t.length>>>1;e.dtype||(e.dtype="array"),"string"===typeof e.dtype?f=new(u(e.dtype))(g):e.dtype&&(f=e.dtype,Array.isArray(f)&&(f.length=g));for(let r=0;r<g;++r)f[r]=r;let y=[],v=[],x=[],b=[];!function t(e,r,i,a,o,s){if(!a.length)return null;let l=y[o]||(y[o]=[]),c=x[o]||(x[o]=[]),u=v[o]||(v[o]=[]),h=l.length;if(++o>n||s>1073741824){for(let t=0;t<a.length;t++)l.push(a[t]),c.push(s),u.push(null,null,null,null);return h}if(l.push(a[0]),c.push(s),a.length<=1)return u.push(null,null,null,null),h;let d=.5*i,p=e+d,f=r+d,g=[],b=[],_=[],w=[];for(let n=1,y=a.length;n<y;n++){let t=a[n],e=m[2*t],r=m[2*t+1];e<p?r<f?g.push(t):b.push(t):r<f?_.push(t):w.push(t)}return s<<=2,u.push(t(e,r,d,g,o,s),t(e,f,d,b,o,s+1),t(p,r,d,_,o,s+2),t(p,f,d,w,o,s+3)),h}(0,0,1,f,0,1);let _=0;for(let r=0;r<y.length;r++){let t=y[r];if(f.set)f.set(t,_);else for(let r=0,n=t.length;r<n;r++)f[r+_]=t[r];let e=_+y[r].length;b[r]=[_,e],_=e}return f.range=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];let l;if(c(n[n.length-1])){let t=n.pop();n.length||null==t.x&&null==t.l&&null==t.left||(n=[t],l={}),l=o(t,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else l={};n.length||(n=p);let u=i(...n),[f,m,g,_]=[Math.min(u.x,u.x+u.width),Math.min(u.y,u.y+u.height),Math.max(u.x,u.x+u.width),Math.max(u.y,u.y+u.height)],[k,T,S,A]=d([f,m,g,_],p),M=s(l.level,y.length);if(null!=l.d){let t;"number"===typeof l.d?t=[l.d,l.d]:l.d.length&&(t=l.d),M=Math.min(Math.max(Math.ceil(-h(Math.abs(t[0])/(p[2]-p[0]))),Math.ceil(-h(Math.abs(t[1])/(p[3]-p[1])))),M)}if(M=Math.min(M,y.length),l.lod)return function(t,e,n,i,a){let o=[];for(let s=0;s<a;s++){let a=x[s],l=b[s][0],c=w(t,e,s),u=w(n,i,s),h=r.ge(a,c),d=r.gt(a,u,h,a.length-1);o[s]=[h+l,d+l]}return o}(k,T,S,A,M);let C=[];return function e(r,n,i,a,o,s){if(null===o||null===s)return;let l=n+i;if(k>r+i||T>l||S<r||A<n)return;if(a>=M)return;if(o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let y=o;y<s;y++){let e=c[y],r=t[2*e],n=t[2*e+1];r>=f&&r<=g&&n>=m&&n<=_&&C.push(e)}let u=v[a],h=u[4*o+0],d=u[4*o+1],p=u[4*o+2],x=u[4*o+3],b=function(t,e){let r=null,n=0;for(;null===r;)if(r=t[4*e+n],n++,n>t.length)return null;return r}(u,o+1),w=.5*i,E=a+1;e(r,n,w,E,h,d||p||x||b),e(r,n+w,w,E,d,p||x||b),e(r+w,n,w,E,p,x||b),e(r+w,n+w,w,E,x,b)}(0,0,1,0,0,1),C},f;function w(t,e,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s<r;s++)n<<=2,n+=t<i?e<a?0:1:e<a?2:3,o*=.5,i+=t<i?-o:o,a+=e<a?-o:o;return n}}}}),Gg=d({"node_modules/@plotly/point-cluster/index.js"(t,e){e.exports=Wg()}}),Yg=d({"node_modules/abs-svg-path/index.js"(t,e){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map((function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=i}switch(o){case"Z":n=e,i=r;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":n=e=t[1],i=r=t[2];break;default:n=t[t.length-2],i=t[t.length-1]}return t}))}}}),Zg=d({"node_modules/svg-arc-to-cubic-bezier/cjs/index.js"(t,e){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(l){i=!0,a=l}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=2*Math.PI,i=function(t,e,r,n,i,a,o){var s=t.x,l=t.y;return{x:n*(s*=e)-i*(l*=r)+a,y:i*s+n*l+o}},a=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(t),i=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},o=function(t,e,r,n){var i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};t.default=function(t){var e=t.px,s=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,d=t.xAxisRotation,p=void 0===d?0:d,f=t.largeArcFlag,m=void 0===f?0:f,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===h)return[];var x=Math.sin(p*n/360),b=Math.cos(p*n/360),_=b*(e-l)/2+x*(s-c)/2,w=-x*(e-l)/2+b*(s-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var k=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);k>1&&(u*=Math.sqrt(k),h*=Math.sqrt(k));var T=function(t,e,r,i,a,s,l,c,u,h,d,p){var f=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(d,2),y=Math.pow(p,2),v=f*m-f*y-m*g;v<0&&(v=0),v/=f*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*a/s*p,b=v*-s/a*d,_=h*x-u*b+(t+r)/2,w=u*x+h*b+(e+i)/2,k=(d-x)/a,T=(p-b)/s,S=(-d-x)/a,A=(-p-b)/s,M=o(1,0,k,T),C=o(k,T,S,A);return 0===c&&C>0&&(C-=n),1===c&&C<0&&(C+=n),[_,w,M,C]}(e,s,l,c,u,h,m,y,x,b,_,w),S=r(T,4),A=S[0],M=S[1],C=S[2],E=S[3],L=Math.abs(E)/(n/4);Math.abs(1-L)<1e-7&&(L=1);var P=Math.max(Math.ceil(L),1);E/=P;for(var I=0;I<P;I++)v.push(a(C,E)),C+=E;return v.map((function(t){var e=i(t[0],u,h,b,x,A,M),r=e.x,n=e.y,a=i(t[1],u,h,b,x,A,M),o=a.x,s=a.y,l=i(t[2],u,h,b,x,A,M);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}}))},e.exports=t.default}}),Xg=d({"node_modules/svg-path-bounds/node_modules/normalize-svg-path/index.js"(t,e){e.exports=function(t){for(var e,a=[],o=0,s=0,l=0,c=0,u=null,h=null,d=0,p=0,f=0,m=t.length;f<m;f++){var g=t[f],y=g[0];switch(y){case"M":l=g[1],c=g[2];break;case"A":var v=r({px:d,py:p,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var x,b=0;b<v.length;b++)g=["C",(x=v[b]).x1,x.y1,x.x2,x.y2,x.x,x.y],b<v.length-1&&a.push(g);break;case"S":var _=d,w=p;"C"!=e&&"S"!=e||(_+=_-o,w+=w-s),g=["C",_,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==e||"T"==e?(u=2*d-u,h=2*p-h):(u=d,h=p),g=i(d,p,u,h,g[1],g[2]);break;case"Q":u=g[1],h=g[2],g=i(d,p,g[1],g[2],g[3],g[4]);break;case"L":g=n(d,p,g[1],g[2]);break;case"H":g=n(d,p,g[1],p);break;case"V":g=n(d,p,d,g[1]);break;case"Z":g=n(d,p,l,c)}e=y,d=g[g.length-2],p=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=d,s=p),a.push(g)}return a};var r=Zg();function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),Kg=d({"node_modules/is-svg-path/index.js"(t,e){e.exports=function(t){return"string"===typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}}),Jg=d({"node_modules/svg-path-bounds/index.js"(t,e){var r=Xe(),n=Yg(),i=Xg(),a=Kg(),o=ru();e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"===typeof t[0]&&(t=t[0]),"string"===typeof t&&(o(a(t),"String is not an SVG path."),t=r(t)),o(Array.isArray(t),"Argument should be a string or an array of path segments."),t=n(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;s<l;s++)for(var c=t[s].slice(1),u=0;u<c.length;u+=2)c[u+0]<e[0]&&(e[0]=c[u+0]),c[u+1]<e[1]&&(e[1]=c[u+1]),c[u+0]>e[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}}}),Qg=d({"node_modules/normalize-svg-path/index.js"(t,e){var r=Math.PI,n=l(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(t,e,i,a,l,c,u,h,d,p){if(p)k=p[0],T=p[1],_=p[2],w=p[3];else{var f=s(t,e,-l);t=f.x,e=f.y;var m=(t-(h=(f=s(h,d,-l)).x))/2,g=(e-(d=f.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));b==1/0&&(b=1);var _=b*i*g/a+(t+h)/2,w=b*-a*m/i+(e+d)/2,k=Math.asin(((e-w)/a).toFixed(9)),T=Math.asin(((d-w)/a).toFixed(9));(k=t<_?r-k:k)<0&&(k=2*r+k),(T=h<_?r-T:T)<0&&(T=2*r+T),u&&k>T&&(k-=2*r),!u&&T>k&&(T-=2*r)}if(Math.abs(T-k)>n){var S=T,A=h,M=d;T=k+n*(u&&T>k?1:-1);var C=o(h=_+i*Math.cos(T),d=w+a*Math.sin(T),i,a,l,0,u,A,M,[T,S,_,w])}var E=Math.tan((T-k)/4),L=4/3*i*E,P=4/3*a*E,I=[2*t-(t+L*Math.sin(k)),2*e-(e-P*Math.cos(k)),h+L*Math.sin(T),d-P*Math.cos(T),h,d];if(p)return I;C&&(I=I.concat(C));for(var z=0;z<I.length;){var O=s(I[z],I[z+1],l);I[z++]=O.x,I[z++]=O.y}return I}function s(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function l(t){return t*(r/180)}e.exports=function(t){for(var e,r=[],n=0,s=0,c=0,u=0,h=null,d=null,p=0,f=0,m=0,g=t.length;m<g;m++){var y=t[m],v=y[0];switch(v){case"M":c=y[1],u=y[2];break;case"A":(y=o(p,f,y[1],y[2],l(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,b=f;"C"!=e&&"S"!=e||(x+=x-n,b+=b-s),y=["C",x,b,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*p-h,d=2*f-d):(h=p,d=f),y=a(p,f,h,d,y[1],y[2]);break;case"Q":h=y[1],d=y[2],y=a(p,f,y[1],y[2],y[3],y[4]);break;case"L":y=i(p,f,y[1],y[2]);break;case"H":y=i(p,f,y[1],f);break;case"V":y=i(p,f,p,y[1]);break;case"Z":y=i(p,f,c,u)}e=v,p=y[y.length-2],f=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=p,s=f),r.push(y)}return r}}}),ty=d({"node_modules/draw-svg-path/index.js"(t,e){var r=Yg(),n=Qg(),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),n(r(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}}}),ey=d({"node_modules/bitmap-sdf/index.js"(t,e){var r=Ff();e.exports=function(t,e){e||(e={});var a,o,s,l,c,u,h,d,p,f,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");a=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/a/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(d=t).getContext("2d"),a=d.width,o=d.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,a=(d=t.canvas).width,o=d.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,a=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),f=0,m=c.length;f<m;f++)l[f]=c[f*u+v]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var x=Array(a*o),b=Array(a*o),_=Array(s),w=Array(s),k=Array(s+1),T=Array(s);for(f=0,m=a*o;f<m;f++){var S=l[f];x[f]=1===S?0:0===S?n:Math.pow(Math.max(0,.5-S),2),b[f]=1===S?n:0===S?0:Math.pow(Math.max(0,S-.5),2)}i(x,a,o,_,w,T,k),i(b,a,o,_,w,T,k);var A=window.Float32Array?new Float32Array(a*o):new Array(a*o);for(f=0,m=a*o;f<m;f++)A[f]=r(1-((x[f]-b[f])/y+g),0,1);return A};var n=1e20;function i(t,e,r,n,i,o,s){for(var l=0;l<e;l++){for(var c=0;c<r;c++)n[c]=t[c*e+l];for(a(n,i,o,s,r),c=0;c<r;c++)t[c*e+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<e;l++)n[l]=t[c*e+l];for(a(n,i,o,s,e),l=0;l<e;l++)t[c*e+l]=Math.sqrt(i[l])}}function a(t,e,r,i,a){r[0]=0,i[0]=-n,i[1]=+n;for(var o=1,s=0;o<a;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=i[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=l,i[s+1]=+n}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}}}),ry=d({"node_modules/svg-path-sdf/index.js"(t,e){var r,n=Jg(),i=Xe(),a=ty(),o=Kg(),s=ey(),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");var u,h;e||(e={}),e.shape?(u=e.shape[0],h=e.shape[1]):(u=l.width=e.w||e.width||200,h=l.height=e.h||e.height||200);var d=Math.min(u,h),p=e.stroke||0,f=e.viewbox||e.viewBox||n(t),m=[u/(f[2]-f[0]),h/(f[3]-f[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,h),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return r=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var n=t.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(t);c.fill(y),p&&c.stroke(y)}else{var v=i(t);a(c,v),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*d})}}}),ny=d({"src/traces/scattergl/convert.js"(t,e){var r=k(),n=ry(),i=jf(),a=Vt(),o=se(),s=o.isArrayOrTypedArray,l=Je(),c=ve(),u=Uf().formatColor,h=Ge(),d=Ye(),p=Dg(),f=zg(),m=$().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Ze().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,c=e.textposition,u=s(c)?c:[c],h=l.color,d=l.size,p=l.family,f=l.weight,m=l.style,g=l.variant,v={},b=t._context.plotGlPixelRatio,_=e.texttemplate;if(_){v.text=[];var w=i._d3locale,k=Array.isArray(_),T=k?Math.min(_.length,a):a,S=k?function(t){return _[t]}:function(){return _};for(n=0;n<T;n++){var A={i:n},M=e._module.formatLabels(A,e,i),C={};y(C,e,n);var E=e._meta||{};v.text.push(o.texttemplateString(S(n),M,w,C,A,E))}}else s(e.text)&&e.text.length<a?v.text=e.text.slice():v.text=e.text;if(s(v.text))for(n=v.text.length;n<a;n++)v.text[n]="";for(v.opacity=e.opacity,v.font={},v.align=[],v.baseline=[],n=0;n<u.length;n++){var L=u[n].split(/\s+/);switch(L[1]){case"left":v.align.push("right");break;case"right":v.align.push("left");break;default:v.align.push(L[1])}switch(L[0]){case"top":v.baseline.push("bottom");break;case"bottom":v.baseline.push("top");break;default:v.baseline.push(L[0])}}if(s(h))for(v.color=new Array(a),n=0;n<a;n++)v.color[n]=h[n];else v.color=h;if(s(d)||Array.isArray(p)||s(f)||Array.isArray(m)||Array.isArray(g))for(v.font=new Array(a),n=0;n<a;n++){var P=v.font[n]={};P.size=(o.isTypedArray(d)?d[n]:s(d)?r(d[n])?d[n]:0:d)*b,P.family=Array.isArray(p)?p[n]:p,P.weight=x(s(f)?f[n]:f),P.style=Array.isArray(m)?m[n]:m,P.variant=Array.isArray(g)?g[n]:g}else v.font={size:d*b,family:p,weight:x(f),style:m,variant:g};return v}function x(t){return t<=1e3?t>500?"bold":"normal":t}function b(t,e){var r,n,a=e._length,o=e.marker,l={},c=s(o.symbol),h=s(o.angle),f=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=p.isOpenSymbol(o.symbol)),c||f||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,b=o.angle,_=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var k=w;for(w=Array(a),r=0;r<a;r++)w[r]=k}if(!s(_[0])){var T=_;for(_=Array(a),r=0;r<a;r++)_[r]=T}if(!s(x)){var S=x;for(x=Array(a),r=0;r<a;r++)x[r]=S}if(!s(b)){var A=b;for(b=Array(a),r=0;r<a;r++)b[r]=A}for(l.symbols=x,l.angles=b,l.colors=_,l.borderColors=w,r=0;r<a;r++)c&&(n=p.isOpenSymbol(o.symbol[r])),n&&(w[r]=_[r].slice(),_[r]=_[r].slice(),_[r][3]=0);for(l.opacity=e.opacity,l.markers=new Array(a),r=0;r<a;r++)l.markers[r]=L({mx:l.symbols[r],ma:l.angles[r]},e)}else n?(l.color=i(o.color,"uint8"),l.color[3]=0,l.borderColor=i(o.color,"uint8")):(l.color=i(o.color,"uint8"),l.borderColor=i(o.line.color,"uint8")),l.opacity=e.opacity*o.opacity,l.marker=L({mx:o.symbol,ma:o.angle},e);var M,C=d(e,1);if(y||v){var E,P=l.sizes=new Array(a),I=l.borderSizes=new Array(a),z=0;if(y){for(r=0;r<a;r++)P[r]=C(o.size[r]),z+=P[r];E=z/a}else for(M=C(o.size),r=0;r<a;r++)P[r]=M;if(v)for(r=0;r<a;r++)I[r]=o.line.width[r];else for(M=o.line.width,r=0;r<a;r++)I[r]=M;l.sizeAvg=E}else l.size=C(o&&o.size||10),l.borderSizes=C(o.line.width);return l}function _(t,e,r){var n=e.marker,i={};return r?(r.marker&&r.marker.symbol?i=b(0,o.extendFlat({},n,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),void 0!==r.marker.opacity&&(i.opacity=r.marker.opacity)),i):i}function w(t,e,r){var n={};if(!r)return n;if(r.textfont){var i={opacity:1,text:e.text,texttemplate:e.texttemplate,textposition:e.textposition,textfont:o.extendFlat({},e.textfont)};r.textfont&&o.extendFlat(i.textfont,r.textfont),n=v(t,i)}return n}function T(t,e,r){var n={capSize:2*e.width*r,lineWidth:e.thickness*r,color:e.color};return e.copy_ystyle&&(n=t.error_y),n}var S=f.SYMBOL_SDF_SIZE,A=f.SYMBOL_SIZE,M=f.SYMBOL_STROKE,C={},E=l.symbolFuncs[0](.05*A);function L(t,e){var r,i,a=t.mx;if("circle"===a)return null;var o=l.symbolNumber(a),s=l.symbolFuncs[o%100],c=!!l.symbolNoDot[o%100],u=!!l.symbolNoFill[o%100],h=p.isDotSymbol(a);if(t.ma&&(a+="_"+t.ma),C[a])return C[a];var d=l.getMarkerAngle(t,e);return r=h&&!c?s(1.1*A,d)+E:s(A,d),i=n(r,{w:S,h:S,viewBox:[-A,-A,A,A],stroke:u?M:-M}),C[a]=i,i||null}e.exports={style:function(t,e){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=t._context.plotGlPixelRatio;if(!0!==e.visible)return n;if(h.hasText(e)&&(n.text=v(t,e),n.textSel=w(t,e,e.selected),n.textUnsel=w(t,e,e.unselected)),h.hasMarkers(e)&&(n.marker=b(0,e),n.markerSel=_(0,e,e.selected),n.markerUnsel=_(0,e,e.unselected),!e.unselected&&s(e.marker.opacity))){var a=e.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=m*a[r]}if(h.hasLines(e)){n.line={overlay:!0,thickness:e.line.width*i,color:e.line.color,opacity:e.opacity};var o=(f.DASHES[e.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=e.line.width*i;n.line.dashes=o}return e.error_x&&e.error_x.visible&&(n.errorX=T(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(n.errorY=T(e,e.error_y,i)),e.fill&&"none"!==e.fill&&(n.fill={closed:!0,fill:e.fillcolor,thickness:0}),n},markerStyle:b,markerSelection:_,linePositions:function(t,e,r){var n,i,a=r.length,o=a/2;if(h.hasLines(e)&&o)if("hv"===e.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i+2],r[2*i+1]));n.push(r[a-2],r[a-1])}else if("hvh"===e.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var s=(r[2*i]+r[2*i+2])/2;n.push(r[2*i],r[2*i+1],s,r[2*i+1],s,r[2*i+3])}n.push(r[a-2],r[a-1])}else if("vhv"===e.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var l=(r[2*i+1]+r[2*i+3])/2;n.push(r[2*i],r[2*i+1],r[2*i],l,r[2*i+2],l)}n.push(r[a-2],r[a-1])}else if("vh"===e.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+3]));n.push(r[a-2],r[a-1])}else n=r;var c=!1;for(i=0;i<n.length;i++)if(isNaN(n[i])){c=!0;break}var u=c||n.length>f.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var d=n[0],p=n[1];for(i=0;i<n.length;i+=2)isNaN(n[i])||isNaN(n[i+1])?(n[i]=d,n[i+1]=p):(d=n[i],p=n[i+1])}return{join:u,positions:n}},errorBarPositions:function(t,e,n,i,o){var s=a.getComponentMethod("errorbars","makeComputeError"),l=c.getFromId(t,e.xaxis,"x"),u=c.getFromId(t,e.yaxis,"y"),h=n.length/2,d={};function p(t,i){var a=i._id.charAt(0),o=e["error_"+a];if(o&&o.visible&&("linear"===i.type||"log"===i.type)){for(var l=s(o),c={x:0,y:1}[a],u={x:[0,1,2,3],y:[2,3,0,1]}[a],p=new Float64Array(4*h),f=1/0,m=-1/0,g=0,y=0;g<h;g++,y+=4){var v=t[g];if(r(v)){var x=n[2*g+c],b=l(v,g),_=b[0],w=b[1];if(r(_)&&r(w)){var k=v-_,T=v+w;p[y+u[0]]=x-i.c2l(k),p[y+u[1]]=i.c2l(T)-x,p[y+u[2]]=0,p[y+u[3]]=0,f=Math.min(f,v-_),m=Math.max(m,v+w)}}}d[a]={positions:n,errors:p,_bnds:[f,m]}}}return p(i,l),p(o,u),d},textPosition:function(t,e,r,n){var i,a=e._length,o={};if(h.hasMarkers(e)){var l=r.font,c=r.align,u=r.baseline;for(o.offset=new Array(a),i=0;i<a;i++){var d=n.sizes?n.sizes[i]:n.size,p=s(l)?l[i].size:l.size,f=s(c)?c.length>1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[f],v=g[m],x=d?d/.8+1:0,b=-v*x-.5*v;o.offset[i]=[y*x/p,b/p]}}return o}}}}),iy=d({"src/traces/scattergl/scene_update.js"(t,e){var r=se();e.exports=function(t,e){var n=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((n=e._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(t){var e=r.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(e),n.scatter2d&&n.scatter2d.update(e),n.line2d&&n.line2d.update(e),n.error2d&&n.error2d.update(e.concat(e)),n.select2d&&n.select2d.update(e),n.glText)for(var i=0;i<n.count;i++)n.glText[i].update(t)},n.draw=function(){for(var t=n.count,e=n.fill2d,i=n.error2d,a=n.line2d,o=n.scatter2d,s=n.glText,l=n.select2d,c=n.selectBatch,u=n.unselectBatch,h=0;h<t;h++){if(e&&n.fillOrder[h]&&e.draw(n.fillOrder[h]),a&&n.lineOptions[h]&&a.draw(h),i&&(n.errorXOptions[h]&&i.draw(h),n.errorYOptions[h]&&i.draw(h+t)),o&&n.markerOptions[h])if(u[h].length){var d=r.repeat([],n.count);d[h]=u[h],o.draw(d)}else c[h].length||o.draw(h);s[h]&&n.textOptions[h]&&s[h].render()}l&&l.draw(c),n.dirty=!1},n.destroy=function(){n.fill2d&&n.fill2d.destroy&&n.fill2d.destroy(),n.scatter2d&&n.scatter2d.destroy&&n.scatter2d.destroy(),n.error2d&&n.error2d.destroy&&n.error2d.destroy(),n.line2d&&n.line2d.destroy&&n.line2d.destroy(),n.select2d&&n.select2d.destroy&&n.select2d.destroy(),n.glText&&n.glText.forEach((function(t){t.destroy&&t.destroy()})),n.lineOptions=null,n.fillOptions=null,n.markerOptions=null,n.markerSelectedOptions=null,n.markerUnselectedOptions=null,n.errorXOptions=null,n.errorYOptions=null,n.textOptions=null,n.textSelectedOptions=null,n.textUnselectedOptions=null,n.selectBatch=null,n.unselectBatch=null,e._scene=null}),n.dirty||r.extendFlat(n,i),n}}}),ay=d({"src/traces/scattergl/calc.js"(t,e){var r=Gg(),n=se(),i=ve(),a=rr().findExtremes,o=ei(),s=ai(),l=s.calcMarkerSize,c=s.calcAxisExpansion,u=s.setFirstScatter,h=ri(),d=ny(),p=iy(),f=T().BADNUM,m=zg().TOO_MANY_POINTS;function g(t,e,r){var n=t._extremes[e._id],i=a(e,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}e.exports=function(t,e){var a,s=t._fullLayout,y=e._xA=i.getFromId(t,e.xaxis,"x"),v=e._yA=i.getFromId(t,e.yaxis,"y"),x=s._plots[e.xaxis+e.yaxis],b=e._length,_=b>=m,w=2*b,k={},T=y.makeCalcdata(e,"x"),S=v.makeCalcdata(e,"y"),A=o(e,y,"x",T),M=o(e,v,"y",S),C=A.vals,E=M.vals;e._x=C,e._y=E,e.xperiodalignment&&(e._origX=T,e._xStarts=A.starts,e._xEnds=A.ends),e.yperiodalignment&&(e._origY=S,e._yStarts=M.starts,e._yEnds=M.ends);var L=new Array(w),P=new Array(b);for(a=0;a<b;a++)L[2*a]=C[a]===f?NaN:C[a],L[2*a+1]=E[a]===f?NaN:E[a],P[a]=a;if("log"===y.type)for(a=0;a<w;a+=2)L[a]=y.c2l(L[a]);if("log"===v.type)for(a=1;a<w;a+=2)L[a]=v.c2l(L[a]);_&&"log"!==y.type&&"log"!==v.type?k.tree=r(L):k.ids=P,h(t,e);var I,z=function(t,e,r,i,a,o){var s=d.style(t,r);if(s.marker&&(s.marker.positions=i),s.line&&i.length>1&&n.extendFlat(s.line,d.linePositions(t,r,i)),s.errorX||s.errorY){var l=d.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},d.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},d.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},d.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,L,C,E),O=p(t,x);return u(s,e),_?z.marker&&(I=z.marker.sizeAvg||Math.max(z.marker.size,3)):I=l(e,b),c(t,e,y,v,C,E,I),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!O.fill2d&&(O.fill2d=!0),z.marker&&!O.scatter2d&&(O.scatter2d=!0),z.line&&!O.line2d&&(O.line2d=!0),!z.errorX&&!z.errorY||O.error2d||(O.error2d=!0),z.text&&!O.glText&&(O.glText=!0),z.marker&&(z.marker.snap=b),O.lineOptions.push(z.line),O.errorXOptions.push(z.errorX),O.errorYOptions.push(z.errorY),O.fillOptions.push(z.fill),O.markerOptions.push(z.marker),O.markerSelectedOptions.push(z.markerSel),O.markerUnselectedOptions.push(z.markerUnsel),O.textOptions.push(z.text),O.textSelectedOptions.push(z.textSel),O.textUnselectedOptions.push(z.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=C,k.y=E,k.positions=L,O.count++,[{x:!1,y:!1,t:k,trace:e}]}}}),oy=d({"src/traces/scattergl/edit_style.js"(t,e){var r=se(),n=q(),i=$().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],d=c.unselectBatch[u],p=c.textOptions[u],f=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},p);if(h.length||d.length){var y=f.color,v=m.color,x=p.color,b=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),e=0;e<h.length;e++)a=h[e],g.color[a]=y||(b?x[a]:x);for(e=0;e<d.length;e++){a=d[e];var _=b?x[a]:x;g.color[a]=v||(y?_:n.addOpacity(_,i))}}c.glText[u].update(g)}}}}),sy=d({"src/traces/scattergl/select.js"(t,e){var r=Ge(),n=oy().styleTextSelection;e.exports=function(t,e){var i=t.cd,a=t.xaxis,o=t.yaxis,s=[],l=i[0].trace,c=i[0].t,u=l._length,h=c.x,d=c.y,p=c._scene,f=c.index;if(!p)return s;var m=r.hasText(l),g=r.hasMarkers(l),y=!g&&!m;if(!0!==l.visible||y)return s;var v=[],x=[];if(!1!==e&&!e.degenerate)for(var b=0;b<u;b++)e.contains([c.xpx[b],c.ypx[b]],!1,b,t)?(v.push(b),s.push({pointNumber:b,x:a.c2d(h[b]),y:o.c2d(d[b])})):x.push(b);if(g){var _=p.scatter2d;if(v.length||x.length){if(!p.selectBatch[f].length&&!p.unselectBatch[f].length){var w=new Array(p.count);w[f]=p.markerUnselectedOptions[f],_.update.apply(_,w)}}else{var k=new Array(p.count);k[f]=p.markerOptions[f],_.update.apply(_,k)}}return p.selectBatch[f]=v,p.unselectBatch[f]=x,m&&n(i),s}}}),ly=d({"src/traces/scattergl/base_index.js"(t,e){var r=Ig();e.exports={moduleType:"trace",name:"scattergl",basePlotModule:Ai(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Og(),supplyDefaults:Rg(),crossTraceDefaults:Qn(),colorbar:di(),formatLabels:Fg(),calc:ay(),hoverPoints:r.hoverPoints,selectPoints:sy(),meta:{}}}}),cy=d({"node_modules/color-id/index.js"(t,e){var r=Ff();function n(t,e){null==e&&(e=!0);var n=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(n*=255,i*=255,a*=255,o*=255),16777216*(n=255&r(n,0,255))+((i=255&r(i,0,255))<<16)+((a=255&r(a,0,255))<<8)+(o=255&r(o,0,255))}e.exports=n,e.exports.to=n,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),uy=d({"node_modules/object-assign/index.js"(t,e){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var a,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(s[c]=a[c]);if(r){o=r(a);for(var u=0;u<o.length;u++)i.call(a,o[u])&&(s[o[u]]=a[o[u]])}}return s}}}),hy=d({"node_modules/glslify/browser.js"(t,e){e.exports=function(t){"string"===typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}}}),dy=d({"node_modules/update-diff/index.js"(t,e){e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n<i;n++){var a=r[n];for(var o in a)if((void 0===e[o]||Array.isArray(e[o])||t[o]!==e[o])&&o in e){var s;if(!0===a[o])s=e[o];else{if(!1===a[o])continue;if("function"===typeof a[o]&&void 0===(s=a[o](e[o],t,e)))continue}t[o]=s}}return t}}}),py=d({"node_modules/is-iexplorer/index.js"(t,e){e.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}}),fy=d({"node_modules/to-float32/index.js"(t,e){e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=n(t));for(var r=0,i=e.length;r<i;r++)e[r]=t[r]-e[r];return e}return n(t-n(t))};var r=new Float32Array(1);function n(t){return t.length?t instanceof Float32Array?t:new Float32Array(t):(r[0]=t,r[0])}}}),my=d({"node_modules/regl-scatter2d/bundle.js"(t,e){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"===typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=jf(),s=Ug(),l=cy(),c=Gg(),u=uy(),h=hy(),d=jg(),p=dy(),f=qg(),m=py(),g=fy(),y=Ng(),v=x;function x(t,e){var r=this;if(!(this instanceof x))return new x(t,e);"function"===typeof t?(e||(e={}),e.regl=t):(e=t,t=null),e&&e.length&&(e.positions=e);var n,i=(t=e.regl)._gl,a=[],o=255;this.tooManyColors=m,n=t.texture({data:new Uint8Array(1020),width:o,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),u(this,{regl:t,gl:i,groups:[],markerCache:[null],markerTextures:[null],palette:a,paletteIds:{},paletteTexture:n,maxColors:o,maxSize:100,canvas:i.canvas}),this.update(e);var s={uniforms:{constPointSize:!!e.constPointSize,opacity:t.prop("opacity"),paletteSize:function(t,e){return[r.tooManyColors?0:o,n.height]},pixelRatio:t.context("pixelRatio"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),markerTexture:t.prop("markerTexture"),paletteTexture:n},attributes:{x:function(t,e){return e.xAttr||{buffer:e.positionBuffer,stride:8,offset:0}},y:function(t,e){return e.yAttr||{buffer:e.positionBuffer,stride:8,offset:4}},xFract:function(t,e){return e.xAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:0}},yFract:function(t,e){return e.yAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:4}},size:function(t,e){return e.size.length?{buffer:e.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*e.size/r.maxSize)]}},borderSize:function(t,e){return e.borderSize.length?{buffer:e.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*e.borderSize/r.maxSize)]}},colorId:function(t,e){return e.color.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?a.slice(4*e.color,4*e.color+4):[e.color]}},borderColorId:function(t,e){return e.borderColor.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?a.slice(4*e.borderColor,4*e.borderColor+4):[e.borderColor]}},isActive:function(t,e){return!0===e.activation?{constant:[1]}:e.activation?e.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:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"},l=u({},s);l.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\nuniform sampler2D markerTexture;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pointSizeScale;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),this.drawMarker=t(l);var c=u({},s);c.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nuniform float opacity;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(c)}x.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},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var a=0;a<r.length;a++)this.drawItem(a,r[a]);else i.forEach((function(e,r){t.drawItem(r)}));return this},x.prototype.drawItem=function(t,e){var r=this.groups,i=r[t];if("number"===typeof e&&(t=e,i=r[e],e=null),i&&i.count&&i.opacity){i.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,i,e));for(var a=[],o=1;o<i.activation.length;o++)i.activation[o]&&(!0===i.activation[o]||i.activation[o].data.length)&&a.push.apply(a,n(this.getMarkerDrawOptions(o,i,e)));a.length&&this.drawMarker(a)}},x.prototype.getMarkerDrawOptions=function(t,e,n){var i=e.range,a=e.tree,o=e.viewport,s=e.activation,l=e.selectionBuffer,c=e.count;if(this.regl,!a)return n?[u({},e,{markerTexture:this.markerTextures[t],activation:s[t],count:n.length,elements:n,offset:0})]:[u({},e,{markerTexture:this.markerTextures[t],activation:s[t],offset:0})];var h=[],d=a.range(i,{lod:!0,px:[(i[2]-i[0])/o.width,(i[3]-i[1])/o.height]});if(n){for(var p=s[t].data,f=new Uint8Array(c),m=0;m<n.length;m++){var g=n[m];f[g]=p?p[g]:1}l.subdata(f)}for(var y=d.length;y--;){var v=r(d[y],2),x=v[0],b=v[1];h.push(u({},e,{markerTexture:this.markerTextures[t],activation:n?l:s[t],offset:x,count:b-x}))}return h},x.prototype.update=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var i=this.groups,a=this.gl,o=this.regl,l=this.maxSize,h=this.maxColors,m=this.palette;this.groups=i=r.map((function(e,r){var n=i[r];if(void 0===e)return n;null===e?e={positions:null}:"function"===typeof e?e={ondraw:e}:"number"===typeof e[0]&&(e={positions:e}),null===(e=d(e,{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"})).positions&&(e.positions=[]),null!=e.tooManyColors&&(t.tooManyColors=e.tooManyColors),n||(i[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},e=u({},x.defaults,e)),e.positions&&!("marker"in e)&&(e.marker=n.marker,delete n.marker),e.marker&&!("positions"in e)&&(e.positions=n.positions,delete n.positions);var v=0,b=0;if(p(n,e,[{snap:!0,size:function(t,e){return null==t&&(t=x.defaults.size),v+=t&&t.length?1:0,t},borderSize:function(t,e){return null==t&&(t=x.defaults.borderSize),v+=t&&t.length?1:0,t},opacity:parseFloat,color:function(e,r){return null==e&&(e=x.defaults.color),e=t.updateColor(e),b++,e},borderColor:function(e,r){return null==e&&(e=x.defaults.borderColor),e=t.updateColor(e),b++,e},bounds:function(t,e,r){return"range"in r||(r.range=null),t},positions:function(t,e,r){var n=e.snap,i=e.positionBuffer,a=e.positionFractBuffer,l=e.selectionBuffer;if(t.x||t.y)return t.x.length?e.xAttr={buffer:o.buffer(t.x),offset:0,stride:4,count:t.x.length}:e.xAttr={buffer:t.x.buffer,offset:4*t.x.offset||0,stride:4*(t.x.stride||1),count:t.x.count},t.y.length?e.yAttr={buffer:o.buffer(t.y),offset:0,stride:4,count:t.y.length}:e.yAttr={buffer:t.y.buffer,offset:4*t.y.offset||0,stride:4*(t.y.stride||1),count:t.y.count},e.count=Math.max(e.xAttr.count,e.yAttr.count),t;t=f(t,"float64");var u=e.count=Math.floor(t.length/2),h=e.bounds=u?s(t,2):null;if(r.range||e.range||(delete e.range,r.range=h),r.marker||e.marker||(delete e.marker,r.marker=null),n&&(!0===n||u>n)?e.tree=c(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var d={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(d):e.elements=o.elements(d)}var p=g.float32(t);return i({data:p,usage:"dynamic"}),a({data:g.fract32(t,p),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!==typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s<l;s++){var c=t.addMarker(e[s]);a[c]||(a[c]=new Uint8Array(r.count)),a[c][s]=1}for(var u=0;u<a.length;u++)if(a[u]){var h={data:a[u],type:"uint8",usage:"static"};i[u]?i[u](h):i[u]=o.buffer(h),i[u].data=a[u]}}else i[t.addMarker(e)]=!0;return e},range:function(t,e,r){var n=e.bounds;if(n)return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=g.fract(e.scale),e.translateFract=g.fract(e.translate),t},viewport:function(t){return y(t||[a.drawingBufferWidth,a.drawingBufferHeight])}}]),v){var _=n,w=_.count,k=_.size,T=_.borderSize,S=_.sizeBuffer,A=new Uint8Array(2*w);if(k.length||T.length)for(var M=0;M<w;M++)A[2*M]=Math.round(255*(null==k[M]?k:k[M])/l),A[2*M+1]=Math.round(255*(null==T[M]?T:T[M])/l);S({data:A,usage:"dynamic"})}if(b){var C,E=n,L=E.count,P=E.color,I=E.borderColor,z=E.colorBuffer;if(t.tooManyColors){if(P.length||I.length){C=new Uint8Array(8*L);for(var O=0;O<L;O++){var D=P[O];C[8*O]=m[4*D],C[8*O+1]=m[4*D+1],C[8*O+2]=m[4*D+2],C[8*O+3]=m[4*D+3];var R=I[O];C[8*O+4]=m[4*R],C[8*O+5]=m[4*R+1],C[8*O+6]=m[4*R+2],C[8*O+7]=m[4*R+3]}}}else if(P.length||I.length){C=new Uint8Array(4*L+2);for(var F=0;F<L;F++)null!=P[F]&&(C[4*F]=P[F]%h,C[4*F+1]=Math.floor(P[F]/h)),null!=I[F]&&(C[4*F+2]=I[F]%h,C[4*F+3]=Math.floor(I[F]/h))}z({data:C||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},x.prototype.addMarker=function(t){var e,r=this.markerTextures,n=this.regl,i=this.markerCache,a=null==t?0:i.indexOf(t);if(a>=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o<s;o++)e[o]=255*t[o]}var l=Math.floor(Math.sqrt(e.length));return a=r.length,i.push(t),r.push(n.texture({channels:1,data:e,radius:l,mag:"linear",min:"linear"})),a},x.prototype.updateColor=function(t){var e=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(t)||(t=[t]);var i=[];if("number"===typeof t[0]){var a=[];if(Array.isArray(t))for(var s=0;s<t.length;s+=4)a.push(t.slice(s,s+4));else for(var c=0;c<t.length;c+=4)a.push(t.subarray(c,c+4));t=a}for(var u=0;u<t.length;u++){var h=t[u];h=o(h,"uint8");var d=l(h,!1);if(null==e[d]){var p=r.length;e[d]=Math.floor(p/4),r[p]=h[0],r[p+1]=h[1],r[p+2]=h[2],r[p+3]=h[3]}i[u]=e[d]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i<n*e;i++)t.push(0,0,0,0);r.height<n&&r.resize(e,n),r.subimage({width:Math.min(.25*t.length,e),height:n,data:t},0,0)}},x.prototype.destroy=function(){return this.groups.forEach((function(t){t.sizeBuffer.destroy(),t.positionBuffer.destroy(),t.positionFractBuffer.destroy(),t.colorBuffer.destroy(),t.activation.forEach((function(t){return t&&t.destroy&&t.destroy()})),t.selectionBuffer.destroy(),t.elements&&t.elements.destroy()})),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach((function(t){return t&&t.destroy&&t.destroy()})),this};var b=uy();e.exports=function(t,e){var r=new v(t,e),n=r.render.bind(r);return b(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}}}),gy=d({"node_modules/earcut/src/earcut.js"(t,e){function r(t,e,r){r=r||2;var i,o,s,l,c,d,p,m=e&&e.length,g=m?e[0]*r:t.length,y=n(t,0,g,r,!0),v=[];if(!y||y.next===y.prev)return v;if(m&&(y=function(t,e,r,i){var a,o,s,l=[];for(a=0,o=e.length;a<o;a++)(s=n(t,e[a]*i,a<o-1?e[a+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),l.push(f(s));for(l.sort(u),a=0;a<l.length;a++)r=h(l[a],r);return r}(t,e,y,r)),t.length>80*r){i=s=t[0],o=l=t[1];for(var x=r;x<g;x+=r)(c=t[x])<i&&(i=c),(d=t[x+1])<o&&(o=d),c>s&&(s=c),d>l&&(l=d);p=0!==(p=Math.max(s-i,l-o))?32767/p:0}return a(y,v,r,i,o,p,0),v}function n(t,e,r,n,i){var a,o;if(i===M(t,e,r,n)>0)for(a=e;a<r;a+=n)o=T(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=T(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(S(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,u,h,d){if(t){!d&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,u,h);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,h?s(t,n,u,h):o(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),S(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?a(t=l(i(t),e,r),e,r,n,u,h,2):2===d&&c(t,e,r,n,u,h):a(i(t),e,r,n,u,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,d=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,f=n.next;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&m(i,s,a,l,o,c,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function s(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,d=o.y,f=s<l?s<c?s:c:l<c?l:c,g=u<h?u<d?u:d:h<d?h:d,v=s>l?s>c?s:c:l>c?l:c,x=u>h?u>d?u:d:h>d?h:d,b=p(f,g,e,r,n),_=p(v,x,e,r,n),w=t.prevZ,k=t.nextZ;w&&w.z>=b&&k&&k.z<=_;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,d,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}for(;w&&w.z>=b;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;k&&k.z<=_;){if(k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,d,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}return!0}function l(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(e.push(a.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,o,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=k(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,e,r,n,o,s,0),void a(u,e,r,n,o,s,0)}c=c.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==e);if(!r)return null;var l,c=r,u=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&m(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),w(n,t)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&d(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=k(r,t);return i(n,n.next),i(r,r.next)}function d(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function m(t,e,r,n,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var i=_(y(t,e,r)),a=_(y(t,e,n)),o=_(y(r,n,t)),s=_(y(r,n,e));return i!==a&&o!==s||!(0!==i||!b(t,r,e))||!(0!==a||!b(t,n,e))||!(0!==o||!b(r,t,n))||!(0!==s||!b(r,e,n))}function b(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function _(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function k(t,e){var r=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function T(t,e,r,n){var i=new A(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}e.exports=r,e.exports.default=r,r.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(M(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(M(t,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,p=n[s+1]*r,f=n[s+2]*r;h+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}}}),yy=d({"node_modules/array-normalize/index.js"(t,e){var r=Ug();e.exports=function(t,e,n){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==n&&(n=r(t,e));for(var i=0;i<e;i++){var a=n[e+i],o=n[i],s=i,l=t.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:t[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=e)t[s]=t[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=e)t[s]=t[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=e)isNaN(t[s])||(t[s]=0===c?.5:(t[s]-o)/c)}}return t}}}),vy=d({"node_modules/es6-weak-map/is-implemented.js"(t,e){e.exports=function(){var t,e;if("function"!==typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(r){return!1}return"[object WeakMap]"===String(t)&&"function"===typeof t.set&&t.set({},1)===t&&"function"===typeof t.delete&&"function"===typeof t.has&&"one"===t.get(e)}}}),xy=d({"node_modules/es5-ext/function/noop.js"(t,e){e.exports=function(){}}}),by=d({"node_modules/es5-ext/object/is-value.js"(t,e){var r=xy()();e.exports=function(t){return t!==r&&null!==t}}}),_y=d({"node_modules/es5-ext/object/set-prototype-of/is-implemented.js"(t,e){var r=Object.create,n=Object.getPrototypeOf,i={};e.exports=function(){var t=Object.setPrototypeOf;return"function"===typeof t&&n(t((arguments[0]||r)(null),i))===i}}}),wy=d({"node_modules/es5-ext/object/is-object.js"(t,e){var r=by(),n={function:!0,object:!0};e.exports=function(t){return r(t)&&n[typeof t]||!1}}}),ky=d({"node_modules/es5-ext/object/valid-value.js"(t,e){var r=by();e.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}}}),Ty=d({"node_modules/es5-ext/object/create.js"(t,e){var r,n=Object.create;_y()()||(r=Sy()),e.exports=function(){var t,e,i;return r?1!==r.level?n:(t={},e={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){e[t]="__proto__"!==t?i:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(t,e),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,r){return n(null===e?t:e,r)}):n}()}}),Sy=d({"node_modules/es5-ext/object/set-prototype-of/shim.js"(t,e){var r,n=wy(),i=ky(),a=Object.prototype.isPrototypeOf,o=Object.defineProperty,s={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(t,e){if(i(t),null===e||n(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,n;return t?(2===t.level?t.set?(n=t.set,e=function(t,e){return n.call(r(t,e),e),t}):e=function(t,e){return r(t,e).__proto__=e,t}:e=function t(e,n){var i;return r(e,n),(i=a.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===n&&(n=t.nullPolyfill),e.__proto__=n,i&&o(t.nullPolyfill,"__proto__",s),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(i){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),Ty()}}),Ay=d({"node_modules/es5-ext/object/set-prototype-of/index.js"(t,e){e.exports=_y()()?Object.setPrototypeOf:Sy()}}),My=d({"node_modules/es5-ext/object/valid-object.js"(t,e){var r=wy();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not an Object");return t}}}),Cy=d({"node_modules/es5-ext/string/random-uniq.js"(t,e){var r=Object.create(null),n=Math.random;e.exports=function(){var t;do{t=n().toString(36).slice(2)}while(r[t]);return t}}}),Ey=d({"node_modules/type/value/is.js"(t,e){e.exports=function(t){return void 0!==t&&null!==t}}}),Ly=d({"node_modules/type/object/is.js"(t,e){var r=Ey(),n={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!r(t)&&hasOwnProperty.call(n,typeof t)}}}),Py=d({"node_modules/type/prototype/is.js"(t,e){var r=Ly();e.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}}}),Iy=d({"node_modules/type/function/is.js"(t,e){var r=Py();e.exports=function(t){if("function"!==typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!==typeof t.length)return!1;if("function"!==typeof t.call)return!1;if("function"!==typeof t.apply)return!1}catch(e){return!1}return!r(t)}}}),zy=d({"node_modules/type/plain-function/is.js"(t,e){var r=Iy(),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!r(t)&&!n.test(i.call(t))}}}),Oy=d({"node_modules/es5-ext/object/assign/is-implemented.js"(t,e){e.exports=function(){var t,e=Object.assign;return"function"===typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}}}),Dy=d({"node_modules/es5-ext/object/keys/is-implemented.js"(t,e){e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}}}),Ry=d({"node_modules/es5-ext/object/keys/shim.js"(t,e){var r=by(),n=Object.keys;e.exports=function(t){return n(r(t)?Object(t):t)}}}),Fy=d({"node_modules/es5-ext/object/keys/index.js"(t,e){e.exports=Dy()()?Object.keys:Ry()}}),By=d({"node_modules/es5-ext/object/assign/shim.js"(t,e){var r=Fy(),n=ky(),i=Math.max;e.exports=function(t,e){var a,o,s,l=i(arguments.length,2);for(t=Object(n(t)),s=function(r){try{t[r]=e[r]}catch(n){a||(a=n)}},o=1;o<l;++o)r(e=arguments[o]).forEach(s);if(void 0!==a)throw a;return t}}}),jy=d({"node_modules/es5-ext/object/assign/index.js"(t,e){e.exports=Oy()()?Object.assign:By()}}),Ny=d({"node_modules/es5-ext/object/normalize-options.js"(t,e){var r=by(),n=Array.prototype.forEach,i=Object.create;e.exports=function(t){var e=i(null);return n.call(arguments,(function(t){r(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)})),e}}}),Uy=d({"node_modules/es5-ext/string/#/contains/is-implemented.js"(t,e){var r="razdwatrzy";e.exports=function(){return"function"===typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}}}),Vy=d({"node_modules/es5-ext/string/#/contains/shim.js"(t,e){var r=String.prototype.indexOf;e.exports=function(t){return r.call(this,t,arguments[1])>-1}}}),qy=d({"node_modules/es5-ext/string/#/contains/index.js"(t,e){e.exports=Uy()()?String.prototype.contains:Vy()}}),$y=d({"node_modules/d/index.js"(t,e){var r=Ey(),n=zy(),i=jy(),a=Ny(),o=qy(),s=e.exports=function(t,e){var n,s,l,c,u;return arguments.length<2||"string"!==typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),u={value:e,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(t,e,s){var l,c,u,h;return"string"!==typeof t?(u=s,s=e,e=t,t=null):u=arguments[3],r(e)?n(e)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),h={get:e,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Hy=d({"node_modules/es5-ext/function/is-arguments.js"(t,e){var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}}),Wy=d({"node_modules/es5-ext/string/is-string.js"(t,e){var r=Object.prototype.toString,n=r.call("");e.exports=function(t){return"string"===typeof t||t&&"object"===typeof t&&(t instanceof String||r.call(t)===n)||!1}}}),Gy=d({"node_modules/ext/global-this/is-implemented.js"(t,e){e.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),Yy=d({"node_modules/ext/global-this/implementation.js"(t,e){var r=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Zy=d({"node_modules/ext/global-this/index.js"(t,e){e.exports=Gy()()?globalThis:Yy()}}),Xy=d({"node_modules/es6-symbol/is-implemented.js"(t,e){var r=Zy(),n={object:!0,symbol:!0};e.exports=function(){var t,e=r.Symbol;if("function"!==typeof e)return!1;t=e("test symbol");try{String(t)}catch(i){return!1}return!!n[typeof e.iterator]&&!!n[typeof e.toPrimitive]&&!!n[typeof e.toStringTag]}}}),Ky=d({"node_modules/es6-symbol/is-symbol.js"(t,e){e.exports=function(t){return!!t&&("symbol"===typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}}}),Jy=d({"node_modules/es6-symbol/validate-symbol.js"(t,e){var r=Ky();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}}),Qy=d({"node_modules/es6-symbol/lib/private/generate-name.js"(t,e){var r=$y(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);e.exports=function(t){for(var e,n,s=0;o[t+(s||"")];)++s;return o[t+=s||""]=!0,i(a,e="@@"+t,r.gs(null,(function(t){n||(n=!0,i(this,e,r(t)),n=!1)}))),e}}}),tv=d({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,e){var r=$y(),n=Zy().Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",n&&n.iterator||t("iterator")),match:r("",n&&n.match||t("match")),replace:r("",n&&n.replace||t("replace")),search:r("",n&&n.search||t("search")),species:r("",n&&n.species||t("species")),split:r("",n&&n.split||t("split")),toPrimitive:r("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:r("",n&&n.toStringTag||t("toStringTag")),unscopables:r("",n&&n.unscopables||t("unscopables"))})}}}),ev=d({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(t,e){var r=$y(),n=Jy(),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:r((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:r((function(t){var e;for(e in n(t),i)if(i[e]===t)return e}))})}}}),rv=d({"node_modules/es6-symbol/polyfill.js"(t,e){var r,n,i,a=$y(),o=Jy(),s=Zy().Symbol,l=Qy(),c=tv(),u=ev(),h=Object.create,d=Object.defineProperties,p=Object.defineProperty;if("function"===typeof s)try{String(s()),i=!0}catch(f){}else s=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?s(e):(r=h(n.prototype),e=void 0===e?"":String(e),d(r,{__description__:a("",e),__name__:a("",l(e))}))},c(r),u(r),d(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),d(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),p(r.prototype,r.toPrimitive,a("",(function(){var t=o(this);return"symbol"===typeof t?t:t.toString()}))),p(r.prototype,r.toStringTag,a("c","Symbol")),p(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),p(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),nv=d({"node_modules/es6-symbol/index.js"(t,e){e.exports=Xy()()?Zy().Symbol:rv()}}),iv=d({"node_modules/es5-ext/array/#/clear.js"(t,e){var r=ky();e.exports=function(){return r(this).length=0,this}}}),av=d({"node_modules/es5-ext/object/valid-callable.js"(t,e){e.exports=function(t){if("function"!==typeof t)throw new TypeError(t+" is not a function");return t}}}),ov=d({"node_modules/type/string/coerce.js"(t,e){var r=Ey(),n=Ly(),i=Object.prototype.toString;e.exports=function(t){if(!r(t))return null;if(n(t)){var e=t.toString;if("function"!==typeof e)return null;if(e===i)return null}try{return""+t}catch(a){return null}}}}),sv=d({"node_modules/type/lib/safe-to-string.js"(t,e){e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(r){return null}}}}}),lv=d({"node_modules/type/lib/to-short-string.js"(t,e){var r=sv(),n=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=r(t);return null===e?"<Non-coercible to string value>":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(n,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),cv=d({"node_modules/type/lib/resolve-exception.js"(t,e){var r=Ey(),n=Ly(),i=ov(),a=lv(),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,a){if(!n(a))throw new TypeError(o(e,t));if(!r(t)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=e),new TypeError(o(s,t))}}}),uv=d({"node_modules/type/value/ensure.js"(t,e){var r=cv(),n=Ey();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}}),hv=d({"node_modules/type/plain-function/ensure.js"(t,e){var r=cv(),n=zy();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}}),dv=d({"node_modules/es5-ext/array/from/is-implemented.js"(t,e){e.exports=function(){var t,e,r=Array.from;return"function"===typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}}}),pv=d({"node_modules/es5-ext/function/is-function.js"(t,e){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"===typeof t&&n(r.call(t))}}}),fv=d({"node_modules/es5-ext/math/sign/is-implemented.js"(t,e){e.exports=function(){var t=Math.sign;return"function"===typeof t&&1===t(10)&&-1===t(-20)}}}),mv=d({"node_modules/es5-ext/math/sign/shim.js"(t,e){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}}),gv=d({"node_modules/es5-ext/math/sign/index.js"(t,e){e.exports=fv()()?Math.sign:mv()}}),yv=d({"node_modules/es5-ext/number/to-integer.js"(t,e){var r=gv(),n=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*i(n(t)):t}}}),vv=d({"node_modules/es5-ext/number/to-pos-integer.js"(t,e){var r=yv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}}),xv=d({"node_modules/es5-ext/array/from/shim.js"(t,e){var r=nv().iterator,n=Hy(),i=pv(),a=vv(),o=av(),s=ky(),l=by(),c=Wy(),u=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,f,m,g,y,v,x,b,_,w,k=arguments[1],T=arguments[2];if(t=Object(s(t)),l(k)&&o(k),this&&this!==Array&&i(this))e=this;else{if(!k){if(n(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(u(t)){for(g=new Array(y=t.length),f=0;f<y;++f)g[f]=t[f];return g}}g=[]}if(!u(t))if(void 0!==(_=t[r])){for(x=o(_).call(t),e&&(g=new e),b=x.next(),f=0;!b.done;)w=k?h.call(k,T,b.value,f):b.value,e?(d.value=w,p(g,f,d)):g[f]=w,b=x.next(),++f;y=f}else if(c(t)){for(y=t.length,e&&(g=new e),f=0,m=0;f<y;++f)w=t[f],f+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=t[++f]),w=k?h.call(k,T,w,m):w,e?(d.value=w,p(g,m,d)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),f=0;f<y;++f)w=k?h.call(k,T,t[f],f):t[f],e?(d.value=w,p(g,f,d)):g[f]=w;return e&&(d.value=null,g.length=y),g}}}),bv=d({"node_modules/es5-ext/array/from/index.js"(t,e){e.exports=dv()()?Array.from:xv()}}),_v=d({"node_modules/es5-ext/object/copy.js"(t,e){var r=bv(),n=jy(),i=ky();e.exports=function(t){var e=Object(i(t)),a=arguments[1],o=Object(arguments[2]);if(e!==t&&!a)return e;var s={};return a?r(a,(function(e){(o.ensure||e in t)&&(s[e]=t[e])})):n(s,t),s}}}),wv=d({"node_modules/es5-ext/object/_iterate.js"(t,e){var r=av(),n=ky(),i=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(l,c){var u,h=arguments[2],d=arguments[3];return l=Object(n(l)),r(c),u=o(l),d&&u.sort("function"===typeof d?i.call(d,l):void 0),"function"!==typeof t&&(t=u[t]),a.call(t,u,(function(t,r){return s.call(l,t)?a.call(c,h,l[t],t,l,r):e}))}}}}),kv=d({"node_modules/es5-ext/object/for-each.js"(t,e){e.exports=wv()("forEach")}}),Tv=d({"node_modules/es5-ext/object/map.js"(t,e){var r=av(),n=kv(),i=Function.prototype.call;e.exports=function(t,e){var a={},o=arguments[2];return r(e),n(t,(function(t,r,n,s){a[r]=i.call(e,o,t,r,n,s)})),a}}}),Sv=d({"node_modules/d/auto-bind.js"(t,e){var r,n=Ey(),i=uv(),a=hv(),o=_v(),s=Ny(),l=Tv(),c=Function.prototype.bind,u=Object.defineProperty,h=Object.prototype.hasOwnProperty;r=function(t,e,r){var n,s=i(e)&&a(e.value);return delete(n=o(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?s:(e.value=c.call(s,r.resolveContext?r.resolveContext(this):this),u(this,t,e),this[t])},n},e.exports=function(t){var e=s(arguments[1]);return n(e.resolveContext)&&a(e.resolveContext),l(t,(function(t,n){return r(n,t,e)}))}}}),Av=d({"node_modules/es6-iterator/index.js"(t,e){var r,n=iv(),i=jy(),a=av(),o=ky(),s=$y(),l=Sv(),c=nv(),u=Object.defineProperty,h=Object.defineProperties;e.exports=r=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");h(this,{__list__:s("w",o(t)),__context__:s("w",e),__nextIndex__:s("w",0)}),e&&(a(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete r.prototype.constructor,h(r.prototype,i({_next:s((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:s((function(){return this._createResult(this._next())})),_createResult:s((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:s((function(t){return this.__list__[t]})),_unBind:s((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:s((function(){return"[object "+(this[c.toStringTag]||"Object")+"]"}))},l({_onAdd:s((function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):u(this,"__redo__",s("c",[t])))})),_onDelete:s((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Mv=d({"node_modules/es6-iterator/array.js"(t,e){var r,n=Ay(),i=qy(),a=$y(),o=nv(),s=Av(),l=Object.defineProperty;r=e.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Cv=d({"node_modules/es6-iterator/string.js"(t,e){var r,n=Ay(),i=$y(),a=nv(),o=Av(),s=Object.defineProperty;r=e.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),s(this,"__length__",i("",t.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Ev=d({"node_modules/es6-iterator/is-iterable.js"(t,e){var r=Hy(),n=by(),i=Wy(),a=nv().iterator,o=Array.isArray;e.exports=function(t){return!!n(t)&&(!!o(t)||!!i(t)||!!r(t)||"function"===typeof t[a])}}}),Lv=d({"node_modules/es6-iterator/valid-iterable.js"(t,e){var r=Ev();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}}),Pv=d({"node_modules/es6-iterator/get.js"(t,e){var r=Hy(),n=Wy(),i=Mv(),a=Cv(),o=Lv(),s=nv().iterator;e.exports=function(t){return"function"===typeof o(t)[s]?t[s]():r(t)?new i(t):n(t)?new a(t):new i(t)}}}),Iv=d({"node_modules/es6-iterator/for-of.js"(t,e){var r=Hy(),n=av(),i=Wy(),a=Pv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var c,u,h,d,p,f,m,g,y=arguments[2];if(o(t)||r(t)?c="array":i(t)?c="string":t=a(t),n(e),h=function(){d=!0},"array"!==c)if("string"!==c)for(u=t.next();!u.done;){if(s.call(e,y,u.value,h),d)return;u=t.next()}else for(f=t.length,p=0;p<f&&(m=t[p],p+1<f&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=t[++p]),s.call(e,y,m,h),!d);++p);else l.call(t,(function(t){return s.call(e,y,t,h),d}))}}}),zv=d({"node_modules/es6-weak-map/is-native-implemented.js"(t,e){e.exports="function"===typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Ov=d({"node_modules/es6-weak-map/polyfill.js"(t,e){var r,n=by(),i=Ay(),a=My(),o=ky(),s=Cy(),l=$y(),c=Pv(),u=Iv(),h=nv().toStringTag,d=zv(),p=Array.isArray,f=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var t,e=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return t=d&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(e)&&(p(e)||(e=c(e))),f(t,"__weakMapData__",l("c","$weakMap$"+s())),e?(u(e,(function(e){o(e),t.set(e[0],e[1])})),t):t},d&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(t){return!!m.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:l((function(t){if(m.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:l((function(t){return m.call(a(t),this.__weakMapData__)})),set:l((function(t,e){return f(a(t),this.__weakMapData__,l("c",e)),this})),toString:l((function(){return"[object WeakMap]"}))}),f(r.prototype,h,l("c","WeakMap"))}}),Dv=d({"node_modules/es6-weak-map/index.js"(t,e){e.exports=vy()()?WeakMap:Ov()}}),Rv=d({"node_modules/array-find-index/index.js"(t,e){e.exports=function(t,e,r){if("function"===typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!==typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var a=0;a<i;a++)if(e.call(r,n[a],a,n))return a;return-1}}}),Fv=d({"node_modules/regl-line2d/index.js"(t,e){var r=jf(),n=Ug(),i=uy(),a=jg(),o=qg(),s=gy(),l=yy(),{float32:c,fract32:u}=fy(),h=Dv(),d=Ng(),p=Rv();function f(t,e){if(!(this instanceof f))return new f(t,e);if("function"===typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=f.shaders.has(t)?f.shaders.get(t):f.shaders.set(t,f.createShaders(t)).get(t),this.update(e)}e.exports=f,f.dashMult=2,f.maxPatternLength=256,f.precisionThreshold=3e6,f.maxPoints=1e4,f.maxLines=2048,f.shaders=new h,f.createShaders=function(t){let e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:(t,e)=>"round"===e.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.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:(t,e)=>!e.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(o){e=a}return{fill:t({primitive:"triangle",elements:(t,e)=>e.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},f.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},f.prototype.render=function(){arguments.length&&this.update(...arguments),this.draw()},f.prototype.draw=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return(e.length?e:this.passes).forEach(((t,e)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"===typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>f.precisionThreshold||t.scale[1]*t.viewport.height>f.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=f.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))})),this},f.prototype.update=function(t){if(!t)return;null!=t.length?"number"===typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:e,gl:h}=this;if(t.forEach(((t,m)=>{let g=this.passes[m];if(void 0!==t)if(null!==t){if("number"===typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:e.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},f.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,m<f.maxLines&&(g.depth=2*(f.maxLines-1-m%f.maxLines)/f.maxLines-1)),null!=t.join&&(g.join=t.join),null!=t.hole&&(g.hole=t.hole),null!=t.fill&&(g.fill=t.fill?r(t.fill,"uint8"):null),null!=t.viewport&&(g.viewport=d(t.viewport)),g.viewport||(g.viewport=d([h.drawingBufferWidth,h.drawingBufferHeight])),null!=t.close&&(g.close=t.close),null===t.positions&&(t.positions=[]),t.positions){let e,r;if(t.positions.x&&t.positions.y){let n=t.positions.x,i=t.positions.y;r=g.count=Math.max(n.length,i.length),e=new Float64Array(2*r);for(let t=0;t<r;t++)e[2*t]=n[t],e[2*t+1]=i[t]}else e=o(t.positions,"float64"),r=g.count=Math.floor(e.length/2);let i=g.bounds=n(e,2);if(g.fill){let r=[],n={},i=0;for(let t=0,a=0,o=g.count;t<o;t++){let o=e[2*t],s=e[2*t+1];isNaN(o)||isNaN(s)||null==o||null==s?(o=e[2*i],s=e[2*i+1],n[t]=i):i=t,r[a++]=o,r[a++]=s}if(t.splitNull){g.count-1 in n||(n[g.count]=g.count-1);let t=Object.keys(n).map(Number).sort(((t,e)=>t-e)),e=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let e=p(t,(t=>t>=a));t=t.slice(0,e),t.push(a)}for(let n=0;n<t.length;n++){let o=r.slice(2*i,2*t[n]).concat(a?r.slice(2*a):[]),l=(g.hole||[]).map((e=>e-a+(t[n]-i))),c=s(o,l);c=c.map((e=>e+i+(e+i<t[n]?0:a-t[n]))),e.push(...c),i=t[n]+1}for(let r=0,o=e.length;r<o;r++)null!=n[e[r]]&&(e[r]=n[e[r]]);g.triangles=e}else{let t=s(r,g.hole||[]);for(let e=0,r=t.length;e<r;e++)null!=n[t[e]]&&(t[e]=n[t[e]]);g.triangles=t}}let a=new Float64Array(e);l(a,2,i);let h=new Float64Array(2*r+6);g.close?e[0]===e[2*r-2]&&e[1]===e[2*r-1]?(h[0]=a[2*r-4],h[1]=a[2*r-3]):(h[0]=a[2*r-2],h[1]=a[2*r-1]):(h[0]=a[0],h[1]=a[1]),h.set(a,2),g.close?e[0]===e[2*r-2]&&e[1]===e[2*r-1]?(h[2*r+2]=a[2],h[2*r+3]=a[3],g.count-=1):(h[2*r+2]=a[0],h[2*r+3]=a[1],h[2*r+4]=a[2],h[2*r+5]=a[3]):(h[2*r+2]=a[2*r-2],h[2*r+3]=a[2*r-1],h[2*r+4]=a[2*r-2],h[2*r+5]=a[2*r-1]);var y=c(h);g.positionBuffer(y);var v=u(h,y);g.positionFractBuffer(v)}if(t.range?g.range=t.range:g.range||(g.range=g.bounds),(t.range||t.positions)&&g.count){let t=g.bounds,e=t[2]-t[0],r=t[3]-t[1],n=g.range[2]-g.range[0],i=g.range[3]-g.range[1];g.scale=[e/n,r/i],g.translate=[-g.range[0]/n+t[0]/n||0,-g.range[1]/i+t[1]/i||0],g.scaleFract=u(g.scale),g.translateFract=u(g.translate)}if(t.dashes){let e,r=0;if(!t.dashes||t.dashes.length<2)r=1,e=new Uint8Array([255,255,255,255,255,255,255,255]);else{r=0;for(let e=0;e<t.dashes.length;++e)r+=t.dashes[e];e=new Uint8Array(r*f.dashMult);let n=0,i=255;for(let r=0;r<2;r++)for(let a=0;a<t.dashes.length;++a){for(let r=0,o=t.dashes[a]*f.dashMult*.5;r<o;++r)e[n++]=i;i^=255}}g.dashLength=r,g.dashTexture({channels:1,data:e,width:e.length,height:1,mag:"linear",min:"linear"},0,0)}if(t.color){let e=g.count,n=t.color;n||(n="transparent");let i=new Uint8Array(4*e+4);if(Array.isArray(n)&&"number"!==typeof n[0]){for(let t=0;t<e;t++){let e=r(n[t],"uint8");i.set(e,4*t)}i.set(r(n[0],"uint8"),4*e)}else{let t=r(n,"uint8");for(let r=0;r<e+1;r++)i.set(t,4*r)}g.colorBuffer({usage:"dynamic",type:"uint8",data:i})}}else this.passes[m]=null})),t.length<this.passes.length){for(let e=t.length;e<this.passes.length;e++){let t=this.passes[e];t&&(t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy())}this.passes.length=t.length}let m=[];for(let r=0;r<this.passes.length;r++)null!==this.passes[r]&&m.push(this.passes[r]);return this.passes=m,this},f.prototype.destroy=function(){return this.passes.forEach((t=>{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}}}),Bv=d({"node_modules/regl-error2d/index.js"(t,e){var r=Ug(),n=jf(),i=dy(),a=jg(),o=uy(),s=qg(),{float32:l,fract32:c}=fy();e.exports=function(t,e){if("function"===typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,d,p,f,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return f=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),d=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:u}),k(e),h=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:f,offset:(t,e)=>4*e.offset,divisor:1},position:{buffer:d,offset:(t,e)=>8*e.offset,divisor:1},positionFract:{buffer:p,offset:(t,e)=>8*e.offset,divisor:1},error:{buffer:m,offset:(t,e)=>16*e.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,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:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:u.length}),o(b,{update:k,draw:_,destroy:T,regl:t,gl:y,canvas:y.canvas,groups:x}),b;function b(t){t?k(t):null===t&&T(),_()}function _(e){if("number"===typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(((t,r)=>{t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"===typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],h(t),t.after&&t.after(t))}function k(t){if(!t)return;null!=t.length?"number"===typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let e=0,u=0;if(b.groups=x=t.map(((t,l)=>{let h=x[l];return t?("function"===typeof t?t={after:t}:"number"===typeof t[0]&&(t={positions:t}),t=a(t,{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"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=o({},v,t)),i(h,t,[{lineWidth:t=>.5*+t,capSize:t=>.5*+t,opacity:parseFloat,errors:t=>(t=s(t),u+=t.length,t),positions:(t,n)=>(t=s(t,"float64"),n.count=Math.floor(t.length/2),n.bounds=r(t,2),n.offset=e,e+=n.count,t)},{color:(t,e)=>{let r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"===typeof t[0]){let e=t;t=Array(r);for(let n=0;n<r;n++)t[n]=e}if(t.length<r)throw Error("Not enough colors");let i=new Uint8Array(4*r);for(let a=0;a<r;a++){let e=n(t[a],"uint8");i.set(e,4*a)}return i},range:(t,e,r)=>{let n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=c(e.scale),e.translateFract=c(e.translate),t},viewport:t=>{let e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),h):h})),e||u){let t=x.reduce(((t,e,r)=>t+(e?e.count:0)),0),e=new Float64Array(2*t),r=new Uint8Array(4*t),n=new Float32Array(4*t);x.forEach(((t,i)=>{if(!t)return;let{positions:a,count:o,offset:s,color:l,errors:c}=t;o&&(r.set(l,4*s),n.set(c,4*s),e.set(a,2*s))}));var h=l(e);d(h);var g=c(e,h);p(g),f(r),m(n)}}function T(){d.destroy(),p.destroy(),f.destroy(),m.destroy(),g.destroy()}};var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),jv=d({"node_modules/unquote/index.js"(t,e){var r=/[\'\"]/;e.exports=function(t){return t?(r.test(t.charAt(0))&&(t=t.substr(1)),r.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}}),Nv=d({"node_modules/css-global-keywords/index.json"(){}}),Uv=d({"node_modules/css-system-font-keywords/index.json"(){}}),Vv=d({"node_modules/css-font-weight-keywords/index.json"(){}}),qv=d({"node_modules/css-font-style-keywords/index.json"(){}}),$v=d({"node_modules/css-font-stretch-keywords/index.json"(){}}),Hv=d({"node_modules/parenthesis/index.js"(t,e){function r(t,e){if("string"!==typeof t)return[t];var r=[t];"string"===typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function n(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?n(t,e):r(t,e)}i.parse=r,i.stringify=n,e.exports=i}}),Wv=d({"node_modules/string-split-by/index.js"(t,e){var r=Hv();e.exports=function(t,e,n){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");n?("string"===typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=r.parse(t,{flat:!0,brackets:n.ignore}),a=i[0].split(e);if(n.escape){for(var o=[],s=0;s<a.length;s++){var l=a[s],c=a[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+e+c),s++):o.push(l)}a=o}for(s=0;s<a.length;s++)i[0]=a[s],a[s]=r.stringify(i,{flat:!0});return a}}}),Gv=d({"node_modules/css-font-size-keywords/index.json"(){}}),Yv=d({"node_modules/css-font/lib/util.js"(t,e){var r=Gv();e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==r.indexOf(t)}}}}),Zv=d({"node_modules/css-font/parse.js"(t,e){var r=jv(),n=Nv(),i=Uv(),a=Vv(),o=qv(),s=$v(),l=Wv(),c=Yv().isSize;e.exports=h;var u=h.cache={};function h(t){if("string"!==typeof t)throw new Error("Font argument must be a string.");if(u[t])return u[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return u[t]={system:t};for(var e,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},p=l(t,/\s+/);e=p.shift();){if(-1!==n.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){h[t]=e})),u[t]=h;if(-1===o.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===s.indexOf(e)){if(-1===a.indexOf(e)){if(c(e)){var f=l(e,"/");if(h.size=f[0],null!=f[1]?h.lineHeight=d(f[1]):"/"===p[0]&&(p.shift(),h.lineHeight=d(p.shift())),!p.length)throw new Error("Missing required font-family.");return h.family=l(p.join(" "),/\s*,\s*/).map(r),u[t]=h}throw new Error("Unknown or unsupported font token: "+e)}h.weight=e}else h.stretch=e;else h.variant=e;else h.style=e}throw new Error("Missing required font-size.")}function d(t){var e=parseFloat(t);return e.toString()===t?e:t}}}),Xv=d({"node_modules/css-font/stringify.js"(t,e){var r=jg(),n=Yv().isSize,i=f(Nv()),a=f(Uv()),o=f(Vv()),s=f(qv()),l=f($v()),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",d="serif";function p(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function f(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=r(t,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return t.system&&p(t.system,a),t.system;if(p(t.style,s),p(t.variant,c),p(t.weight,o),p(t.stretch,l),null==t.size&&(t.size=h),"number"===typeof t.size&&(t.size+="px"),!n)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=d),Array.isArray(t.family)&&(t.family.length||(t.family=[d]),t.family=t.family.map((function(t){return u[t]?t:'"'+t+'"'})).join(", "));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||"normal"===t.lineHeight||t.lineHeight+""==="1"?"":"/"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(" ")}}}),Kv=d({"node_modules/css-font/index.js"(t,e){e.exports={parse:Zv(),stringify:Xv()}}}),Jv=d({"node_modules/regl/dist/regl.unchecked.js"(t,e){var r,n;r=t,n=function(){var t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},e=0;function r(t,r){this.id=e++,this.type=t,this.data=r}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(t){return"["+i(t).join("][")+"]"}var o={DynamicVariable:r,define:function(t,e){return new r(t,a(e+""))},isDynamic:function(t){return"function"===typeof t&&!t._reglType||t instanceof r},unbox:function t(e,n){return"function"===typeof e?new r(0,e):"number"===typeof e||"boolean"===typeof e?new r(5,e):Array.isArray(e)?new r(6,e.map((function(e,r){return t(e,n+"["+r+"]")}))):e instanceof r?e:void 0},accessor:a},s={next:"function"===typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"===typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},l="undefined"!==typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(t){return"string"===typeof t?t.split():t}function u(t){return"string"===typeof t?document.querySelector(t):t}function h(e){var r,n,i,a,o,s=e||{},l={},h=[],d=[],p="undefined"===typeof window?1:window.devicePixelRatio,f=!1,m={},g=function(t){},y=function(){};if("string"===typeof s?r=document.querySelector(s):"object"===typeof s&&("string"===typeof(o=s).nodeName&&"function"===typeof o.appendChild&&"function"===typeof o.getBoundingClientRect?r=s:function(t){return"function"===typeof t.drawArrays||"function"===typeof t.drawElements}(s)?i=(a=s).canvas:("gl"in s?a=s.gl:"canvas"in s?i=u(s.canvas):"container"in s&&(n=u(s.container)),"attributes"in s&&(l=s.attributes),"extensions"in s&&(h=c(s.extensions)),"optionalExtensions"in s&&(d=c(s.optionalExtensions)),"onDone"in s&&(g=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(p=+s.pixelRatio),"cachedCode"in s&&(m=s.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var v=function(e,r,n){var i,a=document.createElement("canvas");function o(){var t=window.innerWidth,r=window.innerHeight;if(e!==document.body){var i=a.getBoundingClientRect();t=i.right-i.left,r=i.bottom-i.top}a.width=n*t,a.height=n*r}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(a),e===document.body&&(a.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"===typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),e.removeChild(a)}}}(n||document.body,0,p);if(!v)return null;i=v.canvas,y=v.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),a=function(t,e){function r(r){try{return t.getContext(r,e)}catch(n){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,l)}return a?{gl:a,canvas:i,container:n,extensions:h,optionalExtensions:d,pixelRatio:p,profile:f,cachedCode:m,onDone:g,onDestroy:y}:(y(),g("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function d(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function p(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function f(){var t=d(8,(function(){return[]}));function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var m=f();m.zero=f();var g=3553,y=6408,v=5126,x=36160,b=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function _(t){return!!t&&"object"===typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"===typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||b(t.data))}var w=function(t){return Object.keys(t).map((function(e){return t[e]}))},k={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||m.allocType(r,i);switch(e.length){case 0:break;case 1:!function(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}(t,e[0],o);break;case 2:!function(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}(t,e[0],e[1],o);break;case 3:T(t,e[0],e[1],e[2],o,0);break;default:S(t,e,0,o,0)}return o}};function T(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function S(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r===4){var l=e[r+1],c=e[r+2],u=e[r+3];for(o=0;o<s;++o)T(t[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)S(t[o],e,r+1,n,i),i+=a}var A={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},M={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},C={dynamic:35048,stream:35040,static:35044},E=k.flatten,L=k.shape,P=5121,I=5126,z=[];function O(t){return 0|A[Object.prototype.toString.call(t)]}function D(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function R(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)t[s++]=e[i*l+a*c+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var F={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},B=5121,j=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function $(t){for(var e=m.allocType(5123,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(t[r]===1/0)e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{V[0]=t[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function H(t){return Array.isArray(t)||b(t)}var W=3553,G=34067,Y=34069,Z=6408,X=6406,K=6407,J=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=33779,ut=5121,ht=5123,dt=5125,pt=5126,ft=33071,mt=9728,gt=9984,yt=9987,vt=4352,xt=33984,bt=[gt,9986,9985,yt],_t=[0,J,Q,K,Z],wt={};function kt(t){return"[object "+t+"]"}wt[6409]=wt[6406]=wt[6402]=1,wt[34041]=wt[6410]=2,wt[6407]=wt[35904]=3,wt[6408]=wt[35906]=4;var Tt=kt("HTMLCanvasElement"),St=kt("OffscreenCanvas"),At=kt("CanvasRenderingContext2D"),Mt=kt("ImageBitmap"),Ct=kt("HTMLImageElement"),Et=kt("HTMLVideoElement"),Lt=Object.keys(A).concat([Tt,St,At,Mt,Ct,Et]),Pt=[];Pt[5121]=1,Pt[5126]=4,Pt[36193]=2,Pt[5123]=2,Pt[5125]=4;var It=[];function zt(t){return Array.isArray(t)&&(0===t.length||"number"===typeof t[0])}function Ot(t){return!!Array.isArray(t)&&!(0===t.length||!H(t[0]))}function Dt(t){return Object.prototype.toString.call(t)}function Rt(t){return Dt(t)===Tt}function Ft(t){return Dt(t)===St}function Bt(t){if(!t)return!1;var e=Dt(t);return Lt.indexOf(e)>=0||zt(t)||Ot(t)||_(t)}function jt(t){return 0|A[Object.prototype.toString.call(t)]}function Nt(t,e){return m.allocType(t.type===at?pt:t.type,e)}function Ut(t,e){t.type===at?(t.data=$(e),m.freeType(e)):t.data=e}function Vt(t,e,r,n,i,a){var o;if(o="undefined"!==typeof It[t]?It[t]:wt[t]*Pt[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function qt(e,r,n,i,a,o,s){var l={"don't care":vt,"dont care":vt,nice:4354,fast:4353},c={repeat:10497,clamp:ft,mirror:33648},u={nearest:mt,linear:9729},h=t({mipmap:yt,"nearest mipmap nearest":gt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":yt},u),d={none:0,browser:37444},p={uint8:ut,rgba4:32819,rgb565:33635,"rgb5 a1":32820},f={alpha:X,luminance:J,"luminance alpha":Q,rgb:K,rgba:Z,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(f.srgb=nt,f.srgba=it),r.oes_texture_float&&(p.float32=p.float=pt),r.oes_texture_half_float&&(p.float16=p["half float"]=at),r.webgl_depth_texture&&(t(f,{depth:et,"depth stencil":rt}),t(p,{uint16:ht,uint32:dt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":ot,"rgba s3tc dxt1":st,"rgba s3tc dxt3":lt,"rgba s3tc dxt5":ct}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(e.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(f[t]=e)}));var v=Object.keys(f);n.textureFormats=v;var x=[];Object.keys(f).forEach((function(t){var e=f[t];x[e]=t}));var T=[];Object.keys(p).forEach((function(t){var e=p[t];T[e]=t}));var S=[];Object.keys(u).forEach((function(t){S[u[t]]=t}));var A=[];Object.keys(h).forEach((function(t){var e=h[t];A[e]=t}));var M=[];Object.keys(c).forEach((function(t){M[c[t]]=t}));var C=v.reduce((function(t,e){var n=f[e];return n===J||n===X||n===J||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=Z:t[n]=K,t}),{});function E(){this.internalformat=Z,this.format=Z,this.type=ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function L(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function P(t,e){if("object"===typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=d[e.colorSpace]),"type"in e){var r=e.type;t.type=p[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,c=t.internalformat=f[l];t.format=C[c],l in p&&("type"in e||(t.type=p[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=wt[t.format]:o&&!s&&t.channels!==_t[t.format]&&(t.format=t.internalformat=_t[t.channels])}}function I(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function z(){E.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(t,e){var r=null;if(Bt(e)?r=e:e&&(P(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),Bt(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(b(r))t.channels=t.channels||4,t.data=r,"type"in e||t.type!==ut||(t.type=jt(r));else if(zt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ut:case ht:case dt:case pt:var n=m.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=$(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(_(r)){var o=r.data;Array.isArray(o)||t.type!==ut||(t.type=jt(o));var s,l,c,u,h,d,p=r.shape,f=r.stride;3===p.length?(c=p[2],d=f[2]):(c=1,d=1),s=p[0],l=p[1],u=f[0],h=f[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=_t[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=Nt(t,o*s*l),u=0,h=0;h<s;++h)for(var d=0;d<o;++d)for(var p=0;p<l;++p)c[u++]=e[r*d+n*h+i*p+a];Ut(t,c)}(t,o,u,h,d,r.offset)}else if(Rt(r)||Ft(r)||Dt(r)===At)Rt(r)||Ft(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(t){return Dt(t)===Mt}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(t){return Dt(t)===Ct}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(t){return Dt(t)===Et}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(Ot(r)){var g=t.width||r[0].length,y=t.height||r.length,v=t.channels;v=H(r[0][0])?v||r[0][0].length:v||1;for(var x=k.shape(r),w=1,T=0;T<x.length;++T)w*=x[T];var S=Nt(t,w);k.flatten(r,x,"",S),Ut(t,S),t.alignment=1,t.width=g,t.height=y,t.channels=v,t.format=t.internalformat=_t[v],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===pt||t.type}function D(t,r,n){var a=t.element,o=t.data,s=t.internalformat,l=t.format,c=t.type,u=t.width,h=t.height;I(t),a?e.texImage2D(r,n,l,l,c,a):t.compressed?e.compressedTexImage2D(r,n,s,u,h,0,o):t.needsCopy?(i(),e.copyTexImage2D(r,n,l,t.xOffset,t.yOffset,u,h,0)):e.texImage2D(r,n,l,u,h,0,l,c,o||null)}function R(t,r,n,a,o){var s=t.element,l=t.data,c=t.internalformat,u=t.format,h=t.type,d=t.width,p=t.height;I(t),s?e.texSubImage2D(r,o,n,a,u,h,s):t.compressed?e.compressedTexSubImage2D(r,o,n,a,c,d,p,l):t.needsCopy?(i(),e.copyTexSubImage2D(r,o,n,a,t.xOffset,t.yOffset,d,p)):e.texSubImage2D(r,o,n,a,d,p,u,h,l)}var F=[];function B(){return F.pop()||new z}function j(t){t.needsFree&&m.freeType(t.data),z.call(t),F.push(t)}function N(){E.call(this),this.genMipmaps=!1,this.mipmapHint=vt,this.mipmask=0,this.images=Array(16)}function U(t,e,r){var n=t.images[0]=B();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function V(t,e){var r=null;if(Bt(e))L(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;else if(P(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)L(r=t.images[i]=B(),t),r.width>>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<<i;else L(r=t.images[0]=B(),t),O(r,e),t.mipmask=1;L(t,t.images[0]),t.compressed&&(t.internalformat===ot||t.internalformat===st||t.internalformat===lt||t.internalformat)}function q(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;D(r[n],e,n)}}var kt=[];function Tt(){var t=kt.pop()||new N;E.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function St(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&j(e[r]),e[r]=null;kt.push(t)}function Lt(){this.minFilter=mt,this.magFilter=mt,this.wrapS=ft,this.wrapT=ft,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=vt}function Pt(t,e){if("min"in e){var r=e.min;t.minFilter=h[r],bt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"===typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var d=e.wrapT;a=c[d]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var p=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,p=!0;break;case"boolean":p=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,p=!0}p&&!("min"in e)&&(t.minFilter=gt)}}function It(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var qt=0,$t={},Ht=n.maxTextureUnits,Wt=Array(Ht).map((function(){return null}));function Gt(t){E.call(this),this.mipmask=0,this.internalformat=Z,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Lt,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(xt),e.bindTexture(t.target,t.texture)}function Zt(){var t=Wt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(W,null)}function Xt(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(xt+n),e.bindTexture(i,null),Wt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete $t[t.id],o.textureCount--}return t(Gt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n<Ht;++n){var i=Wt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}Wt[n]=t,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),t.unit=r,e.activeTexture(xt+r),e.bindTexture(t.target,t.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xt(this)}}),s.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys($t).forEach((function(e){t+=$t[e].stats.size})),t}),{create2D:function(t,r){var n=new Gt(W);function i(t,e){var r=n.texInfo;Lt.call(r);var a=Tt();return"number"===typeof t?U(a,0|t,"number"===typeof e?0|e:0|t):t?(Pt(r,t),V(a,t)):U(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,L(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Yt(n),q(a,W),It(r,W),Zt(),St(a),s.profile&&(n.stats.size=Vt(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=x[n.internalformat],i.type=T[n.type],i.mag=S[r.magFilter],i.min=A[r.minFilter],i.wrapS=M[r.wrapS],i.wrapT=M[r.wrapT],i}return $t[n.id]=n,o.textureCount++,i(t,r),i.subimage=function(t,e,r,a){var o=0|e,s=0|r,l=0|a,c=B();return L(c,n),c.width=0,c.height=0,O(c,t),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),R(c,W,o,s,l),Zt(),j(c),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Zt(),s.profile&&(n.stats.size=Vt(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var c=new Gt(G);$t[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(Lt.call(l),o=0;o<6;++o)u[o]=Tt();if("number"!==typeof t&&t){if("object"===typeof t)if(e)V(u[0],t),V(u[1],e),V(u[2],r),V(u[3],n),V(u[4],i),V(u[5],a);else if(Pt(l,t),P(c,t),"faces"in t){var d=t.faces;for(o=0;o<6;++o)L(u[o],c),V(u[o],d[o])}else for(o=0;o<6;++o)V(u[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)U(u[o],p,p)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)q(u[o],Y+o);for(It(l,G),Zt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[c.internalformat],h.type=T[c.type],h.mag=S[l.magFilter],h.min=A[l.minFilter],h.wrapS=M[l.wrapS],h.wrapT=M[l.wrapT],o=0;o<6;++o)St(u[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=B();return L(l,c),l.width=0,l.height=0,O(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),R(l,Y+t,a,o,s),Zt(),j(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Zt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t<Ht;++t)e.activeTexture(xt+t),e.bindTexture(W,null),Wt[t]=null;w($t).forEach(Xt),o.cubeCount=0,o.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Ht;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null)}w($t).forEach((function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var r=0;r<32;++r)if(0!==(t.mipmask&1<<r))if(t.target===W)e.texImage2D(W,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);It(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Ht;++t){var r=Wt[t];r&&(r.bindCount=0,r.unit=-1,Wt[t]=null),e.activeTexture(xt+t),e.bindTexture(W,null),e.bindTexture(G,null)}}}}It[32854]=2,It[32855]=2,It[36194]=2,It[34041]=4,It[33776]=.5,It[33777]=.5,It[33778]=1,It[33779]=1,It[35986]=.5,It[35987]=1,It[34798]=1,It[35840]=.5,It[35841]=.25,It[35842]=.5,It[35843]=.25,It[36196]=.5;var $t=36161,Ht=32854,Wt=[];function Gt(t,e,r){return Wt[t]*e*r}Wt[32854]=2,Wt[32855]=2,Wt[36194]=2,Wt[33189]=2,Wt[36168]=1,Wt[34041]=4,Wt[35907]=4,Wt[34836]=16,Wt[34842]=8,Wt[34843]=6;var Yt=36160,Zt=36161,Xt=3553,Kt=[];Kt[6408]=4,Kt[6407]=3;var Jt=[];Jt[5121]=1,Jt[5126]=4,Jt[36193]=2;var Qt=34963;function te(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var ee=5121;function re(t,e,r,n,i,a,o){function s(i){var a;a=null===e.next?ee:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;b(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(a===ee?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),t.pixelStorei(3333,4),t.readPixels(o,s,l,c,6408,a,u),u}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},(function(){r=s(t)})),r}(t):s(t)}}function ne(t){return function(t){for(var e,r="0123456789abcdef",n="",i=0;i<t.length;i++)e=t.charCodeAt(i),n+=r.charAt(e>>>4&15)+r.charAt(15&e);return n}(function(t){return ae(fe(ie(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i<t.length;)e=t.charCodeAt(i),r=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=r&&r<=57343&&(e=65536+((1023&e)<<10)+(1023&r),i++),e<=127?n+=String.fromCharCode(e):e<=2047?n+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function ie(t){for(var e=Array(t.length>>2),r=0;r<e.length;r++)e[r]=0;for(r=0;r<8*t.length;r+=8)e[r>>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}function ae(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}function oe(t,e){return t>>>e|t<<32-e}function se(t,e){return t>>>e}function le(t,e,r){return t&e^~t&r}function ce(t,e,r){return t&e^t&r^e&r}function ue(t){return oe(t,2)^oe(t,13)^oe(t,22)}function he(t){return oe(t,6)^oe(t,11)^oe(t,25)}function de(t){return oe(t,7)^oe(t,18)^se(t,3)}var pe=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function fe(t,e){var r,n,i,a,o,s,l,c,u,h,d,p,f,m=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,u=0;u<t.length;u+=16){for(r=m[0],n=m[1],i=m[2],a=m[3],o=m[4],s=m[5],l=m[6],c=m[7],h=0;h<64;h++)g[h]=h<16?t[h+u]:me(me(me(oe(f=g[h-2],17)^oe(f,19)^se(f,10),g[h-7]),de(g[h-15])),g[h-16]),d=me(me(me(me(c,he(o)),le(o,s,l)),pe[h]),g[h]),p=me(ue(r),ce(r,n,i)),c=l,l=s,s=o,o=me(a,d),a=i,i=n,n=r,r=me(d,p);m[0]=me(r,m[0]),m[1]=me(n,m[1]),m[2]=me(i,m[2]),m[3]=me(a,m[3]),m[4]=me(o,m[4]),m[5]=me(s,m[5]),m[6]=me(l,m[6]),m[7]=me(c,m[7])}return m}function me(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function ge(t){return Array.prototype.slice.call(t)}function ye(t){return ge(t).join("")}var ve="xyzw".split(""),xe="dither",be="blend.enable",_e="blend.color",we="blend.equation",ke="blend.func",Te="depth.enable",Se="depth.func",Ae="depth.range",Me="depth.mask",Ce="colorMask",Ee="cull.enable",Le="cull.face",Pe="frontFace",Ie="lineWidth",ze="polygonOffset.enable",Oe="polygonOffset.offset",De="sample.alpha",Re="sample.enable",Fe="sample.coverage",Be="stencil.enable",je="stencil.mask",Ne="stencil.func",Ue="stencil.opFront",Ve="stencil.opBack",qe="scissor.enable",$e="scissor.box",He="viewport",We="profile",Ge="framebuffer",Ye="vert",Ze="frag",Xe="elements",Ke="primitive",Je="count",Qe="offset",tr="instances",er="vao",rr="Width",nr="Height",ir=Ge+rr,ar=Ge+nr,or=He+rr,sr=He+nr,lr="drawingBuffer",cr=lr+rr,ur=lr+nr,hr=[ke,we,Ne,Ue,Ve,Fe,He,$e,Oe],dr=34962,pr=34963,fr=35664,mr=35665,gr=35666,yr=35667,vr=35668,xr=35669,br=35671,_r=35672,wr=35673,kr=35674,Tr=35675,Sr=35676,Ar=35678,Mr=35680,Cr=1028,Er=1029,Lr=2305,Pr=7680,Ir={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Or={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Dr={cw:2304,ccw:Lr};function Rr(t){return Array.isArray(t)||b(t)||_(t)}function Fr(t){return t.sort((function(t,e){return t===He?-1:e===He?1:t<e?-1:1}))}function Br(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function jr(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Nr(t){return new Br(!1,!1,!1,t)}function Ur(t,e){var r=t.type;if(0===r){var n=t.data.length;return new Br(!0,n>=1,n>=2,e)}if(4===r){var i=t.data;return new Br(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Br(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<t.data.length;++l){var c=t.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Br(a,o,s,e)}return new Br(3===r,2===r,1===r,e)}var Vr=new Br(!1,!1,!1,(function(){}));function qr(e,r,n,i,a,s,l,c,u,h,p,f,m,g,y,v){var x=h.Record,b={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(b.min=32775,b.max=32776);var _=n.angle_instanced_arrays,w=n.webgl_draw_buffers,k=n.oes_vertex_array_object,T={dirty:!0,profile:v.profile},S={},A=[],C={},E={};function L(t){return t.replace(".","_")}function P(t,e,r){var n=L(t);A.push(t),S[n]=T[n]=!!r,C[n]=e}function I(t,e,r){var n=L(t);A.push(t),Array.isArray(r)?(T[n]=r.slice(),S[n]=r.slice()):T[n]=S[n]=r,E[n]=e}function z(t){return!!isNaN(t)}P(xe,3024),P(be,3042),I(_e,"blendColor",[0,0,0,0]),I(we,"blendEquationSeparate",[32774,32774]),I(ke,"blendFuncSeparate",[1,0,1,0]),P(Te,2929,!0),I(Se,"depthFunc",513),I(Ae,"depthRange",[0,1]),I(Me,"depthMask",!0),I(Ce,Ce,[!0,!0,!0,!0]),P(Ee,2884),I(Le,"cullFace",Er),I(Pe,Pe,Lr),I(Ie,Ie,1),P(ze,32823),I(Oe,"polygonOffset",[0,0]),P(De,32926),P(Re,32928),I(Fe,"sampleCoverage",[1,!1]),P(Be,2960),I(je,"stencilMask",-1),I(Ne,"stencilFunc",[519,0,-1]),I(Ue,"stencilOpSeparate",[Cr,Pr,Pr,Pr]),I(Ve,"stencilOpSeparate",[Er,Pr,Pr,Pr]),P(qe,3089),I($e,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),I(He,He,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var O={gl:e,context:m,strings:r,next:S,current:T,draw:f,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Rr},D={primTypes:F,compareFuncs:zr,blendFuncs:Ir,blendEquations:b,stencilOps:Or,glTypes:M,orientationType:Dr};w&&(D.backBuffer=[Er],D.drawBuffer=d(i.maxDrawbuffers,(function(t){return 0===t?[0]:d(t,(function(t){return 36064+t}))})));var R=0;function B(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t((function(){e.push.apply(e,ge(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ge(arguments)),e.push(";")),t},toString:function(){return ye([r.length>0?"var "+r.join(",")+";":"",ye(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t((function(){e.apply(e,ge(arguments))}),{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===t&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(t),o.push(r),l},block:s,proc:function(e,r){var n=[];function i(){var t="a"+n.length;return n.push(t),t}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return u[e]=t(o,{arg:i,toString:function(){return ye(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var e=ye(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return t(r,{then:function(){return r.apply(r,ge(arguments)),this},else:function(){return n.apply(n,ge(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),ye(["if(",e,"){",i(),"}",t])}})},compile:function(){var t=['"use strict";',c,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e,n=ye(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(e=ne(n),r[e]))return r[e].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[e]=o),o.apply(null,a)}}}({cache:y}),n=e.link,i=e.global;e.id=R++,e.batchId="0";var a=n(O),o=e.shared={props:"a0"};Object.keys(O).forEach((function(t){o[t]=i.def(a,".",t)}));var s=e.next={},l=e.current={};Object.keys(E).forEach((function(t){Array.isArray(T[t])&&(s[t]=i.def(o.next,".",t),l[t]=i.def(o.current,".",t))}));var c=e.constants={};Object.keys(D).forEach((function(t){c[t]=i.def(JSON.stringify(D[t]))})),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(o.props,r.data);case 2:return t.def(o.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map((function(r){return e.invoke(t,r)}))}},e.attribCache={};var u={};return e.scopeAttrib=function(t){var e=r.id(t);if(e in u)return u[e];var i=h.scope[e];return i||(i=h.scope[e]=new x),u[e]=n(i)},e}function j(t,e,i,o,l){t.static,t.dynamic;var u=function(t,e){var r=t.static;if("string"===typeof r[Ze]&&"string"===typeof r[Ye]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"===typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(t,e),f=function(t){var e=t.static,r=t.dynamic;if(Ge in e){var n=e[Ge];return n?(n=c.getFramebuffer(n),Nr((function(t,e){var r=t.link(n),i=t.shared;e.set(i.framebuffer,".next",r);var a=i.context;return e.set(a,"."+ir,r+".width"),e.set(a,"."+ar,r+".height"),r}))):Nr((function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+ir,n+"."+cr),e.set(n,"."+ar,n+"."+ur),"null"}))}if(Ge in r){var i=r[Ge];return Ur(i,(function(t,e){var r=t.invoke(e,i),n=t.shared,a=n.framebuffer,o=e.def(a,".getFramebuffer(",r,")");e.set(a,".next",o);var s=n.context;return e.set(s,"."+ir,o+"?"+o+".width:"+s+"."+cr),e.set(s,"."+ar,o+"?"+o+".height:"+s+"."+ur),o}))}return null}(t),m=function(t,e){var r=t.static,n=t.dynamic;function i(t){if(t in r){var i,a,o=r[t],s=!0,l=0|o.x,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Br(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var r=t.shared.context,n=i;"width"in o||(n=e.def(r,".",ir,"-",l));var s=a;return"height"in o||(s=e.def(r,".",ar,"-",c)),[l,c,n,s]}))}if(t in n){var u=n[t],h=Ur(u,(function(t,e){var r=t.invoke(e,u),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0");return[i,a,e.def('"width" in ',r,"?",r,".width|0:","(",n,".",ir,"-",i,")"),e.def('"height" in ',r,"?",r,".height|0:","(",n,".",ar,"-",a,")")]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new Br(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",ir),e.def(r,".",ar)]})):null}var a=i(He);if(a){var o=a;a=new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,"."+or,r[2]),e.set(n,"."+sr,r[3]),r}))}return{viewport:a,scissor_box:i($e)}}(t,f),g=function(t){var e=t.static,r=t.dynamic,n={},i=!1,a=function(){if(er in e){var t=e[er];return null!==t&&null===h.getVAO(t)&&(t=h.createVAO(t)),i=!0,n.vao=t,Nr((function(e){var r=h.getVAO(t);return r?e.link(r):"null"}))}if(er in r){i=!0;var a=r[er];return Ur(a,(function(t,e){var r=t.invoke(e,a);return e.def(t.shared.vao+".getVAO("+r+")")}))}return null}(),o=!1,l=function(){if(Xe in e){var t=e[Xe];if(n.elements=t,Rr(t)){var l=n.elements=s.create(t,!0);t=s.getElements(l),o=!0}else t&&(t=s.getElements(t),o=!0);var c=Nr((function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null}));return c.value=t,c}if(Xe in r){o=!0;var u=r[Xe];return Ur(u,(function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,u),o=e.def("null"),s=e.def(n,"(",a,")"),l=t.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return e.entry(l),e.exit(t.cond(s).then(i,".destroyStream(",o,");")),t.ELEMENTS=o,o}))}return i?new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.elements+".getElements("+t.shared.vao+".currentVAO.elements):null")})):null}();function c(t,s){if(t in e){var l=0|e[t];return s?n.offset=l:n.instances=l,Nr((function(t,e){return s&&(t.OFFSET=l),l}))}if(t in r){var c=r[t];return Ur(c,(function(t,e){var r=t.invoke(e,c);return s&&(t.OFFSET=r),r}))}if(s){if(o)return Nr((function(t,e){return t.OFFSET=0,0}));if(i)return new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.offset:0")}))}else if(i)return new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.instances:-1")}));return null}var u=c(Qe,!0),d=function(){if(Ke in e){var t=e[Ke];return n.primitive=t,Nr((function(e,r){return F[t]}))}if(Ke in r){var s=r[Ke];return Ur(s,(function(t,e){var r=t.constants.primTypes,n=t.invoke(e,s);return e.def(r,"[",n,"]")}))}return o?jr(l)?l.value?Nr((function(t,e){return e.def(t.ELEMENTS,".primType")})):Nr((function(){return 4})):new Br(l.thisDep,l.contextDep,l.propDep,(function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)})):i?new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao+".currentVAO?"+t.shared.vao+".currentVAO.primitive:4")})):null}(),p=function(){if(Je in e){var t=0|e[Je];return n.count=t,Nr((function(){return t}))}if(Je in r){var s=r[Je];return Ur(s,(function(t,e){return t.invoke(e,s)}))}return o?jr(l)?l?u?new Br(u.thisDep,u.contextDep,u.propDep,(function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)})):Nr((function(t,e){return e.def(t.ELEMENTS,".vertCount")})):Nr((function(){return-1})):new Br(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.propDep,(function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")})):i?new Br(a.thisDep,a.contextDep,a.propDep,(function(t,e){return e.def(t.shared.vao,".currentVAO?",t.shared.vao,".currentVAO.count:-1")})):null}(),f=c(tr,!1);return{elements:l,primitive:d,count:p,instances:f,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(t),y=function(t){var e=t.static,r=t.dynamic,n={};return A.forEach((function(t){var i=L(t);function a(a,o){if(t in e){var s=a(e[t]);n[i]=Nr((function(){return s}))}else if(t in r){var l=r[t];n[i]=Ur(l,(function(t,e){return o(t,e,t.invoke(e,l))}))}}switch(t){case Ee:case be:case xe:case Be:case Te:case qe:case ze:case De:case Re:case Me:return a((function(t){return t}),(function(t,e,r){return r}));case Se:return a((function(t){return zr[t]}),(function(t,e,r){var n=t.constants.compareFuncs;return e.def(n,"[",r,"]")}));case Ae:return a((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e.def("+",r,"[1]")]}));case ke:return a((function(t){var e="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,n="dstRGB"in t?t.dstRGB:t.dst,i="dstAlpha"in t?t.dstAlpha:t.dst;return[Ir[e],Ir[n],Ir[r],Ir[i]]}),(function(t,e,r){var n=t.constants.blendFuncs;function i(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}var a=i("src","RGB"),o=i("dst","RGB"),s=e.def(n,"[",a,"]"),l=e.def(n,"[",i("src","Alpha"),"]");return[s,e.def(n,"[",o,"]"),l,e.def(n,"[",i("dst","Alpha"),"]")]}));case we:return a((function(t){return"string"===typeof t?[b[t],b[t]]:"object"===typeof t?[b[t.rgb],b[t.alpha]]:void 0}),(function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def(),o=t.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(o),[i,a]}));case _e:return a((function(t){return d(4,(function(e){return+t[e]}))}),(function(t,e,r){return d(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case je:return a((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case Ne:return a((function(t){var e=t.cmp||"keep",r=t.ref||0,n="mask"in t?t.mask:-1;return[zr[e],r,n]}),(function(t,e,r){var n=t.constants.compareFuncs;return[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Pr),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Ue:case Ve:return a((function(e){var r=e.fail||"keep",n=e.zfail||"keep",i=e.zpass||"keep";return[t===Ve?Er:Cr,Or[r],Or[n],Or[i]]}),(function(e,r,n){var i=e.constants.stencilOps;function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",Pr)}return[t===Ve?Er:Cr,a("fail"),a("zfail"),a("zpass")]}));case Oe:return a((function(t){return[0|t.factor,0|t.units]}),(function(t,e,r){return[e.def(r,".factor|0"),e.def(r,".units|0")]}));case Le:return a((function(t){var e=0;return"front"===t?e=Cr:"back"===t&&(e=Er),e}),(function(t,e,r){return e.def(r,'==="front"?',Cr,":",Er)}));case Ie:return a((function(t){return t}),(function(t,e,r){return r}));case Pe:return a((function(t){return Dr[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:'+Lr)}));case Ce:return a((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return d(4,(function(t){return"!!"+r+"["+t+"]"}))}));case Fe:return a((function(t){return["value"in t?t.value:1,!!t.invert]}),(function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]}))}})),n}(t),v=function(t,e,n){var i=t.static,a=t.dynamic;function o(t){if(t in i){var e=r.id(i[t]),n=Nr((function(){return e}));return n.id=e,n}if(t in a){var o=a[t];return Ur(o,(function(t,e){var r=t.invoke(e,o);return e.def(t.shared.strings,".id(",r,")")}))}return null}var s,l=o(Ze),c=o(Ye),u=null;return jr(l)&&jr(c)?(u=p.program(c.id,l.id,null,n),s=Nr((function(t,e){return t.link(u)}))):s=new Br(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(t,e){var r,n=t.shared.shader;r=l?l.append(t,e):e.def(n,".",Ze);var i=n+".program("+(c?c.append(t,e):e.def(n,".",Ye))+","+r;return e.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(t,0,u);function _(t){var e=m[t];e&&(y[t]=e)}_(He),_(L($e));var w=Object.keys(y).length>0,k={framebuffer:f,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(k.profile=function(t){var e,r=t.static,n=t.dynamic;if(We in r){var i=!!r[We];(e=Nr((function(t,e){return i}))).enable=i}else if(We in n){var a=n[We];e=Ur(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),k.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r,i=e[t];if("number"===typeof i||"boolean"===typeof i)r=Nr((function(){return i}));else if("function"===typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Nr((function(t){return t.link(i)})):"framebuffer"!==a&&"framebufferCube"!==a||(r=Nr((function(t){return t.link(i.color[0])})))}else H(i)&&(r=Nr((function(t){return t.global.def("[",d(i.length,(function(t){return i[t]})),"]")})));r.value=i,n[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),k.drawVAO=k.scopeVAO=g.vao,!k.drawVAO&&v.program&&!u&&n.angle_instanced_arrays&&g.static.elements){var T=!0,S=v.program.attributes.map((function(t){var r=e.static[t];return T=T&&!!r,r}));if(T&&S.length>0){var C=h.getVAO(h.createVAO({attributes:S,elements:g.static.elements}));k.drawVAO=new Br(null,null,null,(function(t,e){return t.link(C)})),k.useVAO=!0}}return u?k.useVAO=!0:k.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach((function(t){var n=e[t],o=r.id(t),s=new x;if(Rr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,dr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"===typeof c?s.x=c:ve.forEach((function(t,e){e<c.length&&(s[t]=c[e])}))}else{l=Rr(n.buffer)?a.getBuffer(a.create(n.buffer,dr,!1,!0)):a.getBuffer(n.buffer);var u=0|n.offset,h=0|n.stride,d=0|n.size,p=!!n.normalized,f=0;"type"in n&&(f=M[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=d,s.normalized=p,s.type=f||l.dtype,s.offset=u,s.stride=h,s.divisor=m}}i[t]=Nr((function(t,e){var r=t.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach((function(t){n[t]=s[t]})),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n}))})),Object.keys(n).forEach((function(t){var e=n[t];i[t]=Ur(e,(function(t,r){var n=t.invoke(r,e),i=t.shared,a=t.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},c=new x;c.state=1,Object.keys(c).forEach((function(t){l[t]=r.def(""+c[t])}));var u=l.buffer,h=l.type;function d(t){r(l[t],"=",n,".",t,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",dr,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[ve[0]],"=",n,".constant;",ve.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",ve.map((function(t,e){return l[t]+"="+n+".constant.length>"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",dr,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),k.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Nr((function(t,e){return"number"===typeof r||"boolean"===typeof r?""+r:t.link(r)}))})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),k}function N(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach((function(a){e.save(n,"."+a);var o=r[a].append(t,e);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),e(i)}function U(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;w&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function V(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");A.forEach((function(e){var n,u,h=L(e);if(!(h in r.state))if(h in o){n=o[h],u=a[h];var p=d(T[h].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(p.map((function(t,e){return t+"!=="+u+"["+e+"]"})).join("||")).then(i,".",E[h],"(",p,");",p.map((function(t,e){return u+"["+e+"]="+t})).join(";"),";"))}else{n=c.def(l,".",h);var f=t.cond(n,"!==",s,".",h);c(f),h in C?f(t.cond(n).then(i,".enable(",C[h],");").else(i,".disable(",C[h],");"),s,".",h,"=",n,";"):f(i,".",E[h],"(",n,");",s,".",h,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function q(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;Fr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(t,e);if(C[a]){var h=C[a];jr(c)?(i=t.link(u,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",u,";"))}else if(H(u)){var d=o[a];e(l,".",E[a],"(",u,");",u.map((function(t,e){return d+"["+e+"]="+t})).join(";"),";")}else jr(c)?(i=t.link(u,{stable:!0}),e(l,".",E[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",E[a],"(",u,");",s,".",a,"=",u,";")}}))}function $(t,e){_&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function W(t,e,r,n,i){var a,o,s,l=t.shared,c=t.stats,u=l.current,h=l.timer,d=r.profile;function p(){return"undefined"===typeof performance?"Date.now()":"performance.now()"}function f(t){t(a=e.def(),"=",p(),";"),"string"===typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(d){if(jr(d))return void(d.enable?(f(e),m(e.exit),y("true")):y("false"));y(s=d.append(t,e))}else s=e.def(u,".profile");var v=t.block();f(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function G(t,e,r,n,i){var a=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Vr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];function p(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",d.map((function(t){return l+"."+t+"!=="+i[t]})).join("||"),"){",o,".bindBuffer(",dr,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",d.map((function(t){return l+"."+t+"="+i[t]+";"})).join(""),"}"),_){var c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function f(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",ve.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",ve.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?p():2===c?f():(e("if(",c,"===",1,"){"),p(),e("}else{"),f(),e("}"))}(t.link(n),function(t){switch(t){case fr:case yr:case br:return 2;case mr:case vr:case _r:return 3;case gr:case xr:case wr:return 4;default:return 1}}(n.info.type),o)}))}function Y(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u<i.length;++u){var h,p=i[u],f=p.name,m=p.info.type,g=n.uniforms[f],y=t.link(p)+".location";if(g){if(!a(g))continue;if(jr(g)){var v=g.value;if(m===Ar||m===Mr){var x=t.link(v._texture||v.color[0]._texture);e(c,".uniform1i(",y,",",x+".bind());"),e.exit(x,".unbind();")}else if(m===kr||m===Tr||m===Sr){var b=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),_=2;m===Tr?_=3:m===Sr&&(_=4),e(c,".uniformMatrix",_,"fv(",y,",false,",b,");")}else{switch(m){case 5126:s="1f";break;case fr:s="2f";break;case mr:s="3f";break;case gr:s="4f";break;case 35670:case 5124:s="1i";break;case br:case yr:s="2i";break;case _r:case vr:s="3i";break;case wr:case xr:s="4i"}e(c,".uniform",s,"(",y,",",H(v)?Array.prototype.slice.call(v):v,");")}continue}h=g.append(t,e)}else{if(!a(Vr))continue;h=e.def(l.uniforms,"[",r.id(f),"]")}m===Ar?e("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}"):m===Mr&&e("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}");var w=1;switch(m){case Ar:case Mr:var k=e.def(h,"._texture");e(c,".uniform1i(",y,",",k,".bind());"),e.exit(k,".unbind();");continue;case 5124:case 35670:s="1i";break;case yr:case br:s="2i",w=2;break;case vr:case _r:s="3i",w=3;break;case xr:case wr:s="4i",w=4;break;case 5126:s="1f";break;case fr:s="2f",w=2;break;case mr:s="3f",w=3;break;case gr:s="4f",w=4;break;case kr:s="Matrix2fv";break;case Tr:s="Matrix3fv";break;case Sr:s="Matrix4fv"}if("M"===s.charAt(0)){e(c,".uniform",s,"(",y,",");var T=Math.pow(m-kr+2,2),S=t.global.def("new Float32Array(",T,")");Array.isArray(h)?e("false,(",d(T,(function(t){return S+"["+t+"]="+h[t]})),",",S,")"):e("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",d(T,(function(t){return S+"["+t+"]="+h+"["+t+"]"})),",",S,")"),e(");")}else if(w>1){for(var A=[],M=[],C=0;C<w;++C)Array.isArray(h)?M.push(h[C]):M.push(e.def(h+"["+C+"]")),o&&A.push(e.def());o&&e("if(!",t.batchId,"||",A.map((function(t,e){return t+"!=="+M[e]})).join("||"),"){",A.map((function(t,e){return t+"="+M[e]+";"})).join("")),e(c,".uniform",s,"(",y,",",M.join(","),");"),o&&e("}")}else{if(o){var E=e.def();e("if(!",t.batchId,"||",E,"!==",h,"){",E,"=",h,";")}e(c,".uniform",s,"(",y,",",h,");"),o&&e("}")}}}function Z(t,e,r,n){var i=t.shared,a=i.gl,o=i.draw,s=n.draw,l=function(){var l,c=s.elements,u=e;return c?((c.contextDep&&n.contextDynamic||c.propDep)&&(u=r),l=c.append(t,u),s.elementsActive&&u("if("+l+")"+a+".bindBuffer("+pr+","+l+".buffer.buffer);")):(l=u.def(),u(l,"=",o,".",Xe,";","if(",l,"){",a,".bindBuffer(",pr,",",l,".buffer.buffer);}","else if(",i.vao,".currentVAO){",l,"=",t.shared.elements+".getElements("+i.vao,".currentVAO.elements);",k?"":"if("+l+")"+a+".bindBuffer("+pr+","+l+".buffer.buffer);","}")),l}();function c(i){var a=s[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(o,".",i)}var u,h,d=c(Ke),p=c(Qe),f=function(){var i,a=s.count,l=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(l=r),i=a.append(t,l)):i=l.def(o,".",Je),i}();if("number"===typeof f){if(0===f)return}else r("if(",f,"){"),r.exit("}");_&&(u=c(tr),h=t.instancing);var m=l+".type",g=s.elements&&jr(s.elements)&&!s.vaoActive;function y(){function t(){r(h,".drawElementsInstancedANGLE(",[d,f,m,p+"<<(("+m+"-5121)>>1)",u],");")}function e(){r(h,".drawArraysInstancedANGLE(",[d,p,f,u],");")}l&&"null"!==l?g?t():(r("if(",l,"){"),t(),r("}else{"),e(),r("}")):e()}function v(){function t(){r(a+".drawElements("+[d,f,m,p+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(a+".drawArrays("+[d,p,f]+");")}l&&"null"!==l?g?t():(r("if(",l,"){"),t(),r("}else{"),e(),r("}")):e()}_&&("number"!==typeof u||u>=0)?"string"===typeof u?(r("if(",u,">0){"),y(),r("}else if(",u,"<0){"),v(),r("}")):y():v()}function X(t,e,r,n,i){var a=B(),o=a.proc("body",i);return _&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function K(t,e,r,n){$(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),G(t,e,r,n.attributes,(function(){return!0}))),Y(t,e,r,n.uniforms,(function(){return!0}),!1),Z(t,e,e,r)}function J(t,e,r,n){function i(){return!0}t.batchId="a1",$(t,e),G(t,e,r,n.attributes,i),Y(t,e,r,n.uniforms,i,!1),Z(t,e,e,r)}function Q(t,e,r,n){$(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&N(t,l,r.context),r.needsFramebuffer&&U(t,l,r.framebuffer),q(t,l,r.state,c),r.profile&&c(r.profile)&&W(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),G(t,s,r,n.attributes,u),G(t,l,r,n.attributes,c)),Y(t,s,r,n.uniforms,u,!1),Y(t,l,r,n.uniforms,c,!0),Z(t,s,l,r);else{var h=t.global.def("{}"),d=r.shader.progVar.append(t,l),p=l.def(d,".id"),f=l.def(h,"[",p,"]");l(t.shared.gl,".useProgram(",d,".program);","if(!",f,"){",f,"=",h,"[",p,"]=",t.link((function(t){return X(J,0,r,t,2)})),"(",d,");}",f,".call(this,a0[",a,"],",a,");")}}function tt(t,e,r){var n=e.static[r];if(n&&function(t){if("object"===typeof t&&!H(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(o.isDynamic(t[e[r]]))return!0;return!1}}(n)){var i=t.global,a=Object.keys(n),s=!1,l=!1,c=!1,u=t.global.def("{}");a.forEach((function(e){var r=n[e];if(o.isDynamic(r)){"function"===typeof r&&(r=n[e]=o.unbox(r));var a=Ur(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",e,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(t.link(r))}i(";")}})),e.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:c,ref:u,append:function(t,e){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=t.invoke(e,i);e(u,".",r,"=",a,";")}}))}}),delete e.static[r]}}return{next:S,current:T,procs:function(){var t=B(),e=t.proc("poll"),r=t.proc("refresh"),a=t.block();e(a),r(a);var o,s=t.shared,l=s.gl,c=s.next,u=s.current;a(u,".dirty=false;"),U(t,e),U(t,r,null,!0),_&&(o=t.link(_)),n.oes_vertex_array_object&&r(t.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var h=r.def(s.attributes),p=r.def(0),f=t.cond(p,".buffer");f.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",dr,",",p,".buffer.buffer);",l,".vertexAttribPointer(i,",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;");var m=t.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",p,"=",h,"[i];",f,"}"),_&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",h,"[i].divisor);","}"),r(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(C).forEach((function(n){var i=C[n],o=a.def(c,".",n),s=t.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),e("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(E).forEach((function(n){var i,o,s=E[n],h=T[n],p=t.block();if(p(l,".",s,"("),H(h)){var f=h.length;i=t.global.def(c,".",n),o=t.global.def(u,".",n),p(d(f,(function(t){return i+"["+t+"]"})),");",d(f,(function(t){return o+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",d(f,(function(t){return i+"["+t+"]!=="+o+"["+t+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),p(i,");",u,".",n,"=",i,";"),e("if(",i,"!==",o,"){",p,"}");r(p)})),t.compile()}(),compile:function(e,n,i,a,o){var s=B();s.stats=s.link(o),Object.keys(n.static).forEach((function(t){tt(s,n,t)})),hr.forEach((function(t){tt(s,e,t)}));var l=j(e,n,i,a);return l.shader.program&&(l.shader.program.attributes.sort((function(t,e){return t.name<e.name?-1:1})),l.shader.program.uniforms.sort((function(t,e){return t.name<e.name?-1:1}))),function(t,e){var r=t.proc("draw",1);$(t,r),N(t,r,e.context),U(t,r,e.framebuffer),V(t,r,e),q(t,r,e.state),W(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)K(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link((function(t){return X(K,0,e,t,1)})),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(N(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),Fr(Object.keys(e.state)).forEach((function(r){var a=e.state[r],o=a.append(t,n);H(o)?o.forEach((function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))})):jr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),W(t,n,e,!0,!0),[Xe,Qe,Je,tr,Ke].forEach((function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}})),Object.keys(e.uniforms).forEach((function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map((function(e){return z(e)?e:t.link(e,{stable:!0})}))+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(e.attributes).forEach((function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach((function(t){n.set(a,"."+t,i[t])}))})),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(Ye),s(Ze),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,l),function(t,e){var r=t.proc("batch",2);t.batchId="0",$(t,r);var n=!1,i=!0;Object.keys(e.context).forEach((function(t){n=n||e.context[t].propDep})),n||(N(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(t,r,a)):U(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),V(t,r,e),q(t,r,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||W(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)Q(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),d=r.def(u,"[",h,"]");r(t.cond(d).then(d,".call(this,a0,a1);").else(d,"=",u,"[",h,"]=",t.link((function(t){return X(Q,0,e,t,2)})),"(",c,");",d,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),t(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var $r=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(t,e,r){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var c=[],u=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),l(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var t,r,a=i.length;if(0!==a){u.length=Math.max(u.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,u[0]=0;var l,h=0;for(t=0,r=0;r<i.length;++r){var d=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(d,34919)?(h+=e.ext_disjoint_timer_query.getQueryObjectEXT(d,34918),n(d)):i[t++]=d,c[r+1]=h,u[r+1]=t}for(i.length=t,t=0,r=0;r<s.length;++r){var p=s[r],f=p.startQueryIndex,m=p.endQueryIndex;p.sum+=c[m]-c[f];var g=u[f],y=u[m];y===g?(p.stats.gpuTime+=p.sum/1e6,l=p,o.push(l)):(p.startQueryIndex=g,p.endQueryIndex=y,s[t++]=p)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var t=0;t<r.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(r[t]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}},Hr="webglcontextlost",Wr="webglcontextrestored";function Gr(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}return function(e){var r=h(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch(a){}return!!n}for(var i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!n(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(t){if(r[t]&&!n(t))throw new Error("(regl): error restoring extension "+t)}))}}}(n,r));if(!a)return null;var c=function(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}(),u={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=r.cachedCode||{},p=a.extensions,f=$r(0,p),k=l(),T=n.drawingBufferWidth,S=n.drawingBufferHeight,A={tick:0,time:0,viewportWidth:T,viewportHeight:S,framebufferWidth:T,framebufferHeight:S,drawingBufferWidth:T,drawingBufferHeight:S,pixelRatio:r.pixelRatio},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},q=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var a=!!e.oes_texture_float;if(a){var o=t.createTexture();t.bindTexture(g,o),t.texImage2D(g,0,y,1,1,0,y,v,null);var s=t.createFramebuffer();if(t.bindFramebuffer(x,s),t.framebufferTexture2D(x,36064,g,o,0),t.bindTexture(g,null),36053!==t.checkFramebufferStatus(x))a=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var l=m.allocType(v,4);t.readPixels(0,0,1,1,y,v,l),t.getError()?a=!1:(t.deleteFramebuffer(s),t.deleteTexture(o),a=1===l[0]),m.freeType(l)}}var c=!0;if("undefined"===typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var u=t.createTexture(),h=m.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,u),t.texImage2D(34069,0,y,3,3,0,y,5121,h),m.freeType(h),t.bindTexture(34067,null),t.deleteTexture(u),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:a,npotTextureCube:c}}(n,p),$=function(t,e,r,n){var i=0,a={};function o(e){this.id=i++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=P,this.persistentData=null,r.profile&&(this.stats={size:0})}o.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){u(this)};var s=[];function l(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function c(t,e,r,n,i,a){var o,s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||I,e.length>0)if(Array.isArray(e[0])){o=L(e);for(var c=1,u=1;u<o.length;++u)c*=o[u];t.dimension=c,l(t,s=E(e,o,t.dtype),r),a?t.persistentData=s:m.freeType(s)}else if("number"===typeof e[0]){t.dimension=i;var h=m.allocType(t.dtype,e.length);D(h,e),l(t,h,r),a?t.persistentData=h:m.freeType(h)}else b(e[0])&&(t.dimension=e[0].length,t.dtype=n||O(e[0])||I,l(t,s=E(e,[e.length,e[0].length],t.dtype),r),a?t.persistentData=s:m.freeType(s))}else if(b(e))t.dtype=n||O(e),t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(_(e)){o=e.shape;var d=e.stride,p=e.offset,f=0,g=0,y=0,v=0;1===o.length?(f=o[0],g=1,y=d[0],v=0):2===o.length&&(f=o[0],g=o[1],y=d[0],v=d[1]),t.dtype=n||O(e.data)||I,t.dimension=g;var x=m.allocType(t.dtype,f*g);R(x,e.data,f,g,y,v,p),l(t,x,r),a?t.persistentData=x:m.freeType(x)}else e instanceof ArrayBuffer&&(t.dtype=P,t.dimension=i,l(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function u(r){e.bufferCount--,n(r);var i=r.buffer;t.deleteBuffer(i),r.buffer=null,delete a[r.id]}return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(n,i,s,l){e.bufferCount++;var h=new o(i);function d(e){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(e)||b(e)||_(e)||e instanceof ArrayBuffer?i=e:"number"===typeof e?a=0|e:e&&("data"in e&&(i=e.data),"usage"in e&&(n=C[e.usage]),"type"in e&&(o=M[e.type]),"dimension"in e&&(s=0|e.dimension),"length"in e&&(a=0|e.length)),h.bind(),i?c(h,i,n,o,s,l):(a&&t.bufferData(h.type,a,n),h.dtype=o||P,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),d}function p(e,r){t.bufferSubData(h.type,r,e)}return a[h.id]=h,s||d(n),d._reglType="buffer",d._buffer=h,d.subdata=function(t,e){var r,n=0|(e||0);if(h.bind(),b(t)||t instanceof ArrayBuffer)p(t,n);else if(Array.isArray(t)){if(t.length>0)if("number"===typeof t[0]){var i=m.allocType(h.dtype,t.length);D(i,t),p(i,n),m.freeType(i)}else if(Array.isArray(t[0])||b(t[0])){r=L(t);var a=E(t,r,h.dtype);p(a,n),m.freeType(a)}}else if(_(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var f=Array.isArray(t.data)?h.dtype:O(t.data),g=m.allocType(f,s*l);R(g,t.data,s,l,c,u,t.offset),p(g,n),m.freeType(g)}return d},r.profile&&(d.stats=h.stats),d.destroy=function(){u(h)},d},createStream:function(t,e){var r=s.pop();return r||(r=new o(t)),r.bind(),c(r,e,35040,0,1,!1),r},destroyStream:function(t){s.push(t)},clear:function(){w(a).forEach(u),s.forEach(u)},getBuffer:function(t){return t&&t._buffer instanceof o?t._buffer:null},restore:function(){w(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:c}}(n,u,r,(function(t){return W.destroyBuffer(t)})),H=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:j};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;c||b(i)&&(!_(i)||b(i.data))||(h=e.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var d=s;d<0&&(d=n.buffer.byteLength,u===j?d>>=1:u===N&&(d>>=2)),n.vertCount=d;var p=o;if(o<0){p=4;var f=n.buffer.dimension;1===f&&(p=0),2===f&&(p=1),3===f&&(p=4)}n.primType=p}function u(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"===typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=B;else{var e=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(t)||b(t)||_(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=C[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?u=0|t.length:(u=s,h===j||5122===h?u*=2:h!==N&&5124!==h||(u*=4))),c(a,e,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"===typeof t&&t._elements instanceof s?t._elements:null},clear:function(){w(i).forEach(u)}}}(n,p,$,u),W=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new te;var u=0,h={},d={Record:te,scope:{},state:l,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&w(h).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(t){var e=new m;function r(t){var n;if(Array.isArray(t))n=t,e.elements&&e.ownsElements&&e.elements.destroy(),e.elements=null,e.ownsElements=!1,e.offset=0,e.count=0,e.instances=-1,e.primitive=4;else{if(t.elements){var o=t.elements;e.ownsElements?"function"===typeof o&&"elements"===o._reglType?(e.elements.destroy(),e.ownsElements=!1):(e.elements(o),e.ownsElements=!1):a.getElements(t.elements)?(e.elements=t.elements,e.ownsElements=!1):(e.elements=a.create(t.elements),e.ownsElements=!0)}else e.elements=null,e.ownsElements=!1;n=t.attributes,e.offset=0,e.count=-1,e.instances=-1,e.primitive=4,e.elements&&(e.count=e.elements._elements.vertCount,e.primitive=e.elements._elements.primType),"offset"in t&&(e.offset=0|t.offset),"count"in t&&(e.count=0|t.count),"instances"in t&&(e.instances=0|t.instances),"primitive"in t&&(e.primitive=F[t.primitive])}var s={},l=e.attributes;l.length=n.length;for(var c=0;c<n.length;++c){var u,h=n[c],d=l[c]=new te,p=h.data||h;Array.isArray(p)||b(p)||_(p)?(e.buffers[c]&&(u=e.buffers[c],b(p)&&u._buffer.byteLength>=p.byteLength?u.subdata(p):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),d.buffer=i.getBuffer(u),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,s[c]=1):i.getBuffer(h)?(d.buffer=i.getBuffer(h),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):i.getBuffer(h.buffer)?(d.buffer=i.getBuffer(h.buffer),d.size=0|(+h.size||d.buffer.dimension),d.normalized=!!h.normalized||!1,d.type="type"in h?M[h.type]:d.buffer.dtype,d.offset=0|(h.offset||0),d.stride=0|(h.stride||0),d.divisor=0|(h.divisor||0),d.state=1):"x"in h&&(d.x=+h.x||0,d.y=+h.y||0,d.z=+h.z||0,d.w=+h.w||0,d.state=2)}for(var f=0;f<e.buffers.length;++f)!s[f]&&e.buffers[f]&&(e.buffers[f].destroy(),e.buffers[f]=null);return e.refresh(),r}return n.vaoCount+=1,r.destroy=function(){for(var t=0;t<e.buffers.length;++t)e.buffers[t]&&e.buffers[t].destroy();e.buffers.length=0,e.ownsElements&&(e.elements.destroy(),e.elements=null,e.ownsElements=!1),e.destroy()},r._vao=e,r._reglType="vao",r(t)},getVAO:function(t){return"function"===typeof t&&t._vao?t._vao:null},destroyBuffer:function(e){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===e&&(t.disableVertexAttribArray(r),n.buffer=null)}},setVAO:p()?function(t){if(t!==d.currentVAO){var e=p();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),d.currentVAO=t}}:function(e){if(e!==d.currentVAO){if(e)e.bindAttrs();else{for(var r=f(),n=0;n<l.length;++n){var i=l[n];i.buffer?(t.enableVertexAttribArray(n),i.buffer.bind(),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?t.bindBuffer(Qt,o.elements.buffer.buffer):t.bindBuffer(Qt,null)}d.currentVAO=e}},clear:p()?function(){w(h).forEach((function(t){t.destroy()}))}:function(){}};function p(){return e.oes_vertex_array_object}function f(){return e.angle_instanced_arrays}function m(){this.id=++u,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var t=p();this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var e=f(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(t.enableVertexAttribArray(n),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),e&&i.divisor&&e.vertexAttribDivisorANGLE(n,i.divisor)):(t.disableVertexAttribArray(n),t.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)t.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?t.bindBuffer(Qt,l.buffer.buffer):t.bindBuffer(Qt,null)},m.prototype.refresh=function(){var t=p();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),d.currentVAO=null,t.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var t=p();this===d.currentVAO&&(d.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},d}(n,p,q,u,$,H,V),G=function(e,r,n,i){var a={},o={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function l(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function c(t,n,i){var s=35632===t?a:o,l=s[n];if(!l){var c=r.str(n);l=e.createShader(t),e.shaderSource(l,c),e.compileShader(l),s[n]=l}return l}var u={},h=[],d=0;function p(t,e){this.id=d++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function f(t,n,a){var o,u,h=c(35632,t.fragId),d=c(35633,t.vertId),p=t.program=e.createProgram();if(e.attachShader(p,h),e.attachShader(p,d),a)for(o=0;o<a.length;++o){var f=a[o];e.bindAttribLocation(p,f[0],f[1])}e.linkProgram(p);var m=e.getProgramParameter(p,35718);i.profile&&(t.stats.uniformsCount=m);var g=t.uniforms;for(o=0;o<m;++o)if(u=e.getActiveUniform(p,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),e.getUniformLocation(p,v),u))}else l(g,new s(u.name,r.id(u.name),e.getUniformLocation(p,u.name),u));var x=e.getProgramParameter(p,35721);i.profile&&(t.stats.attributesCount=x);var b=t.attributes;for(o=0;o<x;++o)(u=e.getActiveAttrib(p,o))&&l(b,new s(u.name,r.id(u.name),e.getAttribLocation(p,u.name),u))}return i.profile&&(n.getMaxUniformsCount=function(){var t=0;return h.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var t=e.deleteShader.bind(e);w(a).forEach(t),a={},w(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var d=c[r];if(d&&(d.refCount++,!l))return d;var m=new p(i,r);return n.shaderCount++,f(m,0,l),d||(c[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t<h.length;++t)f(h[t],0,h[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(n,c,u,r),Y=qt(n,p,q,(function(){K.procs.poll()}),A,u,r),Z=function(t,e,r,n,i){var a={rgba4:Ht,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(a.srgba=35907),e.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),e.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach((function(t){var e=a[t];o[e]=t}));var s=0,l={};function c(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=Ht,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(e){var r=e.renderbuffer;t.bindRenderbuffer($t,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete l[e.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(l).forEach((function(e){t+=l[e].stats.size})),t}),{create:function(e,r){var s=new c(t.createRenderbuffer());function u(e,r){var n=0,l=0,c=Ht;if("object"===typeof e&&e){var h=e;if("shape"in h){var d=h.shape;n=0|d[0],l=0|d[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(c=a[h.format])}else"number"===typeof e?(n=0|e,l="number"===typeof r?0|r:n):e||(n=l=1);if(n!==s.width||l!==s.height||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,t.bindRenderbuffer($t,s.renderbuffer),t.renderbufferStorage($t,c,n,l),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(e,r),u.resize=function(e,r){var n=0|e,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,t.bindRenderbuffer($t,s.renderbuffer),t.renderbufferStorage($t,s.format,n,a),i.profile&&(s.stats.size=Gt(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){w(l).forEach(u)},restore:function(){w(l).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer($t,e.renderbuffer),t.renderbufferStorage($t,e.format,e.width,e.height)})),t.bindRenderbuffer($t,null)}}}(n,p,0,u,r),X=function(e,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,r){if(t)if(t.texture){var n=t.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else t.renderbuffer._renderbuffer.refCount+=1}function f(t,r){r&&(r.texture?e.framebufferTexture2D(Yt,t,r.target,r.texture._texture.texture,0):e.framebufferRenderbuffer(Yt,t,Zt,r.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=Xt,r=null,n=null,i=t;"object"===typeof t&&(i=t.data,"target"in t&&(e=0|t.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,e=Zt),new h(e,r,n)}function g(t,e,r,n,o){if(r){var s=i.create2D({width:t,height:e,format:n,type:o});return s._texture.refCount=0,new h(Xt,s,null)}var l=a.create({width:t,height:e,format:n});return l._renderbuffer.refCount=0,new h(Zt,null,l)}function y(t){return t&&(t.texture||t.renderbuffer)}function v(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}r.oes_texture_half_float&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,b={};function _(){this.id=x++,b[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function k(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function T(t){var r=t.framebuffer;e.deleteFramebuffer(r),t.framebuffer=null,o.framebufferCount--,delete b[t.id]}function S(t){var r;e.bindFramebuffer(Yt,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)f(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(Yt,36064+r,Xt,null,0);e.framebufferTexture2D(Yt,33306,Xt,null,0),e.framebufferTexture2D(Yt,36096,Xt,null,0),e.framebufferTexture2D(Yt,36128,Xt,null,0),f(36096,t.depthAttachment),f(36128,t.stencilAttachment),f(33306,t.depthStencilAttachment),e.checkFramebufferStatus(Yt),e.isContextLost(),e.bindFramebuffer(Yt,s.next?s.next.framebuffer:null),s.cur=s.next,e.getError()}function A(e,r){var n=new _;function i(t,e){var r,a=0,o=0,s=!0,u=!0,h=null,d=!0,f="rgba",v="uint8",x=1,b=null,_=null,w=null,T=!1;if("number"===typeof t)a=0|t,o=0|e||a;else if(t){var A=t;if("shape"in A){var M=A.shape;a=M[0],o=M[1]}else"radius"in A&&(a=o=A.radius),"width"in A&&(a=A.width),"height"in A&&(o=A.height);("color"in A||"colors"in A)&&(h=A.color||A.colors,Array.isArray(h)),h||("colorCount"in A&&(x=0|A.colorCount),"colorTexture"in A&&(d=!!A.colorTexture,f="rgba4"),"colorType"in A&&(v=A.colorType,d||("half float"===v||"float16"===v?f="rgba16f":"float"!==v&&"float32"!==v||(f="rgba32f"))),"colorFormat"in A&&(f=A.colorFormat,l.indexOf(f)>=0?d=!0:c.indexOf(f)>=0&&(d=!1))),("depthTexture"in A||"depthStencilTexture"in A)&&(T=!(!A.depthTexture&&!A.depthStencilTexture)),"depth"in A&&("boolean"===typeof A.depth?s=A.depth:(b=A.depth,u=!1)),"stencil"in A&&("boolean"===typeof A.stencil?u=A.stencil:(_=A.stencil,s=!1)),"depthStencil"in A&&("boolean"===typeof A.depthStencil?s=u=A.depthStencil:(w=A.depthStencil,s=!1,u=!1))}else a=o=1;var C=null,E=null,L=null,P=null;if(Array.isArray(h))C=h.map(m);else if(h)C=[m(h)];else for(C=new Array(x),r=0;r<x;++r)C[r]=g(a,o,d,f,v);a=a||C[0].width,o=o||C[0].height,b?E=m(b):s&&!u&&(E=g(a,o,T,"depth","uint32")),_?L=m(_):u&&!s&&(L=g(a,o,!1,"stencil","uint8")),w?P=m(w):!b&&!_&&u&&s&&(P=g(a,o,T,"depth stencil","depth stencil"));var I=null;for(r=0;r<C.length;++r)if(p(C[r]),C[r]&&C[r].texture){var z=Kt[C[r].texture._texture.format]*Jt[C[r].texture._texture.type];null===I&&(I=z)}return p(E),p(L),p(P),k(n),n.width=a,n.height=o,n.colorAttachments=C,n.depthAttachment=E,n.stencilAttachment=L,n.depthStencilAttachment=P,i.color=C.map(y),i.depth=y(E),i.stencil=y(L),i.depthStencil=y(P),i.width=n.width,i.height=n.height,S(n),i}return o.framebufferCount++,i(e,r),t(i,{resize:function(t,e){var r=Math.max(0|t,1),a=Math.max(0|e||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,S(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){T(n),k(n)},use:function(t){s.setFBO({framebuffer:i},t)}})}return t(s,{getFramebuffer:function(t){if("function"===typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof _)return e}return null},create:A,createCube:function(e){var r=Array(6);function n(e){var a,o,s={color:null},l=0,c=null,u="rgba",h="uint8",d=1;if("number"===typeof e)l=0|e;else if(e){var p=e;"shape"in p?l=p.shape[0]:("radius"in p&&(l=0|p.radius),"width"in p?l=0|p.width:"height"in p&&(l=0|p.height)),("color"in p||"colors"in p)&&(c=p.color||p.colors,Array.isArray(c)),c||("colorCount"in p&&(d=0|p.colorCount),"colorType"in p&&(h=p.colorType),"colorFormat"in p&&(u=p.colorFormat)),"depth"in p&&(s.depth=p.depth),"stencil"in p&&(s.stencil=p.stencil),"depthStencil"in p&&(s.depthStencil=p.depthStencil)}else l=1;if(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(d);var f={radius:l,format:u,type:h};for(a=0;a<d;++a)o[a]=i.createCube(f)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=A(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e<a.length;++e)a[e].resize(i);for(e=0;e<6;++e)r[e].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){w(b).forEach(T)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,w(b).forEach((function(t){t.framebuffer=e.createFramebuffer(),S(t)}))}})}(n,p,q,Y,Z,u),K=qr(n,c,p,q,$,H,0,X,{},W,G,V,A,f,d,r),J=re(n,X,K.procs.poll,A),Q=K.next,tt=n.canvas,et=[],rt=[],nt=[],it=[r.onDestroy],at=null;function ot(){if(0===et.length)return f&&f.update(),void(at=null);at=s.next(ot),gt();for(var t=et.length-1;t>=0;--t){var e=et[t];e&&e(A,null,0)}n.flush(),f&&f.update()}function st(){!at&&et.length>0&&(at=s.next(ot))}function lt(){at&&(s.cancel(ot),at=null)}function ct(t){t.preventDefault(),lt(),rt.forEach((function(t){t()}))}function ut(t){n.getError(),a.restore(),G.restore(),$.restore(),Y.restore(),Z.restore(),X.restore(),W.restore(),f&&f.restore(),K.procs.refresh(),st(),nt.forEach((function(t){t()}))}function ht(e){function r(t,e){var r={},n={};return Object.keys(t).forEach((function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}})),{dynamic:n,static:r}}var n=r(e.context||{},!0),i=r(e.uniforms||{},!0),a=r(e.attributes||{},!1),s=r(function(e){var r=t({},e);function n(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach((function(n){r[t+"."+n]=e[n]}))}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in e&&(r.vao=e.vao),r}(e),!1),l={gpuTime:0,cpuTime:0,count:0},c=K.compile(s,a,i,n,l),u=c.draw,h=c.batch,d=c.scope,p=[];return t((function(t,e){var r;if("function"===typeof t)return d.call(this,null,t,0);if("function"===typeof e)if("number"===typeof t)for(r=0;r<t;++r)d.call(this,null,e,r);else{if(!Array.isArray(t))return d.call(this,t,e,0);for(r=0;r<t.length;++r)d.call(this,t[r],e,r)}else if("number"===typeof t){if(t>0)return h.call(this,function(t){for(;p.length<t;)p.push(null);return p}(0|t),0|t)}else{if(!Array.isArray(t))return u.call(this,t);if(t.length)return h.call(this,t,t.length)}}),{stats:l,destroy:function(){c.destroy()}})}tt&&(tt.addEventListener(Hr,ct,!1),tt.addEventListener(Wr,ut,!1));var dt=X.setFBO=ht({framebuffer:o.define.call(null,1,"framebuffer")});function pt(t,e){var r=0;K.procs.poll();var i=e.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in e&&(n.clearDepth(+e.depth),r|=256),"stencil"in e&&(n.clearStencil(0|e.stencil),r|=1024),n.clear(r)}function ft(t){return et.push(t),st(),{cancel:function(){var e=Gr(et,t);et[e]=function t(){var e=Gr(et,t);et[e]=et[et.length-1],et.length-=1,et.length<=0&&lt()}}}}function mt(){var t=Q.viewport,e=Q.scissor_box;t[0]=t[1]=e[0]=e[1]=0,A.viewportWidth=A.framebufferWidth=A.drawingBufferWidth=t[2]=e[2]=n.drawingBufferWidth,A.viewportHeight=A.framebufferHeight=A.drawingBufferHeight=t[3]=e[3]=n.drawingBufferHeight}function gt(){A.tick+=1,A.time=vt(),mt(),K.procs.poll()}function yt(){Y.refresh(),mt(),K.procs.refresh(),f&&f.update()}function vt(){return(l()-k)/1e3}yt();var xt=t(ht,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var r=0;r<6;++r)dt(t({framebuffer:e.framebuffer.faces[r]},e),pt);else dt(e,pt);else pt(0,e)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:ht({}),buffer:function(t){return $.create(t,34962,!1,!1)},elements:function(t){return H.create(t,!1)},texture:Y.create2D,cube:Y.createCube,renderbuffer:Z.create,framebuffer:X.create,framebufferCube:X.createCube,vao:W.createVAO,attributes:i,frame:ft,on:function(t,e){var r;switch(t){case"frame":return ft(e);case"lost":r=rt;break;case"restore":r=nt;break;case"destroy":r=it}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}},limits:q,hasExtension:function(t){return q.extensions.indexOf(t.toLowerCase())>=0},read:J,destroy:function(){et.length=0,lt(),tt&&(tt.removeEventListener(Hr,ct),tt.removeEventListener(Wr,ut)),G.clear(),X.clear(),Z.clear(),W.clear(),Y.clear(),H.clear(),$.clear(),f&&f.clear(),it.forEach((function(t){t()}))},_gl:n,_refresh:yt,poll:function(){gt(),f&&f.update()},now:vt,stats:u,getCachedCode:function(){return d},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){d[t[0]]=t[1]}))}});return r.onDone(null,xt),xt}},"object"===typeof t&&"undefined"!==typeof e?e.exports=n():r.createREGL=n()}}),Qv=d({"node_modules/gl-util/context.js"(t,e){var r=jg();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"===typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"===typeof t&&(t={container:t}):t={},(t=i(t)||"string"===typeof(e=t).nodeName&&"function"===typeof e.appendChild&&"function"===typeof e.getBoundingClientRect?{container:t}:function(t){return"function"===typeof t.drawArrays||"function"===typeof t.drawElements}(t)?{gl:t}:r(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"===typeof t.container){var o=document.querySelector(t.container);if(!o)throw Error("Element "+t.container+" is not found");t.container=o}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),n(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{t.gl=t.canvas.getContext(r,t.attrs)}catch(e){}return t.gl})),t.gl}}}),tx=d({"node_modules/font-atlas/index.js"(t,e){var r=Xv(),n=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],i=t.canvas||document.createElement("canvas"),a=t.font,o="number"===typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||n;if(a&&"string"!==typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"===typeof s[0]&&"number"===typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),i.width=e[0],i.height=e[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var d=o[0]/2,p=o[1]/2;for(c=0;c<s.length;c++)h.fillText(s[c],d,p),(d+=o[0])>e[0]-o[0]/2&&(d=o[0]/2,p+=o[1]);return i}}}),ex=d({"node_modules/bit-twiddle/twiddle.js"(t){function e(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var e=t>>31;return(t^e)-e},t.min=function(t,e){return e^(t^e)&-(t<e)},t.max=function(t,e){return t^(t^e)&-(t<e)},t.isPow2=function(t){return!(t&t-1)&&!!t},t.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},t.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},t.countTrailingZeros=e,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(r),t.reverse=function(t){return r[255&t]<<24|r[t>>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},t.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},t.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},t.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},t.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>e(t)+1}}}),rx=d({"node_modules/dup/dup.js"(t,e){function r(t,e,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=r(t,e,n+1);return o}e.exports=function(t,e){switch("undefined"===typeof e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"===typeof t.length)return r(t,e,0)}return[]}}}),nx=d({"node_modules/typedarray-pool/pool.js"(t){var e=ex(),r=rx(),n=Vl().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:r([32,0]),UINT16:r([32,0]),UINT32:r([32,0]),BIGUINT64:r([32,0]),INT8:r([32,0]),INT16:r([32,0]),INT32:r([32,0]),BIGINT64:r([32,0]),FLOAT:r([32,0]),DOUBLE:r([32,0]),DATA:r([32,0]),UINT8C:r([32,0]),BUFFER:r([32,0])});var i="undefined"!==typeof Uint8ClampedArray,a="undefined"!==typeof BigUint64Array,o="undefined"!==typeof BigInt64Array,s=window.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=r([32,0])),s.BIGUINT64||(s.BIGUINT64=r([32,0])),s.BIGINT64||(s.BIGINT64=r([32,0])),s.BUFFER||(s.BUFFER=r([32,0]));var l=s.DATA,c=s.BUFFER;function u(t){if(t){var r=t.length||t.byteLength,n=e.log2(r);l[n].push(t)}}function h(t){t=e.nextPow2(t);var r=e.log2(t),n=l[r];return n.length>0?n.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(h(t),0,t)}function p(t){return new Uint16Array(h(2*t),0,t)}function f(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function b(t){return i?new Uint8ClampedArray(h(t),0,t):d(t)}function _(t){return a?new BigUint64Array(h(8*t),0,t):null}function w(t){return o?new BigInt64Array(h(8*t),0,t):null}function k(t){return new DataView(h(t),0,t)}function T(t){t=e.nextPow2(t);var r=e.log2(t),i=c[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[e.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,i=0|e.log2(r);l[i].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){u(t.buffer)},t.freeArrayBuffer=u,t.freeBuffer=function(t){c[e.log2(t.length)].push(t)},t.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return d(t);case"uint16":return p(t);case"uint32":return f(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return x(t);case"uint8_clamped":return b(t);case"bigint64":return w(t);case"biguint64":return _(t);case"buffer":return T(t);case"data":case"dataview":return k(t);default:return null}return null},t.mallocArrayBuffer=h,t.mallocUint8=d,t.mallocUint16=p,t.mallocUint32=f,t.mallocInt8=m,t.mallocInt16=g,t.mallocInt32=y,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=x,t.mallocUint8Clamped=b,t.mallocBigUint64=_,t.mallocBigInt64=w,t.mallocDataView=k,t.mallocBuffer=T,t.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}}),ix=d({"node_modules/is-plain-obj/index.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}}}),ax=d({"node_modules/parse-unit/index.js"(t,e){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}}}),ox=d({"node_modules/to-px/topx.js"(t,e){var r=ax();function n(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*i(n[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}e.exports=i}}),sx=d({"node_modules/detect-kerning/index.js"(t,e){e.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var i,o={},s=16,l=.05;e&&(2===e.length&&"number"===typeof e[0]?i=a(e):Array.isArray(e)?i=e:(e.o?i=a(e.o):e.pairs&&(i=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),i||(i=n),r.font=s+"px "+t;for(var c=0;c<i.length;c++){var u=i[c],h=r.measureText(u[0]).width+r.measureText(u[1]).width,d=r.measureText(u).width;if(Math.abs(h-d)>s*l){var p=(d-h)/s;o[u]=1e3*p}}return o}function a(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i<t[1];i++){var a=n+String.fromCharCode(i);e.push(a)}return e}i.createPairs=a,i.ascii=n}}),lx=d({"node_modules/font-measure/index.js"(t,e){function r(t,e){e||(e={}),("string"===typeof t||Array.isArray(t))&&(e.family=t);var o=Array.isArray(e.family)?e.family.join(", "):e.family;if(!o)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",c=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+o,e.origin||"top");if(r.cache[o]&&s<=r.cache[o].em)return n(r.cache[o],c);var u=e.canvas||r.canvas,h=u.getContext("2d"),d={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,h.font=t;var f="H",m={top:0};h.clearRect(0,0,p,p),h.textBaseline="top",h.fillStyle="black",h.fillText(f,0,0);var g=i(h.getImageData(0,0,p,p));h.clearRect(0,0,p,p),h.textBaseline="bottom",h.fillText(f,0,p);var y=i(h.getImageData(0,0,p,p));m.lineHeight=m.bottom=p-y+g,h.clearRect(0,0,p,p),h.textBaseline="alphabetic",h.fillText(f,0,p);var v=p-i(h.getImageData(0,0,p,p))-1+g;m.baseline=m.alphabetic=v,h.clearRect(0,0,p,p),h.textBaseline="middle",h.fillText(f,0,.5*p);var x=i(h.getImageData(0,0,p,p));m.median=m.middle=p-x-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="hanging",h.fillText(f,0,.5*p);var b=i(h.getImageData(0,0,p,p));m.hanging=p-b-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="ideographic",h.fillText(f,0,p);var _=i(h.getImageData(0,0,p,p));if(m.ideographic=p-_-1+g,d.upper&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.upper,0,0),m.upper=i(h.getImageData(0,0,p,p)),m.capHeight=m.baseline-m.upper),d.lower&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.lower,0,0),m.lower=i(h.getImageData(0,0,p,p)),m.xHeight=m.baseline-m.lower),d.tittle&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.tittle,0,0),m.tittle=i(h.getImageData(0,0,p,p))),d.ascent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.ascent,0,0),m.ascent=i(h.getImageData(0,0,p,p))),d.descent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.descent,0,0),m.descent=a(h.getImageData(0,0,p,p))),d.overshoot){h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(d.overshoot,0,0);var w=a(h.getImageData(0,0,p,p));m.overshoot=w-v}for(var k in m)m[k]/=s;return m.em=s,r.cache[o]=m,n(m,c)}function n(t,e){var r={};for(var n in"string"===typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function a(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),cx=d({"node_modules/gl-text/dist.js"(t,e){var r,n=Kv(),i=jg(),a=Jv(),o=Qv(),s=Dv(),l=jf(),c=tx(),u=nx(),h=Ng(),d=ix(),p=ax(),f=ox(),m=sx(),g=uy(),y=lx(),v=qg(),x=ex().nextPow2,b=new s,_=!1;document.body&&((r=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(r).fontStretch&&(_=!0),document.body.removeChild(r));var w=function(t){!function(t){return"function"===typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(t)?t:{})};w.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"===typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{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)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(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]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"===typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=v(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"===typeof t)try{t=n.parse(t)}catch(v){t=n.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=n.parse(n.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=n.stringify({size:w.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=p(t.size),d=Math.round(h[0]*f(h[1]));if(d!==e.fontSize[r]&&(o=!0,e.fontSize[r]=d),(!e.font[r]||u!=e.font[r].baseString)&&(a=!0,e.font[r]=w.fonts[u],!e.font[r])){var m=t.family.join(", "),g=[t.style];t.style!=t.variant&&g.push(t.variant),t.variant!=t.weight&&g.push(t.weight),_&&t.weight!=t.stretch&&g.push(t.stretch),e.font[r]={baseString:u,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:g.join(" ")})},w.fonts[u]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"===typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),d=0;d<s.length;d++)s[d]=t.text;t.text=s}if(null!=t.text||a){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var b=1;b<t.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+t.text[b-1].length,this.count+=t.text[b].length,this.counts.push(t.text[b].length);this.text=t.text.join("")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(t,n){w.atlasContext.font=t.baseString;for(var i=e.fontAtlas[n],a=0;a<e.text.length;a++){var o=e.text.charAt(a);if(null==i.ids[o]&&(i.ids[o]=i.chars.length,i.chars.push(o),r.push(o)),null==t.width[o]&&(t.width[o]=w.atlasContext.measureText(o).width/w.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);g(t.kerning,m(t.family,{pairs:s}))}}}))}if(t.position)if(t.position.length>2){for(var k=!t.position[0].length,T=u.mallocFloat(2*this.count),S=0,A=0;S<this.counts.length;S++){var M=this.counts[S];if(k)for(var C=0;C<M;C++)T[A++]=t.position[2*S],T[A++]=t.position[2*S+1];else for(var E=0;E<M;E++)T[A++]=t.position[S][0],T[A++]=t.position[S][1]}this.position.call?this.position({type:"float",data:T}):this.position=this.regl.buffer({type:"float",data:T}),u.freeFloat(T)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||a){var L=u.mallocUint8(this.count),P=u.mallocFloat(2*this.count);this.textWidth=[];for(var I=0,z=0;I<this.counts.length;I++){for(var O=this.counts[I],D=this.font[I]||this.font[0],R=this.fontAtlas[I]||this.fontAtlas[0],F=0;F<O;F++){var B=this.text.charAt(z),j=this.text.charAt(z-1);if(L[z]=R.ids[B],P[2*z]=D.width[B],F){var N=P[2*z-2],U=P[2*z],V=P[2*z-1]+.5*N+.5*U;if(this.kerning){var q=D.kerning[j+B];q&&(V+=.001*q)}P[2*z+1]=V}else P[2*z+1]=.5*P[2*z];z++}this.textWidth.push(P.length?.5*P[2*z-2]+P[2*z-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:L,type:"uint8",usage:"stream"}),this.sizeBuffer({data:P,type:"float",usage:"stream"}),u.freeUint8(L),u.freeFloat(P),r.length&&this.font.forEach((function(t,r){var n=e.fontAtlas[r],i=n.step,a=Math.floor(w.maxAtlasSize/i),o=Math.min(a,n.chars.length),s=Math.ceil(n.chars.length/o),l=x(o*i),u=x(s*i);n.width=l,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:c({canvas:w.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,u],step:[i,i]})})}))}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map((function(t,r){var n=Array.isArray(e.align)?e.align.length>1?e.align[r]:e.align[0]:e.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof t?t-n.baseline:-n[t],i*=-1}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!==typeof t.color&&isNaN(t.color)){var $;if("number"===typeof t.color[0]&&t.color.length>this.counts.length){var H=t.color.length;$=u.mallocUint8(H);for(var W=(t.color.subarray||t.color.slice).bind(t.color),G=0;G<H;G+=4)$.set(l(W(G,G+4),"uint8"),G)}else{var Y=t.color.length;$=u.mallocUint8(4*Y);for(var Z=0;Z<Y;Z++)$.set(l(t.color[Z]||0,"uint8"),4*Z)}this.color=$}else this.color=l(t.color,"uint8");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var X=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(X);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w}}),ux=d({"src/lib/prepare_regl.js"(t,e){var r=Kf(),n=Jv();e.exports=function(t,e,i){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:i||{}})}catch(s){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),hx=d({"src/traces/scattergl/plot.js"(t,e){var r=my(),n=Fv(),i=Bv(),a=cx(),o=se(),s=Or().selectMode,l=ux(),c=Ge(),u=ui(),h=oy().styleTextSelection,d={};function p(t,e,r,n){var i=t._size,a=t.width*n,o=t.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,d=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*d,a-c-(1-e.domain[1])*h,o-u-(1-r.domain[1])*d]}(e.exports=function(t,e,f){if(f.length){var m,g,y=t._fullLayout,v=e._scene,x=e.xaxis,b=e.yaxis;if(v)if(l(t,["ANGLE_instanced_arrays","OES_element_index_uint"],d)){var _=v.count,w=y._glcanvas.data()[0].regl;if(u(t,e,f),v.dirty){if(!v.line2d&&!v.error2d||v.scatter2d||v.fill2d||v.glText||w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(_),m=0;m<_;m++)v.glText[m]=new a(w);if(v.glText){if(_>v.glText.length){var k=_-v.glText.length;for(m=0;m<k;m++)v.glText.push(new a(w))}else if(_<v.glText.length){var T=v.glText.length-_;v.glText.splice(_,T).forEach((function(t){t.destroy()}))}for(m=0;m<_;m++)v.glText[m].update(v.textOptions[m])}if(v.line2d&&(v.line2d.update(v.lineOptions),v.lineOptions=v.lineOptions.map((function(t){if(t&&t.positions){for(var e=t.positions,r=0;r<e.length&&(isNaN(e[r])||isNaN(e[r+1]));)r+=2;for(var n=e.length-2;n>r&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var S=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(S)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,_),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var r=f[e];if(t&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[e],c=[];o._ownfill&&c.push(e),o._nexttrace&&c.push(e+1),c.length&&(v.fillOrder[e]=c);var u,h,d=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;u<p.length&&isNaN(p[u+1]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h+1]);)h-=2;0!==p[u+1]&&(d=[p[u],0]),d=d.concat(p.slice(u,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===o.fill){for(u=0;u<p.length&&isNaN(p[u]);)u+=2;for(h=p.length-2;h>u&&isNaN(p[h]);)h-=2;0!==p[u]&&(d=[0,p[u+1]]),d=d.concat(p.slice(u,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(d=[],n=0,t.splitNull=!0,i=0;i<p.length;i+=2)(isNaN(p[i])||isNaN(p[i+1]))&&((d=d.concat(p.slice(n,i))).push(p[n],p[n+1]),d.push(null,null),n=i+2);d=d.concat(p.slice(n)),n&&d.push(p[n],p[n+1])}else{var m=o._nexttrace;if(m){var g=v.lineOptions[e+1];if(g){var y=g.positions;if("tonexty"===o.fill){for(d=p.slice(),e=Math.floor(y.length/2);e--;){var x=y[2*e],b=y[2*e+1];isNaN(x)||isNaN(b)||d.push(x,b)}t.fill=m.fillcolor}}}}if(o._prevtrace&&"tonext"===o._prevtrace.fill){var _=v.lineOptions[e-1].positions,w=d.length/2,k=[n=w];for(i=0;i<_.length;i+=2)(isNaN(_[i])||isNaN(_[i+1]))&&(k.push(i/2+w+1),n=i+2);d=d.concat(_),t.hole=k}return t.fillmode=o.fill,t.opacity=o.opacity,t.positions=d,t}})),v.fill2d.update(v.fillOptions))}var A=y.dragmode,M=s(A),C=y.clickmode.indexOf("select")>-1;for(m=0;m<_;m++){var E=f[m][0],L=E.trace,P=E.t,I=P.index,z=L._length,O=P.x,D=P.y;if(L.selectedpoints||M||C){if(M||(M=!0),L.selectedpoints){var R=v.selectBatch[I]=o.selIndices2selPoints(L),F={};for(g=0;g<R.length;g++)F[R[g]]=1;var B=[];for(g=0;g<z;g++)F[g]||B.push(g);v.unselectBatch[I]=B}var j=P.xpx=new Array(z),N=P.ypx=new Array(z);for(g=0;g<z;g++)j[g]=x.c2p(O[g]),N[g]=b.c2p(D[g])}else P.xpx=P.ypx=null}if(M){if(v.select2d||(v.select2d=r(y._glcanvas.data()[1].regl)),v.scatter2d){var U=new Array(_);for(m=0;m<_;m++)U[m]=v.selectBatch[m].length||v.unselectBatch[m].length?v.markerUnselectedOptions[m]:{};v.scatter2d.update(U)}v.select2d&&(v.select2d.update(v.markerOptions),v.select2d.update(v.markerSelectedOptions)),v.glText&&f.forEach((function(t){var e=((t||[])[0]||{}).trace||{};c.hasText(e)&&h(t)}))}else v.scatter2d&&v.scatter2d.update(v.markerOptions);var V={viewport:p(y,x,b,t._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(b._rl||b.range)[0],(x._rl||x.range)[1],(b._rl||b.range)[1]]},q=o.repeat(V,v.count);v.fill2d&&v.fill2d.update(q),v.line2d&&v.line2d.update(q),v.error2d&&v.error2d.update(q.concat(q)),v.scatter2d&&v.scatter2d.update(q),v.select2d&&v.select2d.update(q),v.glText&&v.glText.forEach((function(t){t.update(V)}))}else v.init()}}).reglPrecompiled=d}}),dx=d({"src/traces/scattergl/index.js"(t,e){var r=ly();r.plot=hx(),e.exports=r}}),px=d({"lib/scattergl.js"(t,e){e.exports=dx()}}),fx=d({"src/traces/splom/attributes.js"(t,e){var r=wn(),n=Pe(),i=Ce().axisHoverFormat,a=Ot().hovertemplateAttrs,o=Og(),s=ye().idRegex,l=ge().templatedArray,c=D().extendFlat,u=r.marker,h=u.line,d=c(n("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),p=c(n("marker"),{symbol:u.symbol,angle:u.angle,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:d,editType:"calc"});function f(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}p.color.editType=p.cmin.editType=p.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:c({},o.text,{}),hovertext:c({},o.hovertext,{}),hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),marker:p,xaxes:f("x"),yaxes:f("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}}}),mx=d({"src/traces/parcoords/merge_length.js"(t,e){e.exports=function(t,e,r,n){var i,a;for(n||(n=1/0),i=0;i<e.length;i++)(a=e[i]).visible&&(n=Math.min(n,a[r].length));for(n===1/0&&(n=0),t._length=n,i=0;i<e.length;i++)(a=e[i]).visible&&(a._length=n);return n}}}),gx=d({"src/traces/splom/defaults.js"(t,e){var r=se(),n=Be(),i=fx(),a=Ge(),o=Wn(),s=mx(),l=Dg().isOpenSymbol;function c(t,e){function n(n,a){return r.coerce(t,e,i.dimensions,n,a)}n("label");var a=n("values");a&&a.length?n("visible"):e.visible=!1,n("axis.type"),n("axis.matches")}e.exports=function(t,e,u,h){function d(n,a){return r.coerce(t,e,i,n,a)}var p=n(t,e,{name:"dimensions",handleItemDefaults:c}),f=d("diagonal.visible"),m=d("showupperhalf"),g=d("showlowerhalf");if(s(e,p,"values")&&(f||m||g)){d("text"),d("hovertext"),d("hovertemplate"),d("xhoverformat"),d("yhoverformat"),o(t,e,u,h,d,{noAngleRef:!0,noStandOff:!0});var y=l(e.marker.symbol),v=a.isBubble(e);d("marker.line.width",y||v?1:0),function(t,e,r,n){var i,a,o=e.dimensions,s=o.length,l=e.showupperhalf,c=e.showlowerhalf,u=e.diagonal.visible,h=new Array(s),d=new Array(s);for(i=0;i<s;i++){var p=i?i+1:"";h[i]="x"+p,d[i]="y"+p}var f=n("xaxes",h),m=n("yaxes",d),g=e._diag=new Array(s);e._xaxes={},e._yaxes={};var y=[],v=[];function x(t,n,i,a){if(t){var o=t.charAt(0),s=r._splomAxes[o];if(e["_"+o+"axes"][t]=1,a.push(t),!(t in s)){var l=s[t]={};i&&(l.label=i.label||"",i.visible&&i.axis&&(i.axis.type&&(l.type=i.axis.type),i.axis.matches&&(l.matches=n)))}}}var b=!u&&!c,_=!u&&!l;for(e._axesDim={},i=0;i<s;i++){var w=o[i],k=0===i,T=i===s-1,S=k&&b||T&&_?void 0:f[i],A=k&&_||T&&b?void 0:m[i];x(S,A,w,y),x(A,S,w,v),g[i]=[S,A],e._axesDim[S]=i,e._axesDim[A]=i}for(i=0;i<y.length;i++)for(a=0;a<v.length;a++){var M=y[i]+v[a];i>a&&l||i<a&&c?r._splomSubplots[M]=1:i!==a||!u&&c&&l||(r._splomSubplots[M]=1)}(!c||!u&&l&&c)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,e,h,d),r.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}}}),yx=d({"src/traces/splom/scene_update.js"(t,e){var r=se();e.exports=function(t,e){var n=t._fullLayout,i=e.uid,a=n._splomScenes;a||(a=n._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=a[e.uid];return s||((s=a[i]=r.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||r.extendFlat(s,o),s}}}),vx=d({"src/traces/splom/calc.js"(t,e){var r=se(),n=ve(),i=ai().calcMarkerSize,a=ai().calcAxisExpansion,o=ri(),s=ny().markerSelection,l=ny().markerStyle,c=yx(),u=T().BADNUM,h=zg().TOO_MANY_POINTS;e.exports=function(t,e){var d,p,f,m,g,y,v=e.dimensions,x=e._length,b={},_=b.cdata=[],w=b.data=[],k=e._visibleDims=[];function T(t,n){for(var i=t.makeCalcdata({v:n.values,vcalendar:e.calendar},"v"),a=0;a<i.length;a++)i[a]=i[a]===u?NaN:i[a];_.push(i),w.push("log"===t.type?r.simpleMap(i,t.c2l):i)}for(d=0;d<v.length;d++)if((f=v[d]).visible){if(m=n.getFromId(t,e._diag[d][0]),g=n.getFromId(t,e._diag[d][1]),m&&g&&m.type!==g.type){r.log("Skipping splom dimension "+d+" with conflicting axis types");continue}m?(T(m,f),g&&"category"===g.type&&(g._categories=m._categories.slice())):T(g,f),k.push(d)}for(o(t,e),r.extendFlat(b,l(t,e)),y=_.length*x>h?b.sizeAvg||Math.max(b.size,3):i(e,x),p=0;p<k.length;p++)f=v[d=k[p]],m=n.getFromId(t,e._diag[d][0])||{},g=n.getFromId(t,e._diag[d][1])||{},a(t,e,m,g,_[p],_[p],y);var S=c(t,e);return S.matrix||(S.matrix=!0),S.matrixOptions=b,S.selectedOptions=s(t,e,e.selected),S.unselectedOptions=s(t,e,e.unselected),[{x:!1,y:!1,t:{},trace:e}]}}}),xx=d({"node_modules/performance-now/lib/performance-now.js"(t,e){(function(){var t,r,n,i,a,o;"undefined"!==typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!==typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-a)/1e6},r=process.hrtime,i=(t=function(){var t;return 1e9*(t=r())[0]+t[1]})(),o=1e9*process.uptime(),a=i-o):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(t)}}),bx=d({"node_modules/raf/index.js"(t,e){var r,n,i,a,o,s=xx(),l=window,c=["moz","webkit"],u="AnimationFrame",h=l["request"+u],d=l["cancel"+u]||l["cancelRequest"+u];for(r=0;!h&&r<c.length;r++)h=l[c[r]+"Request"+u],d=l[c[r]+"Cancel"+u]||l[c[r]+"CancelRequest"+u];h&&d||(n=0,i=0,a=[],o=1e3/60,h=function(t){if(0===a.length){var e=s(),r=Math.max(0,o-(e-n));n=r+e,setTimeout((function(){var t=a.slice(0);a.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(n)}catch(r){setTimeout((function(){throw r}),0)}}),Math.round(r))}return a.push({handle:++i,callback:t,cancelled:!1}),i},d=function(t){for(var e=0;e<a.length;e++)a[e].handle===t&&(a[e].cancelled=!0)}),e.exports=function(t){return h.call(l,t)},e.exports.cancel=function(){d.apply(l,arguments)},e.exports.polyfill=function(t){t||(t=l),t.requestAnimationFrame=h,t.cancelAnimationFrame=d}}}),_x=d({"node_modules/array-range/index.js"(t,e){e.exports=function(t,e){var r="number"===typeof t,n="number"===typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var i=(e|=0)-(t|=0);if(i<0)throw new Error("array length must be positive");for(var a=new Array(i),o=0,s=t;o<i;o++,s++)a[o]=s;return a}}}),wx=d({"node_modules/regl-splom/index.js"(t,e){var r=my(),n=jg(),i=Ug(),a=bx(),o=_x(),s=Ng(),l=qg();function c(t,e){if(!(this instanceof c))return new c(t,e);this.traces=[],this.passes={},this.regl=t,this.scatter=r(t),this.canvas=this.scatter.canvas}function u(t,e,r){return(null!=t.id?t.id:t)<<16|(255&e)<<8|255&r}function h(t,e,r){let n,i,a,o,s,l,c,u,h=t[e],d=t[r];return h.length>2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),d.length>2?(s=d[0],c=d[2],l=d[1],u=d[3]):d.length?(s=l=d[0],c=u=d[1]):(s=d.x,l=d.y,c=d.x+d.width,u=d.y+d.height),[s,i,c,o]}function d(t){if("number"===typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let e=s(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}}e.exports=c,c.prototype.render=function(){return arguments.length&&this.update(...arguments),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(){if(!arguments.length)return;for(let r=0;r<arguments.length;r++)this.updateItem(r,r<0||arguments.length<=r?void 0:arguments[r]);this.traces=this.traces.filter(Boolean);let t=[],e=0;for(let r=0;r<this.traces.length;r++){let n=this.traces[r],i=this.traces[r].passes;for(let e=0;e<i.length;e++)t.push(this.passes[i[e]]);n.passOffset=e,e+=n.passes.length}return this.scatter.update(...t),this},c.prototype.updateItem=function(t,e){let{regl:r}=this;if(null===e)return this.traces[t]=null,this;if(!e)return this;let a,o=n(e,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),c=this.traces[t]||(this.traces[t]={id:t,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:s([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(c.color=o.color),null!=o.size&&(c.size=o.size),null!=o.marker&&(c.marker=o.marker),null!=o.borderColor&&(c.borderColor=o.borderColor),null!=o.borderSize&&(c.borderSize=o.borderSize),null!=o.opacity&&(c.opacity=o.opacity),o.viewport&&(c.viewport=s(o.viewport)),null!=o.diagonal&&(c.diagonal=o.diagonal),null!=o.upper&&(c.upper=o.upper),null!=o.lower&&(c.lower=o.lower),o.data){c.buffer(l(o.data)),c.columns=o.data.length,c.count=o.data[0].length,c.bounds=[];for(let t=0;t<c.columns;t++)c.bounds[t]=i(o.data[t],1)}o.range&&(c.range=o.range,a=c.range&&"number"!==typeof c.range[0]),o.domain&&(c.domain=o.domain);let p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===c.columns&&"number"===typeof o.padding[o.padding.length-1]?(c.padding=o.padding.map(d),p=!0):c.padding=d(o.padding));let f=c.columns,m=c.count,g=c.viewport.width,y=c.viewport.height,v=c.viewport.x,x=c.viewport.y,b=g/f,_=y/f;c.passes=[];for(let n=0;n<f;n++)for(let t=0;t<f;t++){if(!c.diagonal&&t===n)continue;if(!c.upper&&n>t)continue;if(!c.lower&&n<t)continue;let e=u(c.id,n,t),r=this.passes[e]||(this.passes[e]={});if(o.data&&(o.transpose?r.positions={x:{buffer:c.buffer,offset:t,count:m,stride:f},y:{buffer:c.buffer,offset:n,count:m,stride:f}}:r.positions={x:{buffer:c.buffer,offset:t*m,count:m},y:{buffer:c.buffer,offset:n*m,count:m}},r.bounds=h(c.bounds,n,t)),o.domain||o.viewport||o.data){let e=p?h(c.padding,n,t):c.padding;if(c.domain){let[i,a,o,s]=h(c.domain,n,t);r.viewport=[v+i*g+e[0],x+a*y+e[1],v+o*g-e[2],x+s*y-e[3]]}else r.viewport=[v+t*b+b*e[0],x+n*_+_*e[1],v+(t+1)*b-b*e[2],x+(n+1)*_-_*e[3]]}o.color&&(r.color=c.color),o.size&&(r.size=c.size),o.marker&&(r.marker=c.marker),o.borderSize&&(r.borderSize=c.borderSize),o.borderColor&&(r.borderColor=c.borderColor),o.opacity&&(r.opacity=c.opacity),o.range&&(r.range=a?h(c.range,n,t):c.range||r.bounds),c.passes.push(e)}return this},c.prototype.draw=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(e.length){let t=[];for(let r=0;r<e.length;r++)if("number"===typeof e[r]){let{passes:n,passOffset:i}=this.traces[e[r]];t.push(...o(i,i+n.length))}else if(e[r].length){let n=e[r],{passes:i,passOffset:a}=this.traces[r];i=i.map(((e,r)=>{t[a+r]=n}))}this.scatter.draw(...t)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),kx=d({"src/traces/splom/plot.js"(t,e){var r=wx(),n=se(),i=ve(),a=Or().selectMode;function o(t,e){var o,s,l,c,u,h=t._fullLayout,d=h._size,p=e.trace,f=e.t,m=h._splomScenes[p.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var b=p._visibleDims,_=y.length,w=m.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),u=0;u<b.length;u++){l=b[u];var k=w.ranges[u]=new Array(4),T=w.domains[u]=new Array(4);(o=i.getFromId(t,p._diag[l][0]))&&(k[0]=o._rl[0],k[2]=o._rl[1],T[0]=o.domain[0],T[2]=o.domain[1]),(s=i.getFromId(t,p._diag[l][1]))&&(k[1]=s._rl[0],k[3]=s._rl[1],T[1]=s.domain[0],T[3]=s.domain[1])}var S=t._context.plotGlPixelRatio,A=d.l*S,M=d.b*S,C=d.w*S,E=d.h*S;w.viewport=[A,M,C+A,E+M],!0===m.matrix&&(m.matrix=r(v));var L=h.clickmode.indexOf("select")>-1,P=!0;if(a(x)||p.selectedpoints||L){var I=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var z=p.selectedpoints,O={};for(l=0;l<z.length;l++)O[z[l]]=!0;var D=[];for(l=0;l<I;l++)O[l]||D.push(l);m.unselectBatch=D}var R=f.xpx=new Array(_),F=f.ypx=new Array(_);for(u=0;u<b.length;u++){if(l=b[u],o=i.getFromId(t,p._diag[l][0]))for(R[u]=new Array(I),c=0;c<I;c++)R[u][c]=o.c2p(y[u][c]);if(s=i.getFromId(t,p._diag[l][1]))for(F[u]=new Array(I),c=0;c<I;c++)F[u][c]=s.c2p(y[u][c])}if(m.selectBatch.length||m.unselectBatch.length){var B=n.extendFlat({},g,m.unselectedOptions,w),j=n.extendFlat({},g,m.selectedOptions,w);m.matrix.update(B,j),P=!1}}else f.xpx=f.ypx=null;if(P){var N=n.extendFlat({},g,w);m.matrix.update(N,null)}}}e.exports=function(t,e,r){if(r.length)for(var n=0;n<r.length;n++)o(t,r[n][0])}}}),Tx=d({"src/traces/splom/helpers.js"(t){t.getDimIndex=function(t,e){for(var r=e._id,n={x:0,y:1}[r.charAt(0)],i=t._visibleDims,a=0;a<i.length;a++){var o=i[a];if(t._diag[o][n]===r)return a}return!1}}}),Sx=d({"src/traces/splom/hover.js"(t,e){var r=Tx(),n=Ig().calcHover,i=nr().getFromId,a=D().extendFlat;function o(t,e,i,a){var o=t.cd[0].trace,s=t.scene.matrixOptions.cdata,l=t.xa,c=t.ya,u=l.c2p(e),h=c.c2p(i),d=t.distance,p=r.getDimIndex(o,l),f=r.getDimIndex(o,c);if(!1===p||!1===f)return[t];for(var m,g,y=s[p],v=s[f],x=d,b=0;b<y.length;b++)if(!a||b===t.index){var _=y[b],w=v[b],k=l.c2p(_)-u,T=c.c2p(w)-h,S=Math.sqrt(k*k+T*T);(a||S<x)&&(x=g=S,m=b)}return t.index=m,t.distance=x,t.dxy=g,void 0===m?[t]:[n(t,y,v,o)]}e.exports={hoverPoints:function(t,e,r,n,s){s||(s={});var l="x"===(n||"").charAt(0),c="y"===(n||"").charAt(0),u=o(t,e,r);if((l||c)&&"axis"===s.hoversubplots&&u[0])for(var h=(l?t.xa:t.ya)._subplotsWith,d=s.gd,p=a({},t),f=0;f<h.length;f++){var m=h[f];if(m!==t.xa._id+t.ya._id){c?p.xa=i(d,m,"x"):p.ya=i(d,m,"y");var g=o(p,e,r,l||c);u=u.concat(g)}}return u}}}}),Ax=d({"src/traces/splom/select.js"(t,e){var r=se(),n=r.pushUnique,i=Ge(),a=Tx();e.exports=function(t,e){var o=t.cd,s=o[0].trace,l=o[0].t,c=t.scene,u=c.matrixOptions.cdata,h=t.xaxis,d=t.yaxis,p=[];if(!c)return p;var f=!i.hasMarkers(s)&&!i.hasText(s);if(!0!==s.visible||f)return p;var m=a.getDimIndex(s,h),g=a.getDimIndex(s,d);if(!1===m||!1===g)return p;var y=l.xpx[m],v=l.ypx[g],x=u[m],b=u[g],_=(t.scene.selectBatch||[]).slice(),w=[];if(!1!==e&&!e.degenerate)for(var k=0;k<x.length;k++)e.contains([y[k],v[k]],null,k,t)?(p.push({pointNumber:k,x:x[k],y:b[k]}),n(_,k)):-1!==_.indexOf(k)?n(_,k):w.push(k);var T=c.matrixOptions;return _.length||w.length?c.selectBatch.length||c.unselectBatch.length||c.matrix.update(c.unselectedOptions,r.extendFlat({},T,c.selectedOptions,c.viewOpts)):c.matrix.update(T,null),c.selectBatch=_,c.unselectBatch=w,p}}}),Mx=d({"src/traces/splom/edit_style.js"(t,e){var r=se(),n=ri(),i=ny().markerStyle;e.exports=function(t,e){var a=e.trace,o=t._fullLayout._splomScenes[a.uid];if(o){n(t,a),r.extendFlat(o.matrixOptions,i(t,a));var s=r.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}}}),Cx=d({"src/traces/splom/base_index.js"(t,e){var r=Vt(),n=Ta();e.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:fx(),supplyDefaults:gx(),colorbar:di(),calc:vx(),plot:kx(),hoverPoints:Sx().hoverPoints,selectPoints:Ax(),editStyle:Mx(),meta:{}},r.register(n)}}),Ex=d({"src/traces/splom/base_plot.js"(t,e){var r=Fv(),n=Vt(),i=ux(),a=_e().getModuleCalcData,o=Ai(),s=ve().getFromId,l=nr().shouldShowZeroLine,c="splom",u={};function h(t,e,r){for(var n=r.matrixOptions.data.length,i=e._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;o<i.length;o++){var l=i[o],c=a[o]=new Array(4),u=s(t,e._diag[l][0]);u&&(c[0]=u.r2l(u.range[0]),c[2]=u.r2l(u.range[1]));var h=s(t,e._diag[l][1]);h&&(c[1]=h.r2l(h.range[0]),c[3]=h.r2l(h.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:a},{ranges:a}):r.matrix.update({ranges:a})}function d(t){var e=t._fullLayout,n=e._glcanvas.data()[0].regl,i=e._splomGrid;i||(i=e._splomGrid=r(n)),i.update(function(t){var e,r=t._context.plotGlPixelRatio,n=t._fullLayout,i=n._size,a=[0,0,n.width*r,n.height*r],o={};function s(t,e,n,i,s,l){n*=r,i*=r,s*=r,l*=r;var c=e[t+"color"],u=e[t+"width"],h=String(c+u);h in o?o[h].data.push(NaN,NaN,n,i,s,l):o[h]={data:[n,i,s,l],join:"rect",thickness:u*r,color:c,viewport:a,range:a,overlay:!1}}for(e in n._splomSubplots){var c,u,h=n._plots[e],d=h.xaxis,p=h.yaxis,f=d._gridVals,m=p._gridVals,g=d._offset,y=d._length,v=p._length,x=i.b+p.domain[0]*i.h,b=-p._m,_=-b*p.r2l(p.range[0],p.calendar);if(d.showgrid)for(e=0;e<f.length;e++)c=g+d.l2p(f[e].x),s("grid",d,c,x,c,x+v);if(p.showgrid)for(e=0;e<m.length;e++)s("grid",p,g,u=x+_+b*m[e].x,g+y,u);l(t,d,p)&&(c=g+d.l2p(0),s("zeroline",d,c,x,c,x+v)),l(t,p,d)&&s("zeroline",p,g,u=x+_+0,g+y,u)}var w=[];for(e in o)w.push(o[e]);return w}(t))}e.exports={name:c,attr:o.attr,attrRegex:o.attrRegex,layoutAttributes:o.layoutAttributes,supplyLayoutDefaults:o.supplyLayoutDefaults,drawFramework:o.drawFramework,plot:function(t){var e=t._fullLayout,r=n.getModule(c),o=a(t.calcdata,r)[0];i(t,["ANGLE_instanced_arrays","OES_element_index_uint"],u)&&(e._hasOnlyLargeSploms&&d(t),r.plot(t,{},o))},drag:function(t){var e=t.calcdata,r=t._fullLayout;r._hasOnlyLargeSploms&&d(t);for(var n=0;n<e.length;n++){var i=e[n][0].trace,a=r._splomScenes[i.uid];"splom"===i.type&&a&&a.matrix&&h(t,i,a)}},updateGrid:d,clean:function(t,e,r,n){var i,a={};if(n._splomScenes){for(i=0;i<t.length;i++){var s=t[i];"splom"===s.type&&(a[s.uid]=1)}for(i=0;i<r.length;i++){var l=r[i];if(!a[l.uid]){var c=n._splomScenes[l.uid];c&&c.destroy&&c.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!e._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),o.clean(t,e,r,n)},updateFx:o.updateFx,toSVG:o.toSVG,reglPrecompiled:u}}}),Lx=d({"src/traces/splom/index.js"(t,e){var r=Cx();r.basePlotModule=Ex(),e.exports=r}}),Px=d({"lib/splom.js"(t,e){e.exports=Lx()}}),Ix=d({"src/traces/parcoords/attributes.js"(t,e){var r=Pe(),n=Ee(),i=R(),a=ka().attributes,o=D().extendFlat,s=ge().templatedArray;e.exports={domain:a({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({autoShadowDflt:!0,editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:s("dimension",{label:{valType:"string",editType:"plot"},tickvals:o({},n.tickvals,{editType:"plot"}),ticktext:o({},n.ticktext,{editType:"plot"}),tickformat:o({},n.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:o({editType:"calc"},r("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}}),zx=d({"src/traces/parcoords/constants.js"(t,e){e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}}),Ox=d({"src/lib/gup.js"(t,e){var r=$t();function n(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:n,descend:r,wrap:n,unwrap:function(t){return t[0]}}}}),Dx=d({"src/traces/parcoords/axisbrush.js"(t,e){var r=zx(),n=v(),i=Ox().keyFun,a=Ox().repeat,o=se().sorterAsc,s=se().strTranslate,l=r.bar.snapRatio;function c(t,e){return t*(1-l)+e*l}var u=r.bar.snapClose;function h(t,e){return t*(1-u)+e*u}function d(t,e,r,n){if(function(t,e){for(var r=0;r<e.length;r++)if(t>=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],u=l,d=a;i*d<i*o;d+=i){var p=d+i,f=e[p];if(i*r<i*h(l,f))return c(l,u);if(i*r<i*f||p===o)return c(f,l);u=l,l=f}}function p(t){t.attr("x",-r.bar.captureWidth/2).attr("width",r.bar.captureWidth)}function f(t){t.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(t){if(!t.brush.filterSpecified)return"0,"+t.height;for(var e,r,n,i=g(t.brush.filter.getConsolidated(),t.height),a=[0],o=i.length?i[0][0]:null,s=0;s<i.length;s++)r=(e=i[s])[1]-e[0],a.push(o),a.push(r),(n=s+1)<i.length&&(o=i[n][0]-e[1]);return a.push(t.height),a}function g(t,e){return t.map((function(t){return t.map((function(t){return Math.max(0,t*e)})).sort(o)}))}function y(){n.select(document.body).style("cursor",null)}function x(t){t.attr("stroke-dasharray",m)}function b(t,e){var i=n.select(t).selectAll(".highlight, .highlight-shadow");x(e?i.transition().duration(r.bar.snapDuration).each("end",e):i)}function _(t,e){var n,i=t.brush,a=NaN,o={};if(i.filterSpecified){var s=t.height,l=i.filter.getConsolidated(),c=g(l,s),u=NaN,h=NaN,d=NaN;for(n=0;n<=c.length;n++){var p=c[n];if(p&&p[0]<=e&&e<=p[1]){u=n;break}if(h=n?n-1:NaN,p&&p[0]>e){d=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(d)?isNaN(h)?d:h:e-c[h][1]<c[d][0]-e?h:d),!isNaN(a)){var f=c[a],m=function(t,e){var n=r.bar.handleHeight;if(!(e>t[1]+n||e<t[0]-n))return e>=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(f,e);m&&(o.interval=l[a],o.intervalPix=f,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(n=0;n<y.length;n++){var x=[.25*y[Math.max(n-1,0)]+.75*y[n],.25*y[Math.min(n+1,y.length-1)]+.75*y[n]];if(v>=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(i)].sort(o),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function k(t,e){var i=_(e,e.height-n.mouse(t)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function T(t){t.on("mousemove",(function(t){n.event.preventDefault(),t.parent.inBrushDrag||k(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(t){!function(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.unitToPaddedPx.invert(i),o=e.brush,s=_(e,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,i=r.filter,a=r.svgBrush;a._dragging||(k(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&A(r)):A(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),a.newExtent=[d(0,l,a.newExtent[0],a.stayingIntervals),d(1,l,a.newExtent[1],a.stayingIntervals)];var c=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||A(r),a.brushCallback(e),c?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)})))}function S(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var s,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(o)})).sort(S)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=M(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(s=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e),n=r.slice();e.filter.set(n),s()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,n){var o=t.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(t,e,n){var i=n._context.staticPlot,o=t.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(p).call(f).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(T).attr("height",(function(t){return t.height-r.verticalPadding}));var l=t.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",e).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(t){return t.height})).call(x);var c=t.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(x)}(o,e,n)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(o)})),t=e.multiselect?M(t.sort(S)):[t[0]]):t=[t.sort(o)],e.tickvals){var r=e.tickvals.slice().sort(o);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}}}),Rx=d({"src/traces/parcoords/defaults.js"(t,e){var r=se(),n=Me().hasColorscale,i=Ve(),a=ka().defaults,o=Be(),s=nr(),l=Ix(),c=Dx(),u=zx().maxDimensionCount,h=mx();function d(t,e,n,i){function a(n,i){return r.coerce(t,e,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=e.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(e._ax,i.layout),a("multiselect");var d=a("constraintrange");d&&(e.constraintrange=c.cleanRanges(d,e))}}e.exports=function(t,e,s,c){function p(n,i){return r.coerce(t,e,l,n,i)}var f=t.dimensions;Array.isArray(f)&&f.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),f.splice(u));var m=o(t,e,{name:"dimensions",layout:c,handleItemDefaults:d}),g=function(t,e,a,o,s){var l=s("line.color",a);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,s,c,p);a(e,c,p),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(p,"labelfont",y),r.coerceFont(p,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(p,"rangefont",y),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}}),Fx=d({"src/traces/parcoords/calc.js"(t,e){var r=se().isArrayOrTypedArray,n=We(),i=Ox().wrap;e.exports=function(t,e){var a,o;return n.hasColorscale(e,"line")&&r(e.line.color)?(a=e.line.color,o=n.extractOpts(e.line).colorscale,n.calc(t,e,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=.5;return e}(e._length),o=[[0,e.line.color],[1,e.line.color]]),i({lineColor:a,cscale:o})}}});function Bx(t){var e,r,n,i,a=[],o=1;if("number"===typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if("number"===typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),Rp.default[t])a=Rp.default[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if("#"===t[0]){var s=t.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]?100*t:"l"!==i[0]||e?"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t:100*t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==Bp[t])return Bp[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=(null==(r=null==(e=t.match(/([a-z])/gi))?void 0:e.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var jx,Nx,Ux=h({"node_modules/color-parse/index.js"(){var r,n,i;r=Of(),n=1,i=null!=r?t(s(r)):{},Rp=f(!n&&r&&r.__esModule?i:e(i,"default",{value:r,enumerable:!0}),r),Fp=Bx,Bp={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Vx=h({"node_modules/color-space/rgb.js"(){jx={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),qx=h({"node_modules/color-space/hsl.js"(){Vx(),Nx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}},jx.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),$x={};function Hx(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var r=Fp(t);if(!r.space)return[];const n="h"===r.space[0]?Nx.min:jx.min,i="h"===r.space[0]?Nx.max:jx.max;return(e=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),e[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),e[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(e=Nx.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}p($x,{default:()=>Hx});var Wx=h({"node_modules/color-rgba/index.js"(){Ux(),Vx(),qx()}}),Gx=d({"src/traces/parcoords/helpers.js"(t){var e=se().isTypedArray;t.convertTypedArray=function(t){return e(t)?Array.prototype.slice.call(t):t},t.isOrdinal=function(t){return!!t.tickvals},t.isVisible=function(t){return t.visible||!("visible"in t)}}}),Yx=d({"src/traces/parcoords/lines.js"(t,e){var r=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=zx().maxDimensionCount,a=se(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function d(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c<i&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function p(t,e){for(var r=new Array(256),n=0;n<256;n++)r[n]=t(n/255).concat(e);return r}function f(t,e){return(t>>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;a<e;a++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*t+s,c=r[64*a+l];63===l&&0===o&&(c*=-1),n[i++]=c}return n}function g(t){var e="0"+t;return e.substr(e.length-2)}function y(t){return t<i?"p"+g(t+1)+"_"+g(t+4):"colors"}function v(t,e,r,n,i,o,s,l,c,u,h,d,p,f){for(var m=[[],[]],g=0;g<64;g++)m[0][g]=g===i?1:0,m[1][g]=g===o?1:0;s*=f,l*=f,c*=f,u*=f;var y=t.lines.canvasOverdrag*f,v=t.domain,x=t.canvasWidth*f,b=t.canvasHeight*f,_=t.pad.l*f,w=t.pad.b*f,k=t.layoutHeight*f,T=t.layoutWidth*f,S=t.deselectedLines.color,A=t.deselectedLines.opacity;return a.extendFlat({key:h,resolution:[x,b],viewBoxPos:[s+y,l],viewBoxSize:[c,u],i0:i,i1:o,dim0A:m[0].slice(0,16),dim0B:m[0].slice(16,32),dim0C:m[0].slice(32,48),dim0D:m[0].slice(48,64),dim1A:m[1].slice(0,16),dim1B:m[1].slice(16,32),dim1C:m[1].slice(32,48),dim1D:m[1].slice(48,64),drwLayer:d,contextColor:[S[0]/255,S[1]/255,S[2]/255,"auto"!==A?S[3]*A:Math.max(1/255,Math.pow(1/t.lines.color.length,1/3))],scissorX:(n===e?0:s+y)+(_-y)+T*v.x[0],scissorWidth:(n===r?x-s+y:c+.5)+(n===e?s+y:0),scissorY:l+w+k*v.y[0],scissorHeight:u,viewportX:_-y+T*v.x[0],viewportY:w+k*v.y[0],viewportWidth:x,viewportHeight:b},p)}function x(t){var e=2047,r=Math.max(0,Math.floor(t[0]*e),0),n=Math.min(e,Math.ceil(t[1]*e),e);return[Math.min(r,n),Math.max(r,n)]}e.exports=function(t,e){var l,g,b,_,w,k=e.context,T=e.pick,S=e.regl,A=S._gl,M=A.getParameter(A.ALIASED_LINE_WIDTH_RANGE),C=Math.max(M[0],Math.min(M[1],e.viewModel.plotGlPixelRatio)),E={currentRafs:{},drawCompleted:!0,clearOnly:!1},L=function(t){for(var e={},r=0;r<=i;r+=4)e[y(r)]=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return e}(S),P=S.texture(u),I=[];O(e);var z=S({profile:!1,blend:{enable:k,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:!k,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:S.prop("scissorX"),y:S.prop("scissorY"),width:S.prop("scissorWidth"),height:S.prop("scissorHeight")}},viewport:{x:S.prop("viewportX"),y:S.prop("viewportY"),width:S.prop("viewportWidth"),height:S.prop("viewportHeight")},dither:!1,vert:r,frag:n,primitive:"lines",lineWidth:C,attributes:L,uniforms:{resolution:S.prop("resolution"),viewBoxPos:S.prop("viewBoxPos"),viewBoxSize:S.prop("viewBoxSize"),dim0A:S.prop("dim0A"),dim1A:S.prop("dim1A"),dim0B:S.prop("dim0B"),dim1B:S.prop("dim1B"),dim0C:S.prop("dim0C"),dim1C:S.prop("dim1C"),dim0D:S.prop("dim0D"),dim1D:S.prop("dim1D"),loA:S.prop("loA"),hiA:S.prop("hiA"),loB:S.prop("loB"),hiB:S.prop("hiB"),loC:S.prop("loC"),hiC:S.prop("hiC"),loD:S.prop("loD"),hiD:S.prop("hiD"),palette:P,contextColor:S.prop("contextColor"),maskTexture:S.prop("maskTexture"),drwLayer:S.prop("drwLayer"),maskHeight:S.prop("maskHeight")},offset:S.prop("offset"),count:S.prop("count")});function O(t){l=t.model,g=t.viewModel,b=g.dimensions.slice(),_=b[0]?b[0].values.length:0;var e=l.lines,r=T?e.color.map((function(t,r){return r/e.color.length})):e.color,n=function(t,e,r){for(var n,a=new Array(t*(i+4)),s=0,l=0;l<t;l++){for(var c=0;c<i;c++)a[s++]=c<e.length?e[c].paddedUnitValues[l]:.5;a[s++]=f(l,2),a[s++]=f(l,1),a[s++]=f(l,0),a[s++]=(n=r[l],Math.max(o,Math.min(.999999,n)))}return a}(_,b,r);!function(t,e,r){for(var n=0;n<=i;n+=4)t[y(n)](m(n/4,e,r))}(L,_,n),k||T||(P=S.texture(a.extendFlat({data:p(l.unitToColor,255)},u)))}return{render:function(t,e,r){var n,i,a,o=t.length,c=1/0,u=-1/0;for(n=0;n<o;n++)t[n].dim0.canvasX<c&&(c=t[n].dim0.canvasX,i=n),t[n].dim1.canvasX>u&&(u=t[n].dim1.canvasX,a=n);0===o&&h(S,0,0,l.canvasWidth,l.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&n<b.length?b[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=new Array(16384);for(e=0;e<16384;e++)o[e]=255;if(!t)for(e=0;e<b.length;e++){var l=e%8,c=(e-l)/8,u=Math.pow(2,l),h=b[e].brush.filter.get();if(!(h.length<2)){var d=x(h[0])[1];for(r=1;r<h.length;r++){var p=x(h[r]);for(n=d+1;n<p[0];n++)o[8*n+c]&=~u;d=Math.max(d,p[1])}}}var f={shape:[8,s],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:o};return w?w(f):w=S.texture(f),{maskTexture:w,maskHeight:s,loA:i[0].slice(0,16),loB:i[0].slice(16,32),loC:i[0].slice(32,48),loD:i[0].slice(48,64),hiA:i[1].slice(0,16),hiB:i[1].slice(16,32),hiC:i[1].slice(32,48),hiD:i[1].slice(48,64)}}(k);for(n=0;n<o;n++){var f=t[n],m=f.dim0.crossfilterDimensionIndex,g=f.dim1.crossfilterDimensionIndex,y=f.canvasX,A=f.canvasY,M=y+f.panelSizeX,C=f.plotGlPixelRatio;if(e||!I[m]||I[m][0]!==y||I[m][1]!==M){I[m]=[y,M];var L=v(l,i,a,n,m,g,y,A,f.panelSizeX,f.panelSizeY,f.dim0.crossfilterDimensionIndex,k?0:T?2:1,p,C);E.clearOnly=r;var P=e?l.lines.blockLineCount:_;d(S,z,E,P,_,L)}}},readPixel:function(t,e){return S.read({x:t,y:e,width:1,height:1,data:c}),c},readPixels:function(t,e,r,n){var i=new Uint8Array(4*r*n);return S.read({x:t,y:e,width:r,height:n,data:i}),i},destroy:function(){for(var e in t.style["pointer-events"]="none",P.destroy(),w&&w.destroy(),L)L[e].destroy()},update:O}}}}),Zx=d({"src/traces/parcoords/parcoords.js"(t,e){var r=v(),n=se(),i=n.isArrayOrTypedArray,a=n.numberFormat,o=(Wx(),m($x)).default,s=nr(),l=n.strRotate,c=n.strTranslate,u=Ae(),h=Je(),d=We(),p=Ox(),f=p.keyFun,g=p.repeat,y=p.unwrap,x=Gx(),b=zx(),_=Dx(),w=Yx();function k(t,e,r){return n.aggNums(t,null,e,r)}function T(t,e){return A(k(Math.min,t,e),k(Math.max,t,e))}function S(t){var e=t.range;return e?A(e[0],e[1]):T(t.values,t._length)}function A(t,e){return!isNaN(t)&&isFinite(t)||(t=0),!isNaN(e)&&isFinite(e)||(e=0),t===e&&(0===t?(t-=1,e+=1):(t*=.9,e*=1.1)),[t,e]}function M(t,e,n,i,o){var s,l,c=S(n);return i?r.scale.ordinal().domain(i.map((s=a(n.tickformat),l=o,l?function(t,e){var r=l[e];return null===r||void 0===r?s(t):r}:s))).range(i.map((function(r){var n=(r-c[0])/(c[1]-c[0]);return t-e+n*(2*e-t)}))):r.scale.linear().domain(c).range([t-e,e])}function C(t){if(t.tickvals){var e=S(t);return r.scale.ordinal().domain(t.tickvals).range(t.tickvals.map((function(t){return(t-e[0])/(e[1]-e[0])})))}}function E(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){var e=o(t[1]);return r.rgb("rgb("+e[0]+","+e[1]+","+e[2]+")")})),i="rgb".split("").map((function(t){return r.scale.linear().clamp(!0).domain(e).range(n.map((i=t,function(t){return t[i]})));var i}));return function(t){return i.map((function(e){return e(t)}))}}function L(t){return t.dimensions.some((function(t){return t.brush.filterSpecified}))}function P(t,e,i){var a=y(e),s=a.trace,l=x.convertTypedArray(a.lineColor),c=s.line,u={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},h=d.extractOpts(c),p=h.reversescale?d.flipScale(a.cscale):a.cscale,f=s.domain,m=s.dimensions,g=t.width,v=s.labelangle,_=s.labelside,w=s.labelfont,k=s.tickfont,T=s.rangefont,A=n.extendDeepNoArrays({},c,{color:l.map(r.scale.linear().domain(S({values:l,range:[h.min,h.max],_length:s._length}))),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),M=Math.floor(g*(f.x[1]-f.x[0])),C=Math.floor(t.height*(f.y[1]-f.y[0])),L=t.margin||{l:80,r:80,t:100,b:80},P=M,I=C;return{key:i,colCount:m.filter(x.isVisible).length,dimensions:m,tickDistance:b.tickDistance,unitToColor:E(p),lines:A,deselectedLines:u,labelAngle:v,labelSide:_,labelFont:w,tickFont:k,rangeFont:T,layoutWidth:g,layoutHeight:t.height,domain:f,translateX:f.x[0]*g,translateY:t.height-f.y[1]*t.height,pad:L,canvasWidth:P*b.canvasPixelRatio+2*A.canvasOverdrag,canvasHeight:I*b.canvasPixelRatio,width:P,height:I,canvasPixelRatio:b.canvasPixelRatio}}function I(t,e,o){var s=o.width,l=o.height,c=o.dimensions,u=o.canvasPixelRatio,h=function(t){return s*t/Math.max(1,o.colCount-1)},d=b.verticalPadding/l,p=function(t,e){return r.scale.linear().range([e,t-e])}(l,b.verticalPadding),f={key:o.key,xScale:h,model:o,inBrushDrag:!1},m={};return f.dimensions=c.filter(x.isVisible).map((function(s,c){var g=function(t,e){return r.scale.linear().domain(S(t)).range([e,1-e])}(s,d),y=m[s.label];m[s.label]=(y||0)+1;var v=s.label+(y?"__"+y:""),w=s.constraintrange,k=w&&w.length;k&&!i(w[0])&&(w=[w]);var T=k?w.map((function(t){return t.map(g)})):[[-1/0,1/0]],A=s.values;A.length>s._length&&(A=A.slice(0,s._length));var E,P=s.tickvals;function I(t,e){return{val:t,text:E[e]}}function z(t,e){return t.val-e.val}if(i(P)&&P.length){n.isTypedArray(P)&&(P=Array.from(P)),E=s.ticktext,i(E)&&E.length?E.length>P.length?E=E.slice(0,P.length):P.length>E.length&&(P=P.slice(0,E.length)):E=P.map(a(s.tickformat));for(var O=1;O<P.length;O++)if(P[O]<P[O-1]){for(var D=P.map(I).sort(z),R=0;R<P.length;R++)P[R]=D[R].val,E[R]=D[R].text;break}}else P=void 0;return A=x.convertTypedArray(A),{key:v,label:s.label,tickFormat:s.tickformat,tickvals:P,ticktext:E,ordinal:x.isOrdinal(s),multiselect:s.multiselect,xIndex:c,crossfilterDimensionIndex:c,visibleIndex:s._index,height:l,values:A,paddedUnitValues:A.map(g),unitTickvals:P&&P.map(g),xScale:h,x:h(c),canvasX:h(c)*u,unitToPaddedPx:p,domainScale:M(l,b.verticalPadding,s,P,E),ordinalScale:C(s),parent:f,model:o,brush:_.makeBrush(t,k,T,(function(){t.linePickActive(!1)}),(function(){var e=f;e.focusLayer&&e.focusLayer.render(e.panels,!0);var r=L(e);!t.contextShown()&&r?(e.contextLayer&&e.contextLayer.render(e.panels,!0),t.contextShown(!0)):t.contextShown()&&!r&&(e.contextLayer&&e.contextLayer.render(e.panels,!0,!0),t.contextShown(!1))}),(function(r){if(f.focusLayer.render(f.panels,!0),f.pickLayer&&f.pickLayer.render(f.panels,!0),t.linePickActive(!0),e&&e.filterChanged){var i=g.invert,a=r.map((function(t){return t.map(i).sort(n.sorterAsc)})).sort((function(t,e){return t[0]-e[0]}));e.filterChanged(f.key,s._index,a)}}))}})),f}function z(t){t.classed(b.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(t,e){var r="top"===e?1:-1,n=t*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:t}}function D(t,e,r){for(var n=e.panels||(e.panels=[]),i=t.data(),a=0;a<i.length-1;a++){var o=n[a]||(n[a]={}),s=i[a],l=i[a+1];o.dim0=s,o.dim1=l,o.canvasX=s.canvasX,o.panelSizeX=l.canvasX-s.canvasX,o.panelSizeY=e.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=r}}function R(t,e){return s.tickText(t._ax,e,!1).text}function F(t,e){if(t.ordinal)return"";var r=t.domainScale.domain(),n=r[e?r.length-1:0];return R(t.model.dimensions[t.visibleIndex],n)}e.exports=function(t,e,i,a){var o=t._context.staticPlot,d=t._fullLayout,p=d._toppaper,m=d._glcontainer,v=t._context.plotGlPixelRatio,k=t._fullLayout.paper_bgcolor;!function(t){for(var e=0;e<t.length;e++)for(var r=0;r<t[e].length;r++)for(var n=t[e][r].trace,i=n.dimensions,a=0;a<i.length;a++){var o=i[a].values,l=i[a]._ax;l&&(l.range?l.range=A(l.range[0],l.range[1]):l.range=T(o,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=i[a].tickformat,s.calcTicks(l),l.cleanRange())}}(e);var S=function(){var t=!0,e=!1;return{linePickActive:function(e){return arguments.length?t=!!e:t},contextShown:function(t){return arguments.length?e=!!t:e}}}(),M=e.filter((function(t){return y(t).trace.visible})).map(P.bind(0,i)).map(I.bind(0,S,a));m.each((function(t,e){return n.extendFlat(t,M[e])}));var C=m.selectAll(".gl-canvas").each((function(t){t.viewModel=M[0],t.viewModel.plotGlPixelRatio=v,t.viewModel.paperColor=k,t.model=t.viewModel?t.viewModel.model:null})),E=null;C.filter((function(t){return t.pick})).style("pointer-events",o?"none":"auto").on("mousemove",(function(t){if(S.linePickActive()&&t.lineLayer&&a&&a.hover){var e=r.event,n=this.width,i=this.height,o=r.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=n||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,d={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==E&&(u?a.hover(d):a.unhover&&a.unhover(d),E=h)}})),C.style("opacity",(function(t){return t.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var B=p.selectAll("."+b.cn.parcoords).data(M,f);B.exit().remove(),B.enter().append("g").classed(b.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var j=B.selectAll("."+b.cn.parcoordsControlView).data(g,f);j.enter().append("g").classed(b.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var N=j.selectAll("."+b.cn.yAxis).data((function(t){return t.dimensions}),f);N.enter().append("g").classed(b.cn.yAxis,!0),j.each((function(t){D(N,t,v)})),C.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=w(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),N.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),N.call(r.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;S.linePickActive(!1),t.x=Math.max(-b.overdrag,Math.min(t.model.width+b.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,N.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),D(N,e,v),N.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),r.select(this).attr("transform",c(t.x,0)),N.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!L(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,D(N,e,v),r.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!L(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+b.cn.axisOverlays).data(g,f);U.enter().append("g").classed(b.cn.axisOverlays,!0),U.selectAll("."+b.cn.axis).remove();var V=U.selectAll("."+b.cn.axis).data(g,f);V.enter().append("g").classed(b.cn.axis,!0),V.each((function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return x.isOrdinal(t)?e:R(t.model.dimensions[t.visibleIndex],e)})).scale(n)),h.font(V.selectAll("text"),t.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+b.cn.axisHeading).data(g,f);q.enter().append("g").classed(b.cn.axisHeading,!0);var $=q.selectAll("."+b.cn.axisTitle).data(g,f);$.enter().append("text").classed(b.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),$.text((function(t){return t.label})).each((function(e){var n=r.select(this);h.font(n,e.model.labelFont),u.convertToTspans(n,t)})).attr("transform",(function(t){var e=O(t.model.labelAngle,t.model.labelSide),r=b.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=O(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var H=U.selectAll("."+b.cn.axisExtent).data(g,f);H.enter().append("g").classed(b.cn.axisExtent,!0);var W=H.selectAll("."+b.cn.axisExtentTop).data(g,f);W.enter().append("g").classed(b.cn.axisExtentTop,!0),W.attr("transform",c(0,-b.axisExtentOffset));var G=W.selectAll("."+b.cn.axisExtentTopText).data(g,f);G.enter().append("text").classed(b.cn.axisExtentTopText,!0).call(z),G.text((function(t){return F(t,!0)})).each((function(t){h.font(r.select(this),t.model.rangeFont)}));var Y=H.selectAll("."+b.cn.axisExtentBottom).data(g,f);Y.enter().append("g").classed(b.cn.axisExtentBottom,!0),Y.attr("transform",(function(t){return c(0,t.model.height+b.axisExtentOffset)}));var Z=Y.selectAll("."+b.cn.axisExtentBottomText).data(g,f);Z.enter().append("text").classed(b.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),Z.text((function(t){return F(t,!1)})).each((function(t){h.font(r.select(this),t.model.rangeFont)})),_.ensureAxisBrush(U,k,t)}}}),Xx=d({"src/traces/parcoords/plot.js"(t,e){var r=Zx(),n=ux(),i=Gx().isVisible,a={};function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var s=t._fullLayout;if(n(t,[],a)){var l={},c={},u={},h={},d=s._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()})),r(t,e,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{filterChanged:function(e,r,n){var i=c[e][r],a=n.map((function(t){return t.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[o]){var d=i.constraintrange;l[o]=d||null}var p=t._fullData[u[e]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,p.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete p.constraintrange,a=null);var f={};f[o]=a,t.emit("plotly_restyle",[f,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,c[e].filter(i));l[e].sort(n),c[e].filter((function(t){return!i(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}}),Kx=d({"src/traces/parcoords/base_plot.js"(t){var e=v(),r=_e().getModuleCalcData,n=Xx(),i=Te();t.name="parcoords",t.plot=function(t){var e=r(t.calcdata,"parcoords")[0];e.length&&n(t,e)},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter((function(t,e){return e===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})})),window.setTimeout((function(){e.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Jx=d({"src/traces/parcoords/base_index.js"(t,e){e.exports={attributes:Ix(),supplyDefaults:Rx(),calc:Fx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Kx(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Qx=d({"src/traces/parcoords/index.js"(t,e){var r=Jx();r.plot=Xx(),e.exports=r}}),tb=d({"lib/parcoords.js"(t,e){e.exports=Qx()}}),eb=d({"src/traces/parcats/attributes.js"(t,e){var r=D().extendFlat,n=N(),i=R(),a=Pe(),o=Ot().hovertemplateAttrs,s=ka().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),rb=d({"src/traces/parcats/defaults.js"(t,e){var r=se(),n=Me().hasColorscale,i=Ve(),a=ka().defaults,o=Be(),s=eb(),l=mx(),c=M().isTypedArraySpec;function u(t,e){function n(n,i){return r.coerce(t,e,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=e.visible=!1),a){n("label"),n("displayindex",e._index);var o,l=t.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==h||(e.categoryorder="trace")}}e.exports=function(t,e,c,h){function d(n,i){return r.coerce(t,e,s,n,i)}var p=o(t,e,{name:"dimensions",handleItemDefaults:u}),f=function(t,e,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,c,h,d);a(e,h,d),Array.isArray(p)&&p.length||(e.visible=!1),l(e,p,"values",f),d("hoveron"),d("hovertemplate"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var m=h.font;r.coerceFont(d,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(d,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),nb=d({"src/traces/parcats/calc.js"(t,e){var r=Ox().wrap,n=Me().hasColorscale,i=He(),a=ne(),o=Je(),s=se(),l=k();function c(t,e,r){t.valueInds.push(e),t.count+=r}function u(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var h=s.filterVisible(e.dimensions);if(0===h.length)return[];var d,p,f,m=h.map((function(t){var e;if("trace"===t.categoryorder)e=null;else if("array"===t.categoryorder)e=t.categoryarray;else{e=a(t.values);for(var r=!0,n=0;n<e.length;n++)if(!l(e[n])){r=!1;break}e.sort(r?s.sorterAsc:void 0),"category descending"===t.categoryorder&&(e=e.reverse())}return function(t,e){e=void 0===e||null===e?[]:e.map((function(t){return t}));var r={},n={},i=[];e.forEach((function(t,e){r[t]=0,n[t]=e}));for(var a=0;a<t.length;a++){var o,s=t[a];void 0===r[s]?(r[s]=1,o=e.push(s)-1,n[s]=o):(r[s]++,o=n[s]),i.push(o)}var l=e.map((function(t){return r[t]}));return{uniqueValues:e,uniqueCounts:l,inds:i}}(t.values,e)}));d=s.isArrayOrTypedArray(e.counts)?e.counts:[e.counts],function(t){var e,r=t.map((function(t){return t.displayindex}));if(function(t){for(var e=new Array(t.length),r=0;r<t.length;r++){if(t[r]<0||t[r]>=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;e<t.length;e++)t[e]._displayindex=t[e].displayindex;else for(e=0;e<t.length;e++)t[e]._displayindex=e}(h),h.forEach((function(t,e){!function(t,e){t._categoryarray=e.uniqueValues,null===t.ticktext||void 0===t.ticktext?t._ticktext=[]:t._ticktext=t.ticktext.slice();for(var r=t._ticktext.length;r<e.uniqueValues.length;r++)t._ticktext.push(e.uniqueValues[r])}(t,m[e])}));var g,y=e.line;function v(t){var e,r;return s.isArrayOrTypedArray(y.color)?r=e=y.color[t%y.color.length]:e=y.color,{color:g(e),rawColor:r}}y?(n(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),g=o.tryColorscale(y)):g=s.identity;var x,b,_,w,k,T=h[0].values.length,S={},A=m.map((function(t){return t.inds}));for(f=0,x=0;x<T;x++){var M=[];for(b=0;b<A.length;b++)M.push(A[b][x]);p=d[x%d.length],f+=p;var C=v(x),E=M+"-"+C.rawColor;void 0===S[E]&&(S[E]=(_=M,w=C.color,k=C.rawColor,{categoryInds:_,color:w,rawColor:k,valueInds:[],count:0})),u(S[E],x,p)}var L,P=h.map((function(t,e){return function(t,e,r,n,i){return{dimensionInd:t,containerInd:e,displayInd:r,dimensionLabel:n,count:i,categories:[],dragX:null}}(e,t._index,t._displayindex,t.label,f)}));for(x=0;x<T;x++)for(p=d[x%d.length],b=0;b<P.length;b++){var I=P[b].containerInd,z=m[b].inds[x],O=P[b].categories;if(void 0===O[z]){var D=e.dimensions[I]._categoryarray[z],R=e.dimensions[I]._ticktext[z];O[z]={dimensionInd:b,categoryInd:L=z,categoryValue:D,displayInd:L,categoryLabel:R,valueInds:[],count:0,dragY:null}}c(O[z],x,p)}return r(function(t,e,r){var n=t.map((function(t){return t.categories.length})).reduce((function(t,e){return Math.max(t,e)}));return{dimensions:t,paths:e,trace:void 0,maxCats:n,count:r}}(P,S,f))}}}),ib=d({"src/traces/parcats/parcats.js"(t,e){var r=v(),n=(jp(),m(Dp)).interpolateNumber,i=zn(),a=zr(),o=se(),s=o.strTranslate,l=Je(),c=O(),u=Ae();function h(t,e,n,i){var a=e._context.staticPlot,c=t.map(j.bind(0,e,n)),h=i.selectAll("g.parcatslayer").data([null]);h.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var m=h.selectAll("g.trace.parcats").data(c,d),v=m.enter().append("g").attr("class","trace parcats");m.attr("transform",(function(t){return s(t.x,t.y)})),v.append("g").attr("class","paths");var x=m.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),d);x.attr("fill",(function(t){return t.model.color}));var b=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);w(b),x.attr("d",(function(t){return t.svgD})),b.empty()||x.sort(f),x.exit().remove(),x.on("mouseover",g).on("mouseout",y).on("click",_),v.append("g").attr("class","dimensions");var k=m.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),d);k.enter().append("g").attr("class","dimension"),k.attr("transform",(function(t){return s(t.x,0)})),k.exit().remove();var A=k.selectAll("g.category").data((function(t){return t.categories}),d),M=A.enter().append("g").attr("class","category");A.attr("transform",(function(t){return s(0,t.y)})),M.append("rect").attr("class","catrect").attr("pointer-events","none"),A.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(M);var C=A.selectAll("rect.bandrect").data((function(t){return t.bands}),d);C.each((function(){o.raiseToTop(this)})),C.attr("fill",(function(t){return t.color}));var E=C.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);C.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),S(E),C.exit().remove(),M.append("text").attr("class","catlabel").attr("pointer-events","none"),A.select("text.catlabel").attr("text-anchor",(function(t){return p(t)?"start":"end"})).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",(function(t){return p(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){l.font(r.select(this),t.parcatsViewModel.categorylabelfont),u.convertToTspans(r.select(this),e)})),M.append("text").attr("class","dimlabel"),A.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){l.font(r.select(this),t.parcatsViewModel.labelfont)})),A.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",P),A.exit().remove(),k.call(r.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",I).on("drag",z).on("dragend",D)),m.each((function(t){t.traceSelection=r.select(this),t.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),m.exit().remove()}function d(t){return t.key}function p(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function f(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor<e.model.rawColor?-1:0}function g(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),k(r.select(this));var e=x(t),n=b(t);if(t.parcatsViewModel.graphDiv.emit("plotly_hover",{points:e,event:r.event,constraints:n}),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")){var i,s,l,u=r.mouse(this)[0],h=t.parcatsViewModel.graphDiv,d=t.parcatsViewModel.trace,p=h._fullLayout,f=p._paperdiv.node().getBoundingClientRect(),m=t.parcatsViewModel.graphDiv.getBoundingClientRect();for(l=0;l<t.leftXs.length-1;l++)if(t.leftXs[l]+t.dimWidths[l]-2<=u&&u<=t.leftXs[l+1]+2){var g=t.parcatsViewModel.dimensions[l],y=t.parcatsViewModel.dimensions[l+1];i=(g.x+g.width+y.x)/2,s=(t.topYs[l]+t.topYs[l+1]+t.height)/2;break}var v=t.parcatsViewModel.x+i,_=t.parcatsViewModel.y+s,w=c.mostReadable(t.model.color,["black","white"]),T=t.model.count,S=T/t.parcatsViewModel.model.count,A={countLabel:T,probabilityLabel:S.toFixed(3)},M=[];-1!==t.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",A.countLabel].join(" ")),-1!==t.parcatsViewModel.hoverinfoItems.indexOf("probability")&&M.push(["P:",A.probabilityLabel].join(" "));var C=M.join("<br>"),E=r.mouse(h)[0];a.loneHover({trace:d,x:v-f.left+m.left,y:_-f.top+m.top,text:C,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:E<v?"right":"left",hovertemplate:(d.line||{}).hovertemplate,hovertemplateLabels:A,eventData:[{data:d._input,fullData:d,count:T,probability:S}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:h})}}}function y(t){if(!t.parcatsViewModel.dragDimension&&(w(r.select(this)),a.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(f),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var e=x(t),n=b(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:e,event:r.event,constraints:n})}}function x(t){for(var e=[],r=R(t.parcatsViewModel),n=0;n<t.model.valueInds.length;n++){var i=t.model.valueInds[n];e.push({curveNumber:r,pointNumber:i})}return e}function b(t){for(var e={},r=t.parcatsViewModel.model.dimensions,n=0;n<r.length;n++){var i=r[n],a=i.categories[t.model.categoryInds[n]];e[i.containerInd]=a.categoryValue}return void 0!==t.model.rawColor&&(e.color=t.model.rawColor),e}function _(t){if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var e=x(t),n=b(t);t.parcatsViewModel.graphDiv.emit("plotly_click",{points:e,event:r.event,constraints:n})}}function w(t){t.attr("fill",(function(t){return t.model.color})).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function k(t){t.attr("fill-opacity",.8).attr("stroke",(function(t){return c.mostReadable(t.model.color,["black","white"])})).attr("stroke-width",.3)}function T(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function S(t){t.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function A(t){var e=t.parcatsViewModel.pathSelection,r=t.categoryViewModel.model.dimensionInd,n=t.categoryViewModel.model.categoryInd;return e.filter((function(e){return e.model.categoryInds[r]===n&&e.model.color===t.color}))}function M(t,e,n){var i=r.select(t).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=r.select(t.parentNode).selectAll("rect.bandrect"),l=[];s.each((function(t){A(t).each((function(t){Array.prototype.push.apply(l,x(t))}))}));var c={};c[a.dimensionInd]=a.categoryValue,o.emit(e,{points:l,event:n,constraints:c})}function C(t,e,n){var i=r.select(t).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=A(i),l=[];s.each((function(t){Array.prototype.push.apply(l,x(t))}));var c={};c[a.dimensionInd]=a.categoryValue,void 0!==i.rawColor&&(c.color=i.rawColor),o.emit(e,{points:l,event:n,constraints:c})}function E(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.select(n.parentNode).select("rect.catrect"),c=l.node().getBoundingClientRect(),u=l.datum(),h=u.parcatsViewModel,d=h.model.dimensions[u.model.dimensionInd],p=h.trace,f=c.top+c.height/2;h.dimensions.length>1&&d.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var b=x.join("<br>");return{trace:p,x:o*(i-e.left),y:s*(f-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:v,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:y}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var e,n=t.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,u=this;"color"===l?(function(t){var e=r.select(t).datum(),n=A(e);k(n),n.each((function(){o.raiseToTop(this)})),r.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),C(u,"plotly_hover",r.event)):(function(t){r.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=A(t);k(e),e.each((function(){o.raiseToTop(this)}))})),r.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),M(u,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=E(n,s,u):"color"===l?e=function(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,d=h.parcatsViewModel,p=d.model.dimensions[h.model.dimensionInd],f=d.trace,m=l.y+l.height/2;d.dimensions.length>1&&p.displayInd===d.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(t){t.color===u.color&&(v+=t.count)}));var x=h.model.count,b=0;d.pathSelection.each((function(t){t.model.color===u.color&&(b+=t.model.count)}));var _=v/y,w=v/b,k=v/x,T={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},S=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",T.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(S.push("P(color \u2229 "+g+"): "+T.probabilityLabel),S.push("P("+g+" | color): "+w.toFixed(3)),S.push("P(color | "+g+"): "+k.toFixed(3)));var A=S.join("<br>"),M=c.mostReadable(u.color,["black","white"]);return{trace:f,x:o*(i-e.left),y:s*(m-e.top),text:A,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:M,fontSize:10,idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:T,eventData:[{data:f._input,fullData:f,category:g,count:y,probability:_,categorycount:x,colorcount:b,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(e=function(t,e,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(n,s,u)),e&&a.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function P(t){var e=t.parcatsViewModel;e.dragDimension||(w(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),S(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(f),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?C(this,"plotly_unhover",r.event):M(this,"plotly_unhover",r.event))}function I(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.y<i&&i<=e.y+e.height&&(t.potentialClickBand=this)})))})),t.parcatsViewModel.dragDimension=t,a.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function z(t){if("fixed"!==t.parcatsViewModel.arrangement&&(t.dragHasMoved=!0,null!==t.dragDimensionDisplayInd)){var e=t.dragDimensionDisplayInd,n=e-1,i=e+1,a=t.parcatsViewModel.dimensions[e];if(null!==t.dragCategoryDisplayInd){var o=a.categories[t.dragCategoryDisplayInd];o.model.dragY+=r.event.dy;var s=o.model.dragY,l=o.model.displayInd,c=a.categories,u=c[l-1],h=c[l+1];void 0!==u&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),void 0!==h&&s+o.height>h.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var d=t.parcatsViewModel.dimensions[n],p=t.parcatsViewModel.dimensions[i];void 0!==d&&a.model.dragX<d.x+d.width&&(a.model.displayInd=d.model.displayInd,d.model.displayInd=e),void 0!==p&&a.model.dragX+a.width>p.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}V(t.parcatsViewModel),U(t.parcatsViewModel),B(t.parcatsViewModel),F(t.parcatsViewModel)}}function D(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var e={},n=R(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==a[e]}));o&&a.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?C(t.potentialClickBand,"plotly_click",r.event.sourceEvent):M(t.potentialClickBand,"plotly_click",r.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),U(t.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){B(t.parcatsViewModel,!0),F(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[n])}))}}function R(t){for(var e,r=t.graphDiv._fullData,n=0;n<r.length;n++)if(t.key===r[n].uid){e=n;break}return e}function F(t,e){var r;void 0===e&&(e=!1),t.pathSelection.data((function(t){return t.paths}),d),(r=t.pathSelection,e?r.transition():r).attr("d",(function(t){return t.svgD}))}function B(t,e){function n(t){return e?t.transition():t}void 0===e&&(e=!1),t.dimensionSelection.data((function(t){return t.dimensions}),d);var i=t.dimensionSelection.selectAll("g.category").data((function(t){return t.categories}),d);n(t.dimensionSelection).attr("transform",(function(t){return s(t.x,0)})),n(i).attr("transform",(function(t){return s(0,t.y)})),i.select(".dimlabel").text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})),i.select(".catlabel").attr("text-anchor",(function(t){return p(t)?"start":"end"})).attr("x",(function(t){return p(t)?t.width+5:-5})).each((function(t){var e,n;p(t)?(e=t.width+5,n="start"):(e=-5,n="end"),r.select(this).selectAll("tspan").attr("x",e).attr("text-anchor",n)}));var a=i.selectAll("rect.bandrect").data((function(t){return t.bands}),d),l=a.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);a.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})),S(l),a.each((function(){o.raiseToTop(this)})),a.exit().remove()}function j(t,e,r){var n,i=r[0],a=e.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=e.width,c=e.height,u=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(c*(s.y[1]-s.y[0])),d=s.x[0]*l+a.l,p=e.height-s.y[1]*e.height+a.t,f=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:i,x:d,y:p,width:u,height:h,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:f,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:t,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(V(m),U(m)),m}function N(t,e,r,i,a){var o,s,l=[],c=[];for(s=0;s<r.length-1;s++)o=n(r[s]+t[s],t[s+1]),l.push(o(a)),c.push(o(1-a));var u="M "+t[0]+","+e[0];for(u+="l"+r[0]+",0 ",s=1;s<r.length;s++)u+="C"+l[s-1]+","+e[s-1]+" "+c[s-1]+","+e[s]+" "+t[s]+","+e[s],u+="l"+r[s]+",0 ";for(u+="l0,"+i+" ",u+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)u+="C"+c[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),u+="l-"+r[s]+",0 ";return u+="Z"}function U(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),n<i?-1:n>i?1:0}));for(var d=new Array(c.length),p=e[0].model.count,f=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m<c.length;m++){var g,y=c[m];g=p>0?f*(y.count/p):0;for(var v,x=new Array(n.length),b=0;b<y.categoryInds.length;b++){var _=y.categoryInds[b],w=i[b][_],k=a[b];x[k]=n[k][w],n[k][w]+=g;var T=t.dimensions[k].categories[w],S=T.bands.length,A=T.bands[S-1];if(void 0===A||y.rawColor!==A.rawColor){var M=void 0===A?0:A.y+A.height;T.bands.push({key:M,color:y.color,rawColor:y.rawColor,height:g,width:T.width,count:y.count,y:M,categoryViewModel:T,parcatsViewModel:t})}else{var C=T.bands[S-1];C.height+=g,C.count+=y.count}}v="hspline"===t.pathShape?N(s,x,l,g,.5):N(s,x,l,g,0),d[m]={key:y.valueInds[0],model:y,height:g,leftXs:s,topYs:x,dimWidths:l,svgD:v,parcatsViewModel:t}}t.paths=d}function V(t){var e=t.model.dimensions.map((function(t){return{displayInd:t.displayInd,dimensionInd:t.dimensionInd}}));e.sort((function(t,e){return t.displayInd-e.displayInd}));var r=[];for(var n in e){var i=e[n].dimensionInd,a=t.model.dimensions[i];r.push(q(t,a))}t.dimensions=r}function q(t,e){var r,n=t.model.dimensions.length,i=e.displayInd;r=40+(n>1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=t.model.maxCats,d=e.categories.length,p=e.count,f=t.height-8*(h-1),m=8*(h-d)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c<d;c++)l=g[c].categoryInd,o=e.categories[l],a=p>0?o.count/p*f:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}}}),ab=d({"src/traces/parcats/plot.js"(t,e){var r=ib();e.exports=function(t,e,n,i){var a=t._fullLayout,o=a._paper,s=a._size;r(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),ob=d({"src/traces/parcats/base_plot.js"(t){var e=_e().getModuleCalcData,r=ab(),n="parcats";t.name=n,t.plot=function(t,i,a,o){var s=e(t.calcdata,n);if(s.length){var l=s[0];r(t,l,a,o)}},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcats"),a=e._has&&e._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),sb=d({"src/traces/parcats/index.js"(t,e){e.exports={attributes:eb(),supplyDefaults:rb(),calc:nb(),plot:ab(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:ob(),categories:["noOpacity"],meta:{}}}}),lb=d({"lib/parcats.js"(t,e){e.exports=sb()}}),cb=d({"src/plots/mapbox/constants.js"(t,e){var r=Wt(),n="1.13.4",i='\xa9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',a=['\xa9 <a target="_blank" href="https://carto.com/">Carto</a>',i].join(" "),o=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);e.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),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("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),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("\n"),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" class="st1"/%3E%3Cpath d="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" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="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 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),ub=d({"src/plots/mapbox/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=ka().attributes,a=R(),o=wn().textposition,s=Pt().overrideAll,l=ge().templatedArray,c=cb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),hb=d({"src/traces/scattermapbox/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=ub(),l=N(),c=Pe(),u=D().extendFlat,h=Pt().overrideAll,d=ub(),p=a.line,f=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},d.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),db=d({"src/traces/scattermapbox/constants.js"(t,e){var 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 Extrabold Italic","Open Sans Extrabold","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"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),pb=d({"src/traces/scattermapbox/defaults.js"(t,e){var r=se(),n=Ge(),i=Wn(),a=Gn(),o=Zn(),s=Xn(),l=hb(),c=db().isSupportedFont;e.exports=function(t,e,u,h){function d(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var f=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,d);if(f){if(d("text"),d("texttemplate"),d("hovertext"),d("hovertemplate"),d("mode"),d("below"),n.hasMarkers(e)){i(t,e,u,h,d,{noLine:!0,noAngle:!0}),d("marker.allowoverlap"),d("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,d,{noDash:!0}),d("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),b=p("cluster.opacity");if(d("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(e)){var _=h.font.family;o(t,e,h,d,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}d("fill"),"none"!==e.fill&&s(t,e,u,d),r.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}}}),fb=d({"src/traces/scattermapbox/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),mb=d({"src/plots/mapbox/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),gb=d({"src/traces/scattermapbox/convert.js"(t,e){var r=k(),n=se(),i=T().BADNUM,a=Qm(),o=We(),s=Je(),l=Ye(),c=Ge(),u=db().isSupportedFont,h=mb(),d=Ze().appendArrayPointValue,p=Ae().NEWLINES,f=Ae().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i<t.length;i++)r.push(e[i-1],t[i])}else r=t;return r}function b(t){var e=t.textfont,r=e.family,n=e.style,i=e.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,C=u.cluster&&u.cluster.enabled,E=m("fill"),L=m("line"),P=m("circle"),I=m("symbol"),z={fill:E,line:L,circle:P,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(e)),w&&(E.geojson=a.makePolygon(i),E.layout.visibility="visible",n.extendFlat(E.paint,{"fill-color":u.fillcolor})),k&&(L.geojson=a.makeLine(i),L.layout.visibility="visible",n.extendFlat(L.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,d=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,b=[];for(e=0;e<t.length;e++){var _=t[e],w=_.lonlat;if(!v(w)){var k={};i&&(k.mcc=_.mcc=i(_.mc)),a&&(k.mrc=_.mrc=a(_.ms)),c&&(k.mo=c(_.mo)),d&&(k.selected=_.selected||0),b.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:w},properties:k})}}if(d)for(x=s.makeSelectedPointStyleFns(u),e=0;e<b.length;e++){var T=b[e].properties;x.selectedOpacityFn&&(T.mo=g(x.selectedOpacityFn(T))),x.selectedColorFn&&(T.mcc=x.selectedColorFn(T)),x.selectedSizeFn&&(T.mrc=x.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:b},mcc:p||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:f||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);P.geojson=O.geojson,P.layout.visibility="visible",C&&(P.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":b(u),"text-size":12}}),n.extendFlat(P.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(A&&C&&(P.filter=["!",["has","point_count"]]),(M||S)&&(I.geojson=function(t,e){for(var r=e._fullLayout,i=t[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<t.length;x++){var b=t[x];if(!v(b.lonlat)){var _,w=i.texttemplate;if(w){var k=Array.isArray(w)?w[x]||"":w,T=i._module.formatLabels(b,i,r),S={};d(S,i,b.i);var A=i._meta||{};_=n.texttemplateString(k,T,r._d3locale,S,b,A)}else _=h(x);_&&(_=_.replace(p,"").replace(f,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:b.lonlat},properties:{symbol:l(x),angle:u(x),text:_}})}}return{type:"FeatureCollection",features:m}}(e,t),n.extendFlat(I.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),M&&(n.extendFlat(I.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(I.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),I.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(I.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),S)){var D=(u.marker||{}).size,R=h(u.textposition,D);n.extendFlat(I.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":b(u)}),n.extendFlat(I.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),yb=d({"src/traces/scattermapbox/plot.js"(t,e){var r=se(),n=gb(),i=cb().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(t,e,n){var i={type:"geojson",data:e.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[t]);a?a.setData(e.geojson):this.subplot.map.addSource(this.sourceIds[t],i)},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter);for(var i,a=this.layerIds[t],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(t){var e=t[0].trace,r=this.subplot,i=r.map,o=n(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(t){c?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function d(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(t):function(t){for(var e=a.nonCluster,r=0;r<e.length;r++){var n=e[r],i=o[n];t||u.addSource(n,i),u.addLayer(n,i,s)}}(t)}function p(){for(var t=l?a.cluster:a.nonCluster,e=0;e<t.length;e++){var n=t[e],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}var f=this.isHidden,m=!0!==e.visible;m?f||h():f?m||d():c!==l?(h(),d()):this.below!==s?(h(!0),d(!0),p()):p(),this.clusterEnabled=l,this.isHidden=m,this.below=s,t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=this.clusterEnabled?a.cluster:a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),d=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",d.circle,l.cluster),r=0;r<a.cluster.length;r++)s=d[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=d[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return e[0].trace._glTrace=h,h}}}),vb=d({"src/traces/scattermapbox/hover.js"(t,e){var r=zr(),n=se(),i=mi(),a=n.fillText,o=T().BADNUM,s=cb().traceLayerPrefix;function l(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,c),c.join("<br>")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,d=t.ya,p=t.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===f.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-d.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var b=c[t.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=d.c2p(w),S=b.mrc||1;t.x0=k-S,t.x1=k+S,t.y0=T-S,t.y1=T+S;var A={};A[u.subplot]={_subplot:p};var M=u._module.formatLabels(b,u,A);return t.lonLabel=M.lonLabel,t.latLabel=M.latLabel,t.color=i(u,b),t.extraText=l(u,b,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),xb=d({"src/traces/scattermapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),bb=d({"src/traces/scattermapbox/select.js"(t,e){var r=se(),n=Ge(),i=T().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],d=h.lonlat;if(d[0]!==i){var p=[r.modHalf(d[0],360),d[1]],f=[s.c2p(p),l.c2p(p)];e.contains(f,null,a,t)?(c.push({pointNumber:a,lon:d[0],lat:d[1]}),h.selected=1):h.selected=0}}return c}}}),_b=d({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(t,e){var r,n;r=t,n=function(){var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),r=i(o),"undefined"!==typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r="1.13.4",n=i;function i(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for("undefined"===typeof e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!==typeof self?self:{},l=Math.pow(2,53)-1;function c(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var u=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function d(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}var f=1;function m(){return f++}function g(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function b(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function _(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"===typeof t&&t?b(t,w):t}var k={};function T(t){k[t]||("undefined"!==typeof console&&console.warn(t),k[t]=!0)}function S(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function A(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=t[r],e+=((o=t[i]).x-a.x)*(a.y+o.y);return e}function M(){return"undefined"!==typeof WorkerGlobalScope&&"undefined"!==typeof self&&self instanceof WorkerGlobalScope}function C(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var E=null;function L(t){if(null==E){var e=t.navigator?t.navigator.userAgent:null;E=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return E}function P(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(r){return!1}}var I,z,O,D,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,B=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,j={now:R,frame:function(t){var e=F(t);return{cancel:function(){return B(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return I||(I=s.document.createElement("a")),I.href=t,I.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&D&&(q?$(t):O=t)}},V=!1,q=!1;function $(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,D),t.isContextLost())return;U.supported=!0}catch(r){}t.deleteTexture(e),V=!0}s.document&&((D=s.document.createElement("img")).onload=function(){O&&$(O),O=null,q=!0},D.onerror=function(){V=!0,O=null},D.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var H="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function G(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",H,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!G(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!G(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!G(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return G(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=K(t),n=j.devicePixelRatio>=2||512===e?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||N.ACCESS_TOKEN;return N.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},W.prototype.canonicalizeTileURL=function(t,e){var r=K(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return!t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},W.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&G(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];Z(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},W.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(N.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){var i=t.params.indexOf("secure");i>=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!N.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return Y.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var Q="mapbox.eventData";function tt(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(s.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(n){return null}}var et=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};et.prototype.getStorageKey=function(t){var e,r=tt(N.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n=N.ACCESS_TOKEN||"",t?Q+"."+t+":"+n:Q+":"+n},et.prototype.fetchEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(a){T("Unable to read from LocalStorage")}},et.prototype.saveEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(n){T("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:H,userId:this.anonId},l=e?p(s,e):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=St(c,(function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)}))}},et.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var rt,nt,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(et),at=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=tt(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(et)),ot=at.postTurnstileEvent.bind(at),st=new it,lt=st.postMapLoadEvent.bind(st),ct="mapbox-tiles",ut=500,ht=50;function dt(){s.caches&&!rt&&(rt=s.caches.open(ct))}function pt(t,e,r){if(dt(),rt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=C(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===nt)try{new Response(new ReadableStream),nt=!0}catch(r){nt=!1}nt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new s.Response(e,n);dt(),rt&&rt.then((function(e){return e.put(ft(t.url),r)})).catch((function(t){return T(t.message)}))})))}}function ft(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function mt(t,e){if(dt(),!rt)return e(null);var r=ft(t.url);rt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=C(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var gt,yt=1/0;function vt(){return null==gt&&(gt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"===typeof s.createImageBitmap),gt}var xt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(xt);var bt=function(t){function e(e,r,n){401===r&&Z(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),_t=M()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function wt(t,e){var r,n=new s.AbortController,i=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:_t(),signal:n.signal}),a=!1,o=!1,l=(r=i.url).indexOf("sku=")>0&&Z(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&T(r),n&&a)return u(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return u(r,n,c)}return e(new bt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&pt(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return l?mt(i,c):c(null,null),{cancel:function(){o=!0,a||n.abort()}}}var kt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(_t())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return wt(t,e);if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(i){return e(i)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new bt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Tt=function(t,e){return kt(p(t,{type:"arrayBuffer"}),e)},St=function(t,e){return kt(p(t,{method:"POST"}),e)};function At(t){var e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}var Mt,Ct,Et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Mt=[],Ct=0;var Lt=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Ct>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Mt.push(r),r}Ct++;var n=!1,i=function(){if(!n)for(n=!0,Ct--;Mt.length&&Ct<N.MAX_PARALLEL_IMAGE_REQUESTS;){var t=Mt.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=Lt(e,r).cancel)}},a=Tt(t,(function(t,r,n,a){i(),t?e(t):r&&(vt()?function(t,e){var r=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,n){var i=new s.Image,a=s.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((function(){i.src=Et}))},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?a.createObjectURL(o):Et}(r,e,n,a))}));return{cancel:function(){a.cancel(),i()}}};function Pt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function It(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var zt=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},Ot=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(zt),Dt=function(){};Dt.prototype.on=function(t,e){return this._listeners=this._listeners||{},Pt(t,e,this._listeners),this},Dt.prototype.off=function(t,e){return It(t,e,this._listeners),It(t,e,this._oneTimeListeners),this},Dt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Pt(t,e,this._oneTimeListeners),this},Dt.prototype.fire=function(t,e){"string"===typeof t&&(t=new zt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];It(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(p(t,"function"===typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Ot&&console.error(t.error);return this},Dt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Rt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ft=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)};function Bt(t){var e=t.key,r=t.value;return r?[new Ft(e,r,"constants have been deprecated as of v8")]:[]}function jt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}function Nt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ut(t){if(Array.isArray(t))return t.map(Ut);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Ut(t[r]);return e}return Nt(t)}var Vt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),qt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o}};qt.prototype.concat=function(t){return new qt(this,t)},qt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},qt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var $t={kind:"null"},Ht={kind:"number"},Wt={kind:"string"},Gt={kind:"boolean"},Yt={kind:"color"},Zt={kind:"object"},Xt={kind:"value"},Kt={kind:"collator"},Jt={kind:"formatted"},Qt={kind:"resolvedImage"};function te(t,e){return{kind:"array",itemType:t,N:e}}function ee(t){if("array"===t.kind){var e=ee(t.itemType);return"number"===typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var re=[$t,Ht,Wt,Gt,Yt,Jt,Zt,te(Xt),Qt];function ne(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ne(t.itemType,e.itemType))&&("number"!==typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=re;r<n.length;r+=1)if(!ne(n[r],e))return null}return"Expected "+ee(t)+" but found "+ee(e)+" instead."}function ie(t,e){return e.some((function(e){return e.kind===t.kind}))}function ae(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"===typeof t:e===typeof t}))}var oe=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),m=o(h[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),d];default:return null}}return null}}catch(l){}})).parseCSSColor,se=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};se.parse=function(t){if(t){if(t instanceof se)return t;if("string"===typeof t){var e=oe(t);if(e)return new se(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},se.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},se.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},se.black=new se(0,0,0,1),se.white=new se(1,1,1,1),se.transparent=new se(0,0,0,0),se.red=new se(1,0,0,1);var le=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};le.prototype.compare=function(t,e){return this.collator.compare(t,e)},le.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ce=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ue=function(t){this.sections=t};ue.fromString=function(t){return new ue([new ce(t,null,null,null,null)])},ue.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ue.factory=function(t){return t instanceof ue?t:ue.fromString(t)},ue.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ue.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var he=function(t){this.name=t.name,this.available=t.available};function de(t,e,r,n){return"number"===typeof t&&t>=0&&t<=255&&"number"===typeof e&&e>=0&&e<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function pe(t){if(null===t)return!0;if("string"===typeof t)return!0;if("boolean"===typeof t)return!0;if("number"===typeof t)return!0;if(t instanceof se)return!0;if(t instanceof le)return!0;if(t instanceof ue)return!0;if(t instanceof he)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!pe(r[e]))return!1;return!0}if("object"===typeof t){for(var n in t)if(!pe(t[n]))return!1;return!0}return!1}function fe(t){if(null===t)return $t;if("string"===typeof t)return Wt;if("boolean"===typeof t)return Gt;if("number"===typeof t)return Ht;if(t instanceof se)return Yt;if(t instanceof le)return Kt;if(t instanceof ue)return Jt;if(t instanceof he)return Qt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=fe(i[n]);if(e){if(e===a)continue;e=Xt;break}e=a}return te(e||Xt,r)}return Zt}function me(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof se||t instanceof ue||t instanceof he?t.toString():JSON.stringify(t)}he.prototype.toString=function(){return this.name},he.fromString=function(t){return t?new he({name:t,available:!1}):null},he.prototype.serialize=function(){return["image",this.name]};var ge=function(t,e){this.type=t,this.value=e};ge.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!pe(t[1]))return e.error("invalid value");var r=t[1],n=fe(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"===typeof i.N&&0!==i.N||(n=i),new ge(n,r)},ge.prototype.evaluate=function(){return this.value},ge.prototype.eachChild=function(){},ge.prototype.outputDefined=function(){return!0},ge.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof se?["rgba"].concat(this.value.toArray()):this.value instanceof ue?this.value.serialize():this.value};var ye=function(t){this.name="ExpressionEvaluationError",this.message=t};ye.prototype.toJSON=function(){return this.message};var ve={string:Wt,number:Ht,boolean:Gt,object:Zt},xe=function(t,e){this.type=t,this.args=e};xe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!==typeof s||!(s in ve)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ve[s],n++}else a=Xt;if(t.length>3){if(null!==t[2]&&("number"!==typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=te(a,o)}else r=ve[i];for(var l=[];n<t.length;n++){var c=e.parse(t[n],n,Xt);if(!c)return null;l.push(c)}return new xe(r,l)},xe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!ne(this.type,fe(r)))return r;if(e===this.args.length-1)throw new ye("Expected value to be of type "+ee(this.type)+", but found "+ee(fe(r))+" instead.")}return null},xe.prototype.eachChild=function(t){this.args.forEach(t)},xe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},xe.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"===typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var be=function(t){this.type=Jt,this.sections=t};be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"===typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,te(Wt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Yt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,Xt);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new be(n)},be.prototype.evaluate=function(t){return new ue(this.sections.map((function(e){var r=e.content.evaluate(t);return fe(r)===Qt?new ce("",r,null,null,null):new ce(me(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},be.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},be.prototype.outputDefined=function(){return!1},be.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var _e=function(t){this.type=Qt,this.input=t};_e.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Wt);return r?new _e(r):e.error("No image name provided.")},_e.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=he.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},_e.prototype.eachChild=function(t){t(this.input)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return["image",this.input.serialize()]};var we={"to-boolean":Gt,"to-color":Yt,"to-number":Ht,"to-string":Wt},ke=function(t,e){this.type=t,this.args=e};ke.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=we[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Xt);if(!o)return null;i.push(o)}return new ke(n,i)},ke.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof se)return e;if("string"===typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":de(e[0],e[1],e[2],e[3])))return new se(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ye(r||"Could not parse color from value '"+("string"===typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var c=Number(o);if(!isNaN(c))return c}throw new ye("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ue.fromString(me(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?he.fromString(me(this.args[0].evaluate(t))):me(this.args[0].evaluate(t))},ke.prototype.eachChild=function(t){this.args.forEach(t)},ke.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ke.prototype.serialize=function(){if("formatted"===this.type.kind)return new be([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _e(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Te=["Unknown","Point","LineString","Polygon"],Se=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Se.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Se.prototype.geometryType=function(){return this.feature?"number"===typeof this.feature.type?Te[this.feature.type]:this.feature.type:null},Se.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Se.prototype.canonicalID=function(){return this.canonical},Se.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Se.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=se.parse(t)),e};var Ae=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};Ae.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ae.prototype.eachChild=function(t){this.args.forEach(t)},Ae.prototype.outputDefined=function(){return!1},Ae.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Ae.parse=function(t,e){var r,n=t[0],i=Ae.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,c=0,u=s;c<u.length;c+=1){var h=u[c],d=h[0],p=h[1];l=new Xe(e.registry,e.path,null,e.scope);for(var f=[],m=!1,g=1;g<t.length;g++){var y=t[g],v=Array.isArray(d)?d[g-1]:d.type,x=l.parse(y,1+f.length,v);if(!x){m=!0;break}f.push(x)}if(!m)if(Array.isArray(d)&&d.length!==f.length)l.error("Expected "+d.length+" arguments, but found "+f.length+" instead.");else{for(var b=0;b<f.length;b++){var _=Array.isArray(d)?d[b]:d.type,w=f[b];l.concat(b+1).checkSubtype(_,w.type)}if(0===l.errors.length)return new Ae(n,a,p,f)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var k=(s.length?s:o).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(ee).join(", ")+")":"("+ee(e.type)+"...)"})).join(" | "),T=[],S=1;S<t.length;S++){var A=e.parse(t[S],1+T.length);if(!A)return null;T.push(ee(A.type))}e.error("Expected arguments of type "+k+", but found ("+T.join(", ")+") instead.")}return null},Ae.register=function(t,e){for(var r in Ae.definitions=e,e)t[r]=Ae};var Me=function(t,e,r){this.type=Kt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Me.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!==typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Gt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Gt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Wt))?null:new Me(n,i,a)},Me.prototype.evaluate=function(t){return new le(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Me.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Me.prototype.outputDefined=function(){return!1},Me.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Ce=8192;function Ee(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Le(t,e){return!(t[0]<=e[0])&&!(t[2]>=e[2])&&!(t[1]<=e[1])&&!(t[3]>=e[3])}function Pe(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*Ce),Math.round(i*a*Ce)]}function Ie(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function ze(t,e){for(var r,n,i,a=!1,o=0,s=e.length;o<s;o++)for(var l=e[o],c=0,u=l.length;c<u-1;c++){if(Ie(t,l[c],l[c+1]))return!1;r=t,n=l[c],i=l[c+1],n[1]>r[1]!==i[1]>r[1]&&r[0]<(i[0]-n[0])*(r[1]-n[1])/(i[1]-n[1])+n[0]&&(a=!a)}return a}function Oe(t,e){for(var r=0;r<e.length;r++)if(ze(t,e[r]))return!0;return!1}function De(t,e,r,n){var i=t[0]-r[0],a=t[1]-r[1],o=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],c=n[1]-r[1],u=i*c-l*a,h=o*c-l*s;return u>0&&h<0||u<0&&h>0}function Re(t,e,r,n){var i,a,o=[e[0]-t[0],e[1]-t[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!==(i=s)[0]*(a=o)[1]-i[1]*a[0]&&!(!De(t,e,r,n)||!De(r,n,t,e))}function Fe(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(Re(t,e,a[o],a[o+1]))return!0;return!1}function Be(t,e){for(var r=0;r<t.length;++r)if(!ze(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Fe(t[n],t[n+1],e))return!1;return!0}function je(t,e){for(var r=0;r<e.length;r++)if(Be(t,e[r]))return!0;return!1}function Ne(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Pe(t[i][o],r);Ee(e,s),a.push(s)}n.push(a)}return n}function Ue(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Ne(t[i],e,r);n.push(a)}return n}function Ve(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ee(e,t)}function qe(t,e,r,n){for(var i=Math.pow(2,n.z)*Ce,a=[n.x*Ce,n.y*Ce],o=[],s=0,l=t;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var h=u[c],d=[h.x+a[0],h.y+a[1]];Ve(d,e,r,i),o.push(d)}return o}function $e(t,e,r,n){for(var i,a=Math.pow(2,n.z)*Ce,o=[n.x*Ce,n.y*Ce],s=[],l=0,c=t;l<c.length;l+=1){for(var u=[],h=0,d=c[l];h<d.length;h+=1){var p=d[h],f=[p.x+o[0],p.y+o[1]];Ee(e,f),u.push(f)}s.push(u)}if(e[2]-e[0]<=a/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)Ve(v[y],e,r,a)}return s}var He=function(t,e){this.type=Gt,this.geojson=t,this.geometries=e};function We(t){if(t instanceof Ae){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof He)return!1;var e=!0;return t.eachChild((function(t){e&&!We(t)&&(e=!1)})),e}function Ge(t){if(t instanceof Ae&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Ge(t)&&(e=!1)})),e}function Ye(t,e){if(t instanceof Ae&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ye(t,e)&&(r=!1)})),r}He.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(pe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new He(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new He(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new He(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},He.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ne(e.coordinates,n,i),o=qe(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!ze(l[s],a))return!1}if("MultiPolygon"===e.type){var c=Ue(e.coordinates,n,i),u=qe(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Oe(d[h],c))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ne(e.coordinates,n,i),o=$e(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Be(l[s],a))return!1}if("MultiPolygon"===e.type){var c=Ue(e.coordinates,n,i),u=$e(t.geometry(),r,n,i);if(!Le(r,n))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!je(d[h],c))return!1}return!0}(t,this.geometries)}return!1},He.prototype.eachChild=function(){},He.prototype.outputDefined=function(){return!0},He.prototype.serialize=function(){return["within",this.geojson]};var Ze=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ze.parse=function(t,e){if(2!==t.length||"string"!==typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ze(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ze.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ze.prototype.eachChild=function(){},Ze.prototype.outputDefined=function(){return!1},Ze.prototype.serialize=function(){return["var",this.name]};var Xe=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new qt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Ke(t){if(t instanceof Ze)return Ke(t.boundExpression);if(t instanceof Ae&&"error"===t.name)return!1;if(t instanceof Me)return!1;if(t instanceof He)return!1;var e=t instanceof ke||t instanceof xe,r=!0;return t.eachChild((function(t){r=e?r&&Ke(t):r&&t instanceof ge})),!!r&&We(t)&&Ye(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Je(t,e){for(var r,n,i=t.length-1,a=0,o=i,s=0;a<=o;)if(r=t[s=Math.floor((a+o)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;a=s+1}else{if(!(r>e))throw new ye("Input is not a number.");o=s-1}return 0}Xe.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Xe.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new xe(e,[t]):"coerce"===r?new ke(e,[t]):t}if(null!==t&&"string"!==typeof t&&"boolean"!==typeof t&&"number"!==typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof ge)&&"resolvedImage"!==a.type.kind&&Ke(a)){var l=new Se;try{a=new ge(a.type,a.evaluate(l))}catch(c){return this.error(c.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof t?this.error("'undefined' value invalid. Use null instead."):"object"===typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Xe.prototype.concat=function(t,e,r){var n="number"===typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Xe(this.registry,n,e||null,i,this.errors)},Xe.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Vt(n,t))},Xe.prototype.checkSubtype=function(t,e){var r=ne(t,e);return r&&this.error(r),r};var Qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};function tr(t,e,r){return t*(1-r)+e*r}Qe.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!==0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],l=a,c=a+1;if("number"!==typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qe(i,r,n)},Qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Je(e,n)].evaluate(t)},Qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Qe.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Qe.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var er=Object.freeze({__proto__:null,number:tr,color:function(t,e,r){return new se(tr(t.r,e.r,r),tr(t.g,e.g,r),tr(t.b,e.b,r),tr(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return tr(t,e[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(t){return t>sr?Math.pow(t,1/3):t/or+ir}function hr(t){return t>ar?t*t*t:or*(t-ir)}function dr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function pr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fr(t){var e=pr(t.r),r=pr(t.g),n=pr(t.b),i=ur((.4124564*e+.3575761*r+.1804375*n)/rr),a=ur((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*e+.119192*r+.9503041*n)/nr)),alpha:t.a}}function mr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*hr(e),r=rr*hr(r),n=nr*hr(n),new se(dr(3.2404542*r-1.5371385*e-.4985314*n),dr(-.969266*r+1.8760108*e+.041556*n),dr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function gr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:fr,reverse:mr,interpolate:function(t,e,r){return{l:tr(t.l,e.l,r),a:tr(t.a,e.a,r),b:tr(t.b,e.b,r),alpha:tr(t.alpha,e.alpha,r)}}},vr={forward:function(t){var e=fr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*cr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*lr,r=t.c;return mr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:gr(t.h,e.h,r),c:tr(t.c,e.c,r),l:tr(t.l,e.l,r),alpha:tr(t.alpha,e.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),br=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[0],c=s[1];this.labels.push(l),this.outputs.push(c)}};function _r(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}br.interpolationFactor=function(t,e,r,i){var a=0;if("exponential"===t.name)a=_r(e,t.base,r,i);else if("linear"===t.name)a=_r(e,1,r,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new n(o[0],o[1],o[2],o[3]).solve(_r(e,1,r,i))}return a},br.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!==typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!==typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!==0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ht)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Yt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<a.length;u+=2){var h=a[u],d=a[u+1],p=u+3,f=u+4;if("number"!==typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(d,f,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"===typeof c.N?new br(c,r,n,i,l):e.error("Type "+ee(c)+" is not interpolatable.")},br.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Je(e,n),o=e[a],s=e[a+1],l=br.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?er[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},br.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},br.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},br.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var wr=function(t,e){this.type=t,this.args=e};wr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=o[a],l=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var c=n&&i.some((function(t){return ne(n,t.type)}));return new wr(c?Xt:r,i)},wr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof he&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},wr.prototype.eachChild=function(t){this.args.forEach(t)},wr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},wr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var kr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};kr.prototype.evaluate=function(t){return this.result.evaluate(t)},kr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},kr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!==typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new kr(r,o):null},kr.prototype.outputDefined=function(){return this.result.outputDefined()},kr.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t.push(i,a.serialize())}return t.push(this.result.serialize()),t};var Tr=function(t,e,r){this.type=t,this.index=e,this.input=r};Tr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,te(e.expectedType||Xt));if(!r||!n)return null;var i=n.type;return new Tr(i.itemType,r,n)},Tr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ye("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ye("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ye("Array index must be an integer, but found "+e+" instead.");return r[e]},Tr.prototype.eachChild=function(t){t(this.index),t(this.input)},Tr.prototype.outputDefined=function(){return!1},Tr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Sr=function(t,e){this.type=Gt,this.needle=t,this.haystack=e};Sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);return r&&n?ie(r.type,[Gt,Wt,Ht,$t,Xt])?new Sr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ee(r.type)+" instead"):null},Sr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ae(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+ee(fe(e))+" instead.");if(!ae(r,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+ee(fe(r))+" instead.");return r.indexOf(e)>=0},Sr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Sr.prototype.outputDefined=function(){return!0},Sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ar=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};Ar.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);if(!r||!n)return null;if(!ie(r.type,[Gt,Wt,Ht,$t,Xt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ee(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Ar(r,n,i):null}return new Ar(r,n)},Ar.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ae(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+ee(fe(e))+" instead.");if(!ae(r,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+ee(fe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Ar.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Mr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!==1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var c=e.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,h=s;u<h.length;u+=1){var d=h[u];if("number"!==typeof d&&"string"!==typeof d)return c.error("Branch labels must be numbers or strings.");if("number"===typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof d&&Math.floor(d)!==d)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,fe(d)))return null}else r=fe(d);if("undefined"!==typeof i[String(d)])return c.error("Branch labels must be unique.");i[String(d)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var f=e.parse(t[1],1,Xt);if(!f)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new Mr(r,n,f,i,a,m):null},Mr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(fe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Mr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Mr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Mr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=r;l<c.length;l+=1){var u=c[l],h=u[0],d=u[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Cr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};Cr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!==0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Gt);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Cr(r,n,s):null},Cr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];if(i.evaluate(t))return a.evaluate(t)}return this.otherwise.evaluate(t)},Cr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t(i),t(a)}t(this.otherwise)},Cr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},Cr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Er=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function Lr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Pr(t,e,r,n){return 0===n.compare(e,r)}function Ir(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Gt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Xt);if(!a)return null;if(!Lr(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+ee(a.type)+"'.");var o=e.parse(t[2],2,Xt);if(!o)return null;if(!Lr(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+ee(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+ee(a.type)+"' and '"+ee(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new xe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new xe(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Kt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=fe(a),l=fe(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ye('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=fe(a),u=fe(o);if("string"!==c.kind||"string"!==u.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}Er.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!ie(r.type,[te(Xt),Wt,Xt]))return e.error("Expected first argument to be of type array or string, but found "+ee(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Er(r.type,r,n,i):null}return new Er(r.type,r,n)},Er.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ae(e,["string","array"]))throw new ye("Expected first argument to be of type array or string, but found "+ee(fe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Er.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zr=Ir("==",(function(t,e,r){return e===r}),Pr),Or=Ir("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Pr(0,e,r,n)})),Dr=Ir("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Rr=Ir(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Fr=Ir("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Br=Ir(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),jr=function(t,e,r,n,i){this.type=Wt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};jr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!==typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Wt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Wt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new jr(r,i,a,o,s)},jr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},jr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Nr=function(t){this.type=Ht,this.input=t};Nr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+ee(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"===typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ye("Expected value to be of type string or array, but found "+ee(fe(e))+" instead.")},Nr.prototype.eachChild=function(t){t(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ur={"==":zr,"!=":Or,">":Rr,"<":Dr,">=":Br,"<=":Fr,array:xe,at:Tr,boolean:xe,case:Cr,coalesce:wr,collator:Me,format:be,image:_e,in:Sr,"index-of":Ar,interpolate:br,"interpolate-hcl":br,"interpolate-lab":br,length:Nr,let:kr,literal:ge,match:Mr,number:xe,"number-format":jr,object:xe,slice:Er,step:Qe,string:xe,"to-boolean":ke,"to-color":ke,"to-number":ke,"to-string":ke,var:Ze,within:He};function Vr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=de(r,n,i,o);if(s)throw new ye(s);return new se(r/255*o,n/255*o,i/255*o,o)}function qr(t,e){return t in e}function $r(t,e){var r=e[t];return"undefined"===typeof r?null:r}function Hr(t){return{type:t}}function Wr(t){return{result:"success",value:t}}function Gr(t){return{result:"error",value:t}}function Yr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Zr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Xr(t){return!!t.expression&&t.expression.interpolated}function Kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Jr(t){return"object"===typeof t&&null!==t&&!Array.isArray(t)}function Qr(t){return t}function tn(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"===typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,c=t.type||(Xr(e)?"exponential":"interval");if(a&&((t=jt({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],se.parse(t[1])]}))),t.default?t.default=se.parse(t.default):t.default=se.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!xr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=t.stops;u<h.length;u+=1){var d=h[u];n[d[0]]=d[1]}i=typeof t.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=on}if(o){for(var p={},f=[],m=0;m<t.stops.length;m++){var g=t.stops[m],y=g[0].zoom;void 0===p[y]&&(p[y]={zoom:y,type:t.type,property:t.property,default:t.default,stops:[]},f.push(y)),p[y].stops.push([g[0].value,g[1]])}for(var v=[],x=0,b=f;x<b.length;x+=1){var _=b[x];v.push([p[_].zoom,tn(p[_],e)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:br.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(r,n){var i=r.zoom;return an({stops:v,base:t.base},e,i).evaluate(i,n)}}}if(l){var k="exponential"===c?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:br.interpolationFactor.bind(void 0,k),zoomStops:t.stops.map((function(t){return t[0]})),evaluate:function(a){var o=a.zoom;return r(t,e,o,n,i)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[t.property]:void 0;return void 0===s?en(t.default,e.default):r(t,e,s,n,i)}}}function en(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function rn(t,e,r,n,i){return en(typeof r===i?n[r]:void 0,t.default,e.default)}function nn(t,e,r){if("number"!==Kr(r))return en(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Je(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function an(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Kr(r))return en(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Je(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=er[e.type]||Qr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=xr[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function on(t,e,r){return"color"===e.type?r=se.parse(r):"formatted"===e.type?r=ue.fromString(r.toString()):"resolvedImage"===e.type?r=he.fromString(r.toString()):Kr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),en(r,t.default,e.default)}Ae.register(Ur,{error:[{kind:"error"},[Wt],function(t,e){var r=e[0];throw new ye(r.evaluate(t))}],typeof:[Wt,[Xt],function(t,e){return ee(fe(e[0].evaluate(t)))}],"to-rgba":[te(Ht,4),[Yt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Yt,[Ht,Ht,Ht],Vr],rgba:[Yt,[Ht,Ht,Ht,Ht],Vr],has:{type:Gt,overloads:[[[Wt],function(t,e){return qr(e[0].evaluate(t),t.properties())}],[[Wt,Zt],function(t,e){var r=e[0],n=e[1];return qr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Xt,overloads:[[[Wt],function(t,e){return $r(e[0].evaluate(t),t.properties())}],[[Wt,Zt],function(t,e){var r=e[0],n=e[1];return $r(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Xt,[Wt],function(t,e){return $r(e[0].evaluate(t),t.featureState||{})}],properties:[Zt,[],function(t){return t.properties()}],"geometry-type":[Wt,[],function(t){return t.geometryType()}],id:[Xt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Xt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,Hr(Ht),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Ht,Hr(Ht),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Ht,overloads:[[[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Ht],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Ht,[],function(){return Math.LN2}],pi:[Ht,[],function(){return Math.PI}],e:[Ht,[],function(){return Math.E}],"^":[Ht,[Ht,Ht],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Ht,[Ht],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Ht,[Ht],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Ht,[Ht],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Ht,[Ht],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Ht,[Ht],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Ht,[Ht],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Ht,[Ht],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Ht,[Ht],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Ht,Hr(Ht),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Ht,Hr(Ht),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Ht,[Ht],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Ht,[Ht],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ht,[Ht],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Ht,[Ht],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Gt,[Wt,Xt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Gt,[Xt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Gt,[Wt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Gt,[Wt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i===typeof a&&i<a}],"filter-id-<":[Gt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n===typeof i&&n<i}],"filter->":[Gt,[Wt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[Gt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[Gt,[Wt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[Gt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[Gt,[Wt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[Gt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[Gt,[Xt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Gt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Gt,[te(Wt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Gt,[te(Xt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Gt,[Wt,te(Xt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Gt,[Wt,te(Xt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Gt,overloads:[[[Gt,Gt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Hr(Gt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Gt,overloads:[[[Gt,Gt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Hr(Gt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Gt,[Gt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Gt,[Wt],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Wt,[Wt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Wt,[Wt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Wt,Hr(Xt),function(t,e){return e.map((function(e){return me(e.evaluate(t))})).join("")}],"resolved-locale":[Wt,[Kt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var sn=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new Se,this._defaultValue=e?"color"===(r=e).type&&Jr(r.default)?new se(0,0,0,0):"color"===r.type?se.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function ln(t){return Array.isArray(t)&&t.length>0&&"string"===typeof t[0]&&t[0]in Ur}function cn(t,e){var r=new Xe(Ur,[],e?function(t){var e={color:Yt,string:Wt,number:Ht,enum:Wt,boolean:Gt,formatted:Jt,resolvedImage:Qt};return"array"===t.type?te(e[t.value]||Xt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Wr(new sn(n,e)):Gr(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ye("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var un=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ge(e.expression)};un.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},un.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var hn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ge(e.expression),this.interpolationType=n};function dn(t,e){if("error"===(t=cn(t,e)).result)return t;var r=t.value.expression,n=We(r);if(!n&&!Yr(e))return Gr([new Vt("","data expressions not supported")]);var i=Ye(r,["zoom"]);if(!i&&!Zr(e))return Gr([new Vt("","zoom expressions not supported")]);var a=fn(r);if(!a&&!i)return Gr([new Vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Vt)return Gr([a]);if(a instanceof br&&!Xr(e))return Gr([new Vt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",t.value));var o=a instanceof br?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",t.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},hn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},hn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?br.interpolationFactor(this.interpolationType,t,e,r):0};var pn=function(t,e){this._parameters=t,this._specification=e,jt(this,tn(this._parameters,this._specification))};function fn(t){var e=null;if(t instanceof kr)e=fn(t.result);else if(t instanceof wr)for(var r=0,n=t.args;r<n.length;r+=1){var i=n[r];if(e=fn(i))break}else(t instanceof Qe||t instanceof br)&&t.input instanceof Ae&&"zoom"===t.input.name&&(e=t);return e instanceof Vt||t.eachChild((function(t){var r=fn(t);r instanceof Vt?e=r:!e&&r?e=new Vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Vt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function mn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Kr(r);if("object"!==l)return[new Ft(e,r,"object expected, "+l+" found")];for(var c in r){var u=c.split(".")[0],h=n[u]||n["*"],d=void 0;if(i[u])d=i[u];else if(n[u])d=Vn;else if(i["*"])d=i["*"];else{if(!n["*"]){s.push(new Ft(e,r[c],'unknown property "'+c+'"'));continue}d=Vn}s=s.concat(d({key:(e?e+".":e)+c,value:r[c],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:c},r))}for(var p in n)i[p]||n[p].required&&void 0===n[p].default&&void 0===r[p]&&s.push(new Ft(e,r,'missing required property "'+p+'"'));return s}function gn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Vn;if("array"!==Kr(e))return[new Ft(a,e,"array expected, "+Kr(e)+" found")];if(r.length&&e.length!==r.length)return[new Ft(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Ft(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Kr(r.value)&&(s=r.value);for(var l=[],c=0;c<e.length;c++)l=l.concat(o({array:e,arrayIndex:c,value:e[c],valueSpec:s,style:n,styleSpec:i,key:a+"["+c+"]"}));return l}function yn(t){var e=t.key,r=t.value,n=t.valueSpec,i=Kr(r);return"number"===i&&r!==r&&(i="NaN"),"number"!==i?[new Ft(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Ft(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Ft(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(t){var e,r,n,i=t.valueSpec,a=Nt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Kr(t.value.stops)&&"array"===Kr(t.value.stops[0])&&"object"===Kr(t.value.stops[0][0]),u=mn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Ft(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(gn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&e.push(new Ft(t.key,r,"array must have at least one stop")),e},default:function(t){return Vn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Ft(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Ft(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Xr(t.valueSpec)&&u.push(new Ft(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Yr(t.valueSpec)?u.push(new Ft(t.key,t.value,"property functions not supported")):s&&!Zr(t.valueSpec)&&u.push(new Ft(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Ft(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Kr(a))return[new Ft(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new Ft(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new Ft(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new Ft(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Ft(s,a,"object stop key must have value")];if(n&&n>Nt(a[0].zoom))return[new Ft(s,a[0].zoom,"stop zoom values must appear in ascending order")];Nt(a[0].zoom)!==n&&(n=Nt(a[0].zoom),r=void 0,o={}),e=e.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:yn,value:d}}))}else e=e.concat(d({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return ln(Ut(a[1]))?e.concat([new Ft(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function d(t,n){var s=Kr(t.value),l=Nt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Ft(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ft(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Yr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ft(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new Ft(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new Ft(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Ft(t.key,c,"integer expected, found "+l)]}}function xn(t){var e=("property"===t.expressionContext?dn:cn)(Ut(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Ft(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new Ft(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ge(r))return[new Ft(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ge(r))return[new Ft(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ye(r,["zoom","feature-state"]))return[new Ft(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!We(r))return[new Ft(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function bn(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Nt(r))&&i.push(new Ft(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Nt(r))&&i.push(new Ft(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function _n(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!==typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!_n(n)&&"boolean"!==typeof n)return!1}return!0;default:return!0}}pn.deserialize=function(t){return new pn(t._parameters,t._specification)},pn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var wn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function kn(t){if(null===t||void 0===t)return{filter:function(){return!0},needGeometry:!1};_n(t)||(t=An(t));var e=cn(t,wn);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:Sn(t)}}function Tn(t,e){return t<e?-1:t>e?1:0}function Sn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(Sn(t[e]))return!0;return!1}function An(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Mn(t[1],t[2],"=="):"!="===r?Ln(Mn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Mn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(An))):"all"===r?["all"].concat(t.slice(1).map(An)):"none"===r?["all"].concat(t.slice(1).map(An).map(Ln)):"in"===r?Cn(t[1],t.slice(2)):"!in"===r?Ln(Cn(t[1],t.slice(2))):"has"===r?En(t[1]):"!has"===r?Ln(En(t[1])):"within"!==r||t}function Mn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Cn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!==typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Tn)]]:["filter-in-small",t,["literal",e]]}}function En(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ln(t){return["!",t]}function Pn(t){return _n(Ut(t.value))?xn(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):In(t)}function In(t){var e=t.value,r=t.key;if("array"!==Kr(e))return[new Ft(r,e,"array expected, "+Kr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Ft(r,e,"filter array must have at least 1 element")];switch(a=a.concat(bn({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Nt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Nt(e[1])&&a.push(new Ft(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Ft(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Kr(e[1]))&&a.push(new Ft(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o<e.length;o++)n=Kr(e[o]),"$type"===Nt(e[1])?a=a.concat(bn({key:r+"["+o+"]",value:e[o],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Ft(r+"["+o+"]",e[o],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var s=1;s<e.length;s++)a=a.concat(In({key:r+"["+s+"]",value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=Kr(e[1]),2!==e.length?a.push(new Ft(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Ft(r+"[1]",e[1],"string expected, "+n+" found"));break;case"within":n=Kr(e[1]),2!==e.length?a.push(new Ft(r,e,'filter array for "'+e[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Ft(r+"[1]",e[1],"object expected, "+n+" found"))}return a}function zn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Vn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var c,u=t.valueSpec||s[o];if(!u)return[new Ft(r,a,'unknown property "'+o+'"')];if("string"===Kr(a)&&Yr(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(a)))return[new Ft(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new Ft(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Jr(Ut(a))&&"identity"===Nt(a.type)&&h.push(new Ft(r,a,'"text-font" does not support identity functions'))),h.concat(Vn({key:t.key,value:a,valueSpec:u,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function On(t){return zn(t,"paint")}function Dn(t){return zn(t,"layout")}function Rn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new Ft(n,r,'either "type" or "ref" is required'));var o,s=Nt(r.type),l=Nt(r.ref);if(r.id)for(var c=Nt(r.id),u=0;u<t.arrayIndex;u++){var h=i.layers[u];Nt(h.id)===c&&e.push(new Ft(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Ft(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){Nt(t.id)===l&&(o=t)})),o?o.ref?e.push(new Ft(n,r.ref,"ref cannot reference another ref layer")):s=Nt(o.type):e.push(new Ft(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var d=i.sources&&i.sources[r.source],p=d&&Nt(d.type);d?"vector"===p&&"raster"===s?e.push(new Ft(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Ft(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==p||r["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Ft(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===p&&d.lineMetrics||e.push(new Ft(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Ft(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Ft(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Ft(n,r,'missing required property "source"'));return e=e.concat(mn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Vn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Pn,layout:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Dn(jt({layerType:s},t))}}})},paint:function(t){return mn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return On(jt({layerType:s},t))}}})}}}))}function Fn(t){var e=t.value,r=t.key,n=Kr(e);return"string"!==n?[new Ft(r,e,"string expected, "+n+" found")]:[]}var Bn={promoteId:function(t){var e=t.key,r=t.value;if("string"===Kr(r))return Fn({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,Fn({key:e+"."+i,value:r[i]}));return n}};function jn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Ft(r,e,'"type" is required')];var a,o=Nt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return a=mn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Bn});case"geojson":if(a=mn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Bn}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],c=l[0],u=l[1],h="string"===typeof c?[c,["accumulated"],["get",s]]:c;a.push.apply(a,xn({key:r+"."+s+".map",value:u,expressionContext:"cluster-map"})),a.push.apply(a,xn({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return mn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return mn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Ft(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return bn({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Nn(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=Kr(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new Ft("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);a=l&&n[l[1]]&&n[l[1]].transition?a.concat(Vn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(Vn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new Ft(s,e[s],'unknown property "'+s+'"')])}return a}var Un={"*":function(){return[]},array:gn,boolean:function(t){var e=t.value,r=t.key,n=Kr(e);return"boolean"!==n?[new Ft(r,e,"boolean expected, "+n+" found")]:[]},number:yn,color:function(t){var e=t.key,r=t.value,n=Kr(r);return"string"!==n?[new Ft(e,r,"color expected, "+n+" found")]:null===oe(r)?[new Ft(e,r,'color expected, "'+r+'" found')]:[]},constants:Bt,enum:bn,filter:Pn,function:vn,layer:Rn,object:mn,source:jn,light:Nn,string:Fn,formatted:function(t){return 0===Fn(t).length?[]:xn(t)},resolvedImage:function(t){return 0===Fn(t).length?[]:xn(t)}};function Vn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Jr(Nt(e))?vn(t):r.expression&&ln(Ut(e))?xn(t):r.type&&Un[r.type]?Un[r.type](t):mn(jt({},t,{valueSpec:r.type?n[r.type]:r}))}function qn(t){var e=t.value,r=t.key,n=Fn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Ft(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Ft(r,e,'"glyphs" url must include a "{range}" token'))),n}function $n(t,e){void 0===e&&(e=Rt);var r=[];return r=r.concat(Vn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:qn,"*":function(){return[]}}})),t.constants&&(r=r.concat(Bt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Hn(r)}function Hn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Wn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Hn(t.apply(this,e))}}$n.source=Wn(jn),$n.light=Wn(Nn),$n.layer=Wn(Rn),$n.filter=Wn(Pn),$n.paintProperty=Wn(On),$n.layoutProperty=Wn(Dn);var Gn=$n,Yn=Gn.light,Zn=Gn.paintProperty,Xn=Gn.layoutProperty;function Kn(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var a=i[n];t.fire(new Ot(new Error(a.message))),r=!0}return r}var Jn=ti,Qn=3;function ti(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[Qn+a],s=i[Qn+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[Qn+n.length],c=i[Qn+n.length+1];this.keys=i.subarray(l,c),this.bboxes=i.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}ti.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ti.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ti.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},ti.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},ti.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===o[d]){var p=4*d;(s?s(u[p+0],u[p+1],u[p+2],u[p+3]):t<=u[p+2]&&e<=u[p+3]&&r>=u[p+0]&&n>=u[p+1])?(o[d]=!0,a.push(c[d])):o[d]=!1}}},ti.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,f,a,o,s))return}},ti.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ti.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ti.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Qn+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[Qn+o]=a,i.set(s,a),a+=s.length}return i[Qn+t.length]=a,i.set(this.keys,a),a+=this.keys.length,i[Qn+t.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var ei=s.ImageData,ri=s.ImageBitmap,ni={};function ii(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ni[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var ai in ii("Object",Object),Jn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Jn.deserialize=function(t){return new Jn(t.buffer)},ii("Grid",Jn),ii("Color",se),ii("Error",Error),ii("ResolvedImage",he),ii("StylePropertyFunction",pn),ii("StyleExpression",sn,{omit:["_evaluator"]}),ii("ZoomDependentExpression",hn),ii("ZoomConstantExpression",un),ii("CompoundExpression",Ae,{omit:["_evaluate"]}),Ur)Ur[ai]._classRegistryKey||ii("Expression_"+ai,Ur[ai]);function oi(t){return t&&"undefined"!==typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function si(t){return ri&&t instanceof ri}function li(t,e){if(null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(oi(t)||si(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof ei)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1){var o=a[i];n.push(li(o,e))}return n}if("object"===typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(ni[l].omit.indexOf(u)>=0)){var h=t[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function ci(t){if(null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||oi(t)||si(t)||ArrayBuffer.isView(t)||t instanceof ei)return t;if(Array.isArray(t))return t.map(ci);if("object"===typeof t){var e=t.$name||"Object",r=ni[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=ni[e].shallow.indexOf(o)>=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ui=function(){this.first=!0};ui.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var hi={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function di(t){for(var e=0,r=t;e<r.length;e+=1)if(fi(r[e].charCodeAt(0)))return!0;return!1}function pi(t){return!hi.Arabic(t)&&!hi["Arabic Supplement"](t)&&!hi["Arabic Extended-A"](t)&&!hi["Arabic Presentation Forms-A"](t)&&!hi["Arabic Presentation Forms-B"](t)}function fi(t){return 746===t||747===t||!(t<4352)&&(!!hi["Bopomofo Extended"](t)||!!hi.Bopomofo(t)||!(!hi["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||!!hi["CJK Compatibility Ideographs"](t)||!!hi["CJK Compatibility"](t)||!!hi["CJK Radicals Supplement"](t)||!!hi["CJK Strokes"](t)||!(!hi["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||!!hi["CJK Unified Ideographs Extension A"](t)||!!hi["CJK Unified Ideographs"](t)||!!hi["Enclosed CJK Letters and Months"](t)||!!hi["Hangul Compatibility Jamo"](t)||!!hi["Hangul Jamo Extended-A"](t)||!!hi["Hangul Jamo Extended-B"](t)||!!hi["Hangul Jamo"](t)||!!hi["Hangul Syllables"](t)||!!hi.Hiragana(t)||!!hi["Ideographic Description Characters"](t)||!!hi.Kanbun(t)||!!hi["Kangxi Radicals"](t)||!!hi["Katakana Phonetic Extensions"](t)||!(!hi.Katakana(t)||12540===t)||!(!hi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!hi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||!!hi["Unified Canadian Aboriginal Syllabics"](t)||!!hi["Unified Canadian Aboriginal Syllabics Extended"](t)||!!hi["Vertical Forms"](t)||!!hi["Yijing Hexagram Symbols"](t)||!!hi["Yi Syllables"](t)||!!hi["Yi Radicals"](t))}function mi(t){return!(fi(t)||function(t){return!(!hi["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||!(!hi["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||!!hi["Letterlike Symbols"](t)||!!hi["Number Forms"](t)||!(!hi["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||!(!hi["Control Pictures"](t)||9251===t)||!!hi["Optical Character Recognition"](t)||!!hi["Enclosed Alphanumerics"](t)||!!hi["Geometric Shapes"](t)||!(!hi["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||!(!hi["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||!!hi["CJK Symbols and Punctuation"](t)||!!hi.Katakana(t)||!!hi["Private Use Area"](t)||!!hi["CJK Compatibility Forms"](t)||!!hi["Small Form Variants"](t)||!!hi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t}(t))}function gi(t){return hi.Arabic(t)||hi["Arabic Supplement"](t)||hi["Arabic Extended-A"](t)||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function yi(t){return t>=1424&&t<=2303||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function vi(t,e){return!(!e&&yi(t))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||hi.Khmer(t))}function xi(t){for(var e=0,r=t;e<r.length;e+=1)if(yi(r[e].charCodeAt(0)))return!0;return!1}var bi="deferred",_i="loading",wi="loaded",ki="error",Ti=null,Si="unavailable",Ai=null,Mi=function(t){t&&"string"===typeof t&&t.indexOf("NetworkError")>-1&&(Si=ki),Ti&&Ti(t)};function Ci(){Ei.fire(new zt("pluginStateChange",{pluginStatus:Si,pluginURL:Ai}))}var Ei=new Dt,Li=function(){return Si},Pi=function(){if(Si!==bi||!Ai)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Si=_i,Ci(),Ai&&Tt({url:Ai},(function(t){t?Mi(t):(Si=wi,Ci())}))},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Si===wi||null!=Ii.applyArabicShaping},isLoading:function(){return Si===_i},setState:function(t){Si=t.pluginStatus,Ai=t.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return Ai}},zi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ui,this.transition={})};zi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!vi(n[r].charCodeAt(0),e))return!1;return!0}(t,Ii.isLoaded())},zi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},zi.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Oi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Jr(t))return new pn(t,e);if(ln(t)){var r=dn(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"===typeof t&&"color"===e.type&&(n=se.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Oi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Oi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Di=function(t){this.property=t,this.value=new Oi(t,void 0)};Di.prototype.transitioned=function(t,e){return new Fi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},Di.prototype.untransitioned=function(){return new Fi(this.property,this.value,null,{},0)};var Ri=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Ri.prototype.getValue=function(t){return w(this._values[t].value.value)},Ri.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Di(this._values[t].property)),this._values[t].value=new Oi(this._values[t].property,null===e?void 0:w(e))},Ri.prototype.getTransition=function(t){return w(this._values[t].transition)},Ri.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Di(this._values[t].property)),this._values[t].transition=w(e)||void 0},Ri.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a)}return t},Ri.prototype.transitioned=function(t,e){for(var r=new Bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a])}return r},Ri.prototype.untransitioned=function(){for(var t=new Bi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var Fi=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Fi.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var Bi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Bi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n},Bi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var ji=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};ji.prototype.getValue=function(t){return w(this._values[t].value)},ji.prototype.setValue=function(t,e){this._values[t]=new Oi(this._values[t].property,null===e?void 0:w(e))},ji.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},ji.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n};var Ni=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Ni.prototype.isConstant=function(){return"constant"===this.value.kind},Ni.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Ni.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var Ui=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ui.prototype.get=function(t){return this._values[t]};var Vi=function(t){this.specification=t};Vi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Vi.prototype.interpolate=function(t,e,r){var n=er[this.specification.type];return n?n(t,e,r):t};var qi=function(t,e){this.specification=t,this.overrides=e};qi.prototype.possiblyEvaluate=function(t,e,r,n){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Ni(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)},e):new Ni(this,t.expression,e)},qi.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Ni(this,{kind:"constant",value:void 0},t.parameters);var n=er[this.specification.type];return n?new Ni(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},qi.prototype.evaluate=function(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new Ni(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!==typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Ni(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Ni(this,{kind:"constant",value:s},e)}return new Ni(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(qi),Hi=function(t){this.specification=t};Hi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new zi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new zi(Math.floor(e.zoom),e)),t.expression.evaluate(new zi(Math.floor(e.zoom+1),e)),e)}},Hi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Hi.prototype.interpolate=function(t){return t};var Wi=function(t){this.specification=t};Wi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var Gi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Oi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Di(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",$i),ii("CrossFadedProperty",Hi),ii("ColorRampProperty",Wi);var Yi="-transition",Zi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ji(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Ri(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ui(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!==e&&void 0!==e){var n="layers."+this.id+".layout."+t;if(this._validate(Xn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Yi)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!==e&&void 0!==e){var n="layers."+this.id+".paint."+t;if(this._validate(Zn,n,t,e,r))return!1}if(x(t,Yi))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)&&!("paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,t.call(Gn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Rt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Ni&&Yr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),Xi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Xi[i].BYTES_PER_ELEMENT),o=r=ta(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:ta(r,Math.max(n,e)),alignment:e}}function ta(t,e){return Math.ceil(t/e)*e}Ji.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ji.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(t){this.reserve(t),this.length=t},Ji.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ji);ea.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ea);var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var d=this.length;return this.resize(d+1),this.emplace(d,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,d){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,t},e}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(Ji);da.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",da);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Ji);pa.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",pa);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ji);fa.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",fa);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y){var v=24*t,x=12*t,b=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t},e}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M,C){var E=34*t,L=17*t;return this.int16[E+0]=e,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=i,this.int16[E+4]=a,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=c,this.uint16[E+9]=u,this.uint16[E+10]=h,this.uint16[E+11]=d,this.uint16[E+12]=p,this.uint16[E+13]=f,this.uint16[E+14]=m,this.uint16[E+15]=g,this.uint16[E+16]=y,this.uint16[E+17]=v,this.uint16[E+18]=x,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[L+12]=T,this.float32[L+13]=S,this.float32[L+14]=A,this.float32[L+15]=M,this.float32[L+16]=C,t},e}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",va);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",xa);var ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ji);ba.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",ba);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Ji);_a.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",_a);var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var ka=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ki);ka.prototype.size=20;var Ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ka(this,t)},e}(ua);ii("CollisionBoxArray",Ta);var Sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ki);Sa.prototype.size=48;var Aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sa(this,t)},e}(ma);ii("PlacedSymbolArray",Aa);var Ma=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ki);Ma.prototype.size=68;var Ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ma(this,t)},e}(ga);ii("SymbolInstanceArray",Ca);var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ya);ii("GlyphOffsetArray",Ea);var La=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(va);ii("SymbolLineVertexArray",La);var Pa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ki);Pa.prototype.size=8;var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Pa(this,t)},e}(xa);ii("FeatureIndexArray",Ia);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Oa=function(t){void 0===t&&(t=[]),this.segments=t};function Da(t,e){return 256*(t=h(Math.floor(t),0,255))+(e=h(Math.floor(e),0,255))}Oa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Oa.MAX_VERTEX_ARRAY_LENGTH&&T("Max vertices per segment is "+Oa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Oa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Oa.prototype.get=function(){return this.segments},Oa.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Oa.simpleSegment=function(t,e,r,n){return new Oa([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Oa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ii("SegmentVector",Oa);var Ra=Qi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Fa=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,l,c;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Ba=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ja=Fa,Na=Fa,Ua=Ba;ja.murmur3=Na,ja.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(t,e,r,n){this.ids.push($a(t)),this.positions.push(e,r,n)},Va.prototype.getPositions=function(t){for(var e=$a(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Va.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Ha(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(t){var e=new Va;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var qa=Math.pow(2,53)-1;function $a(t){var e=+t;return!isNaN(e)&&e<=qa?e:ja(String(t))}function Ha(t,e,r,n){for(;r<n;){for(var i=t[r+n>>1],a=r-1,o=n+1;;){do{a++}while(t[a]<i);do{o--}while(t[o]>i);if(a>=o)break;Wa(t,a,o),Wa(e,3*a,3*o),Wa(e,3*a+1,3*o+1),Wa(e,3*a+2,3*o+2)}o-r<n-o?(Ha(t,e,r,o),r=o+1):(Ha(t,e,o+1,n),n=o)}}function Wa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}ii("FeaturePositionMap",Va);var Ga=function(t,e){this.gl=t.gl,this.location=e},Ya=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ga),Za=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ga),Xa=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Ga),Ka=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Ga),Ja=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ga),Qa=function(t){function e(e,r){t.call(this,e,r),this.current=se.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ga),to=new Float32Array(16),eo=function(t){function e(e,r){t.call(this,e,r),this.current=to}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Ga);function ro(t){return[Da(255*t.r,255*t.g),Da(255*t.b,255*t.a)]}var no=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};no.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},no.prototype.getBinding=function(t,e,r){return"color"===this.type?new Qa(t,e):new Za(t,e)};var io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},io.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)},io.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Ja(t,e):new Za(t,e)};var ao=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};ao.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new zi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},ao.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},ao.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=ro(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},ao.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ao.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var oo=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};oo.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new zi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new zi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},oo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)},oo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=ro(r),a=ro(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},oo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},oo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},oo.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=h(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},oo.prototype.getBinding=function(t,e,r){return new Za(t,e)};var so=function(t,e,r,n,i,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};so.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)},so.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},so.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=r.min,a=r.mid,o=r.max,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(var u=t;u<e;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}},so.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Ra.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Ra.members,this.expression.isStateDependent))},so.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var lo=function(t,e,r){this.binders={},this._buffers=[];var n=[];for(var i in t.paint._values)if(r(i)){var a=t.paint.get(i);if(a instanceof Ni&&Yr(a.property.specification)){var o=uo(i,t.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new io(s.value,o):new no(s.value,o,l),n.push("/u_"+i);else if("source"===s.kind||h){var d=ho(i,l,"source");this.binders[i]=h?new so(s,l,c,e,d,t.id):new ao(s,o,l,d),n.push("/a_"+i)}else{var p=ho(i,l,"composite");this.binders[i]=new oo(s,o,l,c,e,p),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};lo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof ao||e instanceof oo?e.maxValue:0},lo.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof ao||o instanceof oo||o instanceof so)&&o.populatePaintArray(t,e,r,n,i)}},lo.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof io&&n.setConstantPatternPositions(t,e)}},lo.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,l=e.getPositions(o);s<l.length;s+=1){var c=l[s],u=r.feature(c.index);for(var h in this.binders){var d=this.binders[h];if((d instanceof ao||d instanceof oo||d instanceof so)&&!0===d.expression.isStateDependent){var p=n.paint.get(h);d.expression=p.value,d.updatePaintArray(c.start,c.end,u,t[o],i),a=!0}}}return a},lo.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof no||r instanceof io)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},lo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof ao||r instanceof oo)for(var n=0;n<r.paintVertexAttributes.length;n++)t.push(r.paintVertexAttributes[n].name);else if(r instanceof so)for(var i=0;i<Ra.members.length;i++)t.push(Ra.members[i].name)}return t},lo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof no||r instanceof io||r instanceof oo)for(var n=0,i=r.uniformNames;n<i.length;n+=1){var a=i[n];t.push(a)}}return t},lo.prototype.getPaintVertexBuffers=function(){return this._buffers},lo.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof no||i instanceof io||i instanceof oo)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var l=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:l})}}}return r},lo.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property,c=o.binding;this.binders[l].setUniform(c,n,r.get(l),s)}},lo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof so){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof ao||r instanceof oo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},lo.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof ao||r instanceof oo||r instanceof so)&&r.upload(t)}this.updatePaintBuffers()},lo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof ao||e instanceof oo||e instanceof so)&&e.destroy()}};var co=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=t;n<i.length;n+=1){var a=i[n];this.programConfigurations[a.id]=new lo(a,e,r)}this.needsUpload=!1,this._featureMap=new Va,this._bufferOffset=0};function uo(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function ho(t,e,r){var n={color:{source:aa,composite:wa},number:{source:ya,composite:aa}},i=function(t){return{"line-pattern":{source:oa,composite:oa},"fill-pattern":{source:oa,composite:oa},"fill-extrusion-pattern":{source:oa,composite:oa}}[t]}(t);return i&&i[r]||n[e][r]}co.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},co.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload}},co.prototype.get=function(t){return this.programConfigurations[t]},co.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},co.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},ii("ConstantBinder",no),ii("CrossFadedConstantBinder",io),ii("SourceExpressionBinder",ao),ii("CrossFadedCompositeBinder",so),ii("CompositeExpressionBinder",oo),ii("ProgramConfiguration",lo,{omit:["_buffers"]}),ii("ProgramConfigurationSet",co);var po=8192,fo=Math.pow(2,14)-1,mo=-fo-1;function go(t){for(var e=po/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a],s=Math.round(o.x*e),l=Math.round(o.y*e);o.x=h(s,mo,fo),o.y=h(l,mo,fo),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?go(t):[]}}function vo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var xo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ea,this.indexArray=new fa,this.segments=new Oa,this.programConfigurations=new co(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function bo(t,e){for(var r=0;r<t.length;r++)if(Eo(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(Eo(t,e[n]))return!0;return!!To(t,e)}function _o(t,e,r){return!!Eo(t,e)||!!Ao(e,t,r)}function wo(t,e){if(1===t.length)return Co(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Eo(t,n[i]))return!0;for(var a=0;a<t.length;a++)if(Co(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(To(t,e[o]))return!0;return!1}function ko(t,e,r){if(t.length>1){if(To(t,e))return!0;for(var n=0;n<e.length;n++)if(Ao(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Ao(t[i],e,r))return!0;return!1}function To(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(So(n,i,e[a],e[a+1]))return!0;return!1}function So(t,e,r,n){return S(t,r,n)!==S(e,r,n)&&S(t,e,r)!==S(t,e,n)}function Ao(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Mo(t,e[i-1],e[i])<n)return!0;return!1}function Mo(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Co(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>e.y!==i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Eo(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!==o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Lo(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var a=S(t,e,r[0]);return a!==S(t,e,r[1])||a!==S(t,e,r[2])||a!==S(t,e,r[3])}function Po(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<t.length;l++){var c=t[l];s.push(c.sub(o))}return s}xo.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.feature,u=l.id,h=l.index,d=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=yo(c,p);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),f,r)){var m=a?a.evaluate(f,{},r):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:d,index:h,geometry:p?f.geometry:go(c),patterns:{},sortKey:m};i.push(g)}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var x=v[y],b=x,_=b.geometry,w=b.index,k=b.sourceLayerIndex,T=t[w].feature;this.addFeature(x,_,w,r),e.featureIndex.insert(T,_,w,k,this.index)}},xo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,za),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xo.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var l=s[o],c=l.x,u=l.y;if(!(c<0||c>=po||u<0||u>=po)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),d=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},ii("CircleBucket",xo,{omit:["layers"]});var Oo=new Gi({"circle-sort-key":new qi(Rt.layout_circle["circle-sort-key"])}),Do={paint:new Gi({"circle-radius":new qi(Rt.paint_circle["circle-radius"]),"circle-color":new qi(Rt.paint_circle["circle-color"]),"circle-blur":new qi(Rt.paint_circle["circle-blur"]),"circle-opacity":new qi(Rt.paint_circle["circle-opacity"]),"circle-translate":new Vi(Rt.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(Rt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(Rt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(Rt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(Rt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(Rt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(Rt.paint_circle["circle-stroke-opacity"])}),layout:Oo},Ro="undefined"!==typeof Float32Array?Float32Array:Array;function Fo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*d+w*g,t[2]=x*a+b*c+_*p+w*y,t[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*m,t[5]=x*i+b*l+_*d+w*g,t[6]=x*a+b*c+_*p+w*y,t[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*m,t[9]=x*i+b*l+_*d+w*g,t[10]=x*a+b*c+_*p+w*y,t[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*m,t[13]=x*i+b*l+_*d+w*g,t[14]=x*a+b*c+_*p+w*y,t[15]=x*o+b*u+_*f+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var jo=Bo,No=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function Uo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}!function(){var t=new Ro(3);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0)}(),function(){var t=new Ro(4);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Vo=function(t){var e=t[0],r=t[1];return e*e+r*r},qo=(function(){var t=new Ro(2);Ro!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,Do)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new xo(t)},e.prototype.queryRadius=function(t){var e=t;return Po("circle-radius",this,e)+Po("circle-stroke-width",this,e)+Io(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=zo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return $o(t,e)}))}(l,s),d=u?c*o:c,p=0,f=n;p<f.length;p+=1)for(var m=0,g=f[p];m<g.length;m+=1){var y=g[m],v=u?y:$o(y,s),x=d,b=Uo([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/b[3]),_o(h,v,x))return!0}return!1},e}(Zi));function $o(t,e){var r=Uo([],[t.x,t.y,0,1],e);return new a(r[0]/r[3],r[1]/r[3])}var Ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xo);function Wo(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function Go(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=Wo({},{width:n,height:i},r);Yo(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}}function Yo(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<i.height;l++)for(var c=((r.y+l)*t.width+r.x)*a,u=((n.y+l)*e.width+n.x)*a,h=0;h<i.width*a;h++)s[u+h]=o[c+h];return e}ii("HeatmapBucket",Ho,{omit:["layers"]});var Zo=function(t,e){Wo(this,t,1,e)};Zo.prototype.resize=function(t){Go(this,t,1)},Zo.prototype.clone=function(){return new Zo({width:this.width,height:this.height},new Uint8Array(this.data))},Zo.copy=function(t,e,r,n,i){Yo(t,e,r,n,i,1)};var Xo=function(t,e){Wo(this,t,4,e)};Xo.prototype.resize=function(t){Go(this,t,4)},Xo.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Xo.prototype.clone=function(){return new Xo({width:this.width,height:this.height},new Uint8Array(this.data))},Xo.copy=function(t,e,r,n,i){Yo(t,e,r,n,i,4)},ii("AlphaImage",Zo),ii("RGBAImage",Xo);var Ko={paint:new Gi({"heatmap-radius":new qi(Rt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qi(Rt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(Rt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(Rt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(Rt.paint_heatmap["heatmap-opacity"])})};function Jo(t){var e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new Xo({width:r,height:n}),a=function(r,n,a){e[t.evaluationKey]=a;var o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(var o=0,s=0;o<n;++o,s+=4*r)for(var l=0,c=0;l<r;l++,c+=4){var u=l/(r-1),h=t.clips[o];a(s,c,h.start*(1-u)+h.end*u)}else for(var d=0,p=0;d<r;d++,p+=4)a(0,p,d/(r-1));return i}var Qo=function(t){function e(e){t.call(this,e,Ko),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ho(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Jo({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Zi),ts={paint:new Gi({"hillshade-illumination-direction":new Vi(Rt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Vi(Rt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Vi(Rt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Vi(Rt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Vi(Rt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Vi(Rt.paint_hillshade["hillshade-accent-color"])})},es=function(t){function e(e){t.call(this,e,ts)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Zi),rs=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,ns=as,is=as;function as(t,e,r){r=r||2;var n,i,a,o,s,l,c,u=e&&e.length,h=u?e[0]*r:t.length,d=os(t,0,h,r,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=os(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(ys(o));for(s.sort(ps),i=0;i<s.length;i++)fs(s[i],r),r=ss(r,r.next);return r}(t,e,d,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var f=r;f<h;f+=r)(s=t[f])<n&&(n=s),(l=t[f+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ls(d,p,r,n,i,c),p}function os(t,e,r,n,i){var a,o;if(i===Ls(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Ms(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Ms(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Cs(o),o=o.next),o}function ss(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==bs(n.prev,n,n.next))n=n.next;else{if(Cs(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ls(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=gs(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?us(t,n,i,a):cs(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Cs(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ls(t=hs(ss(t),e,r),e,r,n,i,a,2):2===o&&ds(t,e,r,n,i,a):ls(ss(t),e,r,n,i,a,1);break}}}function cs(t){var e=t.prev,r=t,n=t.next;if(bs(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(vs(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&bs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function us(t,e,r,n){var i=t.prev,a=t,o=t.next;if(bs(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=gs(s,l,e,r,n),d=gs(c,u,e,r,n),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&bs(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&bs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function hs(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!_s(i,a)&&ws(i,n,n.next,a)&&Ss(i,a)&&Ss(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Cs(n),Cs(n.next),n=t=a),n=n.next}while(n!==t);return ss(n)}function ds(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&xs(o,s)){var l=As(o,s);return o=ss(o,o.next),l=ss(l,l.next),ls(o,e,r,n,i,a),void ls(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function ps(t,e){return t.x-e.x}function fs(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r;var l,c=r,u=r.x,h=r.y,d=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&vs(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),Ss(n,t)&&(l<d||l===d&&(n.x>r.x||n.x===r.x&&ms(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(t,e),e){var r=As(e,t);ss(e,e.next),ss(r,r.next)}}function ms(t,e){return bs(t.prev,t,e.prev)<0&&bs(e.next,t,t.next)<0}function gs(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ys(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function vs(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function xs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&ws(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ss(t,e)&&Ss(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(bs(t.prev,t,e.prev)||bs(t,e.prev,e))||_s(t,e)&&bs(t.prev,t,t.next)>0&&bs(e.prev,e,e.next)>0)}function bs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function ws(t,e,r,n){var i=Ts(bs(t,e,r)),a=Ts(bs(t,e,n)),o=Ts(bs(r,n,t)),s=Ts(bs(r,n,e));return i!==a&&o!==s||!(0!==i||!ks(t,r,e))||!(0!==a||!ks(t,n,e))||!(0!==o||!ks(r,t,n))||!(0!==s||!ks(r,e,n))}function ks(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ts(t){return t>0?1:t<0?-1:0}function Ss(t,e){return bs(t.prev,t,t.next)<0?bs(t,e,t.next)>=0&&bs(t,t.prev,e)>=0:bs(t,e,t.prev)<0||bs(t,t.next,e)<0}function As(t,e){var r=new Es(t.i,t.x,t.y),n=new Es(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(t,e,r,n){var i=new Es(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Cs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Es(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ls(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Ps(t,e,r,n,i){Is(t,e,r||0,n||t.length-1,i||Os)}function Is(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Is(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,d=n;for(zs(t,r,e),i(t[n],u)>0&&zs(t,r,n);h<d;){for(zs(t,h,d),h++,d--;i(t[h],u)<0;)h++;for(;i(t[d],u)>0;)d--}0===i(t[r],u)?zs(t,r,d):zs(t,++d,n),d<=e&&(r=d+1),e<=d&&(n=d-1)}}function zs(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Os(t,e){return t<e?-1:t>e?1:0}function Ds(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o<r;o++){var s=A(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]))}if(n&&a.push(n),e>1)for(var l=0;l<a.length;l++)a[l].length<=e||(Ps(a[l],e,1,a[l].length-1,Rs),a[l]=a[l].slice(0,e));return a}function Rs(t,e){return e.area-t.area}function Fs(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function Bs(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.paint.get(t+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},r,{},i.availableImages),h=c.evaluate({zoom:n},r,{},i.availableImages),d=c.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,a[u]=!0,a[h]=!0,a[d]=!0,r.patterns[l.id]={min:u,mid:h,max:d}}}return r}as.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(Ls(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,u=s<l-1?e[s+1]*r:t.length;o-=Math.abs(Ls(t,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,p=n[s+1]*r,f=n[s+2]*r;h+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},as.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},ns.default=is;var js=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ea,this.indexArray=new fa,this.indexArray2=new ba,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Oa,this.segments2=new Oa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};js.prototype.populate=function(t,e,r){this.hasPattern=Fs("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=yo(l,d);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var f=n?n.evaluate(p,{},r,e.availableImages):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:go(l),patterns:{},sortKey:f};i.push(m)}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,b=x.geometry,_=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var k=Bs("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(k)}else this.addFeature(v,b,_,r,{});var T=t[_].feature;e.featureIndex.insert(T,b,_,w,this.index)}},js.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},js.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},js.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},js.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},js.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,rs),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},js.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},js.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ds(e,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),d=h.vertexLength,p=[],f=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&f.push(p.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),x=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(x+y.length-1,x),p.push(y[0].x),p.push(y[0].y);for(var b=1;b<y.length;b++)this.layoutVertexArray.emplaceBack(y[b].x,y[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),p.push(y[b].x),p.push(y[b].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var _=ns(p,f),w=0;w<_.length;w+=3)this.indexArray.emplaceBack(d+_[w],d+_[w+1],d+_[w+2]);h.vertexLength+=l,h.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},ii("FillBucket",js,{omit:["layers","patternFeatures"]});var Ns=new Gi({"fill-sort-key":new qi(Rt.layout_fill["fill-sort-key"])}),Us={paint:new Gi({"fill-antialias":new Vi(Rt.paint_fill["fill-antialias"]),"fill-opacity":new qi(Rt.paint_fill["fill-opacity"]),"fill-color":new qi(Rt.paint_fill["fill-color"]),"fill-outline-color":new qi(Rt.paint_fill["fill-outline-color"]),"fill-translate":new Vi(Rt.paint_fill["fill-translate"]),"fill-translate-anchor":new Vi(Rt.paint_fill["fill-translate-anchor"]),"fill-pattern":new $i(Rt.paint_fill["fill-pattern"])}),layout:Ns},Vs=function(t){function e(e){t.call(this,e,Us)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new js(t)},e.prototype.queryRadius=function(){return Io(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return wo(zo(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(Zi),qs=Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,$s=Hs;function Hs(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Ws,this,e)}function Ws(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Gs(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}Hs.types=["Unknown","Point","LineString","Polygon"],Hs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,s=0,l=[];t.pos<r;){if(i<=0){var c=t.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Hs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Hs.types[this.type];function u(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/a;t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=Gs(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var Ys=Zs;function Zs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Xs,this,e),this.length=this._features.length}function Xs(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Ks(t,e,r){if(3===t){var n=new Ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Zs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new $s(this._pbf,e,this.extent,this._keys,this._values)};var Js={VectorTile:function(t,e){this.layers=t.readFields(Ks,{},e)},VectorTileFeature:$s,VectorTileLayer:Ys},Qs=Js.VectorTileFeature.types,tl=Math.pow(2,13);function el(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*tl)+o,i*tl*2,a*tl*2,Math.round(s))}var rl=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new fa,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Oa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function nl(t,e){return t.x===e.x&&(t.x<0||t.x>po)||t.y===e.y&&(t.y<0||t.y>po)}function il(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>po}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>po}))}rl.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Fs("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,l=a.index,c=a.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=yo(o,u);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),h,r)){var d={id:s,sourceLayerIndex:c,index:l,geometry:u?h.geometry:go(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Bs("fill-extrusion",this.layers,d,this.zoom,e)):this.addFeature(d,d.geometry,l,r,{}),e.featureIndex.insert(o,d.geometry,l,c,this.index,!0)}}},rl.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n],o=a.geometry;this.addFeature(a,o,a.index,e,r)}},rl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},rl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},rl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},rl.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,qs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},rl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},rl.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Ds(e,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),d=0,p=s;d<p.length;d+=1){var f=p[d];if(0!==f.length&&!il(f))for(var m=0,g=0;g<f.length;g++){var y=f[g];if(g>=1){var v=f[g-1];if(!nl(y,v)){h.vertexLength+4>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),el(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),el(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=b,el(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),el(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var _=h.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Qs[t.type]){for(var w=[],k=[],T=h.vertexLength,S=0,A=s;S<A.length;S+=1){var M=A[S];if(0!==M.length){M!==s[0]&&k.push(w.length/2);for(var C=0;C<M.length;C++){var E=M[C];el(this.layoutVertexArray,E.x,E.y,0,0,1,1,0),w.push(E.x),w.push(E.y)}}}for(var L=ns(w,k),P=0;P<L.length;P+=3)this.indexArray.emplaceBack(T+L[P],T+L[P+2],T+L[P+1]);h.primitiveLength+=L.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},ii("FillExtrusionBucket",rl,{omit:["layers","features"]});var al={paint:new Gi({"fill-extrusion-opacity":new Vi(Rt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qi(Rt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(Rt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(Rt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new $i(Rt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qi(Rt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qi(Rt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(Rt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ol=function(t){function e(e){t.call(this,e,al)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new rl(t)},e.prototype.queryRadius=function(){return Io(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s,l){var c=zo(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),d=function(t,e,r,n){for(var i=[],o=0,s=t;o<s.length;o+=1){var l=s[o],c=[l.x,l.y,n,1];Uo(c,c,e),i.push(new a(c[0]/c[3],c[1]/c[3]))}return i}(c,l,0,0),p=function(t,e,r,n){for(var i=[],o=[],s=n[8]*e,l=n[9]*e,c=n[10]*e,u=n[11]*e,h=n[8]*r,d=n[9]*r,p=n[10]*r,f=n[11]*r,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],x=0,b=g[m];x<b.length;x+=1){var _=b[x],w=_.x,k=_.y,T=n[0]*w+n[4]*k+n[12],S=n[1]*w+n[5]*k+n[13],A=n[2]*w+n[6]*k+n[14],M=n[3]*w+n[7]*k+n[15],C=A+c,E=M+u,L=T+h,P=S+d,I=A+p,z=M+f,O=new a((T+s)/E,(S+l)/E);O.z=C/E,y.push(O);var D=new a(L/z,P/z);D.z=I/z,v.push(D)}i.push(y),o.push(v)}return[i,o]}(n,h,u,l);return function(t,e,r){var n=1/0;wo(r,e)&&(n=ll(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var l=a[s],c=a[s+1],u=o[s],h=[l,c,o[s+1],u,l];bo(r,h)&&(n=Math.min(n,ll(r,h)))}return n!==1/0&&n}(p[0],p[1],d)},e}(Zi);function sl(t,e){return t.x*e.x+t.y*e.y}function ll(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),l=a.sub(i),c=o.sub(i),u=sl(s,s),h=sl(s,l),d=sl(l,l),p=sl(c,s),f=sl(c,l),m=u*d-h*h,g=(d*p-h*f)/m,y=(u*f-h*p)/m,v=1-g-y,x=i.z*v+r.z*g+a.z*y;if(isFinite(x))return x}return 1/0}for(var b=1/0,_=0,w=e;_<w.length;_+=1){var k=w[_];b=Math.min(b,k.z)}return b}var cl=Qi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ul=Qi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,hl=Js.VectorTileFeature.types,dl=Math.cos(Math.PI/180*37.5),pl=Math.pow(2,14)/.5,fl=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new ia,this.layoutVertexArray2=new aa,this.indexArray=new fa,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Oa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};fl.prototype.populate=function(t,e,r){this.hasPattern=Fs("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=yo(l,d);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),p,r)){var f=n?n.evaluate(p,{},r):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:go(l),patterns:{},sortKey:f};i.push(m)}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,b=x.geometry,_=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var k=Bs("line",this.layers,v,this.zoom,e);this.patternFeatures.push(k)}else this.addFeature(v,b,_,r,{});var T=t[_].feature;e.featureIndex.insert(T,b,_,w,this.index)}},fl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},fl.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},fl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},fl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fl.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ul)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,cl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},fl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},fl.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},fl.prototype.addFeature=function(t,e,r,n,i){var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var u=0,h=e;u<h.length;u+=1){var d=h[u];this.addLine(d,t,o,s,l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},fl.prototype.addLine=function(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===hl[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var u,h=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p=void 0,f=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(u=t[l-2],g=t[c].sub(u)._unit()._perp());for(var y=c;y<l;y++)if(!(f=y===l-1?s?t[c+1]:void 0:t[y+1])||!t[y].equals(f)){g&&(m=g),u&&(p=u),u=t[y],g=f?f.sub(u)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var x=m.x*g.x+m.y*g.y,b=v.x*g.x+v.y*g.y,_=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),k=b<dl&&p&&f,T=m.x*g.y-m.y*g.x>0;if(k&&y>c){var S=u.dist(p);if(S>2*h){var A=u.sub(u.sub(p)._mult(h/S)._round());this.updateDistance(p,A),this.addCurrentVertex(A,m,0,0,d),p=A}}var M=p&&f,C=M?r:s?"butt":n;if(M&&"round"===C&&(_<a?C="miter":_<=2&&(C="fakeround")),"miter"===C&&_>i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_<i&&(C="miter")),p&&this.updateDistance(p,u),"miter"===C)v._mult(_),this.addCurrentVertex(u,v,0,0,d);else if("flipbevel"===C){if(_>100)v=g.mult(-1);else{var E=_*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(E*(T?-1:1))}this.addCurrentVertex(u,v,0,0,d),this.addCurrentVertex(u,v.mult(-1),0,0,d)}else if("bevel"===C||"fakeround"===C){var L=-Math.sqrt(_*_-1),P=T?L:0,I=T?0:L;if(p&&this.addCurrentVertex(u,m,P,I,d),"fakeround"===C)for(var z=Math.round(180*w/Math.PI/20),O=1;O<z;O++){var D=O/z;if(.5!==D){var R=D-.5;D+=D*R*(D-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*R*R+(.848013+x*(.215638*x-1.06021)))}var F=g.sub(m)._mult(D)._add(m)._unit()._mult(T?-1:1);this.addHalfVertex(u,F.x,F.y,!1,T,0,d)}f&&this.addCurrentVertex(u,g,-P,-I,d)}else if("butt"===C)this.addCurrentVertex(u,v,0,0,d);else if("square"===C){var B=p?1:-1;this.addCurrentVertex(u,v,B,B,d)}else"round"===C&&(p&&(this.addCurrentVertex(u,m,0,0,d),this.addCurrentVertex(u,m,1,1,d,!0)),f&&(this.addCurrentVertex(u,g,-1,-1,d,!0),this.addCurrentVertex(u,g,0,0,d)));if(k&&y<l-1){var j=u.dist(f);if(j>2*h){var N=u.add(f.sub(u)._mult(h/j)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,d),u=N}}}}},fl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>pl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},fl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*(this.lineClips?this.scaledDistance*(pl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},fl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},fl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ii("LineBucket",fl,{omit:["layers","patternFeatures"]});var ml=new Gi({"line-cap":new Vi(Rt.layout_line["line-cap"]),"line-join":new qi(Rt.layout_line["line-join"]),"line-miter-limit":new Vi(Rt.layout_line["line-miter-limit"]),"line-round-limit":new Vi(Rt.layout_line["line-round-limit"]),"line-sort-key":new qi(Rt.layout_line["line-sort-key"])}),gl={paint:new Gi({"line-opacity":new qi(Rt.paint_line["line-opacity"]),"line-color":new qi(Rt.paint_line["line-color"]),"line-translate":new Vi(Rt.paint_line["line-translate"]),"line-translate-anchor":new Vi(Rt.paint_line["line-translate-anchor"]),"line-width":new qi(Rt.paint_line["line-width"]),"line-gap-width":new qi(Rt.paint_line["line-gap-width"]),"line-offset":new qi(Rt.paint_line["line-offset"]),"line-blur":new qi(Rt.paint_line["line-blur"]),"line-dasharray":new Hi(Rt.paint_line["line-dasharray"]),"line-pattern":new $i(Rt.paint_line["line-pattern"]),"line-gradient":new Wi(Rt.paint_line["line-gradient"])}),layout:ml},yl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(qi),vl=new yl(gl.paint.properties["line-width"].specification);vl.useIntegerZoom=!0;var xl=function(t){function e(e){t.call(this,e,gl),this.gradientVersion=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){if("line-gradient"===t){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof Qe,this.gradientVersion=(this.gradientVersion+1)%l}},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=vl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new fl(t)},e.prototype.queryRadius=function(t){var e=t,r=bl(Po("line-width",this,e),Po("line-gap-width",this,e)),n=Po("line-offset",this,e);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=zo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*bl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i<t.length;i++){for(var o=t[i],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],h=o[l+1],d=0===l?n:u.sub(c)._unit()._perp(),p=l===o.length-1?n:h.sub(u)._unit()._perp(),f=d._add(p)._unit(),m=f.x*p.x+f.y*p.y;f._mult(1/m),s.push(f._mult(e)._add(u))}r.push(s)}return r}(n,u*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(Eo(t,i[a]))return!0;if(ko(t,i,r))return!0}return!1}(l,n,c)},e.prototype.isTileClipped=function(){return!0},e}(Zi);function bl(t,e){return e>0?e+2*t:t}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),wl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),kl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Sl=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Ii.applyArabicShaping&&(t=Ii.applyArabicShaping(t)),t}(t.text,e,r)})),t}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Cl=24,El=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=t[e+h];for(h+=d,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Ll=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m},Pl=Il;function Il(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Il.Varint=0,Il.Fixed64=1,Il.Bytes=2,Il.Fixed32=5;var zl=4294967296,Ol=1/zl,Dl="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function Rl(t){return t.type===Il.Bytes?t.readVarint()+t.pos:t.pos+1}function Fl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Bl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function jl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Nl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ul(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Vl(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function ql(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function $l(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Hl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Wl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Gl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Yl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Zl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Xl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Kl(t,e,r){1===t&&r.readMessage(Jl,e)}function Jl(t,e,r){if(3===t){var n=r.readMessage(Ql,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new Zo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ql(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function tc(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w)}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,c=0,u=t;c<u.length;c+=1)for(var h=u[c],d=o.length-1;d>=0;d--){var p=o[d];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var f=o.pop();d<o.length&&(o[d]=f)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(o.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Il.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Yl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Yl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*zl;return this.pos+=8,t},readSFixed64:function(){var t=Yl(this.buf,this.pos)+Xl(this.buf,this.pos+4)*zl;return this.pos+=8,t},readFloat:function(){var t=El(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=El(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return Fl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return Fl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return Fl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return Fl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return Fl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return Fl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Dl?function(t,e,r){return Dl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128===(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128===(192&a)&&128===(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Il.Bytes)return t.push(this.readVarint(e));var r=Rl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Il.Bytes)return t.push(this.readSVarint());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Il.Bytes)return t.push(this.readBoolean());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Il.Bytes)return t.push(this.readFloat());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Il.Bytes)return t.push(this.readDouble());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Il.Bytes)return t.push(this.readFixed32());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Il.Bytes)return t.push(this.readSFixed32());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Il.Bytes)return t.push(this.readFixed64());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Il.Bytes)return t.push(this.readSFixed64());var e=Rl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Il.Varint)for(;this.buf[this.pos++]>127;);else if(e===Il.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Il.Fixed32)this.pos+=4;else{if(e!==Il.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Zl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Zl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Zl(this.buf,-1&t,this.pos),Zl(this.buf,Math.floor(t*Ol),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Zl(this.buf,-1&t,this.pos),Zl(this.buf,Math.floor(t*Ol),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Bl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ll(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ll(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Bl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Il.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,$l,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Wl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writeBytesField:function(t,e){this.writeTag(t,Il.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Il.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Il.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ec=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},rc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};rc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},rc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},rc.tlbr.get=function(){return this.tl.concat(this.br)},rc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(ec.prototype,rc);var nc=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=tc(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in t){var u=t[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var d in e){var p=e[d],f=n[d].paddedRect,m=f.x+1,g=f.y+1,y=p.data.width,v=p.data.height;Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),Xo.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.copy(p.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};nc.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new ec(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},nc.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},nc.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},ii("ImagePosition",ec),ii("ImageAtlas",nc);var ic={horizontal:1,vertical:2,horizontalOnly:3},ac=-17,oc=function(){this.scale=1,this.fontStack="",this.imageName=null};oc.forText=function(t,e){var r=new oc;return r.scale=t||1,r.fontStack=e,r},oc.forImage=function(t){var e=new oc;return e.imageName=t,e};var sc=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function lc(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m){var g,y=sc.fromFeature(t,i);h===ic.vertical&&y.verticalizePunctuation();var v=Ii.processBidirectionalText,x=Ii.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var b=0,_=v(y.toString(),gc(y,c,a,e,n,p,f));b<_.length;b+=1){var w=_[b],k=new sc;k.text=w,k.sections=y.sections;for(var T=0;T<w.length;T++)k.sectionIndex.push(0);g.push(k)}}else if(x){g=[];for(var S=0,A=x(y.text,y.sectionIndex,gc(y,c,a,e,n,p,f));S<A.length;S+=1){var M=A[S],C=new sc;C.text=M[0],C.sectionIndex=M[1],C.sections=y.sections,g.push(C)}}else g=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(y,gc(y,c,a,e,n,p,f));var E=[],L={positionedLines:E,text:y.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,l,c,u,h){for(var d=0,p=ac,f=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,x=i;v<x.length;v+=1){var b=x[v];b.trim();var _=b.getMaxScale(),w=(_-1)*Cl,k={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=k;var T=k.positionedGlyphs,S=0;if(b.length()){for(var A=0;A<b.length();A++){var M=b.getSection(A),C=b.getSectionIndex(A),E=b.getCharCode(A),L=0,P=null,I=null,z=null,O=Cl,D=!(l===ic.horizontal||!u&&!fi(E)||u&&(cc[E]||gi(E)));if(M.imageName){var R=n[M.imageName];if(!R)continue;z=M.imageName,t.iconsInText=t.iconsInText||!0,I=R.paddedRect;var F=R.displaySize;M.scale=M.scale*Cl/h,P={width:F[0],height:F[1],left:1,top:-3,advance:D?F[1]:F[0]},L=w+(Cl-F[1]*M.scale),O=P.advance;var B=D?F[0]*M.scale-Cl*_:F[1]*M.scale-Cl*_;B>0&&B>S&&(S=B)}else{var j=r[M.fontStack],N=j&&j[E];if(N&&N.rect)I=N.rect,P=N.metrics;else{var U=e[M.fontStack],V=U&&U[E];if(!V)continue;P=V.metrics}L=(_-M.scale)*Cl}D?(t.verticalizable=!0,T.push({glyph:E,imageName:z,x:d,y:p+L,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:C,metrics:P,rect:I}),d+=O*M.scale+c):(T.push({glyph:E,imageName:z,x:d,y:p+L,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:C,metrics:P,rect:I}),d+=P.advance*M.scale+c)}if(0!==T.length){var q=d-c;f=Math.max(q,f),vc(T,0,T.length-1,g,S)}d=0;var $=a*_+S;k.lineOffset=Math.max(S,w),p+=$,m=Math.max($,m),++y}else p+=a,++y}var H=p-ac,W=yc(o),G=W.horizontalAlign,Y=W.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n-ac:(-n*l+.5)*o;for(var h=0,d=t;h<d.length;h+=1)for(var p=0,f=d[h].positionedGlyphs;p<f.length;p+=1){var m=f[p];m.x+=c,m.y+=u}})(t.positionedLines,g,G,Y,f,m,a,H,i.length),t.top+=-Y*H,t.bottom=t.top+H,t.left+=-G*f,t.right=t.left+f}(L,e,r,n,g,o,s,l,h,c,d,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(E)&&L}sc.fromFeature=function(t,e){for(var r=new sc,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},sc.prototype.length=function(){return this.text.length},sc.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},sc.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},sc.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},sc.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;n&&mi(n)&&!Ml[t[r+1]]||i&&mi(i)&&!Ml[t[r-1]]||!Ml[t[r]]?e+=t[r]:e+=Ml[t[r]]}return e}(this.text)},sc.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&cc[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&cc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},sc.prototype.substring=function(t,e){var r=new sc;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},sc.prototype.toString=function(){return this.text},sc.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},sc.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(oc.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},sc.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(oc.forImage(e)),this.sectionIndex.push(this.sections.length-1)):T("Reached maximum number of images 6401")}else T("Can't add FormattedSection with an empty image.")},sc.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var cc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},uc={};function hc(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Cl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function dc(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function pc(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function fc(t,e,r,n,i,a){for(var o=null,s=dc(e,r,i,a),l=0,c=n;l<c.length;l+=1){var u=c[l],h=dc(e-u.x,r,i,a)+u.badness;h<=s&&(o=u,s=h)}return{index:t,x:e,priorBreak:o,badness:s}}function mc(t){return t?mc(t.priorBreak).concat(t.index):[]}function gc(t,e,r,n,i,a,o){if("point"!==a)return[];if(!t)return[];for(var s,l=[],c=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var l=t.getSection(s);o+=hc(t.getCharCode(s),l,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),u=t.text.indexOf("\u200b")>=0,h=0,d=0;d<t.length();d++){var p=t.getSection(d),f=t.getCharCode(d);if(cc[f]||(h+=hc(f,p,n,i,e,o)),d<t.length()-1){var m=!((s=f)<11904)&&(!!hi["Bopomofo Extended"](s)||!!hi.Bopomofo(s)||!!hi["CJK Compatibility Forms"](s)||!!hi["CJK Compatibility Ideographs"](s)||!!hi["CJK Compatibility"](s)||!!hi["CJK Radicals Supplement"](s)||!!hi["CJK Strokes"](s)||!!hi["CJK Symbols and Punctuation"](s)||!!hi["CJK Unified Ideographs Extension A"](s)||!!hi["CJK Unified Ideographs"](s)||!!hi["Enclosed CJK Letters and Months"](s)||!!hi["Halfwidth and Fullwidth Forms"](s)||!!hi.Hiragana(s)||!!hi["Ideographic Description Characters"](s)||!!hi["Kangxi Radicals"](s)||!!hi["Katakana Phonetic Extensions"](s)||!!hi.Katakana(s)||!!hi["Vertical Forms"](s)||!!hi["Yi Radicals"](s)||!!hi["Yi Syllables"](s));(uc[f]||m||p.imageName)&&l.push(fc(d+1,h,c,l,pc(f,t.getCharCode(d+1),m&&u),!1))}}return mc(fc(t.length(),h,c,l,0,!0))}function yc(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function vc(t,e,r,n,i){if(n||i)for(var a=t[r],o=a.metrics.advance*a.scale,s=(t[r].x+o)*n,l=e;l<=r;l++)t[l].x-=s,t[l].y+=i}function xc(t,e,r,n,i,a){var o,s=t.image;if(s.content){var l=s.content,c=s.pixelRatio||1;o=[l[0]/c,l[1]/c,s.displaySize[0]-l[2]/c,s.displaySize[1]-l[3]/c]}var u,h,d,p,f=e.left*a,m=e.right*a;"width"===r||"both"===r?(p=i[0]+f-n[3],h=i[0]+m+n[1]):h=(p=i[0]+(f+m-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*a,y=e.bottom*a;return"height"===r||"both"===r?(u=i[1]+g-n[0],d=i[1]+y+n[2]):d=(u=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:u,right:h,bottom:d,left:p,collisionPadding:o}}uc[10]=!0,uc[32]=!0,uc[38]=!0,uc[40]=!0,uc[41]=!0,uc[43]=!0,uc[45]=!0,uc[47]=!0,uc[173]=!0,uc[183]=!0,uc[8203]=!0,uc[8208]=!0,uc[8211]=!0,uc[8231]=!0;var bc=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(a);ii("Anchor",bc);var _c=128;function wc(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new zi(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new zi(s)),maxSize:r.evaluate(new zi(l)),interpolationType:i}}function kc(t,e,r){var n=e.uSize,i=e.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===t.kind?a/_c:"composite"===t.kind?tr(a/_c,o/_c,i):n}function Tc(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=t.minZoom,o=t.maxZoom,s=i?h(br.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=tr(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var Sc=Object.freeze({__proto__:null,getSizeData:wc,evaluateSizeForFeature:kc,evaluateSizeForZoom:Tc,SIZE_PACK_FACTOR:_c});function Ac(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;s<r/2;){var u=t[o-1],h=t[o],d=t[o+1];if(!d)return!1;var p=u.angleTo(h)-h.angleTo(d);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),c+=p;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(d)}return!0}function Mc(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Cc(t,e,r){return t?.6*e*r:0}function Ec(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Lc(t,e,r,n,i,a){for(var o=Cc(r,i,a),s=Ec(r,n)*a,l=0,c=Mc(t)/2,u=0;u<t.length-1;u++){var h=t[u],d=t[u+1],p=h.dist(d);if(l+p>c){var f=(c-l)/p,m=tr(h.x,d.x,f),g=tr(h.y,d.y,f),y=new bc(m,g,d.angleTo(h),u);return y._round(),!o||Ac(t,y,s,o,e)?y:void 0}l+=p}}function Pc(t,e,r,n,i,a,o,s,l){var c=Cc(n,a,o),u=Ec(n,i),h=u*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),Ic(t,d?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,h,d,!1,l)}function Ic(t,e,r,n,i,a,o,s,l){for(var c=a/2,u=Mc(t),h=0,d=e-r,p=[],f=0;f<t.length-1;f++){for(var m=t[f],g=t[f+1],y=m.dist(g),v=g.angleTo(m);d+r<h+y;){var x=((d+=r)-h)/y,b=tr(m.x,g.x,x),_=tr(m.y,g.y,x);if(b>=0&&b<l&&_>=0&&_<l&&d-c>=0&&d+c<=u){var w=new bc(b,_,v,f);w._round(),n&&!Ac(t,w,a,n,i)||p.push(w)}}h+=y}return s||p.length||o||(p=Ic(t,h/2,r,n,i,a,o,!0,l)),p}function zc(t,e,r,n,i){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],c=void 0,u=0;u<l.length-1;u++){var h=l[u],d=l[u+1];h.x<e&&d.x<e||(h.x<e?h=new a(e,h.y+(d.y-h.y)*((e-h.x)/(d.x-h.x)))._round():d.x<e&&(d=new a(e,h.y+(d.y-h.y)*((e-h.x)/(d.x-h.x)))._round()),h.y<r&&d.y<r||(h.y<r?h=new a(h.x+(d.x-h.x)*((r-h.y)/(d.y-h.y)),r)._round():d.y<r&&(d=new a(h.x+(d.x-h.x)*((r-h.y)/(d.y-h.y)),r)._round()),h.x>=n&&d.x>=n||(h.x>=n?h=new a(n,h.y+(d.y-h.y)*((n-h.x)/(d.x-h.x)))._round():d.x>=n&&(d=new a(n,h.y+(d.y-h.y)*((n-h.x)/(d.x-h.x)))._round()),h.y>=i&&d.y>=i||(h.y>=i?h=new a(h.x+(d.x-h.x)*((i-h.y)/(d.y-h.y)),i)._round():d.y>=i&&(d=new a(h.x+(d.x-h.x)*((i-h.y)/(d.y-h.y)),i)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(d)))))}return o}function Oc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,d=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],f=function(t,e){return t+e[1]-e[0]},m=d.reduce(f,0),g=p.reduce(f,0),y=l-m,v=c-g,x=0,b=m,_=0,w=g,k=0,T=y,S=0,A=v;if(o.content&&n){var M=o.content;x=Dc(d,0,M[0]),_=Dc(p,0,M[1]),b=Dc(d,M[0],M[2]),w=Dc(p,M[1],M[3]),k=M[0]-x,S=M[1]-_,T=M[2]-M[0]-b,A=M[3]-M[1]-w}var C=function(n,i,l,c){var d=Fc(n.stretch-x,b,u,t.left),p=Bc(n.fixed-k,T,n.stretch,m),f=Fc(i.stretch-_,w,h,t.top),y=Bc(i.fixed-S,A,i.stretch,g),v=Fc(l.stretch-x,b,u,t.left),M=Bc(l.fixed-k,T,l.stretch,m),C=Fc(c.stretch-_,w,h,t.top),E=Bc(c.fixed-S,A,c.stretch,g),L=new a(d,f),P=new a(v,f),I=new a(v,C),z=new a(d,C),O=new a(p/s,y/s),D=new a(M/s,E/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),j=[B,-F,F,B];L._matMult(j),P._matMult(j),z._matMult(j),I._matMult(j)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:L,tr:P,bl:z,br:I,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:D,minFontScaleX:T/s/u,minFontScaleY:A/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=Rc(d,y,m),L=Rc(p,v,g),P=0;P<E.length-1;P++)for(var I=E[P],z=E[P+1],O=0;O<L.length-1;O++){var D=L[O],R=L[O+1];i.push(C(I,D,z,R))}else i.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function Dc(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]))}return n}function Rc(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(l-s)})}return n.push({fixed:e+1,stretch:r}),n}function Fc(t,e,r,n){return t/e*r+n}function Bc(t,e,r,n){return t-e*r/n}var jc=function(t,e,r,n,i,o,s,l,c,u){if(this.boxStartIndex=t.length,c){var h=o.top,d=o.bottom,p=o.collisionPadding;p&&(h-=p[1],d+=p[3]);var f=d-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var b=new a(y,m),_=new a(v,m),w=new a(y,g),k=new a(v,g),T=u*Math.PI/180;b._rotate(T),_._rotate(T),w._rotate(T),k._rotate(T),y=Math.min(b.x,_.x,w.x,k.x),v=Math.max(b.x,_.x,w.x,k.x),m=Math.min(b.y,_.y,w.y,k.y),g=Math.max(b.y,_.y,w.y,k.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,i)}this.boxEndIndex=t.length},Nc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Uc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Uc(t,e){return t<e?-1:t>e?1:0}function Vc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<i)&&(i=u.y),(!c||u.x>o)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,d=s-i,p=Math.min(h,d),f=p/2,m=new Nc([],qc);if(0===p)return new a(n,i);for(var g=n;g<o;g+=p)for(var y=i;y<s;y+=p)m.push(new $c(g+f,y+f,f,t));for(var v=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],c=i[s],u=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*u,n+=(l.y+c.y)*u,e+=3*u}return new $c(r/e,n/e,0,t)}(t),x=m.length;m.length;){var b=m.pop();(b.d>v.d||!v.d)&&(v=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-v.d<=e||(f=b.h/2,m.push(new $c(b.p.x-f,b.p.y-f,f,t)),m.push(new $c(b.p.x+f,b.p.y-f,f,t)),m.push(new $c(b.p.x-f,b.p.y+f,f,t)),m.push(new $c(b.p.x+f,b.p.y+f,f,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function qc(t,e){return e.max-t.max}function $c(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,l=s-1;o<s;l=o++){var c=a[o],u=a[l];c.y>t.y!==u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Mo(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Nc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Nc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Nc.prototype.peek=function(){return this.data[0]},Nc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Nc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a}e[t]=i};var Hc=Number.POSITIVE_INFINITY;function Wc(t,e){return e[1]!==Hc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Gc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Yc=255,Zc=Yc*_c;function Xc(t,e,r,n,i,o,s,l,c,u,h,d,p,f,m){var g=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,d=e.positionedLines;h<d.length;h+=1)for(var p=d[h],f=0,m=p.positionedGlyphs;f<m.length;f+=1){var g=m[f];if(g.rect){var y=g.rect||{},v=4,x=!0,b=1,_=0,w=(i||l)&&g.vertical,k=g.metrics.advance*g.scale/2;if(l&&e.verticalizable){var T=(g.scale-1)*Cl,S=(Cl-g.metrics.width*g.scale)/2;_=p.lineOffset/2-(g.imageName?-S:T)}if(g.imageName){var A=s[g.imageName];x=A.sdf,v=1/(b=A.pixelRatio)}var M=i?[g.x+k,g.y]:[0,0],C=i?[0,0]:[g.x+k+r[0],g.y+r[1]-_],E=[0,0];w&&(E=C,C=[0,0]);var L=(g.metrics.left-v)*g.scale-k+C[0],P=(-g.metrics.top-v)*g.scale+C[1],I=L+y.w*g.scale/b,z=P+y.h*g.scale/b,O=new a(L,P),D=new a(I,P),R=new a(L,z),F=new a(I,z);if(w){var B=new a(-k,k-ac),j=-Math.PI/2,N=12-k,U=g.imageName?N:0,V=new a(22-N,-U),q=new(Function.prototype.bind.apply(a,[null].concat(E)));O._rotateAround(j,B)._add(V)._add(q),D._rotateAround(j,B)._add(V)._add(q),R._rotateAround(j,B)._add(V)._add(q),F._rotateAround(j,B)._add(V)._add(q)}if(c){var $=Math.sin(c),H=Math.cos(c),W=[H,-$,$,H];O._matMult(W),D._matMult(W),R._matMult(W),F._matMult(W)}var G=new a(0,0),Y=new a(0,0);u.push({tl:O,tr:D,bl:R,br:F,tex:y,writingMode:e.writingMode,glyphOffset:M,sectionIndex:g.sectionIndex,isSDF:x,pixelOffsetTL:G,pixelOffsetBR:Y,minFontScaleX:0,minFontScaleY:0})}}return u}(0,r,l,i,o,s,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[_c*i.layout.get("text-size").evaluate(s,{})])[0]>Zc&&T(t.layerIds[0]+': Value for "text-size" is >= '+Yc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[_c*f.compositeTextSizes[0].evaluate(s,{},m),_c*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>Zc||v[1]>Zc)&&T(t.layerIds[0]+': Value for "text-size" is >= '+Yc+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,b=h;x<b.length;x+=1)d[b[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function Kc(t){for(var e in t)return t[e];return null}function Jc(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[e]=[];return i[e].push(n),!1}var Qc=Js.VectorTileFeature.types,tu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function eu(t,e,r,n,i,a,o,s,l,c,u,h,d){var p=s?Math.min(Zc,Math.round(s[0])):0,f=s?Math.min(Zc,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function ru(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function nu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(xi(r[e].text))return!0;return!1}var iu=function(t){this.layoutVertexArray=new sa,this.indexArray=new fa,this.programConfigurations=t,this.segments=new Oa,this.dynamicLayoutVertexArray=new la,this.opacityVertexArray=new ca,this.placedSymbolArray=new Aa};iu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},iu.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_l.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,wl.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,tu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},iu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},ii("SymbolBuffers",iu);var au=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Oa,this.collisionVertexArray=new pa};au.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,kl.members,!0)},au.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},ii("CollisionBuffers",au);var ou=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Fo([]),this.placementViewportMatrix=Fo([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=wc(this.zoom,e["text-size"]),this.iconSizeData=wc(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ic[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};ou.prototype.createArrays=function(){this.text=new iu(new co(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new iu(new co(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Ea,this.lineVertexArray=new La,this.symbolInstances=new Ca},ou.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=Ml[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},ou.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof ue&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,d=e.glyphDependencies,p=e.availableImages,f=new zi(this.zoom),m=0,g=t;m<g.length;m+=1){var y=g[m],v=y.feature,x=y.id,b=y.index,_=y.sourceLayerIndex,w=n._featureFilter.needGeometry,k=yo(v,w);if(n._featureFilter.filter(f,k,r)){w||(k.geometry=go(v));var T=void 0;if(l){var S=n.getValueAndResolveTokens("text-field",k,r,p),A=ue.factory(S);nu(A)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Li()||this.hasRTLText&&Ii.isParsed())&&(T=Al(A,n,k))}var M=void 0;if(c){var C=n.getValueAndResolveTokens("icon-image",k,r,p);M=C instanceof he?C:he.fromString(C)}if(T||M){var E=this.sortFeaturesByKey?u.evaluate(k,{},r):void 0,L={id:x,text:T,icon:M,index:b,sourceLayerIndex:_,geometry:k.geometry,properties:v.properties,type:Qc[v.type],sortKey:E};if(this.features.push(L),M&&(h[M.name]=!0),T){var P=a.evaluate(k,{},r).join(","),I="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ic.vertical)>=0;for(var z=0,O=T.sections;z<O.length;z+=1){var D=O[z];if(D.image)h[D.image.name]=!0;else{var R=di(T.toString()),F=D.fontStack||P,B=d[F]=d[F]||{};this.calculateGlyphDependencies(D.text,B,I,this.allowVerticalPlacement,R)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(d){var p=l(d,h),f=l(d,h,!0);if(p in r&&f in e&&r[p]!==e[f]){var m=s(p,f,h),g=o(p,f,n[m].geometry);delete e[p],delete r[f],r[l(d,n[g].geometry,!0)]=g,n[m].geometry=null}else p in r?o(p,f,h):f in e?s(p,f,h):(a(c),e[p]=i-1,r[f]=i-1)}else a(c)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},ou.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},ou.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},ou.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},ou.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},ou.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},ou.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},ou.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var c=a[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},ou.prototype.addSymbols=function(t,e,r,n,i,a,o,s,l,c,u,h){for(var d=t.indexArray,p=t.layoutVertexArray,f=t.segments.prepareSegment(4*e.length,p,d,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=f.vertexLength,y=this.allowVerticalPlacement&&o===ic.vertical?Math.PI/2:0,v=a.text&&a.text.sections,x=0;x<e.length;x++){var b=e[x],_=b.tl,w=b.tr,k=b.bl,T=b.br,S=b.tex,A=b.pixelOffsetTL,M=b.pixelOffsetBR,C=b.minFontScaleX,E=b.minFontScaleY,L=b.glyphOffset,P=b.isSDF,I=b.sectionIndex,z=f.vertexLength,O=L[1];eu(p,s.x,s.y,_.x,O+_.y,S.x,S.y,r,P,A.x,A.y,C,E),eu(p,s.x,s.y,w.x,O+w.y,S.x+S.w,S.y,r,P,M.x,A.y,C,E),eu(p,s.x,s.y,k.x,O+k.y,S.x,S.y+S.h,r,P,A.x,M.y,C,E),eu(p,s.x,s.y,T.x,O+T.y,S.x+S.w,S.y+S.h,r,P,M.x,M.y,C,E),ru(t.dynamicLayoutVertexArray,s,y),d.emplaceBack(z,z+1,z+2),d.emplaceBack(z+1,z+2,z+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(L[0]),x!==e.length-1&&I===e[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(p.length,a,a.index,{},h,v&&v[I])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)},ou.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},ou.prototype.addCollisionDebugVertices=function(t,e,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,d=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,o,d,p,new a(t,e)),this._addCollisionDebugVertex(u,h,o,d,p,new a(r,e)),this._addCollisionDebugVertex(u,h,o,d,p,new a(r,n)),this._addCollisionDebugVertex(u,h,o,d,p,new a(t,n)),l.vertexLength+=4;var f=i.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4},ou.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,l=a.x2,c=a.y2;this.addCollisionDebugVertices(o,s,l,c,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},ou.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new au(ha,Tl.members,ba),this.iconCollisionBox=new au(ha,Tl.members,ba);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},ou.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,l){for(var c={},u=e;u<r;u++){var h=t.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var d=n;d<i;d++){var p=t.get(d);c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}for(var f=a;f<o;f++){var m=t.get(f);c.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=t.get(g);c.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},c.verticalIconFeatureIndex=y.featureIndex;break}return c},ou.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},ou.prototype.hasTextData=function(){return this.text.segments.get().length>0},ou.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ou.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ou.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ou.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ou.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},ou.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),a},ou.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},ou.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ii("SymbolBucket",ou,{omit:["layers","collisionBoxArray","features","compareText"]}),ou.MAX_GLYPHS=65535,ou.addDynamicAttributes=ru;var su=new Gi({"symbol-placement":new Vi(Rt.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(Rt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(Rt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(Rt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(Rt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(Rt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(Rt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(Rt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(Rt.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(Rt.layout_symbol["icon-size"]),"icon-text-fit":new Vi(Rt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(Rt.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(Rt.layout_symbol["icon-image"]),"icon-rotate":new qi(Rt.layout_symbol["icon-rotate"]),"icon-padding":new Vi(Rt.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(Rt.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(Rt.layout_symbol["icon-offset"]),"icon-anchor":new qi(Rt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(Rt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(Rt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(Rt.layout_symbol["text-rotation-alignment"]),"text-field":new qi(Rt.layout_symbol["text-field"]),"text-font":new qi(Rt.layout_symbol["text-font"]),"text-size":new qi(Rt.layout_symbol["text-size"]),"text-max-width":new qi(Rt.layout_symbol["text-max-width"]),"text-line-height":new Vi(Rt.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(Rt.layout_symbol["text-letter-spacing"]),"text-justify":new qi(Rt.layout_symbol["text-justify"]),"text-radial-offset":new qi(Rt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(Rt.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(Rt.layout_symbol["text-anchor"]),"text-max-angle":new Vi(Rt.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(Rt.layout_symbol["text-writing-mode"]),"text-rotate":new qi(Rt.layout_symbol["text-rotate"]),"text-padding":new Vi(Rt.layout_symbol["text-padding"]),"text-keep-upright":new Vi(Rt.layout_symbol["text-keep-upright"]),"text-transform":new qi(Rt.layout_symbol["text-transform"]),"text-offset":new qi(Rt.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(Rt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(Rt.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(Rt.layout_symbol["text-optional"])}),lu={paint:new Gi({"icon-opacity":new qi(Rt.paint_symbol["icon-opacity"]),"icon-color":new qi(Rt.paint_symbol["icon-color"]),"icon-halo-color":new qi(Rt.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(Rt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(Rt.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(Rt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(Rt.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(Rt.paint_symbol["text-opacity"]),"text-color":new qi(Rt.paint_symbol["text-color"],{runtimeType:Yt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new qi(Rt.paint_symbol["text-halo-color"]),"text-halo-width":new qi(Rt.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(Rt.paint_symbol["text-halo-blur"]),"text-translate":new Vi(Rt.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(Rt.paint_symbol["text-translate-anchor"])}),layout:su},cu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:$t,this.defaultValue=t};cu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},cu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},cu.prototype.outputDefined=function(){return!1},cu.prototype.serialize=function(){return null},ii("FormatSectionOverride",cu,{omit:["defaultValue"]});var uu=function(t){function e(e){t.call(this,e,lu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i,a=this.layout.get(t).evaluate(e,{},r,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||ln(o.value)||!a?a:(i=e.properties,a.replace(/{([^{}]+)}/g,(function(t,e){return e in i?String(i[e]):""})))},e.prototype.createBucket=function(t){return new ou(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=lu.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),a=new cu(i),o=new sn(a,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new un("source",o):new hn("composite",o,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new Ni(i.property,s,i.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=lu.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1){var a=r[e];if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof ue)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){if(!i)if(t instanceof ge&&fe(t.value)===Jt){var e=t.value;a(e.sections)}else t instanceof be?a(t.sections):t.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},e}(Zi),hu={paint:new Gi({"background-color":new Vi(Rt.paint_background["background-color"]),"background-pattern":new Hi(Rt.paint_background["background-pattern"]),"background-opacity":new Vi(Rt.paint_background["background-opacity"])})},du=function(t){function e(e){t.call(this,e,hu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Zi),pu={paint:new Gi({"raster-opacity":new Vi(Rt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(Rt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(Rt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(Rt.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(Rt.paint_raster["raster-saturation"]),"raster-contrast":new Vi(Rt.paint_raster["raster-contrast"]),"raster-resampling":new Vi(Rt.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(Rt.paint_raster["raster-fade-duration"])})},fu=function(t){function e(e){t.call(this,e,pu)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Zi),mu=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Zi),gu={circle:qo,heatmap:Qo,hillshade:es,fill:Vs,"fill-extrusion":ol,line:xl,symbol:uu,background:du,raster:fu},yu=s.HTMLImageElement,vu=s.HTMLCanvasElement,xu=s.HTMLVideoElement,bu=s.ImageData,_u=s.ImageBitmap,wu=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};wu.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=(!this.size||this.size[0]!==n||this.size[1]!==i)&&!r,o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof yu||t instanceof vu||t instanceof xu||t instanceof bu||_u&&t instanceof _u?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},c=l.x,u=l.y;t instanceof yu||t instanceof vu||t instanceof xu||t instanceof bu||_u&&t instanceof _u?s.texSubImage2D(s.TEXTURE_2D,0,c,u,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,c,u,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},wu.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},wu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},wu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ku=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!==typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};ku.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},ku.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Tu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new ku(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=M()?t:s};function Su(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Tu.prototype.send=function(t,e,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=L(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:li(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else M()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Tu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Tu.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(ci(e.error)):n(null,ci(e.data)))}else{var i=!1,a=L(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?li(e):null,data:li(n,a)},a)}:function(t){i=!0},s=null,l=ci(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Au.prototype.setNorthEast=function(t){return this._ne=t instanceof Cu?new Cu(t.lng,t.lat):Cu.convert(t),this},Au.prototype.setSouthWest=function(t){return this._sw=t instanceof Cu?new Cu(t.lng,t.lat):Cu.convert(t),this},Au.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Cu)e=t,r=t;else{if(!(t instanceof Au)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Au.convert(a))}var o=t;return this.extend(Cu.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Cu(e.lng,e.lat),this._ne=new Cu(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Cu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Cu(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Cu(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(t){var e=Cu.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(t){return!t||t instanceof Au?t:new Au(t)};var Mu=6371008.8,Cu=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Cu.prototype.wrap=function(){return new Cu(d(this.lng,-180,180),this.lat)},Cu.prototype.toArray=function(){return[this.lng,this.lat]},Cu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Cu.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Mu*Math.acos(Math.min(i,1))},Cu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Au(new Cu(this.lng-r,this.lat-e),new Cu(this.lng+r,this.lat+e))},Cu.convert=function(t){if(t instanceof Cu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Cu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"===typeof t&&null!==t)return new Cu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Eu=2*Math.PI*Mu;function Lu(t){return Eu*Math.cos(t*Math.PI/180)}function Pu(t){return(180+t)/360}function Iu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function zu(t,e){return t/Lu(e)}function Ou(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Du=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Du.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Cu.convert(t);return new Du(Pu(r.lng),Iu(r.lat),zu(e,r.lat))},Du.prototype.toLngLat=function(){return new Cu(360*this.x-180,Ou(this.y))},Du.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Lu(Ou(e));var t,e},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*(t=Ou(this.y),1/Math.cos(t*Math.PI/180));var t};var Ru=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ju(0,t,t,e,r)};Ru.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ru.prototype.url=function(t,e){var r=function(t,e,r){var n=Su(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Su(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Ru.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new a((t.x*e-this.x)*po,(t.y*e-this.y)*po)},Ru.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Fu=function(t,e){this.wrap=t,this.canonical=e,this.key=ju(t,e.z,e.z,e.x,e.y)},Bu=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Ru(r,+n,+i),this.key=ju(e,t,r,n,i)};function ju(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var a=1<<r;return(a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}Bu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Bu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Bu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Bu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?ju(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ju(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Bu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Bu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Bu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Bu(e,this.wrap,e,r,n),new Bu(e,this.wrap,e,r+1,n),new Bu(e,this.wrap,e,r,n+1),new Bu(e,this.wrap,e,r+1,n+1)]},Bu.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Bu.prototype.wrapped=function(){return new Bu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Bu.prototype.unwrapTo=function(t){return new Bu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Bu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Bu.prototype.toUnwrapped=function(){return new Fu(this.wrap,this.canonical)},Bu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Bu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Du(t.x-this.wrap,t.y))},ii("CanonicalTileID",Ru),ii("OverscaledTileID",Bu,{omit:["posMatrix"]});var Nu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return T('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Nu.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Nu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Nu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Nu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Nu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Nu.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Nu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c<o;c++)for(var u=n;u<i;u++)this.data[this._idx(u,c)]=t.data[this._idx(u+s,c+l)]},ii("DEMData",Nu);var Uu=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Uu.prototype.encode=function(t){return this._stringToNumber[t]},Uu.prototype.decode=function(t){return this._numberToString[t]};var Vu=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},qu={geometry:{configurable:!0}};qu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},qu.geometry.set=function(t){this._geometry=t},Vu.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Vu.prototype,qu);var $u=function(){this.state={},this.stateChanges={},this.deletedStates={}};$u.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o]},$u.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},$u.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{},a=p({},n[r],i[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var s in o)delete a[s]}return a},$u.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},$u.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var u=0,h=Object.keys(this.deletedStates[o][c]);u<h.length;u+=1){var d=h[u];delete this.state[o][c][d]}s[c]=this.state[o][c]}r[o]=r[o]||{},p(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e)};var Hu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Jn(po,16,0),this.grid3D=new Jn(po,16,0),this.featureIndexArray=new Ia,this.promoteId=e};function Wu(t,e,r,n,i){return b(t,(function(t,a){var o=e instanceof Ui?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Gu(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Yu(t,e){return e-t}Hu.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<e.length;l++){for(var c=e[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var d=c[h];u[0]=Math.min(u[0],d.x),u[1]=Math.min(u[1],d.y),u[2]=Math.max(u[2],d.x),u[3]=Math.max(u[3],d.y)}u[0]<po&&u[1]<po&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new Pl(this.rawTileData)).layers,this.sourceLayerCoder=new Uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=po/t.tileSize/t.scale,l=kn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=Gu(c),d=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=Gu(t.cameraQueryGeometry),f=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,h=c;u<h.length;u+=1)if(Eo(t,h[u]))return!0;for(var d=0;d<t.length-1;d++)if(Lo(t[d],t[d+1],c))return!0;return!1}(t.cameraQueryGeometry,e-u,r-u,n+u,i+u)})),m=0,g=f;m<g.length;m+=1){var y=g[m];d.push(y)}d.sort(Yu);for(var v,x={},b=function(a){var u=d[a];if(u!==v){v=u;var h=i.featureIndexArray.get(u),p=null;i.loadMatchingFeature(x,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,o.layers,o.availableImages,e,r,n,(function(e,r,n){return p||(p=go(e)),r.queryIntersectsFeature(c,e,n,p,i.z,t.transform,s,t.pixelPosMatrix)}))}},_=0;_<d.length;_++)b(_);return x},Hu.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,l,c,u){var h=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,h)){var d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(n);if(i.needGeometry){var m=yo(f,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(this.tileID.overscaledZ),f))return;for(var g=this.getId(f,d),y=0;y<h.length;y++){var v=h[y];if(!(a&&a.indexOf(v)<0)){var x=s[v];if(x){var b={};void 0!==g&&c&&(b=c.getState(x.sourceLayer||"_geojsonTileLayer",g));var _=p({},l[v]);_.paint=Wu(_.paint,x.paint,f,b,o),_.layout=Wu(_.layout,x.layout,f,b,o);var w=!u||u(f,x,b);if(w){var k=new Vu(f,this.z,this.x,this.y,g);k.layer=_;var T=t[v];void 0===T&&(T=t[v]=[]),T.push({featureIndex:n,feature:k,intersectionZ:w})}}}}}},Hu.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var c=kn(i),u=0,h=t;u<h.length;u+=1){var d=h[u];this.loadMatchingFeature(l,r,n,d,c,a,o,s,e)}return l},Hu.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},Hu.prototype.getId=function(t,e){var r=t.id;if(this.promoteId){var n="string"===typeof this.promoteId?this.promoteId:this.promoteId[e];"boolean"===typeof(r=t.properties[n])&&(r=Number(r))}return r},ii("FeatureIndex",Hu,{omit:["rawTileData","sourceLayerCoder"]});var Zu=function(t,e){this.tileID=t,this.uid=m(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Zu.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<j.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Zu.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Zu.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=t}}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof ou){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof ou&&o.hasRTLText){this.hasRTLText=!0,Ii.isLoading()||Ii.isLoaded()||"deferred"!==Li()||Pi();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ta},Zu.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Zu.prototype.getBucket=function(t){return this.buckets[t.id]},Zu.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new wu(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new wu(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Zu.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Zu.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}},Zu.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=kn(e&&e.filter),s=this.tileID.canonical,l=s.z,c=s.x,u=s.y,h={z:l,x:c,y:u},d=0;d<a.length;d++){var p=a.feature(d);if(o.needGeometry){var f=yo(p,!0);if(!o.filter(new zi(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!o.filter(new zi(this.tileID.overscaledZ),p))continue;var m=r.getId(p,i),g=new Vu(p,l,c,u,m);g.tile=h,t.push(g)}}},Zu.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Zu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Zu.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=C(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Zu.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Zu.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},Zu.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Zu.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<j.now()},Zu.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Zu.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=j.now()+t},Zu.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r},Zu.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=this.dependencies[i];if(a)for(var o=0,s=e;o<s.length;o+=1)if(a[s[o]])return!0}return!1};var Xu=s.performance,Ku=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Xu.mark(this._marks.start)};Ku.prototype.finish=function(){Xu.mark(this._marks.end);var t=Xu.getEntriesByName(this._marks.measure);return 0===t.length&&(Xu.measure(this._marks.measure,this._marks.start,this._marks.end),t=Xu.getEntriesByName(this._marks.measure),Xu.clearMarks(this._marks.start),Xu.clearMarks(this._marks.end),Xu.clearMeasures(this._marks.measure)),t},t.Actor=Tu,t.AlphaImage=Zo,t.CanonicalTileID=Ru,t.CollisionBoxArray=Ta,t.Color=se,t.DEMData=Nu,t.DataConstantProperty=Vi,t.DictionaryCoder=Uu,t.EXTENT=po,t.ErrorEvent=Ot,t.EvaluationParameters=zi,t.Event=zt,t.Evented=Dt,t.FeatureIndex=Hu,t.FillBucket=js,t.FillExtrusionBucket=rl,t.ImageAtlas=nc,t.ImagePosition=ec,t.LineBucket=fl,t.LngLat=Cu,t.LngLatBounds=Au,t.MercatorCoordinate=Du,t.ONE_EM=Cl,t.OverscaledTileID=Bu,t.Point=a,t.Point$1=a,t.Properties=Gi,t.Protobuf=Pl,t.RGBAImage=Xo,t.RequestManager=W,t.RequestPerformance=Ku,t.ResourceType=xt,t.SegmentVector=Oa,t.SourceFeatureState=$u,t.StructArrayLayout1ui2=_a,t.StructArrayLayout2f1f2i16=da,t.StructArrayLayout2i4=ea,t.StructArrayLayout3ui6=fa,t.StructArrayLayout4i8=ra,t.SymbolBucket=ou,t.Texture=wu,t.Tile=Zu,t.Transitionable=Ri,t.Uniform1f=Za,t.Uniform1i=Ya,t.Uniform2f=Xa,t.Uniform3f=Ka,t.Uniform4f=Ja,t.UniformColor=Qa,t.UniformMatrix4f=eo,t.UnwrappedTileID=Fu,t.ValidationError=Ft,t.WritingMode=ic,t.ZoomHistory=ui,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=ru,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0===--n&&r(a,i)}))}))},t.bezier=c,t.bindAll=v,t.browser=j,t.cacheEntryPossiblyAdded=function(t){++yt>ht&&(t.getActor().send("enforceCacheSizeLimit",ut),yt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ct);t&&e.catch(t).then((function(){return t()}))},t.clipLine=zc,t.clone=function(t){var e=new Ro(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=w,t.clone$2=function(t){var e=new Ro(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Sl,t.config=N,t.create=function(){var t=new Ro(16);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Ro(9);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Ro(4);return Ro!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=cn,t.createLayout=Qi,t.createStyleLayer=function(t){return"custom"===t.type?new mu(t):new gu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"===typeof e&&null!==e&&null!==r){if("object"!==typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=u,t.emitValidationErrors=Kn,t.endsWith=x,t.enforceCacheSizeLimit=function(t){dt(),rt&&rt.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))},t.evaluateSizeForFeature=kc,t.evaluateSizeForZoom=Tc,t.evaluateVariableOffset=Wc,t.evented=Ei,t.extend=p,t.featureFilter=kn,t.filterObject=_,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=yc,t.getAnchorJustification=Gc,t.getArrayBuffer=Tt,t.getImage=Lt,t.getJSON=function(t,e){return kt(p(t,{type:"json"}),e)},t.getRTLTextPluginStatus=Li,t.getReferrer=_t,t.getVideo=function(t,e){var r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var n=0;n<t.length;n++){var i=s.document.createElement("source");At(t[n])||(r.crossOrigin="Anonymous"),i.src=t[n],r.appendChild(i)}return{cancel:function(){}}},t.identity=Fo,t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-d*f,A=u*y-p*f,M=h*g-d*m,C=h*y-p*m,E=d*y-p*g,L=v*E-x*C+b*M+_*A-w*S+k*T;return L?(L=1/L,t[0]=(s*E-l*C+c*M)*L,t[1]=(i*C-n*E-a*M)*L,t[2]=(m*k-g*w+y*_)*L,t[3]=(d*w-h*k-p*_)*L,t[4]=(l*A-o*E-c*S)*L,t[5]=(r*E-i*A+a*S)*L,t[6]=(g*b-f*k-y*x)*L,t[7]=(u*k-d*b+p*x)*L,t[8]=(o*C-s*A+c*T)*L,t[9]=(n*A-r*C-a*T)*L,t[10]=(f*w-m*b+y*v)*L,t[11]=(h*b-u*w-p*v)*L,t[12]=(s*S-o*M-l*T)*L,t[13]=(r*M-n*S+i*T)*L,t[14]=(m*x-f*_-g*v)*L,t[15]=(u*_-h*x+d*v)*L,t):null},t.isChar=hi,t.isMapboxURL=G,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=kt,t.mapObject=b,t.mercatorXfromLng=Pu,t.mercatorYfromLat=Iu,t.mercatorZfromAltitude=zu,t.mul=jo,t.multiply=Bo,t.mvt=Js,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=tr,t.offscreenCanvasSupported=vt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Pl(t).readFields(Kl,[])},t.pbf=Pl,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=po/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,d=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(d),o),c["text-size"].possiblyEvaluate(new zi(p),o)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,m=f.minZoom,g=f.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*Cl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=k[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),d=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},f=a.text,m=[0,0];if(f){var g=f.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*Cl,S=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!pi(r[e].charCodeAt(0)))return!1;return!0}(g)?_:0,A=l.get("text-anchor").evaluate(a,{},o),M=l.get("text-variable-anchor");if(!M){var C=l.get("text-radial-offset").evaluate(a,{},o);m=C?Wc(A,[C*Cl,Hc]):l.get("text-offset").evaluate(a,{},o).map((function(t){return t*Cl}))}var E=v?"center":l.get("text-justify").evaluate(a,{},o),L=l.get("symbol-placement"),P="point"===L?l.get("text-max-width").evaluate(a,{},o)*Cl:0,I=function(){t.allowVerticalPlacement&&di(g)&&(p.vertical=lc(f,e,r,i,s,P,y,A,"left",S,m,ic.vertical,!0,L,h,c))};if(!v&&M){for(var z="auto"===E?M.map((function(t){return Gc(t)})):[E],O=!1,D=0;D<z.length;D++){var R=z[D];if(!p.horizontal[R])if(O)p.horizontal[R]=p.horizontal[0];else{var F=lc(f,e,r,i,s,P,y,"center",R,S,m,ic.horizontal,!1,L,h,c);F&&(p.horizontal[R]=F,O=1===F.positionedLines.length)}}I()}else{"auto"===E&&(E=Gc(A));var B=lc(f,e,r,i,s,P,y,A,E,S,m,ic.horizontal,!1,L,h,c);B&&(p.horizontal[E]=B),I(),di(g)&&v&&x&&(p.vertical=lc(f,e,r,i,s,P,y,A,E,S,m,ic.vertical,!1,L,h,c))}}var j=void 0,N=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(j=function(t,e,r){var n=yc(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],l=o-t.displaySize[0]*i,c=l+t.displaySize[0],u=s-t.displaySize[1]*a;return{image:t,top:u,bottom:u+t.displaySize[1],left:l,right:c}}(i[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&T("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=Kc(p.horizontal)||p.vertical;t.iconsInText=!!V&&V.iconsInText,(V||j)&&function(t,e,r,n,i,a,o,s,l,c,u){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=o);var d,p=t.layers[0].layout,f=p.get("icon-offset").evaluate(e,{},u),m=Kc(r.horizontal),g=24,y=o/g,v=t.tilePixelRatio*y,x=t.tilePixelRatio*h/g,b=t.tilePixelRatio*s,_=t.tilePixelRatio*p.get("symbol-spacing"),w=p.get("text-padding")*t.tilePixelRatio,k=p.get("icon-padding")*t.tilePixelRatio,S=p.get("text-max-angle")/180*Math.PI,A="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),M="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),C=p.get("symbol-placement"),E=_/2,L=p.get("icon-text-fit");n&&"none"!==L&&(t.allowVerticalPlacement&&r.vertical&&(d=xc(n,r.vertical,L,p.get("icon-text-fit-padding"),f,y)),m&&(n=xc(n,m,L,p.get("icon-text-fit-padding"),f,y)));var P=function(s,h){h.x<0||h.x>=po||h.y<0||h.y>=po||function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,S){var A,M,C,E,L,P=t.addToLineVertexArray(e,r),I=0,z=0,O=0,D=0,R=-1,F=-1,B={},j=ja(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(A=s.layout.get("text-offset").evaluate(b,{},k).map((function(t){return t*Cl})))[0],U=A[1]):(N=s.layout.get("text-radial-offset").evaluate(b,{},k)*Cl,U=Hc),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,q=n.vertical;E=new jc(l,e,c,u,h,q,d,p,f,V),o&&(L=new jc(l,e,c,u,h,o,g,y,f,V))}if(i){var $=s.layout.get("icon-rotate").evaluate(b,{}),H="none"!==s.layout.get("icon-text-fit"),W=Oc(i,$,w,H),G=o?Oc(o,$,w,H):void 0;C=new jc(l,e,c,u,h,i,g,y,!1,$),I=4*W.length;var Y=t.iconSizeData,Z=null;"source"===Y.kind?(Z=[_c*s.layout.get("icon-size").evaluate(b,{})])[0]>Zc&&T(t.layerIds[0]+': Value for "icon-size" is >= '+Yc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((Z=[_c*_.compositeIconSizes[0].evaluate(b,{},k),_c*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>Zc||Z[1]>Zc)&&T(t.layerIds[0]+': Value for "icon-size" is >= '+Yc+'. Reduce your "icon-size".'),t.addSymbols(t.icon,W,Z,x,v,b,!1,e,P.lineStartIndex,P.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,G&&(z=4*G.length,t.addSymbols(t.icon,G,Z,x,v,b,ic.vertical,e,P.lineStartIndex,P.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var K=n.horizontal[X];if(!M){j=ja(K.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);M=new jc(l,e,c,u,h,K,d,p,f,J)}var Q=1===K.positionedLines.length;if(O+=Xc(t,e,K,a,s,f,b,m,P,n.vertical?ic.horizontal:ic.horizontalOnly,Q?Object.keys(n.horizontal):[X],B,R,_,k),Q)break}n.vertical&&(D+=Xc(t,e,n.vertical,a,s,f,b,m,P,ic.vertical,["vertical"],B,F,_,k));var tt=M?M.boxStartIndex:t.collisionBoxArray.length,et=M?M.boxEndIndex:t.collisionBoxArray.length,rt=E?E.boxStartIndex:t.collisionBoxArray.length,nt=E?E.boxEndIndex:t.collisionBoxArray.length,it=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,ot=L?L.boxStartIndex:t.collisionBoxArray.length,st=L?L.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(M,lt),lt=ct(E,lt),lt=ct(C,lt);var ut=(lt=ct(L,lt))>-1?1:0;ut&&(lt*=S/Cl),t.glyphOffsetArray.length>=ou.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,tt,et,rt,nt,it,at,ot,st,c,O,D,I,z,ut,0,d,N,U,lt)}(t,h,s,r,n,i,d,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,A,l,b,k,M,f,e,a,c,u,o)};if("line"===C)for(var I=0,z=zc(e.geometry,0,0,po,po);I<z.length;I+=1)for(var O=z[I],D=0,R=Pc(O,_,S,r.vertical||m,n,g,x,t.overscaling,po);D<R.length;D+=1){var F=R[D];m&&Jc(t,m.text,E,F)||P(O,F)}else if("line-center"===C)for(var B=0,j=e.geometry;B<j.length;B+=1){var N=j[B];if(N.length>1){var U=Lc(N,S,r.vertical||m,n,g,x);U&&P(N,U)}}else if("Polygon"===e.type)for(var V=0,q=Ds(e.geometry,0);V<q.length;V+=1){var $=q[V],H=Vc($,16);P($[0],new bc(H.x,H.y,0))}else if("LineString"===e.type)for(var W=0,G=e.geometry;W<G.length;W+=1){var Y=G[W];P(Y,new bc(Y[0].x,Y[0].y,0))}else if("Point"===e.type)for(var Z=0,X=e.geometry;Z<X.length;Z+=1)for(var K=0,J=X[Z];K<J.length;K+=1){var Q=J[K];P([Q],new bc(Q.x,Q.y,0))}}(t,a,p,j,n,u,h,d,m,N,o)},w=0,k=t.features;w<k.length;w+=1)_();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=Ii,t.polygonIntersectsPolygon=bo,t.postMapLoadEvent=lt,t.postTurnstileEvent=ot,t.potpack=tc,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=ii,t.registerForPluginStateChange=function(t){return t({pluginStatus:Si,pluginURL:Ai}),Ei.on("pluginStateChange",t),t},t.renderColorRamp=Jo,t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+d*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=d*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+d*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=d*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){ut=t,ht=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),Si===bi||Si===_i||Si===wi)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ai=j.resolveURL(t),Si=bi,Ti=e,Ci(),r||Pi()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=Vo,t.styleSpec=Rt,t.sub=No,t.symbolSize=Sc,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=Uo,t.translate=function(t,e,r){var n,i,a,o,s,l,c,u,h,d,p,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+d*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+f*y+e[15]),t},t.triggerPluginCompletionEvent=Mi,t.uniqueId=m,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Yn,t.validateStyle=Gn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=Js,t.version=r,t.warnOnce=T,t.webpSupported=U,t.window=s,t.wrap=d})),n(0,(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||void 0===t||null===t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,a=t;i<a.length;i+=1)n+=e(a[i])+",";return n+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=t.refProperties;i<a.length;i+=1)n+="/"+e(r[a[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var c=0,u=n;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var d=function(t,e){for(var n={},i=0;i<t.length;i++){var a=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(t[i])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache),p=0,f=d;p<f.length;p+=1){var m=f[p].map((function(t){return i._layers[t.id]})),g=m[0];if("none"!==g.visibility){var y=g.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var x=g.sourceLayer||"_geojsonTileLayer",b=v[x];b||(b=v[x]=[]),b.push(m)}}};var i=function(e){var r={},n=[];for(var i in e){var a=e[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),o[s]={rect:c,metrics:l.metrics}}}}var u=t.potpack(n),h=u.w,d=u.h,p=new t.AlphaImage({width:h||1,height:d||1});for(var f in e){var m=e[f];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[f][g].rect;t.AlphaImage.copy(y.bitmap,p,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=p,this.positions=r};t.register("GlyphAtlas",i);var a=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function o(e,r,n){for(var i=new t.EvaluationParameters(r),a=0,o=e;a<o.length;a+=1)o[a].recalculate(i,n)}function s(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,i,a){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:a})}));return function(){n.cancel(),r()}}a.prototype.parse=function(e,r,n,a,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h,d,p,f,m={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},y=r.familiesBySource[this.source];for(var v in y){var x=e.layers[v];if(x){1===x.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=c.encode(v),_=[],w=0;w<x.length;w++){var k=x.feature(w),T=u.getId(k,v);_.push({feature:k,id:T,index:w,sourceLayerIndex:b})}for(var S=0,A=y[v];S<A.length;S+=1){var M=A[S],C=M[0];C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||"none"!==C.visibility&&(o(M,this.zoom,n),(m[C.id]=C.createBucket({index:u.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(M.map((function(t){return t.id}))))}}}var E=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(E).length?a.send("getGlyphs",{uid:this.uid,stacks:E},(function(t,e){h||(h=t,d=e,I.call(l))})):d={};var L=Object.keys(g.iconDependencies);L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,I.call(l))})):p={};var P=Object.keys(g.patternDependencies);function I(){if(h)return s(h);if(d&&p&&f){var e=new i(d),r=new t.ImageAtlas(p,f);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,d,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,f=e,I.call(l))})):f={},I.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)d(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)d(e.coordinates[n],r);return e};function d(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,n=0,i=t.length,a=i-1;n<i;a=n++)r+=(t[n][0]-t[a][0])*(t[a][1]+t[n][1]);r>=0!==!!e&&t.reverse()}var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],c=0,u=s[o];c<u.length;c+=1){var h=u[c];l.push(new t.Point$1(h[0],h[1]))}a.push(l)}return a},m.prototype.toGeoJSON=function(t,e,r){return f.call(this,t,e,r)};var g=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};g.prototype.feature=function(t){return new m(this._features[t])};var y=t.vectorTile.VectorTileFeature,v=x;function x(t,e){this.options=e||{},this.features=t,this.length=t.length}function b(t,e){this.id="number"===typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}x.prototype.feature=function(t){return new b(this.features[t],this.options.extent)},b.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<n.length;a++)i.push(new t.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},b.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},b.prototype.toGeoJSON=y.prototype.toGeoJSON;var _=S,w=S,k=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return S({layers:r})},T=v;function S(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,A,t.layers[r])}(e,r),r.finish()}function A(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,M,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,I,a[r])}function M(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,C,t),e.writeVarintField(3,r.type),e.writeMessage(4,P,r)}function C(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=a[s];"undefined"===typeof l&&(n.push(s),l=n.length-1,a[s]=l),e.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,d=o[h];"undefined"===typeof d&&(i.push(c),d=i.length-1,o[h]=d),e.writeVarint(d)}}function E(t,e){return(e<<3)+(7&t)}function L(t){return t<<1^t>>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),e.writeVarint(E(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(E(2,u-1));var d=l[h].x-i,p=l[h].y-a;e.writeVarint(L(d)),e.writeVarint(L(p)),i+=d,a+=p}3===n&&e.writeVarint(E(7,1))}}function I(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function z(t,e,r,n,i,a){if(!(i-n<=r)){var o=n+i>>1;O(t,e,o,n,i,a%2),z(t,e,r,n,o-1,a+1),z(t,e,r,o+1,i,a+1)}}function O(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);O(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=e[2*r+a],d=n,p=i;for(D(t,e,n,r),e[2*i+a]>h&&D(t,e,n,i);d<p;){for(D(t,e,d,p),d++,p--;e[2*d+a]<h;)d++;for(;e[2*p+a]>h;)p--}e[2*n+a]===h?D(t,e,n,p):D(t,e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function D(t,e,r,n){R(t,r,n),R(e,2*r,2*n),R(e,2*r+1,2*n+1)}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function F(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=k,_.GeoJSONWrapper=T;var B=function(t){return t[0]},j=function(t){return t[1]},N=function(t,e,r,n,i){void 0===e&&(e=B),void 0===r&&(r=j),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);z(o,s,n,0,o.length-1,0)};N.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,a,o){for(var s,l,c=[0,t.length-1,0],u=[];c.length;){var h=c.pop(),d=c.pop(),p=c.pop();if(d-p<=o)for(var f=p;f<=d;f++)s=e[2*f],l=e[2*f+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[f]);else{var m=Math.floor((p+d)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(d),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var d=h;d<=u;d++)F(e[2*d],e[2*d+1],r,n)<=l&&s.push(t[d]);else{var p=Math.floor((h+u)/2),f=e[2*p],m=e[2*p+1];F(f,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=f:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=f:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},V=function(t){this.options=X(Object.create(U),t),this.trees=new Array(this.options.maxZoom+1)};function q(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function $(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:G(n),y:Y(i),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:W(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),Z(t.y)]}};var e}function W(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function G(t){return t/360+.5}function Y(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Z(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function X(t,e){for(var r in e)t[r]=e[r];return t}function K(t){return t.x}function J(t){return t.y}function Q(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1],d=e+3;d<r;d+=3){var p=tt(t[d],t[d+1],l,c,u,h);if(p>a)i=d,a=p;else if(p===a){var f=Math.abs(d-o);f<s&&(i=d,s=f)}}a>n&&(i-e>3&&Q(t,e,i,n),t[i+2]=a,r-i>3&&Q(t,i,r,n))}function tt(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function et(t,e,r,n){var i={id:"undefined"===typeof t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)rt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)rt(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)rt(t,e[n][i])}(i),i}function rt(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function nt(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)it(i,s);else if("MultiPoint"===a)for(var c=0;c<i.length;c++)it(i[c],s);else if("LineString"===a)at(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],at(i[c],s,o,!1),t.push(et(l,"LineString",s,e.properties));return}ot(i,s,o,!1)}else if("Polygon"===a)ot(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(c=0;c<e.geometry.geometries.length;c++)nt(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];ot(i[c],u,o,!0),s.push(u)}}t.push(et(l,a,s,e.properties))}}function it(t,e){e.push(st(t[0])),e.push(lt(t[1])),e.push(0)}function at(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var l=st(t[s][0]),c=lt(t[s][1]);e.push(l),e.push(c),e.push(0),s>0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,Q(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function ot(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];at(t[i],a,r,n),e.push(a)}}function st(t){return t/360+.5}function lt(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function ct(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.type,p=0===i?u.minX:u.minY,f=0===i?u.maxX:u.maxY;if(p>=r&&f<n)l.push(u);else if(!(f<r||p>=n)){var m=[];if("Point"===d||"MultiPoint"===d)ut(h,m,r,n,i);else if("LineString"===d)ht(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===d)pt(h,m,r,n,i,!1);else if("Polygon"===d)pt(h,m,r,n,i,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var y=[];pt(h[g],y,r,n,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===d){for(g=0;g<m.length;g++)l.push(et(u.id,d,m[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===m.length?(d="LineString",m=m[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===m.length?"Point":"MultiPoint"),l.push(et(u.id,d,m,u.tags))}}}return l.length?l:null}function ut(t,e,r,n,i){for(var a=0;a<t.length;a+=3){var o=t[a+i];o>=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ht(t,e,r,n,i,a,o){for(var s,l,c=dt(t),u=0===i?mt:gt,h=t.start,d=0;d<t.length-3;d+=3){var p=t[d],f=t[d+1],m=t[d+2],g=t[d+3],y=t[d+4],v=0===i?p:f,x=0===i?g:y,b=!1;o&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(f-y,2))),v<r?x>r&&(l=u(c,p,f,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,p,f,g,y,n),o&&(c.start=h+s*l)):ft(c,p,f,m),x<r&&v>=r&&(l=u(c,p,f,g,y,r),b=!0),x>n&&v<=n&&(l=u(c,p,f,g,y,n),b=!0),!a&&b&&(o&&(c.end=h+s*l),e.push(c),c=dt(t)),o&&(h+=s)}var _=t.length-3;p=t[_],f=t[_+1],m=t[_+2],(v=0===i?p:f)>=r&&v<=n&&ft(c,p,f,m),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&ft(c,c[0],c[1],c[2]),c.length&&e.push(c)}function dt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function pt(t,e,r,n,i,a){for(var o=0;o<t.length;o++)ht(t[o],e,r,n,i,a,!1)}function ft(t,e,r,n){t.push(e),t.push(r),t.push(n)}function mt(t,e,r,n,i,a){var o=(a-e)/(n-e);return t.push(a),t.push(r+(i-r)*o),t.push(1),o}function gt(t,e,r,n,i,a){var o=(a-r)/(i-r);return t.push(e+(n-e)*o),t.push(a),t.push(1),o}function yt(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=vt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(vt(a.geometry[s],e))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],c=0;c<a.geometry[s].length;c++)l.push(vt(a.geometry[s][c],e));i.push(l)}r.push(et(a.id,o,i,a.tags))}return r}function vt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function xt(t,e){if(t.transformed)return t;var r,n,i,a=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(bt(c[n],c[n+1],e,a,o,s));else for(n=0;n<c.length;n++){var h=[];for(i=0;i<c[n].length;i+=2)h.push(bt(c[n][i],c[n][i+1],e,a,o,s));l.geometry.push(h)}}return t.transformed=!0,t}function bt(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function _t(t,e,r,n,i){for(var a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,wt(o,t[s],a,i);var l=t[s].minX,c=t[s].minY,u=t[s].maxX,h=t[s].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),u>o.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function wt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)kt(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)kt(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)kt(o,c[s],t,r,!0,0===s)}if(o.length){var u=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var d={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:u};null!==e.id&&(d.id=e.id),t.features.push(d)}}function kt(t,e,r,n,i,a){var o=n*n;if(n>0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=s}}(s,a),t.push(s)}}function Tt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)nt(r,t.features[n],e,n);else"Feature"===t.type?nt(r,t,e):nt(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){var r=e.buffer/e.extent,n=t,i=ct(t,1,-1-r,r,0,-1,2,e),a=ct(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=ct(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=yt(i,1).concat(n)),a&&(n=n.concat(yt(a,-1)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function St(t,e,r){return 32*((1<<t)*r+e)+t}function At(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new g(n.features),a=_(i);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:i,rawData:a.buffer})}V.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,a=e.nodeSize;r&&console.time("total time");var o="prepare "+t.length+" points";r&&console.time(o),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push($(t[l],l));this.trees[i+1]=new N(s,K,J,a,Float32Array),r&&console.timeEnd(o);for(var c=i;c>=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(G(r),Y(a),G(i),Y(n));u<h.length;u+=1){var d=h[u],p=l.points[d];c.push(p.numPoints?H(p):this.points[p.index])}return c},V.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[e];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,c=i.within(a.x,a.y,o);l<c.length;l+=1){var u=c[l],h=i.points[u];h.parentId===t&&s.push(h.numPoints?H(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},V.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},V.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.points,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.points,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.points,-1,r,i,u),u.features.length?u:null},V.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},V.prototype._appendLeaves=function(t,e,r,n,i){for(var a=0,o=this.getChildren(e);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},V.prototype._addTileFeatures=function(t,e,r,n,i,a){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:c?W(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),a.features.push(u)}},V.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},V.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,a=n.extent,o=n.reduce,s=n.minPoints,l=i/(a*Math.pow(2,e)),c=0;c<t.length;c++){var u=t[c];if(!(u.zoom<=e)){u.zoom=e;for(var h=this.trees[e+1],d=h.within(u.x,u.y,l),p=u.numPoints||1,f=p,m=0,g=d;m<g.length;m+=1){var y=g[m],v=h.points[y];v.zoom>e&&(f+=v.numPoints||1)}if(f>=s){for(var x=u.x*p,b=u.y*p,_=o&&p>1?this._map(u,!0):null,w=(c<<5)+(e+1)+this.points.length,k=0,T=d;k<T.length;k+=1){var S=T[k],A=h.points[S];if(!(A.zoom<=e)){A.zoom=e;var M=A.numPoints||1;x+=A.x*M,b+=A.y*M,A.parentId=w,o&&(_||(_=this._map(u,!0)),o(_,this._map(A)))}}u.parentId=w,r.push(q(x/f,b/f,w,f,_))}else if(r.push(u),f>1)for(var C=0,E=d;C<E.length;C+=1){var L=E[C],P=h.points[L];P.zoom<=e||(P.zoom=e,r.push(P))}}}return r},V.prototype._getOriginId=function(t){return t-this.points.length>>5},V.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},V.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},Tt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Tt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<<e,h=St(e,r,n),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=_t(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=t,i){if(e===l.maxZoom||e===i)continue;var f=1<<i-e;if(r!==Math.floor(a/f)||n!==Math.floor(o/f))continue}else if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==t.length){c>1&&console.time("clipping");var m,g,y,v,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;m=g=y=v=null,x=ct(t,u,r-_,r+k,0,d.minX,d.maxX,l),b=ct(t,u,r+w,r+T,0,d.minX,d.maxX,l),t=null,x&&(m=ct(x,u,n-_,n+k,1,d.minY,d.maxY,l),g=ct(x,u,n+w,n+T,1,d.minY,d.maxY,l),x=null),b&&(y=ct(b,u,n-_,n+k,1,d.minY,d.maxY,l),v=ct(b,u,n+w,n+T,1,d.minY,d.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},Tt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<<t,s=St(t,e=(e%o+o)%o,r);if(this.tiles[s])return xt(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[St(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xt(this.tiles[s],i):null):null};var Mt=function(e){function r(t,r,n,i){e.call(this,t,r,n,At),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!==typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=o.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));o={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new V(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c<u.length;c+=1){var h=u[c],d=n[h],p=d[0],f=d[1],m=t.createExpression(f),g=t.createExpression("string"===typeof p?[p,["accumulated"],["get",h]]:p);i[h]=m.value,a[h]=g.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var a=n[r];e[a]=i[a].evaluate(o,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=t[i],t[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):function(t,e){return new Tt(t,e)}(o,n.geojsonVtOptions)}catch(d){return r(d)}e.loaded={};var c={};if(i){var u=i.finish();u&&(c.resourceTiming={},c.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}r(null,c)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!==typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(n){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(r){e(r)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(r){e(r)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(r){e(r)}},r}(l),Ct=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Mt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return Ct.prototype.setReferrer=function(t,e){this.referrer=e},Ct.prototype.setImages=function(t,e,r){for(var n in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][n];for(var a in i)i[a].availableImages=e}r()},Ct.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ct.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ct.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ct.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ct.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ct.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ct.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ct.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ct.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ct.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(n){r(n.toString())}},Ct.prototype.syncRTLPluginState=function(e,r,n){try{t.plugin.setState(r);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var a=t.plugin.isParsed();n(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),a)}}catch(o){n(o.toString())}},Ct.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Ct.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Ct.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][e][r]},Ct.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},Ct.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!==typeof WorkerGlobalScope&&"undefined"!==typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Ct(self)),Ct})),n(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"===typeof window||"undefined"===typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(i){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(r=t&&t.failIfMajorPerformanceCaveat,void 0===n[r]&&(n[r]=function(t){var r=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(r)),n[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document&&t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(oa){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};var u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",u,!0)}),0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect();return new t.Point(r.clientX-n.left-e.clientLeft,r.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],a=0;a<r.length;a++)i.push(new t.Point(r[a].clientX-n.left-e.clientLeft,r[a].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return"undefined"!==typeof t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e],i=n.ids,a=n.callback;this._notify(i,a)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];if(a[0]<r||a[1]<a[0]||e<a[1])return!1;r=a[1]}return!0},r.prototype._validateContent=function(t,e){return!t||4===t.length&&!(t[0]<0||e.data.width<t[0])&&!(t[1]<0||e.data.height<t[1])&&!(t[2]<0||e.data.width<t[2])&&!(t[3]<0||e.data.height<t[3])&&!(t[2]<t[0])&&!(t[3]<t[1])},r.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1){var a=i[n];this.images[a]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,u=l.y+1,h=this.images[s].data,d=h.width,p=h.height;t.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u},{width:d,height:p}),t.RGBAImage.copy(h,o,{x:0,y:p-1},{x:c,y:u-1},{width:d,height:1}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u+p},{width:d,height:1}),t.RGBAImage.copy(h,o,{x:d-1,y:0},{x:c-1,y:u},{width:1,height:p}),t.RGBAImage.copy(h,o,{x:0,y:0},{x:c+d,y:u},{width:1,height:p})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(t.Evented),p=g,f=g,m=1e20;function g(t,e,r,n,i,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(v(n,i,a,o,r),l=0;l<r;l++)t[l*e+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(v(n,i,a,o,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(i[s])}}function v(t,e,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;e[a]=(a-r[o])*(a-r[o])+t[r[o]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r},p.default=f;var x=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};x.prototype.setURL=function(t){this.url=t},x.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var a in e)for(var o=0,s=e[a];o<s.length;o+=1){var l=s[o];i.push({stack:a,id:l})}t.asyncAll(i,(function(t,e){var r=t.stack,i=t.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void e(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(t,e);delete a.requests[s]}))),l.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})}))}}else e(null,{stack:r,id:i,glyph:o})}),(function(t,e){if(t)r(t);else if(e){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,c=o.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}r(null,n)}}))},x.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},x.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=e.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new x.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(e,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)a(e);else if(r){for(var n={},i=0,o=t.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}}))},x.TinySDF=p;var b=function(){this.specification=t.styleSpec.light.position};b.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},b.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var _=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new b,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w="-transition",k=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(_),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,w)?this._transitionable.setTransition(n.slice(0,-11),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),T=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};T.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},T.prototype.getDashRanges=function(t,e,r){var n=[],i=t.length%2===1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){o=!o;var c=t[l];i=s*r,a=(s+=c)*r,n.push({left:i,right:a,isDash:o,zeroLength:0===c})}return n},T.prototype.addRoundDash=function(t,e,r){for(var n=e/2,i=-r;i<=r;i++)for(var a=this.nextRow+r+i,o=this.width*a,s=0,l=t[s],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),d=Math.min(u,h),p=void 0,f=i/r*(n+1);if(l.isDash){var m=n-Math.abs(f);p=Math.sqrt(d*d+m*m)}else p=n-Math.sqrt(d*d+f*f);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),d=Math.min(u,h),p=l.isDash?d:-d;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<e.length;o++)a+=e[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,c},T.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var S=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=i[a],s=new e.Actor(o,n,this.id);s.name="Worker "+a,this.actors.push(s)}};function A(e,r,n){var i=function(i,a){if(i)return n(i);if(a){var o=t.pick(t.extend(a,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),o.tiles=r.canonicalizeTileset(o,e.url),n(null,o)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}S.prototype.broadcast=function(e,r,n){n=n||function(){},t.asyncAll(this.actors,(function(t,n){t.send(e,r,n)}),n)},S.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},S.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},S.Actor=t.Actor;var M=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};M.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},M.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o};var C=function(e){function r(r,n,i,a){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},r.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,a.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),E=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),(function(i,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;e.texture=n.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.Texture(o,a,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=t.window.ImageBitmap&&a instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?a:t.browser.getImageData(a,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:o,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(E),P=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(a),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var c=i-r,u=a-n,h=Math.max(c,u),d=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),p=Math.pow(2,d);return new t.CanonicalTileID(d,Math.floor((r+i)/2*p),Math.floor((n+a)/2*p))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),O=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var a=i[n];this.urls.push(this.map._requestManager.transformRequest(a,t.ResourceType.Source).url)}t.getVideo(this.urls,(function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),D=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!==typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(z),R={vector:C,raster:E,"raster-dem":L,geojson:P,video:O,image:z,canvas:D};function F(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function B(t,e,r,n,i,a){var o=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var a=e[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in e){var s=e[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(j);for(var c=[],u=0,h=l;u<h.length;u+=1){var d=h[u];c.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(e,r,t._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,i,a,s,F(t.transform,d.tileID))})}var p=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var c in o)for(var u=o[c],h=l[c]=l[c]||{},d=e[c]=e[c]||[],p=0,f=u;p<f.length;p+=1){var m=f[p];h[m.featureIndex]||(h[m.featureIndex]=!0,d.push(m))}}return e}(c);for(var f in p)p[f].forEach((function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return p}function j(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var N=function(t,e){this.max=t,this.onRemove=e,this.reset()};N.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},N.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:e,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout((function(){n.remove(t,a)}),r)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var a=i[n];t(a.value)||e.push(a)}for(var o=0,s=e;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var U=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var V={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},q=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};q.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},q.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},q.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=e.attributes[n.name];void 0!==i&&t.enableVertexAttribArray(i)}},q.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[V[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},q.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var $=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};$.prototype.get=function(){return this.current},$.prototype.set=function(t){},$.prototype.getDefault=function(){return this.default},$.prototype.setDefault=function(){this.set(this.default)};var H=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}($),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}($),G=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}($),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}($),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}($),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}($),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}($),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}($),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}($),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}($),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}($),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}($),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}($),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}($),at=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}($),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}($),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}($),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}($),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}($),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}($),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}($),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}($),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}($),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}($),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}($),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}($),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}($),vt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}($),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}($),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}($),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}($),wt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}($),kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(wt),Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(wt),St=function(t,e,r,n){this.context=t,this.width=e,this.height=r;var i=t.gl,a=this.framebuffer=i.createFramebuffer();this.colorAttachment=new kt(t,a),n&&(this.depthAttachment=new Tt(t,a))};St.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var At=function(t,e,r){this.func=t,this.mask=e,this.range=r};At.ReadOnly=!1,At.ReadWrite=!0,At.disabled=new At(519,At.ReadOnly,[0,1]);var Mt=7680,Ct=function(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Ct.disabled=new Ct({func:519,mask:0},0,0,Mt,Mt,Mt);var Et=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Et.disabled=new Et(Et.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Et.unblended=new Et(Et.Replace,t.Color.transparent,[!0,!0,!0,!0]),Et.alphaBlended=new Et([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Lt=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Lt.disabled=new Lt(!1,1029,2305),Lt.backCCW=new Lt(!0,1029,2305);var Pt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new W(this),this.clearStencil=new G(this),this.colorMask=new Y(this),this.depthMask=new Z(this),this.stencilMask=new X(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new Q(this),this.depthRange=new tt(this),this.depthTest=new et(this),this.depthFunc=new rt(this),this.blend=new nt(this),this.blendFunc=new it(this),this.blendColor=new at(this),this.blendEquation=new ot(this),this.cullFace=new st(this),this.cullFaceSide=new lt(this),this.frontFace=new ct(this),this.program=new ut(this),this.activeTexture=new ht(this),this.viewport=new dt(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new mt(this),this.bindVertexBuffer=new gt(this),this.bindElementBuffer=new yt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new vt(this),this.pixelStoreUnpack=new xt(this),this.pixelStoreUnpackPremultiplyAlpha=new bt(this),this.pixelStoreUnpackFlipY=new _t(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Pt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Pt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Pt.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Pt.prototype.createVertexBuffer=function(t,e,r){return new q(this,t,e,r)},Pt.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Pt.prototype.createFramebuffer=function(t,e,r){return new St(this,t,e,r)},Pt.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),"undefined"!==typeof r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Pt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Pt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Pt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Pt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Et.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Pt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var It=function(e){function r(r,n,i){var a=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))})),this.on("error",(function(){a._sourceErrored=!0})),this._source=function(e,r,n,i){var a=new R[r.type](e,r,n,i);if(a.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+a.id);return t.bindAll(["load","abort","unload","serialize","prepare"],a),a}(r,n,i,this),this._tiles={},this._cache=new N(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(zt).map((function(t){return t.key}))},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&n.push(this._tiles[i]);return e?n.sort((function(e,n){var i=e.tileID,a=n.tileID,o=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(zt).map((function(t){return t.key}))},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);a(t,i),a(i,t)}}function a(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Ot(this._source.type)){for(var c={},u={},h=0,d=Object.keys(l);h<d.length;h+=1){var p=d[h],f=l[p],m=this._tiles[p];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(f,o);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[p]=f}}for(var y in this._retainLoadedChildren(u,a,s,l),c)l[y]||(this._coveredTiles[y]=!0,l[y]=c[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var x=0,b=t.keysDifference(this._tiles,l);x<b.length;x+=1){var _=b[x],w=this._tiles[_];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},a=Math.max(e-r.maxOverzooming,this._source.minzoom),o=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,c=t;l<c.length;l+=1){var u=c[l],h=this._addTile(u);n[u.key]=u,h.hasData()||e<this._source.maxzoom&&(s[u.key]=u)}this._retainLoadedChildren(s,e,o,n);for(var d=0,p=t;d<p.length;d+=1){var f=p[d],m=this._tiles[f.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=f.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),b=f.overscaledZ-1;b>=a;--b){var _=f.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(m=this.getTile(_))&&x&&(m=this._addTile(_)),m&&(n[_.key]=_,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a<o.length;a+=1){var s=o[a];this._loadedParentTiles[s]=r}}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,d=1/0,p=-1/0,f=-1/0,m=0,g=c;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),d=Math.min(d,y.y),p=Math.max(p,y.x),f=Math.max(f,y.y)}for(var v=function(e){var n=i._tiles[u[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*t.EXTENT/n.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(h,d)),s.getTilePoint(new t.MercatorCoordinate(p,f))];if(y[0].x-g<t.EXTENT&&y[0].y-g<t.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x<u.length;x++)v(x);return a},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ot(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function zt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Ot(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(aa.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ft.workerCount;)this.workers.push(new Dt);return this.active[t]=!0,this.workers.slice()},Ft.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Ft.prototype.isPreloaded=function(){return!!this.active[Rt]},Ft.prototype.numActive=function(){return Object.keys(this.active).length};var Bt,jt=Math.floor(t.browser.hardwareConcurrency/2);function Nt(){return Bt||(Bt=new Ft),Bt}function Ut(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}function Vt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Ut(t[n],e[t[n].ref]));return t}Ft.workerCount=Math.max(Math.min(jt,6),1);var qt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function $t(t,e,r){r.push({command:qt.addSource,args:[t,e[t]]})}function Ht(t,e,r){e.push({command:qt.removeSource,args:[t]}),r[t]=!0}function Wt(t,e,r,n){Ht(t,r,n),$t(t,e,r)}function Gt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Yt(e,r,n,i,a,o){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}))}function Zt(t){return t.id}function Xt(t,e){return t[e.id]=e,t}function Kt(e,r){if(!e)return[{command:qt.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:qt.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:qt.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:qt.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:qt.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:qt.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:qt.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:qt.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:qt.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:qt.setLight,args:[r.light]});var i={},a=[];!function(e,r,n,i){var a;for(a in r=r||{},e=e||{})e.hasOwnProperty(a)&&(r.hasOwnProperty(a)||Ht(a,n,i));for(a in r)r.hasOwnProperty(a)&&(e.hasOwnProperty(a)?t.deepEqual(e[a],r[a])||("geojson"===e[a].type&&"geojson"===r[a].type&&Gt(e,r,a)?n.push({command:qt.setGeoJSONSourceData,args:[a,r[a].data]}):Wt(a,r,n,i)):$t(a,r,n))}(e.sources,r.sources,a,i);var o=[];e.layers&&e.layers.forEach((function(t){i[t.source]?n.push({command:qt.removeLayer,args:[t.id]}):o.push(t)})),n=n.concat(a),function(e,r,n){r=r||[];var i,a,o,s,l,c,u,h=(e=e||[]).map(Zt),d=r.map(Zt),p=e.reduce(Xt,{}),f=r.reduce(Xt,{}),m=h.slice(),g=Object.create(null);for(i=0,a=0;i<h.length;i++)o=h[i],f.hasOwnProperty(o)?a++:(n.push({command:qt.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<d.length;i++)o=d[d.length-1-i],m[m.length-1-i]!==o&&(p.hasOwnProperty(o)?(n.push({command:qt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,c=m[m.length-i],n.push({command:qt.addLayer,args:[f[o],c]}),m.splice(m.length-i,0,o),g[o]=!0);for(i=0;i<d.length;i++)if(s=p[o=d[i]],l=f[o],!g[o]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(u in Yt(s.layout,l.layout,n,o,null,qt.setLayoutProperty),Yt(s.paint,l.paint,n,o,null,qt.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:qt.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:qt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Yt(s[u],l[u],n,o,u.slice(6),qt.setPaintProperty):t.deepEqual(s[u],l[u])||n.push({command:qt.setLayerProperty,args:[o,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Yt(s[u],l[u],n,o,u.slice(6),qt.setPaintProperty):t.deepEqual(s[u],l[u])||n.push({command:qt.setLayerProperty,args:[o,u,l[u]]}))}else n.push({command:qt.removeLayer,args:[o]}),c=m[m.lastIndexOf(o)+1],n.push({command:qt.addLayer,args:[l,c]})}(o,r.layers,n)}catch(s){console.warn("Unable to compute style diff:",s),n=[{command:qt.setStyle,args:[r]}]}return n}var Jt=function(t,e){this.reset(t,e)};Jt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Jt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,n=this._distances[r],i=e*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function te(e,r,n,i,a){var o=t.create();return r?(t.scale(o,o,[1/a,1/a,1]),n||t.rotateZ(o,o,i.angle)):t.multiply(o,i.labelPlaneMatrix,e),o}function ee(e,r,n,i,a){if(r){var o=t.clone(e);return t.scale(o,o,[a,a,1]),n||t.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function re(e,r){var n=[e.x,e.y,0,1];pe(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function ne(t,e){return.5+t/e*.5}function ie(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ae(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],d=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();for(var p=e.lineVertexArray,f=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<f.length;y++){var v=f.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)de(v.numGlyphs,d);else{g=!1;var x=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(x,x,r),ie(x,h)){var b=x[3],_=ne(n.transform.cameraToCenterDistance,b),w=t.evaluateSizeForFeature(c,u,v),k=s?w/_:w*_,T=new t.Point(v.anchorX,v.anchorY),S=re(T,a).point,A={},M=le(v,k,!1,l,r,a,o,e.glyphOffsetArray,p,d,S,T,A,m);g=M.useVertical,(M.notEnoughRoom||g||M.needsFlipping&&le(v,k,!0,l,r,a,o,e.glyphOffsetArray,p,d,S,T,A,m).notEnoughRoom)&&de(v.numGlyphs,d)}else de(v.numGlyphs,d)}}i?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function oe(t,e,r,n,i,a,o,s,l,c,u){var h=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(h-1),g=ue(t*f,r,n,i,a,o,s.segment,d,p,l,c,u);if(!g)return null;var y=ue(t*m,r,n,i,a,o,s.segment,d,p,l,c,u);return y?{first:g,last:y}:null}function se(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function le(e,r,n,i,a,o,s,l,c,u,h,d,p,f){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=oe(g,l,y,v,n,h,d,e,c,o,p);if(!w)return{notEnoughRoom:!0};var k=re(w.first.point,s).point,T=re(w.last.point,s).point;if(i&&!n){var S=se(e.writingMode,k,T,f);if(S)return S}m=[w.first];for(var A=e.glyphStartIndex+1;A<x-1;A++)m.push(ue(g*l.getoffsetX(A),y,v,n,h,d,e.segment,b,_,c,o,p));m.push(w.last)}else{if(i&&!n){var M=re(d,a).point,C=e.lineStartIndex+e.segment+1,E=new t.Point(c.getx(C),c.gety(C)),L=re(E,a),P=L.signedDistanceFromCamera>0?L.point:ce(d,E,M,1,a),I=se(e.writingMode,M,P,f);if(I)return I}var z=ue(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var O=0,D=m;O<D.length;O+=1){var R=D[O];t.addDynamicAttributes(u,R.point,R.angle)}return{}}function ce(t,e,r,n,i){var a=re(t.add(t.sub(e)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function ue(e,r,n,i,a,o,s,l,c,u,h,d){var p=i?e-r:e+r,f=p>0?1:-1,m=0;i&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,y=a,v=a,x=0,b=0,_=Math.abs(p),w=[];x+b<=_;){if((g+=f)<l||g>=c)return null;if(v=y,w.push(y),void 0===(y=d[g])){var k=new t.Point(u.getx(g),u.gety(g)),T=re(k,h);if(T.signedDistanceFromCamera>0)y=d[g]=T.point;else{var S=g-f;y=ce(0===x?o:new t.Point(u.getx(S),u.gety(S)),k,v,_-x+1,h)}}x+=b,b=v.dist(y)}var A=(_-x)/b,M=y.sub(v),C=M.mult(A)._add(v);C._add(M._unit()._perp()._mult(n*f));var E=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(C),{point:C,angle:E,path:w}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Qt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Qt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Qt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return a?o.filter(a):o}var d={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,n,this._queryCell,o,d,a),i?o.length>0:o},Qt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Qt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,d=c;h<d.length;h+=1){var p=d[h];if(!l.box[p]){l.box[p]=!0;var f=4*p;if(t<=u[f+2]&&e<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var x=v[y];if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],t,e,r,n)&&(!s||s(this.circleKeys[x]))){if(o.hitTest)return a.push(!0),!0;var _=g[b],w=g[b+1],k=g[b+2];a.push({key:this.circleKeys[x],x1:_-k,y1:w-k,x2:_+k,y2:w+k})}}}},Qt.prototype._queryCellCircle=function(t,e,r,n,i,a,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[i];if(null!==u)for(var h=this.bboxes,d=0,p=u;d<p.length;d+=1){var f=p[d];if(!c.box[f]){c.box[f]=!0;var m=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[f])))return a.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,x=g;v<x.length;v+=1){var b=x[v];if(!c.circle[b]){c.circle[b]=!0;var _=3*b;if(this._circlesCollide(y[_],y[_+1],y[_+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[b])))return a.push(!0),!0}}},Qt.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.xCellCount*p+d;if(i.call(this,t,e,r,n,f,a,o,s))return}},Qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Qt.prototype._circlesCollide=function(t,e,r,n,i,a){var o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s},Qt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,d=u-c;return h*h+d*d<=r*r};var he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function de(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(he,3*n)}}function pe(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var fe=100,me=function(t,e,r){void 0===e&&(e=new Qt(t.width+200,t.height+200,25)),void 0===r&&(r=new Qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+fe,this.screenBottomBoundary=t.height+fe,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function ge(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}me.prototype.placeCollisionBox=function(t,e,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),o=r*a.perspectiveRatio,s=t.x1*o+a.point.x,l=t.y1*o+a.point.y,c=t.x2*o+a.point.x,u=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,c,u)||!e&&this.grid.hitTest(s,l,c,u,i)?{box:[],offscreen:!1}:{box:[s,l,c,u],offscreen:this.isOffscreen(s,l,c,u)}},me.prototype.placeCollisionCircles=function(e,r,n,i,a,o,s,l,c,u,h,d,p){var f=[],m=new t.Point(r.anchorX,r.anchorY),g=re(m,o),y=ne(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?a/y:a*y)/t.ONE_EM,x=re(m,s).point,b=oe(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,x,m,r,n,s,{}),_=!1,w=!1,k=!0;if(b){for(var T=.5*d*y+p,S=new t.Point(-100,-100),A=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),M=new Jt,C=b.first,E=b.last,L=[],P=C.path.length-1;P>=1;P--)L.push(C.path[P]);for(var I=1;I<E.path.length;I++)L.push(E.path[I]);var z=2.5*T;if(l){var O=L.map((function(t){return re(t,l)}));L=O.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:O.map((function(t){return t.point}))}var D=[];if(L.length>0){for(var R=L[0].clone(),F=L[0].clone(),B=1;B<L.length;B++)R.x=Math.min(R.x,L[B].x),R.y=Math.min(R.y,L[B].y),F.x=Math.max(F.x,L[B].x),F.y=Math.max(F.y,L[B].y);D=R.x>=S.x&&F.x<=A.x&&R.y>=S.y&&F.y<=A.y?[L]:F.x<S.x||R.x>A.x||F.y<S.y||R.y>A.y?[]:t.clipLine([L],S.x,S.y,A.x,A.y)}for(var j=0,N=D;j<N.length;j+=1){var U=N[j];M.reset(U,.25*T);var V=0;V=M.length<=.5*T?1:Math.ceil(M.paddedLength/z)+1;for(var q=0;q<V;q++){var $=q/Math.max(V-1,1),H=M.lerp($),W=H.x+fe,G=H.y+fe;f.push(W,G,T,0);var Y=W-T,Z=G-T,X=W+T,K=G+T;if(k=k&&this.isOffscreen(Y,Z,X,K),w=w||this.isInsideGrid(Y,Z,X,K),!e&&this.grid.hitTestCircle(W,G,T,h)&&(_=!0,!c))return{circles:[],offscreen:!1,collisionDetected:_}}}}return{circles:!c&&_||!w?[]:f,offscreen:k,collisionDetected:_}},me.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var c=l[s],u=new t.Point(c.x+fe,c.y+fe);n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y),r.push(u)}for(var h={},d={},p=0,f=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));p<f.length;p+=1){var m=f[p],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===d[g.bucketInstanceId]&&(d[g.bucketInstanceId]=[]),d[g.bucketInstanceId].push(g.featureIndex))}}return d},me.prototype.insertCollisionBox=function(t,e,r,n,i){var a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(a,t[0],t[1],t[2],t[3])},me.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var a=e?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)a.insertCircle(o,t[s],t[s+1],t[s+2])},me.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return pe(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+fe,(-i[1]/i[3]+1)/2*this.transform.height+fe),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},me.prototype.isOffscreen=function(t,e,r,n){return r<fe||t>=this.screenRightBoundary||n<fe||e>this.screenBottomBoundary},me.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},me.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var ye=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};ye.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var ve=function(t,e,r,n,i){this.text=new ye(t?t.text:null,e,r,i),this.icon=new ye(t?t.icon:null,e,n,i)};ve.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var xe=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},be=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},_e=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},we=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ke(e,r,n,i,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point(s+c[0]*a,l+c[1]*a)}function Te(e,r,n,i,a,o){var s=e.x1,l=e.x2,c=e.y1,u=e.y2,h=e.anchorPointX,d=e.anchorPointY,p=new t.Point(r,n);return i&&p._rotate(a?o:-o),{x1:s+p.x,y1:c+p.y,x2:l+p.x,y2:u+p.y,anchorPointX:h,anchorPointY:d}}we.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var Se=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new me(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new we(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function Ae(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}Se.prototype.getBucketParts=function(e,r,n,i){var a=n.getBucket(r),o=n.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=n.collisionBoxArray,l=a.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),d="map"===l.get("text-pitch-alignment"),p="map"===l.get("text-rotation-alignment"),f=ge(n,1,this.transform.zoom),m=te(h,d,p,this.transform,f),g=null;if(d){var y=ee(h,d,p,this.transform,f);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new _e(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var x=0,b=a.sortKeyRanges;x<b.length;x+=1){var _=b[x],w=_.sortKey,k=_.symbolInstanceStart,T=_.symbolInstanceEnd;e.push({sortKey:w,symbolInstanceStart:k,symbolInstanceEnd:T,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},Se.prototype.attemptAnchorPlacement=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f){var m,g=[h.textOffset0,h.textOffset1],y=ke(t,r,n,g,i),v=this.collisionIndex.placeCollisionBox(Te(e,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate);if(!f||0!==this.collisionIndex.placeCollisionBox(Te(f,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(d,t,h,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,h),this.placedOrientations[h.crossTileID]=p),{shift:y,placedGlyphBoxes:v}):void 0},Se.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,d=a.holdingForFade,p=a.collisionBoxArray,f=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),T=v&&(x||!o.hasIconData()||y),S=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var A=function(e,a){if(!r[e.crossTileID])if(d)i.placements[e.crossTileID]=new xe(!1,!1,!1);else{var p,k=!1,A=!1,M=!0,C=null,E={box:null,offscreen:null},L={box:null,offscreen:null},P=null,I=null,z=0,O=0,D=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(E=n(),L=E):E=r(),!(E&&E.box&&E.box.length));i+=1);else E=r()};if(s.get("text-variable-anchor")){var j=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var N=i.prevPlacement.variableOffsets[e.crossTileID];j.indexOf(N.anchor)>0&&(j=j.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,d={box:[],offscreen:!1},p=v?2*j.length:j.length,f=0;f<p;++f){var g=j[f%j.length],y=f>=j.length,T=i.attemptAnchorPlacement(g,t,a,s,c,b,_,h,l,m,y,e,o,n,u);if(T&&(d=T.placedGlyphBoxes)&&d.box&&d.box.length){k=!0,C=T.shift;break}}return d};B((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=E&&E.box&&E.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),E&&(k=E.box,M=E.offscreen);var V=F(E&&E.box);if(!k&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var $=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return $(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?$(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(E&&E.box&&E.box.length)}}if(k=(p=E)&&p.box&&p.box.length>0,M=p&&p.offscreen,e.useRuntimeCollisionCircles){var H=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(o.textSizeData,f,H),G=s.get("text-padding"),Y=e.collisionCircleDiameter;P=i.collisionIndex.placeCollisionCircles(v,H,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,_,m.predicate,Y,G),k=v||P.circles.length>0&&!P.collisionDetected,M=M&&P.offscreen}if(a.iconFeatureIndex&&(D=a.iconFeatureIndex),a.iconBox){var Z=function(t){var e=w&&C?Te(t,C.x,C.y,b,_,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};A=L&&L.box&&L.box.length&&a.verticalIconBox?(I=Z(a.verticalIconBox)).box.length>0:(I=Z(a.iconBox)).box.length>0,M=M&&I.offscreen}var X=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(X||K?K?X||(A=A&&k):k=A&&k:A=k=A&&k,k&&p&&p.box&&(L&&L.box&&O?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),A&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,D,m.ID),P&&(k&&i.collisionIndex.insertCollisionCircles(P.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new be);for(var tt=0;tt<P.circles.length;tt+=4)Q.circles.push(P.circles[tt+0]),Q.circles.push(P.circles[tt+1]),Q.circles.push(P.circles[tt+2]),Q.circles.push(P.collisionDetected?1:0)}i.placements[e.crossTileID]=new xe(k||T,A||S,M||o.justReloaded),r[e.crossTileID]=!0}};if(k)for(var M=o.getSortedSymbolIndexes(this.transform.angle),C=M.length-1;C>=0;--C){var E=M[C];A(o.symbolInstances.get(E),o.collisionArrays[E])}else for(var L=e.symbolInstanceStart;L<e.symbolInstanceEnd;L++)A(o.symbolInstances.get(L),o.collisionArrays[L]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var P=this.collisionCircleArrays[o.bucketInstanceId];t.invert(P.invProjMatrix,l),P.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},Se.prototype.markUsedJustification=function(e,r,n,i){var a,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};a=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[t.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var c=l[s];c>=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Se.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];e.text.placedSymbolArray.get(l).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},Se.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=i[s];c?(this.opacities[s]=new ve(c,n,l.text,l.icon),r=r||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new ve(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var u in i){var h=i[u];if(!this.opacities[u]){var d=new ve(h,n,!1,!1);d.isHidden()||(this.opacities[u]=d,r=r||h.text.placed||h.icon.placed)}}for(var p in a)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=a[p]);for(var f in o)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=o[f]);r?this.lastPlacementChangeTime=t:"number"!==typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},Se.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.getBucket(t);o&&a.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},Se.prototype.updateBucketOpacities=function(e,r,n){var i=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var a=e.layers[0].layout,o=new ve(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),c=a.get("text-variable-anchor"),u="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),d="none"!==a.get("icon-text-fit"),p=new ve(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);for(var f=function(t,e,r){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r)},m=function(n){var a=e.symbolInstances.get(n),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,g=r[m],y=i.opacities[m];g?y=o:y||(y=p,i.opacities[m]=y),r[m]=!0;var v=s>0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===t.WritingMode.vertical,w=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;if(v){var k=Oe(y.text),T=_?De:k;f(e.text,s,T);var S=w?De:k;f(e.text,l,S);var A=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=A||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var M=i.variableOffsets[a.crossTileID];M&&i.markUsedJustification(e,M.anchor,a,b);var C=i.placedOrientations[a.crossTileID];C&&(i.markUsedJustification(e,"left",a,C),i.markUsedOrientation(e,C,a))}if(x){var E=Oe(y.icon),L=!(d&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var P=L?E:De;f(e.icon,a.numIconVertices,P),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=L?De:E;f(e.icon,a.numVerticalIconVertices,I),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var O=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var D=!0;if(c){var R=i.variableOffsets[m];R?(O=ke(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&O._rotate(h?i.transform.angle:-i.transform.angle)):D=!1}z.textBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!D||_,O.x,O.y),z.verticalTextBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!D||w,O.x,O.y)}var F=Boolean(!w&&z.verticalIconBox);z.iconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,d?O.x:0,d?O.y:0),z.verticalIconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,d?O.x:0,d?O.y:0)}}},g=0;g<e.symbolInstances.length;g++)m(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=y.invProjMatrix,e.placementViewportMatrix=y.viewportMatrix,e.collisionCircleArray=y.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},Se.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Se.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},Se.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Se.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},Se.prototype.setStale=function(){this.stale=!0};var Me=Math.pow(2,25),Ce=Math.pow(2,24),Ee=Math.pow(2,17),Le=Math.pow(2,16),Pe=Math.pow(2,9),Ie=Math.pow(2,8),ze=Math.pow(2,1);function Oe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Me+e*Ce+r*Ee+e*Le+r*Pe+e*Ie+r*ze+e}var De=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.getBucketParts(a,n,o,this._sortAcrossTiles),this._currentTileIndex++,i())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<a.length;){var s=a[this._currentPartIndex];if(e.placeLayerBucketPart(s,this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0}return!1};var Fe=function(t,e,r,n,i,a,o){this.placement=new Se(t,i,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Fe.prototype.isDone=function(){return this._done},Fe.prototype.continuePlacement=function(e,r,n){for(var i=this,a=t.browser.now(),o=function(){var e=t.browser.now()-a;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Be=512/t.EXTENT/2,je=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};je.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,i=Be/Math.pow(2,n);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},je.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var a=t.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,e),l=0,c=o;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-s.x)<=n&&Math.abs(u.coord.y-s.y)<=n&&!r[u.crossTileID]){r[u.crossTileID]=!0,a.crossTileID=u.crossTileID;break}}}}};var Ne=function(){this.maxCrossTileID=0};Ne.prototype.generate=function(){return++this.maxCrossTileID};var Ue=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ue.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=t},Ue.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new je(t,e.symbolInstances,e.bucketInstanceId),!0},Ue.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1){var a=i[n];delete this.usedCrossTileIDs[t][a.crossTileID]}},Ue.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Ve=function(){this.layerIndexes={},this.crossTileIDs=new Ne,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Ve.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Ue);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(i=!0),a[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Ve.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var qe=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},$e=t.pick(qt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),He=t.pick(qt,["setCenter","setZoom","setBearing","setPitch"]),We=function(){var e={},r=t.styleSpec.$version;for(var n in t.styleSpec.$root){var i=t.styleSpec.$root[n];if(i.required){var a=null;null!=(a="version"===n?r:"array"===i.type?[]:{})&&(e[n]=a)}}return e}(),Ge=function(e){function r(n,i){var a=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new S(Nt(),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new x(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new Ve,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){var r={pluginStatus:e.pluginStatus,pluginURL:e.pluginURL};o.dispatcher.broadcast("syncRTLPluginState",r,(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var n in o.sourceCaches)o.sourceCaches[n].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=a.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}}))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"===typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,(function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(We,!1)},r.prototype._load=function(e,r){if(!r||!qe(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(n,e.sources[n],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Vt(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var a=0,o=i;a<o.length;a+=1){var s=o[a];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new k(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,n){var i,a,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,d=l.y,p=l.sdf,f=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,v,{x:h,y:d},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:f,sdf:p,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],a=this._layers[i];"custom"!==a.type&&e.push(a.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,d=this._order;h<d.length;h+=1){var p=d[h],f=this._layers[p];f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(var m in l){var g=this.sourceCaches[m];l[m]!==g.used&&g.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),qe(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Vt(e.layers);var n=Kt(this.serialize(),e).filter((function(t){return!(t.command in He)}));if(0===n.length)return!1;var i=n.filter((function(t){return!(t.command in $e)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new It(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(qe(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"===typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof e.id&&"number"!==typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s<l.length;s+=1){var c=l[s][o];if(c)for(var u=0,h=c;u<h.length;u+=1){var d=h[u];i.push(d)}}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],f=this._order.length-1;f>=0;f--){var m=this._order[f];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id]<f)break;p.push(y),i.pop()}else for(var v=0,x=t;v<x.length;v+=1){var b=x[v][m];if(b)for(var _=0,w=b;_<w.length;_+=1){var k=w[_];p.push(k.feature)}}}return p},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var c=[];for(var u in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[u]||c.push(B(this.sourceCaches[u],this._layers,this._serializedLayers,e,r,n));return this.placement&&c.push(function(t,e,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1){var d=h[u];c.push(o[d])}c.sort(j);for(var p=function(){var r=m[f],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var a in n){var o=s[a]=s[a]||[],c=n[a];c.sort((function(t,e){var n=r.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(var u=0,h=c;u<h.length;u+=1){var d=h[u];o.push(d)}}},f=0,m=c;f<m.length;f+=1)p();var g=function(e){s[e].forEach((function(n){var i=n.feature,a=t[e],o=r[a.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o}))};for(var y in s)g(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in e)if(!t.deepEqual(e[a],n[a])){i=!0;break}if(i){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}},r.prototype._validate=function(e,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&qe(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=u[c],d=this._layers[h];if("symbol"===d.type){if(!l[d.source]){var p=this.sourceCaches[d.source];l[d.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(d,l[d.source],e.center.lng);o=o||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Fe(e,this._order,a,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,l[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);Ge.getSourceType=function(t){return R[t]},Ge.setSourceType=function(t,e){R[t]=e},Ge.registerForPluginStateChange=t.registerForPluginStateChange;var Ye=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ze=_r("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}"),Xe=_r("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ke=_r("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),Je=_r("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);}"),Qe=_r("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),tr=_r("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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;}"),er=_r("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),rr=_r("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;}}","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;}"),nr=_r("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;}","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);}"),ir=_r("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);}","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);}"),ar=_r("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=_r("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=_r("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),lr=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),cr=_r("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 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;}"),ur=_r("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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\n? a_pos\n: 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;}"),hr=_r("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),dr=_r("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),pr=_r("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),fr=_r("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),mr=_r("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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;}"),gr=_r("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);}"),yr=_r("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),vr=_r("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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));}"),xr=_r("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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);}"),br=_r("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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);}");function _r(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Ze,background:Xe,backgroundPattern:Ke,circle:Je,clippingMask:Qe,heatmap:tr,heatmapTexture:er,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:cr,fillExtrusionPattern:ur,hillshadePrepare:hr,hillshade:dr,line:pr,lineGradient:fr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:br}),kr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Tr(t){for(var e=[],r=0;r<t.length;r++)if(null!==t[r]){var n=t[r].split(" ");e.push(n.pop())}return e}kr.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var u=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||u?this.freshBind(e,r,n,i,a,o,s):(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},kr.prototype.freshBind=function(t,e,r,n,i,a,o){var s,l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=c.currentNumAttributes||0;for(var h=l;h<s;h++)u.disableVertexAttribArray(h)}e.enableAttributes(u,t);for(var d=0,p=r;d<p.length;d+=1)p[d].enableAttributes(u,t);a&&a.enableAttributes(u,t),o&&o.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,i);for(var f=0,m=r;f<m.length;f+=1){var g=m[f];g.bind(),g.setVertexAttribPointers(u,t,i)}a&&(a.bind(),a.setVertexAttribPointers(u,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,t,i)),c.currentNumAttributes=l},kr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Sr=function(t,e,r,n,i,a){var o=t.gl;this.program=o.createProgram();for(var s=Tr(r.staticAttributes),l=n?n.getBinderAttributes():[],c=s.concat(l),u=r.staticUniforms?Tr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],d=[],p=0,f=u.concat(h);p<f.length;p+=1){var m=f[p];d.indexOf(m)<0&&d.push(m)}var g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(Ze.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Ze.vertexSource,r.vertexSource).join("\n"),x=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(x,y),o.compileShader(x),o.attachShader(this.program,x);var b=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(b,v),o.compileShader(b),o.attachShader(this.program,b),this.attributes={};var _={};this.numAttributes=c.length;for(var w=0;w<this.numAttributes;w++)c[w]&&(o.bindAttribLocation(this.program,w,c[w]),this.attributes[c[w]]=w);o.linkProgram(this.program),o.deleteShader(b),o.deleteShader(x);for(var k=0;k<d.length;k++){var T=d[k];if(T&&!_[T]){var S=o.getUniformLocation(this.program,T);S&&(_[T]=S)}}this.fixedUniforms=i(t,_),this.binderUniforms=n?n.getUniforms(t,_):[]}}};function Ar(t,e,r){var n=1/ge(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Sr.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:d});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],b=0,_=u.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new kr)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,w.vertexOffset,f,m),y.drawElements(e,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Mr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Cr=function(e,r,n,i,a,o,s){return t.extend(Mr(e,r,n,i),Ar(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Er=function(t){return{u_matrix:t}},Lr=function(e,r,n,i){return t.extend(Er(e),Ar(n,r,i))},Pr=function(t,e){return{u_matrix:t,u_world:e}},Ir=function(e,r,n,i,a){return t.extend(Lr(e,r,n,i),{u_world:a})},zr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=ge(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Or=function(t,e,r){var n=ge(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Dr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Rr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},Fr=function(t){return{u_matrix:t}},Br=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ge(e,1,r),u_intensity:n}};function jr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Nr=function(e,r,n){var i=e.transform;return{u_matrix:Hr(e,r,n),u_ratio:1/ge(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Ur=function(e,r,n,i){return t.extend(Nr(e,r,n),{u_image:0,u_image_height:i})},Vr=function(e,r,n,i){var a=e.transform,o=$r(r,a);return{u_matrix:Hr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ge(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},qr=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=$r(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),d=u.width*a.fromScale,p=h.width*a.toScale;return t.extend(Nr(e,r,n),{u_patternscale_a:[l/d,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(d,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function $r(t,e){return 1/ge(t,1,e.tileZoom)}function Hr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Wr=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Gr(i.paint.get("raster-hue-rotate"))};var a,o};function Gr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Yr,Zr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Xr=function(e,r,n,i,a,o,s,l,c,u,h){var d=a.transform;return t.extend(Zr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(e,r,n,i,a,o,s,l,c,u){return t.extend(Xr(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),d=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ge(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},tn={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function en(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],d=0,p=0,f=0;f<i.length;f++){var m=i[f],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;0===a[0]&&0===a[1]||(v=e.translatePosMatrix(m.posMatrix,g,a,o));var x=s?y.textCollisionBox:y.iconCollisionBox,b=y.collisionCircleArray;if(b.length>0){var _=t.create(),w=v;t.mul(_,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(_,_,y.placementViewportMatrix),h.push({circleArray:b,circleOffset:p,transform:w,invTransform:_}),p=d+=b.length/4}x&&u.draw(l,c.LINES,At.disabled,Ct.disabled,e.colorModeForRenderPass(),Lt.disabled,Or(v,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var k=e.useProgram("collisionCircle"),T=new t.StructArrayLayout2f1f2i16;T.resize(4*d),T._trim();for(var S=0,A=0,M=h;A<M.length;A+=1)for(var C=M[A],E=0;E<C.circleArray.length/4;E++){var L=4*E,P=C.circleArray[L+0],I=C.circleArray[L+1],z=C.circleArray[L+2],O=C.circleArray[L+3];T.emplace(S++,P,I,z,O,0),T.emplace(S++,P,I,z,O,1),T.emplace(S++,P,I,z,O,2),T.emplace(S++,P,I,z,O,3)}(!Yr||Yr.length<2*d)&&(Yr=function(e){var r=2*e,n=new t.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var a=6*i;n.uint16[a+0]=4*i+0,n.uint16[a+1]=4*i+1,n.uint16[a+2]=4*i+2,n.uint16[a+3]=4*i+2,n.uint16[a+4]=4*i+3,n.uint16[a+5]=4*i+0}return n}(d));for(var D=l.createIndexBuffer(Yr,!0),R=l.createVertexBuffer(T,t.collisionCircleLayout.members,!0),F=0,B=h;F<B.length;F+=1){var j=B[F],N=Dr(j.transform,j.invTransform,e.transform);k.draw(l,c.TRIANGLES,At.disabled,Ct.disabled,e.colorModeForRenderPass(),Lt.disabled,N,n.id,R,D,t.SegmentVector.simpleSegment(0,2*j.circleOffset,j.circleArray.length,j.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),D.destroy()}}var rn=t.identity(new Float32Array(16));function nn(e,r,n,i,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,i);return new t.Point((l/a+u[0])*o,(c/a+u[1])*o)}function an(e,r,n,i,a,o,s,l,c,u,h){var d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,m={};p.clear();for(var g=0;g<d.length;g++){var y=d.get(g),v=e.allowVerticalPlacement&&!y.placedOrientation,x=y.hidden||!y.crossTileID||v?null:i[y.crossTileID];if(x){var b=new t.Point(y.anchorX,y.anchorY),_=re(b,n?l:s),w=ne(o.cameraToCenterDistance,_.signedDistanceFromCamera),k=a.evaluateSizeForFeature(e.textSizeData,u,y)*w/t.ONE_EM;n&&(k*=e.tilePixelRatio/c);for(var T=x.width,S=x.height,A=nn(x.anchor,T,S,x.textOffset,x.textBoxScale,k),M=n?re(b.add(A),s).point:_.point.add(r?A.rotate(-o.angle):A),C=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,E=0;E<y.numGlyphs;E++)t.addDynamicAttributes(p,M,C);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:M,angle:C})}else de(y.numGlyphs,p)}if(h){f.clear();for(var L=e.icon.placedSymbolArray,P=0;P<L.length;P++){var I=L.get(P);if(I.hidden)de(I.numGlyphs,f);else{var z=m[P];if(z)for(var O=0;O<I.numGlyphs;O++)t.addDynamicAttributes(f,z.shiftedAnchor,z.angle);else de(I.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function on(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function sn(e,r,n,i,a,o,s,l,c,u,h,d){for(var p=e.context,f=p.gl,m=e.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),x=g&&!y&&!v,b=void 0!==n.layout.get("symbol-sort-key").constantOr(1),_=!1,w=e.depthModeForSublayer(0,At.ReadOnly),k=n.layout.get("text-variable-anchor"),T=[],S=0,A=i;S<A.length;S+=1){var M=A[S],C=r.getTile(M),E=C.getBucket(n);if(E){var L=a?E.text:E.icon;if(L&&L.segments.get().length){var P=L.programConfigurations.get(n.id),I=a||E.sdfIcons,z=a?E.textSizeData:E.iconSizeData,O=y||0!==m.pitch,D=e.useProgram(on(I,a,E),P),R=t.evaluateSizeForZoom(z,m.zoom),F=void 0,B=[0,0],j=void 0,N=void 0,U=null,V=void 0;if(a){if(j=C.glyphAtlasTexture,N=f.LINEAR,F=C.glyphAtlasTexture.size,E.iconsInText){B=C.imageAtlasTexture.size,U=C.imageAtlasTexture;var q="composite"===z.kind||"camera"===z.kind;V=O||e.options.rotating||e.options.zooming||q?f.LINEAR:f.NEAREST}}else{var $=1!==n.layout.get("icon-size").constantOr(0)||E.iconsNeedLinear;j=C.imageAtlasTexture,N=I||e.options.rotating||e.options.zooming||$||O?f.LINEAR:f.NEAREST,F=C.imageAtlasTexture.size}var H=ge(C,1,e.transform.zoom),W=te(M.posMatrix,y,g,e.transform,H),G=ee(M.posMatrix,y,g,e.transform,H),Y=k&&E.hasTextData(),Z="none"!==n.layout.get("icon-text-fit")&&Y&&E.hasIconData();v&&ae(E,M.posMatrix,e,a,W,G,y,u);var X=e.translatePosMatrix(M.posMatrix,C,o,s),K=v||a&&k||Z?rn:W,J=e.translatePosMatrix(G,C,o,s,!0),Q=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),tt={program:D,buffers:L,uniformValues:I?E.iconsInText?Kr(z.kind,R,x,y,e,X,K,J,F,B):Xr(z.kind,R,x,y,e,X,K,J,a,F,!0):Zr(z.kind,R,x,y,e,X,K,J,a,F),atlasTexture:j,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:V,isSDF:I,hasHalo:Q};if(b&&E.canOverlap){_=!0;for(var et=0,rt=L.segments.get();et<rt.length;et+=1){var nt=rt[et];T.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:tt})}}else T.push({segments:L.segments,sortKey:0,state:tt})}}}_&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,at=T;it<at.length;it+=1){var ot=at[it],st=ot.state;if(p.activeTexture.set(f.TEXTURE0),st.atlasTexture.bind(st.atlasInterpolation,f.CLAMP_TO_EDGE),st.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),st.atlasTextureIcon&&st.atlasTextureIcon.bind(st.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),st.isSDF){var lt=st.uniformValues;st.hasHalo&&(lt.u_is_halo=1,ln(st.buffers,ot.segments,n,e,st.program,w,h,d,lt)),lt.u_is_halo=0}ln(st.buffers,ot.segments,n,e,st.program,w,h,d,st.uniformValues)}}function ln(t,e,r,n,i,a,o,s,l){var c=n.context,u=c.gl;i.draw(c,u.TRIANGLES,a,o,s,Lt.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function cn(t,e,r,n,i,a,o){var s,l,c,u,h,d=t.context.gl,p=r.paint.get("fill-pattern"),f=p&&p.constantOr(1),m=r.getCrossfadeParameters();o?(l=f&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=d.LINES):(l=f?"fillPattern":"fill",s=d.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],x=e.getTile(v);if(!f||x.patternsLoaded()){var b=x.getBucket(r);if(b){var _=b.programConfigurations.get(r.id),w=t.useProgram(l,_);f&&(t.context.activeTexture.set(d.TEXTURE0),x.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),_.updatePaintBuffers(m));var k=p.constantOr(null);if(k&&x.imageAtlas){var T=x.imageAtlas,S=T.patternPositions[k.to.toString()],A=T.patternPositions[k.from.toString()];S&&A&&_.setConstantPatternPositions(S,A)}var M=t.translatePosMatrix(v.posMatrix,x,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=b.indexBuffer2,h=b.segments2;var C=[d.drawingBufferWidth,d.drawingBufferHeight];c="fillOutlinePattern"===l&&f?Ir(M,t,m,x,C):Pr(M,C)}else u=b.indexBuffer,h=b.segments,c=f?Lr(M,t,m,x):Er(M);w.draw(t.context,s,i,t.stencilModeForClipping(v),a,Lt.disabled,c,r.id,b.layoutVertexBuffer,u,h,r.paint,t.transform.zoom,_)}}}}function un(t,e,r,n,i,a,o){for(var s=t.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=r.getCrossfadeParameters(),d=r.paint.get("fill-extrusion-opacity"),p=0,f=n;p<f.length;p+=1){var m=f[p],g=e.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),x=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var b=c.constantOr(null);if(b&&g.imageAtlas){var _=g.imageAtlas,w=_.patternPositions[b.to.toString()],k=_.patternPositions[b.from.toString()];w&&k&&v.setConstantPatternPositions(w,k)}var T=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),A=u?Cr(T,t,S,d,m,h,g):Mr(T,t,S,d);x.draw(s,s.gl.TRIANGLES,i,a,o,Lt.backCCW,A,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function hn(t,e,r,n,i,a){var o=t.context,s=o.gl,l=e.fbo;if(l){var c=t.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var u=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:jr(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}}(t,e,r);c.draw(o,s.TRIANGLES,n,i,a,Lt.disabled,u,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function dn(e,r,n,i,a,o){var s=e.context,l=s.gl,c=r.dem;if(c&&c.data){var u=c.dim,h=c.stride,d=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){var p=r.demTexture;p.update(d,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(s,d,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var f=r.fbo;if(!f){var m=new t.Texture(s,{width:u,height:u,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(f=r.fbo=s.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Lt.disabled,function(e,r){var n=r.stride,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,c),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function pn(e,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=d&&e.refreshedUponExpiration?1:t.clamp(d?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var fn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),gn=new t.Color(0,0,1,1),yn=new t.Color(1,0,1,1),vn=new t.Color(0,1,1,1);function xn(t){var e=t.transform.padding;bn(t,t.transform.height-(e.top||0),3,fn),bn(t,e.bottom||0,3,mn),_n(t,e.left||0,3,gn),_n(t,t.transform.width-(e.right||0),3,yn);var r=t.transform.centerPoint;!function(t,e,r,n){var i=20,a=2;wn(t,e-a/2,r-i/2,a,i,n),wn(t,e-i/2,r-a/2,i,a,n)}(t,r.x,t.transform.height-r.y,vn)}function bn(t,e,r,n){wn(t,0,e+r/2,t.transform.width,r,n)}function _n(t,e,r,n){wn(t,e-r/2,0,r,t.transform.height,n)}function wn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function kn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=At.disabled,c=Ct.disabled,u=e.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Lt.disabled,Rr(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var d=r.getTileByID(n.key).latestRawTileData,p=d&&d.byteLength||0,f=Math.floor(p/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+f+"kb"),s.draw(i,a.TRIANGLES,l,c,Et.alphaBlended,Lt.disabled,Rr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var Tn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Ct.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,d=e;h<d.length;h+=1){var p=d[h],f=i.getTile(p),m=f.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=m.textSizeData,y=t.evaluateSizeForZoom(g,l.zoom),v=ge(f,1,r.transform.zoom),x=te(p.posMatrix,u,c,r.transform,v),b="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var _=Math.pow(2,l.zoom-f.tileID.overscaledZ);an(m,c,u,s,t.symbolSize,l,x,p.posMatrix,_,y,b)}}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&sn(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&sn(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(en(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),en(e,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,u=c.gl,h=e.depthModeForSublayer(0,At.ReadOnly),d=Ct.disabled,p=e.colorModeForRenderPass(),f=[],m=0;m<i.length;m++){var g=i[m],y=r.getTile(g),v=y.getBucket(n);if(v){var x=v.programConfigurations.get(n.id),b={programConfiguration:x,program:e.useProgram("circle",x),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:zr(e,g,y,n)};if(l)for(var _=0,w=v.segments.get();_<w.length;_+=1){var k=w[_];f.push({segments:new t.SegmentVector([k]),sortKey:k.sortKey,state:b})}else f.push({segments:v.segments,sortKey:0,state:b})}}l&&f.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,S=f;T<S.length;T+=1){var A=S[T],M=A.state,C=M.programConfiguration,E=M.program,L=M.layoutVertexBuffer,P=M.indexBuffer,I=M.uniformValues,z=A.segments;E.draw(c,u.TRIANGLES,h,d,p,Lt.disabled,I,n.id,L,P,z,n.paint,e.transform.zoom,C)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var a=e.context,o=a.gl,s=Ct.disabled,l=new Et([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,n){var i=t.gl,a=t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,a,null),n.colorAttachment.set(r)}(t,e,a,i)}}(a,e,n),a.clear({color:t.Color.transparent});for(var c=0;c<i.length;c++){var u=i[c];if(!r.hasRenderableParent(u)){var h=r.getTile(u),d=h.getBucket(n);if(d){var p=d.programConfigurations.get(n.id),f=e.useProgram("heatmap",p),m=e.transform.zoom;f.draw(a,o.TRIANGLES,At.disabled,s,l,Lt.disabled,Br(u.posMatrix,h,m,n.paint.get("heatmap-intensity")),n.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,n.paint,e.transform.zoom,p)}}}a.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,At.disabled,Ct.disabled,e.colorModeForRenderPass(),Lt.disabled,function(e,r,n,i){var a=t.create();t.ortho(a,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}}(e,r,0,1),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1))for(var s=e.depthModeForSublayer(0,At.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),d=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",m=e.context,g=m.gl,y=!0,v=0,x=i;v<x.length;v+=1){var b=x[v],_=r.getTile(b);if(!h||_.patternsLoaded()){var w=_.getBucket(n);if(w){var k=w.programConfigurations.get(n.id),T=e.context.program.get(),S=e.useProgram(f,k),A=y||S.program!==T,M=u.constantOr(null);if(M&&_.imageAtlas){var C=_.imageAtlas,E=C.patternPositions[M.to.toString()],L=C.patternPositions[M.from.toString()];E&&L&&k.setConstantPatternPositions(E,L)}var P=h?Vr(e,_,n,p):c?qr(e,_,n,c,p):d?Ur(e,_,n,w.lineClipsArray.length):Nr(e,_,n);if(h)m.activeTexture.set(g.TEXTURE0),_.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),k.updatePaintBuffers(p);else if(c&&(A||e.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m);else if(d){var I=w.gradients[n.id],z=I.texture;if(n.gradientVersion!==I.version){var O=256;if(n.stepInterpolant){var D=r.getSource().maxzoom,R=b.canonical.z===D?Math.ceil(1<<e.transform.maxZoom-b.canonical.z):1,F=w.maxLineLength/t.EXTENT*1024*R;O=t.clamp(t.nextPowerOfTwo(F),256,m.maxTextureSize)}I.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:I.gradient||void 0,clips:w.lineClipsArray}),I.texture?I.texture.update(I.gradient):I.texture=new t.Texture(m,I.gradient,g.RGBA),I.version=n.gradientVersion,z=I.texture}m.activeTexture.set(g.TEXTURE0),z.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}S.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(b),l,Lt.disabled,P,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,e.transform.zoom,k,w.layoutVertexBuffer2),y=!1}}}}},fill:function(e,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?At.ReadWrite:At.ReadOnly);cn(e,r,n,i,u,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,At.ReadOnly);cn(e,r,n,i,h,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var a=new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))un(t,e,r,n,a,Ct.disabled,Et.disabled),un(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();un(t,e,r,n,a,Ct.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,a=t.depthModeForSublayer(0,At.ReadOnly),o=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],l=s[0],c=0,u=s[1];c<u.length;c+=1){var h=u[c],d=e.getTile(h);d.needsHillshadePrepare&&"offscreen"===t.renderPass?dn(t,d,r,a,Ct.disabled,o):"translucent"===t.renderPass&&hn(t,d,r,a,l[h.overscaledZ],o)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=o instanceof z?[{},n]:t.stencilConfigForOverlap(n),u=c[0],h=c[1],d=h[h.length-1].overscaledZ,p=!t.options.moving,f=0,m=h;f<m.length;f+=1){var g=m[f],y=t.depthModeForSublayer(g.overscaledZ-d,1===r.paint.get("raster-opacity")?At.ReadWrite:At.ReadOnly,a.LESS),v=e.getTile(g),x=t.transform.calculatePosMatrix(g.toUnwrapped(),p);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var b=e.findLoadedParent(g,0),_=pn(v,b,e,r,t.transform),w=void 0,k=void 0,T="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),b?(b.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ),k=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var S=Wr(x,k||[0,0],w||1,_,r);o instanceof z?s.draw(i,a.TRIANGLES,y,Ct.disabled,l,Lt.disabled,S,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,u[g.overscaledZ],l,Lt.disabled,S,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=t.context,o=a.gl,s=t.transform,l=s.tileSize,c=r.paint.get("background-pattern");if(!t.isPatternMissing(c)){var u=!c&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===u){var h=Ct.disabled,d=t.depthModeForSublayer(0,"opaque"===u?At.ReadWrite:At.ReadOnly),p=t.colorModeForRenderPass(),f=t.useProgram(c?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});c&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var x=v[y],b=t.transform.calculatePosMatrix(x.toUnwrapped()),_=c?Qr(b,i,t,c,{tileID:x,tileSize:l},g):Jr(b,i,n);f.draw(a,o.TRIANGLES,d,h,p,Lt.disabled,_,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)kn(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var a=i.prerender;a&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),a.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Ct.disabled);var o="3d"===i.renderingMode?new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,At.ReadOnly);n.setDepthMode(o),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},Sn=function(t,e){this.context=new Pt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=It.maxUnderzooming+It.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ve,this.gpuTimers={}};Sn.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1){var a=i[n];this.style._layers[a].resize()}},Sn.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Ye.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ye.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,I.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,Ye.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Ct({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},Sn.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,At.disabled,this.stencilClearMode,Et.disabled,Lt.disabled,Fr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Sn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Et.disabled),r.setDepthMode(At.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,At.disabled,new Ct({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Et.disabled,Lt.disabled,Fr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Sn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},Sn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Sn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+i]=new Ct({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=a,[o,n]}return[(e={},e[i]=Ct.disabled,e),n]},Sn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Et([e.CONSTANT_COLOR,e.ONE],new t.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Et.unblended:Et.alphaBlended},Sn.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return At.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new At(r||this.context.gl.LEQUAL,e,[n,n])},Sn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Sn.prototype.render=function(e,r){var n=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var i=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var l,c,u={},h={},d={};for(var p in a){var f=a[p];u[p]=f.getVisibleCoordinates(),h[p]=u[p].slice().reverse(),d[p]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++){var g=i[m];if(this.style._layers[g].is3D()){this.opaquePassCutoff=m;break}}this.renderPass="offscreen";for(var y=0,v=i;y<v.length;y+=1){var x=v[y],b=this.style._layers[x];if(b.hasOffscreenPass()&&!b.isHidden(this.transform.zoom)){var _=h[b.source];("custom"===b.type||_.length)&&this.renderLayer(this,a[b.source],b,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=a[w.source],T=u[w.source];this._renderTileClippingMasks(w,T),this.renderLayer(this,k,w,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var S=this.style._layers[i[this.currentLayer]],A=a[S.source],M=("symbol"===S.type?d:h)[S.source];this._renderTileClippingMasks(S,u[S.source]),this.renderLayer(this,A,S,M)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(c&&c.id)&&(c=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&Tn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&xn(this),this.context.setDefault()},Sn.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),Tn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},Sn.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},Sn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},Sn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},Sn.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var n=t[r],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),e[r]=a}return e},Sn.prototype.translatePosMatrix=function(e,r,n,i,a){if(!n[0]&&!n[1])return e;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var c=[a?n[0]:ge(r,n[0],this.transform.zoom),a?n[1]:ge(r,n[1],this.transform.zoom),0],u=new Float32Array(16);return t.translate(u,e,c),u},Sn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},Sn.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Sn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},Sn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Sr(this.context,t,wr[t],e,tn[t],this._showOverdrawInspector)),this.cache[r]},Sn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Sn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},Sn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},Sn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var An=function(t,e){this.points=t,this.planes=e};An.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new An(a,o)};var Mn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Mn.prototype.quadrant=function(e){for(var r=[e%2===0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a<r.length;a++)n[a]=r[a]?this.min[a]:this.center[a],i[a]=r[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new Mn(n,i)},Mn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},Mn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},Mn.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,i=0;i<e.planes.length;i++){for(var a=e.planes[i],o=0,s=0;s<r.length;s++)o+=t.dot$1(a,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var d=e.points[h][l]-this.min[l];c=Math.min(c,d),u=Math.max(u,d)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var Cn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};Cn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},Cn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},Cn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},Cn.prototype.clone=function(){return new Cn(this.top,this.bottom,this.left,this.right)},Cn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Cn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ln={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};En.prototype.clone=function(){var t=new En(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Ln.minZoom.get=function(){return this._minZoom},Ln.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ln.maxZoom.get=function(){return this._maxZoom},Ln.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ln.minPitch.get=function(){return this._minPitch},Ln.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ln.maxPitch.get=function(){return this._maxPitch},Ln.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ln.renderWorldCopies.get=function(){return this._renderWorldCopies},Ln.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ln.worldSize.get=function(){return this.tileSize*this.scale},Ln.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ln.size.get=function(){return new t.Point(this.width,this.height)},Ln.bearing.get=function(){return-this.angle/Math.PI*180},Ln.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ln.pitch.get=function(){return this._pitch/Math.PI*180},Ln.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ln.fov.get=function(){return this._fov/Math.PI*180},Ln.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Ln.zoom.get=function(){return this._zoom},Ln.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Ln.center.get=function(){return this._center},Ln.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ln.padding.get=function(){return this._edgeInsets.toJSON()},Ln.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ln.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=An.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Mn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],d=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)u.push(c(-f)),u.push(c(f));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var b=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),k=3+(1<<d-m.zoom)-2;if(m.zoom===d||w>k&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===d?p:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var T=0;T<4;T++){var S=(g<<1)+T%2,A=(y<<1)+(T>>1);u.push({aabb:m.aabb.quadrant(T),zoom:m.zoom+1,x:S,y:A,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ln.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ln.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,d=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,d)/this.worldSize,t.number(l,c,d)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-a<c.y?c.y/(o-a):0}if(this.lngRange){var d=this.lngRange;s=t.mercatorXfromLng(d[0])*this.worldSize,r=(l=t.mercatorXfromLng(d[1])*this.worldSize)-s<c.x?c.x/(l-s):0}var p=this.point,f=Math.max(r||0,e||0);if(f)return this.center=this.unproject(new t.Point(r?(l+s)/2:p.x,e?(o+a)/2:p.y)),this.zoom+=this.scaleZoom(f),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var m=p.y,g=c.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=p.x,v=c.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var d=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+f*d+m*p,y=l-Math.round(l)+f*p+m*d,v=new Float64Array(h);if(t.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s<l.length;s+=1){var c=l[s];n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}return[new t.Point(n,i),new t.Point(a,i),new t.Point(a,o),new t.Point(n,o),new t.Point(n,i)]},Object.defineProperties(En.prototype,Ln);var Pn=function(e){this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(t,e){var r=!1,n=null,i=function(){n=null,r&&(t(),n=setTimeout(i,e),r=!1)};return function(){return r=!0,n||i(),n}}(this._updateHashUnthrottled.bind(this),300)};Pn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Pn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Pn.prototype.getHashString=function(e){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(r.lng*a)/a,s=Math.round(r.lat*a)/a,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=e?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,d=!1,p=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(d=!0,e+"="+u):t})).filter((function(t){return t}));return d||p.push(h+"="+u),"#"+p.join("&")}return"#"+u},Pn.prototype._getCurrentHash=function(){var e,r=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):n.split("/")},Pn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Pn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(r){}};var In={linearity:.3,easing:t.bezier(0,0,.3,1)},zn=t.extend({deceleration:2500,maxSpeed:1400},In),On=t.extend({deceleration:20,maxSpeed:1400},In),Dn=t.extend({deceleration:1e3,maxSpeed:360},In),Rn=t.extend({deceleration:1e3,maxSpeed:90},In),Fn=function(t){this._map=t,this.clear()};function Bn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function jn(e,r,n){var i=n.maxSpeed,a=n.linearity,o=n.deceleration,s=t.clamp(e*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}Fn.prototype.clear=function(){this._inertiaBuffer=[]},Fn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Fn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Fn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var a=i[n].settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=jn(r.pan.mag(),o,t.extend({},zn,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Bn(s,l)}if(r.zoom){var c=jn(r.zoom,o,On);s.zoom=this._map.transform.zoom+c.amount,Bn(s,c)}if(r.bearing){var u=jn(r.bearing,o,Dn);s.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Bn(s,u)}if(r.pitch){var h=jn(r.pitch,o,Rn);s.pitch=this._map.transform.pitch+h.amount,Bn(s,h)}if(s.zoom||s.bearing){var d=void 0===r.pinchAround?r.around:r.pinchAround;s.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var Nn=function(e){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),Un=function(e){function n(n,i,a){var o="touchend"===n?a.changedTouches:a.touches,s=r.touchPos(i.getCanvasContainer(),o),l=s.map((function(t){return i.unproject(t)})),c=s.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),u=i.unproject(c);e.call(this,n,{points:s,point:c,lngLats:l,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),Vn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),qn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};qn.prototype.reset=function(){delete this._mousedownPos},qn.prototype.wheel=function(t){return this._firePreventable(new Vn(t.type,this._map,t))},qn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Nn(t.type,this._map,t))},qn.prototype.mouseup=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.dblclick=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},qn.prototype.mouseover=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.mouseout=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.touchstart=function(t){return this._firePreventable(new Un(t.type,this._map,t))},qn.prototype.touchmove=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchend=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchcancel=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var $n=function(t){this._map=t};$n.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},$n.prototype.mousemove=function(t){this._map.fire(new Nn(t.type,this._map,t))},$n.prototype.mousedown=function(){this._delayContextMenu=!0},$n.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},$n.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Nn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},$n.prototype.isEnabled=function(){return!0},$n.prototype.isActive=function(){return!1},$n.prototype.enable=function(){},$n.prototype.disable=function(){};var Hn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Wn(t,e){for(var r={},n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}Hn.prototype.isEnabled=function(){return!!this._enabled},Hn.prototype.isActive=function(){return!!this._active},Hn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Hn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Hn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Hn.prototype.mousemoveWindow=function(t,e){if(this._active){var n=e;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var a=Math.min(i.x,n.x),o=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+a+"px,"+s+"px)"),this._box.style.width=o-a+"px",this._box.style.height=l-s+"px"}}},Hn.prototype.mouseupWindow=function(e,n){var i=this;if(this._active&&0===e.button){var a=this._startPos,o=n;if(this.reset(),r.suppressClick(),a.x!==o.x||a.y!==o.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Hn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Hn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Hn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Gn=function(t){this.reset(),this.numTouches=t.numTouches};Gn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Gn.prototype.touchstart=function(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n<i.length;n+=1){var a=i[n];r._add(a)}return r.div(e.length)}(r),this.touches=Wn(n,r)))},Gn.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var n=Wn(r,e);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>30)&&(this.aborted=!0)}}},Gn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Yn=function(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()};Yn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Yn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Yn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Zn=function(){this._zoomIn=new Yn({numTouches:1,numTaps:2}),this._zoomOut=new Yn({numTouches:2,numTaps:1}),this.reset()};Zn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Zn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Zn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Zn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Zn.prototype.touchcancel=function(){this.reset()},Zn.prototype.enable=function(){this._enabled=!0},Zn.prototype.disable=function(){this._enabled=!1,this.reset()},Zn.prototype.isEnabled=function(){return this._enabled},Zn.prototype.isActive=function(){return this._active};var Xn={0:1,2:2},Kn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Kn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Kn.prototype._correctButton=function(t,e){return!1},Kn.prototype._move=function(t,e){return{}},Kn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Kn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Xn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},Kn.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},Kn.prototype.enable=function(){this._enabled=!0},Kn.prototype.disable=function(){this._enabled=!1,this.reset()},Kn.prototype.isEnabled=function(){return this._enabled},Kn.prototype.isActive=function(){return this._active};var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Kn),Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Kn),ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Kn),ei=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};ei.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},ei.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},ei.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},ei.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},ei.prototype.touchcancel=function(){this.reset()},ei.prototype._calculateTransform=function(e,r,n){n.length>0&&(this._active=!0);var i=Wn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(s<this._minTouches)&&o.mag()){var h=o.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:h}}},ei.prototype.enable=function(){this._enabled=!0},ei.prototype.disable=function(){this._enabled=!1,this.reset()},ei.prototype.isEnabled=function(){return this._enabled},ei.prototype.isActive=function(){return this._active};var ri=function(){this.reset()};function ni(t,e,r){for(var n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function ii(t,e){return Math.log(t/e)/Math.LN2}ri.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},ri.prototype._start=function(t){},ri.prototype._move=function(t,e,r){return{}},ri.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},ri.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,i=n[0],a=n[1],o=ni(r,e,i),s=ni(r,e,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,t)}}},ri.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=ni(n,e,a),l=ni(n,e,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},ri.prototype.touchcancel=function(){this.reset()},ri.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},ri.prototype.disable=function(){this._enabled=!1,this.reset()},ri.prototype.isEnabled=function(){return this._enabled},ri.prototype.isActive=function(){return this._active};var ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(ii(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ii(this._distance,r),pinchAround:e}},e}(ri);function oi(t,e){return 180*t.angleWith(e)/Math.PI}var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:oi(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=oi(t,this._startVector);return Math.abs(r)<e},e}(ri);function li(t){return Math.abs(t.y)>Math.abs(t.x)}var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,li(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0===e.y>0;return li(t)&&li(e)&&a}},e}(ri),ui={panStep:100,bearingStep:15,pitchStep:10},hi=function(){var t=ui;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function di(t){return t*(2-t)}hi.prototype.reset=function(){this._active=!1},hi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:di,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active},hi.prototype.disableRotation=function(){this._rotationDisabled=!0},hi.prototype.enableRotation=function(){this._rotationDisabled=!1};var pi=4.000244140625,fi=1/450,mi=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fi,t.bindAll(["_onTimeout"],this)};mi.prototype.setZoomRate=function(t){this._defaultZoomRate=t},mi.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},mi.prototype.isEnabled=function(){return!!this._enabled},mi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mi.prototype.isZooming=function(){return!!this._zooming},mi.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},mi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mi.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%pi===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},mi.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},mi.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mi.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),d=c(h);o=t.number(l,s,d),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mi.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},mi.prototype.reset=function(){this._active=!1};var gi=function(t,e){this._clickZoom=t,this._tapZoom=e};gi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},gi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},gi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},gi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var yi=function(){this.reset()};yi.prototype.reset=function(){this._active=!1},yi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Yn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},vi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},vi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var xi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};xi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var bi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};bi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},bi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},bi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},bi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Si=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;a<o.length;a+=1){var s=o[a],l=s[0],c=s[1],u=s[2];r.addEventListener(l,c,l===t.window.document?this.handleWindowEvent:this.handleEvent,u)}};Si.prototype.destroy=function(){for(var e=0,n=this._listeners;e<n.length;e+=1){var i=n[e],a=i[0],o=i[1],s=i[2];r.removeEventListener(a,o,a===t.window.document?this.handleWindowEvent:this.handleEvent,s)}},Si.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new qn(e,t));var n=e.boxZoom=new Hn(e,t);this._add("boxZoom",n);var i=new Zn,a=new yi;e.doubleClickZoom=new gi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new vi;this._add("tapDragZoom",o);var s=e.touchPitch=new ci;this._add("touchPitch",s);var l=new Qn(t),c=new ti(t);e.dragRotate=new bi(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Jn(t),h=new ei(t);e.dragPan=new xi(r,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var d=new si,p=new ai;e.touchZoomRotate=new _i(r,p,d,o),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var f=e.scrollZoom=new mi(e,this);this._add("scrollZoom",f,["mousePan"]);var m=e.keyboard=new hi;this._add("keyboard",m),this._add("blockableMapEvent",new $n(e));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];t.interactive&&t[v]&&e[v].enable(t[v])}},Si.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},Si.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},Si.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},Si.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Si.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Si.prototype.isMoving=function(){return Boolean(wi(this._eventsInProgress))||this.isZooming()},Si.prototype._blockedByActive=function(t,e,r){for(var n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1},Si.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},Si.prototype._getMapTouches=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.target;this._el.contains(a)&&e.push(i)}return e},Si.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var n="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},a={},o={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],d=h.handlerName,p=h.handler,f=h.allowed;if(p.isEnabled()){var m=void 0;this._blockedByActive(o,f,d)?p.reset():p[e||t.type]&&(m=p[e||t.type](t,l,s),this.mergeHandlerResult(i,a,m,d,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||p.isActive())&&(o[d]=p)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||Ti(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||Ti(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))}else this.stop(!0)},Si.prototype.mergeHandlerResult=function(e,r,n,i,a){if(n){t.extend(e,n);var o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},Si.prototype._applyChanges=function(){for(var e={},r={},n={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=o[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(n,c)}this._updateMapTransform(e,r,n),this._changes=[]},Si.prototype._updateMapTransform=function(t,e,r){var n=this._map,i=n.transform;if(!Ti(t))return this._fireEvents(e,r,!0);var a=t.panDelta,o=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,c=t.around,u=t.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var h=i.pointLocation(a?c.sub(a):c);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(h,c),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},Si.prototype._fireEvents=function(e,r,n){var i=this,a=wi(this._eventsInProgress),o=wi(e),s={};for(var l in e){var c=e[l].originalEvent;this._eventsInProgress[l]||(s[l+"start"]=c),this._eventsInProgress[l]=e[l]}for(var u in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(u,s[u]);for(var h in o&&this._fireEvent("move",o.originalEvent),e){var d=e[h].originalEvent;this._fireEvent(h,d)}var p,f={};for(var m in this._eventsInProgress){var g=this._eventsInProgress[m],y=g.handlerName,v=g.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],p=r[y]||v,f[m+"end"]=p)}for(var x in f)this._fireEvent(x,f[x]);var b=wi(this._eventsInProgress);if(n&&(a||o)&&!b){this._updatingCamera=!0;var _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};_?(w(_.bearing||this._map.getBearing())&&(_.bearing=0),this._map.easeTo(_,{originalEvent:p})):(this._map.fire(new t.Event("moveend",{originalEvent:p})),w(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Si.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Si.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new ki("renderFrame",{timeStamp:e})),t._applyChanges()}))},Si.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Ai=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var n=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){var a={top:0,bottom:0,right:0,left:0};if("number"===typeof(i=t.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}i.padding=t.extend(a,i.padding);var s=this.transform,l=s.padding,c=s.project(t.LngLat.convert(e)),u=s.project(t.LngLat.convert(r)),h=c.rotate(-n*Math.PI/180),d=u.rotate(-n*Math.PI/180),p=new t.Point(Math.max(h.x,d.x),Math.max(h.y,d.y)),f=new t.Point(Math.min(h.x,d.x),Math.min(h.y,d.y)),m=p.sub(f),g=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),i.maxZoom),x="number"===typeof i.offset.x?new t.Point(i.offset.x,i.offset.y):t.Point.convert(i.offset),b=(i.padding.left-i.padding.right)/2,_=(i.padding.top-i.padding.bottom)/2,w=new t.Point(b,_).rotate(n*Math.PI/180),k=x.add(w).mult(s.scale/s.zoomScale(v));return{center:s.unproject(c.add(u).div(2).sub(k)),zoom:v,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(e,r,n){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,h="pitch"in e?+e.pitch:s,d="padding"in e?e.padding:i.padding,p=t.Point.convert(e.offset),f=i.centerPoint.add(p),m=i.pointLocation(f),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);var y,v,x=i.project(m),b=i.project(g).sub(x),_=i.zoomScale(c-a);e.around&&(y=t.LngLat.convert(e.around),v=i.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==a,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(d),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),this._ease((function(e){if(n._zooming&&(i.zoom=t.number(a,c,e)),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,h,e)),n._padding&&(i.interpolatePadding(l,d,e),f=i.centerPoint.add(p)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-a),g=c>a?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-e),k=i.unproject(x.add(b.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?k.wrap():k,f)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,d="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,f=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var x=a.project(y),b=a.project(v).sub(x),_=e.curve,w=Math.max(a.width,a.height),k=w/f,T=b.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),A=w/a.zoomScale(S-o);_=Math.sqrt(A/T*2)}var M=_*_;function C(t){var e=(k*k-w*w+(t?-1:1)*M*M*T*T)/(2*(t?k:w)*M*T);return Math.log(Math.sqrt(e*e+1)-e)}function E(t){return(Math.exp(t)-Math.exp(-t))/2}function L(t){return(Math.exp(t)+Math.exp(-t))/2}var P=C(0),I=function(t){return L(P)/L(P+_*t)},z=function(t){return w*((L(P)*(E(e=P+_*t)/L(e))-E(P))/M)/T;var e},O=(C(1)-P)/_;if(Math.abs(T)<1e-6||!isFinite(O)){if(Math.abs(w-k)<1e-6)return this.easeTo(e,r);var D=k<w?-1:1;O=Math.abs(Math.log(k/w))/_,z=function(){return 0},I=function(t){return Math.exp(D*_*t)}}if("duration"in e)e.duration=+e.duration;else{var R="screenSpeed"in e?+e.screenSpeed/_:+e.speed;e.duration=1e3*O/R}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=d!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*O,f=1/I(i);a.zoom=1===e?u:o+a.scaleZoom(f),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,d,e)),n._padding&&(a.interpolatePadding(c,p,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(x.add(b.mult(z(i))).mult(f));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),Mi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mi.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Mi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Mi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},Mi.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Mi.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!==typeof t?"":t}))):"string"===typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t.sort((function(t,e){return t.length-e.length}));var o=(t=t.filter((function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ci=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Ci.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ci.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ci.prototype.getDefaultPosition=function(){return"bottom-left"},Ci.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ci.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Ci.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Ei=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ei.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ei.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},Ei.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=e;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ei.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Li={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Pi=t.window.HTMLImageElement,Ii=t.window.HTMLElement,zi=t.window.ImageBitmap,Oi=60,Di={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:Oi,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ri=function(n){function i(e){var r=this;if(null!=(e=t.extend({},Di,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>Oi)throw new Error("maxPitch must be less than or equal to 60");var i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Ei,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Li,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"===typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,e);var a="string"===typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Pn(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Mi({customAttribution:e.customAttribution})),this.addControl(new Ci,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null===t||void 0===t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null===t||void 0===t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null===t||void 0===t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null===t||void 0===t?Oi:t)>Oi)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Nn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Nn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Nn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o<a.length;o++){var s=a[o];if(s.layer===e&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"===typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),a=t.Point.convert(e[1]);n=[i,new t.Point(a.x,i.y),a,new t.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Ge(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"===typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ge(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,r){var n=this;if("string"===typeof e){var i=this._requestManager.normalizeStyleURL(e),a=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(a,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))}else"object"===typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;void 0===a&&(a=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof Pi||zi&&r instanceof zi){var c=t.browser.getImageData(r),u=c.width,h=c.height,d=c.data;this.style.addImage(e,{data:new t.RGBAImage({width:u,height:h},d),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var p=r.width,f=r.height,m=r.data,g=r;this.style.addImage(e,{data:new t.RGBAImage({width:p,height:f},new Uint8Array(m)),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:g}),g.onAdd&&g.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof Pi||zi&&r instanceof zi?t.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;if(void 0===a||void 0===o)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==n.data.width||o!==n.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof Pi||zi&&r instanceof zi);n.data.replace(s,l),this.style.updateImage(e,n)},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){a[t]=r.create("div","mapboxgl-ctrl-"+t,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(e,r){var n=t.browser.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new Sn(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(e){var r,n=this,i=0,a=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var c=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(o=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-i;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),n.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var d=this.painter.collectGpuTimers();setTimeout((function(){var e=n.painter.queryGpuTimers(d);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!==typeof t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext&&n.loseContext(),Fi(this._canvasContainer),Fi(this._controlContainer),Fi(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},a.version.get=function(){return t.version},Object.defineProperties(i.prototype,a),i}(Ai);function Fi(t){t.parentNode&&t.parentNode.removeChild(t)}var Bi={showCompass:!0,showZoom:!0,visualizePitch:!1},ji=function(e){var n=this;this.options=t.extend({},Bi,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return n._map.zoomIn({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return n._map.zoomOut({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};ji.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},ji.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},ji.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ni(this._map,this._compass,this.options.visualizePitch)),this._container},ji.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},ji.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},ji.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Ni=function(e,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Qn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new ti({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function Ui(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ni.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ni.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ni.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ni.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ni.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ni.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ni.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ni.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Ni.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Vi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function qi(t,e,r){var n=t.classList;for(var i in Vi)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var $i,Hi=function(e){function n(n,i){if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<u.length;c+=1){var h=u[c],d=r.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",h.rx),d.setAttributeNS(null,"ry",h.ry),l.appendChild(d)}var p=r.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var f=r.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(f);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(g);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),v.appendChild(x),v.appendChild(b),s.appendChild(l),s.appendChild(p),s.appendChild(m),s.appendChild(y),s.appendChild(v),a.appendChild(s),a.setAttributeNS(null,"height",41*this._scale+"px"),a.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(a),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),qi(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=13.5,r=Math.sqrt(Math.pow(e,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[e,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Ui(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,Vi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gi=0,Yi=!1,Zi=function(e){function n(r){e.call(this),this.options=t.extend({},Wi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==$i?n($i):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){$i="denied"!==t.state,n($i)})):($i=!!t.window.navigator.geolocation,n($i)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gi=0,Yi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Yi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Hi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Hi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gi--,Yi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Gi>1?(e={maximumAge:6e5,timeout:0},Yi=!0):(e=this.options.positionOptions,Yi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Xi={maxWidth:100,unit:"metric"},Ki=function(e){this.options=t.extend({},Xi,e),t.bindAll(["_onMove","setUnit"],this)};function Ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Qi(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Qi(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Qi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Qi(t,e,r,n){var i=function(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r),a=i/r;t.style.width=e*a+"px",t.innerHTML=i+"&nbsp;"+n}Ki.prototype.getDefaultPosition=function(){return"bottom-left"},Ki.prototype._onMove=function(){Ji(this._map,this._container,this.options)},Ki.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ki.prototype.setUnit=function(t){this.options.unit=t,Ji(this._map,this._container,this.options)};var ta=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};ta.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ta.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ta.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ta.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ta.prototype._isFullscreen=function(){return this._fullscreen},ta.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ta.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ea={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ra=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(ea),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ui(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=ia(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.y<c?["top"]:i.y>this._map.transform.height-c?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Vi[a]+" translate("+u.x+"px,"+u.y+"px)"),qi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ra);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ia(e){if(e){if("number"===typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return ia(new t.Point(0,0))}var aa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ri,NavigationControl:ji,GeolocateControl:Zi,AttributionControl:Mi,ScaleControl:Ki,FullscreenControl:ta,Popup:na,Marker:Hi,Style:Ge,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(Rt)},clearPrewarmedResources:function(){var t=Bt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Bt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return aa})),r},"object"===typeof t&&"undefined"!==typeof e?e.exports=n():(r=r||self).mapboxgl=n()}}),wb=d({"src/plots/mapbox/layers.js"(t,e){var r=se(),n=Ae().sanitizeHTML,i=mb(),a=cb();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n<e.length;n++)if("string"!==typeof e[n]||0===e[n].length)return!1;return!0}return r.isPlainObject(e)||"string"===typeof e&&e.length>0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"===typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r<e.length;r++){var n=e[r].id;if("string"===typeof n&&0===n.indexOf(a.traceLayerPrefix)){t=n;break}}return t},s.updateLayer=function(t){var e=this.subplot,r=c(t),n=this.lookupBelow(),i=this.findFollowingMapboxLayerId(n);this.removeLayer(),l(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=t.type,this.below=n},s.updateStyle=function(t){if(l(t)){var e=c(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}}}),kb=d({"src/plots/mapbox/mapbox.js"(t,e){var r=_b(),n=se(),i=og(),a=Vt(),o=nr(),s=hr(),l=zr(),c=Or(),u=c.drawMode,h=c.selectMode,d=Mn().prepSelect,p=Mn().clearOutline,f=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=cb(),y=wb();function v(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash={},i.layerList=[]),n=i.map?new Promise((function(r,n){i.updateMap(t,e,r,n)})):new Promise((function(r,n){i.createMap(t,e,r,n)})),r.push(n)},x.createMap=function(t,e,n,a){var o=this,s=e[o.id],l=o.styleObj=_(s.style,e);o.accessToken=s.accesstoken;var c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:k(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0}));h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(t,e);var d=[];d.push(new Promise((function(t){h.once("load",t)}))),d=d.concat(i.fetchTraceGeoData(t)),Promise.all(d).then((function(){o.fillBelowLookup(t,e),o.updateData(t),o.updateLayout(e),o.resolveOnRender(n)})).catch(a)},x.updateMap=function(t,e,r,n){var a=this,o=a.map,s=e[this.id];a.rejectOnError(n);var l=[],c=_(s.style,e);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(t){o.once("styledata",t)})))),l=l.concat(i.fetchTraceGeoData(t)),Promise.all(l).then((function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"===typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"===typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,d={};for(u in a)d[n=a[u]]?d[n].push(u):d[n]=[u];for(n in d){var p=d[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var b={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function _(t,e){var r={};if(n.isPlainObject(t))r.id=t.id,r.style=t;else if("string"===typeof t)if(r.id=t,-1!==g.styleValuesMapbox.indexOf(t))r.style=w(t);else if(g.stylesNonMapbox[t]){r.style=g.stylesNonMapbox[t];var i=r.style.sources["plotly-"+t],a=i?i.tiles:void 0;a&&a[0]&&"?api_key="===a[0].slice(-9)&&(a[0]+=e._mapboxAccessToken)}else r.style=t;else r.id=g.styleValueDflt,r.style=w(g.styleValueDflt);return r.transition={duration:0,delay:0},r}function w(t){return g.styleUrlPrefix+t+"-"+g.styleUrlSuffix}function k(t){return[t.lon,t.lat]}x.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort((function(t,e){return b[t[0].trace.type]-b[e[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);t:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<t.length;i++)if(u===(r=t[i][0].trace).uid)continue t;(e=a[u]).dispose(),delete a[u]}},x.updateLayout=function(t){var e=this.map,r=t[this.id];this.dragging||this.wheeling||(e.setCenter(k(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.mapbox?e.scrollZoom.enable():e.scrollZoom.disable()},x.resolveOnRender=function(t){var e=this.map;e.on("render",(function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))}))},x.rejectOnError=function(t){var e=this.map;function r(){t(new Error(g.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},x.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(e.mockAxis,t)},x.initFx=function(t,e){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(e._hoverlayer)}function s(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}i.on("moveend",(function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];a.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e._rehover&&e._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(t){var e=r.div.getBoundingClientRect(),a=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,t,r.id)},l.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var t=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;i.setCenter(k(e.center)),i.setZoom(e.zoom),i.setBearing(e.bearing),i.setPitch(e.pitch);var o=r.getView();t._input.center=t.center=o.center,t._input.zoom=t.zoom=o.zoom,t._input.bearing=t.bearing=o.bearing,t._input.pitch=t.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){f(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(t){return function(e){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(y(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(t,e){var r=this.map;if("string"===typeof e){if(""===e)return void r.addLayer(t,e);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(e===i[a].id)return void r.addLayer(t,e);n.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},x.project=function(t){return this.map.project(new r.LngLat(t[0],t[1]))},x.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},x.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},x.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=v}}),Tb=d({"src/plots/mapbox/layout_defaults.js"(t,e){var r=se(),n=qs(),i=Be(),a=ub();function o(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var a=r("bounds.west"),o=r("bounds.east"),l=r("bounds.south"),c=r("bounds.north");void 0!==a&&void 0!==o&&void 0!==l&&void 0!==c||delete e.bounds,i(t,e,{name:"layers",handleItemDefaults:s}),e._input=t}function s(t,e){function n(n,i){return r.coerce(t,e,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=e.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}e.exports=function(t,e,r){n(t,e,r,{type:"mapbox",attributes:a,handleDefaults:o,partition:"y",accessToken:e._mapboxAccessToken})}}}),Sb=d({"src/plots/mapbox/index.js"(t){var e=_b(),r=se(),n=r.strTranslate,i=r.strScale,a=_e().getSubplotCalcData,o=Te(),s=v(),l=Je(),c=Ae(),u=kb(),h="mapbox",d=t.constants=cb();t.name=h,t.attr="subplot",t.idRoot=h,t.idRegex=t.attrRegex=r.counterRegex(h);var p=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");t.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},t.layoutAttributes=ub(),t.supplyLayoutDefaults=Tb();var f=!0;function m(t){return"string"===typeof t&&(-1!==d.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://")||0===t.indexOf("stamen"))}t.plot=function(t){f&&(f=!1,r.warn(p));var n=t._fullLayout,i=t.calcdata,o=n._subplots[h];if(e.version!==d.requiredVersion)throw new Error(d.wrongVersionErrorMsg);var s=function(t,e){var n=t._fullLayout,i=t._context;if(""===i.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,c=0;c<e.length;c++){var u=n[e[c]],h=u.accesstoken;m(u.style)&&(h?r.pushUnique(a,h):(m(u._input.style)&&(r.error("Uses Mapbox map style, but did not set an access token."),s=!0),l=!0)),h&&r.pushUnique(o,h)}if(l){var p=s?d.noAccessTokenErrorMsg:d.missingStyleErrorMsg;throw r.error(p),new Error(p)}return a.length?(a.length>1&&r.warn(d.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);e.accessToken=s;for(var l=0;l<o.length;l++){var c=o[l],g=a(i,h,c),y=n[c],v=y._subplot;v||(v=new u(t,c),n[c]._subplot=v),v.viewInitial||(v.viewInitial={center:r.extendFlat({},y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),v.plot(g,n,t._promises)}},t.clean=function(t,e,r,n){for(var i=n._subplots[h]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},t.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots[h],a=e._size,u=0;u<r.length;u++){var p=e[r[u]],f=p.domain,m=p._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":m,x:a.l+a.w*f.x[0],y:a.t+a.h*(1-f.y[1]),width:a.w*(f.x[1]-f.x[0]),height:a.h*(f.y[1]-f.y[0]),preserveAspectRatio:"none"});var g=s.select(p._subplot.div);if(null!==g.select(".mapboxgl-ctrl-logo").node().offsetParent){var y=e._glimages.append("g");y.attr("transform",n(a.l+a.w*f.x[0]+10,a.t+a.h*(1-f.y[0])-31)),y.append("path").attr("d",d.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),y.append("path").attr("d",d.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),y.append("path").attr("d",d.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),y.append("polygon").attr("points",d.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var v=g.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),x=e._glimages.append("g"),b=x.append("text");b.text(v).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":v});var _=l.bBox(b.node()),w=a.w*(f.x[1]-f.x[0]);if(_.width>w/2){var k=v.split("|").join("<br>");b.text(k).attr("data-unformatted",k).call(c.convertToTspans,t),_=l.bBox(b.node())}b.attr("transform",n(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>w&&(T=w/(_.width+6));var S=[a.l+a.w*f.x[1],a.t+a.h*(1-f.y[0])];x.attr("transform",n(S[0],S[1])+i(T))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[h],n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}}}),Ab=d({"src/traces/scattermapbox/index.js"(t,e){["*scattermapbox* trace is deprecated!","Please consider switching to the *scattermap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:hb(),supplyDefaults:pb(),colorbar:di(),formatLabels:fb(),calc:Zm(),plot:yb(),hoverPoints:vb().hoverPoints,eventData:xb(),selectPoints:bb(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:Sb(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Mb=d({"lib/scattermapbox.js"(t,e){e.exports=Ab()}}),Cb=d({"src/traces/choroplethmapbox/attributes.js"(t,e){var r=wg(),n=Pe(),i=Ot().hovertemplateAttrs,a=N(),o=D().extendFlat;e.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),Eb=d({"src/traces/choroplethmapbox/defaults.js"(t,e){var r=se(),n=Ve(),i=Cb();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"===typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),e._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(t,e,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}}}),Lb=d({"src/traces/choroplethmapbox/convert.js"(t,e){var r=k(),n=se(),i=We(),a=Je(),o=Qm().makeBlank,s=og();function l(t){var e,r=t[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":e}),n.extendFlat(i.line.paint,{"line-opacity":e}),i}e.exports={convert:function(t){var e=t[0].trace,a=!0===e.visible&&0!==e._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=e._opts={fill:c,line:u,geojson:o()};if(!a)return h;var d=s.extractTraceFeature(t);if(!d)return h;var p,f,m,g=i.makeColorScaleFuncFromTrace(e),y=e.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(t){var e=t.mo;return r(e)?+n.constrain(e,0,1):0}),n.isArrayOrTypedArray(v.color)&&(f=function(t){return t.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var x=0;x<t.length;x++){var b=t[x],_=b.fOut;if(_){var w=_.properties;w.fc=g(b.z),p&&(w.mo=p(b)),f&&(w.mlc=f(b)),m&&(w.mlw=m(b)),b.ct=w.ct,b._polygons=s.feature2polygons(_)}}var k=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),n.extendFlat(u.paint,{"line-color":f?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:d},l(t),h},convertOnSelect:l}}}),Pb=d({"src/traces/choroplethmapbox/plot.js"(t,e){var r=Lb().convert,n=Lb().convertOnSelect,i=cb().traceLayerPrefix;function a(t,e){this.type="choroplethmapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",i+e+"-fill"],["line",i+e+"-line"]],this.below=null}var o=a.prototype;o.update=function(t){this._update(r(t)),t[0].trace._glTrace=this},o.updateOnSelect=function(t){this._update(n(t))},o._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),Ib=d({"src/traces/choroplethmapbox/index.js"(t,e){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:Cb(),supplyDefaults:Eb(),colorbar:No(),calc:Tg(),plot:Pb(),hoverPoints:Mg(),eventData:Cg(),selectPoints:Eg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"===typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:Sb(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}}),zb=d({"lib/choroplethmapbox.js"(t,e){e.exports=Ib()}}),Ob=d({"src/traces/densitymapbox/attributes.js"(t,e){var r=Pe(),n=Ot().hovertemplateAttrs,i=N(),a=hb(),o=D().extendFlat;e.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),Db=d({"src/traces/densitymapbox/defaults.js"(t,e){var r=se(),n=Ve(),i=Ob();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}}),Rb=d({"src/traces/densitymapbox/calc.js"(t,e){var r=k(),n=se().isArrayOrTypedArray,i=T().BADNUM,a=He(),o=se()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),c=e.z,u=n(c)&&c.length,h=0;h<s;h++){var d=l[h]={},p=e.lon[h],f=e.lat[h];if(d.lonlat=r(p)&&r(f)?[+p,+f]:[i,i],u){var m=c[h];d.z=r(m)?m:i}}return a(t,e,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}}),Fb=d({"src/traces/densitymapbox/convert.js"(t,e){var r=k(),n=se(),i=q(),a=We(),o=T().BADNUM,s=Qm().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,c=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],d=e.z,p=e.radius,f=n.isArrayOrTypedArray(d)&&d.length,m=n.isArrayOrTypedArray(p);for(u=0;u<t.length;u++){var g=t[u],y=g.lonlat;if(y[0]!==o){var v={};if(f){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[u])&&p[u]>0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(e),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),Bb=d({"src/traces/densitymapbox/plot.js"(t,e){var r=Fb(),n=cb().traceLayerPrefix;function i(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",n+e+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(t){var e=this.subplot,n=this.layerList,i=r(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];e.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&e.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},a._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),jb=d({"src/traces/densitymapbox/hover.js"(t,e){var r=nr(),n=vb().hoverPoints,i=vb().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),Nb=d({"src/traces/densitymapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),Ub=d({"src/traces/densitymapbox/index.js"(t,e){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:Ob(),supplyDefaults:Db(),colorbar:No(),formatLabels:fb(),calc:Rb(),plot:Bb(),hoverPoints:jb(),eventData:Nb(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"===typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:Sb(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}}),Vb=d({"lib/densitymapbox.js"(t,e){e.exports=Ub()}}),qb=d({"src/plots/map/styles/arcgis-sat-hybrid.js"(t,e){e.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),$b=d({"src/plots/map/styles/arcgis-sat.js"(t,e){e.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),Hb=d({"src/plots/map/constants.js"(t,e){var r=Wt(),n=qb(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:$b(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'\xa9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);e.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),Wb=d({"src/plots/map/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=ka().attributes,a=R(),o=wn().textposition,s=Pt().overrideAll,l=ge().templatedArray,c=Hb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),Gb=d({"src/traces/scattermap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=Wb(),l=N(),c=Pe(),u=D().extendFlat,h=Pt().overrideAll,d=Wb(),p=a.line,f=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},d.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),Yb=d({"src/traces/scattermap/constants.js"(t,e){var 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 Extrabold Italic","Open Sans Extrabold","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"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),Zb=d({"src/traces/scattermap/defaults.js"(t,e){var r=se(),n=Ge(),i=Wn(),a=Gn(),o=Zn(),s=Xn(),l=Gb(),c=Yb().isSupportedFont;e.exports=function(t,e,u,h){function d(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var f=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,d);if(f){if(d("text"),d("texttemplate"),d("hovertext"),d("hovertemplate"),d("mode"),d("below"),n.hasMarkers(e)){i(t,e,u,h,d,{noLine:!0,noAngle:!0}),d("marker.allowoverlap"),d("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,d,{noDash:!0}),d("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),b=p("cluster.opacity");if(d("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(e)){var _=h.font.family;o(t,e,h,d,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}d("fill"),"none"!==e.fill&&s(t,e,u,d),r.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}}}),Xb=d({"src/traces/scattermap/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),Kb=d({"src/plots/map/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),Jb=d({"src/traces/scattermap/convert.js"(t,e){var r=k(),n=se(),i=T().BADNUM,a=Qm(),o=We(),s=Je(),l=Ye(),c=Ge(),u=Yb().isSupportedFont,h=Kb(),d=Ze().appendArrayPointValue,p=Ae().NEWLINES,f=Ae().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i<t.length;i++)r.push(e[i-1],t[i])}else r=t;return r}function b(t){var e=t.textfont,r=e.family,n=e.style,i=e.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,C=u.cluster&&u.cluster.enabled,E=m("fill"),L=m("line"),P=m("circle"),I=m("symbol"),z={fill:E,line:L,circle:P,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(e)),w&&(E.geojson=a.makePolygon(i),E.layout.visibility="visible",n.extendFlat(E.paint,{"fill-color":u.fillcolor})),k&&(L.geojson=a.makeLine(i),L.layout.visibility="visible",n.extendFlat(L.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,d=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,b=[];for(e=0;e<t.length;e++){var _=t[e],w=_.lonlat;if(!v(w)){var k={};i&&(k.mcc=_.mcc=i(_.mc)),a&&(k.mrc=_.mrc=a(_.ms)),c&&(k.mo=c(_.mo)),d&&(k.selected=_.selected||0),b.push({type:"Feature",id:e+1,geometry:{type:"Point",coordinates:w},properties:k})}}if(d)for(x=s.makeSelectedPointStyleFns(u),e=0;e<b.length;e++){var T=b[e].properties;x.selectedOpacityFn&&(T.mo=g(x.selectedOpacityFn(T))),x.selectedColorFn&&(T.mcc=x.selectedColorFn(T)),x.selectedSizeFn&&(T.mrc=x.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:b},mcc:p||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:f||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(e);P.geojson=O.geojson,P.layout.visibility="visible",C&&(P.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":b(u),"text-size":12}}),n.extendFlat(P.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(A&&C&&(P.filter=["!",["has","point_count"]]),(M||S)&&(I.geojson=function(t,e){for(var r=e._fullLayout,i=t[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<t.length;x++){var b=t[x];if(!v(b.lonlat)){var _,w=i.texttemplate;if(w){var k=Array.isArray(w)?w[x]||"":w,T=i._module.formatLabels(b,i,r),S={};d(S,i,b.i);var A=i._meta||{};_=n.texttemplateString(k,T,r._d3locale,S,b,A)}else _=h(x);_&&(_=_.replace(p,"").replace(f,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:b.lonlat},properties:{symbol:l(x),angle:u(x),text:_}})}}return{type:"FeatureCollection",features:m}}(e,t),n.extendFlat(I.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),M&&(n.extendFlat(I.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(I.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),I.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(I.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),S)){var D=(u.marker||{}).size,R=h(u.textposition,D);n.extendFlat(I.layout,{"text-size":u.textfont.size,"text-anchor":R.anchor,"text-offset":R.offset,"text-font":b(u)}),n.extendFlat(I.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),Qb=d({"src/traces/scattermap/plot.js"(t,e){var r=se(),n=Jb(),i=Hb().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(t,e,r,n){this.type="scattermap",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(t,e,n){var i={type:"geojson",data:e.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[t]);a?a.setData(e.geojson):this.subplot.map.addSource(this.sourceIds[t],i)},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter);for(var i,a=this.layerIds[t],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(t){var e=t[0].trace,r=this.subplot,i=r.map,o=n(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(t){c?function(t){for(var e=a.cluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function d(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(t):function(t){for(var e=a.nonCluster,r=0;r<e.length;r++){var n=e[r],i=o[n];t||u.addSource(n,i),u.addLayer(n,i,s)}}(t)}function p(){for(var t=l?a.cluster:a.nonCluster,e=0;e<t.length;e++){var n=t[e],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}var f=this.isHidden,m=!0!==e.visible;m?f||h():f?m||d():c!==l?(h(),d()):this.below!==s?(h(!0),d(!0),p()):p(),this.clusterEnabled=l,this.isHidden=m,this.below=s,t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=this.clusterEnabled?a.cluster:a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),d=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",d.circle,l.cluster),r=0;r<a.cluster.length;r++)s=d[i=a.cluster[r]],h.addLayer(i,s,p);else for(r=0;r<a.nonCluster.length;r++)s=d[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,p);return e[0].trace._glTrace=h,h}}}),t_=d({"src/traces/scattermap/hover.js"(t,e){var r=zr(),n=se(),i=mi(),a=n.fillText,o=T().BADNUM,s=Hb().traceLayerPrefix;function l(t,e,r){if(!t.hovertemplate){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(e,t,c),c.join("<br>")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,d=t.ya,p=t.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===f.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-d.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var b=c[t.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=d.c2p(w),S=b.mrc||1;t.x0=k-S,t.x1=k+S,t.y0=T-S,t.y1=T+S;var A={};A[u.subplot]={_subplot:p};var M=u._module.formatLabels(b,u,A);return t.lonLabel=M.lonLabel,t.latLabel=M.latLabel,t.color=i(u,b),t.extraText=l(u,b,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),e_=d({"src/traces/scattermap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),r_=d({"src/traces/scattermap/select.js"(t,e){var r=se(),n=Ge(),i=T().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],d=h.lonlat;if(d[0]!==i){var p=[r.modHalf(d[0],360),d[1]],f=[s.c2p(p),l.c2p(p)];e.contains(f,null,a,t)?(c.push({pointNumber:a,lon:d[0],lat:d[1]}),h.selected=1):h.selected=0}}return c}}}),n_=d({"node_modules/maplibre-gl/dist/maplibre-gl.js"(t,e){var n,a;n=t,a=function(){var t={},e={};function n(r,n,i){if(e[r]=i,"index"===r){var a="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",o={};return e.shared(o),e.index(t,o),"undefined"!==typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),t}}return n("shared",0,(function(t){function e(t,e,r,n){return new(r||(r=Promise))((function(i,a){function o(t){try{l(n.next(t))}catch(e){a(e)}}function s(t){try{l(n.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,s)}l((n=n.apply(t,e||[])).next())}))}function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError;var a=s;function s(t,e){this.x=t,this.y=e}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(t){return t instanceof s?t:Array.isArray(t)?new s(t[0],t[1]):t};var h=n(a),d=p;function p(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}p.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var f=n(d);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let n=0;n<t*t;n++){const r=4*n;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(n%t,Math.floor(n/t),1,1)}const r=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&r[e]!==e){g=!0;break}}}return g||!1}function x(t,e,r,n){const i=new f(t,e,r,n);return t=>i.solve(t)}const b=x(.25,.1,.25,1);function _(t,e,r){return Math.min(r,Math.max(e,t))}function w(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function k(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(const i of r)for(const e in i)t[e]=i[e];return t}let T=1;function S(t,e,r){const n={};for(const i in t)n[i]=e.call(this,t[i],i,t);return n}function A(t,e,r){const n={};for(const i in t)e.call(this,t[i],i,t)&&(n[i]=t[i]);return n}function M(t){return Array.isArray(t)?t.map(M):"object"==typeof t&&t?S(t,M):t}const C={};function E(t){C[t]||("undefined"!=typeof console&&console.warn(t),C[t]=!0)}function L(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function P(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let I=null;function z(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function D(t,r,n,i,a){return e(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const o=null==e?void 0:e.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield e.copyTo(l,function(t,e,r,n,i){const a=4*Math.max(-e,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,e),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-c},layout:[{offset:o,stride:s}]}}(t,r,n,i,a)),s)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}}))}let R,F;const B="AbortError";function j(){return new Error(B)}const N={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function U(t){return N.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const V="global-dispatcher";class q extends Error{constructor(t,e,r,n){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=n}}const $=()=>P(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,H=function(t,r){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=U(t.url);if(e)return e(t,r);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:V},r)}if(!(/^file:/.test(n=t.url)||/^file:/.test($())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,r){return e(this,void 0,void 0,(function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:$(),signal:r.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");const n=yield fetch(e);if(!n.ok){const e=yield n.blob();throw new q(n.status,n.statusText,t.url,e)}let i;i="arrayBuffer"===t.type||"image"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text();const a=yield i;if(r.signal.aborted)throw j();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(t,r);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=t,a=r,new Promise(((t,e)=>{var r;const n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(const a in i.headers)n.setRequestHeader(a,i.headers[a]);"json"===i.type&&(n.responseType="text",(null===(r=i.headers)||void 0===r?void 0:r.Accept)||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let a=n.response;if("json"===i.type)try{a=JSON.parse(n.response)}catch(r){return void e(r)}t({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{const t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new q(n.status,n.statusText,i.url,t))}},a.signal.addEventListener("abort",(()=>{n.abort(),e(j())})),n.send(i.body)}))};function W(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function G(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Y(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}class Z{constructor(t){k(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=t}}class X extends Z{constructor(t){super("error",k({error:t},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class K{on(t,e){return this._listeners=this._listeners||{},G(t,e,this._listeners),this}off(t,e){return Y(t,e,this._listeners),Y(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},G(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new Z(t,e||{}));const r=t.type;if(this.listens(r)){t.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of e)r.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const a of n)Y(r,a,this._oneTimeListeners),a.call(this,t);const i=this._eventedParent;i&&(k(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t))}else t instanceof X&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var J={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tt(t,e){const r={};for(const n in t)"ref"!==n&&(r[n]=t[n]);return Q.forEach((t=>{t in e&&(r[t]=e[t])})),r}function et(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!et(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(!et(t[r],e[r]))return!1;return!0}return t===e}function rt(t,e){t.push(e)}function nt(t,e,r){rt(r,{command:"addSource",args:[t,e[t]]})}function it(t,e,r){rt(e,{command:"removeSource",args:[t]}),r[t]=!0}function at(t,e,r,n){it(t,r,n),nt(t,e,r)}function ot(t,e,r){let n;for(n in t[r])if(Object.prototype.hasOwnProperty.call(t[r],n)&&"data"!==n&&!et(t[r][n],e[r][n]))return!1;for(n in e[r])if(Object.prototype.hasOwnProperty.call(e[r],n)&&"data"!==n&&!et(t[r][n],e[r][n]))return!1;return!0}function st(t,e,r,n,i,a){t=t||{},e=e||{};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(et(t[o],e[o])||r.push({command:a,args:[n,o,e[o],i]}));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&!Object.prototype.hasOwnProperty.call(t,o)&&(et(t[o],e[o])||r.push({command:a,args:[n,o,e[o],i]}))}function lt(t){return t.id}function ct(t,e){return t[e.id]=e,t}class ut{constructor(t,e,r,n){this.message=(t?`${t}: `:"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}function ht(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(const i of r)for(const e in i)t[e]=i[e];return t}class dt extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class pt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.parent=t,this.bindings={};for(const[r,n]of e)this.bindings[r]=n}concat(t){return new pt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const ft={kind:"null"},mt={kind:"number"},gt={kind:"string"},yt={kind:"boolean"},vt={kind:"color"},xt={kind:"object"},bt={kind:"value"},_t={kind:"collator"},wt={kind:"formatted"},kt={kind:"padding"},Tt={kind:"resolvedImage"},St={kind:"variableAnchorOffsetCollection"};function At(t,e){return{kind:"array",itemType:t,N:e}}function Mt(t){if("array"===t.kind){const e=Mt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Ct=[ft,mt,gt,yt,vt,wt,xt,At(bt),kt,Tt,St];function Et(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Et(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of Ct)if(!Et(t,e))return null}return`Expected ${Mt(t)} but found ${Mt(e)} instead.`}function Lt(t,e){return e.some((e=>e.kind===t.kind))}function Pt(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function It(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const zt=.96422,Ot=.82521,Dt=4/29,Rt=6/29,Ft=3*Rt*Rt,Bt=Rt*Rt*Rt,jt=Math.PI/180,Nt=180/Math.PI;function Ut(t){return(t%=360)<0&&(t+=360),t}function Vt(t){let e,r,[n,i,a,o]=t;const s=$t((.2225045*(n=qt(n))+.7168786*(i=qt(i))+.0606169*(a=qt(a)))/1);n===i&&i===a?e=r=s:(e=$t((.4360747*n+.3850649*i+.1430804*a)/zt),r=$t((.0139322*n+.0971045*i+.7141733*a)/Ot));const l=116*s-16;return[l<0?0:l,500*(e-s),200*(s-r),o]}function qt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $t(t){return t>Bt?Math.pow(t,1/3):t/Ft+Dt}function Ht(t){let[e,r,n,i]=t,a=(e+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(n)?a:a-n/200;return a=1*Gt(a),o=zt*Gt(o),s=Ot*Gt(s),[Wt(3.1338561*o-1.6168667*a-.4906146*s),Wt(-.9787684*o+1.9161415*a+.033454*s),Wt(.0719453*o-.2289914*a+1.4052427*s),i]}function Wt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Gt(t){return t>Rt?t*t*t:Ft*(t-Dt)}function Yt(t){return parseInt(t.padEnd(2,t),16)/255}function Zt(t,e){return Xt(e?t/100:t,0,1)}function Xt(t,e,r){return Math.min(Math.max(e,t),r)}function Kt(t){return!t.some(Number.isNaN)}const Jt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Qt{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=t,this.g=e,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,e,r,n]))}static parse(t){if(t instanceof Qt)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=Jt[t];if(e){const[t,r,n]=e;return[t/255,r/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let r=1;return[Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,r,n,i,a,o,s,l,c,u,h,d]=e,p=[i||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[n,o,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[Xt(+r/e,0,1),Xt(+a/e,0,1),Xt(+l/e,0,1),h?Zt(+h,d):1];if(Kt(t))return t}}return}}const r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[t,e,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const t=[+e,Xt(+i,0,100),Xt(+o,0,100),l?Zt(+l,c):1];if(Kt(t))return function(t){let[e,r,n,i]=t;function a(t){const i=(t+e/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return e=Ut(e),r/=100,n/=100,[a(0),a(8),a(4),i]}(t)}}}(t);return e?new Qt(...e,!1):void 0}get rgb(){const{r:t,g:e,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[t/i,e/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,r,n,i]=Vt(t),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ut(Math.atan2(n,r)*Nt):NaN,a,e,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,r,n]=this.rgb;return`rgba(${[t,e,r].map((t=>Math.round(255*t))).join(",")},${n})`}}Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);class te{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ee{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i}}class re{constructor(t){this.sections=t}static fromString(t){return new re([new ee(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof re?t:re.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class ne{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ne)return t;if("number"==typeof t)return new ne([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new ne(t)}}toString(){return JSON.stringify(this.values)}}const ie=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ae{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ae)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const r=t[e],n=t[e+1];if("string"!=typeof r||!ie.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new ae(t)}}toString(){return JSON.stringify(this.values)}}class oe{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new oe({name:t,available:!1}):null}}function se(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Qt||t instanceof te||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe)return!0;if(Array.isArray(t)){for(const e of t)if(!le(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!le(t[e]))return!1;return!0}return!1}function ce(t){if(null===t)return ft;if("string"==typeof t)return gt;if("boolean"==typeof t)return yt;if("number"==typeof t)return mt;if(t instanceof Qt)return vt;if(t instanceof te)return _t;if(t instanceof re)return wt;if(t instanceof ne)return kt;if(t instanceof ae)return St;if(t instanceof oe)return Tt;if(Array.isArray(t)){const e=t.length;let r;for(const n of t){const t=ce(n);if(r){if(r===t)continue;r=bt;break}r=t}return At(r||bt,e)}return xt}function ue(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe?t.toString():JSON.stringify(t)}class he{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!le(t[1]))return e.error("invalid value");const r=t[1];let n=ce(r);const i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new he(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class de{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const pe={string:gt,number:mt,boolean:yt,object:xt};class fe{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,a;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in pe)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[r],n++}else i=bt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=At(i,a)}else{if(!pe[i])throw new Error(`Types doesn't contain name = ${i}`);r=pe[i]}const a=[];for(;n<t.length;n++){const r=e.parse(t[n],n,bt);if(!r)return null;a.push(r)}return new fe(r,a)}evaluate(t){for(let e=0;e<this.args.length;e++){const r=this.args[e].evaluate(t);if(!Et(this.type,ce(r)))return r;if(e===this.args.length-1)throw new de(`Expected value to be of type ${Mt(this.type)}, but found ${Mt(ce(r))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const me={"to-boolean":yt,"to-color":vt,"to-number":mt,"to-string":gt};class ge{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(!me[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const n=me[r],i=[];for(let a=1;a<t.length;a++){const r=e.parse(t[a],a,bt);if(!r)return null;i.push(r)}return new ge(n,i)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,r;for(const n of this.args){if(e=n.evaluate(t),r=null,e instanceof Qt)return e;if("string"==typeof e){const r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&(r=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:se(e[0],e[1],e[2],e[3]),!r))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new de(r||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const r of this.args){e=r.evaluate(t);const n=ne.parse(e);if(n)return n}throw new de(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const r of this.args){e=r.evaluate(t);const n=ae.parse(e);if(n)return n}throw new de(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new de(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return re.fromString(ue(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ue(this.args[0].evaluate(t)));default:return ue(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const ye=["Unknown","Point","LineString","Polygon"];class ve{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ye[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e}}class xe{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new pt,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=t,this.path=r,this.key=r.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=e}parse(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return"assert"===r?new fe(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const a=this.registry[i];if(a){let i=a.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==t.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert")}if(!(i instanceof he)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){const t=new ve;try{i=new he(i.type,i.evaluate(t))}catch(n){return this.error(n.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xe(this.registry,this._isConstant,n,e||null,i,this.errors)}error(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];const i=`${this.key}${r.map((t=>`[${t}]`)).join("")}`;this.errors.push(new dt(i,t))}checkSubtype(t,e){const r=Et(t,e);return r&&this.error(r),r}}class be{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let i=1;i<t.length-1;i+=2){const n=t[i];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);const a=e.parse(t[i+1],i+1);if(!a)return null;r.push([n,a])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return n?new be(r,n):null}outputDefined(){return this.result.outputDefined()}}class _e{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new _e(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class we{constructor(t,e,r){this.type=t,this.index=e,this.input=r}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,mt),n=e.parse(t[2],2,At(e.expectedType||bt));return r&&n?new we(n.type.itemType,r,n):null}evaluate(t){const e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new de(`Array index out of bounds: ${e} < 0.`);if(e>=r.length)throw new de(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new de(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ke{constructor(t,e){this.type=yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,bt),n=e.parse(t[2],2,bt);return r&&n?Lt(r.type,[yt,gt,mt,ft,bt])?new ke(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mt(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Pt(e,["boolean","string","number","null"]))throw new de(`Expected first argument to be of type boolean, string, number or null, but found ${Mt(ce(e))} instead.`);if(!Pt(r,["string","array"]))throw new de(`Expected second argument to be of type array or string, but found ${Mt(ce(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Te{constructor(t,e,r){this.type=mt,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,bt),n=e.parse(t[2],2,bt);if(!r||!n)return null;if(!Lt(r.type,[yt,gt,mt,ft,bt]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Mt(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new Te(r,n,i):null}return new Te(r,n)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Pt(e,["boolean","string","number","null"]))throw new de(`Expected first argument to be of type boolean, string, number or null, but found ${Mt(ce(e))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),Pt(r,["string"])){const t=r.indexOf(e,n);return-1===t?-1:[...r.slice(0,t)].length}if(Pt(r,["array"]))return r.indexOf(e,n);throw new de(`Expected second argument to be of type array or string, but found ${Mt(ce(r))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Se{constructor(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i={},a=[];for(let l=2;l<t.length-1;l+=2){let o=t[l];const s=t[l+1];Array.isArray(o)||(o=[o]);const c=e.concat(l);if(0===o.length)return c.error("Expected at least one branch label.");for(const t of o){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ce(t)))return null}else r=ce(t);if(void 0!==i[String(t)])return c.error("Branch labels must be unique.");i[String(t)]=a.length}const u=e.parse(s,l,n);if(!u)return null;n=n||u.type,a.push(u)}const o=e.parse(t[1],1,bt);if(!o)return null;const s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Se(r,n,o,i,a,s):null}evaluate(t){const e=this.input.evaluate(t);return(ce(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class Ae{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n=[];for(let a=1;a<t.length-1;a+=2){const i=e.parse(t[a],a,yt);if(!i)return null;const o=e.parse(t[a+1],a+1,r);if(!o)return null;n.push([i,o]),r=r||o.type}const i=e.parse(t[t.length-1],t.length-1,r);if(!i)return null;if(!r)throw new Error("Can't infer output type");return new Ae(r,n,i)}evaluate(t){for(const[e,r]of this.branches)if(e.evaluate(t))return r.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,r]of this.branches)t(e),t(r);t(this.otherwise)}outputDefined(){return this.branches.every((t=>{let[e,r]=t;return r.outputDefined()}))&&this.otherwise.outputDefined()}}class Me{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,bt),n=e.parse(t[2],2,mt);if(!r||!n)return null;if(!Lt(r.type,[At(bt),gt,bt]))return e.error(`Expected first argument to be of type array or string, but found ${Mt(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new Me(r.type,r,n,i):null}return new Me(r.type,r,n)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);let n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),Pt(e,["string"]))return[...e].slice(r,n).join("");if(Pt(e,["array"]))return e.slice(r,n);throw new de(`Expected first argument to be of type array or string, but found ${Mt(ce(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ce(t,e){const r=t.length-1;let n,i,a=0,o=r,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),n=t[s],i=t[s+1],n<=e){if(s===r||e<i)return s;a=s+1}else{if(!(n>e))throw new de("Input is not a number.");o=s-1}return 0}class Ee{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,i]of r)this.labels.push(n),this.outputs.push(i)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let a=1;a<t.length;a+=2){const r=1===a?-1/0:t[a],o=t[a+1],s=a,l=a+1;if("number"!=typeof r)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=r)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([r,c])}return new Ee(i,r,n)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ce(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}var Le=Pe;function Pe(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Pe.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Ie,ze=(Ie=Le)&&Ie.__esModule&&Object.prototype.hasOwnProperty.call(Ie,"default")?Ie.default:Ie;function Oe(t,e,r){return t+r*(e-t)}function De(t,e,r){return t.map(((t,n)=>Oe(t,e[n],r)))}const Re={number:Oe,color:function(t,e,r){switch(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb"){case"rgb":{const[n,i,a,o]=De(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{const[n,i,a,o]=t.hcl,[s,l,c,u]=e.hcl;let h,d;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?h=NaN:(h=s,1!==a&&0!==a||(d=l)):(h=n,1!==c&&0!==c||(d=i));else{let t=s-n;s>n&&t>180?t-=360:s<n&&n-s>180&&(t+=360),h=n+r*t}const[p,f,m,g]=function(t){let[e,r,n,i]=t;return e=isNaN(e)?0:e*jt,Ht([n,Math.cos(e)*r,Math.sin(e)*r,i])}([h,null!=d?d:Oe(i,l,r),Oe(a,c,r),Oe(o,u,r)]);return new Qt(p,f,m,g,!1)}case"lab":{const[n,i,a,o]=Ht(De(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:De,padding:function(t,e,r){return new ne(De(t.values,e.values,r))},variableAnchorOffsetCollection:function(t,e,r){const n=t.values,i=e.values;if(n.length!==i.length)throw new de(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const a=[];for(let o=0;o<n.length;o+=2){if(n[o]!==i[o])throw new de(`Cannot interpolate values containing mismatched anchors. from[${o}]: ${n[o]}, to[${o}]: ${i[o]}`);a.push(n[o]);const[t,e]=n[o+1],[s,l]=i[o+1];a.push([Oe(t,s,r),Oe(e,l,r)])}return new ae(a)}};class Fe{constructor(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[a,o]of i)this.labels.push(a),this.outputs.push(o)}static interpolationFactor(t,e,r,n){let i=0;if("exponential"===t.name)i=Be(e,t.base,r,n);else if("linear"===t.name)i=Be(e,1,r,n);else if("cubic-bezier"===t.name){const a=t.controlPoints;i=new ze(a[0],a[1],a[2],a[3]).solve(Be(e,1,r,n))}return i}static parse(t,e){let[r,n,i,...a]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,mt),!i)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=vt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<a.length;l+=2){const t=a[l],r=a[l+1],n=l+3,i=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(r,i,s);if(!c)return null;s=s||c.type,o.push([t,c])}return It(s,mt)||It(s,vt)||It(s,kt)||It(s,St)||It(s,At(mt))?new Fe(s,r,n,i,o):e.error(`Type ${Mt(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);const a=Ce(e,n),o=Fe.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](s,l,o);case"interpolate-hcl":return Re.color(s,l,o,"hcl");case"interpolate-lab":return Re.color(s,l,o,"lab")}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Be(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}class je{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null;const n=e.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const o of t.slice(1)){const t=e.parse(o,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t)}if(!r)throw new Error("No output type");const a=n&&i.some((t=>Et(n,t.type)));return new je(a?bt:r,i)}evaluate(t){let e,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof oe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ne(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ue(t,e,r,n){return 0===n.compare(e,r)}function Ve(t,e,r){const n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let a=e.parse(t[1],1,bt);if(!a)return null;if(!Ne(r,a.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${Mt(a.type)}'.`);let o=e.parse(t[2],2,bt);if(!o)return null;if(!Ne(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${Mt(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${Mt(a.type)}' and '${Mt(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new fe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new fe(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,_t),!s)return null}return new i(a,o,s)}evaluate(i){const a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const e=ce(a),r=ce(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new de(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ce(a),r=ce(o);if("string"!==t.kind||"string"!==r.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const qe=Ve("==",(function(t,e,r){return e===r}),Ue),$e=Ve("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ue(0,e,r,n)})),He=Ve("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),We=Ve(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Ge=Ve("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ye=Ve(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class Ze{constructor(t,e,r){this.type=_t,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,yt);if(!n)return null;const i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,yt);if(!i)return null;let a=null;return r.locale&&(a=e.parse(r.locale,1,gt),!a)?null:new Ze(n,i,a)}evaluate(t){return new te(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Xe{constructor(t,e,r,n,i){this.type=gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,gt),!i))return null;let a=null;if(n.currency&&(a=e.parse(n.currency,1,gt),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parse(n["min-fraction-digits"],1,mt),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,mt),!s)?null:new Xe(r,i,a,o,s)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ke{constructor(t){this.type=wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let a=1;a<=t.length-1;++a){const r=t[a];if(i&&"object"==typeof r&&!Array.isArray(r)){i=!1;let t=null;if(r["font-scale"]&&(t=e.parse(r["font-scale"],1,mt),!t))return null;let a=null;if(r["text-font"]&&(a=e.parse(r["text-font"],1,At(gt)),!a))return null;let o=null;if(r["text-color"]&&(o=e.parse(r["text-color"],1,vt),!o))return null;const s=n[n.length-1];s.scale=t,s.font=a,s.textColor=o}else{const r=e.parse(t[a],1,bt);if(!r)return null;const o=r.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:r,scale:null,font:null,textColor:null})}}return new Ke(n)}evaluate(t){return new re(this.sections.map((e=>{const r=e.content.evaluate(t);return ce(r)===Tt?new ee("",r,null,null,null):new ee(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Je{constructor(t){this.type=Tt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,gt);return r?new Je(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=oe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}}class Qe{constructor(t){this.type=mt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${Mt(r.type)} instead.`):new Qe(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new de(`Expected value to be of type string or array, but found ${Mt(ce(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const tr=8192;function er(t,e){const r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*tr),Math.round(n*i*tr)]}function rr(t,e){const r=Math.pow(2,e.z);return[(i=(t[0]/tr+e.x)/r,360*i-180),(n=(t[1]/tr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ar(t,e,r){const n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(t,e,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*a[0]&&!(!dr(t,e,r,n)||!dr(r,n,t,e));var i,a}function sr(t,e,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(or(t,e,n[r],n[r+1]))return!0;return!1}function lr(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;for(const s of e)for(let e=0;e<s.length-1;e++){if(ar(t,s[e],s[e+1]))return r;(a=s[e])[1]>(i=t)[1]!=(o=s[e+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(t,e){for(const r of e)if(lr(t,r))return!0;return!1}function ur(t,e){for(const r of t)if(!lr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(sr(t[r],t[r+1],e))return!1;return!0}function hr(t,e){for(const r of e)if(ur(t,r))return!0;return!1}function dr(t,e,r,n){const i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function pr(t,e,r){const n=[];for(let i=0;i<t.length;i++){const a=[];for(let n=0;n<t[i].length;n++){const o=er(t[i][n],r);nr(e,o),a.push(o)}n.push(a)}return n}function fr(t,e,r){const n=[];for(let i=0;i<t.length;i++){const a=pr(t[i],e,r);n.push(a)}return n}function mr(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){const e=.5*n;let i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i}nr(e,t)}function gr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const s of t)for(const t of s){const n=[t.x+a[0],t.y+a[1]];mr(n,e,r,i),o.push(n)}return o}function yr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const l of t){const t=[];for(const r of l){const n=[r.x+a[0],r.y+a[1]];nr(e,n),t.push(n)}o.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of o)for(const n of t)mr(n,e,r,i)}var s;return o}class vr{constructor(t,e){this.type=yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const r of e.features){const{type:e,coordinates:n}=r.geometry;"Polygon"===e&&t.push(n),"MultiPolygon"===e&&t.push(...n)}if(t.length)return new vr(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vr(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!lr(t,a))return!1}if("MultiPolygon"===e.type){const a=fr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!cr(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!ur(t,a))return!1}if("MultiPolygon"===e.type){const a=fr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!hr(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t<e?-1:t>e?1:0;if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1);const a=n+1;if(a<this.length&&r(e[a],e[n])<0&&(n=a),r(e[n],i)>=0)break;e[t]=e[n],t=n}e[t]=i}};function br(t,e,r,n,i){_r(t,e,r,n||t.length-1,i||kr)}function _r(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);_r(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,d=n;for(wr(t,r,e),i(t[n],u)>0&&wr(t,r,n);h<d;){for(wr(t,h,d),h++,d--;i(t[h],u)<0;)h++;for(;i(t[d],u)>0;)d--}0===i(t[r],u)?wr(t,r,d):wr(t,++d,n),d<=e&&(r=d+1),e<=d&&(n=d-1)}}function wr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function kr(t,e){return t<e?-1:t>e?1:0}function Tr(t,e){if(t.length<=1)return[t];const r=[];let n,i;for(const a of t){const t=Ar(a);0!==t&&(a.area=Math.abs(t),void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[a]):n.push(a))}if(n&&r.push(n),e>1)for(let a=0;a<r.length;a++)r[a].length<=e||(br(r[a],e,1,r[a].length-1,Sr),r[a]=r[a].slice(0,e));return r}function Sr(t,e){return e.area-t.area}function Ar(t){let e=0;for(let r,n,i=0,a=t.length,o=a-1;i<a;o=i++)r=t[i],n=t[o],e+=(n.x-r.x)*(r.y+n.y);return e}const Mr=1/298.257223563,Cr=Mr*(2-Mr),Er=Math.PI/180;class Lr{constructor(t){const e=6378.137*Er*1e3,r=Math.cos(t*Er),n=1/(1-Cr*(1-r*r)),i=Math.sqrt(n);this.kx=e*i*r,this.ky=e*i*n*(1-Cr)}distance(t,e){const r=this.wrap(t[0]-e[0])*this.kx,n=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(t,e){let r,n,i,a,o=1/0;for(let s=0;s<t.length-1;s++){let l=t[s][0],c=t[s][1],u=this.wrap(t[s+1][0]-l)*this.kx,h=(t[s+1][1]-c)*this.ky,d=0;0===u&&0===h||(d=(this.wrap(e[0]-l)*this.kx*u+(e[1]-c)*this.ky*h)/(u*u+h*h),d>1?(l=t[s+1][0],c=t[s+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const p=u*u+h*h;p<o&&(o=p,r=l,n=c,i=s,a=d)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,a))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Pr(t,e){return e[0]-t[0]}function Ir(t){return t[1]-t[0]+1}function zr(t,e){return t[1]>=t[0]&&t[1]<e}function Or(t,e){if(t[0]>t[1])return[null,null];const r=Ir(t);if(e){if(2===r)return[t,null];const e=Math.floor(r/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===r)return[t,null];const n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Dr(t,e){if(!zr(e,t.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)nr(r,t[n]);return r}function Rr(t){const e=[1/0,1/0,-1/0,-1/0];for(const r of t)for(const t of r)nr(e,t);return e}function Fr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Br(t,e,r){if(!Fr(t)||!Fr(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function jr(t,e,r){const n=r.pointOnLine(e,t);return r.distance(t,n.point)}function Nr(t,e,r,n,i){const a=Math.min(jr(t,[r,n],i),jr(e,[r,n],i)),o=Math.min(jr(r,[t,e],i),jr(n,[t,e],i));return Math.min(a,o)}function Ur(t,e,r,n,i){if(!zr(e,t.length)||!zr(n,r.length))return 1/0;let a=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],s=t[o+1];for(let t=n[0];t<n[1];++t){const n=r[t],o=r[t+1];if(or(e,s,n,o))return 0;a=Math.min(a,Nr(e,s,n,o,i))}}return a}function Vr(t,e,r,n,i){if(!zr(e,t.length)||!zr(n,r.length))return NaN;let a=1/0;for(let o=e[0];o<=e[1];++o)for(let e=n[0];e<=n[1];++e)if(a=Math.min(a,i.distance(t[o],r[e])),0===a)return a;return a}function qr(t,e,r){if(lr(t,e,!0))return 0;let n=1/0;for(const i of e){const e=i[0],a=i[i.length-1];if(e!==a&&(n=Math.min(n,jr(t,[a,e],r)),0===n))return n;const o=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,o.point)),0===n)return n}return n}function $r(t,e,r,n){if(!zr(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(lr(t[a],r,!0))return 0;let i=1/0;for(let a=e[0];a<e[1];++a){const e=t[a],o=t[a+1];for(const t of r)for(let r=0,a=t.length,s=a-1;r<a;s=r++){const a=t[s],l=t[r];if(or(e,o,a,l))return 0;i=Math.min(i,Nr(e,o,a,l,n))}}return i}function Hr(t,e){for(const r of t)for(const t of r)if(lr(t,e,!0))return!0;return!1}function Wr(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;const i=Rr(t),a=Rr(e);if(n!==1/0&&Br(i,a,r)>=n)return n;if(ir(i,a)){if(Hr(t,e))return 0}else if(Hr(e,t))return 0;let o=1/0;for(const s of t)for(let t=0,n=s.length,i=n-1;t<n;i=t++){const n=s[i],a=s[t];for(const t of e)for(let e=0,i=t.length,s=i-1;e<i;s=e++){const i=t[s],l=t[e];if(or(n,a,i,l))return 0;o=Math.min(o,Nr(n,a,i,l,r))}}return o}function Gr(t,e,r,n,i,a){if(!a)return;const o=Br(Dr(n,a),i,r);o<e&&t.push([o,a,[0,0]])}function Yr(t,e,r,n,i,a,o){if(!a||!o)return;const s=Br(Dr(n,a),Dr(i,o),r);s<e&&t.push([s,a,o])}function Zr(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=Math.min(n.distance(t[0],r[0][0]),i);if(0===a)return a;const o=new xr([[0,[0,t.length-1],[0,0]]],Pr),s=Rr(r);for(;o.length>0;){const i=o.pop();if(i[0]>=a)continue;const l=i[1],c=e?50:100;if(Ir(l)<=c){if(!zr(l,t.length))return NaN;if(e){const e=$r(t,l,r,n);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){const i=qr(t[e],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Or(l,e);Gr(o,a,n,t,s,r[0]),Gr(o,a,n,t,s,r[1])}}return a}function Xr(t,e,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,o=Math.min(a,i.distance(t[0],r[0]));if(0===o)return o;const s=new xr([[0,[0,t.length-1],[0,r.length-1]]],Pr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],u=e?50:100,h=n?50:100;if(Ir(l)<=u&&Ir(c)<=h){if(!zr(l,t.length)&&zr(c,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,c,i),o=Math.min(o,a);else if(e&&!n){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=jr(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){const e=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,c,i),o=Math.min(o,a)}else{const a=Or(l,e),u=Or(c,n);Yr(s,o,i,t,r,a[0],u[0]),Yr(s,o,i,t,r,a[0],u[1]),Yr(s,o,i,t,r,a[1],u[0]),Yr(s,o,i,t,r,a[1],u[1])}}return o}function Kr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Jr{constructor(t,e){this.type=mt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Jr(e,e.features.map((t=>Kr(t.geometry))).flat());if("Feature"===e.type)return new Jr(e,Kr(e.geometry));if("type"in e&&"coordinates"in e)return new Jr(e,Kr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Lr(n[0][1]);let a=1/0;for(const o of e){switch(o.type){case"Point":a=Math.min(a,Xr(n,!1,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Xr(n,!1,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Zr(n,!1,o.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Lr(n[0][1]);let a=1/0;for(const o of e){switch(o.type){case"Point":a=Math.min(a,Xr(n,!0,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Xr(n,!0,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Zr(n,!0,o.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const r=t.geometry();if(0===r.length||0===r[0].length)return NaN;const n=Tr(r,0).map((e=>e.map((e=>e.map((e=>rr([e.x,e.y],t.canonical))))))),i=new Lr(n[0][0][0][1]);let a=1/0;for(const o of e)for(const t of n){switch(o.type){case"Point":a=Math.min(a,Zr([o.coordinates],!1,t,i,a));break;case"LineString":a=Math.min(a,Zr(o.coordinates,!0,t,i,a));break;case"Polygon":a=Math.min(a,Wr(t,o.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Qr={"==":qe,"!=":$e,">":We,"<":He,">=":Ye,"<=":Ge,array:fe,at:we,boolean:fe,case:Ae,coalesce:je,collator:Ze,format:Ke,image:Je,in:ke,"index-of":Te,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:be,literal:he,match:Se,number:fe,"number-format":Xe,object:fe,slice:Me,step:Ee,string:fe,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:_e,within:vr,distance:Jr};class tn{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const r=t[0],n=tn.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((e=>{let[r]=e;return!Array.isArray(r)||r.length===t.length-1}));let s=null;for(const[l,c]of o){s=new xe(e.registry,on,e.path,null,e.scope);const n=[];let a=!1;for(let e=1;e<t.length;e++){const r=t[e],i=Array.isArray(l)?l[e-1]:l.type,o=s.parse(r,1+n.length,i);if(!o){a=!0;break}n.push(o)}if(!a)if(Array.isArray(l)&&l.length!==n.length)s.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,r=n[t];s.concat(t+1).checkSubtype(e,r.type)}if(0===s.errors.length)return new tn(r,i,c,n)}}if(1===o.length)e.errors.push(...s.errors);else{const r=(o.length?o:a).map((t=>{let[e]=t;return r=e,Array.isArray(r)?`(${r.map(Mt).join(", ")})`:`(${Mt(r.type)}...)`;var r})).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(Mt(r.type))}e.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){tn.definitions=e;for(const r in e)t[r]=tn}}function en(t,e){let[r,n,i,a]=e;r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);const o=a?a.evaluate(t):1,s=se(r,n,i,o);if(s)throw new de(s);return new Qt(r/255,n/255,i/255,o,!1)}function rn(t,e){return t in e}function nn(t,e){const r=e[t];return void 0===r?null:r}function an(t){return{type:t}}function on(t){if(t instanceof _e)return on(t.boundExpression);if(t instanceof tn&&"error"===t.name)return!1;if(t instanceof Ze)return!1;if(t instanceof vr)return!1;if(t instanceof Jr)return!1;const e=t instanceof ge||t instanceof fe;let r=!0;return t.eachChild((t=>{r=e?r&&on(t):r&&t instanceof he})),!!r&&sn(t)&&cn(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(t){if(t instanceof tn){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof vr)return!1;if(t instanceof Jr)return!1;let e=!0;return t.eachChild((t=>{e&&!sn(t)&&(e=!1)})),e}function ln(t){if(t instanceof tn&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!ln(t)&&(e=!1)})),e}function cn(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!cn(t,e)&&(r=!1)})),r}function un(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function dn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function fn(t){return!!t.expression&&t.expression.interpolated}function mn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function yn(t){return t}function vn(t,e){const r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),a=t.type||(fn(e)?"exponential":"interval");if(r||"padding"===e.type){const n=r?Qt.parse:ne.parse;(t=ht({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],n(t[1])]))),t.default=n(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=_n;else if("categorical"===a){s=bn,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=kn}if(n){const r={},n=[];for(let e=0;e<t.stops.length;e++){const i=t.stops[e],a=i[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},n.push(a)),r[a].stops.push([i[0].value,i[1]])}const i=[];for(const t of n)i.push([r[t].zoom,vn(r[t],e)]);const a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:Fe.interpolationFactor.bind(void 0,a),zoomStops:i.map((t=>t[0])),evaluate:(r,n)=>{let{zoom:a}=r;return wn({stops:i,base:t.base},e,a).evaluate(a,n)}}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Fe.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:r=>{let{zoom:n}=r;return s(t,e,n,l,c)}}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?xn(t.default,e.default):s(t,e,i,l,c)}}}function xn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function bn(t,e,r,n,i){return xn(typeof r===i?n[r]:void 0,t.default,e.default)}function _n(t,e,r){if("number"!==mn(r))return xn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const i=Ce(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function wn(t,e,r){const n=void 0!==t.base?t.base:1;if("number"!==mn(r))return xn(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const a=Ce(t.stops.map((t=>t[0])),r),o=function(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Re[e.type]||yn;return"function"==typeof s.evaluate?{evaluate(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];const i=s.evaluate.apply(void 0,r),a=l.evaluate.apply(void 0,r);if(void 0!==i&&void 0!==a)return c(i,a,o,t.colorSpace)}}:c(s,l,o,t.colorSpace)}function kn(t,e,r){switch(e.type){case"color":r=Qt.parse(r);break;case"formatted":r=re.fromString(r.toString());break;case"resolvedImage":r=oe.fromString(r.toString());break;case"padding":r=ne.parse(r);break;default:mn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return xn(r,t.default,e.default)}tn.register(Qr,{error:[{kind:"error"},[gt],(t,e)=>{let[r]=e;throw new de(r.evaluate(t))}],typeof:[gt,[bt],(t,e)=>{let[r]=e;return Mt(ce(r.evaluate(t)))}],"to-rgba":[At(mt,4),[vt],(t,e)=>{let[r]=e;const[n,i,a,o]=r.evaluate(t).rgb;return[255*n,255*i,255*a,o]}],rgb:[vt,[mt,mt,mt],en],rgba:[vt,[mt,mt,mt,mt],en],has:{type:yt,overloads:[[[gt],(t,e)=>{let[r]=e;return rn(r.evaluate(t),t.properties())}],[[gt,xt],(t,e)=>{let[r,n]=e;return rn(r.evaluate(t),n.evaluate(t))}]]},get:{type:bt,overloads:[[[gt],(t,e)=>{let[r]=e;return nn(r.evaluate(t),t.properties())}],[[gt,xt],(t,e)=>{let[r,n]=e;return nn(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[bt,[gt],(t,e)=>{let[r]=e;return nn(r.evaluate(t),t.featureState||{})}],properties:[xt,[],t=>t.properties()],"geometry-type":[gt,[],t=>t.geometryType()],id:[bt,[],t=>t.id()],zoom:[mt,[],t=>t.globals.zoom],"heatmap-density":[mt,[],t=>t.globals.heatmapDensity||0],"line-progress":[mt,[],t=>t.globals.lineProgress||0],accumulated:[bt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[mt,an(mt),(t,e)=>{let r=0;for(const n of e)r+=n.evaluate(t);return r}],"*":[mt,an(mt),(t,e)=>{let r=1;for(const n of e)r*=n.evaluate(t);return r}],"-":{type:mt,overloads:[[[mt,mt],(t,e)=>{let[r,n]=e;return r.evaluate(t)-n.evaluate(t)}],[[mt],(t,e)=>{let[r]=e;return-r.evaluate(t)}]]},"/":[mt,[mt,mt],(t,e)=>{let[r,n]=e;return r.evaluate(t)/n.evaluate(t)}],"%":[mt,[mt,mt],(t,e)=>{let[r,n]=e;return r.evaluate(t)%n.evaluate(t)}],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(t,e)=>{let[r,n]=e;return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[mt,[mt],(t,e)=>{let[r]=e;return Math.sqrt(r.evaluate(t))}],log10:[mt,[mt],(t,e)=>{let[r]=e;return Math.log(r.evaluate(t))/Math.LN10}],ln:[mt,[mt],(t,e)=>{let[r]=e;return Math.log(r.evaluate(t))}],log2:[mt,[mt],(t,e)=>{let[r]=e;return Math.log(r.evaluate(t))/Math.LN2}],sin:[mt,[mt],(t,e)=>{let[r]=e;return Math.sin(r.evaluate(t))}],cos:[mt,[mt],(t,e)=>{let[r]=e;return Math.cos(r.evaluate(t))}],tan:[mt,[mt],(t,e)=>{let[r]=e;return Math.tan(r.evaluate(t))}],asin:[mt,[mt],(t,e)=>{let[r]=e;return Math.asin(r.evaluate(t))}],acos:[mt,[mt],(t,e)=>{let[r]=e;return Math.acos(r.evaluate(t))}],atan:[mt,[mt],(t,e)=>{let[r]=e;return Math.atan(r.evaluate(t))}],min:[mt,an(mt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[mt,an(mt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[mt,[mt],(t,e)=>{let[r]=e;return Math.abs(r.evaluate(t))}],round:[mt,[mt],(t,e)=>{let[r]=e;const n=r.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[mt,[mt],(t,e)=>{let[r]=e;return Math.floor(r.evaluate(t))}],ceil:[mt,[mt],(t,e)=>{let[r]=e;return Math.ceil(r.evaluate(t))}],"filter-==":[yt,[gt,bt],(t,e)=>{let[r,n]=e;return t.properties()[r.value]===n.value}],"filter-id-==":[yt,[bt],(t,e)=>{let[r]=e;return t.id()===r.value}],"filter-type-==":[yt,[gt],(t,e)=>{let[r]=e;return t.geometryType()===r.value}],"filter-<":[yt,[gt,bt],(t,e)=>{let[r,n]=e;const i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[yt,[bt],(t,e)=>{let[r]=e;const n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[yt,[gt,bt],(t,e)=>{let[r,n]=e;const i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[yt,[bt],(t,e)=>{let[r]=e;const n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[yt,[gt,bt],(t,e)=>{let[r,n]=e;const i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[yt,[bt],(t,e)=>{let[r]=e;const n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[yt,[gt,bt],(t,e)=>{let[r,n]=e;const i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[yt,[bt],(t,e)=>{let[r]=e;const n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[yt,[bt],(t,e)=>{let[r]=e;return r.value in t.properties()}],"filter-has-id":[yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[yt,[At(gt)],(t,e)=>{let[r]=e;return r.value.indexOf(t.geometryType())>=0}],"filter-id-in":[yt,[At(bt)],(t,e)=>{let[r]=e;return r.value.indexOf(t.id())>=0}],"filter-in-small":[yt,[gt,At(bt)],(t,e)=>{let[r,n]=e;return n.value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[yt,[gt,At(bt)],(t,e)=>{let[r,n]=e;return function(t,e,r,n){for(;r<=n;){const i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:yt,overloads:[[[yt,yt],(t,e)=>{let[r,n]=e;return r.evaluate(t)&&n.evaluate(t)}],[an(yt),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(t,e)=>{let[r,n]=e;return r.evaluate(t)||n.evaluate(t)}],[an(yt),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[yt,[yt],(t,e)=>{let[r]=e;return!r.evaluate(t)}],"is-supported-script":[yt,[gt],(t,e)=>{let[r]=e;const n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[gt,[gt],(t,e)=>{let[r]=e;return r.evaluate(t).toUpperCase()}],downcase:[gt,[gt],(t,e)=>{let[r]=e;return r.evaluate(t).toLowerCase()}],concat:[gt,an(bt),(t,e)=>e.map((e=>ue(e.evaluate(t)))).join("")],"resolved-locale":[gt,[_t],(t,e)=>{let[r]=e;return r.evaluate(t).resolvedLocale()}]});class Tn{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?"color"===(r=e).type&&gn(r.default)?new Qt(0,0,0,0):"color"===r.type?Qt.parse(r.default)||null:"padding"===r.type?ne.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ae.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new de(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,"undefined"!=typeof console&&console.warn(o.message)),this._defaultValue}}}function Sn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Qr}function An(t,e){const r=new xe(Qr,on,[],e?function(t){const e={color:vt,string:gt,number:mt,enum:gt,boolean:yt,formatted:wt,padding:kt,resolvedImage:Tt,variableAnchorOffsetCollection:St};return"array"===t.type?At(e[t.value]||bt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?un(new Tn(n,e)):hn(r.errors)}class Mn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ln(e.expression)}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}}class Cn{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ln(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}interpolationFactor(t,e,r){return this.interpolationType?Fe.interpolationFactor(this.interpolationType,t,e,r):0}}function En(t,e){const r=An(t,e);if("error"===r.result)return r;const n=r.value.expression,i=sn(n);if(!i&&!dn(e))return hn([new dt("","data expressions not supported")]);const a=cn(n,["zoom"]);if(!a&&!pn(e))return hn([new dt("","zoom expressions not supported")]);const o=Pn(n);return o||a?o instanceof dt?hn([o]):o instanceof Fe&&!fn(e)?hn([new dt("",'"interpolate" expressions cannot be used with this property')]):un(o?new Cn(i?"camera":"composite",r.value,o.labels,o instanceof Fe?o.interpolation:void 0):new Mn(i?"constant":"source",r.value)):hn([new dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ln{constructor(t,e){this._parameters=t,this._specification=e,ht(this,vn(this._parameters,this._specification))}static deserialize(t){return new Ln(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Pn(t){let e=null;if(t instanceof be)e=Pn(t.result);else if(t instanceof je){for(const r of t.args)if(e=Pn(r),e)break}else(t instanceof Ee||t instanceof Fe)&&t.input instanceof tn&&"zoom"===t.input.name&&(e=t);return e instanceof dt||t.eachChild((t=>{const r=Pn(t);r instanceof dt?e=r:!e&&r?e=new dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function In(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!In(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function On(t){if(null==t)return{filter:()=>!0,needGeometry:!1};In(t)||(t=Fn(t));const e=An(t,zn);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Rn(t)}}function Dn(t,e){return t<e?-1:t>e?1:0}function Rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(Rn(t[e]))return!0;return!1}function Fn(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Bn(t[1],t[2],"=="):"!="===e?Un(Bn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Bn(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fn))):"all"===e?["all"].concat(t.slice(1).map(Fn)):"none"===e?["all"].concat(t.slice(1).map(Fn).map(Un)):"in"===e?jn(t[1],t.slice(2)):"!in"===e?Un(jn(t[1],t.slice(2))):"has"===e?Nn(t[1]):"!has"!==e||Un(Nn(t[1]));var r}function Bn(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function jn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Dn)]]:["filter-in-small",t,["literal",e]]}}function Nn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Un(t){return["!",t]}function Vn(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const r of t)e+=`${Vn(r)},`;return`${e}]`}const r=Object.keys(t).sort();let n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${Vn(t[r[i]])},`;return`${n}}`}function qn(t){let e="";for(const r of Q)e+=`/${Vn(t[r])}`;return e}function $n(t){const e=t.value;return e?[new ut(t.key,e,"constants have been deprecated as of v8")]:[]}function Hn(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Wn(t){if(Array.isArray(t))return t.map(Wn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Wn(t[r]);return e}return Hn(t)}function Gn(t){const e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=t.validateSpec;let l=[];const c=mn(r);if("object"!==c)return[new ut(e,r,`object expected, ${c} found`)];for(const u in r){const t=u.split(".")[0],c=n[t]||n["*"];let h;if(i[t])h=i[t];else if(n[t])h=s;else if(i["*"])h=i["*"];else{if(!n["*"]){l.push(new ut(e,r[u],`unknown property "${u}"`));continue}h=s}l=l.concat(h({key:(e?`${e}.`:e)+u,value:r[u],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:u,validateSpec:s},r))}for(const u in n)i[u]||n[u].required&&void 0===n[u].default&&void 0===r[u]&&l.push(new ut(e,r,`missing required property "${u}"`));return l}function Yn(t){const e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||t.validateSpec;if("array"!==mn(e))return[new ut(a,e,`array expected, ${mn(e)} found`)];if(r.length&&e.length!==r.length)return[new ut(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new ut(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===mn(r.value)&&(s=r.value);let l=[];for(let c=0;c<e.length;c++)l=l.concat(o({array:e,arrayIndex:c,value:e[c],valueSpec:s,validateSpec:t.validateSpec,style:n,styleSpec:i,key:`${a}[${c}]`}));return l}function Zn(t){const e=t.key,r=t.value,n=t.valueSpec;let i=mn(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new ut(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new ut(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new ut(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Xn(t){const e=t.valueSpec,r=Hn(t.value.type);let n,i,a,o={};const s="categorical"!==r&&void 0===t.value.property,l=!s,c="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),u=Gn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return[new ut(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Yn({key:t.key,value:n,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===mn(n)&&0===n.length&&e.push(new ut(t.key,n,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===r&&s&&u.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||u.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!fn(t.valueSpec)&&u.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!dn(t.valueSpec)?u.push(new ut(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&u.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==t.value.property||u.push(new ut(t.key,t.value,'"property" property is required')),u;function h(t){let r=[];const n=t.value,s=t.key;if("array"!==mn(n))return[new ut(s,n,`array expected, ${mn(n)} found`)];if(2!==n.length)return[new ut(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==mn(n[0]))return[new ut(s,n,`object expected, ${mn(n[0])} found`)];if(void 0===n[0].zoom)return[new ut(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ut(s,n,"object stop key must have value")];if(a&&a>Hn(n[0].zoom))return[new ut(s,n[0].zoom,"stop zoom values must appear in ascending order")];Hn(n[0].zoom)!==a&&(a=Hn(n[0].zoom),i=void 0,o={}),r=r.concat(Gn({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Zn,value:d}}))}else r=r.concat(d({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},n));return Sn(Wn(n[1]))?r.concat([new ut(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(t.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,a){const s=mn(t.value),l=Hn(t.value),c=null!==t.value?t.value:a;if(n){if(s!==n)return[new ut(t.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return dn(e)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(t.key,c,n)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==i&&l<i?[new ut(t.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===r&&l in o?[new ut(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new ut(t.key,c,`integer expected, found ${l}`)]}}function Kn(t){const e=("property"===t.expressionContext?En:An)(Wn(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new ut(`${t.key}${e.key}`,t.value,e.message)));const r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ut(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(t){const e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Hn(r))&&i.push(new ut(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Hn(r))&&i.push(new ut(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return In(Wn(t.value))?Kn(ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ti(t)}function ti(t){const e=t.value,r=t.key;if("array"!==mn(e))return[new ut(r,e,`array expected, ${mn(e)} found`)];const n=t.styleSpec;let i,a=[];if(e.length<1)return[new ut(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Jn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Hn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Hn(e[1])&&a.push(new ut(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ut(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=mn(e[1]),"string"!==i&&a.push(new ut(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let o=2;o<e.length;o++)i=mn(e[o]),"$type"===Hn(e[1])?a=a.concat(Jn({key:`${r}[${o}]`,value:e[o],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new ut(`${r}[${o}]`,e[o],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)a=a.concat(ti({key:`${r}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=mn(e[1]),2!==e.length?a.push(new ut(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==i&&a.push(new ut(`${r}[1]`,e[1],`string expected, ${i} found`))}return a}function ei(t,e){const r=t.key,n=t.validateSpec,i=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];const c=s.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});const u=t.valueSpec||l[s];if(!u)return[new ut(r,o,`unknown property "${s}"`)];let h;if("string"===mn(o)&&dn(u)&&!u.tokens&&(h=/^{([^}]+)}$/.exec(o)))return[new ut(r,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(h[1])} }\`.`)];const d=[];return"symbol"===t.layerType&&("text-field"===s&&i&&!i.glyphs&&d.push(new ut(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&gn(Wn(o))&&"identity"===Hn(o.type)&&d.push(new ut(r,o,'"text-font" does not support identity functions'))),d.concat(n({key:t.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:s}))}function ri(t){return ei(t,"paint")}function ni(t){return ei(t,"layout")}function ii(t){let e=[];const r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new ut(n,r,'either "type" or "ref" is required'));let o=Hn(r.type);const s=Hn(r.ref);if(r.id){const a=Hn(r.id);for(let o=0;o<t.arrayIndex;o++){const t=i.layers[o];Hn(t.id)===a&&e.push(new ut(n,r.id,`duplicate layer id "${r.id}", previously used at line ${t.id.__line__}`))}}if("ref"in r){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in r&&e.push(new ut(n,r[t],`"${t}" is prohibited for ref layers`))})),i.layers.forEach((e=>{Hn(e.id)===s&&(t=e)})),t?t.ref?e.push(new ut(n,r.ref,"ref cannot reference another ref layer")):o=Hn(t.type):e.push(new ut(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){const t=i.sources&&i.sources[r.source],a=t&&Hn(t.type);t?"vector"===a&&"raster"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ut(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ut(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&t.lineMetrics||e.push(new ut(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ut(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ut(n,r.source,`source "${r.source}" not found`))}else e.push(new ut(n,r,'missing required property "source"'));return e=e.concat(Gn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:t=>Gn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ni(ht({layerType:o},t))}}),paint:t=>Gn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ri(ht({layerType:o},t))}})}})),e}function ai(t){const e=t.value,r=t.key,n=mn(e);return"string"!==n?[new ut(r,e,`string expected, ${n} found`)]:[]}const oi={promoteId:function(t){let{key:e,value:r}=t;if("string"===mn(r))return ai({key:e,value:r});{const t=[];for(const n in r)t.push(...ai({key:`${e}.${n}`,value:r[n]}));return t}}};function si(t){const e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new ut(r,e,'"type" is required')];const o=Hn(e.type);let s;switch(o){case"vector":case"raster":return s=Gn({key:r,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),s;case"raster-dem":return s=function(t){var e;const r=null!==(e=t.sourceName)&&void 0!==e?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style;let s=[];const l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ut("source_raster_dem",n,`object expected, ${l} found`)),s;const c="custom"===Hn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const d in n)!c&&u.includes(d)?s.push(new ut(d,n[d],`In "${r}": "${d}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[d]?s=s.concat(t.validateSpec({key:d,value:n[d],valueSpec:a[d],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new ut(d,n[d],`unknown property "${d}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=Gn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),e.cluster)for(const t in e.clusterProperties){const[n,i]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;s.push(...Kn({key:`${r}.${t}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Kn({key:`${r}.${t}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return Gn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Gn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(t){const e=t.value,r=t.styleSpec,n=r.light,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("light",e,`object expected, ${o} found`)]),a;for(const s in e){const o=s.match(/^(.*)-transition$/);a=a.concat(o&&n[o[1]]&&n[o[1]].transition?t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r}):n[s]?t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(s,e[s],`unknown property "${s}"`)])}return a}function ci(t){const e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("sky",e,`object expected, ${a} found`)];let o=[];for(const s in e)o=o.concat(n[s]?t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new ut(s,e[s],`unknown property "${s}"`)]);return o}function ui(t){const e=t.value,r=t.styleSpec,n=r.terrain,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("terrain",e,`object expected, ${o} found`)]),a;for(const s in e)a=a.concat(n[s]?t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(s,e[s],`unknown property "${s}"`)]);return a}function hi(t){let e=[];const r=t.value,n=t.key;if(Array.isArray(r)){const i=[],a=[];for(const o in r)r[o].id&&i.includes(r[o].id)&&e.push(new ut(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new ut(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Gn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return ai({key:n,value:r})}const di={"*":()=>[],array:Yn,boolean:function(t){const e=t.value,r=t.key,n=mn(e);return"boolean"!==n?[new ut(r,e,`boolean expected, ${n} found`)]:[]},number:Zn,color:function(t){const e=t.key,r=t.value,n=mn(r);return"string"!==n?[new ut(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ut(e,r,`color expected, "${r}" found`)]},constants:$n,enum:Jn,filter:Qn,function:Xn,layer:ii,object:Gn,source:si,light:li,sky:ci,terrain:ui,projection:function(t){const e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("projection",e,`object expected, ${a} found`)];let o=[];for(const s in e)o=o.concat(n[s]?t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new ut(s,e[s],`unknown property "${s}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Kn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Kn(t)},padding:function(t){const e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ut(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a<r.length;a++)i=i.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:n}));return i}return Zn({key:e,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(t){const e=t.key,r=t.value,n=mn(r),i=t.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new ut(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let o=0;o<r.length;o+=2)a=a.concat(Jn({key:`${e}[${o}]`,value:r[o],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat(Yn({key:`${e}[${o+1}]`,value:r[o+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return a},sprite:hi};function pi(t){const e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=pi,r.expression&&gn(Hn(e))?Xn(t):r.expression&&Sn(Wn(e))?Kn(t):r.type&&di[r.type]?di[r.type](t):Gn(ht({},t,{valueSpec:r.type?n[r.type]:r}))}function fi(t){const e=t.value,r=t.key,n=ai(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new ut(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new ut(r,e,'"glyphs" url must include a "{range}" token'))),n}function mi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J,r=[];return r=r.concat(pi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:pi,objectElementValidators:{glyphs:fi,"*":()=>[]}})),t.constants&&(r=r.concat($n({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:pi}))),yi(r)}function gi(t){return function(e){return t(((t,e)=>r(t,i(e)))(((t,e)=>{for(var r in e||(e={}))l.call(e,r)&&u(t,r,e[r]);if(o)for(var r of o(e))c.call(e,r)&&u(t,r,e[r]);return t})({},e),{validateSpec:pi}))}}function yi(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function vi(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return yi(t.apply(this,r))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(fi)),mi.light=vi(gi(li)),mi.sky=vi(gi(ci)),mi.terrain=vi(gi(ui)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));const xi=mi,bi=xi.light,_i=xi.sky,wi=xi.paintProperty,ki=xi.layoutProperty;function Ti(t,e){let r=!1;if(e&&e.length)for(const n of e)t.fire(new X(new Error(n.message))),r=!0;return r}class Si{constructor(t,e,r){const n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t<this.d*this.d;t++){const e=i[3+t],r=i[3+t+1];n.push(e===r?null:i.subarray(e,r))}const a=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=e+2*r;for(let t=0;t<this.d*this.d;t++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;const i=r/e*t;this.min=-i,this.max=t+i}insert(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,r,n,i,a){this.cells[i].push(a)}query(t,e,r,n,i){const a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);{const a=[];return this._forEachCell(t,e,r,n,this._queryCell,a,{},i),a}}_queryCell(t,e,r,n,i,a,o,s){const l=this.cells[i];if(null!==l){const i=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){const h=l[u];if(void 0===o[h]){const l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&r>=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++){const c=this.d*l+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,c,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let r=0;for(let a=0;a<this.cells.length;a++)r+=this.cells[a].length;const n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=e;for(let a=0;a<t.length;a++){const e=t[a];n[3+a]=i,n.set(e,i),i+=e.length}return n[3+t.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+t.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(t,e){const r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}}static deserialize(t){return new Si(t.buffer)}}const Ai={};function Mi(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ai[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ai[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}Mi("Object",Object),Mi("TransferableGridIndex",Si),Mi("Color",Qt),Mi("Error",Error),Mi("AJAXError",q),Mi("ResolvedImage",oe),Mi("StylePropertyFunction",Ln),Mi("StyleExpression",Tn,{omit:["_evaluator"]}),Mi("ZoomDependentExpression",Cn),Mi("ZoomConstantExpression",Mn),Mi("CompoundExpression",tn,{omit:["_evaluate"]});for(const r in Qr)Qr[r]._classRegistryKey||Mi(`Expression_${r}`,Qr[r]);function Ci(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Ei(t){return t.$name||t.constructor._classRegistryKey}function Li(t){return!function(t){if(null===t||"object"!=typeof t)return!1;const e=Ei(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Ci(t)||z(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Pi(t,e){if(Li(t))return(Ci(t)||z(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const r=[];for(const n of t)r.push(Pi(n,e));return r}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const r=Ei(t);if(!r)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Ai[r])throw new Error(`${r} is not registered.`);const{klass:n}=Ai[r],i=n.serialize?n.serialize(t,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const n in t){if(!t.hasOwnProperty(n))continue;if(Ai[r].omit.indexOf(n)>=0)continue;const a=t[n];i[n]=Ai[r].shallow.indexOf(n)>=0?a:Pi(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Ii(t){if(Li(t))return t;if(Array.isArray(t))return t.map(Ii);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=Ei(t)||"Object";if(!Ai[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Ai[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);const n=Object.create(r.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const r=t[i];n[i]=Ai[e].shallow.indexOf(i)>=0?r:Ii(r)}return n}class zi{constructor(){this.first=!0}update(t,e){const r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}}const Oi=t=>t>=128&&t<=255,Di=t=>t>=6016&&t<=6143,Ri=t=>t>=8192&&t<=8303,Fi=t=>t>=8448&&t<=8527,Bi=t=>t>=8528&&t<=8591,ji=t=>t>=8960&&t<=9215,Ni=t=>t>=9216&&t<=9279,Ui=t=>t>=9280&&t<=9311,Vi=t=>t>=9312&&t<=9471,qi=t=>t>=9632&&t<=9727,$i=t=>t>=9728&&t<=9983,Hi=t=>t>=11008&&t<=11263,Wi=t=>t>=12272&&t<=12287,Gi=t=>t>=12288&&t<=12351,Yi=t=>t>=12448&&t<=12543,Zi=t=>t>=12688&&t<=12703,Xi=t=>t>=12736&&t<=12783,Ki=t=>t>=12800&&t<=13055,Ji=t=>t>=13056&&t<=13311,Qi=t=>t>=19904&&t<=19967,ta=t=>t>=57344&&t<=63743,ea=t=>t>=65040&&t<=65055,ra=t=>t>=65072&&t<=65103,na=t=>t>=65104&&t<=65135,ia=t=>t>=65280&&t<=65519;function aa(t){for(const e of t)if(ha(e.charCodeAt(0)))return!0;return!1}function oa(t){for(const e of t)if(!ca(e.charCodeAt(0)))return!1;return!0}function sa(t){const e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(e){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ca(t){return!la.test(String.fromCodePoint(t))}const ua=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(t){return!(746!==t&&747!==t&&(t<4352||!(ra(t)&&!(t>=65097&&t<=65103)||Ji(t)||Xi(t)||!(!Gi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ki(t)||Wi(t)||Zi(t)||Yi(t)&&12540!==t||!(!ia(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!na(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ea(t)||Qi(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||ua.test(String.fromCodePoint(t)))))}function da(t){return!(ha(t)||(e=t,Oi(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ri(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Fi(e)||Bi(e)||ji(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ni(e)&&9251!==e||Ui(e)||Vi(e)||qi(e)||$i(e)&&!(e>=9754&&e<=9759)||Hi(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Gi(e)||Yi(e)||ta(e)||ra(e)||na(e)||ia(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}const pa=sa(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function fa(t){return pa.test(String.fromCodePoint(t))}function ma(t,e){return!(!e&&fa(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Di(t))}function ga(t){for(const e of t)if(fa(e.charCodeAt(0)))return!0;return!1}const ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(t){return function(t,e){for(const r of t)if(!ma(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class xa{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new Ln(t,e);if(Sn(t)){const r=En(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"color"===e.type&&"string"==typeof t?r=Qt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(r=ae.parse(t)):r=ne.parse(t),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class ba{constructor(t){this.property=t,this.value=new xa(t,void 0)}transitioned(t,e){return new wa(this.property,this.value,e,k({},t.transition,this.transition),t.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class _a{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return M(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ba(this._values[t].property)),this._values[t].value=new xa(this._values[t].property,null===e?void 0:M(e))}getTransition(t){return M(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ba(this._values[t].property)),this._values[t].transition=M(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const r=new ka(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){const t=new ka(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class wa{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){const n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);{const o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}}return i}}class ka{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Ta{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return M(this._values[t].value)}setValue(t,e){this._values[t]=new xa(this._values[t].property,null===e?void 0:M(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class Sa{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class Aa{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Ma{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){const n=Re[this.specification.type];return n?n(t,e,r):t}}class Ca{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new Sa(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Sa(this,{kind:"constant",value:void 0},t.parameters);const n=Re[this.specification.type];if(n){const i=n(t.value.value,e.value.value,r);return new Sa(this,{kind:"constant",value:i},t.parameters)}return t}evaluate(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)}}class Ea extends Ca{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new Sa(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Sa(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){const r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Sa(this,{kind:"constant",value:r},e)}return new Sa(this,t.expression,e)}evaluate(t,e,r,n,i,a){if("source"===t.kind){const o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class La{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new va(Math.floor(e.zoom-1),e)),t.expression.evaluate(new va(Math.floor(e.zoom),e)),t.expression.evaluate(new va(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class Pa{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class Ia{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const r=t[e];r.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ba(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Mi("DataDrivenProperty",Ca),Mi("DataConstantProperty",Ma),Mi("CrossFadedDataDrivenProperty",Ea),Mi("CrossFadedProperty",La),Mi("ColorRampProperty",Pa);const za="-transition";class Oa extends K{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new Ta(e.layout)),e.paint)){this._transitionablePaint=new _a(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=e&&this._validate(ki,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(za)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=e&&this._validate(wi,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(za))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),A(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&Ti(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof Sa&&dn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const Da={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ra{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ba(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,n=0;return{members:t.map((t=>{const i=Da[t.type].BYTES_PER_ELEMENT,a=r=ja(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:ja(r,Math.max(n,e)),alignment:e}}function ja(t,e){return Math.ceil(t/e)*e}class Na extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}Na.prototype.bytesPerElement=4,Mi("StructArrayLayout2i4",Na);class Ua extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ua.prototype.bytesPerElement=6,Mi("StructArrayLayout3i6",Ua);class Va extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t}}Va.prototype.bytesPerElement=8,Mi("StructArrayLayout4i8",Va);class qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}qa.prototype.bytesPerElement=12,Mi("StructArrayLayout2i4i12",qa);class $a extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}$a.prototype.bytesPerElement=8,Mi("StructArrayLayout2i4ub8",$a);class Ha extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Ha.prototype.bytesPerElement=8,Mi("StructArrayLayout2f8",Ha);class Wa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)}emplace(t,e,r,n,i,a,o,s,l,c,u){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}Wa.prototype.bytesPerElement=20,Mi("StructArrayLayout10ui20",Wa);class Ga extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,r,n,i,a,o,s,l,c,u,h)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,t}}Ga.prototype.bytesPerElement=24,Mi("StructArrayLayout4i4ui4i24",Ga);class Ya extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}Ya.prototype.bytesPerElement=12,Mi("StructArrayLayout3f12",Ya);class Za extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Za.prototype.bytesPerElement=4,Mi("StructArrayLayout1ul4",Za);class Xa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,c){const u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}Xa.prototype.bytesPerElement=20,Mi("StructArrayLayout6i1ul2ui20",Xa);class Ka extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ka.prototype.bytesPerElement=12,Mi("StructArrayLayout2i2i2i12",Ka);class Ja extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)}emplace(t,e,r,n,i,a){const o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t}}Ja.prototype.bytesPerElement=16,Mi("StructArrayLayout2f1f2i16",Ja);class Qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,t}}Qa.prototype.bytesPerElement=16,Mi("StructArrayLayout2ub2f2i16",Qa);class to extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}to.prototype.bytesPerElement=6,Mi("StructArrayLayout3ui6",to);class eo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y){const v=24*t,x=12*t,b=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t}}eo.prototype.bytesPerElement=48,Mi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",eo);class ro extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M){const C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S,A,M,C){const E=32*t,L=16*t;return this.int16[E+0]=e,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=i,this.int16[E+4]=a,this.int16[E+5]=o,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=c,this.uint16[E+9]=u,this.uint16[E+10]=h,this.uint16[E+11]=d,this.uint16[E+12]=p,this.uint16[E+13]=f,this.uint16[E+14]=m,this.uint16[E+15]=g,this.uint16[E+16]=y,this.uint16[E+17]=v,this.uint16[E+18]=x,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[L+12]=T,this.float32[L+13]=S,this.float32[L+14]=A,this.uint16[E+30]=M,this.uint16[E+31]=C,t}}ro.prototype.bytesPerElement=64,Mi("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}no.prototype.bytesPerElement=4,Mi("StructArrayLayout1f4",no);class io extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[6*t+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}io.prototype.bytesPerElement=12,Mi("StructArrayLayout1ui2f12",io);class ao extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}ao.prototype.bytesPerElement=8,Mi("StructArrayLayout1ul2ui8",ao);class oo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}oo.prototype.bytesPerElement=4,Mi("StructArrayLayout2ui4",oo);class so extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}so.prototype.bytesPerElement=2,Mi("StructArrayLayout1ui2",so);class lo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t}}lo.prototype.bytesPerElement=16,Mi("StructArrayLayout4f16",lo);class co extends Ra{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new h(this.anchorPointX,this.anchorPointY)}}co.prototype.size=20;class uo extends Xa{get(t){return new co(this,t)}}Mi("CollisionBoxArray",uo);class ho extends Ra{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ho.prototype.size=48;class po extends eo{get(t){return new ho(this,t)}}Mi("PlacedSymbolArray",po);class fo extends Ra{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}fo.prototype.size=64;class mo extends ro{get(t){return new fo(this,t)}}Mi("SymbolInstanceArray",mo);class go extends no{getoffsetX(t){return this.float32[1*t+0]}}Mi("GlyphOffsetArray",go);class yo extends Ua{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Mi("SymbolLineVertexArray",yo);class vo extends Ra{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}vo.prototype.size=12;class xo extends io{get(t){return new vo(this,t)}}Mi("TextAnchorOffsetArray",xo);class bo extends Ra{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}bo.prototype.size=8;class _o extends ao{get(t){return new bo(this,t)}}Mi("FeatureIndexArray",_o);class wo extends Na{}class ko extends Na{}class To extends Na{}class So extends qa{}class Ao extends $a{}class Mo extends Ha{}class Co extends Wa{}class Eo extends Ga{}class Lo extends Ya{}class Po extends Za{}class Io extends Ka{}class zo extends Qa{}class Oo extends to{}class Do extends oo{}const Ro=Ba([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fo}=Ro;class Bo{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>Bo.MAX_VERTEX_ARRAY_LENGTH&&E(`Max vertices per segment is ${Bo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>Bo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,r,n){return new Bo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function jo(t,e){return 256*(t=_(Math.floor(t),0,255))+_(Math.floor(e),0,255)}Bo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Mi("SegmentVector",Bo);const No=Ba([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Uo={exports:{}},Vo={exports:{}};Vo.exports=function(t,e){var r,n,i,a,o,s,l,c;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var qo=Vo.exports,$o={exports:{}};$o.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Ho=qo,Wo=$o.exports;Uo.exports=Ho,Uo.exports.murmur3=Ho,Uo.exports.murmur2=Wo;var Go=n(Uo.exports);class Yo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Zo(t)),this.positions.push(e,r,n)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=Zo(t);let r=0,n=this.ids.length-1;for(;r<n;){const t=r+n>>1;this.ids[t]>=e?n=t:r=t+1}const i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){const r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Xo(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){const e=new Yo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Zo(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Go(String(t))}function Xo(t,e,r,n){for(;r<n;){const i=t[r+n>>1];let a=r-1,o=n+1;for(;;){do{a++}while(t[a]<i);do{o--}while(t[o]>i);if(a>=o)break;Ko(t,a,o),Ko(e,3*a,3*o),Ko(e,3*a+1,3*o+1),Ko(e,3*a+2,3*o+2)}o-r<n-o?(Xo(t,e,r,o),r=o+1):(Xo(t,e,o+1,n),n=o)}}function Ko(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}Mi("FeaturePositionMap",Yo);class Jo{constructor(t,e){this.gl=t.gl,this.location=e}}class Qo extends Jo{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class ts extends Jo{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class es extends Jo{constructor(t,e){super(t,e),this.current=Qt.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const rs=new Float32Array(16);function ns(t){return[jo(255*t.r,255*t.g),jo(255*t.b,255*t.a)]}class is{constructor(t,e,r){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return"color"===this.type?new es(t,e):new Qo(t,e)}}class as{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)}getBinding(t,e,r){return"u_pattern"===r.substr(0,9)?new ts(t,e):new Qo(t,e)}}class os{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,r,n,i){const a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)}_setPaintValue(t,e,r){if("color"===this.type){const n=ns(r);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ss{constructor(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(t,e,r,n,i){const a=this.expression.evaluate(new va(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)}_setPaintValue(t,e,r,n){if("color"===this.type){const i=ns(r),a=ns(n);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1],a[0],a[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=_(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)}getBinding(t,e,r){return new Qo(t,e)}}class ls{constructor(t,e,r,n,i,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(t,e,r){const n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)}updatePaintArray(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)}_setPaintValues(t,e,r,n){if(!n||!r)return;const{min:i,mid:a,max:o}=r,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(let u=t;u<e;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,No.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,No.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class cs{constructor(t,e,r){this.binders={},this._buffers=[];const n=[];for(const i in t.paint._values){if(!r(i))continue;const a=t.paint.get(i);if(!(a instanceof Sa&&dn(a.property.specification)))continue;const o=hs(i,t.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new as(s.value,o):new is(s.value,o,l),n.push(`/u_${i}`);else if("source"===s.kind||h){const r=ds(i,l,"source");this.binders[i]=h?new ls(s,l,c,e,r,t.id):new os(s,o,l,r),n.push(`/a_${i}`)}else{const t=ds(i,l,"composite");this.binders[i]=new ss(s,o,l,c,e,t),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof os||e instanceof ss?e.maxValue:0}populatePaintArrays(t,e,r,n,i){for(const a in this.binders){const o=this.binders[a];(o instanceof os||o instanceof ss||o instanceof ls)&&o.populatePaintArray(t,e,r,n,i)}}setConstantPatternPositions(t,e){for(const r in this.binders){const n=this.binders[r];n instanceof as&&n.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,r,n,i){let a=!1;for(const o in t){const s=e.getPositions(o);for(const e of s){const s=r.feature(e.index);for(const r in this.binders){const l=this.binders[r];if((l instanceof os||l instanceof ss||l instanceof ls)&&!0===l.expression.isStateDependent){const c=n.paint.get(r);l.expression=c.value,l.updatePaintArray(e.start,e.end,s,t[o],i),a=!0}}}}return a}defines(){const t=[];for(const e in this.binders){const r=this.binders[e];(r instanceof is||r instanceof as)&&t.push(...r.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof os||r instanceof ss)for(let e=0;e<r.paintVertexAttributes.length;e++)t.push(r.paintVertexAttributes[e].name);else if(r instanceof ls)for(let e=0;e<No.members.length;e++)t.push(No.members[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof is||r instanceof as||r instanceof ss)for(const e of r.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const r=[];for(const n in this.binders){const i=this.binders[n];if(i instanceof is||i instanceof as||i instanceof ss)for(const a of i.uniformNames)if(e[a]){const o=i.getBinding(t,e[a],a);r.push({name:a,property:n,binding:o})}}return r}setUniforms(t,e,r,n){for(const{name:i,property:a,binding:o}of e)this.binders[a].setUniform(o,n,r.get(a),i)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const r=this.binders[e];if(t&&r instanceof ls){const e=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(r instanceof os||r instanceof ss)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(const e in this.binders){const r=this.binders[e];(r instanceof os||r instanceof ss||r instanceof ls)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof os||e instanceof ss||e instanceof ls)&&e.destroy()}}}class us{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new cs(n,e,r);this.needsUpload=!1,this._featureMap=new Yo,this._bufferOffset=0}populatePaintArrays(t,e,r,n,i,a){for(const o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function hs(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function ds(t,e,r){const n={color:{source:Ha,composite:lo},number:{source:no,composite:Ha}},i={"line-pattern":{source:Co,composite:Co},"fill-pattern":{source:Co,composite:Co},"fill-extrusion-pattern":{source:Co,composite:Co}}[t];return i&&i[r]||n[e][r]}Mi("ConstantBinder",is),Mi("CrossFadedConstantBinder",as),Mi("SourceExpressionBinder",os),Mi("CrossFadedCompositeBinder",ls),Mi("CompositeExpressionBinder",ss),Mi("ProgramConfiguration",cs,{omit:["_buffers"]}),Mi("ProgramConfigurationSet",us);const ps=8192,fs=Math.pow(2,14)-1,ms=-fs-1;function gs(t){const e=ps/t.extent,r=t.loadGeometry();for(let n=0;n<r.length;n++){const t=r[n];for(let r=0;r<t.length;r++){const n=t[r],i=Math.round(n.x*e),a=Math.round(n.y*e);n.x=_(i,ms,fs),n.y=_(a,ms,fs),(i<n.x||i>n.x+1||a<n.y||a>n.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ys(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?gs(t):[]}}function vs(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class xs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ko,this.indexArray=new Oo,this.segments=new Bo,this.programConfigurations=new us(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){const n=this.layers[0],i=[];let a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(const{feature:s,id:l,index:c,sourceLayerIndex:u}of t){const t=this.layers[0]._featureFilter.needGeometry,e=ys(s,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),e,r))continue;const n=o?a.evaluate(e,{},r):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:u,index:c,geometry:t?e.geometry:gs(s),patterns:{},sortKey:n};i.push(h)}o&&i.sort(((t,e)=>t.sortKey-e.sortKey));for(const s of i){const{geometry:n,index:i,sourceLayerIndex:a}=s,o=t[i].feature;this.addFeature(s,n,i,r),e.featureIndex.insert(o,n,i,a,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,n){for(const i of e)for(const e of i){const r=e.x,n=e.y;if(r<0||r>=ps||n<0||n>=ps)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;vs(this.layoutVertexArray,r,n,-1,-1),vs(this.layoutVertexArray,r,n,1,-1),vs(this.layoutVertexArray,r,n,1,1),vs(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)}}function bs(t,e){for(let r=0;r<t.length;r++)if(Es(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Es(t,e[r]))return!0;return!!Ts(t,e)}function _s(t,e,r){return!!Es(t,e)||!!As(e,t,r)}function ws(t,e){if(1===t.length)return Cs(e,t[0]);for(let r=0;r<e.length;r++){const n=e[r];for(let e=0;e<n.length;e++)if(Es(t,n[e]))return!0}for(let r=0;r<t.length;r++)if(Cs(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Ts(t,e[r]))return!0;return!1}function ks(t,e,r){if(t.length>1){if(Ts(t,e))return!0;for(let n=0;n<e.length;n++)if(As(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(As(t[n],e,r))return!0;return!1}function Ts(t,e){if(0===t.length||0===e.length)return!1;for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1];for(let t=0;t<e.length-1;t++)if(Ss(n,i,e[t],e[t+1]))return!0}return!1}function Ss(t,e,r,n){return L(t,r,n)!==L(e,r,n)&&L(t,e,r)!==L(t,e,n)}function As(t,e,r){const n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++)if(Ms(t,e[i-1],e[i])<n)return!0;return!1}function Ms(t,e,r){const n=e.distSqr(r);if(0===n)return t.distSqr(e);const i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Cs(t,e){let r,n,i,a=!1;for(let o=0;o<t.length;o++){r=t[o];for(let t=0,o=r.length-1;t<r.length;o=t++)n=r[t],i=r[o],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Es(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){const a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Ls(t,e,r){const n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;const a=L(t,e,r[0]);return a!==L(t,e,r[1])||a!==L(t,e,r[2])||a!==L(t,e,r[3])}function Ps(t,e,r){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Is(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zs(t,e,r,n,i){if(!e[0]&&!e[1])return t;const a=h.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);const o=[];for(let s=0;s<t.length;s++)o.push(t[s].sub(a));return o}let Os,Ds;Mi("CircleBucket",xs,{omit:["layers"]});var Rs={get paint(){return Ds=Ds||new Ia({"circle-radius":new Ca(J.paint_circle["circle-radius"]),"circle-color":new Ca(J.paint_circle["circle-color"]),"circle-blur":new Ca(J.paint_circle["circle-blur"]),"circle-opacity":new Ca(J.paint_circle["circle-opacity"]),"circle-translate":new Ma(J.paint_circle["circle-translate"]),"circle-translate-anchor":new Ma(J.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ma(J.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ma(J.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ca(J.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ca(J.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ca(J.paint_circle["circle-stroke-opacity"])})},get layout(){return Os=Os||new Ia({"circle-sort-key":new Ca(J.layout_circle["circle-sort-key"])})}},Fs=1e-6,Bs="undefined"!=typeof Float32Array?Float32Array:Array;function js(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ns(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*m,t[1]=x*i+b*l+_*d+w*g,t[2]=x*a+b*c+_*p+w*y,t[3]=x*o+b*u+_*f+w*v,t[4]=(x=r[4])*n+(b=r[5])*s+(_=r[6])*h+(w=r[7])*m,t[5]=x*i+b*l+_*d+w*g,t[6]=x*a+b*c+_*p+w*y,t[7]=x*o+b*u+_*f+w*v,t[8]=(x=r[8])*n+(b=r[9])*s+(_=r[10])*h+(w=r[11])*m,t[9]=x*i+b*l+_*d+w*g,t[10]=x*a+b*c+_*p+w*y,t[11]=x*o+b*u+_*f+w*v,t[12]=(x=r[12])*n+(b=r[13])*s+(_=r[14])*h+(w=r[15])*m,t[13]=x*i+b*l+_*d+w*g,t[14]=x*a+b*c+_*p+w*y,t[15]=x*o+b*u+_*f+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Us,Vs=Ns;function qs(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Us=new Bs(4),Bs!=Float32Array&&(Us[0]=0,Us[1]=0,Us[2]=0,Us[3]=0);class $s extends Oa{constructor(t){super(t,Rs)}createBucket(t){return new xs(t)}queryRadius(t){const e=t;return Ps("circle-radius",this,e)+Ps("circle-stroke-width",this,e)+Is(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o,s){const l=zs(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:(p=s,l.map((t=>Hs(t,p)))),d=u?c*o:c;var p;for(const f of n)for(const t of f){const e=u?t:Hs(t,s);let r=d;const n=qs([],[t.x,t.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),_s(h,e,r))return!0}return!1}}function Hs(t,e){const r=qs([],[t.x,t.y,0,1],e);return new h(r[0]/r[3],r[1]/r[3])}class Ws extends xs{}let Gs;Mi("HeatmapBucket",Ws,{omit:["layers"]});var Ys={get paint(){return Gs=Gs||new Ia({"heatmap-radius":new Ca(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ca(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ma(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Pa(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ma(J.paint_heatmap["heatmap-opacity"])})}};function Zs(t,e,r,n){let{width:i,height:a}=e;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${i*a*r}`)}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function Xs(t,e,r){let{width:n,height:i}=e;if(n===t.width&&i===t.height)return;const a=Zs({},{width:n,height:i},r);Ks(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}function Ks(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){const c=((r.y+l)*t.width+r.x)*a,u=((n.y+l)*e.width+n.x)*a;for(let t=0;t<i.width*a;t++)s[u+t]=o[c+t]}return e}class Js{constructor(t,e){Zs(this,t,1,e)}resize(t){Xs(this,t,1)}clone(){return new Js({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){Ks(t,e,r,n,i,1)}}class Qs{constructor(t,e){Zs(this,t,4,e)}resize(t){Xs(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Qs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){Ks(t,e,r,n,i,4)}}function tl(t){const e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new Qs({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const a=(r,n,a)=>{e[t.evaluationKey]=a;const o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(let o=0,s=0;o<n;++o,s+=4*r)for(let e=0,n=0;e<r;e++,n+=4){const i=e/(r-1),{start:l,end:c}=t.clips[o];a(s,n,l*(1-i)+c*i)}else for(let o=0,s=0;o<r;o++,s+=4)a(0,s,o/(r-1));return i}Mi("AlphaImage",Js),Mi("RGBAImage",Qs);const el="big-fb";class rl extends Oa{createBucket(t){return new Ws(t)}constructor(t){super(t,Ys),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=tl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(el)&&this.heatmapFbos.delete(el)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let nl;var il={get paint(){return nl=nl||new Ia({"hillshade-illumination-direction":new Ma(J.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ma(J.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ma(J.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ma(J.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ma(J.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ma(J.paint_hillshade["hillshade-accent-color"])})}};class al extends Oa{constructor(t){super(t,il)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const ol=Ba([{name:"a_pos",components:2,type:"Int16"}],4),{members:sl}=ol;function ll(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const n=e&&e.length,i=n?e[0]*r:t.length;let a=cl(t,0,i,r,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c;if(n&&(a=function(t,e,r,n){const i=[];for(let a=0,o=e.length;a<o;a++){const r=cl(t,e[a]*n,a<o-1?e[a+1]*n:t.length,n,!1);r===r.next&&(r.steiner=!0),i.push(bl(r))}i.sort(gl);for(let a=0;a<i.length;a++)r=yl(i[a],r);return r}(t,e,a,r)),t.length>80*r){s=1/0,l=1/0;let e=-1/0,n=-1/0;for(let a=r;a<i;a+=r){const r=t[a],i=t[a+1];r<s&&(s=r),i<l&&(l=i),r>e&&(e=r),i>n&&(n=i)}c=Math.max(e-s,n-l),c=0!==c?32767/c:0}return hl(a,o,r,s,l,c,0),o}function cl(t,e,r,n,i){let a;if(i===function(t,e,r,n){let i=0;for(let a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,r,n)>0)for(let o=e;o<r;o+=n)a=Ll(o/n|0,t[o],t[o+1],a);else for(let o=r-n;o>=e;o-=n)a=Ll(o/n|0,t[o],t[o+1],a);return a&&Tl(a,a.next)&&(Pl(a),a=a.next),a}function ul(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!Tl(n,n.next)&&0!==kl(n.prev,n,n.next))n=n.next;else{if(Pl(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function hl(t,e,r,n,i,a,o){if(!t)return;!o&&a&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=xl(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let a=null;for(e=0;i;){e++;let o=i,s=0;for(let t=0;t<r&&(s++,o=o.nextZ,o);t++);let l=r;for(;s>0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,a);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?pl(t,n,i,a):dl(t))e.push(l.i,t.i,c.i),Pl(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?hl(t=fl(ul(t),e),e,r,n,i,a,2):2===o&&ml(t,e,r,n,i,a):hl(ul(t),e,r,n,i,a,1);break}}}function dl(t){const e=t.prev,r=t,n=t.next;if(kl(e,r,n)>=0)return!1;const i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,d=i>a?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c;let f=n.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&_l(i,s,a,l,o,c,f.x,f.y)&&kl(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function pl(t,e,r,n){const i=t.prev,a=t,o=t.next;if(kl(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,d=o.y,p=s<l?s<c?s:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,y=xl(p,f,e,r,n),v=xl(m,g,e,r,n);let x=t.prevZ,b=t.nextZ;for(;x&&x.z>=y&&b&&b.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,d,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,d,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,d,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,d,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function fl(t,e){let r=t;do{const n=r.prev,i=r.next.next;!Tl(n,i)&&Sl(n,r,r.next,i)&&Cl(n,i)&&Cl(i,n)&&(e.push(n.i,r.i,i.i),Pl(r),Pl(r.next),r=t=i),r=r.next}while(r!==t);return ul(r)}function ml(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&wl(o,t)){let s=El(o,t);return o=ul(o,o.next),s=ul(s,s.next),hl(o,e,r,n,i,a,0),void hl(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function gl(t,e){return t.x-e.x}function yl(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let a,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>o&&(o=t,a=r.x<r.next.x?r:r.next,t===n))return a}r=r.next}while(r!==e);if(!a)return null;const s=a,l=a.x,c=a.y;let u=1/0;r=a;do{if(n>=r.x&&r.x>=l&&n!==r.x&&_l(i<c?n:o,i,l,c,i<c?o:n,i,r.x,r.y)){const e=Math.abs(i-r.y)/(n-r.x);Cl(r,t)&&(e<u||e===u&&(r.x>a.x||r.x===a.x&&vl(a,r)))&&(a=r,u=e)}r=r.next}while(r!==s);return a}(t,e);if(!r)return e;const n=El(r,t);return ul(n,n.next),ul(r,r.next)}function vl(t,e){return kl(t.prev,t,e.prev)<0&&kl(e.next,t,t.next)<0}function xl(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function bl(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function _l(t,e,r,n,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function wl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Sl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Cl(t,e)&&Cl(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(kl(t.prev,t,e.prev)||kl(t,e.prev,e))||Tl(t,e)&&kl(t.prev,t,t.next)>0&&kl(e.prev,e,e.next)>0)}function kl(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Tl(t,e){return t.x===e.x&&t.y===e.y}function Sl(t,e,r,n){const i=Ml(kl(t,e,r)),a=Ml(kl(t,e,n)),o=Ml(kl(r,n,t)),s=Ml(kl(r,n,e));return i!==a&&o!==s||!(0!==i||!Al(t,r,e))||!(0!==a||!Al(t,n,e))||!(0!==o||!Al(r,t,n))||!(0!==s||!Al(r,e,n))}function Al(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ml(t){return t>0?1:t<0?-1:0}function Cl(t,e){return kl(t.prev,t,t.next)<0?kl(t,e,t.next)>=0&&kl(t,t.prev,e)>=0:kl(t,e,t.prev)<0||kl(t,t.next,e)<0}function El(t,e){const r=Il(t.i,t.x,t.y),n=Il(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ll(t,e,r,n){const i=Il(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Pl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Il(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zl(t,e,r){const n=r.patternDependencies;let i=!1;for(const a of e){const e=a.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);const r=e.constantOr(null);r&&(i=!0,n[r.to]=!0,n[r.from]=!0)}return i}function Ol(t,e,r,n,i){const a=i.patternDependencies;for(const o of e){const e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),s=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[t]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:t,mid:s,max:l}}}return r}class Dl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new To,this.indexArray=new Oo,this.indexArray2=new Do,this.programConfigurations=new us(t.layers,t.zoom),this.segments=new Bo,this.segments2=new Bo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=zl("fill",this.layers,e);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=ys(o,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;const h=i?n.evaluate(u,{},r,e.availableImages):void 0,d={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:gs(o),patterns:{},sortKey:h};a.push(d)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const t=Ol("fill",this.layers,o,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(o,n,i,r,{});e.featureIndex.insert(t[i].feature,n,i,a,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,sl),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,n,i){for(const a of Tr(e,500)){let t=0;for(const s of a)t+=s.length;const e=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),r=e.vertexLength,n=[],i=[];for(const s of a){if(0===s.length)continue;s!==a[0]&&i.push(n.length/2);const t=this.segments2.prepareSegment(s.length,this.layoutVertexArray,this.indexArray2),e=t.vertexLength;this.layoutVertexArray.emplaceBack(s[0].x,s[0].y),this.indexArray2.emplaceBack(e+s.length-1,e),n.push(s[0].x),n.push(s[0].y);for(let r=1;r<s.length;r++)this.layoutVertexArray.emplaceBack(s[r].x,s[r].y),this.indexArray2.emplaceBack(e+r-1,e+r),n.push(s[r].x),n.push(s[r].y);t.vertexLength+=s.length,t.primitiveLength+=s.length}const o=ll(n,i);for(let a=0;a<o.length;a+=3)this.indexArray.emplaceBack(r+o[a],r+o[a+1],r+o[a+2]);e.vertexLength+=t,e.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}}let Rl,Fl;Mi("FillBucket",Dl,{omit:["layers","patternFeatures"]});var Bl={get paint(){return Fl=Fl||new Ia({"fill-antialias":new Ma(J.paint_fill["fill-antialias"]),"fill-opacity":new Ca(J.paint_fill["fill-opacity"]),"fill-color":new Ca(J.paint_fill["fill-color"]),"fill-outline-color":new Ca(J.paint_fill["fill-outline-color"]),"fill-translate":new Ma(J.paint_fill["fill-translate"]),"fill-translate-anchor":new Ma(J.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ea(J.paint_fill["fill-pattern"])})},get layout(){return Rl=Rl||new Ia({"fill-sort-key":new Ca(J.layout_fill["fill-sort-key"])})}};class jl extends Oa{constructor(t){super(t,Bl)}recalculate(t,e){super.recalculate(t,e);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Dl(t)}queryRadius(){return Is(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){return ws(zs(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)}isTileClipped(){return!0}}const Nl=Ba([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ul=Ba([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Vl}=Nl;var ql={},$l=a,Hl=Wl;function Wl(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Gl,this,e)}function Gl(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Yl(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}Wl.types=["Unknown","Point","LineString","Polygon"],Wl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(i<=0){var l=t.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new $l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},Wl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Wl.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Wl.types[this.type];function u(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=Yl(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var Zl=Hl,Xl=Kl;function Kl(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Jl,this,e),this.length=this._features.length}function Jl(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}Kl.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Zl(this._pbf,e,this.extent,this._keys,this._values)};var Ql=Xl;function tc(t,e,r){if(3===t){var n=new Ql(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ql.VectorTile=function(t,e){this.layers=t.readFields(tc,{},e)},ql.VectorTileFeature=Hl,ql.VectorTileLayer=Xl;const ec=ql.VectorTileFeature.types,rc=Math.pow(2,13);function nc(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*rc)+o,i*rc*2,a*rc*2,Math.round(s))}class ic{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new So,this.centroidVertexArray=new wo,this.indexArray=new Oo,this.programConfigurations=new us(t.layers,t.zoom),this.segments=new Bo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.features=[],this.hasPattern=zl("fill-extrusion",this.layers,e);for(const{feature:n,id:i,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,s=ys(n,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;const l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:gs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Ol("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,r,{}),e.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,r){for(const n of this.features){const{geometry:t}=n;this.addFeature(n,t,n.index,e,r)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vl),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Ul.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,n,i){for(const a of Tr(e,500)){const e={x:0,y:0,vertexCount:0};let r=0;for(const t of a)r+=t.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of a){if(0===t.length)continue;if(oc(t))continue;let r=0;for(let i=0;i<t.length;i++){const a=t[i];if(i>=1){const o=t[i-1];if(!ac(a,o)){n.vertexLength+4>Bo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=a.sub(o)._perp()._unit(),i=o.dist(a);r+i>32768&&(r=0),nc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),nc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,r),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2,r+=i,nc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),nc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,r),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2;const s=n.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+r>Bo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),"Polygon"!==ec[t.type])continue;const i=[],o=[],s=n.vertexLength;for(const t of a)if(0!==t.length){t!==a[0]&&o.push(i.length/2);for(let r=0;r<t.length;r++){const n=t[r];nc(this.layoutVertexArray,n.x,n.y,0,0,1,1,0),e.x+=n.x,e.y+=n.y,e.vertexCount+=1,i.push(n.x),i.push(n.y)}}const l=ll(i,o);for(let t=0;t<l.length;t+=3)this.indexArray.emplaceBack(s+l[t],s+l[t+2],s+l[t+1]);n.primitiveLength+=l.length/3,n.vertexLength+=r;for(let t=0;t<e.vertexCount;t++){const t=Math.floor(e.x/e.vertexCount),r=Math.floor(e.y/e.vertexCount);this.centroidVertexArray.emplaceBack(t,r)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}}function ac(t,e){return t.x===e.x&&(t.x<0||t.x>ps)||t.y===e.y&&(t.y<0||t.y>ps)}function oc(t){return t.every((t=>t.x<0))||t.every((t=>t.x>ps))||t.every((t=>t.y<0))||t.every((t=>t.y>ps))}let sc;Mi("FillExtrusionBucket",ic,{omit:["layers","features"]});var lc={get paint(){return sc=sc||new Ia({"fill-extrusion-opacity":new Ma(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ca(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ea(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ca(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ca(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ma(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class cc extends Oa{constructor(t){super(t,lc)}createBucket(t){return new ic(t)}queryRadius(){return Is(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,o,s){const l=zs(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),c=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),d=function(t,e){const r=[];for(const n of t){const t=[n.x,n.y,0,1];qs(t,t,e),r.push(new h(t[0]/t[3],t[1]/t[3]))}return r}(l,s),p=function(t,e,r,n){const i=[],a=[],o=n[8]*e,s=n[9]*e,l=n[10]*e,c=n[11]*e,u=n[8]*r,d=n[9]*r,p=n[10]*r,f=n[11]*r;for(const m of t){const t=[],e=[];for(const r of m){const i=r.x,a=r.y,m=n[0]*i+n[4]*a+n[12],g=n[1]*i+n[5]*a+n[13],y=n[2]*i+n[6]*a+n[14],v=n[3]*i+n[7]*a+n[15],x=y+l,b=v+c,_=m+u,w=g+d,k=y+p,T=v+f,S=new h((m+o)/b,(g+s)/b);S.z=x/b,t.push(S);const A=new h(_/T,w/T);A.z=k/T,e.push(A)}i.push(t),a.push(e)}return[i,a]}(n,u,c,s);return function(t,e,r){let n=1/0;ws(r,e)&&(n=hc(r,e[0]));for(let i=0;i<e.length;i++){const a=e[i],o=t[i];for(let t=0;t<a.length-1;t++){const e=a[t],i=[e,a[t+1],o[t+1],o[t],e];bs(r,i)&&(n=Math.min(n,hc(r,i)))}}return n!==1/0&&n}(p[0],p[1],d)}}function uc(t,e){return t.x*e.x+t.y*e.y}function hc(t,e){if(1===t.length){let r=0;const n=e[r++];let i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){const a=e[r],o=t[0],s=i.sub(n),l=a.sub(n),c=o.sub(n),u=uc(s,s),h=uc(s,l),d=uc(l,l),p=uc(c,s),f=uc(c,l),m=u*d-h*h,g=(d*p-h*f)/m,y=(u*f-h*p)/m,v=n.z*(1-g-y)+i.z*g+a.z*y;if(isFinite(v))return v}return 1/0}{let t=1/0;for(const r of e)t=Math.min(t,r.z);return t}}const dc=Ba([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:pc}=dc,fc=Ba([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:mc}=fc,gc=ql.VectorTileFeature.types,yc=Math.cos(Math.PI/180*37.5),vc=Math.pow(2,14)/.5;class xc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Ao,this.layoutVertexArray2=new Mo,this.indexArray=new Oo,this.programConfigurations=new us(t.layers,t.zoom),this.segments=new Bo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=zl("line",this.layers,e);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,e=ys(o,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),e,r))continue;const u=i?n.evaluate(e,{},r):void 0,h={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?e.geometry:gs(o),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const t=Ol("line",this.layers,o,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(o,n,i,r,{});e.featureIndex.insert(t[i].feature,n,i,a,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,mc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pc),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,r,n,i){const a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const u of e)this.addLine(u,t,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}addLine(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const o="Polygon"===gc[e.type];let s=t.length;for(;s>=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l<s-1&&t[l].equals(t[l+1]);)l++;if(s<(o?3:2))return;"bevel"===r&&(i=1.05);const c=this.overscaling<=16?15*ps/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,d,p,f,m;this.e1=this.e2=-1,o&&(h=t[s-2],m=t[l].sub(h)._unit()._perp());for(let g=l;g<s;g++){if(p=g===s-1?o?t[l+1]:void 0:t[g+1],p&&t[g].equals(p))continue;m&&(f=m),h&&(d=h),h=t[g],m=p?p.sub(h)._unit()._perp():f,f=f||m;let e=f.add(m);0===e.x&&0===e.y||e._unit();const y=f.x*m.x+f.y*m.y,v=e.x*m.x+e.y*m.y,x=0!==v?1/v:1/0,b=2*Math.sqrt(2-2*v),_=v<yc&&d&&p,w=f.x*m.y-f.y*m.x>0;if(_&&g>l){const t=h.dist(d);if(t>2*c){const e=h.sub(h.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,f,0,0,u),d=e}}const k=d&&p;let T=k?r:o?"butt":n;if(k&&"round"===T&&(x<a?T="miter":x<=2&&(T="fakeround")),"miter"===T&&x>i&&(T="bevel"),"bevel"===T&&(x>2&&(T="flipbevel"),x<i&&(T="miter")),d&&this.updateDistance(d,h),"miter"===T)e._mult(x),this.addCurrentVertex(h,e,0,0,u);else if("flipbevel"===T){if(x>100)e=m.mult(-1);else{const t=x*f.add(m).mag()/f.sub(m).mag();e._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,e,0,0,u),this.addCurrentVertex(h,e.mult(-1),0,0,u)}else if("bevel"===T||"fakeround"===T){const t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(d&&this.addCurrentVertex(h,f,e,r,u),"fakeround"===T){const t=Math.round(180*b/Math.PI/20);for(let e=1;e<t;e++){let r=e/t;if(.5!==r){const t=r-.5;r+=r*t*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*t*t+(.848013+y*(.215638*y-1.06021)))}const n=m.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,n.x,n.y,!1,w,0,u)}}p&&this.addCurrentVertex(h,m,-e,-r,u)}else if("butt"===T)this.addCurrentVertex(h,e,0,0,u);else if("square"===T){const t=d?1:-1;this.addCurrentVertex(h,e,t,t,u)}else"round"===T&&(d&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),p&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(_&&g<s-1){const t=h.dist(p);if(t>2*c){const e=h.add(p.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>vc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,n,i,a))}addHalfVertex(t,e,r,n,i,a,o){let{x:s,y:l}=t;const c=.5*(this.lineClips?this.scaledDistance*(vc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let bc,_c;Mi("LineBucket",xc,{omit:["layers","patternFeatures"]});var wc={get paint(){return _c=_c||new Ia({"line-opacity":new Ca(J.paint_line["line-opacity"]),"line-color":new Ca(J.paint_line["line-color"]),"line-translate":new Ma(J.paint_line["line-translate"]),"line-translate-anchor":new Ma(J.paint_line["line-translate-anchor"]),"line-width":new Ca(J.paint_line["line-width"]),"line-gap-width":new Ca(J.paint_line["line-gap-width"]),"line-offset":new Ca(J.paint_line["line-offset"]),"line-blur":new Ca(J.paint_line["line-blur"]),"line-dasharray":new La(J.paint_line["line-dasharray"]),"line-pattern":new Ea(J.paint_line["line-pattern"]),"line-gradient":new Pa(J.paint_line["line-gradient"])})},get layout(){return bc=bc||new Ia({"line-cap":new Ma(J.layout_line["line-cap"]),"line-join":new Ca(J.layout_line["line-join"]),"line-miter-limit":new Ma(J.layout_line["line-miter-limit"]),"line-round-limit":new Ma(J.layout_line["line-round-limit"]),"line-sort-key":new Ca(J.layout_line["line-sort-key"])})}};class kc extends Ca{possiblyEvaluate(t,e){return e=new va(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=k({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let Tc;class Sc extends Oa{constructor(t){super(t,wc),this.gradientVersion=0,Tc||(Tc=new kc(wc.paint.properties["line-width"].specification),Tc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!(void 0===t._styleExpression)&&t._styleExpression.expression instanceof Ee,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Tc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new xc(t)}queryRadius(t){const e=t,r=Ac(Ps("line-width",this,e),Ps("line-gap-width",this,e)),n=Ps("line-offset",this,e);return r/2+Math.abs(n)+Is(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){const s=zs(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Ac(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){const r=[];for(let n=0;n<t.length;n++){const i=t[n],a=[];for(let t=0;t<i.length;t++){const r=i[t-1],n=i[t],o=i[t+1],s=0===t?new h(0,0):n.sub(r)._unit()._perp(),l=t===i.length-1?new h(0,0):o.sub(n)._unit()._perp(),c=s._add(l)._unit(),u=c.x*l.x+c.y*l.y;0!==u&&c._mult(1/u),a.push(c._mult(e)._add(n))}r.push(a)}return r}(n,c*o)),function(t,e,r){for(let n=0;n<e.length;n++){const i=e[n];if(t.length>=3)for(let e=0;e<i.length;e++)if(Es(t,i[e]))return!0;if(ks(t,i,r))return!0}return!1}(s,n,l)}isTileClipped(){return!0}}function Ac(t,e){return e>0?e+2*t:t}const Mc=Ba([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Cc=Ba([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ba([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ec=Ba([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ba([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Lc=Ba([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Pc=Ba([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ic(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){const n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ya.applyArabicShaping&&(t=ya.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ba([{name:"triangle",components:3,type:"Uint16"}]),Ba([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ba([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ba([{type:"Float32",name:"offsetX"}]),Ba([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ba([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const zc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var Oc=24,Dc=Bc,Rc=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=t[e+h];for(h+=d,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Fc=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m};function Bc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Bc.Varint=0,Bc.Fixed64=1,Bc.Bytes=2,Bc.Fixed32=5;var jc=4294967296,Nc=1/jc,Uc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Vc(t){return t.type===Bc.Bytes?t.readVarint()+t.pos:t.pos+1}function qc(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function $c(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Hc(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Wc(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Gc(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Yc(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Zc(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Xc(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Kc(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Jc(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Qc(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function tu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function eu(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ru(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Bc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=tu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ru(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=tu(this.buf,this.pos)+tu(this.buf,this.pos+4)*jc;return this.pos+=8,t},readSFixed64:function(){var t=tu(this.buf,this.pos)+ru(this.buf,this.pos+4)*jc;return this.pos+=8,t},readFloat:function(){var t=Rc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Rc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return qc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return qc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return qc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return qc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return qc(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return qc(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Uc?(t=this.buf,e=i,r=n,Uc.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Bc.Bytes)return t.push(this.readVarint(e));var r=Vc(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Bc.Bytes)return t.push(this.readSVarint());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Bc.Bytes)return t.push(this.readBoolean());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Bc.Bytes)return t.push(this.readFloat());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Bc.Bytes)return t.push(this.readDouble());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Bc.Bytes)return t.push(this.readFixed32());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Bc.Bytes)return t.push(this.readSFixed32());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Bc.Bytes)return t.push(this.readFixed64());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Bc.Bytes)return t.push(this.readSFixed64());var e=Vc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Bc.Varint)for(;this.buf[this.pos++]>127;);else if(e===Bc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Bc.Fixed32)this.pos+=4;else{if(e!==Bc.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),eu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),eu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),eu(this.buf,-1&t,this.pos),eu(this.buf,Math.floor(t*Nc),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),eu(this.buf,-1&t,this.pos),eu(this.buf,Math.floor(t*Nc),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n,i,a;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=r,(a=e).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&$c(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Fc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Fc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&$c(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Bc.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Wc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Zc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Gc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Yc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Xc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Kc,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Jc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Qc,e)},writeBytesField:function(t,e){this.writeTag(t,Bc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Bc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Bc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Bc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Bc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Bc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Bc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Bc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Bc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Bc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var nu,iu=n(Dc);function au(t,e,r){1===t&&r.readMessage(ou,e)}function ou(t,e,r){if(3===t){const{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(su,{});e.push({id:t,bitmap:new Js({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function su(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function lu(t){let e=0,r=0;for(const o of t)e+=o.w*o.h,r=Math.max(r,o.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let i=0,a=0;for(const o of t)for(let t=n.length-1;t>=0;t--){const e=n[t];if(!(o.w>e.w||o.h>e.h)){if(o.x=e.x,o.y=e.y,a=Math.max(a,o.y+o.h),i=Math.max(i,o.x+o.w),o.w===e.w&&o.h===e.h){const e=n.pop();t<n.length&&(n[t]=e)}else o.h===e.h?(e.x+=o.w,e.w-=o.w):o.w===e.w?(e.y+=o.h,e.h-=o.h):(n.push({x:e.x+o.w,y:e.y,w:e.w-o.w,h:o.h}),e.y+=o.h,e.h-=o.h);break}}return{w:i,h:a,fill:e/(i*a)||0}}class cu{constructor(t,e){let{pixelRatio:r,version:n,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=e;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class uu{constructor(t,e){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(t,r,i),this.addImages(e,n,i);const{w:a,h:o}=lu(i),s=new Qs({width:a||1,height:o||1});for(const l in t){const e=t[l],n=r[l].paddedRect;Qs.copy(e.data,s,{x:0,y:0},{x:n.x+1,y:n.y+1},e.data)}for(const l in e){const t=e[l],r=n[l].paddedRect,i=r.x+1,a=r.y+1,o=t.data.width,c=t.data.height;Qs.copy(t.data,s,{x:0,y:0},{x:i,y:a},t.data),Qs.copy(t.data,s,{x:0,y:c-1},{x:i,y:a-1},{width:o,height:1}),Qs.copy(t.data,s,{x:0,y:0},{x:i,y:a+c},{width:o,height:1}),Qs.copy(t.data,s,{x:o-1,y:0},{x:i-1,y:a},{width:1,height:c}),Qs.copy(t.data,s,{x:0,y:0},{x:i+o,y:a},{width:1,height:c})}this.image=s,this.iconPositions=r,this.patternPositions=n}addImages(t,e,r){for(const n in t){const i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new cu(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}patchUpdatedImage(t,e,r){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,i]=t.tl;r.update(e.data,void 0,{x:n,y:i})}}Mi("ImagePosition",cu),Mi("ImageAtlas",uu),t.ah=void 0,(nu=t.ah||(t.ah={}))[nu.none=0]="none",nu[nu.horizontal=1]="horizontal",nu[nu.vertical=2]="vertical",nu[nu.horizontalOnly=3]="horizontalOnly";const hu=-17;class du{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const r=new du;return r.scale=t||1,r.fontStack=e,r}static forImage(t){const e=new du;return e.imageName=t,e}}class pu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const r=new pu;for(let n=0;n<t.sections.length;n++){const i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let r=0;r<t.length;r++){const n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&da(n)&&!zc[t[r+1]]||i&&da(i)&&!zc[t[r-1]]||!zc[t[r]]?t[r]:zc[t[r]]}return e}(this.text)}trim(){let t=0;for(let r=0;r<this.text.length&&mu[this.text.charCodeAt(r)];r++)t++;let e=this.text.length;for(let r=this.text.length-1;r>=0&&r>=t&&mu[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const r=new pu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(du.forText(t.scale,t.fontStack||e));const r=this.sections.length-1;for(let n=0;n<t.text.length;++n)this.sectionIndex.push(r)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void E("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(du.forImage(e)),this.sectionIndex.push(this.sections.length-1)):E("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function fu(e,r,n,i,a,o,s,l,c,u,h,d,p,f,m){const g=pu.fromFeature(e,a);let y;d===t.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===g.sections.length){y=[];const t=v(g.toString(),ku(g,u,o,r,i,f));for(const e of t){const t=new pu;t.text=e,t.sections=g.sections;for(let r=0;r<e.length;r++)t.sectionIndex.push(0);y.push(t)}}else if(x){y=[];const t=x(g.text,g.sectionIndex,ku(g,u,o,r,i,f));for(const e of t){const t=new pu;t.text=e[0],t.sectionIndex=e[1],t.sections=g.sections,y.push(t)}}else y=function(t,e){const r=[],n=t.text;let i=0;for(const a of e)r.push(t.substring(i,a)),i=a;return i<n.length&&r.push(t.substring(i,n.length)),r}(g,ku(g,u,o,r,i,f));const b=[],_={positionedLines:b,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:d,iconsInText:!1,verticalizable:!1};return function(e,r,n,i,a,o,s,l,c,u,h,d){let p=0,f=hu,m=0,g=0;const y="right"===l?1:"left"===l?0:.5;let v=0;for(const k of a){k.trim();const a=k.getMaxScale(),s=(a-1)*Oc,l={positionedGlyphs:[],lineOffset:0};e.positionedLines[v]=l;const b=l.positionedGlyphs;let _=0;if(!k.length()){f+=o,++v;continue}for(let o=0;o<k.length();o++){const l=k.getSection(o),m=k.getSectionIndex(o),g=k.getCharCode(o);let y=0,v=null,w=null,T=null,S=Oc;const A=!(c===t.ah.horizontal||!h&&!ha(g)||h&&(mu[g]||(x=g,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(x)))));if(l.imageName){const t=i[l.imageName];if(!t)continue;T=l.imageName,e.iconsInText=e.iconsInText||!0,w=t.paddedRect;const r=t.displaySize;l.scale=l.scale*Oc/d,v={width:r[0],height:r[1],left:1,top:-3,advance:A?r[1]:r[0]},y=s+(Oc-r[1]*l.scale),S=v.advance;const n=A?r[0]*l.scale-Oc*a:r[1]*l.scale-Oc*a;n>0&&n>_&&(_=n)}else{const t=n[l.fontStack],e=t&&t[g];if(e&&e.rect)w=e.rect,v=e.metrics;else{const t=r[l.fontStack],e=t&&t[g];if(!e)continue;v=e.metrics}y=(a-l.scale)*Oc}A?(e.verticalizable=!0,b.push({glyph:g,imageName:T,x:p,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),p+=S*l.scale+u):(b.push({glyph:g,imageName:T,x:p,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),p+=v.advance*l.scale+u)}0!==b.length&&(m=Math.max(p-u,m),Su(b,0,b.length-1,y,_)),p=0;const w=o*a+_;l.lineOffset=Math.max(_,s),f+=w,g=Math.max(w,g),++v}var x;const b=f-hu,{horizontalAlign:_,verticalAlign:w}=Tu(s);(function(t,e,r,n,i,a,o,s,l){const c=(e-r)*i;let u=0;u=a!==o?-s*n-hu:(-n*l+.5)*o;for(const h of t)for(const t of h.positionedGlyphs)t.x+=c,t.y+=u})(e.positionedLines,y,_,w,m,g,o,b,a.length),e.top+=-w*b,e.bottom=e.top+b,e.left+=-_*m,e.right=e.left+m}(_,r,n,i,y,s,l,c,d,u,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(b)&&_}const mu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},gu={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},yu={40:!0};function vu(t,e,r,n,i,a){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*Oc/a+i:0}{const n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function xu(t,e,r,n){const i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function bu(t,e,r){let n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function _u(t,e,r,n,i,a){let o=null,s=xu(e,r,i,a);for(const l of n){const t=xu(e-l.x,r,i,a)+l.badness;t<=s&&(o=l,s=t)}return{index:t,x:e,priorBreak:o,badness:s}}function wu(t){return t?wu(t.priorBreak).concat(t.index):[]}function ku(t,e,r,n,i,a){if(!t)return[];const o=[],s=function(t,e,r,n,i,a){let o=0;for(let s=0;s<t.length();s++){const r=t.getSection(s);o+=vu(t.getCharCode(s),r,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,a),l=t.text.indexOf("\u200b")>=0;let c=0;for(let h=0;h<t.length();h++){const r=t.getSection(h),d=t.getCharCode(h);if(mu[d]||(c+=vu(d,r,n,i,e,a)),h<t.length()-1){const e=!((u=d)<11904)&&(!!ra(u)||!!Ji(u)||!!Xi(u)||!!Gi(u)||!!Ki(u)||!!ia(u)||!!Wi(u)||!!ea(u)||ua.test(String.fromCodePoint(u)));(gu[d]||e||r.imageName||h!==t.length()-2&&yu[t.getCharCode(h+1)])&&o.push(_u(h+1,c,s,o,bu(d,t.getCharCode(h+1),e&&l),!1))}}var u;return wu(_u(t.length(),c,s,o,0,!0))}function Tu(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Su(t,e,r,n,i){if(!n&&!i)return;const a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n;for(let s=e;s<=r;s++)t[s].x-=o,t[s].y+=i}function Au(t,e,r){const{horizontalAlign:n,verticalAlign:i}=Tu(r),a=e[0]-t.displaySize[0]*n,o=e[1]-t.displaySize[1]*i;return{image:t,top:o,bottom:o+t.displaySize[1],left:a,right:a+t.displaySize[0]}}function Mu(t){var e,r;let n=t.left,i=t.top,a=t.right-n,o=t.bottom-i;const s=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(r=t.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<c||"proportional"===s){const t=Math.ceil(o*c);n*=t/a,a=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&a/o>c){const t=Math.ceil(a/c);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Cu(t,e,r,n,i,a){const o=t.image;let s;if(o.content){const t=o.content,e=o.pixelRatio||1;s=[t[0]/e,t[1]/e,o.displaySize[0]-t[2]/e,o.displaySize[1]-t[3]/e]}const l=e.left*a,c=e.right*a;let u,h,d,p;"width"===r||"both"===r?(p=i[0]+l-n[3],h=i[0]+c+n[1]):(p=i[0]+(l+c-o.displaySize[0])/2,h=p+o.displaySize[0]);const f=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(u=i[1]+f-n[0],d=i[1]+m+n[2]):(u=i[1]+(f+m-o.displaySize[1])/2,d=u+o.displaySize[1]),{image:o,top:u,right:h,bottom:d,left:p,collisionPadding:s}}const Eu=128,Lu=32640;function Pu(t,e){const{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(t+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=r;let i=0;for(;i<e.length&&e[i]<=t;)i++;i=Math.max(0,i-1);let a=i;for(;a<e.length&&e[a]<t+1;)a++;a=Math.min(e.length-1,a);const o=e[i],s=e[a];return"composite"===r.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:n}:{kind:"camera",minZoom:o,maxZoom:s,minSize:r.evaluate(new va(o)),maxSize:r.evaluate(new va(s)),interpolationType:n}}}function Iu(t,e,r){let n="never";const i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}const zu=ql.VectorTileFeature.types,Ou=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Du(t,e,r,n,i,a,o,s,l,c,u,h,d){const p=s?Math.min(Lu,Math.round(s[0])):0,f=s?Math.min(Lu,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function Ru(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Fu(t){for(const e of t.sections)if(ga(e.text))return!0;return!1}class Bu{constructor(t){this.layoutVertexArray=new Eo,this.indexArray=new Oo,this.programConfigurations=t,this.segments=new Bo,this.dynamicLayoutVertexArray=new Lo,this.opacityVertexArray=new Po,this.hasVisibleVertices=!1,this.placedSymbolArray=new po}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Mc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Cc.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Ou,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Mi("SymbolBuffers",Bu);class ju{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Bo,this.collisionVertexArray=new zo}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Ec.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Mi("CollisionBuffers",ju);class Nu{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=js([]),this.placementViewportMatrix=js([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Pu(this.zoom,r["text-size"]),this.iconSizeData=Pu(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Iu(n,"text-overlap","text-allow-overlap")||"never"!==Iu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((e=>t.ah[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Bu(new us(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Bu(new us(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(t,e,r,n,i){for(let a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){const r=zc[t.charAt(a)];r&&(e[r.charCodeAt(0)]=!0)}}populate(e,r,n){const i=this.layers[0],a=i.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof re&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const d=r.iconDependencies,p=r.glyphDependencies,f=r.availableImages,m=new va(this.zoom);for(const{feature:g,id:y,index:v,sourceLayerIndex:x}of e){const e=i._featureFilter.needGeometry,r=ys(g,e);if(!i._featureFilter.filter(m,r,n))continue;let s,l;if(e||(r.geometry=gs(g)),c){const t=i.getValueAndResolveTokens("text-field",r,n,f),e=re.factory(t),a=this.hasRTLText=this.hasRTLText||Fu(e);(!a||"unavailable"===ya.getRTLTextPluginStatus()||a&&ya.isParsed())&&(s=Ic(e,i,r))}if(u){const t=i.getValueAndResolveTokens("icon-image",r,n,f);l=t instanceof oe?t:oe.fromString(t)}if(!s&&!l)continue;const b=this.sortFeaturesByKey?h.evaluate(r,{},n):void 0;if(this.features.push({id:y,text:s,icon:l,index:v,sourceLayerIndex:x,geometry:r.geometry,properties:g.properties,type:zu[g.type],sortKey:b}),l&&(d[l.name]=!0),s){const e=o.evaluate(r,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const t of s.sections)if(t.image)d[t.image.name]=!0;else{const r=aa(s.toString()),n=t.fontStack||e,a=p[n]=p[n]||{};this.calculateGlyphDependencies(t.text,a,i,this.allowVerticalPlacement,r)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){const e={},r={},n=[];let i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){const a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){const a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){const n=r?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){a(c);continue}const p=l(d,h),f=l(d,h,!0);if(p in r&&f in e&&r[p]!==e[f]){const t=s(p,f,h),i=o(p,f,n[t].geometry);delete e[p],delete r[f],r[l(d,n[i].geometry,!0)]=i,n[t].geometry=null}else p in r?o(p,f,h):f in e?s(p,f,h):(a(c),e[p]=i-1,r[f]=i-1)}return n.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const i={};for(let a=t.segment+1;a<e.length;a++)i[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(let a=t.segment||0;a>=0;a--)i[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a>0&&(n+=e[a-1].dist(e[a]));for(let t=0;t<e.length;t++){const e=i[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,r,n,i,a,o,s,l,c,u,h,d){const p=e.indexArray,f=e.layoutVertexArray,m=e.segments.prepareSegment(4*r.length,f,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,y=m.vertexLength,v=this.allowVerticalPlacement&&s===t.ah.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let t=0;t<r.length;t++){const{tl:i,tr:a,bl:s,br:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:b,glyphOffset:_,isSDF:w,sectionIndex:k}=r[t],T=m.vertexLength,S=_[1];Du(f,l.x,l.y,i.x,S+i.y,u.x,u.y,n,w,h.x,h.y,y,b),Du(f,l.x,l.y,a.x,S+a.y,u.x+u.w,u.y,n,w,g.x,h.y,y,b),Du(f,l.x,l.y,s.x,S+s.y,u.x,u.y+u.h,n,w,h.x,g.y,y,b),Du(f,l.x,l.y,c.x,S+c.y,u.x+u.w,u.y+u.h,n,w,g.x,g.y,y,b),Ru(e.dynamicLayoutVertexArray,l,v),p.emplaceBack(T,T+1,T+2),p.emplaceBack(T+1,T+2,T+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_[0]),t!==r.length-1&&k===r[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(f.length,o,o.index,{},d,x&&x[k])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,y,c,u,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,h)}_addCollisionDebugVertex(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,n,i,a,o){const s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=s.vertexLength,c=i.layoutVertexArray,u=i.collisionVertexArray,d=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(c,u,a,d,p,new h(t,e)),this._addCollisionDebugVertex(c,u,a,d,p,new h(r,e)),this._addCollisionDebugVertex(c,u,a,d,p,new h(r,n)),this._addCollisionDebugVertex(c,u,a,d,p,new h(t,n)),s.vertexLength+=4;const f=i.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,n){for(let i=t;i<e;i++){const t=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,n?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ju(Io,Lc.members,Do),this.iconCollisionBox=new ju(Io,Lc.members,Do);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,n,i,a,o,s,l){const c={};for(let u=e;u<r;u++){const e=t.get(u);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let u=n;u<i;u++){const e=t.get(u);c.verticalTextBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalTextFeatureIndex=e.featureIndex;break}for(let u=a;u<o;u++){const e=t.get(u);c.iconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.iconFeatureIndex=e.featureIndex;break}for(let u=s;u<l;u++){const e=t.get(u);c.verticalIconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalIconFeatureIndex=e.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[];for(let o=0;o<this.symbolInstances.length;++o){a.push(o);const t=this.symbolInstances.get(o);n.push(0|Math.round(e*t.anchorX+r*t.anchorY)),i.push(t.featureIndex)}return a.sort(((t,e)=>n[t]-n[e]||i[e]-i[t])),a}addToSortKeyRanges(t,e){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Uu,Vu;Mi("SymbolBucket",Nu,{omit:["layers","collisionBoxArray","features","compareText"]}),Nu.MAX_GLYPHS=65535,Nu.addDynamicAttributes=Ru;var qu={get paint(){return Vu=Vu||new Ia({"icon-opacity":new Ca(J.paint_symbol["icon-opacity"]),"icon-color":new Ca(J.paint_symbol["icon-color"]),"icon-halo-color":new Ca(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ca(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ca(J.paint_symbol["icon-halo-blur"]),"icon-translate":new Ma(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ma(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ca(J.paint_symbol["text-opacity"]),"text-color":new Ca(J.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ca(J.paint_symbol["text-halo-color"]),"text-halo-width":new Ca(J.paint_symbol["text-halo-width"]),"text-halo-blur":new Ca(J.paint_symbol["text-halo-blur"]),"text-translate":new Ma(J.paint_symbol["text-translate"]),"text-translate-anchor":new Ma(J.paint_symbol["text-translate-anchor"])})},get layout(){return Uu=Uu||new Ia({"symbol-placement":new Ma(J.layout_symbol["symbol-placement"]),"symbol-spacing":new Ma(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ma(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ca(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ma(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ma(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ma(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ma(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ma(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ma(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ca(J.layout_symbol["icon-size"]),"icon-text-fit":new Ma(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ma(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ca(J.layout_symbol["icon-image"]),"icon-rotate":new Ca(J.layout_symbol["icon-rotate"]),"icon-padding":new Ca(J.layout_symbol["icon-padding"]),"icon-keep-upright":new Ma(J.layout_symbol["icon-keep-upright"]),"icon-offset":new Ca(J.layout_symbol["icon-offset"]),"icon-anchor":new Ca(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ma(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ma(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ma(J.layout_symbol["text-rotation-alignment"]),"text-field":new Ca(J.layout_symbol["text-field"]),"text-font":new Ca(J.layout_symbol["text-font"]),"text-size":new Ca(J.layout_symbol["text-size"]),"text-max-width":new Ca(J.layout_symbol["text-max-width"]),"text-line-height":new Ma(J.layout_symbol["text-line-height"]),"text-letter-spacing":new Ca(J.layout_symbol["text-letter-spacing"]),"text-justify":new Ca(J.layout_symbol["text-justify"]),"text-radial-offset":new Ca(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ma(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ca(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ca(J.layout_symbol["text-anchor"]),"text-max-angle":new Ma(J.layout_symbol["text-max-angle"]),"text-writing-mode":new Ma(J.layout_symbol["text-writing-mode"]),"text-rotate":new Ca(J.layout_symbol["text-rotate"]),"text-padding":new Ma(J.layout_symbol["text-padding"]),"text-keep-upright":new Ma(J.layout_symbol["text-keep-upright"]),"text-transform":new Ca(J.layout_symbol["text-transform"]),"text-offset":new Ca(J.layout_symbol["text-offset"]),"text-allow-overlap":new Ma(J.layout_symbol["text-allow-overlap"]),"text-overlap":new Ma(J.layout_symbol["text-overlap"]),"text-ignore-placement":new Ma(J.layout_symbol["text-ignore-placement"]),"text-optional":new Ma(J.layout_symbol["text-optional"])})}};class $u{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:ft,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Mi("FormatSectionOverride",$u,{omit:["defaultValue"]});class Hu extends Oa{constructor(t){super(t,qu)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,r,n){const i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||Sn(a.value)||!i?i:(o=e.properties,i.replace(/{([^{}]+)}/g,((t,e)=>o&&e in o?String(o[e]):"")));var o}createBucket(t){return new Nu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of qu.paint.overridableProperties){if(!Hu.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),r=new $u(e),n=new Tn(r,e.property.specification);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Mn("source",n):new Cn("composite",n,e.value.zoomStops),this.paint._values[t]=new Sa(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Hu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const r=t.get("text-field"),n=qu.paint.properties[e];let i=!1;const a=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof re)a(r.value.value.sections);else if("source"===r.value.kind){const t=e=>{i||(e instanceof he&&ce(e.value)===wt?a(e.value.sections):e instanceof Ke?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Wu;var Gu={get paint(){return Wu=Wu||new Ia({"background-color":new Ma(J.paint_background["background-color"]),"background-pattern":new La(J.paint_background["background-pattern"]),"background-opacity":new Ma(J.paint_background["background-opacity"])})}};class Yu extends Oa{constructor(t){super(t,Gu)}}let Zu;var Xu={get paint(){return Zu=Zu||new Ia({"raster-opacity":new Ma(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ma(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ma(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ma(J.paint_raster["raster-brightness-max"]),"raster-saturation":new Ma(J.paint_raster["raster-saturation"]),"raster-contrast":new Ma(J.paint_raster["raster-contrast"]),"raster-resampling":new Ma(J.paint_raster["raster-resampling"]),"raster-fade-duration":new Ma(J.paint_raster["raster-fade-duration"])})}};class Ku extends Oa{constructor(t){super(t,Xu)}}class Ju extends Oa{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Qu{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const th=6371008.8;class eh{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new eh(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return th*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof eh)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new eh(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new eh(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const rh=2*Math.PI*th;function nh(t){return rh*Math.cos(t*Math.PI/180)}function ih(t){return(180+t)/360}function ah(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function oh(t,e){return t/nh(e)}function sh(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class lh{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=eh.convert(t);return new lh(ih(r.lng),ah(r.lat),oh(e,r.lat))}toLngLat(){return new eh(360*this.x-180,sh(this.y))}toAltitude(){return this.z*nh(sh(this.y))}meterInMercatorCoordinateUnits(){return 1/rh*(t=sh(this.y),1/Math.cos(t*Math.PI/180));var t}}function ch(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class uh{constructor(t,e,r){if(i=e,a=r,(n=t)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var n,i,a;this.z=t,this.x=e,this.y=r,this.key=ph(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){const n=(a=this.y,o=this.z,s=ch(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=ch(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;const c=function(t,e,r){let n,i="";for(let a=t;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new h((t.x*e-this.x)*ps,(t.y*e-this.y)*ps)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hh{constructor(t,e){this.wrap=t,this.canonical=e,this.key=ph(t,e.z,e.z,e.x,e.y)}}class dh{constructor(t,e,r,n,i){if(t<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=e,this.canonical=new uh(r,+n,+i),this.key=ph(e,t,r,n,i)}clone(){return new dh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new dh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new dh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?ph(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ph(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new dh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new dh(e,this.wrap,e,r,n),new dh(e,this.wrap,e,r+1,n),new dh(e,this.wrap,e,r,n+1),new dh(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new dh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new dh(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new lh(t.x-this.wrap,t.y))}}function ph(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);const a=1<<r;return(a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}Mi("CanonicalTileID",uh),Mi("OverscaledTileID",dh,{omit:["posMatrix"]});class fh{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void E(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;const s=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;l<s;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(s,l)]=this.data[this._idx(s-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,s)]=this.data[this._idx(l,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let l=0;l<s;l++)for(let t=0;t<s;t++){const e=this.get(l,t);e>this.max&&(this.max=e),e<this.min&&(this.min=e)}}get(t,e){const r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return this.unpack(r[n],r[n+1],r[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,r){return t*this.redFactor+e*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Qs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}const s=-e*this.dim,l=-r*this.dim;for(let c=a;c<o;c++)for(let e=n;e<i;e++)this.data[this._idx(e,c)]=t.data[this._idx(e+s,c+l)]}}Mi("DEMData",fh);class mh{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class gh{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class yh{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Si(ps,16,0),this.grid3D=new Si(ps,16,0),this.featureIndexArray=new _o,this.promoteId=e}insert(t,e,r,n,i,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const s=a?this.grid3D:this.grid;for(let l=0;l<e.length;l++){const t=e[l],r=[1/0,1/0,-1/0,-1/0];for(let e=0;e<t.length;e++){const n=t[e];r[0]=Math.min(r[0],n.x),r[1]=Math.min(r[1],n.y),r[2]=Math.max(r[2],n.x),r[3]=Math.max(r[3],n.y)}r[0]<ps&&r[1]<ps&&r[2]>=0&&r[3]>=0&&s.insert(o,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ql.VectorTile(new iu(this.rawTileData)).layers,this.sourceLayerCoder=new mh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const i=t.params||{},a=ps/t.tileSize/t.scale,o=On(i.filter),s=t.queryGeometry,l=t.queryPadding*a,c=xh(s),u=this.grid.query(c.minX-l,c.minY-l,c.maxX+l,c.maxY+l),d=xh(t.cameraQueryGeometry),p=this.grid3D.query(d.minX-l,d.minY-l,d.maxX+l,d.maxY+l,((e,r,n,i)=>function(t,e,r,n,i){for(const o of t)if(e<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const a=[new h(e,r),new h(e,i),new h(n,i),new h(n,r)];if(t.length>2)for(const o of a)if(Es(t,o))return!0;for(let o=0;o<t.length-1;o++)if(Ls(t[o],t[o+1],a))return!0;return!1}(t.cameraQueryGeometry,e-l,r-l,n+l,i+l)));for(const h of p)u.push(h);u.sort(bh);const f={};let m;for(let h=0;h<u.length;h++){const l=u[h];if(l===m)continue;m=l;const c=this.featureIndexArray.get(l);let d=null;this.loadMatchingFeature(f,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,o,i.layers,i.availableImages,e,r,n,((e,r,n)=>(d||(d=gs(e)),r.queryIntersectsFeature(s,e,n,d,this.z,t.transform,a,t.pixelPosMatrix))))}return f}loadMatchingFeature(t,e,r,n,i,a,o,s,l,c,u){const h=this.bucketLayerIDs[e];if(a&&!function(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,h))return;const d=this.sourceLayerCoder.decode(r),p=this.vtLayers[d].feature(n);if(i.needGeometry){const t=ys(p,!0);if(!i.filter(new va(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),p))return;const f=this.getId(p,d);for(let m=0;m<h.length;m++){const e=h[m];if(a&&a.indexOf(e)<0)continue;const r=s[e];if(!r)continue;let i={};f&&c&&(i=c.getState(r.sourceLayer||"_geojsonTileLayer",f));const d=k({},l[e]);d.paint=vh(d.paint,r.paint,p,i,o),d.layout=vh(d.layout,r.layout,p,i,o);const g=!u||u(p,r,i);if(!g)continue;const y=new gh(p,this.z,this.x,this.y,f);y.layer=d;let v=t[e];void 0===v&&(v=t[e]=[]),v.push({featureIndex:n,feature:y,intersectionZ:g})}}lookupSymbolFeatures(t,e,r,n,i,a,o,s){const l={};this.loadVTLayers();const c=On(i);for(const u of t)this.loadMatchingFeature(l,r,n,u,c,a,o,s,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r))),r}}function vh(t,e,r,n,i){return S(t,((t,a)=>{const o=e instanceof Aa?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function xh(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:r,maxX:n,maxY:i}}function bh(t,e){return e-t}function _h(t,e,r,n,i){const a=[];for(let o=0;o<t.length;o++){const s=t[o];let l;for(let t=0;t<s.length-1;t++){let o=s[t],c=s[t+1];o.x<e&&c.x<e||(o.x<e?o=new h(e,o.y+(e-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x<e&&(c=new h(e,o.y+(e-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y<r&&c.y<r||(o.y<r?o=new h(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round():c.y<r&&(c=new h(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round()),o.x>=n&&c.x>=n||(o.x>=n?o=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x>=n&&(c=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y>=i&&c.y>=i||(o.y>=i?o=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round():c.y>=i&&(c=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round()),l&&o.equals(l[l.length-1])||(l=[o],a.push(l)),l.push(c)))))}}return a}Mi("FeatureIndex",yh,{omit:["rawTileData","sourceLayerCoder"]});class wh extends h{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new wh(this.x,this.y,this.angle,this.segment)}}function kh(t,e,r,n,i){if(void 0===e.segment||0===r)return!0;let a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;const l=[];let c=0;for(;s<r/2;){const e=t[o],r=t[o+1];if(!r)return!1;let a=t[o-1].angleTo(e)-e.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:a}),c+=a;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=e.dist(r)}return!0}function Th(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Sh(t,e,r){return t?.6*e*r:0}function Ah(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Mh(t,e,r,n,i,a){const o=Sh(r,i,a),s=Ah(r,n)*a;let l=0;const c=Th(t)/2;for(let u=0;u<t.length-1;u++){const r=t[u],n=t[u+1],i=r.dist(n);if(l+i>c){const a=(c-l)/i,h=Re.number(r.x,n.x,a),d=Re.number(r.y,n.y,a),p=new wh(h,d,n.angleTo(r),u);return p._round(),!o||kh(t,p,s,o,e)?p:void 0}l+=i}}function Ch(t,e,r,n,i,a,o,s,l){const c=Sh(n,a,o),u=Ah(n,i),h=u*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),Eh(t,d?e/2*s%e:(u/2+2*a)*o*s%e,e,c,r,h,d,!1,l)}function Eh(t,e,r,n,i,a,o,s,l){const c=a/2,u=Th(t);let h=0,d=e-r,p=[];for(let f=0;f<t.length-1;f++){const e=t[f],o=t[f+1],s=e.dist(o),m=o.angleTo(e);for(;d+r<h+s;){d+=r;const g=(d-h)/s,y=Re.number(e.x,o.x,g),v=Re.number(e.y,o.y,g);if(y>=0&&y<l&&v>=0&&v<l&&d-c>=0&&d+c<=u){const e=new wh(y,v,m,f);e._round(),n&&!kh(t,e,a,n,i)||p.push(e)}}h+=s}return s||p.length||o||(p=Eh(t,h/2,r,n,i,a,o,!0,l)),p}function Lh(t,e,r,n){const i=[],a=t.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2;let c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const u=a.stretchX||[[0,s]],d=a.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],f=u.reduce(p,0),m=d.reduce(p,0),g=s-f,y=l-m;let v=0,x=f,b=0,_=m,w=0,k=g,T=0,S=y;if(a.content&&n){const e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(c=Mu(t)),v=Ph(u,0,e[0]),b=Ph(d,0,e[1]),x=Ph(u,e[0],e[2]),_=Ph(d,e[1],e[3]),w=e[0]-v,T=e[1]-b,k=r-x,S=n-_}const A=c.x1,M=c.y1,C=c.x2-A,E=c.y2-M,L=(t,n,i,s)=>{const l=zh(t.stretch-v,x,C,A),c=Oh(t.fixed-w,k,t.stretch,f),u=zh(n.stretch-b,_,E,M),d=Oh(n.fixed-T,S,n.stretch,m),p=zh(i.stretch-v,x,C,A),g=Oh(i.fixed-w,k,i.stretch,f),y=zh(s.stretch-b,_,E,M),L=Oh(s.fixed-T,S,s.stretch,m),P=new h(l,u),I=new h(p,u),z=new h(p,y),O=new h(l,y),D=new h(c/o,d/o),R=new h(g/o,L/o),F=e*Math.PI/180;if(F){const t=Math.sin(F),e=Math.cos(F),r=[e,-t,t,e];P._matMult(r),I._matMult(r),O._matMult(r),z._matMult(r)}const B=t.stretch+t.fixed,j=n.stretch+n.fixed;return{tl:P,tr:I,bl:O,br:z,tex:{x:a.paddedRect.x+1+B,y:a.paddedRect.y+1+j,w:i.stretch+i.fixed-B,h:s.stretch+s.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:k/o/C,minFontScaleY:S/o/E,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const t=Ih(u,g,f),e=Ih(d,y,m);for(let r=0;r<t.length-1;r++){const n=t[r],a=t[r+1];for(let t=0;t<e.length-1;t++)i.push(L(n,e[t],a,e[t+1]))}}else i.push(L({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return i}function Ph(t,e,r){let n=0;for(const i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function Ih(t,e,r){const n=[{fixed:-1,stretch:0}];for(const[i,a]of t){const t=n[n.length-1];n.push({fixed:i-t.stretch,stretch:t.stretch}),n.push({fixed:i-t.stretch,stretch:t.stretch+(a-i)})}return n.push({fixed:e+1,stretch:r}),n}function zh(t,e,r,n){return t/e*r+n}function Oh(t,e,r,n){return t-e*r/n}Mi("Anchor",wh);class Dh{constructor(t,e,r,n,i,a,o,s,l,c){var u;if(this.boxStartIndex=t.length,l){let t=a.top,e=a.bottom;const r=a.collisionPadding;r&&(t-=r[1],e+=r[3]);let n=e-t;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const l=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?Mu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];const d=a.collisionPadding;if(d&&(l.x1-=d[0]*o,l.y1-=d[1]*o,l.x2+=d[2]*o,l.y2+=d[3]*o),c){const t=new h(l.x1,l.y1),e=new h(l.x2,l.y1),r=new h(l.x1,l.y2),n=new h(l.x2,l.y2),i=c*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(t.x,e.x,r.x,n.x),l.x2=Math.max(t.x,e.x,r.x,n.x),l.y1=Math.min(t.y,e.y,r.y,n.y),l.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=t.length}}class Rh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t<e?-1:t>e?1:0;if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1);const a=n+1;if(a<this.length&&r(e[a],e[n])<0&&(n=a),r(e[n],i)>=0)break;e[t]=e[n],t=n}e[t]=i}}function Fh(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1/0,i=1/0,a=-1/0,o=-1/0;const s=t[0];for(let h=0;h<s.length;h++){const t=s[h];(!h||t.x<n)&&(n=t.x),(!h||t.y<i)&&(i=t.y),(!h||t.x>a)&&(a=t.x),(!h||t.y>o)&&(o=t.y)}const l=Math.min(a-n,o-i);let c=l/2;const u=new Rh([],Bh);if(0===l)return new h(n,i);for(let h=n;h<a;h+=l)for(let e=i;e<o;e+=l)u.push(new jh(h+c,e+c,c,t));let d=function(t){let e=0,r=0,n=0;const i=t[0];for(let a=0,o=i.length,s=o-1;a<o;s=a++){const t=i[a],o=i[s],l=t.x*o.y-o.x*t.y;r+=(t.x+o.x)*l,n+=(t.y+o.y)*l,e+=3*l}return new jh(r/e,n/e,0,t)}(t),p=u.length;for(;u.length;){const n=u.pop();(n.d>d.d||!d.d)&&(d=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-d.d<=e||(c=n.h/2,u.push(new jh(n.p.x-c,n.p.y-c,c,t)),u.push(new jh(n.p.x+c,n.p.y-c,c,t)),u.push(new jh(n.p.x-c,n.p.y+c,c,t)),u.push(new jh(n.p.x+c,n.p.y+c,c,t)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${d.d}`)),d.p}function Bh(t,e){return e.max-t.max}function jh(t,e,r,n){this.p=new h(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){const a=e[i];for(let e=0,i=a.length,o=i-1;e<i;o=e++){const i=a[e],s=a[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Ms(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Nh;t.aq=void 0,(Nh=t.aq||(t.aq={}))[Nh.center=1]="center",Nh[Nh.left=2]="left",Nh[Nh.right=3]="right",Nh[Nh.top=4]="top",Nh[Nh.bottom=5]="bottom",Nh[Nh["top-left"]=6]="top-left",Nh[Nh["top-right"]=7]="top-right",Nh[Nh["bottom-left"]=8]="bottom-left",Nh[Nh["bottom-right"]=9]="bottom-right";const Uh=Number.POSITIVE_INFINITY;function Vh(t,e){return e[1]!==Uh?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);const i=e/Math.SQRT2;switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function qh(t,e,r){var n;const i=t.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(e,{},r);if(a){const t=a.values,e=[];for(let r=0;r<t.length;r+=2){const n=e[r]=t[r],i=t[r+1].map((t=>t*Oc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),e[r+1]=i}return new ae(e)}const o=i.get("text-variable-anchor");if(o){let n;n=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(e,{},r)*Oc,Uh]:i.get("text-offset").evaluate(e,{},r).map((t=>t*Oc));const a=[];for(const t of o)a.push(t,Vh(t,n));return new ae(a)}return null}function $h(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hh(e,r,n,i,a,o,s,l,c,u,h){let d=o.textMaxSize.evaluate(r,{});void 0===d&&(d=s);const p=e.layers[0].layout,f=p.get("icon-offset").evaluate(r,{},h),m=Gh(n.horizontal),g=s/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*d/24,x=e.tilePixelRatio*l,b=e.tilePixelRatio*p.get("symbol-spacing"),_=p.get("text-padding")*e.tilePixelRatio,w=function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=t.get("icon-padding").evaluate(e,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(p,r,h,e.tilePixelRatio),k=p.get("text-max-angle")/180*Math.PI,T="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),S="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),A=p.get("symbol-placement"),M=b/2,C=p.get("icon-text-fit");let L;i&&"none"!==C&&(e.allowVerticalPlacement&&n.vertical&&(L=Cu(i,n.vertical,C,p.get("icon-text-fit-padding"),f,g)),m&&(i=Cu(i,m,C,p.get("icon-text-fit-padding"),f,g)));const P=(l,d)=>{d.x<0||d.x>=ps||d.y<0||d.y>=ps||function(e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x,b,_,w,k,T,S){const A=e.addToLineVertexArray(r,n);let M,C,L,P,I=0,z=0,O=0,D=0,R=-1,F=-1;const B={};let j=Go("");if(e.allowVerticalPlacement&&i.vertical){const t=l.layout.get("text-rotate").evaluate(_,{},T)+90;L=new Dh(c,r,u,h,d,i.vertical,p,f,m,t),s&&(P=new Dh(c,r,u,h,d,s,y,v,m,t))}if(a){const n=l.layout.get("icon-rotate").evaluate(_,{}),i="none"!==l.layout.get("icon-text-fit"),o=Lh(a,n,k,i),p=s?Lh(s,n,k,i):void 0;C=new Dh(c,r,u,h,d,a,y,v,!1,n),I=4*o.length;const f=e.iconSizeData;let m=null;"source"===f.kind?(m=[Eu*l.layout.get("icon-size").evaluate(_,{})],m[0]>Lu&&E(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[Eu*w.compositeIconSizes[0].evaluate(_,{},T),Eu*w.compositeIconSizes[1].evaluate(_,{},T)],(m[0]>Lu||m[1]>Lu)&&E(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,m,b,x,_,t.ah.none,r,A.lineStartIndex,A.lineLength,-1,T),R=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,b,x,_,t.ah.vertical,r,A.lineStartIndex,A.lineLength,-1,T),F=e.icon.placedSymbolArray.length-1)}const N=Object.keys(i.horizontal);for(const E of N){const n=i.horizontal[E];if(!M){j=Go(n.text);const t=l.layout.get("text-rotate").evaluate(_,{},T);M=new Dh(c,r,u,h,d,n,p,f,m,t)}const a=1===n.positionedLines.length;if(O+=Wh(e,r,n,o,l,m,_,g,A,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,a?N:[E],B,R,w,T),a)break}i.vertical&&(D+=Wh(e,r,i.vertical,o,l,m,_,g,A,t.ah.vertical,["vertical"],B,F,w,T));const U=M?M.boxStartIndex:e.collisionBoxArray.length,V=M?M.boxEndIndex:e.collisionBoxArray.length,q=L?L.boxStartIndex:e.collisionBoxArray.length,$=L?L.boxEndIndex:e.collisionBoxArray.length,H=C?C.boxStartIndex:e.collisionBoxArray.length,W=C?C.boxEndIndex:e.collisionBoxArray.length,G=P?P.boxStartIndex:e.collisionBoxArray.length,Y=P?P.boxEndIndex:e.collisionBoxArray.length;let Z=-1;const X=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;Z=X(M,Z),Z=X(L,Z),Z=X(C,Z),Z=X(P,Z);const K=Z>-1?1:0;K&&(Z*=S/Oc),e.glyphOffsetArray.length>=Nu.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,_.sortKey);const J=qh(l,_,T),[Q,tt]=function(e,r){const n=e.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let a=0;a<i.length;a+=2){const r=i[a+1];e.emplaceBack(t.aq[i[a]],r[0],r[1])}return[n,e.length]}(e.textAnchorOffsets,J);e.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,U,V,q,$,H,W,G,Y,u,O,D,I,z,K,0,p,Z,Q,tt)}(e,d,l,n,i,a,L,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,y,[_,_,_,_],T,c,x,w,S,f,r,o,u,h,s)};if("line"===A)for(const t of _h(r.geometry,0,0,ps,ps)){const r=Ch(t,b,k,n.vertical||m,i,24,v,e.overscaling,ps);for(const n of r)m&&Yh(e,m.text,M,n)||P(t,n)}else if("line-center"===A){for(const t of r.geometry)if(t.length>1){const e=Mh(t,k,n.vertical||m,i,24,v);e&&P(t,e)}}else if("Polygon"===r.type)for(const t of Tr(r.geometry,0)){const e=Fh(t,16);P(t[0],new wh(e.x,e.y,0))}else if("LineString"===r.type)for(const t of r.geometry)P(t,new wh(t[0].x,t[0].y,0));else if("Point"===r.type)for(const t of r.geometry)for(const e of t)P([e],new wh(e.x,e.y,0))}function Wh(t,e,r,n,i,a,o,s,l,c,u,d,p,f,m){const g=function(t,e,r,n,i,a,o,s){const l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[];for(const u of e.positionedLines)for(const t of u.positionedGlyphs){if(!t.rect)continue;const n=t.rect||{};let a=4,d=!0,p=1,f=0;const m=(i||s)&&t.vertical,g=t.metrics.advance*t.scale/2;if(s&&e.verticalizable&&(f=u.lineOffset/2-(t.imageName?-(Oc-t.metrics.width*t.scale)/2:(t.scale-1)*Oc)),t.imageName){const e=o[t.imageName];d=e.sdf,p=e.pixelRatio,a=1/p}const y=i?[t.x+g,t.y]:[0,0];let v=i?[0,0]:[t.x+g+r[0],t.y+r[1]-f],x=[0,0];m&&(x=v,v=[0,0]);const b=t.metrics.isDoubleResolution?2:1,_=(t.metrics.left-a)*t.scale-g+v[0],w=(-t.metrics.top-a)*t.scale+v[1],k=_+n.w/b*t.scale/p,T=w+n.h/b*t.scale/p,S=new h(_,w),A=new h(k,w),M=new h(_,T),C=new h(k,T);if(m){const e=new h(-g,g-hu),r=-Math.PI/2,n=12-g,i=new h(22-n,-(t.imageName?n:0)),a=new h(...x);S._rotateAround(r,e)._add(i)._add(a),A._rotateAround(r,e)._add(i)._add(a),M._rotateAround(r,e)._add(i)._add(a),C._rotateAround(r,e)._add(i)._add(a)}if(l){const t=Math.sin(l),e=Math.cos(l),r=[e,-t,t,e];S._matMult(r),A._matMult(r),M._matMult(r),C._matMult(r)}const E=new h(0,0),L=new h(0,0);c.push({tl:S,tr:A,bl:M,br:C,tex:n,writingMode:e.writingMode,glyphOffset:y,sectionIndex:t.sectionIndex,isSDF:d,pixelOffsetTL:E,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}return c}(0,r,s,i,a,o,n,t.allowVerticalPlacement),y=t.textSizeData;let v=null;"source"===y.kind?(v=[Eu*i.layout.get("text-size").evaluate(o,{})],v[0]>Lu&&E(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Eu*f.compositeTextSizes[0].evaluate(o,{},m),Eu*f.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>Lu||v[1]>Lu)&&E(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,s,a,o,c,e,l.lineStartIndex,l.lineLength,p,m);for(const h of u)d[h]=t.text.placedSymbolArray.length-1;return 4*g.length}function Gh(t){for(const e in t)return t[e];return null}function Yh(t,e,r,n){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<r)return!0}else i[e]=[];return i[e].push(n),!1}const Zh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Xh{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,r]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Zh[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Xh(o,a,i,t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,n=arguments.length>3?arguments[3]:void 0;if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Zh.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Kh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){const s=a[2*o],c=a[2*o+1];s>=t&&s<=r&&c>=e&&c<=n&&l.push(i[o])}continue}const d=h+u>>1,p=a[2*d],f=a[2*d+1];p>=t&&p<=r&&f>=e&&f<=n&&l.push(i[d]),(0===c?t<=p:e<=f)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?r>=p:n>=f)&&(s.push(d+1),s.push(u),s.push(1-c))}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){const c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)ed(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}const d=h+u>>1,p=i[2*d],f=i[2*d+1];ed(p,f,t,e)<=l&&s.push(n[d]),(0===c?t-r<=p:e-r<=f)&&(o.push(h),o.push(d-1),o.push(1-c)),(0===c?t+r>=p:e+r>=f)&&(o.push(d+1),o.push(u),o.push(1-c))}return s}}function Kh(t,e,r,n,i,a){if(i-n<=r)return;const o=n+i>>1;Jh(t,e,o,n,i,a),Kh(t,e,r,n,o-1,1-a),Kh(t,e,r,o+1,i,1-a)}function Jh(t,e,r,n,i,a){for(;i>n;){if(i-n>600){const o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Jh(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}const o=e[2*r+a];let s=n,l=i;for(Qh(t,e,n,r),e[2*i+a]>o&&Qh(t,e,n,i);s<l;){for(Qh(t,e,s,l),s++,l--;e[2*s+a]<o;)s++;for(;e[2*l+a]>o;)l--}e[2*n+a]===o?Qh(t,e,n,l):(l++,Qh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Qh(t,e,r,n){td(t,r,n),td(e,2*r,2*n),td(e,2*r+1,2*n+1)}function td(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function ed(t,e,r,n){const i=t-r,a=e-n;return i*i+a*a}var rd;t.bg=void 0,(rd=t.bg||(t.bg={})).create="create",rd.load="load",rd.fullLoad="fullLoad";let nd=null,id=[];const ad=1e3/60,od="loadTime",sd="fullLoadTime",ld={mark(t){performance.mark(t)},frame(t){const e=t;null!=nd&&id.push(e-nd),nd=e},clearMetrics(){nd=null,id=[],performance.clearMeasures(od),performance.clearMeasures(sd);for(const e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(od,t.bg.create,t.bg.load),performance.measure(sd,t.bg.create,t.bg.fullLoad);const e=performance.getEntriesByName(od)[0].duration,r=performance.getEntriesByName(sd)[0].duration,n=id.length,i=1/(id.reduce(((t,e)=>t+e),0)/n/1e3),a=id.filter((t=>t>ad)).reduce(((t,e)=>t+(e-ad)/ad),0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Va{},t.A=Bs,t.B=_i,t.C=function(t){if(null==I){const e=t.navigator?t.navigator.userAgent:null;I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return I},t.D=Ma,t.E=K,t.F=class{constructor(t,e){var r,n,i;this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Qu((()=>this.process())),this.subscription=(r=this.target,n="message",i=t=>this.receive(t),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=P(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},e&&e.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const e={id:i,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),{once:!0});const a=[],o=Object.assign(Object.assign({},t),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Pi(t.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(t){const e=t.data,r=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[r];const t=this.abortControllers[r];return delete this.abortControllers[r],void(t&&t.abort())}if(P(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,r){return e(this,void 0,void 0,(function*(){if("<response>"===r.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(r.error?e.reject(Ii(r.error)):e.resolve(Ii(r.data)))}if(!this.messageHandlers[r.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=Ii(r.data),n=new AbortController;this.abortControllers[t]=n;try{const i=yield this.messageHandlers[r.type](r.sourceMapId,e,n);this.completeTask(t,null,i)}catch(i){this.completeTask(t,i)}}))}completeTask(t,e,r){const n=[];delete this.abortControllers[t];const i={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Pi(e):null,data:Pi(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=V,t.H=function(){var t=new Bs(16);return Bs!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=cu,t.J=function(t,e,r){var n,i,a,o,s,l,c,u,h,d,p,f,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+d*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+f*y+e[15]),t},t.K=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=Ns,t.M=function(t,e){const r={};for(let n=0;n<e.length;n++){const i=e[n];i in t&&(r[i]=t[i])}return r},t.N=eh,t.O=ih,t.P=h,t.Q=ah,t.R=Qs,t.S=dh,t.T=_a,t.U=y,t.V=v,t.W=D,t.X=ps,t.Y=Ba,t.Z=lh,t._=e,t.a=N,t.a$=function(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=e[0],x=e[1],b=e[2],_=e[3],w=e[4],k=e[5],T=e[6],S=e[7],A=e[8],M=e[9],C=e[10],E=e[11],L=e[12],P=e[13],I=e[14],z=e[15];return Math.abs(r-v)<=Fs*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-x)<=Fs*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=Fs*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-_)<=Fs*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=Fs*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-k)<=Fs*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-T)<=Fs*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(c-S)<=Fs*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(u-A)<=Fs*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(h-M)<=Fs*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-C)<=Fs*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-E)<=Fs*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(f-L)<=Fs*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(m-P)<=Fs*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(g-I)<=Fs*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(y-z)<=Fs*Math.max(1,Math.abs(y),Math.abs(z))},t.a0=Bo,t.a1=uh,t.a2=ut,t.a3=t=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((r=>{e.onloadstart=()=>{r(e)};for(const n of t){const t=window.document.createElement("source");W(n)||(e.crossOrigin="Anonymous"),t.src=n,e.appendChild(t)}}))},t.a4=function(){return T++},t.a5=uo,t.a6=Nu,t.a7=On,t.a8=ys,t.a9=gh,t.aA=function(t){if("custom"===t.type)return new Ju(t);switch(t.type){case"background":return new Yu(t);case"circle":return new $s(t);case"fill":return new jl(t);case"fill-extrusion":return new cc(t);case"heatmap":return new rl(t);case"hillshade":return new al(t);case"line":return new Sc(t);case"raster":return new Ku(t);case"symbol":return new Hu(t)}},t.aB=M,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let r=[];try{if(!et(t.version,e.version))return[{command:"setStyle",args:[e]}];et(t.center,e.center)||r.push({command:"setCenter",args:[e.center]}),et(t.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),et(t.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),et(t.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),et(t.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),et(t.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),et(t.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),et(t.light,e.light)||r.push({command:"setLight",args:[e.light]}),et(t.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),et(t.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),et(t.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});const n={},i=[];!function(t,e,r,n){let i;for(i in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||it(i,r,n));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?et(t[i],e[i])||("geojson"===t[i].type&&"geojson"===e[i].type&&ot(t,e,i)?rt(r,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):at(i,e,r,n)):nt(i,e,r))}(t.sources,e.sources,i,n);const a=[];t.layers&&t.layers.forEach((t=>{"source"in t&&n[t.source]?r.push({command:"removeLayer",args:[t.id]}):a.push(t)})),r=r.concat(i),function(t,e,r){e=e||[];const n=(t=t||[]).map(lt),i=e.map(lt),a=t.reduce(ct,{}),o=e.reduce(ct,{}),s=n.slice(),l=Object.create(null);let c,u,h,d,p;for(let f=0,m=0;f<n.length;f++)c=n[f],Object.prototype.hasOwnProperty.call(o,c)?m++:(rt(r,{command:"removeLayer",args:[c]}),s.splice(s.indexOf(c,m),1));for(let f=0,m=0;f<i.length;f++)c=i[i.length-1-f],s[s.length-1-f]!==c&&(Object.prototype.hasOwnProperty.call(a,c)?(rt(r,{command:"removeLayer",args:[c]}),s.splice(s.lastIndexOf(c,s.length-m),1)):m++,d=s[s.length-f],rt(r,{command:"addLayer",args:[o[c],d]}),s.splice(s.length-f,0,c),l[c]=!0);for(let f=0;f<i.length;f++)if(c=i[f],u=a[c],h=o[c],!l[c]&&!et(u,h))if(et(u.source,h.source)&&et(u["source-layer"],h["source-layer"])&&et(u.type,h.type)){for(p in st(u.layout,h.layout,r,c,null,"setLayoutProperty"),st(u.paint,h.paint,r,c,null,"setPaintProperty"),et(u.filter,h.filter)||rt(r,{command:"setFilter",args:[c,h.filter]}),et(u.minzoom,h.minzoom)&&et(u.maxzoom,h.maxzoom)||rt(r,{command:"setLayerZoomRange",args:[c,h.minzoom,h.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?st(u[p],h[p],r,c,p.slice(6),"setPaintProperty"):et(u[p],h[p])||rt(r,{command:"setLayerProperty",args:[c,p,h[p]]}));for(p in h)Object.prototype.hasOwnProperty.call(h,p)&&!Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?st(u[p],h[p],r,c,p.slice(6),"setPaintProperty"):et(u[p],h[p])||rt(r,{command:"setLayerProperty",args:[c,p,h[p]]}))}else rt(r,{command:"removeLayer",args:[c]}),d=s[s.lastIndexOf(c)+1],rt(r,{command:"addLayer",args:[h,d]})}(a,e.layers,r)}catch(n){console.warn("Unable to compute style diff:",n),r=[{command:"setStyle",args:[e]}]}return r},t.aD=function(t){const e=[],r=t.id;return void 0===r&&e.push({message:`layers.${r}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${r}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},t.aE=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(!t(e[n],r[n]))return!1;return!0}return e===r},t.aF=S,t.aG=A,t.aH=class extends Jo{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=Qo,t.aJ=class extends Jo{constructor(t,e){super(t,e),this.current=rs}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.aK=ts,t.aL=es,t.aM=Qt,t.aN=class extends Jo{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.aO=class extends Jo{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.aP=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.aQ=Vs,t.aR=class extends Ja{},t.aS=Pc,t.aT=class extends to{},t.aU=el,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=tl,t.aX=wo,t.aY=Oo,t.aZ=class extends so{},t.a_=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.aa=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const r=[];for(const n in t)n in e||r.push(n);return r},t.ac=_,t.ad=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+d*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=d*i-l*n,t},t.ae=function(t){var e=new Bs(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=qs,t.ag=function(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=t,s=i?_(Fe.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Re.number(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}},t.ai=function(t,e,r){let{uSize:n,uSizeT:i}=e,{lowerSize:a,upperSize:o}=r;return"source"===t.kind?a/Eu:"composite"===t.kind?Re.number(a/Eu,o/Eu,i):n},t.aj=Ru,t.ak=function(t,e,r,n){const i=e.y-t.y,a=e.x-t.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;const c=(s*(t.y-r.y)-o*(t.x-r.x))/l;return new h(t.x+c*a,t.y+c*i)},t.al=_h,t.am=bs,t.an=js,t.ao=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[e,r,n,i]},t.ap=Oc,t.ar=Iu,t.as=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-d*f,A=u*y-p*f,M=h*g-d*m,C=h*y-p*m,E=d*y-p*g,L=v*E-x*C+b*M+_*A-w*S+k*T;return L?(t[0]=(s*E-l*C+c*M)*(L=1/L),t[1]=(i*C-n*E-a*M)*L,t[2]=(m*k-g*w+y*_)*L,t[3]=(d*w-h*k-p*_)*L,t[4]=(l*A-o*E-c*S)*L,t[5]=(r*E-i*A+a*S)*L,t[6]=(g*b-f*k-y*x)*L,t[7]=(u*k-d*b+p*x)*L,t[8]=(o*C-s*A+c*T)*L,t[9]=(n*A-r*C-a*T)*L,t[10]=(f*w-m*b+y*v)*L,t[11]=(h*b-u*w-p*v)*L,t[12]=(s*S-o*M-l*T)*L,t[13]=(r*M-n*S+i*T)*L,t[14]=(m*x-f*_-g*v)*L,t[15]=(u*_-h*x+d*v)*L,t):null},t.at=$h,t.au=Tu,t.av=Xh,t.aw=function(){const t={},e=J.$version;for(const r in J.$root){const n=J.$root[r];if(n.required){let i=null;i="version"===r?e:"array"===n.type?[]:{},null!=i&&(t[r]=i)}}return t},t.ax=zi,t.ay=$,t.az=function(t){t=t.slice();const e=Object.create(null);for(let r=0;r<t.length;r++)e[t[r].id]=t[r];for(let r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=tt(t[r],e[t[r].ref]));return t},t.b=z,t.b0=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.b1=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},t.b2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.b3=w,t.b4=hh,t.b5=oh,t.b6=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.b7=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+d*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=d*i-l*n,t},t.b8=x,t.b9=b,t.bA=Dc,t.bB=function(t){return t.message===B},t.bC=An,t.bD=ya,t.ba=function(t){return t*Math.PI/180},t.bb=function(t,e){const{x:r,y:n}=lh.fromLngLat(e);return!(t<0||t>25||n<0||n>=1||r<0||r>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ua{},t.be=th,t.bf=ld,t.bh=q,t.bi=function(t,e){N.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete N.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){const r={};for(let i=0;i<t.length;i++){const n=e&&e[t[i].id]||qn(t[i]);e&&(e[t[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(t[i])}const n=[];for(const i in r)n.push(r[i]);return n},t.bl=Mi,t.bm=mh,t.bn=yh,t.bo=uu,t.bp=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=ps/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;const r=e.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new va(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new va(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new va(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:r}=e.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new va(t),e.canonical),i["text-size"].possiblyEvaluate(new va(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new va(t),e.canonical),i["icon-size"].possiblyEvaluate(new va(r),e.canonical)]}const o=n.get("text-line-height")*Oc,s="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),c=n.get("text-size");for(const u of e.bucket.features){const i=n.get("text-font").evaluate(u,{},e.canonical).join(","),h=c.evaluate(u,{},e.canonical),d=a.layoutTextSize.evaluate(u,{},e.canonical),p=a.layoutIconSize.evaluate(u,{},e.canonical),f={horizontal:{},vertical:void 0},m=u.text;let g,y=[0,0];if(m){const a=m.toString(),c=n.get("text-letter-spacing").evaluate(u,{},e.canonical)*Oc,p=oa(a)?c:0,g=n.get("text-anchor").evaluate(u,{},e.canonical),v=qh(r,u,e.canonical);if(!v){const t=n.get("text-radial-offset").evaluate(u,{},e.canonical);y=t?Vh(g,[t*Oc,Uh]):n.get("text-offset").evaluate(u,{},e.canonical).map((t=>t*Oc))}let x=s?"center":n.get("text-justify").evaluate(u,{},e.canonical);const b="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(u,{},e.canonical)*Oc:1/0,_=()=>{e.bucket.allowVerticalPlacement&&aa(a)&&(f.vertical=fu(m,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,o,g,"left",p,y,t.ah.vertical,!0,d,h))};if(!s&&v){const r=new Set;if("auto"===x)for(let t=0;t<v.values.length;t+=2)r.add($h(v.values[t]));else r.add(x);let n=!1;for(const a of r)if(!f.horizontal[a])if(n)f.horizontal[a]=f.horizontal[0];else{const r=fu(m,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,o,"center",a,p,y,t.ah.horizontal,!1,d,h);r&&(f.horizontal[a]=r,n=1===r.positionedLines.length)}_()}else{"auto"===x&&(x=$h(g));const r=fu(m,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,o,g,x,p,y,t.ah.horizontal,!1,d,h);r&&(f.horizontal[x]=r),_(),aa(a)&&s&&l&&(f.vertical=fu(m,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,o,g,x,p,y,t.ah.vertical,!1,d,h))}}let v=!1;if(u.icon&&u.icon.name){const t=e.imageMap[u.icon.name];t&&(g=Au(e.imagePositions[u.icon.name],n.get("icon-offset").evaluate(u,{},e.canonical),n.get("icon-anchor").evaluate(u,{},e.canonical)),v=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=v:e.bucket.sdfIcons!==v&&E("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}const x=Gh(f.horizontal)||f.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||g)&&Hh(e.bucket,u,f,g,e.imageMap,a,d,p,y,v,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=xc,t.br=Dl,t.bs=ic,t.bt=ql,t.bu=iu,t.bv=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.bw=function(t,r,n,i,a){return e(this,void 0,void 0,(function*(){if(v())try{return yield D(t,r,n,i,a)}catch(e){}return function(t,e,r,n,i){const a=t.width,o=t.height;R&&F||(R=new OffscreenCanvas(a,o),F=R.getContext("2d",{willReadFrequently:!0})),R.width=a,R.height=o,F.drawImage(t,0,0,a,o);const s=F.getImageData(e,r,n,i);return F.clearRect(0,0,a,o),s.data}(t,r,n,i,a)}))},t.bx=fh,t.by=n,t.bz=a,t.c=j,t.d=t=>e(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.e=k,t.f=t=>new Promise(((e,r)=>{const n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=O}))},n.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):O})),t.g=U,t.h=(t,e)=>H(k(t,{type:"json"}),e),t.i=P,t.j=X,t.k=Z,t.l=(t,e)=>H(k(t,{type:"arrayBuffer"}),e),t.m=H,t.n=function(t){return new iu(t).readFields(au,[])},t.o=Js,t.p=lu,t.q=Ia,t.r=bi,t.s=W,t.t=Ti,t.u=xi,t.v=J,t.w=E,t.x=function(t){let[e,r,n]=t;return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.y=Re,t.z=va})),n("worker",0,(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,r){for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.aA(i);e._featureFilter=t.a7(e.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of r)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const n=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const t of n){const e=t.map((t=>this._layers[t.id])),r=e[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const a=r.sourceLayer||"_geojsonTileLayer";let o=i[a];o||(o=i[a]=[]),o.push(e)}}}class r{constructor(e){const r={},n=[];for(const t in e){const i=e[t],a=r[t]={};for(const t in i){const e=i[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const r={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(r),a[t]={rect:r,metrics:e.metrics}}}const{w:i,h:a}=t.p(n),o=new t.o({width:i||1,height:a||1});for(const s in e){const n=e[s];for(const e in n){const i=n[+e];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=r[s][e].rect;t.o.copy(i.bitmap,o,{x:0,y:0},{x:a.x+1,y:a.y+1},i.bitmap)}}this.image=o,this.positions=r}}t.bl("GlyphAtlas",r);class n{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,n,a,o){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;const s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(const r in h){const n=e.layers[r];if(!n)continue;1===n.version&&t.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=s.encode(r),d=[];for(let t=0;t<n.length;t++){const e=n.feature(t),i=l.getId(e,r);d.push({feature:e,id:i,index:t,sourceLayerIndex:o})}for(const e of h[r]){const r=e[0];r.source!==this.source&&t.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(i(e,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(d,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}const d=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(d).length){const t=new AbortController;this.inFlightDependencies.push(t),p=o.sendAsync({type:"GG",data:{stacks:d,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const f=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(f.length){const t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},t)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[v,x,b]=yield Promise.all([p,m,y]),_=new r(v),w=new t.bo(x,b);for(const e in c){const r=c[e];r instanceof t.a6?(i(r.layers,this.zoom,a),t.bp({bucket:r,glyphMap:v,glyphPositions:_.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof t.bq||r instanceof t.br||r instanceof t.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((t=>!t.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?_.positions:null}}))}}function i(e,r,n){const i=new t.z(r);for(const t of e)t.recalculate(i,n)}class a{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,r){return t._(this,void 0,void 0,(function*(){const n=yield t.l(e.request,r);try{return{vectorTile:new t.bt.VectorTile(new t.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){const t=new Uint8Array(n.data);let r=`Unable to parse the tile at ${e.request.url}, `;throw r+=31===t[0]&&139===t[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${i.message}`,new Error(r)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid,i=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),a=new n(e);this.loading[r]=a;const o=new AbortController;a.abort=o;try{const n=yield this.loadVectorTile(e,o);if(delete this.loading[r],!n)return null;const s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const t=i.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}finally{delete this.fetching[r]}}catch(s){throw delete this.loading[r],a.status="done",this.loaded[r]=a,s}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status){const e=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],i=t.e({rawTileData:n.slice(0)},e,a,o)}else i=e;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){const t=this.loading,r=e.uid;t&&t[r]&&t[r].abort&&(t[r].abort.abort(),delete t[r])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class o{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,c=i.width+2,u=i.height+2,h=t.b(i)?new t.R({width:c,height:u},yield t.bw(i,-1,-1,c,u)):i,d=new t.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=d,d}))}removeTile(t){const e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var r=1;r<t.length;r++)l(t[r],!e)}}function l(t,e){for(var r=0,n=0,i=0,a=t.length,o=a-1;i<a;o=i++){var s=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}var c=t.by((function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)s(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)s(e.coordinates[n],r);return e}));const u=t.bt.VectorTileFeature.prototype.toGeoJSON;var h={exports:{}},d=t.bz,p=t.bt.VectorTileFeature,f=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function g(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}m.prototype.feature=function(t){return new g(this.features[t],this.options.extent)},g.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new d(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var y=t.bA,v=f;function x(t){var e=new y;return function(t,e){for(var r in t.layers)e.writeMessage(3,b,t.layers[r])}(t,e),e.finish()}function b(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,_,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,A,a[r])}function _(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,w,t),e.writeVarintField(3,r.type),e.writeMessage(4,S,r)}function w(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=r.properties[s],c=a[s];if(null!==l){void 0===c&&(n.push(s),a[s]=c=n.length-1),e.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,d=o[h];void 0===d&&(i.push(l),o[h]=d=i.length-1),e.writeVarint(d)}}}function k(t,e){return(e<<3)+(7&t)}function T(t){return t<<1^t>>31}function S(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),e.writeVarint(k(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(k(2,u-1));var d=l[h].x-i,p=l[h].y-a;e.writeVarint(T(d)),e.writeVarint(T(p)),i+=d,a+=p}3===n&&e.writeVarint(k(7,1))}}function A(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}h.exports=x,h.exports.fromVectorTileJs=x,h.exports.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return x({layers:r})},h.exports.GeoJSONWrapper=v;var M=t.by(h.exports);const C={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},E=Math.fround||(L=new Float32Array(1),t=>(L[0]=+t,L[0]));var L;class P{constructor(t){this.options=Object.assign(Object.create(C),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const a=[];for(let s=0;s<t.length;s++){const e=t[s];if(!e.geometry)continue;const[r,n]=e.geometry.coordinates,i=E(O(r)),o=E(D(n));a.push(i,o,1/0,s,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[n+1]=this._createTree(a);e&&console.timeEnd(i);for(let s=n;s>=r;s--){const t=+Date.now();o=this.trees[s]=this._createTree(this._cluster(o,s)),e&&console.log("z%d: %d clusters in %dms",s,o.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){const t=this.getClusters([r,n,180,a],e),o=this.getClusters([-180,n,i,a],e);return t.concat(o)}const o=this.trees[this._limitZoom(e)],s=o.range(O(r),D(a),O(i),D(n)),l=o.data,c=[];for(const u of s){const t=this.stride*u;c.push(l[t+5]>1?I(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const a=i.data;if(e*this.stride>=a.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(const c of s){const e=c*this.stride;a[e+4]===t&&l.push(a[e+5]>1?I(a,e,this.clusterProps):this.points[a[e+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,r){const n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.data,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,i){const a=this.getChildren(e);for(const o of a){const e=o.properties;if(e&&e.cluster?i+e.point_count<=n?i+=e.point_count:i=this._appendLeaves(t,e.cluster_id,r,n,i):i<n?i++:t.push(o),t.length===r)break}return i}_createTree(e){const r=new t.av(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)r.add(e[t],e[t+1]);return r.finish(),r.data=e,r}_addTileFeatures(t,e,r,n,i,a){for(const o of t){const t=o*this.stride,s=e[t+5]>1;let l,c,u;if(s)l=z(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const r=this.points[e[t+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=O(n),u=D(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let d;d=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(h.id=d),a.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,e)),s=t.data,l=[],c=this.stride;for(let u=0;u<s.length;u+=c){if(s[u+2]<=e)continue;s[u+2]=e;const r=s[u],n=s[u+1],h=t.within(s[u],s[u+1],o),d=s[u+5];let p=d;for(const t of h){const r=t*c;s[r+2]>e&&(p+=s[r+5])}if(p>d&&p>=a){let t,a=r*d,o=n*d,f=-1;const m=(u/c<<5)+(e+1)+this.points.length;for(const r of h){const n=r*c;if(s[n+2]<=e)continue;s[n+2]=e;const l=s[n+5];a+=s[n]*l,o+=s[n+1]*l,s[n+4]=m,i&&(t||(t=this._map(s,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,n)))}s[u+4]=m,l.push(a/p,o/p,1/0,m,-1,p),i&&l.push(f)}else{for(let t=0;t<c;t++)l.push(s[u+t]);if(p>1)for(const t of h){const r=t*c;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t<c;t++)l.push(s[r+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function I(t,e,r){return{type:"Feature",id:t[e+3],properties:z(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),R(t[e+1])]}};var n}function z(t,e,r){const n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=t[e+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function O(t){return t/360+.5}function D(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function R(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,r,n){let i=n;const a=e+(r-e>>1);let o,s=r-e;const l=t[e],c=t[e+1],u=t[r],h=t[r+1];for(let d=e+3;d<r;d+=3){const e=B(t[d],t[d+1],l,c,u,h);if(e>i)o=d,i=e;else if(e===i){const t=Math.abs(d-a);t<s&&(o=d,s=t)}}i>n&&(o-e>3&&F(t,e,o,n),t[o+2]=i,r-o>3&&F(t,o,r,n))}function B(t,e,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){const l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=t-r,s=e-n,o*o+s*s}function j(t,e,r,n){const i={id:null==t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)N(i,r);else if("Polygon"===e)N(i,r[0]);else if("MultiLineString"===e)for(const a of r)N(i,a);else if("MultiPolygon"===e)for(const a of r)N(i,a[0]);return i}function N(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function U(t,e,r,n){if(!e.geometry)return;const i=e.geometry.coordinates;if(i&&0===i.length)return;const a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2);let s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)V(i,s);else if("MultiPoint"===a)for(const c of i)V(c,s);else if("LineString"===a)q(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(const r of i)s=[],q(r,s,o,!1),t.push(j(l,"LineString",s,e.properties));return}$(i,s,o,!1)}else if("Polygon"===a)$(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(const i of e.geometry.geometries)U(t,{id:l,geometry:i,properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const e=[];$(t,e,o,!0),s.push(e)}}t.push(j(l,a,s,e.properties))}function V(t,e){e.push(H(t[0]),W(t[1]),0)}function q(t,e,r,n){let i,a,o=0;for(let l=0;l<t.length;l++){const r=H(t[l][0]),s=W(t[l][1]);e.push(r,s,0),l>0&&(o+=n?(i*s-r*a)/2:Math.sqrt(Math.pow(r-i,2)+Math.pow(s-a,2))),i=r,a=s}const s=e.length-3;e[2]=1,F(e,0,s,r),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function $(t,e,r,n){for(let i=0;i<t.length;i++){const a=[];q(t[i],a,r,n),e.push(a)}}function H(t){return t/360+.5}function W(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;const l=[];for(const c of t){const t=c.geometry;let e=c.type;const a=0===i?c.minX:c.minY,o=0===i?c.maxX:c.maxY;if(a>=r&&o<n){l.push(c);continue}if(o<r||a>=n)continue;let u=[];if("Point"===e||"MultiPoint"===e)Y(t,u,r,n,i);else if("LineString"===e)Z(t,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===e)K(t,u,r,n,i,!1);else if("Polygon"===e)K(t,u,r,n,i,!0);else if("MultiPolygon"===e)for(const s of t){const t=[];K(s,t,r,n,i,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===e){for(const t of u)l.push(j(c.id,e,t,c.tags));continue}"LineString"!==e&&"MultiLineString"!==e||(1===u.length?(e="LineString",u=u[0]):e="MultiLineString"),"Point"!==e&&"MultiPoint"!==e||(e=3===u.length?"Point":"MultiPoint"),l.push(j(c.id,e,u,c.tags))}}return l.length?l:null}function Y(t,e,r,n,i){for(let a=0;a<t.length;a+=3){const o=t[a+i];o>=r&&o<=n&&J(e,t[a],t[a+1],t[a+2])}}function Z(t,e,r,n,i,a,o){let s=X(t);const l=0===i?Q:tt;let c,u,h=t.start;for(let g=0;g<t.length-3;g+=3){const d=t[g],p=t[g+1],f=t[g+2],m=t[g+3],y=t[g+4],v=0===i?d:p,x=0===i?m:y;let b=!1;o&&(c=Math.sqrt(Math.pow(d-m,2)+Math.pow(p-y,2))),v<r?x>r&&(u=l(s,d,p,m,y,r),o&&(s.start=h+c*u)):v>n?x<n&&(u=l(s,d,p,m,y,n),o&&(s.start=h+c*u)):J(s,d,p,f),x<r&&v>=r&&(u=l(s,d,p,m,y,r),b=!0),x>n&&v<=n&&(u=l(s,d,p,m,y,n),b=!0),!a&&b&&(o&&(s.end=h+c*u),e.push(s),s=X(t)),o&&(h+=c)}let d=t.length-3;const p=t[d],f=t[d+1],m=0===i?p:f;m>=r&&m<=n&&J(s,p,f,t[d+2]),d=s.length-3,a&&d>=3&&(s[d]!==s[0]||s[d+1]!==s[1])&&J(s,s[0],s[1],s[2]),s.length&&e.push(s)}function X(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function K(t,e,r,n,i,a){for(const o of t)Z(o,e,r,n,i,a,!1)}function J(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){const o=(a-e)/(n-e);return J(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){const o=(a-r)/(i-r);return J(t,e+(n-e)*o,a,1),o}function et(t,e){const r=[];for(let n=0;n<t.length;n++){const i=t[n],a=i.type;let o;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=rt(i.geometry,e);else if("MultiLineString"===a||"Polygon"===a){o=[];for(const t of i.geometry)o.push(rt(t,e))}else if("MultiPolygon"===a){o=[];for(const t of i.geometry){const r=[];for(const n of t)r.push(rt(n,e));o.push(r)}}r.push(j(i.id,a,o,i.tags))}return r}function rt(t,e){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(let n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function nt(t,e){if(t.transformed)return t;const r=1<<t.z,n=t.x,i=t.y;for(const a of t.features){const t=a.geometry,o=a.type;if(a.geometry=[],1===o)for(let s=0;s<t.length;s+=2)a.geometry.push(it(t[s],t[s+1],e,r,n,i));else for(let s=0;s<t.length;s++){const o=[];for(let a=0;a<t[s].length;a+=2)o.push(it(t[s][a],t[s][a+1],e,r,n,i));a.geometry.push(o)}}return t.transformed=!0,t}function it(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function at(t,e,r,n,i){const a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const s of t)ot(o,s,a,i);return o}function ot(t,e,r,n){const i=e.geometry,a=e.type,o=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===a||"MultiPoint"===a)for(let s=0;s<i.length;s+=3)o.push(i[s],i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)st(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let s=0;s<i.length;s++)st(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(let s=0;s<i.length;s++){const e=i[s];for(let n=0;n<e.length;n++)st(o,e[n],t,r,!0,0===n)}if(o.length){let r=e.tags||null;if("LineString"===a&&n.lineMetrics){r={};for(const t in e.tags)r[t]=e.tags[t];r.mapbox_clip_start=i.start/i.size,r.mapbox_clip_end=i.end/i.size}const s={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==e.id&&(s.id=e.id),t.features.push(s)}}function st(t,e,r,n,i,a){const o=n*n;if(n>0&&e.size<(i?o:n))return void(r.numPoints+=e.length/3);const s=[];for(let l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l],e[l+1])),r.numPoints++;i&&function(t,e){let r=0;for(let n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(let n=0,i=t.length;n<i/2;n+=2){const e=t[n],r=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=e,t[i-1-n]=r}}(s,a),t.push(s)}const lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class ct{constructor(t,e){const r=(e=this.options=function(t,e){for(const r in e)t[r]=e[r];return t}(Object.create(lt),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(t,e){const r=[];if("FeatureCollection"===t.type)for(let n=0;n<t.features.length;n++)U(r,t.features[n],e,n);else U(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){const r=e.buffer/e.extent;let n=t;const i=G(t,1,-1-r,r,0,-1,2,e),a=G(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=G(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=et(i,1).concat(n)),a&&(n=n.concat(et(a,-1)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,r,n,i,a,o){const s=[t,e,r,n],l=this.options,c=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();const u=1<<e,h=ut(e,r,n);let d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==i){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(r!==a>>t||n!==o>>t)continue}}if(d.source=null,0===t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,m=.5+p,g=1+p;let y=null,v=null,x=null,b=null,_=G(t,u,r-p,r+m,0,d.minX,d.maxX,l),w=G(t,u,r+f,r+g,0,d.minX,d.maxX,l);t=null,_&&(y=G(_,u,n-p,n+m,1,d.minY,d.maxY,l),v=G(_,u,n+f,n+g,1,d.minY,d.maxY,l),_=null),w&&(x=G(w,u,n-p,n+m,1,d.minY,d.maxY,l),b=G(w,u,n+f,n+g,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(x||[],e+1,2*r+1,2*n),s.push(b||[],e+1,2*r+1,2*n+1)}}getTile(t,e,r){t=+t,e=+e,r=+r;const n=this.options,{extent:i,debug:a}=n;if(t<0||t>24)return null;const o=1<<t,s=ut(t,e=e+o&o-1,r);if(this.tiles[s])return nt(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);let l,c=t,u=e,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ut(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ut(t,e,r){return 32*((1<<t)*r+e)+t}function ht(t,e){return e?t.properties[e]:t.id}function dt(t,e){if(null==t)return!0;if("Feature"===t.type)return null!=ht(t,e);if("FeatureCollection"===t.type){const r=new Set;for(const n of t.features){const t=ht(n,e);if(null==t)return!1;if(r.has(t))return!1;r.add(t)}return!0}return!1}function pt(t,e){const r=new Map;if(null==t);else if("Feature"===t.type)r.set(ht(t,e),t);else for(const n of t.features)r.set(ht(n,e),n);return r}class ft extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(e,r){return t._(this,void 0,void 0,(function*(){const r=e.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return null;const i=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.X,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const r of this._feature.geometry)e.push([new t.P(r[0],r[1])]);return e}{const e=[];for(const r of this._feature.geometry){const n=[];for(const e of r)n.push(new t.P(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,r){return u.call(this,t,e,r)}}(this._features[e])}}(n.features);let a=M(i);return 0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:i,rawData:a.buffer}}))}loadData(e){return t._(this,void 0,void 0,(function*(){var r;null===(r=this._pendingRequest)||void 0===r||r.abort();const n=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(e,this._pendingRequest),this._geoJSONIndex=e.cluster?new P(function(e){let{superclusterOptions:r,clusterProperties:n}=e;if(!n||!r)return r;const i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n);for(const c of l){const[e,r]=n[c],o=t.bC(r),s=t.bC("string"==typeof e?[e,["accumulated"],["get",c]]:e);i[c]=o.value,a[c]=s.value}return r.map=t=>{s.properties=t;const e={};for(const r of l)e[r]=i[r].evaluate(o,s);return e},r.reduce=(t,e)=>{s.properties=e;for(const r of l)o.accumulated=t[r],t[r]=a[r].evaluate(o,s)},r}(e)).load((yield this._pendingData).features):(i=yield this._pendingData,new ct(i,e.geojsonVtOptions)),this.loaded={};const r={};if(n){const t=n.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return r}catch(a){if(delete this._pendingRequest,t.bB(a))return{abandoned:!0};throw a}var i}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(e,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(n,!0),e.filter){const r=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const i=n.features.filter((t=>r.value.evaluate({zoom:0},t)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){const{promoteId:n}=e;if(e.request){const i=yield t.h(e.request,r);return this._dataUpdateable=dt(i.data,n)?pt(i.data,n):void 0,i.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=dt(t,n)?pt(t,n):void 0,t}catch(i){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,r){var n,i,a,o;if(e.removeAll&&t.clear(),e.remove)for(const s of e.remove)t.delete(s);if(e.add)for(const s of e.add){const e=ht(s,r);null!=e&&t.set(e,s)}if(e.update)for(const s of e.update){let e=t.get(s.id);if(null==e)continue;const r=!s.removeAllProperties&&((null===(n=s.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=s.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((s.newGeometry||s.removeAllProperties||r)&&(e=Object.assign({},e),t.set(s.id,e),r&&(e.properties=Object.assign({},e.properties))),s.newGeometry&&(e.geometry=s.newGeometry),s.removeAllProperties)e.properties={};else if((null===(a=s.removeProperties)||void 0===a?void 0:a.length)>0)for(const t of s.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(o=s.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(const{key:t,value:n}of s.addOrUpdateProperties)e.properties[t]=n}}(this._dataUpdateable,e.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,r)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,r)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][r.type]||!this.workerSources[e][r.type][r.source])return;const t=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],void 0!==t.removeSource&&t.removeSource(r)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,r)=>t._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,r)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(r)}))))}_setImages(e,r){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=r;for(const t in this.workerSources[e]){const n=this.workerSources[e][t];for(const t in n)n[t].availableImages=r}}))}_syncRTLPluginState(e,r){return t._(this,void 0,void 0,(function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==r.pluginStatus)return t.bD.setState(r),r;const e=r.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(r),r}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new e),r}_getWorkerSource(t,e,r){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){const n={sendAsync:(e,r)=>(e.targetMapId=t,this.actor.sendAsync(e,r))};switch(e){case"vector":this.workerSources[t][e][r]=new a(n,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new ft(n,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](n,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt})),n("index",0,(function(t,e){var r="4.7.1";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);t.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(e.c())}))})),getImageData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(t){if(!o.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in o.docStyle)return t[e];return t[0]}static create(t,e,r){const n=window.document.createElement(t);return void 0!==e&&(n.className=e),r&&r.appendChild(n),n}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(t,e){t.style[o.transformProp]=e}static addEventListener(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.addEventListener(e,r,"passive"in n?n:n.capture)}static removeEventListener(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.removeEventListener(e,r,"passive"in n?n:n.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,r,n){const i=r.boundingClientRect;return new e.P((n.clientX-i.left)/r.x-t.clientLeft,(n.clientY-i.top)/r.y-t.clientTop)}static mousePos(t,e){const r=o.getScale(t);return o.getPoint(t,r,e)}static touchPos(t,e){const r=[],n=o.getScale(t);for(let i=0;i<e.length;i++)r.push(o.getPoint(t,n,e[i]));return r}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}o.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);const s={supported:!1,testSupport:function(t){!u&&c&&(h?d(t):l=t)}};let l,c,u=!1,h=!1;function d(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,c),t.isContextLost())return;s.supported=!0}catch(r){}t.deleteTexture(e),u=!0}var p;"undefined"!=typeof document&&(c=document.createElement("img"),c.onload=()=>{l&&d(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let r,n,i,a;t.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},t.addThrottleControl=t=>{const e=i++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],l()},t.getImage=function(t,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(((a,o)=>{s.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),r.push({abortController:n,requestParameters:t,supportImageRefresh:i,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),l()}))};const o=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=t,u=!1===i&&!e.i(self)&&!e.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((t,e)=>t&&"accept"===e),!0));n++;const h=u?c(r,s):e.m(r,s);try{const r=yield h;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||e.b(r.data)?o(r):r.data&&o({data:yield(d=r.data,"function"==typeof createImageBitmap?e.d(d):e.f(d)),cacheControl:r.cacheControl,expires:r.expires})}catch(p){delete t.abortController,a(p)}finally{n--,l()}var d})),l=()=>{const t=(()=>{for(const t of Object.keys(a))if(a[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=n;e<t&&r.length>0;e++){const t=r.shift();t.abortController.signal.aborted?e--:o(t)}},c=(t,r)=>new Promise(((n,i)=>{const a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(e.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(p||(p={})),p.resetRequestQueue();class f{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var r=new e.A(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}var g,y=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v=function(t){var e=t[0],r=t[1];return e*e+r*r};function x(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const r=[];for(const{id:n,url:i}of t){const t=`${n}${i}`;-1===r.indexOf(t)&&(r.push(t),e.push({id:n,url:i}))}}return e}function b(t,e,r){const n=t.split("?");return n[0]+=`${e}${r}`,n.join("?")}!function(){var t=new e.A(2);e.A!=Float32Array&&(t[0]=0,t[1]=0)}();class _{constructor(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,r,n){const{width:i,height:a}=t,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:r,y:o}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function w(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class k extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const r=this.images[t];if(r&&!r.data&&r.spriteData){const t=r.spriteData;r.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let r=0;for(const n of t){if(n[0]<r||n[1]<n[0]||e<n[1])return!1;r=n[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;const r=e.spriteData,n=r&&r.width||e.data.width,i=r&&r.height||e.data.height;return!(t[0]<0||n<t[0]||t[1]<0||i<t[1]||t[2]<0||n<t[2]||t[3]<0||i<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=this.getImage(t);if(r&&(n.data.width!==e.data.width||n.data.height!==e.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=n.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((e,r)=>{let n=!0;if(!this.isLoaded())for(const i of t)this.images[i]||(n=!1);this.isLoaded()||n?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const r={};for(const n of t){let t=this.getImage(n);t||(this.fire(new e.k("styleimagemissing",{id:n})),t=this.getImage(n)),t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.I(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:r,h:n}=e.p(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const a in this.patterns){const{bin:t}=this.patterns[a],r=t.x+1,n=t.y+1,o=this.getImage(a).data,s=o.width,l=o.height;e.R.copy(o,i,{x:0,y:0},{x:r,y:n},{width:s,height:l}),e.R.copy(o,i,{x:0,y:l-1},{x:r,y:n-1},{width:s,height:1}),e.R.copy(o,i,{x:0,y:0},{x:r,y:n+l},{width:s,height:1}),e.R.copy(o,i,{x:s-1,y:0},{x:r-1,y:n},{width:1,height:l}),e.R.copy(o,i,{x:0,y:0},{x:r+s,y:n},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const t=this.getImage(r);t||e.w(`Image with ID: "${r}" was not found`),w(t)&&this.updateImage(r,t)}}}const T=1e20;function S(t,e,r,n,i,a,o,s,l){for(let c=e;c<e+n;c++)A(t,r*a+c,a,i,o,s,l);for(let c=r;c<r+i;c++)A(t,c*a+e,1,n,o,s,l)}function A(t,e,r,n,i,a,o){a[0]=0,o[0]=-T,o[1]=T,i[0]=t[e];for(let s=1,l=0,c=0;s<n;s++){i[s]=t[e+s*r];const n=s*s;do{const t=a[l];c=(i[s]-i[t]+n-t*t)/(s-t)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=T}for(let s=0,l=0;s<n;s++){for(;o[l+1]<s;)l++;const n=a[l],c=s-n;t[e+s*r]=i[n]+c*c}}class M{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,(function*(){const e=[];for(const i in t)for(const r of t[i])e.push(this._getAndCacheGlyphsPromise(i,r));const r=yield Promise.all(e),n={};for(const{stack:t,id:i,glyph:a}of r)n[t]||(n[t]={}),n[t][i]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return n}))}_getAndCacheGlyphsPromise(t,r){return e._(this,void 0,void 0,(function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let n=e.glyphs[r];if(void 0!==n)return{stack:t,id:r,glyph:n};if(n=this._tinySDF(e,t,r),n)return e.glyphs[r]=n,{stack:t,id:r,glyph:n};const i=Math.floor(r/256);if(256*i>65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[i])return{stack:t,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[i]){const r=M.loadGlyphRange(t,i,this.url,this.requestManager);e.requests[i]=r}const a=yield e.requests[i];for(const t in a)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=a[+t]);return e.ranges[i]=!0,{stack:t,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(t))}_tinySDF(t,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=t.tinySDF;if(!a){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),a=t.tinySDF=new M.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}const o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new e.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}M.loadGlyphRange=function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);const c={};for(const t of e.n(l.data))c[t.id]=t;return c}))},M.TinySDF=class{constructor(){let{fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=e,this.cutoff=n,this.radius=r;const s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:y}=this;f.clearRect(m,m,s,l),f.fillText(t,m,m+o);const v=f.getImageData(m,m,s,l);y.fill(T,0,h),g.fill(0,0,h);for(let x=0;x<l;x++)for(let t=0;t<s;t++){const e=v.data[4*(x*s+t)+3]/255;if(0===e)continue;const r=(x+m)*c+t+m;if(1===e)y[r]=0,g[r]=T;else{const t=.5-e;y[r]=t>0?t*t:0,g[r]=t<0?t*t:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let x=0;x<h;x++){const t=Math.sqrt(y[x])-Math.sqrt(g[x]);d[x]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class C{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,r){return e.x(t.expression.evaluate(r))}interpolate(t,r,n){return{x:e.y.number(t.x,r.x,n),y:e.y.number(t.y,r.y,n),z:e.y.number(t.z,r.z,n)}}}let E;class L extends e.E{constructor(t){super(),E=E||new e.q({anchor:new e.D(e.v.light.anchor),position:new C,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(E),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.r,t,r))for(const e in t){const r=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),r):this._transitionable.setValue(e,r)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,n){return(!n||!1!==n.validate)&&e.t(this,t.call(e.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}const P=new e.q({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class I extends e.E{constructor(t){super(),this._transitionable=new e.T(P),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.B,t,r)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const e in t){const r=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),r):this._transitionable.setValue(e,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!1!==(null==n?void 0:n.validate)&&e.t(this,t.call(e.u,e.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class z{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]}getDashRanges(t,e,r){const n=[];let i=t.length%2==1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});let s=t[0];for(let l=1;l<t.length;l++){o=!o;const e=t[l];i=s*r,s+=e,a=s*r,n.push({left:i,right:a,isDash:o,zeroLength:0===e})}return n}addRoundDash(t,e,r){const n=e/2;for(let i=-r;i<=r;i++){const e=this.width*(this.nextRow+r+i);let a=0,o=t[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=t[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),u=Math.min(l,c);let h;const d=i/r*(n+1);if(o.isDash){const t=n-Math.abs(d);h=Math.sqrt(u*u+t*t)}else h=n-Math.sqrt(u*u+d*d);this.data[e+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t){for(let o=t.length-1;o>=0;--o){const e=t[o],r=t[o+1];e.zeroLength?t.splice(o,1):r&&r.isDash===e.isDash&&(r.left=e.left,t.splice(o,1))}const e=t[0],r=t[t.length-1];e.isDash===r.isDash&&(e.left=r.left-this.width,r.right=e.right+this.width);const n=this.width*this.nextRow;let i=0,a=t[i];for(let o=0;o<this.width;o++){o/a.right>1&&(a=t[++i]);const e=Math.abs(o-a.left),r=Math.abs(o-a.right),s=Math.min(e,r);this.data[n+o]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e<t.length;e++)a+=t[e];if(0!==a){const e=this.width/a,i=this.getDashRanges(t,this.width,e);r?this.addRoundDash(i,e,n):this.addRegularDash(i)}const o={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const O="maplibre_preloaded_worker_pool";class D{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<D.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}const R=Math.floor(a.hardwareConcurrency/2);let F,B;function j(){return F||(F=new D),F}D.workerCount=e.C(globalThis)?Math.max(Math.min(R,3),1):1;class N{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let i=0;i<n.length;i++){const t=new e.F(n[i],r);t.name=`Worker ${i}`,this.actors.push(t)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const r=[];for(const n of this.actors)r.push(n.sendAsync({type:t,data:e}));return Promise.all(r)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((t=>{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const r of this.actors)r.registerMessageHandler(t,e)}}function U(){return B||(B=new N(j(),e.G),B.registerMessageHandler("GR",((t,r,n)=>e.m(r,n)))),B}function V(t,r){const n=e.H();return e.J(n,n,[1,1,0]),e.K(n,n,[.5*t.width,.5*t.height,1]),e.L(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function q(t,e,r,n,i,a){const o=function(t,e,r){if(t)for(const n of t){const t=e[n];if(t&&t.source===r&&"fill-extrusion"===t.type)return!0}else for(const n in e){const t=e[n];if(t.source===r&&"fill-extrusion"===t.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort($);const c=[];for(const h of l)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,r,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,i,a,s,V(t.transform,h.tileID))});const u=function(t){const e={},r={};for(const n of t){const t=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in t){const n=t[r],i=a[r]=a[r]||{},o=e[r]=e[r]||[];for(const t of n)i[t.featureIndex]||(i[t.featureIndex]=!0,o.push(t))}}return e}(c);for(const h in u)u[h].forEach((e=>{const r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function $(t,e){const r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function H(t,r,n){return e._(this,void 0,void 0,(function*(){let i=t;if(t.url?i=(yield e.h(r.transformRequest(t.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const o=e.M(e.e(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((t=>t.id))),o}))}class W{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){const r=this._sw,n=this._ne;let i,a;if(t instanceof e.N)i=t,a=t;else{if(!(t instanceof W))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(i=t._sw,a=t._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new e.N(i.lng,i.lat),this._ne=new e.N(a.lng,a.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:r,lat:n}=e.N.convert(t);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(t){return t instanceof W?t:t?new W(t):t}static fromLngLat(t){const r=360*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)/40075017,n=r/Math.cos(Math.PI/180*t.lat);return new W(new e.N(t.lng-n,t.lat-r),new e.N(t.lng+n,t.lat+r))}adjustAntiMeridian(){const t=new e.N(this._sw.lng,this._sw.lat),r=new e.N(this._ne.lng,this._ne.lat);return new W(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class G{constructor(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),n=Math.floor(e.O(this.bounds.getWest())*r),i=Math.floor(e.Q(this.bounds.getNorth())*r),a=Math.ceil(e.O(this.bounds.getEast())*r),o=Math.ceil(e.Q(this.bounds.getSouth())*r);return t.x>=n&&t.x<a&&t.y>=i&&t.y<o}}class Y extends e.E{constructor(t,r,n,i){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.M(r,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield H(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(e.e(this,t),t.bounds&&(this.tileBounds=new G(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,r)=>{t.reloadPromise={resolve:e,reject:r}}))}else t.actor=this.dispatcher.getActor(),n="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:n,data:r},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(i){if(delete t.abortController,t.aborted)return;if(i&&404!==i.status)throw i;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Z extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},r),e.e(this,e.M(r,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield H(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new G(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const e=this.map.painter.context,n=e.gl,i=r.data;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new _(e,i,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(r){if(delete t.abortController,t.aborted)t.state="unloaded";else if(r)throw t.state="errored",r}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class X extends Z{constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const r=yield p.getImage(n,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=e.b(n)&&e.U()?n:yield this.readImageNow(n),a={type:this.type,uid:t.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(i){if(delete t.abortController,t.aborted)t.state="unloaded";else if(i)throw t.state="errored",i}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.V()){const n=t.width+2,i=t.height+2;try{return new e.R({width:n,height:i},yield e.W(t,-1,-1,n,i))}catch(r){}}return a.getImageData(t,1)}))}_getNeighboringTiles(t){const r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}class K extends e.E{constructor(t,r,n,i){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=e.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const a=e.X/this.tileSize;void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:e.X,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.X,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return e._(this,void 0,void 0,(function*(){const t=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:r}})}_updateWorkerData(t){return e._(this,void 0,void 0,(function*(){const r=e.e({type:this.type},this.workerOptions);t?r.dataDiff=t:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{const t=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let n=null;t.resourceTiming&&t.resourceTiming[this.id]&&(n=t.resourceTiming[this.id].slice(0));const i={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&e.e(i,{resourceTiming:n}),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(n){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(n))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const r={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const n=yield this.actor.sendAsync({type:e,data:r},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var J=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends e.E{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new e.j(r))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const r=t.map(e.Z.fromLngLat);this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);const o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new e.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class tt extends Q{constructor(t,e,r,n){super(t,e,r,n),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new e.j(r))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new _(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class et extends Q{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const rt={},nt=t=>{switch(t){case"geojson":return K;case"image":return Q;case"raster":return Z;case"raster-dem":return X;case"vector":return Y;case"video":return tt;case"canvas":return et}return rt[t]},it="RTLPluginLoaded";class at extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=U()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function(t){var e=this;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){if(e.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(e.url=a.resolveURL(t),!e.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===e.status){if(!r)return e._requestImport();e.status="deferred",e._syncState(e.status)}else if("requested"===e.status)return e._requestImport()}()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(it))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let ot=null;function st(){return ot||(ot=new at),ot}class lt{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const e=t+this.timeAdded;e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,r,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const r={};if(!e)return r;for(const n of t){const t=n.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)r[e.id]=n}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6&&r.hasRTLText){this.hasRTLText=!0,st().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const r in this.buckets){const e=this.buckets[r];e.uploadPending()&&e.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new _(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new _(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}}querySourceFeatures(t,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;const s=e.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let d=0;d<o.length;d++){const r=o.feature(d);if(s.needGeometry){const t=e.a8(r,!0);if(!s.filter(new e.z(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.z(this.tileID.overscaledZ),r))continue;const i=n.getId(r,a),p=new e.a9(r,l,c,u,i);p.tile=h,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const r=this.expirationTime;if(t.cacheControl){const r=e.aa(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(r)if(this.expirationTime<r)e=!0;else{const n=this.expirationTime-r;n?this.expirationTime=t+Math.max(n,3e4):e=!0}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!e.style.hasLayer(n))continue;const i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(!o||!s||0===Object.keys(s).length)continue;i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=a.now()+t}setDependencies(t,e){const r={};for(const n of e)r[n]=!0;this.dependencies[t]=r}hasDependency(t,e){for(const r of t){const t=this.dependencies[r];if(t)for(const r of e)if(t[r])return!0}return!1}}class ct{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,r){const n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const i={value:e,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((()=>{this.remove(t,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const r in this.data)for(const n of this.data[r])t(n.value)||e.push(n);for(const r of e)this.remove(r.value.tileID,r)}}class ut{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,n){const i=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.e(this.stateChanges[t][i],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(const e in this.state[t][i])n[e]||(this.deletedStates[t][i][e]=null)}else for(const e in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(t,e,r){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,r){const n=String(r),i=e.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][r];if(null===e)return{};for(const t in e)delete i[t]}return i}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,r){const n={};for(const i in this.stateChanges){this.state[i]=this.state[i]||{};const t={};for(const r in this.stateChanges[i])this.state[i][r]||(this.state[i][r]={}),e.e(this.state[i][r],this.stateChanges[i][r]),t[r]=this.state[i][r];n[i]=t}for(const i in this.deletedStates){this.state[i]=this.state[i]||{};const t={};if(null===this.deletedStates[i])for(const e in this.state[i])t[e]={},this.state[i][e]={};else for(const e in this.deletedStates[i]){if(null===this.deletedStates[i][e])this.state[i][e]={};else for(const t of Object.keys(this.deletedStates[i][e]))delete this.state[i][e][t];t[e]=this.state[i][e]}n[i]=n[i]||{},e.e(n[i],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const e in t)t[e].setFeatureState(n,r)}}class ht extends e.E{constructor(t,e,r){super(),this.id=t,this.dispatcher=r,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,r,n)=>{const i=new(nt(e.type))(t,e,r,n);if(i.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${i.id}`);return i})(t,e,r,this),this._tiles={},this._cache=new ct(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ut,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,n){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,r,n)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.j(i,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(dt).map((t=>t.key))}getRenderableIds(t){const r=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort(((t,r)=>{const n=t.tileID,i=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((t=>t.tileID.key)):r.map((t=>t.tileID)).sort(dt).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,r){return e._(this,void 0,void 0,(function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=r),yield this._loadTile(e,t,r))}))}_tileLoaded(t,r,n){t.timeAdded=a.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n<e.length;n++){const i=e[n];if(t.neighboringTiles&&t.neighboringTiles[i]){const e=this.getTileByID(i);r(t,e),r(e,t)}}function r(t,e){t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let r=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,r,n){for(const i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>e+1;){const t=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[t.key],a&&a.hasData()&&(o=t)}let s=o;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(let r=t.overscaledZ-1;r>=e;r--){const e=t.scaledTo(r),n=this._getLoadedTile(e);if(n)return n}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const r=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}}_updateCoveredAndRetainedTiles(t,e,r,n,i,o){const s={},l={},c=Object.keys(t),u=a.now();for(const a of c){const r=t[a],n=this._tiles[a];if(!n||0!==n.fadeEndTime&&n.fadeEndTime<=u)continue;const i=this.findLoadedParent(r,e),o=this.findLoadedSibling(r),c=i||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[a]=r}this._retainLoadedChildren(l,n,r,t);for(const a in s)t[a]||(this._coveredTiles[a]=!0,t[a]=s[a]);if(o){const e={},r={};for(const t of i)this._tiles[t.key].hasData()?e[t.key]=t:r[t.key]=t;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=t[i[0].key]=i[0],e[i[1].key]=t[i[1].key]=i[1],e[i[2].key]=t[i[2].key]=i[2],e[i[3].key]=t[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(const t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const i=t.coveringZoomLevel(this._source),a=Math.max(i-ht.maxOverzooming,this._source.minzoom),o=Math.max(i+ht.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of n)if(e.canonical.z>this._source.minzoom){const r=e.scaledTo(e.canonical.z-1);t[r.key]=r;const n=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[n.key]=n}n=n.concat(Object.values(t))}const s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);pt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(const e in l)this._tiles[e].clearFadeHold();const c=e.ab(this._tiles,l);for(const e of c){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(e)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var r;const n={},i={},a=Math.max(e-ht.maxOverzooming,this._source.minzoom),o=Math.max(e+ht.maxUnderzooming,this._source.minzoom),s={};for(const l of t){const t=this._addTile(l);n[l.key]=l,t.hasData()||e<this._source.maxzoom&&(s[l.key]=l)}this._retainLoadedChildren(s,e,o,n);for(const l of t){let t=this._tiles[l.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){const t=l.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){n[t.key]=t;continue}}else{const t=l.children(this._source.maxzoom);if(n[t[0].key]&&n[t[1].key]&&n[t[2].key]&&n[t[3].key])continue}let o=t.wasRequested();for(let e=l.overscaledZ-1;e>=a;--e){const a=l.scaledTo(e);if(i[a.key])break;if(i[a.key]=!0,t=this.getTile(a),!t&&o&&(t=this._addTile(a)),t){const e=t.hasData();if((e||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||o)&&(n[a.key]=a),o=t.wasRequested(),e)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let r,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(t),r)break;n=t}for(const t of e)this._loadedParentTiles[t]=r}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,r=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const n=r;return r||(r=new lt(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state)),r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),r))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,r,n){const i=[],a=this.transform;if(!a)return i;const o=n?a.getCameraQueryGeometry(t):t,s=t.map((t=>a.pointCoordinate(t,this.terrain))),l=o.map((t=>a.pointCoordinate(t,this.terrain))),c=this.getIds();let u=1/0,h=1/0,d=-1/0,p=-1/0;for(const e of l)u=Math.min(u,e.x),h=Math.min(h,e.y),d=Math.max(d,e.x),p=Math.max(p,e.y);for(let f=0;f<c.length;f++){const t=this._tiles[c[f]];if(t.holdingForFade())continue;const n=t.tileID,o=Math.pow(2,a.zoom-t.tileID.overscaledZ),m=r*t.queryPadding*e.X/t.tileSize/o,g=[n.getTilePoint(new e.Z(u,h)),n.getTilePoint(new e.Z(d,p))];if(g[0].x-m<e.X&&g[0].y-m<e.X&&g[1].x+m>=0&&g[1].y+m>=0){const e=s.map((t=>n.getTilePoint(t))),r=l.map((t=>n.getTilePoint(t)));i.push({tile:t,tileID:n,queryGeometry:e,cameraQueryGeometry:r,scale:o})}}return i}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const r of e)r.posMatrix=this.transform.calculatePosMatrix(r.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type)){const t=a.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)}removeFeatureState(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,r){const n=this._tiles[t];n&&n.setDependencies(e,r)}reloadTilesForDependencies(t,e){for(const r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(t,e)))}}function dt(t,e){const r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function pt(t){return"raster"===t||"image"===t||"video"===t}ht.maxOverzooming=10,ht.maxUnderzooming=3;class ft{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ac(t,0,1);let r=1,n=this._distances[r];const i=t*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];const a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function mt(t,e){let r=!0;return"always"===t||"never"!==t&&"never"!==e||(r=!1),r}class gt{constructor(t,e,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(let a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)}_insertBoxCell(t,e,r,n,i,a){this.boxCells[i].push(a)}_insertCircleCell(t,e,r,n,i,a){this.circleCells[i].push(a)}_query(t,e,r,n,i,a,o){if(r<0||t>this.width||n<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:t,y1:e,x2:r,y2:n}];for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],r=this.circles[3*t+1],n=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-n,y1:r-n,x2:e+n,y2:r+n})}}else this._forEachCell(t,e,r,n,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(t,e,r,n){return this._query(t,e,r,n,!1,null)}hitTest(t,e,r,n,i,a){return this._query(t,e,r,n,!0,i,a).length>0}hitTestCircle(t,e,r,n,i){const a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(t,e,r,n,i,a,o,s){const{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const i=this.bboxes;for(const o of h)if(!l.box[o]){l.box[o]=!0;const h=4*o,d=this.boxKeys[o];if(t<=i[h+2]&&e<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(d))&&(!c||!mt(u,d.overlapMode))&&(a.push({key:d,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}const d=this.circleCells[i];if(null!==d){const i=this.circles;for(const o of d)if(!l.circle[o]){l.circle[o]=!0;const h=3*o,d=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],t,e,r,n)&&(!s||s(d))&&(!c||!mt(u,d.overlapMode))){const t=i[h],e=i[h+1],r=i[h+2];if(a.push({key:d,x1:t-r,y1:e-r,x2:t+r,y2:e+r}),c)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){const{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const r=4*e,n=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[r+0],t[r+1],t[r+2],t[r+3])&&(!s||s(n))&&!mt(u,n.overlapMode))return a.push(!0),!0}}const d=this.circleCells[i];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const r=3*e,n=this.circleKeys[e];if(this._circlesCollide(t[r],t[r+1],t[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!mt(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(i.call(this,t,e,r,n,this.xCellCount*l+d,a,o,s))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,r,n,i,a){const o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,r,n,i,a,o){const s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;const c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,d=u-c;return h*h+d*d<=r*r}}function yt(t,r,n,i,a){const o=e.H();return r?(e.K(o,o,[1/a,1/a,1]),n||e.ad(o,o,i.angle)):e.L(o,i.labelPlaneMatrix,t),o}function vt(t,r,n,i,a){if(r){const r=e.ae(t);return e.K(r,r,[a,a,1]),n||e.ad(r,r,-i.angle),r}return i.glCoordMatrix}function xt(t,r,n,i){let a;i?(a=[t,r,i(t,r),1],e.af(a,a,n)):(a=[t,r,0,1],Ot(a,a,n));const o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function _t(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function wt(t,r,n,i,a,o,s,l,c,u,h,d,p,f,m){const g=i?t.textSizeData:t.iconSizeData,y=e.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();const b=t.lineVertexArray,_=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let k=!1;for(let T=0;T<_.length;T++){const i=_.get(T);if(i.hidden||i.writingMode===e.ah.vertical&&!k){zt(i.numGlyphs,x);continue}k=!1;const S=xt(i.anchorX,i.anchorY,r,m);if(!_t(S.point,v)){zt(i.numGlyphs,x);continue}const A=bt(n.transform.cameraToCenterDistance,S.signedDistanceFromCamera),M=e.ai(g,y,i),C=s?M/A:M*A,E={getElevation:m,labelPlaneMatrix:a,lineVertexArray:b,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new e.P(i.anchorX,i.anchorY),unwrappedTileID:h,width:d,height:p,translation:f},L=St(E,i,C,!1,l,r,o,t.glyphOffsetArray,x,w,c);k=L.useVertical,(L.notEnoughRoom||k||L.needsFlipping&&St(E,i,C,!0,l,r,o,t.glyphOffsetArray,x,w,c).notEnoughRoom)&&zt(i.numGlyphs,x)}i?t.text.dynamicLayoutVertexBuffer.updateData(x):t.icon.dynamicLayoutVertexBuffer.updateData(x)}function kt(t,e,r,n,i,a,o,s){const l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,h=e.getoffsetX(a.glyphStartIndex),d=e.getoffsetX(l-1),p=Pt(t*h,r,n,i,a.segment,c,u,s,o);if(!p)return null;const f=Pt(t*d,r,n,i,a.segment,c,u,s,o);return f?s.projectionCache.anyProjectionOccluded?null:{first:p,last:f}:null}function Tt(t,r,n,i){return t===e.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.ah.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function St(t,r,n,i,a,o,s,l,c,u,h){const d=n/24,p=r.lineOffsetX*d,f=r.lineOffsetY*d;let m;if(r.numGlyphs>1){const e=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=kt(d,l,p,f,i,r,h,t);if(!c)return{notEnoughRoom:!0};const g=xt(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=xt(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(a&&!i){const t=Tt(r.writingMode,g,y,u);if(t)return t}m=[c.first];for(let a=r.glyphStartIndex+1;a<e-1;a++)m.push(Pt(d*l.getoffsetX(a),p,f,i,r.segment,n,o,t,h));m.push(c.last)}else{if(a&&!i){const n=xt(t.tileAnchorPoint.x,t.tileAnchorPoint.y,o,t.getElevation).point,i=r.lineStartIndex+r.segment+1,a=new e.P(t.lineVertexArray.getx(i),t.lineVertexArray.gety(i)),s=xt(a.x,a.y,o,t.getElevation),l=s.signedDistanceFromCamera>0?s.point:At(t.tileAnchorPoint,a,n,1,o,t),c=Tt(r.writingMode,n,l,u);if(c)return c}const n=Pt(d*l.getoffsetX(r.glyphStartIndex),p,f,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!n||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[n]}for(const g of m)e.aj(c,g.point,g.angle);return{}}function At(t,e,r,n,i,a){const o=t.add(t.sub(e)._unit()),s=void 0!==i?xt(o.x,o.y,i,a.getElevation).point:Ct(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Mt(t,r,n){const i=r.projectionCache;if(i.projections[t])return i.projections[t];const a=new e.P(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=Ct(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[t]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;const s=t-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),c=a,u=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,At(l,c,u,h,void 0,r);var l,c,u,h}function Ct(t,e,r){const n=t+r.translation[0],i=e+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=xt(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function Et(t,e,r){return t._unit()._perp()._mult(e*r)}function Lt(t,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const u=n.add(r);if(t+c.direction<i||t+c.direction>=a)return l.projectionCache.offsets[t]=u,u;const h=Mt(t+c.direction,l,c),d=Et(h.sub(n),s,c.direction),p=n.add(d),f=h.add(d);return l.projectionCache.offsets[t]=e.ak(o,u,p,f)||u,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){const c=n?t-e:t+e;let u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let d,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?d=s.projectionCache.cachedAnchorPoint:(d=Ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=d);let f,m,g=d,y=d,v=0,x=0;const b=Math.abs(c),_=[];let w;for(;v+x<=b;){if(p+=u,p<a||p>=o)return null;v+=x,y=g,m=f;const t={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:y};if(g=Mt(p,s,t),0===r)_.push(y),w=g.sub(y);else{let e;const n=g.sub(y);e=0===n.mag()?Et(Mt(p+u,s,t).sub(g),r,u):Et(n,r,u),m||(m=y.add(e)),f=Lt(p,e,g,a,o,m,r,s,t),_.push(m),w=f.sub(m)}x=w.mag()}const k=w._mult((b-v)/x)._add(m||y),T=h+Math.atan2(g.y-y.y,g.x-y.x);return _.push(k),{point:k,angle:l?T:0,path:_}}const It=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function zt(t,e){for(let r=0;r<t;r++){const t=e.length;e.resize(t+4),e.float32.set(It,3*t)}}function Ot(t,e,r){const n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}const Dt=100;class Rt{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new gt(t.width+200,t.height+200,25),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new gt(t.width+200,t.height+200,25);this.transform=t,this.mapProjection=e,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Dt,this.screenBottomBoundary=t.height+Dt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,r,n,i,a,o,s,l,c,u){const h=t.anchorPointX+s[0],d=t.anchorPointY+s[1],p=this.projectAndGetPerspectiveRatio(n,h,d,i,c),f=r*p.perspectiveRatio;let m;if(a||o)m=this._projectCollisionBox(t,f,n,i,a,o,s,p,c,u);else{const e=p.point.x+(u?u.x*f:0),r=p.point.y+(u?u.y*f:0);m={allPointsOccluded:!1,box:[e+t.x1*f,r+t.y1*f,e+t.x2*f,r+t.y2*f]}}const[g,y,v,x]=m.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?m.allPointsOccluded:this.mapProjection.isOccluded(h,d,i))||p.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,y,v,x)||"always"!==e&&this.grid.hitTest(g,y,v,x,e,l)?{box:[g,y,v,x],placeable:!1,offscreen:!1}:{box:[g,y,v,x],placeable:!0,offscreen:this.isOffscreen(g,y,v,x)}}placeCollisionCircles(t,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g){const y=[],v=new e.P(r.anchorX,r.anchorY),x=this.getPerspectiveRatio(o,v.x,v.y,s,g),b=(h?a/x:a*x)/e.ap,_={getElevation:g,labelPlaneMatrix:l,lineVertexArray:n,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:m},w=kt(b,i,r.lineOffsetX*b,r.lineOffsetY*b,!1,r,!1,_);let k=!1,T=!1,S=!0;if(w){const r=.5*p*x+f,n=new e.P(-100,-100),i=new e.P(this.screenRightBoundary,this.screenBottomBoundary),a=new ft,o=w.first,s=w.last;let l=[];for(let t=o.path.length-1;t>=1;t--)l.push(o.path[t]);for(let t=1;t<s.path.length;t++)l.push(s.path[t]);const h=2.5*r;if(c){const t=this.projectPathToScreenSpace(l,_,c);l=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let m=[];if(l.length>0){const t=l[0].clone(),r=l[0].clone();for(let e=1;e<l.length;e++)t.x=Math.min(t.x,l[e].x),t.y=Math.min(t.y,l[e].y),r.x=Math.max(r.x,l[e].x),r.y=Math.max(r.y,l[e].y);m=t.x>=n.x&&r.x<=i.x&&t.y>=n.y&&r.y<=i.y?[l]:r.x<n.x||t.x>i.x||r.y<n.y||t.y>i.y?[]:e.al([l],n.x,n.y,i.x,i.y)}for(const e of m){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let e=0;e<n;e++){const i=e/Math.max(n-1,1),o=a.lerp(i),s=o.x+Dt,l=o.y+Dt;y.push(s,l,r,0);const c=s-r,h=l-r,p=s+r,f=l+r;if(S=S&&this.isOffscreen(c,h,p,f),T=T||this.isInsideGrid(c,h,p,f),"always"!==t&&this.grid.hitTestCircle(s,l,r,t,d)&&(k=!0,!u))return{circles:[],offscreen:!1,collisionDetected:k}}}}return{circles:!u&&k||!T||x<this.perspectiveRatioCutoff?[]:y,offscreen:S,collisionDetected:k}}projectPathToScreenSpace(t,e,r){return t.map((t=>xt(t.x,t.y,r,e.getElevation)))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,o=-1/0;for(const u of t){const t=new e.P(u.x+Dt,u.y+Dt);n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y),r.push(t)}const s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(const u of s){const t=u.key;if(void 0===l[t.bucketInstanceId]&&(l[t.bucketInstanceId]={}),l[t.bucketInstanceId][t.featureIndex])continue;const n=[new e.P(u.x1,u.y1),new e.P(u.x2,u.y1),new e.P(u.x2,u.y2),new e.P(u.x1,u.y2)];e.am(r,n)&&(l[t.bucketInstanceId][t.featureIndex]=!0,void 0===c[t.bucketInstanceId]&&(c[t.bucketInstanceId]=[]),c[t.bucketInstanceId].push(t.featureIndex))}return c}insertCollisionBox(t,e,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,r,n,i,a){const o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e};for(let l=0;l<t.length;l+=4)o.insertCircle(s,t[l],t[l+1],t[l+2])}projectAndGetPerspectiveRatio(t,r,n,i,a){let o;a?(o=[r,n,a(r,n),1],e.af(o,o,t)):(o=[r,n,0,1],Ot(o,o,t));const s=o[3];return{point:new e.P((o[0]/s+1)/2*this.transform.width+Dt,(-o[1]/s+1)/2*this.transform.height+Dt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(t,e,r,n,i){const a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(e,r,n,i):xt(e,r,t,i);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(t,e,r,n){return r<Dt||t>=this.screenRightBoundary||n<Dt||e>this.screenBottomBoundary}isInsideGrid(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.an([]);return e.J(t,t,[-100,-100,0]),t}_projectCollisionBox(t,r,n,i,a,o,s,l,c,u){let h=new e.P(1,0),d=new e.P(0,1);const p=new e.P(t.anchorPointX+s[0],t.anchorPointY+s[1]);if(o&&!a){const t=this.projectAndGetPerspectiveRatio(n,p.x+1,p.y,i,c).point.sub(l.point).unit(),r=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0),a=Math.sin(r),o=Math.cos(r);h=new e.P(o,a),d=new e.P(-a,o)}else if(!o&&a){const t=-this.transform.angle,r=Math.sin(t),n=Math.cos(t);h=new e.P(n,r),d=new e.P(-r,n)}let f=l.point,m=r;if(a){f=p;const t=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-t),m*=this.mapProjection.getPitchedTextCorrection(this.transform,p,i),u||(m*=e.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(f=f.add(h.mult(u.x*m)).add(d.mult(u.y*m)));const g=t.x1*m,y=t.x2*m,v=(g+y)/2,x=t.y1*m,b=t.y2*m,_=(x+b)/2,w=[{offsetX:g,offsetY:x},{offsetX:v,offsetY:x},{offsetX:y,offsetY:x},{offsetX:y,offsetY:_},{offsetX:y,offsetY:b},{offsetX:v,offsetY:b},{offsetX:g,offsetY:b},{offsetX:g,offsetY:_}];let k=[];for(const{offsetX:S,offsetY:A}of w)k.push(new e.P(f.x+h.x*S+d.x*A,f.y+h.y*S+d.y*A));let T=!1;if(a){const t=k.map((t=>this.projectAndGetPerspectiveRatio(n,t.x,t.y,i,c)));T=t.some((t=>!t.isOccluded)),k=t.map((t=>t.point))}else T=!0;return{box:e.ao(k),allPointsOccluded:!T}}}function Ft(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class Bt{constructor(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class jt{constructor(t,e,r,n,i){this.text=new Bt(t?t.text:null,e,r,i),this.icon=new Bt(t?t.icon:null,e,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Nt{constructor(t,e,r){this.text=t,this.icon=e,this.skipFade=r}}class Ut{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class Vt{constructor(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class qt{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function $t(t,r,n,i,a){const{horizontalAlign:o,verticalAlign:s}=e.au(t);return new e.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Ht{constructor(t,e,r,n,i,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new Rt(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new qt(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(r,n)=>e.getElevation(t,r,n):null}getBucketParts(t,r,n,i){const a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;const s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.X,d=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(d),f="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=Ft(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=yt(p,f,m,this.transform,g);let b=null;if(f){const t=vt(p,f,m,this.transform,g);b=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[a.bucketInstanceId]=new Vt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);const _={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:p,unwrappedTileID:d,textLabelPlaneMatrix:x,labelToScreenMatrix:b,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const e of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:_})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:_})}attemptAnchorPlacement(t,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y,v,x){const b=e.aq[t.textAnchor],_=[t.textOffset0,t.textOffset1],w=$t(b,n,i,_,a),k=this.collisionIndex.placeCollisionBox(r,d,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,d,l,c,u,s,o,y,h.predicate,x,w).placeable)&&k.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:_,width:n,height:i,anchor:b,textBoxScale:a,prevAnchor:t},this.markUsedJustification(f,b,p,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:k}}}placeLayerBucketPart(t,r,n){const{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:d,holdingForFade:p,collisionBoxArray:f,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=e.ar(a,"text-overlap","text-allow-overlap"),b="always"===x,_=e.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===_,k="map"===a.get("text-rotation-alignment"),T="map"===a.get("text-pitch-alignment"),S="none"!==a.get("icon-text-fit"),A="viewport-y"===a.get("symbol-z-order"),M=b&&(w||!i.hasIconData()||v),C=w&&(b||!i.hasTextData()||y);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);const E=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),L=(t,f,w)=>{var A,L;if(r[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new Nt(!1,!1,!1));let P=!1,I=!1,z=!0,O=null,D={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,B=null,j=null,N=0,U=0,V=0;f.textFeatureIndex?N=f.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),f.verticalTextFeatureIndex&&(U=f.verticalTextFeatureIndex);const q=f.textBox;if(q){const r=r=>{let n=e.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,n=e,this.markUsedOrientation(i,n,t))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&f.verticalTextBox){for(const t of i.writingModes)if(t===e.ah.vertical?(D=n(),R=D):D=r(),D&&D.placeable)break}else D=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){const n=(e,r)=>{const n=this.collisionIndex.placeCollisionBox(e,x,d,l,c,T,k,o,g.predicate,E);return n&&n.placeable&&(this.markUsedOrientation(i,r,t),this.placedOrientations[t.crossTileID]=r),n};a((()=>n(q,e.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?n(r,e.ah.vertical):{box:null,offscreen:null}})),r(D&&D.placeable)}else{let p=e.aq[null===(L=null===(A=this.prevPlacement)||void 0===A?void 0:A.variableOffsets[t.crossTileID])||void 0===L?void 0:L.anchor];const m=(r,a,f)=>{const m=r.x2-r.x1,y=r.y2-r.y1,v=t.textBoxScale,b=S&&"never"===_?a:null;let w=null,A="never"===x?1:2,M="never";p&&A++;for(let e=0;e<A;e++){for(let e=u;e<h;e++){const n=i.textAnchorOffsets.get(e);if(p&&n.textAnchor!==p)continue;const a=this.attemptAnchorPlacement(n,r,m,y,v,k,T,d,l,c,g,M,t,i,f,o,s,b,E);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return P=!0,O=a.shift,w}p?p=null:M=x}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",d,l,c,T,k,o,g.predicate,E,new e.P(0,0)).box,offscreen:!1,placeable:!1}),w};a((()=>m(q,f.iconBox,e.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&(!D||!D.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,f.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),D&&(P=D.placeable,z=D.offscreen);const y=r(D&&D.placeable);if(!P&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(i,e.anchor,t,y))}}}if(F=D,P=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(i.textSizeData,m,r),d=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,T,g.predicate,t.collisionCircleDiameter,d,o,E),B.circles.length&&B.collisionDetected&&!n&&e.w("Collisions detected, but collision boxes are not shown"),P=b||B.circles.length>0&&!B.collisionDetected,z=z&&B.offscreen}if(f.iconFeatureIndex&&(V=f.iconFeatureIndex),f.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,_,d,l,c,T,k,s,g.predicate,E,S&&O?O:void 0);R&&R.placeable&&f.verticalIconBox?(j=t(f.verticalIconBox),I=j.placeable):(j=t(f.iconBox),I=j.placeable),z=z&&j.offscreen}const $=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,H=v||0===t.numIconVertices;$||H?H?$||(I=I&&P):P=I&&P:I=P=I&&P;const W=I&&j.placeable;if(P&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(j.box,_,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),B&&P&&this.collisionIndex.insertCollisionCircles(B.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,f,F,j,B),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Nt(P||M,I||C,z||i.justReloaded),r[t.crossTileID]=!0};if(A){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=i.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const r=e[t];L(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)L(i.symbolInstances.get(e),i.collisionArrays[e],e);if(n&&i.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[i.bucketInstanceId];e.as(t.invProjMatrix,l),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(t,e,r,n,i,a){if(r.textBox||r.iconBox){let a,o;this.collisionBoxArrays.has(t)?a=this.collisionBoxArrays.get(t):(a=new Map,this.collisionBoxArrays.set(t,a)),a.has(e)?o=a.get(e):(o={text:null,icon:null},a.set(e,o)),r.textBox&&(o.text=n.box),r.iconBox&&(o.icon=i.box)}if(a){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new Ut);for(let t=0;t<a.circles.length;t+=4)e.circles.push(a.circles[t+0]),e.circles.push(a.circles[t+1]),e.circles.push(a.circles[t+2]),e.circles.push(a.collisionDetected?1:0)}}markUsedJustification(t,r,n,i){let a;a=i===e.ah.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[e.at(r)];const o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const e of o)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:n.crossTileID)}markUsedOrientation(t,r,n){const i=r===e.ah.horizontal||r===e.ah.horizontalOnly?r:0,a=r===e.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const e of o)t.text.placedSymbolArray.get(e).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(const s in this.placements){const t=this.placements[s],e=i[s];e?(this.opacities[s]=new jt(e,n,t.text,t.icon),r=r||t.text!==e.text.placed||t.icon!==e.icon.placed):(this.opacities[s]=new jt(null,n,t.text,t.icon,t.skipFade),r=r||t.text||t.icon)}for(const s in i){const t=i[s];if(!this.opacities[s]){const e=new jt(t,n,!1,!1);e.isHidden()||(this.opacities[s]=e,r=r||t.text.placed||t.icon.placed)}}for(const s in a)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=a[s]);for(const s in o)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=o[s]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const r={};for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n,i){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const a=t.layers[0],o=a.layout,s=new jt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),d="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),f=new jt(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const m=(t,e,r)=>{for(let n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r);t.hasVisibleVertices=t.hasVisibleVertices||r!==ee},g=this.collisionBoxArrays.get(t.bucketInstanceId);for(let y=0;y<t.symbolInstances.length;y++){const r=t.symbolInstances.get(y),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:a,crossTileID:o}=r;let l=this.opacities[o];n[o]?l=s:l||(l=f,this.opacities[o]=l),n[o]=!0;const c=r.numIconVertices>0,v=this.placedOrientations[r.crossTileID],x=v===e.ah.vertical,b=v===e.ah.horizontal||v===e.ah.horizontalOnly;if(i>0||a>0){const e=te(l.text);m(t.text,i,x?ee:e),m(t.text,a,b?ee:e);const n=l.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=n||x?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=n||b?1:0);const o=this.variableOffsets[r.crossTileID];o&&this.markUsedJustification(t,o.anchor,r,v);const s=this.placedOrientations[r.crossTileID];s&&(this.markUsedJustification(t,"left",r,s),this.markUsedOrientation(t,s,r))}if(c){const e=te(l.icon),n=!(p&&r.verticalPlacedIconSymbolIndex&&x);r.placedIconSymbolIndex>=0&&(m(t.icon,r.numIconVertices,n?e:ee),t.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=l.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,r.numVerticalIconVertices,n?ee:e),t.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const _=g&&g.has(y)?g.get(y):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[y];if(r){let n=new e.P(0,0);if(r.textBox||r.verticalTextBox){let e=!0;if(u){const t=this.variableOffsets[o];t?(n=$t(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&n._rotate(d?this.transform.angle:-this.transform.angle)):e=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=x),r.verticalTextBox&&(i=b),Wt(t.textCollisionBox.collisionVertexArray,l.text.placed,!e||i,_.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){const e=Boolean(!b&&r.verticalIconBox);let i;r.iconBox&&(i=e),r.verticalIconBox&&(i=!e),Wt(t.iconCollisionBox.collisionVertexArray,l.icon.placed,i,_.icon,p?n.x:0,p?n.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t}setStale(){this.stale=!0}}function Wt(t,e,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const o=n[0]-Dt,s=n[1]-Dt,l=n[2]-Dt,c=n[3]-Dt;t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,c),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,c)}const Gt=Math.pow(2,25),Yt=Math.pow(2,24),Zt=Math.pow(2,17),Xt=Math.pow(2,16),Kt=Math.pow(2,9),Jt=Math.pow(2,8),Qt=Math.pow(2,1);function te(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Gt+e*Yt+r*Zt+e*Xt+r*Kt+e*Jt+r*Qt+e}const ee=0;function re(){return{isOccluded:(t,e,r)=>!1,getPitchedTextCorrection:(t,e,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,r,n){throw new Error("Not implemented.")},translatePosition:(t,e,r,n)=>function(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?t.angle:0:"viewport"===n?-t.angle:0;if(a){const t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}return[i?r[0]:Ft(e,r[0],t.zoom),i?r[1]:Ft(e,r[1],t.zoom)]}(t,e,r,n),getCircleRadiusCorrection:t=>1}}class ne{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,r,n,i){const a=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(a,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<a.length;)if(e.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1}}class ie{constructor(t,e,r,n,i,a,o,s){this.placement=new Ht(t,re(),e,a,o,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(t,e,r){const n=a.now(),i=()=>!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=e[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ne(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const ae=512/e.X/2;class oe{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let e=0;e<r.length;e++){const t=r.get(e),n=t.key,a=i.get(n);a?a.push(t):i.set(n,[t])}for(const[a,o]of i){const t={positions:o.map((t=>({x:Math.floor(t.anchorX*ae),y:Math.floor(t.anchorY*ae)}))),crossTileIDs:o.map((t=>t.crossTileID))};if(t.positions.length>128){const r=new e.av(t.positions.length,16,Uint16Array);for(const{x:e,y:n}of t.positions)r.add(e,n);r.finish(),delete t.positions,t.index=r}this._symbolsByKey[a]=t}}getScaledCoordinates(t,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=ae/Math.pow(2,l-a),u=(s*e.X+t.anchorY)*c,h=i*e.X*ae;return{x:Math.floor((o*e.X+t.anchorX)*c-n*e.X*ae),y:Math.floor(u-h)}}findMatches(t,e,r){const n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let i=0;i<t.length;i++){const a=t.get(i);if(a.crossTileID)continue;const o=this._symbolsByKey[a.key];if(!o)continue;const s=this.getScaledCoordinates(a,e);if(o.index){const t=o.index.range(s.x-n,s.y-n,s.x+n,s.y+n).sort();for(const e of t){const t=o.crossTileIDs[e];if(!r[t]){r[t]=!0,a.crossTileID=t;break}}}else if(o.positions)for(let t=0;t<o.positions.length;t++){const e=o.positions[t],i=o.crossTileIDs[t];if(Math.abs(e.x-s.x)<=n&&Math.abs(e.y-s.y)<=n&&!r[i]){r[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((t=>{let{crossTileIDs:e}=t;return e}))}}class se{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class le{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const r in this.indexes){const t=this.indexes[r],n={};for(const r in t){const i=t[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}this.indexes[r]=n}this.lng=t}addBucket(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const n=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in r){const a=r[i];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,n)}else{const a=r[t.scaledTo(Number(i)).key];a&&a.findMatches(e.symbolInstances,t,n)}}for(let i=0;i<e.symbolInstances.length;i++){const t=e.symbolInstances.get(i);t.crossTileID||(t.crossTileID=r.generate(),n[t.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new oe(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const r of e.getCrossTileIDsLists())for(const e of r)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(const r in this.indexes){const n=this.indexes[r];for(const i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e}}class ce{constructor(){this.layerIndexes={},this.crossTileIDs=new se,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,r){let n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new le);let i=!1;const a={};n.handleWrapJump(r);for(const o of e){const e=o.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(o.tileID,e,this.crossTileIDs)&&(i=!0),a[e.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const r in this.layerIndexes)e[r]||delete this.layerIndexes[r]}}const ue=(t,r)=>e.t(t,r&&r.filter((t=>"source.canvas"!==t.identifier))),he=e.aw();class de extends e.E{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new N(j(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new M(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new z(256,512),this.crossTileSymbolIndex=new ce,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),st().on(it,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const r=e.getSource();if(r&&r.vectorLayerIds)for(const n in this._layers){const t=this._layers[n];t.source===r.id&&this._validateLayer(t)}}))}loadURL(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new e.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;e.h(i,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,r,n)})).catch((t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new e.j(t))}))}loadJSON(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(he,{validate:!1})}_load(t,r,n){var i;const a=r.transformStyle?r.transformStyle(n,t):t;if(!r.validate||!ue(this,e.u(a))){this._loaded=!0,this.stylesheet=a;for(const t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new I(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const r of t){const t=e.aA(r);t.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=t}}_loadSprite(t){let r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const o=x(t),s=n>1?"@2x":"",l={},c={};for(const{id:t,url:n}of o){const a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[t]=e.h(a,i);const o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[t]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,r){return e._(this,void 0,void 0,(function*(){const e={};for(const n in t){e[n]={};const i=a.getImageCanvasContext((yield r[n]).data),o=(yield t[n]).data;for(const t in o){const{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:p,textFitWidth:f,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:d,content:p,textFitWidth:f,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const i in t[e]){const r="default"===e?i:`${e}:${i}`;this._spritesImagesIds[e].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,t[e][i],!1):this.imageManager.addImage(r,t[e][i]),n&&(this._changedImages[r]=!0)}}})).catch((t=>{this._spriteRequest=null,r=t,this.fire(new e.j(r))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),i&&i(r)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){const r=this.sourceCaches[t.source];if(!r)return;const n=t.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?e.aB(n):n);const i=[];for(const a of t)if(n[a]){const t=r?e.aB(n[a]):n[a];i.push(t)}return i}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const r of e){const e=this._layers[r];"custom"!==e.type&&(t[r]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const r=this._changed;if(r){const e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const n in this._updatedPaintProps)this._layers[n].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const n={};for(const e in this.sourceCaches){const t=this.sourceCaches[e];n[e]=t.used,t.used=!1}for(const e of this._order){const r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const i in n){const t=this.sourceCaches[i];!!n[i]!=!!t.used&&t.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:i}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,r&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;this._checkLoaded();const i=this.serialize();if(t=r.transformStyle?r.transformStyle(i,t):t,(null===(n=r.validate)||void 0===n||n)&&ue(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);const a=e.aC(i,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const e of o.operations)e();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const e=[],r=[];for(const n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":e.push((()=>{}));break;default:r.push(n.command)}return{operations:e,unimplemented:r}}addImage(t,r){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.u.source,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[t]=new ht(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:t}))),i.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${n}" is using it.`)));const r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const r=this.sourceCaches[t].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=t.id;if(this.getLayer(i))return void this.fire(new e.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===t.type){if(ue(this,e.aD(t)))return;a=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(i,t.source),t=e.aB(t),t=e.e(t,{source:i})),this._validate(e.u.layer,`layers.${i}`,t,{arrayIndex:-1},n))return;a=e.aA(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const t=this._removedLayers[i];delete this._removedLayers[i],t.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;const n=this._order.indexOf(t);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const r=this._layers[t];if(!r)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,n){this._checkLoaded();const i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this.getLayer(t);if(i){if(!e.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=e.aB(r),this._updateLayer(i)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){const n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,r){this._checkLoaded();const n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&i?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();const n=t.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.aF(this.sourceCaches,(t=>t.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return e.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:r,terrain:n},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,r={},n=[];for(let a=this._order.length-1;a>=0;a--){const i=this._order[a];if(e(i)){r[i]=a;for(const e of t){const t=e[i];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(e(o))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(r[e.layer.id]<a)break;i.push(e),n.pop()}else for(const e of t){const t=e[o];if(t)for(const e of t)i.push(e.feature)}}return i}queryRenderedFeatures(t,r,n){r&&r.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);const i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(const t of r.layers){const r=this._layers[t];if(!r)return this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}const a=[];r.availableImages=this._availableImages;const o=this._serializedAllLayers();for(const e in this.sourceCaches)r.layers&&!i[e]||a.push(q(this.sourceCaches[e],this._layers,o,t,r,n));return this.placement&&a.push(function(t,e,r,n,i,a,o){const s={},l=a.queryRenderedSymbols(n),c=[];for(const u of Object.keys(l).map(Number))c.push(o[u]);c.sort($);for(const u of c){const r=u.featureIndex.lookupSymbolFeatures(l[u.bucketInstanceId],e,u.bucketIndex,u.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(const t in r){const e=s[t]=s[t]||[],n=r[t];n.sort(((t,e)=>{const r=u.featureSortOrder;if(r){const n=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(const t of n)e.push(t)}}for(const u in s)s[u].forEach((e=>{const n=e.feature,i=r[t[u].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return s}(this._layers,o,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[t];return n?function(t,e){const r=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],i={};for(let a=0;a<r.length;a++){const t=r[a],o=t.tileID.canonical.key;i[o]||(i[o]=!0,t.querySourceFeatures(n,e))}return n}(n,r):[]}getLight(){return this.light.getLight()}setLight(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const n=this.light.getLight();let i=!1;for(const a in t)if(!e.aE(t[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(o)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getSky();let i=!1;if(!t&&!n)return;if(t&&!n)i=!0;else if(!t&&n)i=!0;else for(const a in t)if(!e.aE(t[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,r),this.sky.updateTransitions(o)}_validate(t,r,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&ue(this,t.call(e.u,e.e({key:r,style:this.serialize(),value:n,styleSpec:e.v},i)))}_remove(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),st().off(it,this._rtlPluginLoaded);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this.sourceCaches){const t=this.sourceCaches[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const e in this.sourceCaches)this.sourceCaches[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=!1,s=!1;const l={};for(const a of this._order){const e=this._layers[a];if("symbol"!==e.type)continue;if(!l[e.source]){const t=this.sourceCaches[e.source];l[e.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(e,l[e.source],t.center.lng);o=o||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),t.zoom))&&(this.pauseablePlacement=new ie(t,this.map.terrain,this._order,i,e,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(const a of this._order){const t=this._layers[a];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,r.icons),t}))}getGlyphs(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(r.stacks),e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;this._checkLoaded();const a=[{id:t,url:r}],o=[...x(this.stylesheet.sprite),...a];this._validate(e.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(t){this._checkLoaded();const r=x(this.stylesheet.sprite);if(r.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;r.splice(r.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return x(this.stylesheet.sprite)}setSprite(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,r)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}var pe=e.Y([{name:"a_pos",type:"Int16",components:2}]);const fe={prelude:me("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:me("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:me("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),circle:me("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));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,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,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;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:me("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:me("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:me("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),collisionBox:me("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;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:me("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;}","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);}"),debug:me("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);}","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,get_elevation(a_pos),1);}"),fill:me("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:me("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:me("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),fillPattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),fillExtrusion:me("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}"),fillExtrusionPattern:me("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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\n? a_pos\n: 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;}"),hillshadePrepare:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),hillshade:me("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),line:me("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:me("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:me("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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);}"),raster:me("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),symbolIcon:me("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:me("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:me("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}"),terrain:me("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:me("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:me("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:me("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function me(t,e){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,((t,e,r,n,i)=>(s[i]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:e=e.replace(r,((t,e,r,n,i)=>{const a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class ge{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,r,n,i,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let u=0;!c&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,r,n,i,a,o,s,l):(t.bindVertexArray.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,r,n,i,a,o,s){const l=t.numAttributes,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,e.enableAttributes(u,t);for(const h of r)h.enableAttributes(u,t);a&&a.enableAttributes(u,t),o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,i);for(const h of r)h.bind(),h.setVertexAttribPointers(u,t,i);a&&(a.bind(),a.setVertexAttribPointers(u,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,t,i)),s&&(s.bind(),s.setVertexAttribPointers(u,t,i)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ye=(t,r,n,i,a)=>({u_matrix:t,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function ve(t){const e=[];for(let r=0;r<t.length;r++){if(null===t[r])continue;const n=t[r].split(" ");e.push(n.pop())}return e}class xe{constructor(t,r,n,i,a,o){const s=t.gl;this.program=s.createProgram();const l=ve(r.staticAttributes),c=n?n.getBinderAttributes():[],u=l.concat(c),h=fe.prelude.staticUniforms?ve(fe.prelude.staticUniforms):[],d=r.staticUniforms?ve(r.staticUniforms):[],p=n?n.getBinderUniforms():[],f=h.concat(d).concat(p),m=[];for(const e of f)m.indexOf(e)<0&&m.push(e);const g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");const y=g.concat(fe.prelude.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(fe.prelude.vertexSource,r.vertexSource).join("\n"),x=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(x,y),s.compileShader(x),!s.getShaderParameter(x,s.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${s.getShaderInfoLog(x)}`);s.attachShader(this.program,x);const b=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(b,v),s.compileShader(b),!s.getShaderParameter(b,s.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${s.getShaderInfoLog(b)}`);s.attachShader(this.program,b),this.attributes={};const _={};this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw new Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(b),s.deleteShader(x);for(let e=0;e<m.length;e++){const t=m[e];if(t&&!_[t]){const e=s.getUniformLocation(this.program,t);e&&(_[t]=e)}}var w,k;this.fixedUniforms=i(t,_),this.terrainUniforms=(w=t,k=_,{u_depth:new e.aH(w,k.u_depth),u_terrain:new e.aH(w,k.u_terrain),u_terrain_dim:new e.aI(w,k.u_terrain_dim),u_terrain_matrix:new e.aJ(w,k.u_terrain_matrix),u_terrain_unpack:new e.aK(w,k.u_terrain_unpack),u_terrain_exaggeration:new e.aI(w,k.u_terrain_exaggeration)}),this.binderUniforms=n?n.getUniforms(t,_):[]}draw(t,e,r,n,i,a,o,s,l,c,u,h,d,p,f,m,g,y){const v=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),s){t.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),t.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(s[t])}for(const b in this.fixedUniforms)this.fixedUniforms[b].set(o[b]);f&&f.setUniforms(t,this.binderUniforms,d,{zoom:p});let x=0;switch(e){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(const b of h.get()){const r=b.vaos||(b.vaos={});(r[l]||(r[l]=new ge)).bind(t,this,c,f?f.getPaintVertexBuffers():[],u,b.vertexOffset,m,g,y),v.drawElements(e,b.primitiveLength*x,v.UNSIGNED_SHORT,b.primitiveOffset*x*2)}}}function be(t,e,r){const n=1/Ft(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const _e=(t,r,n,i)=>{const a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=function(){var t=new e.A(9);return e.A!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}();"viewport"===a.properties.get("anchor")&&function(t,e){var r=Math.sin(e),n=Math.cos(e);t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-r.transform.angle),function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);const c=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},we=(t,r,n,i,a,o,s)=>e.e(_e(t,r,n,i),be(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ke=t=>({u_matrix:t}),Te=(t,r,n,i)=>e.e(ke(t),be(n,r,i)),Se=(t,e)=>({u_matrix:t,u_world:e}),Ae=(t,r,n,i,a)=>e.e(Te(t,r,n,i),{u_world:a}),Me=(t,e,r,n)=>{const i=t.transform;let a,o;if("map"===n.paint.get("circle-pitch-alignment")){const t=Ft(r,1,i.zoom);a=!0,o=[t,t]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:o}},Ce=(t,e,r)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ee=function(t,e){return{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1}},Le=t=>({u_matrix:t}),Pe=(t,e,r,n)=>({u_matrix:t,u_extrude_scale:Ft(e,1,r),u_intensity:n}),Ie=(t,r,n,i)=>{const a=e.H();e.aP(a,0,t.width,t.height,0,0,1);const o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function ze(t,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.Z(0,i/n).toLngLat().lat,new e.Z(0,(i+1)/n).toLngLat().lat]}const Oe=(t,e,r,n)=>{const i=t.transform;return{u_matrix:je(t,e,r,n),u_ratio:1/Ft(e,1,i.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},De=(t,r,n,i,a)=>e.e(Oe(t,r,n,a),{u_image:0,u_image_height:i}),Re=(t,e,r,n,i)=>{const a=t.transform,o=Be(e,a);return{u_matrix:je(t,e,r,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ft(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Fe=(t,r,n,i,a,o)=>{const s=t.lineAtlas,l=Be(r,t.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),d=u.width*a.fromScale,p=h.width*a.toScale;return e.e(Oe(t,r,n,o),{u_patternscale_a:[l/d,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(d,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Be(t,e){return 1/Ft(t,1,e.tileZoom)}function je(t,e,r,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Ne=(t,e,r,n,i)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ue(i.paint.get("raster-hue-rotate"))};var a,o};function Ue(t){t*=Math.PI/180;const e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const Ve=(t,e,r,n,i,a,o,s,l,c,u,h,d,p)=>{const f=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:f.width/f.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:d,u_texture:0,u_translation:u,u_pitched_scale:p}},qe=(t,r,n,i,a,o,s,l,c,u,h,d,p,f,m)=>{const g=s.transform;return e.e(Ve(t,r,n,i,a,o,s,l,c,u,h,d,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+f})},$e=(t,r,n,i,a,o,s,l,c,u,h,d,p,f)=>e.e(qe(t,r,n,i,a,o,s,l,c,u,h,!0,d,!0,f),{u_texsize_icon:p,u_texture_icon:1}),He=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),We=(t,r,n,i,a,o)=>e.e(function(t,e,r,n){const i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Ft(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:t,u_opacity:r}),Ge={fillExtrusion:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_opacity:new e.aI(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_height_factor:new e.aI(t,r.u_height_factor),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade),u_opacity:new e.aI(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,r.u_scale_with_map),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_extrude_scale:new e.aO(t,r.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_matrix:new e.aJ(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_pixel_extrude_scale:new e.aO(t,r.u_pixel_extrude_scale)}),collisionCircle:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_inv_matrix:new e.aJ(t,r.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_viewport_size:new e.aO(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.aL(t,r.u_color),u_matrix:new e.aJ(t,r.u_matrix),u_overlay:new e.aH(t,r.u_overlay),u_overlay_scale:new e.aI(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.aI(t,r.u_extrude_scale),u_intensity:new e.aI(t,r.u_intensity),u_matrix:new e.aJ(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_color_ramp:new e.aH(t,r.u_color_ramp),u_opacity:new e.aI(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_latrange:new e.aO(t,r.u_latrange),u_light:new e.aO(t,r.u_light),u_shadow:new e.aL(t,r.u_shadow),u_highlight:new e.aL(t,r.u_highlight),u_accent:new e.aL(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_dimension:new e.aO(t,r.u_dimension),u_zoom:new e.aI(t,r.u_zoom),u_unpack:new e.aK(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_image:new e.aH(t,r.u_image),u_image_height:new e.aI(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texsize:new e.aO(t,r.u_texsize),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_image:new e.aH(t,r.u_image),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_patternscale_a:new e.aO(t,r.u_patternscale_a),u_patternscale_b:new e.aO(t,r.u_patternscale_b),u_sdfgamma:new e.aI(t,r.u_sdfgamma),u_image:new e.aH(t,r.u_image),u_tex_y_a:new e.aI(t,r.u_tex_y_a),u_tex_y_b:new e.aI(t,r.u_tex_y_b),u_mix:new e.aI(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_tl_parent:new e.aO(t,r.u_tl_parent),u_scale_parent:new e.aI(t,r.u_scale_parent),u_buffer_scale:new e.aI(t,r.u_buffer_scale),u_fade_t:new e.aI(t,r.u_fade_t),u_opacity:new e.aI(t,r.u_opacity),u_image0:new e.aH(t,r.u_image0),u_image1:new e.aH(t,r.u_image1),u_brightness_low:new e.aI(t,r.u_brightness_low),u_brightness_high:new e.aI(t,r.u_brightness_high),u_saturation_factor:new e.aI(t,r.u_saturation_factor),u_contrast_factor:new e.aI(t,r.u_contrast_factor),u_spin_weights:new e.aN(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texsize_icon:new e.aO(t,r.u_texsize_icon),u_texture:new e.aH(t,r.u_texture),u_texture_icon:new e.aH(t,r.u_texture_icon),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),background:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_color:new e.aL(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_image:new e.aH(t,r.u_image),u_pattern_tl_a:new e.aO(t,r.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,r.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,r.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,r.u_pattern_br_b),u_texsize:new e.aO(t,r.u_texsize),u_mix:new e.aI(t,r.u_mix),u_pattern_size_a:new e.aO(t,r.u_pattern_size_a),u_pattern_size_b:new e.aO(t,r.u_pattern_size_b),u_scale_a:new e.aI(t,r.u_scale_a),u_scale_b:new e.aI(t,r.u_scale_b),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_ele_delta:new e.aI(t,r.u_ele_delta),u_fog_matrix:new e.aJ(t,r.u_fog_matrix),u_fog_color:new e.aL(t,r.u_fog_color),u_fog_ground_blend:new e.aI(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,r.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon_fog_blend:new e.aI(t,r.u_horizon_fog_blend)}),terrainDepth:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ele_delta:new e.aI(t,r.u_ele_delta)}),terrainCoords:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_terrain_coords_id:new e.aI(t,r.u_terrain_coords_id),u_ele_delta:new e.aI(t,r.u_ele_delta)}),sky:(t,r)=>({u_sky_color:new e.aL(t,r.u_sky_color),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon:new e.aI(t,r.u_horizon),u_sky_horizon_blend:new e.aI(t,r.u_sky_horizon_blend)})};class Ye{constructor(t,e,r){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ze={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Xe{constructor(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let r=0;r<this.attributes.length;r++){const n=e.attributes[this.attributes[r].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,r){for(let n=0;n<this.attributes.length;n++){const i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[Ze[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ke=new WeakMap;function Je(t){var e;if(Ke.has(t))return Ke.get(t);{const r=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Ke.set(t,r),r}}class Qe{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class tr extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class er extends Qe{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class rr extends Qe{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class nr extends Qe{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ir extends Qe{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class ar extends Qe{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class or extends Qe{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class sr extends Qe{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class lr extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class cr extends Qe{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class ur extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class hr extends Qe{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class dr extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class pr extends Qe{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class fr extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class mr extends Qe{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class gr extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class yr extends Qe{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class vr extends Qe{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class xr extends Qe{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class br extends Qe{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class _r extends Qe{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class wr extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class kr extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Tr extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Sr extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ar extends Qe{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Mr extends Qe{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const r=this.gl;Je(r)?r.bindVertexArray(t):null===(e=r.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Cr extends Qe{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Er extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Lr extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Pr extends Qe{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class Ir extends Pr{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class zr extends Pr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Or extends Pr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Dr{constructor(t,e,r,n,i){this.context=t,this.width=e,this.height=r;const a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new Ir(t,o),n)this.depthAttachment=i?new Or(t,o):new zr(t,o);else if(i)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Rr{constructor(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r}}Rr.Replace=[1,0],Rr.disabled=new Rr(Rr.Replace,e.aM.transparent,[!1,!1,!1,!1]),Rr.unblended=new Rr(Rr.Replace,e.aM.transparent,[!0,!0,!0,!0]),Rr.alphaBlended=new Rr([1,771],e.aM.transparent,[!0,!0,!0,!0]);class Fr{constructor(t){var e,r;if(this.gl=t,this.clearColor=new tr(this),this.clearDepth=new er(this),this.clearStencil=new rr(this),this.colorMask=new nr(this),this.depthMask=new ir(this),this.stencilMask=new ar(this),this.stencilFunc=new or(this),this.stencilOp=new sr(this),this.stencilTest=new lr(this),this.depthRange=new cr(this),this.depthTest=new ur(this),this.depthFunc=new hr(this),this.blend=new dr(this),this.blendFunc=new pr(this),this.blendColor=new fr(this),this.blendEquation=new mr(this),this.cullFace=new gr(this),this.cullFaceSide=new yr(this),this.frontFace=new vr(this),this.program=new xr(this),this.activeTexture=new br(this),this.viewport=new _r(this),this.bindFramebuffer=new wr(this),this.bindRenderbuffer=new kr(this),this.bindTexture=new Tr(this),this.bindVertexBuffer=new Sr(this),this.bindElementBuffer=new Ar(this),this.bindVertexArray=new Mr(this),this.pixelStoreUnpack=new Cr(this),this.pixelStoreUnpackPremultiplyAlpha=new Er(this),this.pixelStoreUnpackFlipY=new Lr(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Je(t)){this.HALF_FLOAT=t.HALF_FLOAT;const n=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!==(r=t.RGB16F)&&void 0!==r?r:null==n?void 0:n.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new Ye(this,t,e)}createVertexBuffer(t,e,r){return new Xe(this,t,e,r)}createRenderbuffer(t,e,r){const n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i}createFramebuffer(t,e,r,n){return new Dr(this,t,e,r,n)}clear(t){let{color:e,depth:r,stencil:n}=t;const i=this.gl;let a=0;e&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==n&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(a)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.aE(t.blendFunction,Rr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Je(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return Je(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class Br{constructor(t,e,r){this.func=t,this.mask=e,this.range=r}}Br.ReadOnly=!1,Br.ReadWrite=!0,Br.disabled=new Br(519,Br.ReadOnly,[0,1]);const jr=7680;class Nr{constructor(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a}}Nr.disabled=new Nr({func:519,mask:0},0,0,jr,jr,jr);class Ur{constructor(t,e,r){this.enable=t,this.mode=e,this.frontFace=r}}let Vr;function qr(t,r,n,i,a){const o=t.context,s=o.gl,l=t.useProgram("collisionBox"),c=[];let u=0,h=0;for(let v=0;v<i.length;v++){const p=i[v],f=r.getTile(p).getBucket(n);if(!f)continue;const m=a?f.textCollisionBox:f.iconCollisionBox,g=f.collisionCircleArray;if(g.length>0){const r=e.H();e.aQ(r,f.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(r,r,f.placementViewportMatrix),c.push({circleArray:g,circleOffset:h,transform:p.posMatrix,invTransform:r,coord:p}),u+=g.length/4,h=u}m&&l.draw(o,s.LINES,Br.disabled,Nr.disabled,t.colorModeForRenderPass(),Ur.disabled,{u_matrix:p.posMatrix,u_pixel_extrude_scale:[1/(d=t.transform).width,1/d.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.zoom,null,null,m.collisionVertexBuffer)}var d;if(!a||!c.length)return;const p=t.useProgram("collisionCircle"),f=new e.aR;f.resize(4*u),f._trim();let m=0;for(const e of c)for(let t=0;t<e.circleArray.length/4;t++){const r=4*t,n=e.circleArray[r+0],i=e.circleArray[r+1],a=e.circleArray[r+2],o=e.circleArray[r+3];f.emplace(m++,n,i,a,o,0),f.emplace(m++,n,i,a,o,1),f.emplace(m++,n,i,a,o,2),f.emplace(m++,n,i,a,o,3)}(!Vr||Vr.length<2*u)&&(Vr=function(t){const r=2*t,n=new e.aT;n.resize(r),n._trim();for(let e=0;e<r;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(u));const g=o.createIndexBuffer(Vr,!0),y=o.createVertexBuffer(f,e.aS.members,!0);for(const v of c){const r=Ce(v.transform,v.invTransform,t.transform);p.draw(o,s.TRIANGLES,Br.disabled,Nr.disabled,t.colorModeForRenderPass(),Ur.disabled,r,t.style.map.terrain&&t.style.map.terrain.getTerrainData(v.coord),n.id,y,g,e.a0.simpleSegment(0,2*v.circleOffset,v.circleArray.length,v.circleArray.length/2),null,t.transform.zoom,null,null,null)}y.destroy(),g.destroy()}Ur.disabled=new Ur(!1,1029,2305),Ur.backCCW=new Ur(!0,1029,2305);const $r=e.an(new Float32Array(16));function Hr(t,r,n,i,a,o){const{horizontalAlign:s,verticalAlign:l}=e.au(t);return new e.P((-(s-.5)*r/a+i[0])*o,(-(l-.5)*n/a+i[1])*o)}function Wr(t,r,n,i,a,o){const s=r.tileAnchorPoint.add(new e.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let t=i.mult(o);n||(t=t.rotate(-a));const e=s.add(t);return xt(e.x,e.y,r.labelPlaneMatrix,r.getElevation).point}if(n){const e=Ct(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(t),n=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(i.rotate(n))}return t.add(i)}function Gr(t,r,n,i,a,o,s,l,c,u,h,d,p,f){const m=t.text.placedSymbolArray,g=t.text.dynamicLayoutVertexArray,y=t.icon.dynamicLayoutVertexArray,v={};g.clear();for(let x=0;x<m.length;x++){const y=m.get(x),b=y.hidden||!y.crossTileID||t.allowVerticalPlacement&&!y.placedOrientation?null:i[y.crossTileID];if(b){const i=new e.P(y.anchorX,y.anchorY),m={getElevation:f,width:a.width,height:a.height,labelPlaneMatrix:o,lineVertexArray:null,pitchWithMap:n,projection:h,projectionCache:null,tileAnchorPoint:i,translation:d,unwrappedTileID:p},x=n?xt(i.x,i.y,s,f):Ct(i.x,i.y,m),_=bt(a.cameraToCenterDistance,x.signedDistanceFromCamera);let w=e.ai(t.textSizeData,c,y)*_/e.ap;n&&(w*=t.tilePixelRatio/l);const{width:k,height:T,anchor:S,textOffset:A,textBoxScale:M}=b,C=Hr(S,k,T,A,M,w),E=h.getPitchedTextCorrection(a,i.add(new e.P(d[0],d[1])),p),L=Wr(x.point,m,r,C,a.angle,E),P=t.allowVerticalPlacement&&y.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<y.numGlyphs;t++)e.aj(g,L,P);u&&y.associatedIconIndex>=0&&(v[y.associatedIconIndex]={shiftedAnchor:L,angle:P})}else zt(y.numGlyphs,g)}if(u){y.clear();const r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){const n=r.get(t);if(n.hidden)zt(n.numGlyphs,y);else{const r=v[t];if(r)for(let t=0;t<n.numGlyphs;t++)e.aj(y,r.shiftedAnchor,r.angle);else zt(n.numGlyphs,y)}}t.icon.dynamicLayoutVertexBuffer.updateData(y)}t.text.dynamicLayoutVertexBuffer.updateData(g)}function Yr(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Zr(t,r,n,i,a,o,s,l,c,u,h,d){const p=t.context,f=p.gl,m=t.transform,g=re(),y="map"===l,v="map"===c,x="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),b=y&&!v&&!x,_=!v&&x,w=!n.layout.get("symbol-sort-key").isConstant();let k=!1;const T=t.depthModeForSublayer(0,Br.ReadOnly),S=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=[],M=g.getCircleRadiusCorrection(m);for(const C of i){const i=r.getTile(C),l=i.getBucket(n);if(!l)continue;const c=a?l.text:l.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const h=c.programConfigurations.get(n.id),d=a||l.sdfIcons,p=a?l.textSizeData:l.iconSizeData,T=v||0!==m.pitch,E=t.useProgram(Yr(d,a,l),h),L=e.ag(p,m.zoom),P=t.style.map.terrain&&t.style.map.terrain.getTerrainData(C);let I,z,O,D,R=[0,0],F=null;if(a)z=i.glyphAtlasTexture,O=f.LINEAR,I=i.glyphAtlasTexture.size,l.iconsInText&&(R=i.imageAtlasTexture.size,F=i.imageAtlasTexture,D=T||t.options.rotating||t.options.zooming||"composite"===p.kind||"camera"===p.kind?f.LINEAR:f.NEAREST);else{const e=1!==n.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;z=i.imageAtlasTexture,O=d||t.options.rotating||t.options.zooming||e||T?f.LINEAR:f.NEAREST,I=i.imageAtlasTexture.size}const B=Ft(i,1,t.transform.zoom),j=_?C.posMatrix:$r,N=yt(j,v,y,t.transform,B),U=vt(j,v,y,t.transform,B),V=vt(C.posMatrix,v,y,t.transform,B),q=g.translatePosition(t.transform,i,o,s),$=S&&l.hasTextData(),H="none"!==n.layout.get("icon-text-fit")&&$&&l.hasIconData();if(x){const e=t.style.map.terrain?(e,r)=>t.style.map.terrain.getElevation(C,e,r):null,r="map"===n.layout.get("text-rotation-alignment");wt(l,C.posMatrix,t,a,N,V,v,u,r,g,C.toUnwrapped(),m.width,m.height,q,e)}const W=C.posMatrix,G=a&&S||H,Y=x||G?$r:N,Z=U,X=d&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=d?l.iconsInText?$e(p.kind,L,b,v,x,G,t,W,Y,Z,q,I,R,M):qe(p.kind,L,b,v,x,G,t,W,Y,Z,q,a,I,!0,M):Ve(p.kind,L,b,v,x,G,t,W,Y,Z,q,a,I,M);const J={program:E,buffers:c,uniformValues:K,atlasTexture:z,atlasTextureIcon:F,atlasInterpolation:O,atlasInterpolationIcon:D,isSDF:d,hasHalo:X};if(w&&l.canOverlap){k=!0;const t=c.segments.get();for(const r of t)A.push({segments:new e.a0([r]),sortKey:r.sortKey,state:J,terrainData:P})}else A.push({segments:c.segments,sortKey:0,state:J,terrainData:P})}k&&A.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of A){const r=e.state;if(p.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Xr(r.buffers,e.segments,n,t,r.program,T,h,d,i,e.terrainData)),i.u_is_halo=0}Xr(r.buffers,e.segments,n,t,r.program,T,h,d,r.uniformValues,e.terrainData)}}function Xr(t,e,r,n,i,a,o,s,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Ur.disabled,l,c,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Kr(t,r,n,i){const a=t.context,o=a.gl,s=Nr.disabled,l=new Rr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let h=n.heatmapFbos.get(u);h||(h=Qr(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});const d=c.programConfigurations.get(n.id),p=t.useProgram("heatmap",d),f=t.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,Br.disabled,s,l,Ur.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),f,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,t.transform.zoom,d)}function Jr(t,e,r){const n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());const a=tn(n,e),o=r.key,s=e.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Br.disabled,Nr.disabled,t.colorModeForRenderPass(),Ur.disabled,Ie(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(o))}function Qr(t,e,r){var n,i;const a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(n=t.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=t.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,r,0,a.RGBA,s,null);const c=t.createFramebuffer(e,r,!1,!1);return c.colorAttachment.set(o),c}function tn(t,e){return e.colorRampTexture||(e.colorRampTexture=new _(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function en(t,e,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const t=i.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function rn(t,e,r,n,i,a,o){const s=t.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),h=r.getCrossfadeParameters();let d,p,f,m,g;o?(p=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=s.LINES):(p=u?"fillPattern":"fill",d=s.TRIANGLES);const y=c.constantOr(null);for(const v of n){const n=e.getTile(v);if(u&&!n.patternsLoaded())continue;const c=n.getBucket(r);if(!c)continue;const x=c.programConfigurations.get(r.id),b=t.useProgram(p,x),_=t.style.map.terrain&&t.style.map.terrain.getTerrainData(v);u&&(t.context.activeTexture.set(s.TEXTURE0),n.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(h)),en(x,l,y,n,r);const w=_?v:null,k=t.translatePosMatrix(w?w.posMatrix:v.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){m=c.indexBuffer2,g=c.segments2;const e=[s.drawingBufferWidth,s.drawingBufferHeight];f="fillOutlinePattern"===p&&u?Ae(k,t,h,n,e):Se(k,e)}else m=c.indexBuffer,g=c.segments,f=u?Te(k,t,h,n):ke(k);b.draw(t.context,d,i,t.stencilModeForClipping(v),a,Ur.disabled,f,_,r.id,c.layoutVertexBuffer,m,g,r.paint,t.transform.zoom,x)}}function nn(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),d=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),f=u.constantOr(null);for(const m of n){const n=e.getTile(m),u=n.getBucket(r);if(!u)continue;const g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(m),y=u.programConfigurations.get(r.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(d)),en(y,c,f,n,r);const x=t.translatePosMatrix(m.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),b=r.paint.get("fill-extrusion-vertical-gradient"),_=h?we(x,t,b,p,m,d,n):_e(x,t,b,p);v.draw(s,s.gl.TRIANGLES,i,a,o,Ur.backCCW,_,g,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,t.transform.zoom,y,t.style.map.terrain&&u.centroidVertexBuffer)}}function an(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c=r.fbo;if(!c)return;const u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((t,e,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n?n.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:ze(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(t,r,n,h?e:null),h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function on(t,r,n,i,a,o){const s=t.context,l=s.gl,c=r.dem;if(c&&c.data){const u=c.dim,h=c.stride,d=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){const t=r.demTexture;t.update(d,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new _(s,d,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){const t=new _(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((t,r)=>{const n=r.stride,i=e.H();return e.aP(i,0,e.X,-e.X,0,0,1),e.J(i,i,[0,-e.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function sn(t,r,n,i,o,s){const l=i.paint.get("raster-fade-duration");if(!s&&l>0){const i=a.now(),s=(i-t.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=d&&t.refreshedUponExpiration?1:e.ac(d?s:1-c,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const ln=new e.aM(1,0,0,1),cn=new e.aM(0,1,0,1),un=new e.aM(0,0,1,1),hn=new e.aM(1,0,1,1),dn=new e.aM(0,1,1,1);function pn(t,e,r,n){mn(t,0,e+r/2,t.transform.width,r,n)}function fn(t,e,r,n){mn(t,e-r/2,0,r,t.transform.height,n)}function mn(t,e,r,n,i,a){const o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,i*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function gn(t,r,n){const i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Br.disabled,c=Nr.disabled,u=t.colorModeForRenderPass(),h="$debug",d=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const p=r.getTileByID(n.key).latestRawTileData,f=Math.floor((p&&p.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${y} ${f}kB`),s.draw(i,a.TRIANGLES,l,c,Rr.alphaBlended,Ur.disabled,Ee(o,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,Ur.disabled,Ee(o,e.aM.red),d,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function yn(t,e,r){const n=t.context,i=n.gl,a=t.colorModeForRenderPass(),o=new Br(i.LEQUAL,Br.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(const c of r){const r=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),d=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),f=ye(h,d,p,t.style.sky,t.transform.pitch);s.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,f,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class vn{constructor(t,e,r){this.vertexBuffer=t,this.indexBuffer=e,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class xn{constructor(t,r){this.context=new Fr(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ht.maxUnderzooming+ht.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ce}resize(t,e,r){if(this.width=Math.floor(t*r),this.height=Math.floor(e*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const n of this.style._order)this.style._layers[n].resize()}setup(){const t=this.context,r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(r,pe.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const n=new e.aX;n.emplaceBack(0,0),n.emplaceBack(e.X,0),n.emplaceBack(0,e.X),n.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(n,pe.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const i=new e.$;i.emplaceBack(0,0,0,0),i.emplaceBack(e.X,0,e.X,0),i.emplaceBack(0,e.X,0,e.X),i.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(i,J.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,pe.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const o=new e.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);const s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new Nr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=e.H();e.aP(n,0,this.width,this.height,0,0,1),e.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Br.disabled,this.stencilClearMode,Rr.disabled,Ur.disabled,Le(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;const r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Rr.disabled),r.setDepthMode(Br.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const a of e){const t=this._tileClippingMaskIDs[a.key]=this.nextStencilID++,e=this.style.map.terrain&&this.style.map.terrain.getTerrainData(a);i.draw(r,n.TRIANGLES,Br.disabled,new Nr({func:n.ALWAYS,mask:0},t,255,n.KEEP,n.KEEP,n.REPLACE),Rr.disabled,Ur.disabled,Le(a.posMatrix),e,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new Nr({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new Nr({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,r=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const t={};for(let r=0;r<i;r++)t[r+n]=new Nr({func:e.GEQUAL,mask:255},r+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=i,[t,r]}return[{[n]:Nr.disabled},r]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new Rr([t.CONSTANT_COLOR,t.ONE],new e.aM(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Rr.unblended:Rr.alphaBlended}depthModeForSublayer(t,e,r){if(!this.opaquePassEnabledForLayer())return Br.disabled;const n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Br(r||this.context.gl.LEQUAL,e,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,r){this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();const n=this.style._order,i=this.style.sourceCaches,o={},s={},l={};for(const e in i){const t=i[e];t.used&&t.prepare(this.context),o[e]=t.getVisibleCoordinates(),s[e]=o[e].slice().reverse(),l[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<n.length;e++)if(this.style._layers[n[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const e of n){const t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;const r=s[t.source];("custom"===t.type||r.length)&&this.renderLayer(this,i[t.source],t,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,r){const n=t.context,i=n.gl,a=(u=r,h=t.style.map.transform,d=t.pixelRatio,{u_sky_color:u.properties.get("sky-color"),u_horizon_color:u.properties.get("horizon-color"),u_horizon:(h.height/2+h.getHorizon())*d,u_sky_horizon_blend:u.properties.get("sky-horizon-blend")*h.height/2*d}),o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=Nr.disabled,l=t.colorModeForRenderPass(),c=t.useProgram("sky");var u,h,d;if(!r.mesh){const t=new e.aX;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);const i=new e.aY;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new vn(n.createVertexBuffer(t,pe.members),n.createIndexBuffer(i),e.a0.simpleSegment(0,0,t.length,i.length))}c.draw(n,i.TRIANGLES,o,s,l,Ur.disabled,a,void 0,"sky",r.mesh.vertexBuffer,r.mesh.indexBuffer,r.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],e=i[t.source],r=o[t.source];this._renderTileClippingMasks(t,r),this.renderLayer(this,e,t,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const t=this.style._layers[n[this.currentLayer]],e=i[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;const r=("symbol"===t.type?l:s)[t.source];this._renderTileClippingMasks(t,o[t.source]),this.renderLayer(this,e,t,r)}if(this.options.showTileBoundaries){const t=function(t,e){let r=null;const n=Object.values(t._layers).flatMap((r=>r.source&&!r.isHidden(e)?[t.sourceCaches[r.source]]:[])),i=n.filter((t=>"vector"===t.getSource().type)),a=n.filter((t=>"vector"!==t.getSource().type)),o=t=>{(!r||r.getSource().maxzoom<t.getSource().maxzoom)&&(r=t)};return i.forEach((t=>o(t))),r||a.forEach((t=>o(t))),r}(this.style,this.transform.zoom);t&&function(t,e,r){for(let n=0;n<r.length;n++)gn(t,e,r[n])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;pn(t,t.transform.height-(e.top||0),3,ln),pn(t,e.bottom||0,3,cn),fn(t,e.left||0,3,un),fn(t,t.transform.width-(e.right||0),3,hn);const r=t.transform.centerPoint;var n,i,a,o;n=t,i=r.x,a=t.transform.height-r.y,mn(n,i-1,a-10,2,20,o=dn),mn(n,i-10,a-1,20,2,o)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix;let i=this.terrainFacilitator.dirty;i||(i=t?!e.a_(r,n):!e.a$(r,n)),i||(i=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),i&&(e.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){const n=t.context,i=n.gl,a=Rr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1});for(const e of l){const l=r.getTerrainData(e.tileID),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,r){const n=t.context,i=n.gl,a=Rr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1}),r.coordsIndex=[];for(const e of c){const c=r.getTerrainData(e.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};u.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,r,n,i,a){if("translucent"!==t.renderPass)return;const o=Nr.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,r,n,i,a,o,s,l,c){const u=r.transform,h=re(),d="map"===a,p="map"===o;for(const f of t){const t=i.getTile(f),a=t.getBucket(n);if(!a||!a.text||!a.text.segments.get().length)continue;const o=e.ag(a.textSizeData,u.zoom),m=Ft(t,1,r.transform.zoom),g=yt(f.posMatrix,p,d,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&a.hasIconData();if(o){const e=Math.pow(2,u.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(f,t,e):null,i=h.translatePosition(u,t,s,l);Gr(a,d,p,c,u,g,f.posMatrix,e,o,y,h,i,f.toUnwrapped(),n)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&Zr(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&Zr(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(qr(t,r,n,i,!0),qr(t,r,n,i,!1))}(t,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(t,r,n,i){if("translucent"!==t.renderPass)return;const a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Br.ReadOnly),d=Nr.disabled,p=t.colorModeForRenderPass(),f=[];for(let m=0;m<i.length;m++){const a=i[m],o=r.getTile(a),s=o.getBucket(n);if(!s)continue;const c=s.programConfigurations.get(n.id),u=t.useProgram("circle",c),h=s.layoutVertexBuffer,d=s.indexBuffer,p=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),g={programConfiguration:c,program:u,layoutVertexBuffer:h,indexBuffer:d,uniformValues:Me(t,a,o,n),terrainData:p};if(l){const t=s.segments.get();for(const r of t)f.push({segments:new e.a0([r]),sortKey:r.sortKey,state:g})}else f.push({segments:s.segments,sortKey:0,state:g})}l&&f.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of f){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;i.draw(c,u.TRIANGLES,h,d,p,Ur.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,r)}}(t,r,n,i);break;case"heatmap":!function(t,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=t.context;if(t.style.map.terrain){for(const e of i){const i=r.getTile(e);r.hasRenderableParent(e)||("offscreen"===t.renderPass?Kr(t,i,n,e):"translucent"===t.renderPass&&Jr(t,n,e))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,r,n,i){const a=t.context,o=a.gl,s=Nr.disabled,l=new Rr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,r,n){const i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(e.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=Qr(t,r.width/4,r.height/4),n.heatmapFbos.set(e.aU,a))})(a,t,n),a.clear({color:e.aM.transparent});for(let e=0;e<i.length;e++){const c=i[e];if(r.hasRenderableParent(c))continue;const u=r.getTile(c),h=u.getBucket(n);if(!h)continue;const d=h.programConfigurations.get(n.id),p=t.useProgram("heatmap",d),{zoom:f}=t.transform;p.draw(a,o.TRIANGLES,Br.disabled,s,l,Ur.disabled,Pe(c.posMatrix,u,f,n.paint.get("heatmap-intensity")),null,n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,t.transform.zoom,d)}a.viewport.set([0,0,t.width,t.height])}(t,r,n,i):"translucent"===t.renderPass&&function(t,r){const n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());const a=r.heatmapFbos.get(e.aU);a&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),tn(n,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Br.disabled,Nr.disabled,t.colorModeForRenderPass(),Ur.disabled,Ie(t,r,0,1),null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom))}(t,n)}(t,r,n,i);break;case"line":!function(t,r,n,i){if("translucent"!==t.renderPass)return;const a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;const s=t.depthModeForSublayer(0,Br.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),d=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",m=t.context,g=m.gl;let y=!0;for(const v of i){const i=r.getTile(v);if(h&&!i.patternsLoaded())continue;const a=i.getBucket(n);if(!a)continue;const o=a.programConfigurations.get(n.id),x=t.context.program.get(),b=t.useProgram(f,o),w=y||b.program!==x,k=t.style.map.terrain&&t.style.map.terrain.getTerrainData(v),T=u.constantOr(null);if(T&&i.imageAtlas){const t=i.imageAtlas,e=t.patternPositions[T.to.toString()],r=t.patternPositions[T.from.toString()];e&&r&&o.setConstantPatternPositions(e,r)}const S=k?v:null,A=h?Re(t,i,n,p,S):c?Fe(t,i,n,c,p,S):d?De(t,i,n,a.lineClipsArray.length,S):Oe(t,i,n,S);if(h)m.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),o.updatePaintBuffers(p);else if(c&&(w||t.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m);else if(d){const i=a.gradients[n.id];let o=i.texture;if(n.gradientVersion!==i.version){let s=256;if(n.stepInterpolant){const n=r.getSource().maxzoom,i=v.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-v.canonical.z):1;s=e.ac(e.aV(a.maxLineLength/e.X*1024*i),256,m.maxTextureSize)}i.gradient=e.aW({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:s,image:i.gradient||void 0,clips:a.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new _(m,i.gradient,g.RGBA),i.version=n.gradientVersion,o=i.texture}m.activeTexture.set(g.TEXTURE0),o.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}b.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(v),l,Ur.disabled,A,k,n.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,n.paint,t.transform.zoom,o,a.layoutVertexBuffer2),y=!1}}(t,r,n,i);break;case"fill":!function(t,r,n,i){const a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;const s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.aM.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const e=t.depthModeForSublayer(1,"opaque"===t.renderPass?Br.ReadWrite:Br.ReadOnly);rn(t,r,n,i,e,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){const e=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Br.ReadOnly);rn(t,r,n,i,e,s,!0)}}(t,r,n,i);break;case"fill-extrusion":!function(t,e,r,n){const i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){const a=new Br(t.context.gl.LEQUAL,Br.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))nn(t,e,r,n,a,Nr.disabled,Rr.disabled),nn(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{const i=t.colorModeForRenderPass();nn(t,e,r,n,a,Nr.disabled,i)}}}(t,r,n,i);break;case"hillshade":!function(t,e,r,n){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const i=t.context,a=t.depthModeForSublayer(0,Br.ReadOnly),o=t.colorModeForRenderPass(),[s,l]="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n];for(const c of l){const n=e.getTile(c);void 0!==n.needsHillshadePrepare&&n.needsHillshadePrepare&&"offscreen"===t.renderPass?on(t,n,r,a,Nr.disabled,o):"translucent"===t.renderPass&&an(t,c,n,r,a,s[c.overscaledZ],o)}i.viewport.set([0,0,t.width,t.height])}(t,r,n,i);break;case"raster":!function(t,e,r,n){if("translucent"!==t.renderPass)return;if(0===r.paint.get("raster-opacity"))return;if(!n.length)return;const i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),[c,u]=o instanceof Q?[{},n]:t.stencilConfigForOverlap(n),h=u[u.length-1].overscaledZ,d=!t.options.moving;for(const p of u){const n=t.depthModeForSublayer(p.overscaledZ-h,1===r.paint.get("raster-opacity")?Br.ReadWrite:Br.ReadOnly,a.LESS),u=e.getTile(p);u.registerFadeDuration(r.paint.get("raster-fade-duration"));const f=e.findLoadedParent(p,0),m=e.findLoadedSibling(p),g=sn(u,f||m||null,e,r,t.transform,t.style.map.terrain);let y,v;const x="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),u.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),f?(f.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,f.tileID.overscaledZ-u.tileID.overscaledZ),v=[u.tileID.canonical.x*y%1,u.tileID.canonical.y*y%1]):u.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),u.texture.useMipmap&&i.extTextureFilterAnisotropic&&t.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),_=b?p:null,w=_?_.posMatrix:t.transform.calculatePosMatrix(p.toUnwrapped(),d),k=Ne(w,v||[0,0],y||1,g,r);o instanceof Q?s.draw(i,a.TRIANGLES,n,Nr.disabled,l,Ur.disabled,k,b,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,n,c[p.overscaledZ],l,Ur.disabled,k,b,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,r,n,i);break;case"background":!function(t,e,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const o=t.context,s=o.gl,l=t.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(t.isPatternMissing(u))return;const h=!u&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;const d=Nr.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Br.ReadWrite:Br.ReadOnly),f=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));const y=r.getCrossfadeParameters();for(const v of g){const e=n?v.posMatrix:t.transform.calculatePosMatrix(v.toUnwrapped()),l=u?We(e,a,t,u,{tileID:v,tileSize:c},y):He(e,a,i),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(v);m.draw(o,s.TRIANGLES,p,d,f,Ur.disabled,l,h,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,i);break;case"custom":!function(t,e,r){const n=t.context,i=r.implementation;if("offscreen"===t.renderPass){const e=i.prerender;e&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),e.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Nr.disabled);const e="3d"===i.renderingMode?new Br(t.context.gl.LEQUAL,Br.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Br.ReadOnly);n.setDepthMode(e),i.render(n.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}(t,0,n)}}translatePosMatrix(t,r,n,i,a){if(!n[0]&&!n[1])return t;const o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){const t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}const s=[a?n[0]:Ft(r,n[0],this.transform.zoom),a?n[1]:Ft(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r}useProgram(t,e){this.cache=this.cache||{};const r=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new xe(this.context,fe[t],e,Ge[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class bn{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,r,n){const i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const a=1/(n=e.af([],n,t))[3]/r*i;return e.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}([],y([],a[t[0]],a[t[1]]),y([],a[t[2]],a[t[1]]))),r=-((n=e)[0]*(i=a[t[1]])[0]+n[1]*i[1]+n[2]*i[2]);var n,i;return e.concat(r)}));return new bn(a,o)}}class _n{constructor(t,e){var r,n,i;this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(t){const e=[t%2==0,t<2],r=m(this.min),n=m(this.max);for(let i=0;i<e.length;i++)r[i]=e[i]?this.min[i]:this.center[i],n[i]=e[i]?this.center[i]:this.max[i];return n[2]=this.max[2],new _n(r,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let i=0;i<t.planes.length;i++){const a=t.planes[i];let o=0;for(let t=0;t<r.length;t++)e.b2(a,r[t])>=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<t.points.length;i++){const a=t.points[i][e]-this.min[e];r=Math.min(r,a),n=Math.max(n,a)}if(n<0||r>this.max[e]-this.min[e])return 0}return 1}}class wn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.y.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.y.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.y.number(t.right,r.right,n)),this}getCenter(t,r){const n=e.ac((this.left+t-this.right)/2,0,t),i=e.ac((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new wn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const kn=85.051129;class Tn{constructor(t,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new Tn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const r=-e.b3(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=function(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const r=[new e.b4(0,t)];if(this._renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let u=s-c;u<=l+c;u++)0!==u&&r.push(new e.b4(u,t))}return r}coveringTiles(t){var r,n;let i=this.coveringZoomLevel(t);const a=i;if(void 0!==t.minzoom&&i<t.minzoom)return[];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);const o=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let d=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(d=i);const p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,f=t=>({aabb:new _n([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=i,x=t.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let e=1;e<=3;e++)m.push(f(-e)),m.push(f(e));for(m.push(f(0));m.length>0;){const i=m.pop(),a=i.x,o=i.y;let s=i.fullyVisible;if(!s){const t=i.aabb.intersects(h);if(0===t)continue;s=2===t}const l=t.terrain?c:u,f=i.aabb.distanceX(l),b=i.aabb.distanceY(l),_=Math.max(Math.abs(f),Math.abs(b));if(i.zoom===y||_>p+(1<<y-i.zoom)-2&&i.zoom>=d){const t=y-i.zoom,r=c[0]-.5-(a<<t),n=c[1]-.5-(o<<t);g.push({tileID:new e.S(i.zoom===y?x:i.zoom,i.wrap,i.zoom,a,o),distanceSq:v([u[0]-.5-a,u[1]-.5-o]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let c=0;c<4;c++){const l=(a<<1)+c%2,u=(o<<1)+(c>>1),h=i.zoom+1;let d=i.aabb.quadrant(c);if(t.terrain){const a=new e.S(h,i.wrap,h,l,u),o=t.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,c=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;d=new _n([d.min[0],d.min[1],s],[d.max[0],d.max[1],c])}m.push({aabb:d,zoom:h,x:l,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const r=e.ac(t.lat,-85.051129,kn);return new e.P(e.O(t.lng)*this.worldSize,e.Q(r)*this.worldSize)}unproject(t){return new e.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/e.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(t,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,r){if(r){const e=r.pointCoordinate(t);if(null!=e)return e}const n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(i,i,this.pixelMatrixInverse);const a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new e.Z(e.y.number(n[0]/a,i[0]/o,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix;const i=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.af(i,i,n),new e.P(i[0]/i[3],i[1]/i[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,kn])}calculateTileMatrix(t){const r=t.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*t.wrap,a=e.an(new Float64Array(16));return e.J(a,a,[i*n,r.y*n,0]),e.K(a,a,[n/e.X,n/e.X,1]),a}calculatePosMatrix(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(t);return e.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(t){const r=t.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(t);return e.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,r){r=e.ac(+r,this.minZoom,this.maxZoom);const n={center:new e.N(t.lng,t.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const t=180-1e-10;i=[-t,t]}const a=this.tileSize*this.zoomScale(n.zoom);let o=0,s=a,l=0,c=a,u=0,h=0;const{x:d,y:p}=this.size;if(this.latRange){const t=this.latRange;o=e.Q(t[1])*a,s=e.Q(t[0])*a,s-o<p&&(u=p/(s-o))}i&&(l=e.b3(e.O(i[0])*a,0,a),c=e.b3(e.O(i[1])*a,0,a),c<l&&(c+=a),c-l<d&&(h=d/(c-l)));const{x:f,y:m}=this.project.call({worldSize:a},t);let g,y;const v=Math.max(h||0,u||0);if(v){const t=new e.P(h?(c+l)/2:f,u?(s+o)/2:m);return n.center=this.unproject.call({worldSize:a},t).wrap(),n.zoom+=this.scaleZoom(v),n}if(this.latRange){const t=p/2;m-t<o&&(y=o+t),m+t>s&&(y=s-t)}if(i){const t=(l+c)/2;let r=f;this._renderWorldCopies&&(r=e.b3(f,t-a/2,t+a/2));const n=d/2;r-n<l&&(g=l+n),r+n>c&&(g=c-n)}if(void 0!==g||void 0!==y){const t=new e.P(null!=g?g:f,null!=y?y:m);n.center=this.unproject.call({worldSize:a},t).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=r,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let i=e.an(new Float64Array(16));e.K(i,i,[this.width/2,-this.height/2,1]),e.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=e.an(new Float64Array(16)),e.K(i,i,[1,-1,1]),e.J(i,i,[-1,-1,0]),e.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.01,Math.PI-.01)),d=this.getHorizon(),p=2*Math.atan(d/this.cameraToCenterDistance)*(.5+t.y/(2*d)),f=Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(h,f);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),e.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.projectionMatrix=e.ae(i),e.K(i,i,[1,-1,1]),e.J(i,i,[0,0,-this.cameraToCenterDistance]),e.b7(i,i,this._pitch),e.ad(i,i,this.angle),e.J(i,i,[-r,-n,0]),this.mercatorMatrix=e.K([],i,[this.worldSize,this.worldSize,this.worldSize]),e.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,i),e.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=e.as([],i),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),b=r-Math.round(r)+v*g+x*y,_=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(e.J(w,w,[b>.5?b-1:b,_>.5?_-1:_,0]),this.alignedModelViewProjectionMatrix=w,i=e.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.P(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){const r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(const e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,i),new e.P(a,i),new e.P(a,o),new e.P(n,o),new e.P(n,i)]}}lngLatToCameraDepth(t,r){const n=this.locationCoordinate(t),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return e.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Sn(t,e){var r=this;let n,i=!1,a=null,o=null;const s=()=>{a=null,i&&(t.apply(o,n),a=setTimeout(s,e),i=!1)};return function(){for(var t=arguments.length,e=new Array(t),l=0;l<t;l++)e[l]=arguments[l];return i=!0,o=r,n=e,a||s(),a}}class An{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let r=e;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${e}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Sn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===t?(e=!0,`${n}=${c}`):r})).filter((t=>t));return e||r.push(`${t}=${c}`),`#${r.join("&")}`}return`#${c}`}}const Mn={linearity:.3,easing:e.b8(0,0,.3,1)},Cn=e.e({deceleration:2500,maxSpeed:1400},Mn),En=e.e({deceleration:20,maxSpeed:1400},Mn),Ln=e.e({deceleration:1e3,maxSpeed:360},Mn),Pn=e.e({deceleration:1e3,maxSpeed:90},Mn);class In{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=a.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=On(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,zn(i,a)}if(r.zoom){const t=On(r.zoom,n,En);i.zoom=this._map.transform.zoom+t.amount,zn(i,t)}if(r.bearing){const t=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),zn(i,t)}if(r.pitch){const t=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,zn(i,t)}if(i.zoom||i.bearing){const t=void 0===r.pinchAround?r.around:r.pinchAround;i.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(i,{noMoveStart:!0})}}function zn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function On(t,r,n){const{maxSpeed:i,linearity:a,deceleration:o}=n,s=e.ac(t*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class Dn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=o.mousePos(r.getCanvas(),n),s=r.unproject(a);super(t,e.e({point:a,lngLat:s,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class Rn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,n){const i="touchend"===t?n.changedTouches:n.touches,a=o.touchPos(r.getCanvasContainer(),i),s=a.map((t=>r.unproject(t))),l=a.reduce(((t,e,r,n)=>t.add(e.div(n.length))),new e.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class Fn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,r){super(t,{originalEvent:r}),this._defaultPrevented=!1}}class Bn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Fn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Dn(t.type,this._map,t))}mouseup(t){this._map.fire(new Dn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Dn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Dn(t.type,this._map,t))}mouseover(t){this._map.fire(new Dn(t.type,this._map,t))}mouseout(t){this._map.fire(new Dn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Rn(t.type,this._map,t))}touchmove(t){this._map.fire(new Rn(t.type,this._map,t))}touchend(t){this._map.fire(new Rn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Rn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Dn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Dn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class Un{constructor(t,e){this._map=t,this._tr=new Nn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const r=e;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;const n=this._startPos;this._lastPos=r,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const i=Math.min(n.x,r.x),a=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y);o.setTransform(this._box,`translate(${i}px,${s}px)`),this._box.style.width=a-i+"px",this._box.style.height=l-s+"px"}mouseupWindow(t,r){if(!this._active)return;if(0!==t.button)return;const n=this._startPos,i=r;if(this.reset(),o.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.k(t,{originalEvent:r}))}}function Vn(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const r={};for(let n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}class qn{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const r=new e.P(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=Vn(n,r)))}touchmove(t,e,r){if(this.aborted||!this.centroid)return;const n=Vn(r,e);for(const i in this.touches){const t=n[i];(!t||t.dist(this.touches[i])>30)&&(this.aborted=!0)}}touchend(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class $n{constructor(t){this.singleTap=new qn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,r){this.singleTap.touchstart(t,e,r)}touchmove(t,e,r){this.singleTap.touchmove(t,e,r)}touchend(t,e,r){const n=this.singleTap.touchend(t,e,r);if(n){const e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Hn{constructor(t){this._tr=new Nn(t),this._zoomIn=new $n({numTouches:1,numTaps:2}),this._zoomOut=new $n({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)}touchmove(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)}touchend(t,e,r){const n=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):i?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(){const t=this._moveFunction(...arguments);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const n=e.length?e[0]:e;return!this._moved&&n.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(r,n))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&o.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gn={0:1,2:2};class Yn{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const e=o.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const r=Gn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton)}isValidEndEvent(t){return o.mouseButton(t)===this._eventButton}}class Zn{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Xn=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Kn=t=>{let{enable:e,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=t;const i=new Yn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:r,move:(t,e)=>({bearingDelta:(e.x-t.x)*n}),moveStateManager:i,enable:e,assignEvents:Xn})},Jn=t=>{let{enable:e,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=t;const i=new Yn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:r,move:(t,e)=>({pitchDelta:(e.y-t.y)*n}),moveStateManager:i,enable:e,assignEvents:Xn})};class Qn{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,r){return this._calculateTransform(t,e,r)}touchmove(t,e,r){if(this._active){if(!this._shouldBePrevented(r.length))return t.preventDefault(),this._calculateTransform(t,e,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,r){this._calculateTransform(t,e,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);const i=Vn(n,r),a=new e.P(0,0),o=new e.P(0,0);let s=0;for(const e in i){const t=i[e],r=this._touches[e];r&&(a._add(t),o._add(t.sub(r)),s++,i[e]=t)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ti{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,r){if(!this._firstTwoTouches)return;t.preventDefault();const[n,i]=this._firstTwoTouches,a=ei(r,e,n),o=ei(r,e,i);if(!a||!o)return;const s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}touchend(t,e,r){if(!this._firstTwoTouches)return;const[n,i]=this._firstTwoTouches,a=ei(r,e,n),s=ei(r,e,i);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ei(t,e,r){for(let n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function ri(t,e){return Math.log(t/e)/Math.LN2}class ni extends ti{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(ri(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ri(this._distance,r),pinchAround:e}}}function ii(t,e){return 180*t.angleWith(e)/Math.PI}class ai extends ti{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,r){const n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ii(this._vector,n),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,r=ii(t,this._startVector);return Math.abs(r)<e}}function oi(t){return Math.abs(t.y)>Math.abs(t.x)}class si extends ti{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,r){super.touchstart(t,e,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,oi(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,r){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,i=e.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=t.y>0==e.y>0;return oi(t)&&oi(e)&&a}}const li={panStep:100,bearingStep:15,pitchStep:10};class ci{constructor(t){this._tr=new Nn(t);const e=li;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{const s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:ui,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function ui(t){return t*(2-t)}const hi=4.000244140625;class di{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Nn(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%hi==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=o.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?e.N.convert(this._aroundCenter?n.center:n.unproject(r)):e.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>hi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:t.zoom,n=this._startZoom,i=this._easing;let o,s=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const t=Math.min(l/200,1),a=i(t);o=e.y.number(n,r,a),t<1?this._frameId||(this._frameId=!0):s=!0}else o=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.b9;if(this._prevEase){const t=this._prevEase,n=(a.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pi{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class fi{constructor(t){this._tr=new Nn(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mi{constructor(){this._tap=new $n({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,r){if(!this._swipePoint)if(this._tapTime){const n=e[0],i=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,e,r)}touchmove(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)}touchend(t,e,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(t,e,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class yi{constructor(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class vi{constructor(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class xi{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bi=t=>t.zoom||t.drag||t.pitch||t.rotate;class _i extends e.k{}function wi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class ki{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},i={},a={},s=t.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(const{handlerName:o,handler:d,allowed:p}of this._handlers){if(!d.isEnabled())continue;let s;this._blockedByActive(a,p,o)?d.reset():d[e||t.type]&&(s=d[e||t.type](t,c,l),this.mergeHandlerResult(n,i,s,o,r),s&&s.needsRenderFrame&&this._triggerRenderFrame()),(s||d.isActive())&&(a[o]=d)}const u={};for(const o in this._previousActiveHandlers)a[o]||(u[o]=r);this._previousActiveHandlers=a,(Object.keys(u).length||wi(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||wi(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new In(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[n,i,a]of this._listeners)o.addEventListener(n,i,n===document?this.handleWindowEvent:this.handleEvent,a)}destroy(){for(const[t,e,r]of this._listeners)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){const e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Bn(e,t));const n=e.boxZoom=new Un(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();const i=e.cooperativeGestures=new xi(e,t.cooperativeGestures);this._add("cooperativeGestures",i),t.cooperativeGestures&&i.enable();const a=new Hn(e),s=new fi(e);e.doubleClickZoom=new pi(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();const l=new mi;this._add("tapDragZoom",l);const c=e.touchPitch=new si(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);const u=Kn(t),h=Jn(t);e.dragRotate=new yi(t,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();const d=(t=>{let{enable:e,clickTolerance:r}=t;const n=new Yn({checkCorrectEvent:t=>0===o.mouseButton(t)&&!t.ctrlKey});return new Wn({clickTolerance:r,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:n,enable:e,assignEvents:Xn})})(t),p=new Qn(t,e);e.dragPan=new gi(r,d,p),this._add("mousePan",d),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);const f=new ai,m=new ni;e.touchZoomRotate=new vi(r,m,f,l),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);const g=e.scrollZoom=new di(e,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);const y=e.keyboard=new ci(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new jn(e))}_add(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bi(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,r){for(const n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const r of t)this._el.contains(r.target)&&e.push(r);return e}mergeHandlerResult(t,r,n,i,a){if(!n)return;e.e(t,n);const o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){const t={},r={},n={};for(const[i,a,o]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.e(r,a),e.e(n,o);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,e,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(wi(t)||a&&this._terrainMovement))return this._fireEvents(e,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;const d=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(d,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(d,u)):i.setLocationAtPoint(d,u),n._applyUpdatedTransform(i),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)}_fireEvents(t,r,n){const i=bi(this._eventsInProgress),o=bi(t),s={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in s)this._fireEvent(e,s[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const l={};let c;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],c=r[t]||n,l[`${e}end`]=c)}for(const e in l)this._fireEvent(e,l[e]);const u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(n&&h){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&a.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:c})),r(this._map.getBearing())&&this._map.resetNorth()):(r(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(t,r){this._map.fire(new e.k(t,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new _i("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ti extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{const t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.e({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,r,n){return this.easeTo(e.e({zoom:t},r),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,r,n){return this.easeTo(e.e({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.e({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=W.convert(t).adjustAntiMeridian();const r=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),r,e)}_cameraForBoxAndBearing(t,r,n,i){const a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=e.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){const t=i.padding;i.padding={top:t,bottom:t,right:t,left:t}}i.padding=e.e(a,i.padding);const o=this.transform,s=o.padding,l=new W(t,r),c=o.project(l.getNorthWest()),u=o.project(l.getNorthEast()),h=o.project(l.getSouthEast()),d=o.project(l.getSouthWest()),p=e.ba(-n),f=c.rotate(p),m=u.rotate(p),g=h.rotate(p),y=d.rotate(p),v=new e.P(Math.max(f.x,m.x,y.x,g.x),Math.max(f.y,m.y,y.y,g.y)),x=new e.P(Math.min(f.x,m.x,y.x,g.x),Math.min(f.y,m.y,y.y,g.y)),b=v.sub(x),_=(o.width-(s.left+s.right+i.padding.left+i.padding.right))/b.x,w=(o.height-(s.top+s.bottom+i.padding.top+i.padding.bottom))/b.y;if(w<0||_<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const k=Math.min(o.scaleZoom(o.scale*Math.min(_,w)),i.maxZoom),T=e.P.convert(i.offset),S=new e.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(e.ba(n)),A=T.add(S).mult(o.scale/o.zoomScale(k));return{center:o.unproject(c.add(h).div(2).sub(A)),zoom:k,bearing:n}}fitBounds(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)}fitScreenCoordinates(t,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(r)),n,i),i,a)}_fitInternal(t,r,n){return t?(delete(r=e.e(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(t,r){this.stop();const n=this._getTransformForUpdate();let i=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.N.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new e.k("movestart",r)).fire(new e.k("move",r)),i&&this.fire(new e.k("zoomstart",r)).fire(new e.k("zoom",r)).fire(new e.k("zoomend",r)),a&&this.fire(new e.k("rotatestart",r)).fire(new e.k("rotate",r)).fire(new e.k("rotateend",r)),o&&this.fire(new e.k("pitchstart",r)).fire(new e.k("pitch",r)).fire(new e.k("pitchend",r)),this.fire(new e.k("moveend",r))}calculateCameraOptionsFromTo(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=e.Z.fromLngLat(t,r),o=e.Z.fromLngLat(n,i),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const h=Math.hypot(s,l),d=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(h/u)/Math.PI;return f=c<0?90-f:90+f,{center:o.toLngLat(),zoom:d,pitch:f,bearing:p}}easeTo(t,r){var n;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b9},t)).animate||!t.essential&&a.prefersReducedMotion)&&(t.duration=0);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset);let f=i.centerPoint.add(p);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.project(m),x=i.project(g).sub(v),b=i.zoomScale(y-o);let _,w;t.around&&(_=e.N.convert(t.around),w=i.locationPoint(_));const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==l,this._padding=!i.isPaddingEqual(d),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,k),this.terrain&&this._prepareElevation(g),this._ease((n=>{if(this._zooming&&(i.zoom=e.y.number(o,y,n)),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,d,n),f=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),_)i.setLocationAtPoint(_,w);else{const t=i.zoomScale(i.zoom-o),e=y>o?Math.min(2,b):Math.max(.5,b),r=Math.pow(e,1-n),a=i.unproject(v.add(x.mult(n*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,f)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,e)}),t),this}_prepareEase(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,r||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&r!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(r-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=r}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){const e=t.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitude<r){const n=this.calculateCameraOptionsFromTo(e.lngLat,r,t.center,t.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(this.terrain&&e.push((t=>this._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const r=t.clone();for(const n of e){const t=r.clone(),{center:e,zoom:i,pitch:a,bearing:o,elevation:s}=n(t);e&&(t.center=e),void 0!==i&&(t.zoom=i),void 0!==a&&(t.pitch=a),void 0!==o&&(t.bearing=o),void 0!==s&&(t.elevation=s),r.apply(t)}this.transform.apply(r)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),i&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,r){var n;if(!t.essential&&a.prefersReducedMotion){const n=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset);let f=i.centerPoint.add(p);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.zoomScale(y-o),x=i.project(m),b=i.project(g).sub(x);let _=t.curve;const w=Math.max(i.width,i.height),k=w/v,T=b.mag();if("minZoom"in t){const r=e.ac(Math.min(t.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);_=Math.sqrt(n/T*2)}const S=_*_;function A(t){const e=(k*k-w*w+(t?-1:1)*S*S*T*T)/(2*(t?k:w)*S*T);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}const E=A(!1);let L=function(t){return C(E)/C(E+_*t)},P=function(t){return w*((C(E)*(M(e=E+_*t)/C(e))-M(E))/S)/T;var e},I=(A(!0)-E)/_;if(Math.abs(T)<1e-6||!isFinite(I)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);const e=k<w?-1:1;I=Math.abs(Math.log(k/w))/_,P=()=>0,L=t=>Math.exp(e*_*t)}return t.duration="duration"in t?+t.duration:1e3*I/("screenSpeed"in t?+t.screenSpeed/_:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(d),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*I,m=1/L(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,d,n),f=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);const v=1===n?g:i.unproject(x.add(b.mult(P(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,f),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){t=e.b3(t,-180,180);const n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t}_normalizeCenter(t,e){if(!e.renderWorldCopies||e.lngRange)return;const r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Si={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Ai{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si;this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const r=this._map._getUIString(`AttributionControl.${e}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const n in e){const r=e[n];if(r.used||r.usedForTerrain){const e=r.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,r)=>{for(let n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}));const r=t.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Mi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const e=o.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,r=e?this._queue.concat(e):this._queue;for(const n of r)if(n.id===t)return void(n.cancelled=!0)}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const r of e)if(!r.cancelled&&(r.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ei=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];const n={};for(const i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),this._tiles[i.key]=new lt(i,this.tileSize));for(const e in this._tiles)n[e]||delete this._tiles[e]}freeRtt(t){for(const e in this._tiles){const r=this._tiles[e];(!t||r.tileID.equals(t)||r.tileID.isChildOf(t)||t.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(t.canonical)){const i=t.clone();i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),r[n]=i}else if(i.canonical.isChildOf(t.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=i.canonical.z-t.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),c=e.X>>o;e.aP(a.posMatrix,0,c,0,c,0,1),e.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(t.canonical.isChildOf(i.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=t.canonical.z-i.canonical.z,s=t.canonical.x-(t.canonical.x>>o<<o),l=t.canonical.y-(t.canonical.y>>o<<o),c=e.X>>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(t,e){const r=this.sourceCache._source;let n=t.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n<r.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(n).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!i||!i.dem)&&e)for(;n>=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(t.scaledTo(n--).key);return i}tilesAfterTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((e=>e.timeAdded>=t))}}class Pi{constructor(t,e,r){this.painter=t,this.sourceCache=new Li(e),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.X;var a;if(!(r>=0&&r<i&&n>=0&&n<i))return 0;const o=this.getTerrainData(t),s=null===(a=o.tile)||void 0===a?void 0:a.dem;if(!s)return 0;const l=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}([],[r/i*e.X,n/i*e.X],o.u_terrain_matrix),c=[l[0]*s.dim,l[1]*s.dim],u=Math.floor(c[0]),h=Math.floor(c[1]),d=c[0]-u,p=c[1]-h;return s.get(u,h)*(1-d)*(1-p)+s.get(u+1,h)*d*(1-p)+s.get(u,h+1)*(1-d)*p+s.get(u+1,h+1)*d*p}getElevationForLngLatZoom(t,r){if(!e.bb(r,t.wrap()))return 0;const{tileID:n,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,r);return this.getElevation(n,i%e.X,a%e.X,e.X)}getElevation(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.X;return this.getDEMElevation(t,r,n,i)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,r=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new _(t,r,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new _(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}const r=this.sourceCache.getSourceTile(t,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const t=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new _(t,r.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),r.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const n=r&&r+r.tileID.key+t.key;if(n&&!this._demMatrixCache[n]){const n=this.sourceCache.sourceCache._source.maxzoom;let i=t.canonical.z-r.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=n?i=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),s=e.bc(new Float64Array(16),[1/(e.X<<i),1/(e.X<<i),0]);e.J(s,s,[a*e.X,o*e.X,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(t){const e=this.painter,r=e.width/devicePixelRatio,n=e.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new _(e.context,{width:r,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new _(e.context,{width:r,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,a=0;e<this._coordsTextureSize;e++)for(let t=0;t<this._coordsTextureSize;t++,a+=4)r[a+0]=255&t,r[a+1]=255&e,r[a+2]=t>>8<<4|e>>8,r[a+3]=0;const n=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new _(t,n,t.gl.RGBA,{premultiply:!1});return i.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const d=this._coordsTextureSize,p=(1<<h.tileID.canonical.z)*d;return new e.Z((h.tileID.canonical.x*d+l)/p+h.tileID.wrap,(h.tileID.canonical.y*d+c)/p,this.getElevation(h.tileID,l,c,d))}depthAtPoint(t){const e=new Uint8Array(4),r=this.painter.context,n=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,e),r.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,r=new e.bd,n=new e.aY,i=this.meshSize,a=e.X/i,o=i*i;for(let e=0;e<=i;e++)for(let t=0;t<=i;t++)r.emplaceBack(t*a,e*a,0);for(let e=0;e<o;e+=i+1)for(let t=0;t<i;t++)n.emplaceBack(t+e,i+t+e+1,i+t+e+2),n.emplaceBack(t+e,i+t+e+2,t+e+1);const s=r.length,l=s+2*(i+1);for(const h of[0,1])for(let t=0;t<=i;t++)for(const n of[0,1])r.emplaceBack(t*a,h*e.X,n);for(let e=0;e<2*i;e+=2)n.emplaceBack(l+e,l+e+1,l+e+3),n.emplaceBack(l+e,l+e+3,l+e+2),n.emplaceBack(s+e,s+e+3,s+e+1),n.emplaceBack(s+e,s+e+2,s+e+3);const c=r.length,u=c+2*(i+1);for(const h of[0,1])for(let t=0;t<=i;t++)for(const n of[0,1])r.emplaceBack(h*e.X,t*a,n);for(let e=0;e<2*i;e+=2)n.emplaceBack(c+e,c+e+1,c+e+3),n.emplaceBack(c+e,c+e+3,c+e+2),n.emplaceBack(u+e,u+e+3,u+e+1),n.emplaceBack(u+e,u+e+2,u+e+3);return this._mesh=new vn(t.createVertexBuffer(r,Ei.members),t.createIndexBuffer(n),e.a0.simpleSegment(0,0,r.length,n.length)),this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var r;const{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,r={minElevation:null,maxElevation:null};return e&&e.dem&&(r.minElevation=e.dem.min*this.exaggeration,r.maxElevation=e.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(t,r){const n=e.Z.fromLngLat(t.wrap()),i=(1<<r)*e.X,a=n.x*i,o=n.y*i,s=Math.floor(a/e.X),l=Math.floor(o/e.X);return{tileID:new e.S(r,0,r,s,l),mercatorX:a,mercatorY:o}}}class Ii{constructor(t,e,r){this._context=t,this._size=e,this._tileSize=r,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new _(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(r.texture),{id:t,fbo:e,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((e=>t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((t=>!t.inUse))}}const zi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new Ii(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((r=>!t._layers[r].isHidden(e))),this._coordsDescendingInv={};for(const r in t.sourceCaches){this._coordsDescendingInv[r]={};const e=t.sourceCaches[r].getVisibleCoordinates();for(const t of e){const e=this.terrain.sourceCache.getTerrainCoords(t);for(const t in e)this._coordsDescendingInv[r][t]||(this._coordsDescendingInv[r][t]=[]),this._coordsDescendingInv[r][t].push(e[t])}}this._coordsDescendingInvStr={};for(const r of t._order){const e=t._layers[r],n=e.source;if(zi[e.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const t in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map((t=>t.key)).sort().join()}}for(const r of this._renderableTiles)for(const t in this._coordsDescendingInvStr){const e=this._coordsDescendingInvStr[t][r.tileID.key];e&&e!==r.rttCoords[t]&&(r.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const r=t.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(zi[r]&&(this._prevType&&zi[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(zi[this._prevType]||zi[r]&&i){this._prevType=r;const t=this._stacks.length-1,i=this._stacks[t]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(yn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[t]){const e=this.pool.getObjectForId(r.rtt[t].id);if(e.stamp===r.rtt[t].stamp){this.pool.useObject(e);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t<i.length;t++){const e=n.style._layers[i[t]],o=e.source?this._coordsDescendingInv[e.source][r.tileID.key]:[r.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(e,o),n.renderLayer(n,n.style.sourceCaches[e.source],e,o),e.source&&(r.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][r.tileID.key])}}return yn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),zi[r]}return!1}}const Di={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Ri=r,Fi={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Si,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Bi=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},ji={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ni{constructor(t,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,o.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const i=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(t=>{let{enable:e,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=t;const i=new Zn;return new Wn({clickTolerance:r,move:(t,e)=>({bearingDelta:(e.x-t.x)*n}),moveStateManager:i,enable:e,assignEvents:Bi})})({clickTolerance:i,enable:!0}),this.map=t,n&&(this.mousePitch=Jn({clickTolerance:a,enable:!0}),this.touchPitch=(t=>{let{enable:e,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=t;const i=new Zn;return new Wn({clickTolerance:r,move:(t,e)=>({pitchDelta:(e.y-t.y)*n}),moveStateManager:i,enable:e,assignEvents:Bi})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),o.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),o.disableDrag()}moveMouse(t,e){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(t,e){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let Ui;function Vi(t,r,n){const i=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),r){const i=new e.N(t.lng-360,t.lat),a=new e.N(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)<o?t=i:n.locationPoint(a).distSqr(r)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==i.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:i}const qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function $i(t,e,r){const n=t.classList;for(const i in qi)n.remove(`maplibregl-${r}-anchor-${i}`);n.add(`maplibregl-${r}-anchor-${e}`)}class Hi extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Vi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(h);const d=o.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");const p=o.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),d.appendChild(p);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(d),s.appendChild(f),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),$i(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,r=13.5,n=Math.abs(r)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-r+n)],"bottom-right":[-n,-1*(e-r+n)],left:[r,-1*(e-r)],right:[-r,-1*(e-r)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Gi=0,Yi=!1;const Zi={maxWidth:100,unit:"metric"};function Xi(t,e,r){const n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?Ki(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ki(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ki(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ki(t,e,r,n){const i=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r);t.style.width=e*(i/r)+"px",t.innerHTML=`${i}&nbsp;${n}`}const Ji={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ta(t){if(t){if("number"==typeof t){const r=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(r,r),"top-right":new e.P(-r,r),bottom:new e.P(0,-t),"bottom-left":new e.P(r,-r),"bottom-right":new e.P(-r,-r),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const r=e.P.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ta(new e.P(0,0))}const ea=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Ai,t.BoxZoomHandler=Un,t.CanvasSource=et,t.CooperativeGesturesHandler=xi,t.DoubleClickZoomHandler=pi,t.DragPanHandler=gi,t.DragRotateHandler=yi,t.EdgeInsets=wn,t.FullscreenControl=class extends e.E{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const r=new e.N(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const r=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Yi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Hi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Hi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))}))}},this.options=e.e({},Wi,t)}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){if(void 0!==Ui&&!t)return Ui;if(void 0===window.navigator.permissions)return Ui=!!window.navigator.geolocation,Ui;try{const t=yield window.navigator.permissions.query({name:"geolocation"});Ui="denied"!==t.state}catch(e){Ui=!!window.navigator.geolocation}return Ui}()}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gi=0,Yi=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const t=this._map.getBounds(),e=t.getSouthEast(),r=t.getNorthEast(),n=e.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gi--,Yi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Gi++,Gi>1?(t={maximumAge:6e5,timeout:0},Yi=!0):(t=this.options.positionOptions,Yi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=An,t.ImageSource=Q,t.KeyboardHandler=ci,t.LngLatBounds=W,t.LogoControl=Mi,t.Map=class extends Ti{constructor(t){e.bf.mark(e.bg.create);const r=Object.assign(Object.assign({},Fi),t);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Tn(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Di),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))).on("moveend",(()=>this._update(!1))).on("zoom",(()=>this._update(!0))).on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})).once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1;const e=Sn((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{t?e(r):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new An("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,e.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Ai("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Mi,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,r,n)}resize(t){var r;const n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,e),this.painter.resize(i,a,e)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=t*i,o=e*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(W.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,r){if("mouseenter"===t||"mouseover"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Dn(t,this,i.originalEvent,{features:o}))):n=!1};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Dn(t,this,i.originalEvent)))},a=e=>{n&&(n=!1,r.call(this,new Dn(t,this,e.originalEvent)))};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),i=0!==n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];i.length&&(t.features=i,r.call(this,t),delete t.features)};return{layers:e,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,r){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const n=this._delegatedListeners[t];for(let i=0;i<n.length;i++){const t=n[i];if(t.listener===r&&t.layers.length===e.length&&t.layers.every((t=>e.includes(t)))){for(const e in t.delegates)this.off(e,t.delegates[e]);return void n.splice(i,1)}}}on(t,e,r){if(void 0===r)return super.on(t,e);const n=this._createDelegatedListener(t,"string"==typeof e?[e]:e,r);this._saveDelegatedListener(t,n);for(const i in n.delegates)this.on(i,n.delegates[i]);return this}once(t,e,r){var n=this;if(void 0===r)return super.once(t,e);const i="string"==typeof e?[e]:e,a=this._createDelegatedListener(t,i,r);for(const o in a.delegates){const e=a.delegates[o];a.delegates[o]=function(){n._removeDelegatedListener(t,i,r),e(...arguments)}}this._saveDelegatedListener(t,a);for(const o in a.delegates)this.once(o,a.delegates[o]);return this}off(t,e,r){return void 0===r?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,r),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let n;const i=t instanceof e.P||Array.isArray(t),a=i?t:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{const t=e.P.convert(a[0]),r=e.P.convert(a[1]);n=[t,new e.P(r.x,t.y),r,new e.P(t.x,r.y),t]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,r){return!1!==(r=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const r=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new de(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,r):this.style.loadJSON(t,e,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new de(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){const n=this._requestManager.transformRequest(t,"Style");e.h(n,new AbortController).then((t=>{this._updateDiff(t.data,r)})).catch((t=>{t&&this.fire(new e.j(t))}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const r=this.style.sourceCaches[t.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&r.reload();for(const n in this.style._layers){const r=this.style._layers[n];"hillshade"===r.type&&r.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Pi(this.painter,r,t),this.painter.renderToTexture=new Oi(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const r=t[e]._tiles;for(const t in r){const e=r[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||e.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:n,height:a,data:d}=r,p=r;return this.style.addImage(t,{data:new e.R({width:n,height:a},new Uint8Array(d)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:n,height:d,data:p}=a.getImageData(r);this.style.addImage(t,{data:new e.R({width:n,height:d},p),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(t,r){const n=this.style.getImage(t);if(!n)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||e.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,c),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)}setFilter(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(t,e,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(t,e,r,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(t,e,r,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,r,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=o.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=o.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{a[t]=o.create("div",`maplibregl-ctrl-${t} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{e={requestedAttributes:t},r&&(e.statusMessage=r.statusMessage,e.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!r){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new xn(r,this.transform),s.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=a.now();this.style.zoomHistory.update(t,i);const o=new e.z(t,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Ri}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Dn,t.MapTouchEvent=Rn,t.MapWheelEvent=Fn,t.Marker=Hi,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{const r=this._map._getUIString(`NavigationControl.${e}`);t.title=r,t.setAttribute("aria-label",r)},this.options=e.e({},ji,t),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ni(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Vi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;const r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ta(this.options.offset);if(!n){const t=this._container.offsetWidth,e=this._container.offsetHeight;let a;a=r.y+i.bottom.y<e?["top"]:r.y>this._map.transform.height-e?["bottom"]:[],r.x<t/2?a.push("left"):r.x>this._map.transform.width-t/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${qi[n]} translate(${a.x}px,${a.y}px)`),$i(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Ji),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=t;n=r.firstChild,n;)e.appendChild(n);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Qi);t&&t.focus()}},t.RasterDEMTileSource=X,t.RasterTileSource=Z,t.ScaleControl=class{constructor(t){this._onMove=()=>{Xi(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Xi(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Zi),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=di,t.Style=de,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=si,t.TwoFingersTouchRotateHandler=ai,t.TwoFingersTouchZoomHandler=ni,t.TwoFingersTouchZoomRotateHandler=vi,t.VectorTileSource=Y,t.VideoSource=tt,t.addSourceType=(t,r)=>e._(void 0,void 0,void 0,(function*(){if(nt(t))throw new Error(`A source type called "${t}" already exists.`);var e;e=r,rt[t]=e})),t.clearPrewarmedResources=function(){const t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(O),F=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return st().getRTLTextPluginStatus()},t.getVersion=function(){return ea},t.getWorkerCount=function(){return D.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return U().broadcast("IS",t)},t.prewarm=function(){j().acquire(O)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return st().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){D.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}})),t},"object"===typeof t&&"undefined"!==typeof e?e.exports=a():(n="undefined"!==typeof globalThis?globalThis:n||self).maplibregl=a()}}),i_=d({"src/plots/map/layers.js"(t,e){var r=se(),n=Ae().sanitizeHTML,i=Kb(),a=Hb();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n<e.length;n++)if("string"!==typeof e[n]||0===e[n].length)return!1;return!0}return r.isPlainObject(e)||"string"===typeof e&&e.length>0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"===typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r<e.length;r++){var n=e[r].id;if("string"===typeof n&&0===n.indexOf(a.traceLayerPrefix)){t=n;break}}return t},s.updateLayer=function(t){var e=this.subplot,r=c(t),n=this.lookupBelow(),i=this.findFollowingMapLayerId(n);this.removeLayer(),l(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=t.type,this.below=n},s.updateStyle=function(t){if(l(t)){var e=c(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}}}),a_=d({"src/plots/map/map.js"(t,e){var r=n_(),n=se(),i=og(),a=Vt(),o=nr(),s=hr(),l=zr(),c=Or(),u=c.drawMode,h=c.selectMode,d=Mn().prepSelect,p=Mn().clearOutline,f=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=Hb(),y=i_();function v(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(t,e,r){var n,i=this;n=i.map?new Promise((function(r,n){i.updateMap(t,e,r,n)})):new Promise((function(r,n){i.createMap(t,e,r,n)})),r.push(n)},x.createMap=function(t,e,n,a){var o=this,s=e[o.id],l=o.styleObj=_(s.style),c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:w(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0})),d={};h.on("styleimagemissing",(function(t){var e=t.id;if(!d[e]&&e.includes("-15")){d[e]=!0;var r=new Image(15,15);r.onload=function(){h.addImage(e,r)},r.crossOrigin="Anonymous",r.src="https://unpkg.com/maki@2.1.0/icons/"+e+".svg"}})),h.setTransformRequest((function(t){return{url:t=(t=(t=t.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}})),h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(t,e);var p=[];p.push(new Promise((function(t){h.once("load",t)}))),p=p.concat(i.fetchTraceGeoData(t)),Promise.all(p).then((function(){o.fillBelowLookup(t,e),o.updateData(t),o.updateLayout(e),o.resolveOnRender(n)})).catch(a)},x.updateMap=function(t,e,r,n){var a=this,o=a.map,s=e[this.id];a.rejectOnError(n);var l=[],c=_(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(t){o.once("styledata",t)})))),l=l.concat(i.fetchTraceGeoData(t)),Promise.all(l).then((function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"===typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"===typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,d={};for(u in a)d[n=a[u]]?d[n].push(u):d[n]=[u];for(n in d){var p=d[n];if(p.length>1)for(r=0;r<p.length;r++)0===(u=p[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var b={choroplethmap:0,densitymap:1,scattermap:2};function _(t){var e={};return n.isPlainObject(t)?(e.id=t.id,e.style=t):"string"===typeof t?(e.id=t,g.stylesMap[t]?e.style=g.stylesMap[t]:e.style=t):(e.id=g.styleValueDflt,e.style=function(t){return g.styleUrlPrefix+t+"-"+g.styleUrlSuffix}(g.styleValueDflt)),e.transition={duration:0,delay:0},e}function w(t){return[t.lon,t.lat]}x.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort((function(t,e){return b[t[0].trace.type]-b[e[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);t:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<t.length;i++)if(u===(r=t[i][0].trace).uid)continue t;(e=a[u]).dispose(),delete a[u]}},x.updateLayout=function(t){var e=this.map,r=t[this.id];this.dragging||this.wheeling||(e.setCenter(w(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.map?e.scrollZoom.enable():e.scrollZoom.disable()},x.resolveOnRender=function(t){var e=this.map;e.on("render",(function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))}))},x.rejectOnError=function(t){var e=this.map;function r(){t(new Error(g.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},x.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(e.mockAxis,t)},x.initFx=function(t,e){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(e._hoverlayer)}function s(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}i.on("moveend",(function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];a.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e&&e._rehover&&e._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(t){var e=r.div.getBoundingClientRect(),a=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,t,r.id)},l.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var t=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;i.setCenter(w(e.center)),i.setZoom(e.zoom),i.setBearing(e.bearing),i.setPitch(e.pitch);var o=r.getView();t._input.center=t.center=o.center,t._input.zoom=t.zoom=o.zoom,t._input.bearing=t.bearing=o.bearing,t._input.pitch=t.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){f(r.dragOptions),p(r.dragOptions.gd)},r.onClickInPanFn=function(t){return function(e){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(y(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(t,e){var r=this.map;if("string"===typeof e){if(""===e)return void r.addLayer(t,e);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(e===i[a].id)return void r.addLayer(t,e);n.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},x.project=function(t){return this.map.project(new r.LngLat(t[0],t[1]))},x.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},x.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},x.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=v}}),o_=d({"src/plots/map/layout_defaults.js"(t,e){var r=se(),n=qs(),i=Be(),a=Wb();function o(t,e,r){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var n=r("bounds.west"),a=r("bounds.east"),o=r("bounds.south"),l=r("bounds.north");void 0!==n&&void 0!==a&&void 0!==o&&void 0!==l||delete e.bounds,i(t,e,{name:"layers",handleItemDefaults:s}),e._input=t}function s(t,e){function n(n,i){return r.coerce(t,e,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=e.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}e.exports=function(t,e,r){n(t,e,r,{type:"map",attributes:a,handleDefaults:o,partition:"y"})}}}),s_=d({"src/plots/map/index.js"(t){var e=se(),r=e.strTranslate,n=e.strScale,i=_e().getSubplotCalcData,a=Te(),o=v(),s=Je(),l=Ae(),c=a_(),u="map";t.name=u,t.attr="subplot",t.idRoot=u,t.idRegex=t.attrRegex=e.counterRegex(u),t.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},t.layoutAttributes=Wb(),t.supplyLayoutDefaults=o_(),t.plot=function(t){for(var r=t._fullLayout,n=t.calcdata,a=r._subplots[u],o=0;o<a.length;o++){var s=a[o],l=i(n,u,s),h=r[s],d=h._subplot;d||(d=new c(t,s),r[s]._subplot=d),d.viewInitial||(d.viewInitial={center:e.extendFlat({},h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),d.plot(l,r,t._promises)}},t.clean=function(t,e,r,n){for(var i=n._subplots[u]||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},t.toSVG=function(t){for(var e=t._fullLayout,i=e._subplots[u],c=e._size,h=0;h<i.length;h++){var d=e[i[h]],p=d.domain,f=d._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:a.svg,"xlink:href":f,x:c.l+c.w*p.x[0],y:c.t+c.h*(1-p.y[1]),width:c.w*(p.x[1]-p.x[0]),height:c.h*(p.y[1]-p.y[0]),preserveAspectRatio:"none"});var m=o.select(d._subplot.div).select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),g=e._glimages.append("g"),y=g.append("text");y.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=s.bBox(y.node()),x=c.w*(p.x[1]-p.x[0]);if(v.width>x/2){var b=m.split("|").join("<br>");y.text(b).attr("data-unformatted",b).call(l.convertToTspans,t),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;v.width+6>x&&(_=x/(v.width+6));var w=[c.l+c.w*p.x[1],c.t+c.h*(1-p.y[0])];g.attr("transform",r(w[0],w[1])+n(_))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[u],n=0;n<r.length;n++)e[r[n]]._subplot.updateFx(e)}}}),l_=d({"src/traces/scattermap/index.js"(t,e){e.exports={attributes:Gb(),supplyDefaults:Zb(),colorbar:di(),formatLabels:Xb(),calc:Zm(),plot:Qb(),hoverPoints:t_().hoverPoints,eventData:e_(),selectPoints:r_(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermap",basePlotModule:s_(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),c_=d({"lib/scattermap.js"(t,e){e.exports=l_()}}),u_=d({"src/traces/choroplethmap/attributes.js"(t,e){var r=wg(),n=Pe(),i=Ot().hovertemplateAttrs,a=N(),o=D().extendFlat;e.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),h_=d({"src/traces/choroplethmap/defaults.js"(t,e){var r=se(),n=Ve(),i=u_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"===typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),e._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(t,e,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}}}),d_=d({"src/traces/choroplethmap/convert.js"(t,e){var r=k(),n=se(),i=We(),a=Je(),o=Qm().makeBlank,s=og();function l(t){var e,r=t[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":e}),n.extendFlat(i.line.paint,{"line-opacity":e}),i}e.exports={convert:function(t){var e=t[0].trace,a=!0===e.visible&&0!==e._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=e._opts={fill:c,line:u,geojson:o()};if(!a)return h;var d=s.extractTraceFeature(t);if(!d)return h;var p,f,m,g=i.makeColorScaleFuncFromTrace(e),y=e.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(p=function(t){var e=t.mo;return r(e)?+n.constrain(e,0,1):0}),n.isArrayOrTypedArray(v.color)&&(f=function(t){return t.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var x=0;x<t.length;x++){var b=t[x],_=b.fOut;if(_){var w=_.properties;w.fc=g(b.z),p&&(w.mo=p(b)),f&&(w.mlc=f(b)),m&&(w.mlw=m(b)),b.ct=w.ct,b._polygons=s.feature2polygons(_)}}var k=p?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),n.extendFlat(u.paint,{"line-color":f?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:d},l(t),h},convertOnSelect:l}}}),p_=d({"src/traces/choroplethmap/plot.js"(t,e){var r=d_().convert,n=d_().convertOnSelect,i=Hb().traceLayerPrefix;function a(t,e){this.type="choroplethmap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",i+e+"-fill"],["line",i+e+"-line"]],this.below=null}var o=a.prototype;o.update=function(t){this._update(r(t)),t[0].trace._glTrace=this},o.updateOnSelect=function(t){this._update(n(t))},o._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),f_=d({"src/traces/choroplethmap/index.js"(t,e){e.exports={attributes:u_(),supplyDefaults:h_(),colorbar:No(),calc:Tg(),plot:p_(),hoverPoints:Mg(),eventData:Cg(),selectPoints:Eg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"===typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmap",basePlotModule:s_(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),m_=d({"lib/choroplethmap.js"(t,e){e.exports=f_()}}),g_=d({"src/traces/densitymap/attributes.js"(t,e){var r=Pe(),n=Ot().hovertemplateAttrs,i=N(),a=Gb(),o=D().extendFlat;e.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),y_=d({"src/traces/densitymap/defaults.js"(t,e){var r=se(),n=Ve(),i=g_();e.exports=function(t,e,a,o){function s(n,a){return r.coerce(t,e,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}}}),v_=d({"src/traces/densitymap/calc.js"(t,e){var r=k(),n=se().isArrayOrTypedArray,i=T().BADNUM,a=He(),o=se()._;e.exports=function(t,e){for(var s=e._length,l=new Array(s),c=e.z,u=n(c)&&c.length,h=0;h<s;h++){var d=l[h]={},p=e.lon[h],f=e.lat[h];if(d.lonlat=r(p)&&r(f)?[+p,+f]:[i,i],u){var m=c[h];d.z=r(m)?m:i}}return a(t,e,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(t,"lat:")+" ",lon:o(t,"lon:")+" "}}),l}}}),x_=d({"src/traces/densitymap/convert.js"(t,e){var r=k(),n=se(),i=q(),a=We(),o=T().BADNUM,s=Qm().makeBlank;e.exports=function(t){var e=t[0].trace,l=!0===e.visible&&0!==e._length,c=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],d=e.z,p=e.radius,f=n.isArrayOrTypedArray(d)&&d.length,m=n.isArrayOrTypedArray(p);for(u=0;u<t.length;u++){var g=t[u],y=g.lonlat;if(y[0]!==o){var v={};if(f){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(p[u])&&p[u]>0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(e),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),b_=d({"src/traces/densitymap/plot.js"(t,e){var r=x_(),n=Hb().traceLayerPrefix;function i(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",n+e+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(t){var e=this.subplot,n=this.layerList,i=r(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];e.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&e.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},a._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),__=d({"src/traces/densitymap/hover.js"(t,e){var r=nr(),n=t_().hoverPoints,i=t_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),w_=d({"src/traces/densitymap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),k_=d({"src/traces/densitymap/index.js"(t,e){e.exports={attributes:g_(),supplyDefaults:y_(),colorbar:No(),formatLabels:Xb(),calc:v_(),plot:b_(),hoverPoints:__(),eventData:w_(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"===typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymap",basePlotModule:s_(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),T_=d({"lib/densitymap.js"(t,e){e.exports=k_()}}),S_=d({"src/traces/sankey/attributes.js"(t,e){var r=R(),n=N(),i=V(),a=j(),o=ka().attributes,s=Ot().hovertemplateAttrs,l=Pe(),c=ge().templatedArray,u=Ce().descriptionOnlyNumbers,h=D().extendFlat,d=Pt().overrideAll;e.exports=d({hoverinfo:h({},n.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:a.hoverlabel,domain:o({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:r({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:i.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:a.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}}),A_=d({"src/traces/sankey/defaults.js"(t,e){var r=se(),n=S_(),i=q(),a=O(),o=ka().defaults,s=Ar(),l=ge(),c=Be();function u(t,e){function i(i,a){return r.coerce(t,e,n.link.colorscales,i,a)}i("label"),i("cmin"),i("cmax"),i("colorscale")}e.exports=function(t,e,h,d){function p(i,a){return r.coerce(t,e,n,i,a)}var f=r.extendDeep(d.hoverlabel,t.hoverlabel),m=t.node,g=l.newContainer(e,"node");function y(t,e){return r.coerce(m,g,n.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),s(m,g,y,f),y("hovertemplate"),y("align");var v=d.colorway;y("color",g.label.map((function(t,e){return i.addOpacity(function(t){return v[t%v.length]}(e),.8)}))),y("customdata");var x=t.link||{},b=l.newContainer(e,"link");function _(t,e){return r.coerce(x,b,n.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),s(x,b,_,f),_("hovertemplate");var w,k=a(d.paper_bgcolor).getLuminance()<.333,T=_("color",k?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function S(t){var e=a(t);if(!e.isValid())return t;var r=e.getAlpha();return r<=.8?e.setAlpha(r+.2):e=k?e.brighten():e.darken(),e.toRgbString()}_("hovercolor",Array.isArray(T)?T.map(S):S(T)),_("customdata"),c(x,b,{name:"colorscales",handleItemDefaults:u}),o(e,d,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),r.coerceFont(p,"textfont",d.font,{autoShadowDflt:!0}),e._length=null}}}),M_=d({"node_modules/strongly-connected-components/scc.js"(t,e){e.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l<e;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var c,u=0,h=[],d=[];function p(e){var l=[e],c=[e];for(r[e]=n[e]=u,i[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var p=t[e];if(a[e]<p.length){for(var f=a[e];f<p.length;++f){var m=p[f];if(r[m]<0){r[m]=n[m]=u,i[m]=!0,u+=1,l.push(m),c.push(m);break}i[m]&&(n[e]=0|Math.min(n[e],n[m])),o[m]>=0&&s[e].push(o[m])}a[e]=f}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(f=l.length-1;f>=0;--f){var x=l[f];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=f;break}}h.push(g);var b=new Array(v);for(f=0;f<y.length;f++)for(var _=0;_<y[f].length;_++)b[--v]=y[f][_];d.push(b)}c.pop()}}}for(l=0;l<e;++l)r[l]<0&&p(l);for(l=0;l<d.length;l++){var f=d[l];if(0!==f.length){f.sort((function(t,e){return t-e})),c=[f[0]];for(var m=1;m<f.length;m++)f[m]!==f[m-1]&&c.push(f[m]);d[l]=c}}return{components:h,adjacencyList:d}}}}),C_=d({"src/traces/sankey/calc.js"(t,e){var r=M_(),n=se(),i=Ox().wrap,a=n.isArrayOrTypedArray,o=n.isIndex,s=We();function l(t){var e,i=t.node,l=t.link,c=[],u=a(l.color),h=a(l.hovercolor),d=a(l.customdata),p={},f={},m=l.colorscales.length;for(e=0;e<m;e++){var g=l.colorscales[e],y=s.extractScale(g,{cLetter:"c"}),v=s.makeColorScaleFunc(y);f[g.label]=v}var x=0;for(e=0;e<l.value.length;e++)l.source[e]>x&&(x=l.source[e]),l.target[e]>x&&(x=l.target[e]);var b,_=x+1;t.node._count=_;var w=t.node.groups,k={};for(e=0;e<w.length;e++){var T=w[e];for(b=0;b<T.length;b++){var S=T[b],A=_+e;k.hasOwnProperty(S)?n.warn("Node "+S+" is already part of a group."):k[S]=A}}var M={source:[],target:[]};for(e=0;e<l.value.length;e++){var C=l.value[e],E=l.source[e],L=l.target[e];if(C>0&&o(E,_)&&o(L,_)&&(!k.hasOwnProperty(E)||!k.hasOwnProperty(L)||k[E]!==k[L])){k.hasOwnProperty(L)&&(L=k[L]),k.hasOwnProperty(E)&&(E=k[E]),L=+L,p[E=+E]=p[L]=!0;var P="";l.label&&l.label[e]&&(P=l.label[e]);var I=null;P&&f.hasOwnProperty(P)&&(I=f[P]),c.push({pointNumber:e,label:P,color:u?l.color[e]:l.color,hovercolor:h?l.hovercolor[e]:l.hovercolor,customdata:d?l.customdata[e]:l.customdata,concentrationscale:I,source:E,target:L,value:+C}),M.source.push(E),M.target.push(L)}}var z=_+w.length,O=a(i.color),D=a(i.customdata),R=[];for(e=0;e<z;e++)if(p[e]){var F=i.label[e];R.push({group:e>_-1,childrenNodes:[],pointNumber:e,label:F,color:O?i.color[e]:i.color,customdata:D?i.customdata[e]:i.customdata})}var B=!1;return function(t,e,i){for(var a=n.init2dArray(t,0),o=0;o<Math.min(e.length,i.length);o++)if(n.isIndex(e[o],t)&&n.isIndex(i[o],t)){if(e[o]===i[o])return!0;a[e[o]].push(i[o])}var s=r(a);return s.components.some((function(t){return t.length>1}))}(z,M.source,M.target)&&(B=!0),{circular:B,links:c,nodes:R,groups:w,groupLookup:k}}e.exports=function(t,e){var r=l(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}}),E_=d({"node_modules/d3-quadtree/dist/d3-quadtree.js"(t,e){var r,n;r=t,n=function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,d,p=t._root,f={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))return i[h]=f,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return f.next=p,i?i[h]=f:t._root=f,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)===(d=(l>=o)<<1|s>=a));return i[d]=p,i[h]=f,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,d=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>h&&(h=i),a<u&&(u=a),a>d&&(d=a));if(c>h||u>d)return this;for(this.cover(c,u).cover(h,d),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this},l.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{for(var o,s,l=i-r,c=this._root;r>t||t>=i||n>e||e>=a;)switch(s=(e<n)<<1|t<r,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=r+l,a=n+l;break;case 1:r=i-l,a=n+l;break;case 2:i=r+l,n=a-l;break;case 3:r=i-l,n=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,c,u,h=this._x0,d=this._y0,p=this._x1,f=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,d,p,f)),null==n?n=1/0:(h=t-n,d=e-n,p=t+n,f=e+n,n*=n);c=m.pop();)if(!(!(g=c.node)||(a=c.x0)>p||(o=c.y0)>f||(s=c.x1)<h||(l=c.y1)<d))if(g.length){var y=(a+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],a,v,y,l),new r(g[1],y,o,s,v),new r(g[0],a,o,y,v)),(u=(e>=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_<n){var w=Math.sqrt(n=_);h=t-w,d=e-w,p=t+w,f=e+w,i=g.data}}return i},l.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,c,u,h,d,p=this._root,f=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((c=a>=(s=(f+g)/2))?f=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,d=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[d]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this},l.root=function(){return this._root},l.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},l.visit=function(t){var e,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,a=e.y0,o=e.x1,s=e.y1)&&c.length){var u=(i+o)/2,h=(a+s)/2;(n=c[3])&&l.push(new r(n,u,h,o,s)),(n=c[2])&&l.push(new r(n,i,h,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,h)),(n=c[0])&&l.push(new r(n,i,a,u,h))}return this},l.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var a=e.node;if(a.length){var o,s=e.x0,l=e.y0,c=e.x1,u=e.y1,h=(s+c)/2,d=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,h,d)),(o=a[1])&&n.push(new r(o,h,l,c,d)),(o=a[2])&&n.push(new r(o,s,d,h,u)),(o=a[3])&&n.push(new r(o,h,d,c,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},l.x=function(t){return arguments.length?(this._x=t,this):this._x},l.y=function(t){return arguments.length?(this._y=t,this):this._y},t.quadtree=a,Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),L_=d({"node_modules/d3-collection/dist/d3-collection.js"(t,e){var r;r=t,function(t){var e="$";function r(){}function n(t,e){var n=new r;if(t instanceof r)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==e)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(e(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}function i(){return{}}function a(t,e,r){t[e]=r}function o(){return n()}function s(t,e,r){t.set(e,r)}function l(){}r.prototype=n.prototype={constructor:r,has:function(t){return e+t in this},get:function(t){return this[e+t]},set:function(t,r){return this[e+t]=r,this},remove:function(t){var r=e+t;return r in this&&delete this[r]},clear:function(){for(var t in this)t[0]===e&&delete this[t]},keys:function(){var t=[];for(var r in this)r[0]===e&&t.push(r.slice(1));return t},values:function(){var t=[];for(var r in this)r[0]===e&&t.push(this[r]);return t},entries:function(){var t=[];for(var r in this)r[0]===e&&t.push({key:r.slice(1),value:this[r]});return t},size:function(){var t=0;for(var r in this)r[0]===e&&++t;return t},empty:function(){for(var t in this)if(t[0]===e)return!1;return!0},each:function(t){for(var r in this)r[0]===e&&t(this[r],r.slice(1),this)}};var c=n.prototype;function u(t,e){var r=new l;if(t instanceof l)t.each((function(t){r.add(t)}));else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}l.prototype=u.prototype={constructor:l,has:c.has,add:function(t){return this[e+(t+="")]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each},t.nest=function(){var t,e,r,l=[],c=[];function u(r,i,a,o){if(i>=l.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var s,c,h,d=-1,p=r.length,f=l[i++],m=n(),g=a();++d<p;)(h=m.get(s=f(c=r[d])+""))?h.push(c):m.set(s,[c]);return m.each((function(t,e){o(g,e,u(t,i,a,o))})),g}function h(t,r){if(++r>l.length)return t;var n,i=c[r-1];return null!=e&&r>=l.length?n=t.entries():(n=[],t.each((function(t,e){n.push({key:e,values:h(t,r)})}))),null!=i?n.sort((function(t,e){return i(t.key,e.key)})):n}return r={object:function(t){return u(t,0,i,a)},map:function(t){return u(t,0,o,s)},entries:function(t){return h(u(t,0,o,s),0)},key:function(t){return l.push(t),r},sortKeys:function(t){return c[l.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}},t.set=u,t.map=n,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"===typeof t&&"undefined"!==typeof e?t:r.d3=r.d3||{})}}),P_=d({"node_modules/d3-dispatch/dist/d3-dispatch.js"(t,e){var r,n;r=t,n=function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new n(i)}function n(t){this._=t}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,r,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===r){t[i]=e,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:r,value:n}),t}n.prototype=r.prototype={constructor:n,on:function(t,e){var r,n,o=this._,s=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++l<c;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<c;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=r,Object.defineProperty(t,"__esModule",{value:!0})},n("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),I_=d({"node_modules/d3-timer/dist/d3-timer.js"(t,e){var r;r=t,function(t){var e,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"===typeof performance&&performance.now?performance:Date,u="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function h(){return s||(u(d),s=c.now()+l)}function d(){s=0}function p(){this._call=this._time=this._next=null}function f(t,e,r){var n=new p;return n.restart(t,e,r),n}function m(){h(),++n;for(var t,r=e;r;)(t=s-r._time)>=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,v(a)}(),s=0}}function y(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}p.prototype=f.prototype={constructor:p,restart:function(t,n,i){if("function"!==typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=f,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})}("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),z_=d({"node_modules/d3-force/dist/d3-force.js"(t,e){var r,n;r=t,n=function(t,e,r,n,i){function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function d(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-t,s=s/a-e,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==t&&(t=0),null==e&&(e=0),n.initialize=function(t){r=t},n.x=function(e){return arguments.length?(t=+e,n):t},n.y=function(t){return arguments.length?(e=+t,n):e},n},t.forceCollide=function(t){var r,n,i=1,c=1;function u(){for(var t,a,u,d,p,f,m,g=r.length,y=0;y<c;++y)for(a=e.quadtree(r,s,l).visitAfter(h),t=0;t<g;++t)u=r[t],f=n[u.index],m=f*f,d=u.x+u.vx,p=u.y+u.vy,a.visit(v);function v(t,e,r,n,a){var s=t.data,l=t.r,c=f+l;if(!s)return e>d+c||n<d-c||r>p+c||a<p-c;if(s.index>u.index){var h=d-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;y<c*c&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(c-(y=Math.sqrt(y)))/y*i,u.vx+=(h*=y)*(c=(l*=l)/(m+l)),u.vy+=(g*=y)*c,s.vx-=h*(c=1-c),s.vy-=g*c)}}}function h(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function d(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e<a;++e)i=r[e],n[i.index]=+t(i,e,r)}}return"function"!==typeof t&&(t=a(null==t?1:+t)),u.initialize=function(t){r=t,d()},u.iterations=function(t){return arguments.length?(c=+t,u):c},u.strength=function(t){return arguments.length?(i=+t,u):i},u.radius=function(e){return arguments.length?(t="function"===typeof e?e:a(+e),d(),u):t},u},t.forceLink=function(t){var e,n,i,s,l,h=c,d=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},p=a(30),f=1;function m(r){for(var i=0,a=t.length;i<f;++i)for(var s,c,u,h,d,p,m,g=0;g<a;++g)c=(s=t[g]).source,h=(u=s.target).x+u.vx-c.x-c.vx||o(),d=u.y+u.vy-c.y-c.vy||o(),h*=p=((p=Math.sqrt(h*h+d*d))-n[g])/p*r*e[g],d*=p,u.vx-=h*(m=l[g]),u.vy-=d*m,c.vx+=h*(m=1-m),c.vy+=d*m}function g(){if(i){var a,o,c=i.length,d=t.length,p=r.map(i,h);for(a=0,s=new Array(c);a<d;++a)(o=t[a]).index=a,"object"!==typeof o.source&&(o.source=u(p,o.source)),"object"!==typeof o.target&&(o.target=u(p,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(d);a<d;++a)o=t[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);e=new Array(d),y(),n=new Array(d),v()}}function y(){if(i)for(var r=0,n=t.length;r<n;++r)e[r]=+d(t[r],r,t)}function v(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+p(t[e],e,t)}return null==t&&(t=[]),m.initialize=function(t){i=t,g()},m.links=function(e){return arguments.length?(t=e,g(),m):t},m.id=function(t){return arguments.length?(h=t,m):h},m.iterations=function(t){return arguments.length?(f=+t,m):f},m.strength=function(t){return arguments.length?(d="function"===typeof t?t:a(+t),y(),m):d},m.distance=function(t){return arguments.length?(p="function"===typeof t?t:a(+t),v(),m):p},m},t.forceManyBody=function(){var t,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function p(i){var a,o=t.length,s=e.quadtree(t,h,d).visitAfter(m);for(n=i,a=0;a<o;++a)r=t[a],s.visit(g)}function f(){if(t){var e,r,n=t.length;for(i=new Array(n),e=0;e<n;++e)r=t[e],i[r.index]=+s(r,e,t)}}function m(t){var e,r,n,a,o,s=0,l=0;if(t.length){for(n=a=o=0;o<4;++o)(e=t[o])&&(r=Math.abs(e.value))&&(s+=e.value,l+=r,n+=r*e.x,a+=r*e.y);t.x=n/l,t.y=a/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function g(t,e,a,s){if(!t.value)return!0;var h=t.x-r.x,d=t.y-r.y,p=s-e,f=h*h+d*d;if(p*p/u<f)return f<c&&(0===h&&(f+=(h=o())*h),0===d&&(f+=(d=o())*d),f<l&&(f=Math.sqrt(l*f)),r.vx+=h*t.value*n/f,r.vy+=d*t.value*n/f),!0;if(!(t.length||f>=c)){(t.data!==r||t.next)&&(0===h&&(f+=(h=o())*h),0===d&&(f+=(d=o())*d),f<l&&(f=Math.sqrt(l*f)));do{t.data!==r&&(p=i[t.data.index]*n/f,r.vx+=h*p,r.vy+=d*p)}while(t=t.next)}}return p.initialize=function(e){t=e,f()},p.strength=function(t){return arguments.length?(s="function"===typeof t?t:a(+t),f(),p):s},p.distanceMin=function(t){return arguments.length?(l=t*t,p):Math.sqrt(l)},p.distanceMax=function(t){return arguments.length?(c=t*t,p):Math.sqrt(c)},p.theta=function(t){return arguments.length?(u=t*t,p):Math.sqrt(u)},p},t.forceRadial=function(t,e,r){var n,i,o,s=a(.1);function l(t){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-e||1e-6,u=l.y-r||1e-6,h=Math.sqrt(c*c+u*u),d=(o[a]-h)*i[a]*t/h;l.vx+=c*d,l.vy+=u*d}}function c(){if(n){var e,r=n.length;for(i=new Array(r),o=new Array(r),e=0;e<r;++e)o[e]=+t(n[e],e,n),i[e]=isNaN(o[e])?0:+s(n[e],e,n)}}return"function"!==typeof t&&(t=a(+t)),null==e&&(e=0),null==r&&(r=0),l.initialize=function(t){n=t,c()},l.strength=function(t){return arguments.length?(s="function"===typeof t?t:a(+t),c(),l):s},l.radius=function(e){return arguments.length?(t="function"===typeof e?e:a(+e),c(),l):t},l.x=function(t){return arguments.length?(e=+t,l):e},l.y=function(t){return arguments.length?(r=+t,l):r},l},t.forceSimulation=function(t){var e,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),h=i.timer(f),d=n.dispatch("tick","end");function f(){m(),d.call("tick",e),a<o&&(h.stop(),d.call("end",e))}function m(r){var n,i,o=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(a+=(l-a)*s,u.each((function(t){t(a)})),n=0;n<o;++n)null==(i=t[n]).fx?i.x+=i.vx*=c:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=c:(i.y=i.fy,i.vy=0);return e}function g(){for(var e,r=0,n=t.length;r<n;++r){if((e=t[r]).index=r,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(r),a=r*p;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function y(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:m,restart:function(){return h.restart(f),e},stop:function(){return h.stop(),e},nodes:function(r){return arguments.length?(t=r,g(),u.each(y),e):t},alpha:function(t){return arguments.length?(a=+t,e):a},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(s=+t,e):+s},alphaTarget:function(t){return arguments.length?(l=+t,e):l},velocityDecay:function(t){return arguments.length?(c=1-t,e):1-c},force:function(t,r){return arguments.length>1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=e-(s=t[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(t,r){return arguments.length>1?(d.on(t,r),e):d.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vx+=(n[a]-i.x)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!==typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:a(+t),s(),o):i},o.x=function(e){return arguments.length?(t="function"===typeof e?e:a(+e),s(),o):t},o},t.forceY=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a<o;++a)(i=e[a]).vy+=(n[a]-i.y)*r[a]*t}function s(){if(e){var a,o=e.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!==typeof t&&(t=a(null==t?0:+t)),o.initialize=function(t){e=t,s()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:a(+t),s(),o):i},o.y=function(e){return arguments.length?(t="function"===typeof e?e:a(+e),s(),o):t},o},Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,E_(),L_(),P_(),I_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3)}}),O_=d({"node_modules/d3-path/dist/d3-path.js"(t,e){var r;r=t,function(t){var e=Math.PI,r=2*e,n=1e-6,i=r-n;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,r,i,a,o){t=+t,r=+r,i=+i,a=+a,o=+o;var s=this._x1,l=this._y1,c=i-t,u=a-r,h=s-t,d=l-r,p=h*h+d*d;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=r);else if(p>n)if(Math.abs(d*c-u*h)>n&&o){var f=i-s,m=a-l,g=c*c+u*u,y=f*f+m*m,v=Math.sqrt(g),x=Math.sqrt(p),b=o*Math.tan((e-Math.acos((g+p-y)/(2*v*x)))/2),_=b/x,w=b/v;Math.abs(_-1)>n&&(this._+="L"+(t+_*h)+","+(r+_*d)),this._+="A"+o+","+o+",0,0,"+ +(d*f>h*m)+","+(this._x1=t+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,c){t=+t,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),d=t+u,p=a+h,f=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+d+","+p:(Math.abs(this._x1-d)>n||Math.abs(this._y1-p)>n)&&(this._+="L"+d+","+p),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+f+","+(t-u)+","+(a-h)+"A"+o+","+o+",0,1,"+f+","+(this._x1=d)+","+(this._y1=p):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=e)+","+f+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})}("object"===typeof t&&"undefined"!==typeof e?t:(r=r||self).d3=r.d3||{})}}),D_=d({"node_modules/d3-shape/dist/d3-shape.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,d=h/2,p=2*h;function f(t){return t>=1?d:t<=-1?-d:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,e,r,n,i,a,s){var l=t-r,u=e-n,h=(s?a:-a)/c(l*l+u*u),d=h*u,p=-h*l,f=t+d,m=e+p,g=r+d,y=n+p,v=(f+g)/2,x=(m+y)/2,b=g-f,_=y-m,w=b*b+_*_,k=i-a,T=f*y-g*m,S=(_<0?-1:1)*c(o(0,k*k*w-T*T)),A=(T*_-b*S)/w,M=(-T*b-_*S)/w,C=(T*_+b*S)/w,E=(-T*b+_*S)/w,L=A-v,P=M-x,I=C-v,z=E-x;return L*L+P*P>I*I+z*z&&(A=C,M=E),{cx:A,cy:M,x01:-d,y01:-p,x11:A*(i/k-1),y11:M*(i/k-1)}}function _(t){this._context=t}function w(t){return new _(t)}function k(t){return t[0]}function T(t){return t[1]}function S(){var t=k,n=T,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,d=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l<h&&i(c=r[l],l,r))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+t(c,l,r),+n(c,l,r));if(u)return s=null,u+""||null}return l.x=function(e){return arguments.length?(t="function"===typeof e?e:r(+e),l):t},l.y=function(t){return arguments.length?(n="function"===typeof t?t:r(+t),l):n},l.defined=function(t){return arguments.length?(i="function"===typeof t?t:r(!!t),l):i},l.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),l):o},l.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),l):a},l}function A(){var t=k,n=null,i=r(0),a=T,o=r(!0),s=null,l=w,c=null;function u(r){var u,h,d,p,f,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(c=l(f=e.path())),u=0;u<=m;++u){if(!(u<m&&o(p=r[u],u,r))===g)if(g=!g)h=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),d=u-1;d>=h;--d)c.point(y[d],v[d]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+t(p,u,r),v[u]=+i(p,u,r),c.point(n?+n(p,u,r):y[u],a?+a(p,u,r):v[u]))}if(f)return c=null,f+""||null}function h(){return S().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"===typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"===typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"===typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"===typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"===typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"===typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function M(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function C(t){return t}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var E=P(w);function L(t){this._curve=t}function P(t){function e(e){return new L(t(e))}return e._curve=t,e}function I(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(P(t)):e()._curve},t}function z(){return I(S().curve(E))}function O(){var t=A().curve(E),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return I(r())},delete t.lineX0,t.lineEndAngle=function(){return I(n())},delete t.lineX1,t.lineInnerRadius=function(){return I(i())},delete t.lineY0,t.lineOuterRadius=function(){return I(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(P(t)):e()._curve},t}function D(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function j(t){var n=F,i=B,a=k,o=T,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"===typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"===typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function N(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function V(t,e,r,n,i){var a=D(e,r),o=D(e,r=(r+i)/2),s=D(n,r),l=D(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,p)}},$={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},H=Math.sqrt(1/3),W=2*H,G={draw:function(t,e){var r=Math.sqrt(e/W),n=r*H;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),Z=Math.sin(p/10)*Y,X=-Math.cos(p/10)*Y,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=Z*r,i=X*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},J={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[q,$,G,J,K,tt,at];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ct(t){this._context=t}function ut(t){this._context=t}function ht(t){this._context=t}function dt(t,e){this._basis=new ct(t),this._beta=e}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ut.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var pt=function t(e){function r(t){return 1===e?new ct(t):new dt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function ft(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ft(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ft(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ft(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ft(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var bt=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>u){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>u){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:_t(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var kt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Tt(t,e){this._context=t,this._alpha=e}Tt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:_t(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var St=function t(e){function r(t){return e?new Tt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_t(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function r(t){return e?new At(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Ct(t){this._context=t}function Et(t){return t<0?-1:1}function Lt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Et(a)+Et(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Pt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function It(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Ot(t){this._context=new Dt(t)}function Dt(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,o[e]-=r*o[e-1];for(i[n-1]=o[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function Bt(t,e){this._context=t,this._t=e}function jt(t,e){if((i=t.length)>1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a<i;++a)for(n=o,o=t[e[a]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Nt(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function Vt(t){var e=t.map(qt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++r<i;)(e=+t[r][1])>a&&(a=e,n=r);return n}function $t(t){var e=t.map(Ht);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function Ht(t){for(var e,r=0,n=-1,i=t.length;++n<i;)(e=+t[n][1])&&(r+=e);return r}Ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:It(this,this._t0,Pt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,It(this,Pt(this,r=Lt(this,t,e)),r);break;default:It(this,this._t0,r=Lt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(Ot.prototype=Object.create(zt.prototype)).point=function(t,e){zt.prototype.point.call(this,e,t)},Dt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}},Rt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=Ft(t),i=Ft(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,_=r(0),w=null,k=y,T=v,S=x,A=null;function M(){var r,m,g,y=+t.apply(this,arguments),v=+o.apply(this,arguments),x=k.apply(this,arguments)-d,M=T.apply(this,arguments)-d,C=n(M-x),E=M>x;if(A||(A=r=e.path()),v<y&&(m=v,v=y,y=m),v>u)if(C>p-u)A.moveTo(v*a(x),v*l(x)),A.arc(0,0,v,x,M,!E),y>u&&(A.moveTo(y*a(M),y*l(M)),A.arc(0,0,y,M,x,E));else{var L,P,I=x,z=M,O=x,D=M,R=C,F=C,B=S.apply(this,arguments)/2,j=B>u&&(w?+w.apply(this,arguments):c(y*y+v*v)),N=s(n(v-y)/2,+_.apply(this,arguments)),U=N,V=N;if(j>u){var q=f(j/y*l(B)),$=f(j/v*l(B));(R-=2*q)>u?(O+=q*=E?1:-1,D-=q):(R=0,O=D=(x+M)/2),(F-=2*$)>u?(I+=$*=E?1:-1,z-=$):(F=0,I=z=(x+M)/2)}var H=v*a(I),W=v*l(I),G=y*a(D),Y=y*l(D);if(N>u){var Z,X=v*a(z),K=v*l(z),J=y*a(O),Q=y*l(O);if(C<h&&(Z=function(t,e,r,n,i,a,o,s){var l=r-t,c=n-e,h=o-i,d=s-a,p=d*l-h*c;if(!(p*p<u))return[t+(p=(h*(e-a)-d*(t-i))/p)*l,e+p*c]}(H,W,J,Q,X,K,G,Y))){var tt=H-Z[0],et=W-Z[1],rt=X-Z[0],nt=K-Z[1],it=1/l(((g=(tt*rt+et*nt)/(c(tt*tt+et*et)*c(rt*rt+nt*nt)))>1?0:g<-1?h:Math.acos(g))/2),at=c(Z[0]*Z[0]+Z[1]*Z[1]);U=s(N,(y-at)/(it-1)),V=s(N,(v-at)/(it+1))}}F>u?V>u?(L=b(J,Q,H,W,v,V,E),P=b(X,K,G,Y,v,V,E),A.moveTo(L.cx+L.x01,L.cy+L.y01),V<N?A.arc(L.cx,L.cy,V,i(L.y01,L.x01),i(P.y01,P.x01),!E):(A.arc(L.cx,L.cy,V,i(L.y01,L.x01),i(L.y11,L.x11),!E),A.arc(0,0,v,i(L.cy+L.y11,L.cx+L.x11),i(P.cy+P.y11,P.cx+P.x11),!E),A.arc(P.cx,P.cy,V,i(P.y11,P.x11),i(P.y01,P.x01),!E))):(A.moveTo(H,W),A.arc(0,0,v,I,z,!E)):A.moveTo(H,W),y>u&&R>u?U>u?(L=b(G,Y,X,K,y,-U,E),P=b(H,W,J,Q,y,-U,E),A.lineTo(L.cx+L.x01,L.cy+L.y01),U<N?A.arc(L.cx,L.cy,U,i(L.y01,L.x01),i(P.y01,P.x01),!E):(A.arc(L.cx,L.cy,U,i(L.y01,L.x01),i(L.y11,L.x11),!E),A.arc(0,0,y,i(L.cy+L.y11,L.cx+L.x11),i(P.cy+P.y11,P.cx+P.x11),E),A.arc(P.cx,P.cy,U,i(P.y11,P.x11),i(P.y01,P.x01),!E))):A.arc(0,0,y,D,O,E):A.lineTo(G,Y)}else A.moveTo(0,0);if(A.closePath(),r)return A=null,r+""||null}return M.centroid=function(){var e=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+k.apply(this,arguments)+ +T.apply(this,arguments))/2-h/2;return[a(r)*e,l(r)*e]},M.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:r(+e),M):t},M.outerRadius=function(t){return arguments.length?(o="function"===typeof t?t:r(+t),M):o},M.cornerRadius=function(t){return arguments.length?(_="function"===typeof t?t:r(+t),M):_},M.padRadius=function(t){return arguments.length?(w=null==t?null:"function"===typeof t?t:r(+t),M):w},M.startAngle=function(t){return arguments.length?(k="function"===typeof t?t:r(+t),M):k},M.endAngle=function(t){return arguments.length?(T="function"===typeof t?t:r(+t),M):T},M.padAngle=function(t){return arguments.length?(S="function"===typeof t?t:r(+t),M):S},M.context=function(t){return arguments.length?(A=null==t?null:t,M):A},M},t.area=A,t.areaRadial=O,t.curveBasis=function(t){return new ct(t)},t.curveBasisClosed=function(t){return new ut(t)},t.curveBasisOpen=function(t){return new ht(t)},t.curveBundle=pt,t.curveCardinal=gt,t.curveCardinalClosed=vt,t.curveCardinalOpen=bt,t.curveCatmullRom=kt,t.curveCatmullRomClosed=St,t.curveCatmullRomOpen=Mt,t.curveLinear=w,t.curveLinearClosed=function(t){return new Ct(t)},t.curveMonotoneX=function(t){return new zt(t)},t.curveMonotoneY=function(t){return new Ot(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.line=S,t.lineRadial=z,t.linkHorizontal=function(){return j(N)},t.linkRadial=function(){var t=j(V);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return j(U)},t.pie=function(){var t=C,e=M,n=null,i=r(0),a=r(p),o=r(0);function s(r){var s,l,c,u,h,d=r.length,f=0,m=new Array(d),g=new Array(d),y=+i.apply(this,arguments),v=Math.min(p,Math.max(-p,a.apply(this,arguments)-y)),x=Math.min(Math.abs(v)/d,o.apply(this,arguments)),b=x*(v<0?-1:1);for(s=0;s<d;++s)(h=g[m[s]=s]=+t(r[s],s,r))>0&&(f+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=f?(v-d*b)/f:0;s<d;++s,y=u)l=m[s],u=y+((h=g[l])>0?h*c:0)+b,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"===typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"===typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"===typeof t?t:r(+t),s):o},s},t.pointRadial=D,t.radialArea=O,t.radialLine=z,t.stack=function(){var t=r([]),e=Nt,n=jt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a<c;++a){for(var h,d=s[a],p=u[a]=new Array(l),f=0;f<l;++f)p[f]=h=[0,+i(r[f],d,f,r)],h.data=r[f];p.key=d}for(a=0,o=e(u);a<c;++a)u[o[a]].index=a;return n(u,o),u}return a.keys=function(e){return arguments.length?(t="function"===typeof e?e:r(R.call(e)),a):t},a.value=function(t){return arguments.length?(i="function"===typeof t?t:r(+t),a):i},a.order=function(t){return arguments.length?(e=null==t?Nt:"function"===typeof t?t:r(R.call(t)),a):e},a.offset=function(t){return arguments.length?(n=null==t?jt:t,a):n},a},t.stackOffsetDiverging=function(t,e){if((s=t.length)>0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l<c;++l)for(a=o=0,r=0;r<s;++r)(i=(n=t[e[r]][l])[1]-n[0])>0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a<o;++a){for(i=r=0;r<n;++r)i+=t[r][a][1]||0;if(i)for(r=0;r<n;++r)t[r][a][1]/=i}jt(t,e)}},t.stackOffsetNone=jt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,i=t[e[0]],a=i.length;n<a;++n){for(var o=0,s=0;o<r;++o)s+=t[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}jt(t,e)}},t.stackOffsetWiggle=function(t,e){if((i=t.length)>0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<i;++s){for(var u=t[e[s]],h=u[o][1]||0,d=(h-(u[o-1][1]||0))/2,p=0;p<s;++p){var f=t[e[p]];d+=(f[o][1]||0)-(f[o-1][1]||0)}l+=h,c+=d*h}r[o-1][1]+=r[o-1][0]=a,l&&(a-=c/l)}r[o-1][1]+=r[o-1][0]=a,jt(t,e)}},t.stackOrderAppearance=Vt,t.stackOrderAscending=$t,t.stackOrderDescending=function(t){return $t(t).reverse()},t.stackOrderInsideOut=function(t){var e,r,n=t.length,i=t.map(Ht),a=Vt(t),o=0,s=0,l=[],c=[];for(e=0;e<n;++e)r=a[e],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)},t.stackOrderNone=Nt,t.stackOrderReverse=function(t){return Nt(t).reverse()},t.symbol=function(){var t=r(q),n=r(64),i=null;function a(){var r;if(i||(i=r=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(e){return arguments.length?(t="function"===typeof e?e:r(e),a):t},a.size=function(t){return arguments.length?(n="function"===typeof t?t:r(+t),a):n},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a},t.symbolCircle=q,t.symbolCross=$,t.symbolDiamond=G,t.symbolSquare=J,t.symbolStar=K,t.symbolTriangle=tt,t.symbolWye=at,t.symbols=ot,Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,O_()):n((r=r||self).d3=r.d3||{},r.d3)}}),R_=d({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(t,e){var r,n;r=t,n=function(t,e,r,n){function i(t){return t.target.depth}function a(t,e){return t.sourceLinks.length?t.depth:e-1}function o(t){return function(){return t}}function s(t,e){return c(t.source,e.source)||t.index-e.index}function l(t,e){return c(t.target,e.target)||t.index-e.index}function c(t,e){return t.y0-e.y0}function u(t){return t.value}function h(t){return(t.y0+t.y1)/2}function d(t){return h(t.source)*t.value}function p(t){return h(t.target)*t.value}function f(t){return t.index}function m(t){return t.nodes}function g(t){return t.links}function y(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function v(t){return[t.source.x1,t.y0]}function x(t){return[t.target.x0,t.y1]}t.sankey=function(){var t=0,n=0,i=1,v=1,x=24,b=8,_=f,w=a,k=m,T=g,S=32,A=2/3;function M(){var a={nodes:k.apply(null,arguments),links:T.apply(null,arguments)};return function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,_);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==typeof n&&(n=t.source=y(e,n)),"object"!==typeof i&&(i=t.target=y(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))}(a),function(t){t.nodes.forEach((function(t){t.value=Math.max(e.sum(t.sourceLinks,u),e.sum(t.targetLinks,u))}))}(a),function(e){var r,n,a;for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(t){t.depth=a,t.sourceLinks.forEach((function(t){n.indexOf(t.target)<0&&n.push(t.target)}))}));for(r=e.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(t){t.height=a,t.targetLinks.forEach((function(t){n.indexOf(t.source)<0&&n.push(t.source)}))}));var o=(i-t-x)/(a-1);e.nodes.forEach((function(e){e.x1=(e.x0=t+Math.max(0,Math.min(a-1,Math.floor(w.call(null,e,a))))*o)+x}))}(a),function(t){var i=r.nest().key((function(t){return t.x0})).sortKeys(e.ascending).entries(t.nodes).map((function(t){return t.values}));s(),m();for(var a=1,o=S;o>0;--o)f(a*=.99),m(),l(a),m();function s(){var r=e.max(i,(function(t){return t.length})),a=A*(v-n)/(r-1);b>a&&(b=a);var o=e.min(i,(function(t){return(v-n-(t.length-1)*b)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}function l(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,d)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function f(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function m(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i<o;++i)(r=a-(e=t[i]).y0)>0&&(e.y0+=r,e.y1+=r),a=e.y1+b;if((r=a-b-v)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+b-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}(a),C(a),a}function C(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return M.update=function(t){return C(t),t},M.nodeId=function(t){return arguments.length?(_="function"===typeof t?t:o(t),M):_},M.nodeAlign=function(t){return arguments.length?(w="function"===typeof t?t:o(t),M):w},M.nodeWidth=function(t){return arguments.length?(x=+t,M):x},M.nodePadding=function(t){return arguments.length?(b=+t,M):b},M.nodes=function(t){return arguments.length?(k="function"===typeof t?t:o(t),M):k},M.links=function(t){return arguments.length?(T="function"===typeof t?t:o(t),M):T},M.size=function(e){return arguments.length?(t=n=0,i=+e[0],v=+e[1],M):[i-t,v-n]},M.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],v=+e[1][1],M):[[t,n],[i,v]]},M.iterations=function(t){return arguments.length?(S=+t,M):S},M},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,dg(),L_(),D_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),F_=d({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,e){var r=M_();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(t){var e,r,i=!1;for(a.push(t),o[t]=!0,e=0;e<l[t].length;e++)(r=l[t][e])===n?(h(n,a),i=!0):o[r]||(i=u(r));if(i)c(t);else for(e=0;e<l[t].length;e++){r=l[t][e];var d=s[r];d||(d={},s[r]=d),d[r]=!0}return a.pop(),i}function h(t,r){var n=[].concat(r).concat(t);e?e(u):i.push(n)}function d(e){!function(e){for(var r=0;r<t.length;r++)r<e&&(t[r]=[]),t[r]=t[r].filter((function(t){return t>=e}))}(e);for(var n,i=r(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o<i.length;o++)for(var s=0;s<i[o].length;s++)i[o][s]<a&&(a=i[o][s],n=o);var l=i[n];return!!l&&{leastVertex:a,adjList:t.map((function(t,e){return-1===l.indexOf(e)?[]:t.filter((function(t){return-1!==l.indexOf(t)}))}))}}n=0;for(var p=t.length;n<p;){var f=d(n);if(n=f.leastVertex,l=f.adjList){for(var m=0;m<l.length;m++)for(var g=0;g<l[m].length;g++){var y=l[m][g];o[+y]=!1,s[y]={}}u(n),n+=1}else n=p}return e?void 0:i}}}),B_=d({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(t,e){var r,n;r=t,n=function(t,e,r,n,i){function a(t){return t.target.depth}function o(t,e){return t.sourceLinks.length?t.depth:e-1}function s(t){return function(){return t}}i=i&&i.hasOwnProperty("default")?i.default:i;var l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function c(t,e){return h(t.source,e.source)||t.index-e.index}function u(t,e){return h(t.target,e.target)||t.index-e.index}function h(t,e){return t.partOfCycle===e.partOfCycle?t.y0-e.y0:"top"===t.circularLinkType||"bottom"===e.circularLinkType?-1:1}function d(t){return t.value}function p(t){return(t.y0+t.y1)/2}function f(t){return p(t.source)}function m(t){return p(t.target)}function g(t){return t.index}function y(t){return t.nodes}function v(t){return t.links}function x(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function b(t,e){return e(t)}var _=25,w=10;function k(t,e){var r=0,n=0;t.links.forEach((function(i){i.circular&&(i.source.circularLinkType||i.target.circularLinkType?i.circularLinkType=i.source.circularLinkType?i.source.circularLinkType:i.target.circularLinkType:i.circularLinkType=r<n?"top":"bottom","top"==i.circularLinkType?r+=1:n+=1,t.nodes.forEach((function(t){b(t,e)!=b(i.source,e)&&b(t,e)!=b(i.target,e)||(t.circularLinkType=i.circularLinkType)})))})),t.links.forEach((function(t){t.circular&&(t.source.circularLinkType==t.target.circularLinkType&&(t.circularLinkType=t.source.circularLinkType),$(t,e)&&(t.circularLinkType=t.source.circularLinkType))}))}function T(t){var e=Math.abs(t.y1-t.y0),r=Math.abs(t.target.x0-t.source.x1);return Math.atan(r/e)}function S(t,e){var r=0;t.sourceLinks.forEach((function(t){r=t.circular&&!$(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!$(t,e)?n+1:n})),r+n}function A(t){var e=t.source.sourceLinks,r=0;e.forEach((function(t){r=t.circular?r+1:r}));var n=t.target.targetLinks,i=0;return n.forEach((function(t){i=t.circular?i+1:i})),!(r>1||i>1)}function M(t,e,r){return t.sort(E),t.forEach((function(n,i){var a,o,s=0;if($(n,r)&&A(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<i;l++)if(a=t[i],o=t[l],!(a.source.column<o.target.column)&&!(a.target.column>o.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function C(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),M(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),M(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,$(e,a)&&A(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+_+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-_-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(P):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(z):c.sort(I),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+_+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-_-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function E(t,e){return O(t)==O(e)?"bottom"==t.circularLinkType?P(t,e):L(t,e):O(e)-O(t)}function L(t,e){return t.y0-e.y0}function P(t,e){return e.y0-t.y0}function I(t,e){return t.y1-e.y1}function z(t,e){return e.y1-t.y1}function O(t){return t.target.column-t.source.column}function D(t){return t.target.x0-t.source.x1}function R(t,e){var r=T(t),n=D(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function F(t,e){var r=T(t),n=D(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function B(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),d=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),f=Math.pow(u,3),m=h*i.y0+d*i.y0+p*i.y1+f*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&g<o.y1?(c=o.y1-g+10,c="bottom"==o.circularLinkType?c:-c,o=j(o,c,e,r),t.nodes.forEach((function(t){var i,a;b(t,n)!=b(o,n)&&t.column==o.column&&(a=t,(i=o).y0>a.y0&&i.y0<a.y1||i.y1>a.y0&&i.y1<a.y1||i.y0<a.y0&&i.y1>a.y1)&&j(t,c,e,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(c=y-o.y0+10,o=j(o,c,e,r),t.nodes.forEach((function(t){b(t,n)!=b(o,n)&&t.column==o.column&&t.y0<o.y1&&t.y1>o.y1&&j(t,c,e,r)})))}}))}}))}function j(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function N(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return b(t.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=F(e,t);return t.y1-r}if(e.target.column>t.target.column)return F(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r<o;r++)n+=a[r].width;t.y0=i.y1-n-t.width/2}}))}))}function U(t,e,r){t.nodes.forEach((function(e){var n=t.links.filter((function(t){return b(t.target,r)==b(e,r)})),i=n.length;i>1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column<t.source.column){var r=R(e,t);return t.y0-r}if(t.source.column<e.source.column)return R(t,e)-e.y0}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:t.source.column-e.source.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.source.column===e.source.column?t.source.y1-e.source.y1:e.source.column-t.source.column:"top"==t.circularLinkType?-1:1:void 0}));var a=e.y0;n.forEach((function(t){t.y1=a+t.width/2,a+=t.width})),n.forEach((function(t,r){if("bottom"==t.circularLinkType){for(var a=r+1,o=0;a<i;a++)o+=n[a].width;t.y1=e.y1-o-t.width/2}}))}))}function V(t,e){return q(t)==q(e)}function q(t){return t.y0-t.y1>0?"up":"down"}function $(t,e){return b(t.source,e)==b(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,b=0,T=1,A=1,M=24,E=g,L=o,P=y,I=v,z=32,O=2,D=null;function R(){var o={nodes:P.apply(null,arguments),links:I.apply(null,arguments)};!function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,E);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==("undefined"===typeof n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==("undefined"===typeof i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))}(o),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o<t.links.length;o++){var s=t.links[o],l=s.source.index,c=s.target.index;a[l]||(a[l]=[]),a[c]||(a[c]=[]),-1===a[l].indexOf(c)&&a[l].push(c)}var u=i(a);u.sort((function(t,e){return t.length-e.length}));var h={};for(o=0;o<u.length;o++){var d=u[o].slice(-2);h[d[0]]||(h[d[0]]={}),h[d[0]][d[1]]=!0}t.links.forEach((function(t){var e=t.target.index,r=t.source.index;e===r||h[r]&&h[r][e]?(t.circular=!0,t.circularLinkID=n,n+=1):t.circular=!1}))}else t.links.forEach((function(t){t.source[r]<t.target[r]?t.circular=!1:(t.circular=!0,t.circularLinkID=n,n+=1)}))}(o,0,D),function(t){t.nodes.forEach((function(t){t.partOfCycle=!1,t.value=Math.max(e.sum(t.sourceLinks,d),e.sum(t.targetLinks,d)),t.sourceLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)})),t.targetLinks.forEach((function(e){e.circular&&(t.partOfCycle=!0,t.circularLinkType=e.circularLinkType)}))}))}(o),function(t){var e,r,n;for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.depth=n,t.sourceLinks.forEach((function(t){r.indexOf(t.target)<0&&!t.circular&&r.push(t.target)}))}));for(e=t.nodes,r=[],n=0;e.length;++n,e=r,r=[])e.forEach((function(t){t.height=n,t.targetLinks.forEach((function(t){r.indexOf(t.source)<0&&!t.circular&&r.push(t.source)}))}));t.nodes.forEach((function(t){t.column=Math.floor(L.call(null,t,n))}))}(o),k(o,E),function(i,o,s){var l=r.nest().key((function(t){return t.column})).sortKeys(e.ascending).entries(i.nodes).map((function(t){return t.values}));g(s),v();for(var c=1,u=o;u>0;--u)y(c*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach((function(t){var e=A*n/(t.length+1);o=e<o?e:o})),t=o}var s=e.min(l,(function(r){return(A-b-(r.length-1)*t)/e.sum(r,d)}));s*=.3,i.links.forEach((function(t){t.width=t.value*s}));var c=function(t){var r=0,n=0,i=0,a=0,o=e.max(t.nodes,(function(t){return t.column}));return t.links.forEach((function(t){t.circular&&("top"==t.circularLinkType?r+=t.width:n+=t.width,0==t.target.column&&(a+=t.width),t.source.column==o&&(i+=t.width))})),{top:r=r>0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:a=a>0?a+_+w:a,right:i=i>0?i+_+w:i}}(i),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),i=T-a,o=A-b,s=i+r.right+r.left,l=o+r.top+r.bottom,c=i/s,u=o/l;return a=a*c+r.left,T=0==r.right?T:T*c,b=b*u+r.top,A*=u,t.nodes.forEach((function(t){t.x0=a+t.column*((T-a-M)/n),t.x1=t.x0+M})),u}(i,c);s*=u,i.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=A/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==S(t,r)?(t.y0=A/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=b+n,t.y1=t.y0+t.value*s):(t.y0=A-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(A-b)/e*n,t.y1=t.y0+t.value*s):(t.y0=(A-b)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))}function y(t,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&S(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,f),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function v(){l.forEach((function(e){var r,n,i,a=b,o=e.length;for(e.sort(h),i=0;i<o;++i)(n=a-(r=e[i]).y0)>0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-A)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=e[i]).y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,E),F(o);for(var s=0;s<4;s++)N(o,A,E),U(o,0,E),B(o,b,A,E),N(o,A,E),U(o,0,E);return function(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}(o,b,A),C(o,O,A,E),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return R.nodeId=function(t){return arguments.length?(E="function"===typeof t?t:s(t),R):E},R.nodeAlign=function(t){return arguments.length?(L="function"===typeof t?t:s(t),R):L},R.nodeWidth=function(t){return arguments.length?(M=+t,R):M},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(P="function"===typeof t?t:s(t),R):P},R.links=function(t){return arguments.length?(I="function"===typeof t?t:s(t),R):I},R.size=function(t){return arguments.length?(a=b=0,T=+t[0],A=+t[1],R):[T-a,A-b]},R.extent=function(t){return arguments.length?(a=+t[0][0],T=+t[1][0],b=+t[0][1],A=+t[1][1],R):[[a,b],[T,A]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(O=+t,R):O},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(D=t,R):D},R.update=function(t){return k(t,E),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1<A?"top":"bottom",t.source.circularLinkType=t.circularLinkType,t.target.circularLinkType=t.circularLinkType)})),N(t,A,E,!1),U(t,0,E),C(t,O,A,E),t},R},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,a)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"===typeof t&&"undefined"!==typeof e?n(t,dg(),L_(),D_(),F_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)}}),j_=d({"src/traces/sankey/constants.js"(t,e){e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),N_=d({"src/traces/sankey/render.js"(t,e){var r=z_(),n=(jp(),m(Dp)).interpolateNumber,i=v(),a=R_(),o=B_(),s=j_(),l=O(),c=q(),u=Je(),h=se(),d=h.strTranslate,p=h.strRotate,f=Ox(),g=f.keyFun,y=f.repeat,x=f.unwrap,b=Ae(),_=Vt(),w=Se(),k=w.CAP_SHIFT,T=w.LINE_SPACING;function S(t,e,r){var n,i=x(e),c=i.trace,u=c.domain,d="h"===c.orientation,p=c.node.pad,f=c.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[c.node.align],g=t.width*(u.x[1]-u.x[0]),y=t.height*(u.y[1]-u.y[0]),v=i._nodes,b=i._links,_=i.circular;(n=_?o.sankeyCircular().circularLinkGap(0):a.sankey()).iterations(s.sankeyIterations).size(d?[g,y]:[y,g]).nodeWidth(f).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodeAlign(m).nodes(v).links(b);var w,k,T,S=n();for(var A in n.nodePadding()<p&&h.warn("node.pad was reduced to ",n.nodePadding()," to fit within the figure."),i._groupLookup){var M,C=parseInt(i._groupLookup[A]);for(w=0;w<S.nodes.length;w++)if(S.nodes[w].pointNumber===C){M=S.nodes[w];break}if(M){var E={pointNumber:parseInt(A),x0:M.x0,x1:M.x1,y0:M.y0,y1:M.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};S.nodes.unshift(E),M.childrenNodes.unshift(E)}}if(function(){for(w=0;w<S.nodes.length;w++){var t,e,r=S.nodes[w],n={};for(k=0;k<r.targetLinks.length;k++)t=(e=r.targetLinks[k]).source.pointNumber+":"+e.target.pointNumber,n.hasOwnProperty(t)||(n[t]=[]),n[t].push(e);var i=Object.keys(n);for(k=0;k<i.length;k++){var a=n[t=i[k]],o=0,s={};for(T=0;T<a.length;T++)s[(e=a[T]).label]||(s[e.label]=0),s[e.label]+=e.value,o+=e.value;for(T=0;T<a.length;T++)(e=a[T]).flow={value:o,labelConcentration:s[e.label]/o,concentration:e.value/o,links:a},e.concentrationscale&&(e.color=l(e.concentrationscale(e.flow.labelConcentration)))}var c=0;for(k=0;k<r.sourceLinks.length;k++)c+=r.sourceLinks[k].value;for(k=0;k<r.sourceLinks.length;k++)(e=r.sourceLinks[k]).concentrationOut=e.value/c;var u=0;for(k=0;k<r.targetLinks.length;k++)u+=r.targetLinks[k].value;for(k=0;k<r.targetLinks.length;k++)(e=r.targetLinks[k]).concenrationIn=e.value/u}}(),c.node.x.length&&c.node.y.length){for(w=0;w<Math.min(c.node.x.length,c.node.y.length,S.nodes.length);w++)if(c.node.x[w]&&c.node.y[w]){var L=[c.node.x[w]*g,c.node.y[w]*y];S.nodes[w].x0=L[0]-f/2,S.nodes[w].x1=L[0]+f/2;var P=S.nodes[w].y1-S.nodes[w].y0;S.nodes[w].y0=L[1]-P/2,S.nodes[w].y1=L[1]+P/2}if("snap"===c.arrangement){var I=function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(w=0;w<n.length;w++){var s=t[n[w].index];s.x0>o+f&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=S.nodes);I.forEach((function(t){var e,r,n,i=0,a=t.length;for(t.sort((function(t,e){return t.y0-e.y0})),n=0;n<a;++n)(e=t[n]).y0>=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}n.update(S)}return{circular:_,key:r,trace:c,guid:h.randstr(),horizontal:d,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:d?y:g,dragPerpendicular:d?g:y,arrangement:c.arrangement,sankey:n,graph:S,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(t,e,r){var n=l(e.color),i=l(e.hovercolor),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r="",n=t.width/2,i=t.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-e<=i.leftFullExtent-n;return Math.abs(i.rightFullExtent-i.leftFullExtent-n),"top"===t.circularLinkType?(r="M "+(i.targetX-e)+" "+(i.targetY+n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+"A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n-e)+" "+(i.targetY-i.rightSmallArcRadius)+"L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" L "+(i.rightFullExtent+n-(i.rightLargeArcRadius-n)-e)+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent-n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.leftInnerExtent+" "+(i.sourceY-n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.verticalFullExtent+n)+"L"+(i.rightFullExtent+n-e)+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent-n-e)+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY-i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" L "+(i.targetX-e)+" "+(i.targetY-n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-e)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-e)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-e-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-e+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-e-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+" L "+(i.targetX-e)+" "+(i.targetY+n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var i=t.link.source.x1,a=t.link.target.x0-e,o=n(i,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,d=t.link.y1+t.link.width/2,p="M"+i+","+c,f="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+d+" "+s+","+u+" "+i+","+u,g=e>0?"L"+(a+e)+","+(h+t.link.width/2):"";return p+f+(g+="L"+a+","+d)+m+"Z"}}function C(t,e){var r=l(e.color),n=s.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return d(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function P(t,e){t.call(L),e.attr("d",M())}function I(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function z(t){return t.link.width>1||t.linkLineWidth>0}function D(t){return d(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function F(t,e,n,a){var o=i.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(t){a._fullLayout._dragCover=t})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,j(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,n){!function(t){for(var e=0;e<t.length;e++)t[e].y=(t[e].y0+t[e].y1)/2,t[e].x=(t[e].x0+t[e].x1)/2}(n.graph.nodes);var i=n.graph.nodes.filter((function(t){return t.originalX===n.node.originalX})).filter((function(t){return!t.partOfGroup}));n.forceLayouts[e]=r.forceSimulation(i).alphaDecay(0).force("collide",r.forceCollide().radius((function(t){return t.dy/2+n.nodePad/2})).strength(1).iterations(s.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i<r.length;i++){var a=r[i];a===n.interactionState.dragInProgress?(a.x=a.lastDraggedX,a.y=a.lastDraggedY):(a.vx=(a.originalX-a.x)/s.forceTicksPerFrame,a.y=Math.min(n.size-a.dy/2,Math.max(a.dy/2,a.y))),t=Math.max(t,Math.abs(a.vx),Math.abs(a.vy))}!n.interactionState.dragInProgress&&t<.1&&n.forceLayouts[e].alpha()>0&&n.forceLayouts[e].alpha(0)}}(0,e,i,n)).stop()}(0,o,i),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o<s.forceTicksPerFrame;o++)r.forceLayouts[n].tick();if(function(t){for(var e=0;e<t.length;e++)t[e].y0=t[e].y-t[e].dy/2,t[e].y1=t[e].y0+t[e].dy,t[e].x0=t[e].x-t[e].dx/2,t[e].x1=t[e].x0+t[e].dx}(r.graph.nodes),r.sankey.update(r.graph),P(t.filter(N(r)),e),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,B(r,i)}}))}(t,e,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),j(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),P(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e<t.node.childrenNodes.length;e++)t.node.childrenNodes[e].x=t.node.x,t.node.childrenNodes[e].y=t.node.y;"snap"!==t.arrangement&&B(t,a)}}));t.on(".drag",null).call(o)}function B(t,e){for(var r=[],n=[],i=0;i<t.graph.nodes.length;i++){var a=(t.graph.nodes[i].x0+t.graph.nodes[i].x1)/2,o=(t.graph.nodes[i].y0+t.graph.nodes[i].y1)/2;r.push(a/t.figure.width),n.push(o/t.figure.height)}_.call("_guiRestyle",e,{"node.x":[r],"node.y":[n]},t.trace.index).then((function(){e._fullLayout._dragCover&&e._fullLayout._dragCover.remove()}))}function j(t){t.lastDraggedX=t.x0+t.dx/2,t.lastDraggedY=t.y0+t.dy/2}function N(t){return function(e){return e.node.originalX===t.node.originalX}}e.exports=function(t,e,r,n,a){var o=t._context.staticPlot,f=!1;h.ensureSingle(t._fullLayout._infolayer,"g","first-render",(function(){f=!0}));var m=t._fullLayout._dragCover,v=r.filter((function(t){return x(t).trace.visible})).map(S.bind(null,n)),_=e.selectAll("."+s.cn.sankey).data(v,g);_.exit().remove(),_.enter().append("g").classed(s.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",o?"none":"auto").attr("transform",D),_.each((function(e,r){t._fullData[r]._sankey=e;var n="bgsankey-"+e.trace.uid+"-"+r;h.ensureSingle(t._fullLayout._draggers,"rect",n),t._fullData[r]._bgRect=i.select("."+n),t._fullData[r]._bgRect.style("pointer-events",o?"none":"all").attr("width",e.width).attr("height",e.height).attr("x",e.translateX).attr("y",e.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})})),_.transition().ease(s.ease).duration(s.duration).attr("transform",D);var w=_.selectAll("."+s.cn.sankeyLinks).data(y,g);w.enter().append("g").classed(s.cn.sankeyLinks,!0).style("fill","none");var L=w.selectAll("."+s.cn.sankeyLink).data((function(t){return t.graph.links.filter((function(t){return t.value})).map(A.bind(null,t))}),g);L.enter().append("path").classed(s.cn.sankeyLink,!0).call(R,_,a.linkEvents),L.style("stroke",(function(t){return z(t)?c.tinyRGB(l(t.linkLineColor)):t.tinyColorHue})).style("stroke-opacity",(function(t){return z(t)?c.opacity(t.linkLineColor):t.tinyColorAlpha})).style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha})).style("stroke-width",(function(t){return z(t)?t.linkLineWidth:1})).attr("d",M()),L.style("opacity",(function(){return t._context.staticPlot||f||m?1:0})).transition().ease(s.ease).duration(s.duration).style("opacity",1),L.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var P=_.selectAll("."+s.cn.sankeyNodeSet).data(y,g);P.enter().append("g").classed(s.cn.sankeyNodeSet,!0),P.style("cursor",(function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}}));var O=P.selectAll("."+s.cn.sankeyNode).data((function(t){var e=t.graph.nodes;return function(t){var e,r=[];for(e=0;e<t.length;e++)t[e].originalX=(t[e].x0+t[e].x1)/2,t[e].originalY=(t[e].y0+t[e].y1)/2,-1===r.indexOf(t[e].originalX)&&r.push(t[e].originalX);for(r.sort((function(t,e){return t-e})),e=0;e<t.length;e++)t[e].originalLayerIndex=r.indexOf(t[e].originalX),t[e].originalLayer=t[e].originalLayerIndex/(r.length-1)}(e),e.map(C.bind(null,t))}),g);O.enter().append("g").classed(s.cn.sankeyNode,!0).call(E).style("opacity",(function(e){return!t._context.staticPlot&&!f||e.partOfGroup?0:1})),O.call(R,_,a.nodeEvents).call(F,L,a,t),O.transition().ease(s.ease).duration(s.duration).call(E).style("opacity",(function(t){return t.partOfGroup?0:1})),O.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var B=O.selectAll("."+s.cn.nodeRect).data(y);B.enter().append("rect").classed(s.cn.nodeRect,!0).call(I),B.style("stroke-width",(function(t){return t.nodeLineWidth})).style("stroke",(function(t){return c.tinyRGB(l(t.nodeLineColor))})).style("stroke-opacity",(function(t){return c.opacity(t.nodeLineColor)})).style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),B.transition().ease(s.ease).duration(s.duration).call(I);var j=O.selectAll("."+s.cn.nodeLabel).data(y);j.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),j.attr("data-notex",1).text((function(t){return t.node.label})).each((function(e){var r=i.select(this);u.font(r,e.textFont),b.convertToTspans(r,t)})).attr("text-anchor",(function(t){return t.horizontal&&t.left?"end":"start"})).attr("transform",(function(t){var e=i.select(this),r=b.lineCount(e),n=t.textFont.size*((r-1)*T-k),a=t.nodeLineWidth/2+3,o=((t.horizontal?t.visibleHeight:t.visibleWidth)-n)/2;t.horizontal&&(t.left?a=-a:a+=t.visibleWidth);var s=t.horizontal?"":"scale(-1,1)"+p(90);return d(t.horizontal?a:o,t.horizontal?o:a)+s})),j.transition().ease(s.ease).duration(s.duration)}}}),U_=d({"src/traces/sankey/plot.js"(t,e){var r=v(),n=se(),i=n.numberFormat,a=N_(),o=zr(),s=q(),l=j_().cn,c=n._;function u(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function d(t,e){r.select(t).select("path").style("fill-opacity",e),r.select(t).select("rect").style("fill-opacity",e)}function p(t){r.select(t).select("text.name").style("fill","black")}function f(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function m(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function g(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(f(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(f(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){n.style("fill",(function(t){if(!t.link.concentrationscale)return t.tinyColorHoverHue})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return t.tinyColorHoverAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===n})).style("fill",(function(t){if(!t.link.concentrationscale)return t.tinyColorHoverHue})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return t.tinyColorHoverAlpha}))})),r&&h(e,t).selectAll("."+l.sankeyNode).filter(m(t)).call(g)}function b(t,e,r,n){n.style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(e,t).selectAll("."+l.sankeyLink).filter((function(t){return t.link.label===n})).style("fill",(function(t){return t.tinyColorHue})).style("fill-opacity",(function(t){return t.tinyColorAlpha}))})),r&&h(e,t).selectAll(l.sankeyNode).filter(m(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},i=n.nestedProperty(r,e).get();return!Array.isArray(i)&&i}e.exports=function(t,e){for(var n=t._fullLayout,h=n._paper,f=n._size,m=0;m<t._fullData.length;m++)if(t._fullData[m].visible&&t._fullData[m].type===l.sankey&&!t._fullData[m]._viewInitial){var v=t._fullData[m].node;t._fullData[m]._viewInitial={node:{groups:v.groups.slice(),x:v.x.slice(),y:v.y.slice()}}}var w=c(t,"source:")+" ",k=c(t,"target:")+" ",T=c(t,"concentration:")+" ",S=c(t,"incoming flow count:")+" ",A=c(t,"outgoing flow count:")+" ";a(t,h,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{linkEvents:{hover:function(e,n,i){!1!==t._fullLayout.hovermode&&(r.select(e).call(x.bind(0,n,i,!0)),"skip"!==n.link.trace.link.hoverinfo&&(n.link.fullData=n.link.trace,t.emit("plotly_hover",{event:r.event,points:[n.link]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var l=a.link.trace.link;if("none"!==l.hoverinfo&&"skip"!==l.hoverinfo){for(var c=[],h=0,f=0;f<a.flow.links.length;f++){var m=a.flow.links[f];if("closest"!==t._fullLayout.hovermode||a.link.pointNumber===m.pointNumber){a.link.pointNumber===m.pointNumber&&(h=f),m.fullData=m.trace,l=a.link.trace.link;var g=v(m),y={valueLabel:i(a.valueFormat)(m.value)+a.valueSuffix};c.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,k+m.target.label,m.concentrationscale?T+i("%0.2f")(m.flow.labelConcentration):""].filter(u).join("<br>"),color:_(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:_(l,"bordercolor"),fontFamily:_(l,"font.family"),fontSize:_(l,"font.size"),fontColor:_(l,"font.color"),fontWeight:_(l,"font.weight"),fontStyle:_(l,"font.style"),fontVariant:_(l,"font.variant"),fontTextcase:_(l,"font.textcase"),fontLineposition:_(l,"font.lineposition"),fontShadow:_(l,"font.shadow"),nameLength:_(l,"namelength"),textAlign:_(l,"align"),idealAlign:r.event.x<g[0]?"right":"left",hovertemplate:l.hovertemplate,hovertemplateLabels:y,eventData:[m]})}}o.loneHover(c,{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,anchorIndex:h}).each((function(){a.link.concentrationscale||d(this,.65),p(this)}))}}function v(t){var e,r;t.circular?(e=(t.circularPathData.leftInnerExtent+t.circularPathData.rightInnerExtent)/2,r=t.circularPathData.verticalFullExtent):(e=(t.source.x1+t.target.x0)/2,r=(t.y0+t.y1)/2);var n=[e,r];return"v"===t.trace.orientation&&n.reverse(),n[0]+=a.parent.translateX,n[1]+=a.parent.translateY,n}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(b.bind(0,i,a,!0)),"skip"!==i.link.trace.link.hoverinfo&&(i.link.fullData=i.link.trace,t.emit("plotly_unhover",{event:r.event,points:[i.link]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n){var i=n.link;i.originalEvent=r.event,t._hoverdata=[i],o.click(t,{target:!0})}},nodeEvents:{hover:function(e,n,i){!1!==t._fullLayout.hovermode&&(r.select(e).call(g,n,i),"skip"!==n.node.trace.node.hoverinfo&&(n.node.fullData=n.node.trace,t.emit("plotly_hover",{event:r.event,points:[n.node]})))},follow:function(e,a){if(!1!==t._fullLayout.hovermode){var s=a.node.trace.node;if("none"!==s.hoverinfo&&"skip"!==s.hoverinfo){var c=r.select(e).select("."+l.nodeRect),h=t._fullLayout._paperdiv.node().getBoundingClientRect(),f=c.node().getBoundingClientRect(),m=f.left-2-h.left,g=f.right+2-h.left,y=f.top+f.height/4-h.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,t._fullLayout._calcInverseTransform(t);var x=t._fullLayout._invScaleX,b=t._fullLayout._invScaleY,w=o.loneHover({x0:x*m,x1:x*g,y:b*y,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,S+a.node.targetLinks.length,A+a.node.sourceLinks.length].filter(u).join("<br>"),color:_(s,"bgcolor")||a.tinyColorHue,borderColor:_(s,"bordercolor"),fontFamily:_(s,"font.family"),fontSize:_(s,"font.size"),fontColor:_(s,"font.color"),fontWeight:_(s,"font.weight"),fontStyle:_(s,"font.style"),fontVariant:_(s,"font.variant"),fontTextcase:_(s,"font.textcase"),fontLineposition:_(s,"font.lineposition"),fontShadow:_(s,"font.shadow"),nameLength:_(s,"namelength"),textAlign:_(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});d(w,.85),p(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n,i){var a=n.node;a.originalEvent=r.event,t._hoverdata=[a],r.select(e).call(y,n,i),o.click(t,{target:!0})}}})}}}),V_=d({"src/traces/sankey/base_plot.js"(t){var e=Pt().overrideAll,r=_e().getModuleCalcData,n=U_(),i=B(),a=dr(),o=hr(),s=Mn().prepSelect,l=se(),c=Vt(),u="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var d={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},f={gd:t,element:h.node(),plotinfo:{id:e,xaxis:d,yaxis:p,fillRangeItems:l.noop},subplot:e,xaxes:[d],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;r<e.length;r++)if(e[r].pointNumber===t)return e[r]}for(var l=0;l<r.length;l++){var u=s(r[l].pointNumber);if(u)if(u.group){for(var h=0;h<u.childrenNodes.length;h++)o.push(u.childrenNodes[h].pointNumber);a[u.pointNumber-i.node._count]=!1}else o.push(u.pointNumber)}n=a.filter(Boolean).concat([o]),c.call("_guiRestyle",t,{"node.groups":[n]},e)},prepFn:function(t,e,r){s(t,e,r,f,i)}};o.init(f)}}t.name=u,t.baseLayoutAttrOverrides=e({hoverlabel:i.hoverlabel},"plot","nested"),t.plot=function(e){var i=r(e.calcdata,u)[0];n(e,i),t.updateFx(e)},t.clean=function(t,e,r,n){var i=n._has&&n._has(u),a=e._has&&e._has(u);i&&!a&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},t.updateFx=function(t){for(var e=0;e<t._fullData.length;e++)h(t,e)}}}),q_=d({"src/traces/sankey/select.js"(t,e){e.exports=function(t,e){for(var r=[],n=t.cd[0].trace,i=n._sankey.graph.nodes,a=0;a<i.length;a++){var o=i[a];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),e&&e.contains(s,!1,a,t)&&r.push({pointNumber:o.pointNumber})}}return r}}}),$_=d({"src/traces/sankey/index.js"(t,e){e.exports={attributes:S_(),supplyDefaults:A_(),calc:C_(),plot:U_(),moduleType:"trace",name:"sankey",basePlotModule:V_(),selectPoints:q_(),categories:["noOpacity"],meta:{}}}}),H_=d({"lib/sankey.js"(t,e){e.exports=$_()}}),W_=d({"src/traces/indicator/base_plot.js"(t){var e=ke();t.name="indicator",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),G_=d({"src/traces/indicator/attributes.js"(t,e){var r=D().extendFlat,n=D().extendDeep,i=Pt().overrideAll,a=R(),o=V(),s=ka().attributes,l=Ee(),c=ge().templatedArray,u=Tl(),h=Ce().descriptionOnlyNumbers,d=a({editType:"plot",colorEditType:"plot"}),p={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:o.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},f={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},m=c("step",n({},p,{range:f}));e.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:s({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:r({},d,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:h("value")},font:r({},d,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:h("value")},increasing:{symbol:{valType:"string",dflt:u.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:u.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:r({},d,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:n({},p,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:o.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:f,visible:r({},l.visible,{dflt:!0}),tickmode:l.minor.tickmode,nticks:l.nticks,tick0:l.tick0,dtick:l.dtick,tickvals:l.tickvals,ticktext:l.ticktext,ticks:r({},l.ticks,{dflt:"outside"}),ticklen:l.ticklen,tickwidth:l.tickwidth,tickcolor:l.tickcolor,ticklabelstep:l.ticklabelstep,showticklabels:l.showticklabels,labelalias:l.labelalias,tickfont:a({}),tickangle:l.tickangle,tickformat:l.tickformat,tickformatstops:l.tickformatstops,tickprefix:l.tickprefix,showtickprefix:l.showtickprefix,ticksuffix:l.ticksuffix,showticksuffix:l.showticksuffix,separatethousands:l.separatethousands,exponentformat:l.exponentformat,minexponent:l.minexponent,showexponent:l.showexponent,editType:"plot"},"plot"),steps:m,threshold:{line:{color:r({},p.line.color,{}),width:r({},p.line.width,{dflt:1}),editType:"plot"},thickness:r({},p.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}}),Y_=d({"src/traces/indicator/constants.js"(t,e){e.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),Z_=d({"src/traces/indicator/defaults.js"(t,e){var r=se(),n=G_(),i=ka().defaults,a=ge(),o=Be(),s=Y_(),l=De(),c=Re(),u=je(),h=Ne();function d(t,e){function i(i,a){return r.coerce(t,e,n.gauge.steps,i,a)}i("color"),i("line.color"),i("line.width"),i("range"),i("thickness")}e.exports={supplyDefaults:function(t,e,p,f){function m(i,a){return r.coerce(t,e,n,i,a)}i(e,f,m),m("mode"),e._hasNumber=-1!==e.mode.indexOf("number"),e._hasDelta=-1!==e.mode.indexOf("delta"),e._hasGauge=-1!==e.mode.indexOf("gauge");var g=m("value");e._range=[0,"number"===typeof g?1.5*g:1];var y,v,x=new Array(2);if(e._hasNumber){m("number.valueformat");var b=r.extendFlat({},f.font);b.size=void 0,r.coerceFont(m,"number.font",b),void 0===e.number.font.size&&(e.number.font.size=s.defaultNumberFontSize,x[0]=!0),m("number.prefix"),m("number.suffix"),y=e.number.font.size}if(e._hasDelta){var _=r.extendFlat({},f.font);_.size=void 0,r.coerceFont(m,"delta.font",_),void 0===e.delta.font.size&&(e.delta.font.size=(e._hasNumber?.5:1)*(y||s.defaultNumberFontSize),x[1]=!0),m("delta.reference",e.value),m("delta.relative"),m("delta.valueformat",e.delta.relative?"2%":""),m("delta.increasing.symbol"),m("delta.increasing.color"),m("delta.decreasing.symbol"),m("delta.decreasing.color"),m("delta.position"),m("delta.prefix"),m("delta.suffix"),v=e.delta.font.size}e._scaleNumbers=(!e._hasNumber||x[0])&&(!e._hasDelta||x[1])||!1;var w,k,T,S,A=r.extendFlat({},f.font);function M(t,e){return r.coerce(w,k,n.gauge,t,e)}function C(t,e){return r.coerce(T,S,n.gauge.axis,t,e)}if(A.size=.25*(y||v||s.defaultNumberFontSize),r.coerceFont(m,"title.font",A),m("title.text"),e._hasGauge){(w=t.gauge)||(w={}),k=a.newContainer(e,"gauge"),M("shape"),(e._isBullet="bullet"===e.gauge.shape)||m("title.align","center"),(e._isAngular="angular"===e.gauge.shape)||m("align","center"),M("bgcolor",f.paper_bgcolor),M("borderwidth"),M("bordercolor"),M("bar.color"),M("bar.line.color"),M("bar.line.width"),M("bar.thickness",s.valueThickness*("bullet"===e.gauge.shape?.5:1)),o(w,k,{name:"steps",handleItemDefaults:d}),M("threshold.value"),M("threshold.thickness"),M("threshold.line.width"),M("threshold.line.color"),T={},w&&(T=w.axis||{}),S=a.newContainer(k,"axis"),C("visible"),e._range=C("range",e._range);var E={font:f.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};l(T,S,C,"linear"),h(T,S,C,"linear",E),u(T,S,C,"linear",E),c(T,S,C,E)}else m("title.align","center"),m("align","center"),e._isAngular=e._isBullet=!1;e._length=null}}}}),X_=d({"src/traces/indicator/calc.js"(t,e){e.exports={calc:function(t,e){var r=[],n=e.value;"number"!==typeof e._lastValue&&(e._lastValue=e.value);var i=e._lastValue,a=i;return e._hasDelta&&"number"===typeof e.delta.reference&&(a=e.delta.reference),r[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},r}}}}),K_=d({"src/traces/indicator/plot.js"(t,e){var r=v(),n=(jp(),m(Dp)).interpolate,i=(jp(),m(Dp)).interpolateNumber,a=se(),o=a.strScale,s=a.strTranslate,l=a.rad2deg,c=Se().MID_SHIFT,u=Je(),h=Y_(),d=Ae(),p=nr(),f=wi(),g=ki(),y=Ee(),x=q(),b={left:"start",center:"middle",right:"end"},_={left:0,center:.5,right:1},w=/[yzafpn\xb5mkMGTPEZY]/;function k(t){return t&&t.duration>0}function T(t){t.each((function(t){x.stroke(r.select(this),t.line.color)})).each((function(t){x.fill(r.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function S(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,y,t,e)}return f(i,o,l,s,n),g(i,o,l,s),o}function A(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(d.convertToTspans,i).call(u.font,e),u.bBox(o.node())}function C(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,f,m){var g,y=t._fullLayout;k(f)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,v,E,L,P,I=e[0].trace,z=r.select(this),O=I._hasGauge,D=I._isAngular,R=I._isBullet,F=I.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},j=B.l+B.w/2,N=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=I.align||"center";if(v=N,O){if(D&&(m=j,v=N+U/2,E=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),n=e/r;return[n,t,e]}(t,.9*V)}),R){var $=h.bulletPadding,H=1-h.bulletNumberDomainSize+$;m=B.l+(H+(1-H)*_[q])*B.w,E=function(t){return A(t,(h.bulletNumberDomainSize-$)*B.w,B.h)}}}else m=B.l+_[q]*B.w,E=function(t){return A(t,B.w,B.h)};!function(t,e,n,l){var c,h,f,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",T=b[v],A=l.transitionOpts,E=l.onComplete,L=a.ensureSingle(e,"g","numbers"),P=[];m._hasNumber&&P.push("number"),m._hasDelta&&(P.push("delta"),"left"===m.delta.position&&P.reverse());var I=L.selectAll("text").data(P);function z(e,r,n,i){if(!e.match("s")||n>=0===i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=S(t,{tickformat:a});return function(t){return Math.abs(t)<1?p.tickText(o,t).text:r(t)}}function O(){var e=S(t,{tickformat:m.number.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=L.select("text.number");function h(){var e="number"===typeof n[0].y?s+a(n[0].y)+o:"-";l.text(e).call(u.font,m.number.font).call(d.convertToTspans,t)}return k(A)?l.transition().duration(A.duration).ease(A.easing).each("end",(function(){h(),E&&E()})).each("interrupt",(function(){h(),E&&E()})).attrTween("text",(function(){var t=r.select(this),e=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){t.text(s+l(e(r))+o)}})):h(),c=M(s+a(n[0].y)+o,m.number.font,T,t),l}function D(){var e=S(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!==typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},f=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=L.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(x.fill,f(n[0])).call(d.convertToTspans,t)}return g.call(u.font,m.delta.font).call(x.fill,f({delta:m._deltaLastValue})),k(A)?g.transition().duration(A.duration).ease(A.easing).tween("text",(function(){var t=r.select(this),e=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,e),u=i(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(x.fill,f({delta:u(e)}))}})).each("end",(function(){y(),E&&E()})).each("interrupt",(function(){y(),E&&E()})):y(),h=M(c(l(n[0]),a),m.delta.font,T,t),g}I.enter().append("text"),I.attr("text-anchor",(function(){return T})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var R,F=m.mode+m.align;if(m._hasDelta&&(R=D(),F+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,F+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=h),m._hasNumber&&(O(),F+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c),m._hasDelta&&m._hasNumber){var B,j,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(B=C(m,"deltaPos",0,-1*(c.width*_[m.align]+h.width*(1-_[m.align])+V),F,Math.min),j=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:h.left+B,right:c.right,top:Math.min(c.top,h.top+j),bottom:Math.max(c.bottom,h.bottom+j)}),"right"===m.delta.position&&(B=C(m,"deltaPos",0,c.width*(1-_[m.align])+h.width*_[m.align]+V,F,Math.max),j=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:c.left,right:h.right+B,top:Math.min(c.top,h.top+j),bottom:Math.max(c.bottom,h.bottom+j)}),"bottom"===m.delta.position&&(B=null,j=h.height,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(B=null,j=c.top,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),R.attr({dx:B,dy:j})}(m._hasNumber||m._hasDelta)&&L.attr("transform",(function(){var t=l.numbersScaler(f);F+=t[2];var e,r=C(m,"numbersScale",1,t[0],F,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*f.bottom:y-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+e;var n=f[v];"center"===v&&(n=(f.left+f.right)/2);var i=g-r*n;return i=C(m,"numbersTranslate",0,i,F,Math.max),s(i,e)+o(r)}))}(t,z,e,{numbersX:m,numbersY:v,numbersScaler:E,transitionOpts:f,onComplete:g}),O&&(L={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(D?e:[]);W.exit().remove();var G=z.selectAll("g.angularaxis").data(D?e:[]);G.exit().remove(),D&&function(t,e,i,a){var o,u,h,d,f=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,w=a.layer,A=a.transitionOpts,M=a.onComplete,C=Math.PI/2;function E(t){var e=f.gauge.axis.range[0],r=(t-e)/(f.gauge.axis.range[1]-e)*Math.PI-C;return r<-C?-C:r>C?C:r}function L(t){return r.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-C)}function P(t){t.attr("d",(function(t){return L(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=S(t,f.gauge.axis)).type="linear",o.range=f.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},O=p.makeLabelFns(o,0).labelStandoff;z.xFn=function(t){var e=I(t);return Math.cos(e)*O},z.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(O+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*c)},z.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return s(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};h=function(t){return D(I(t))};var R=function(t){var e=I(t);return D(e)+"rotate("+-l(e)+")"};if(u=p.calcTicks(o),d=p.getTickSigns(o)[2],o.visible){d="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;p.drawTicks(t,o,{vals:u,layer:w,path:"M"+d*F+",0h"+d*o.ticklen,transFn:R}),p.drawLabels(t,o,{vals:u,layer:w,transFn:h,labelFns:z})}var B=[v].concat(f.gauge.steps),j=_.selectAll("g.bg-arc").data(B);j.enter().append("g").classed("bg-arc",!0).append("path"),j.select("path").call(P).call(T),j.exit().remove();var N=L(f.gauge.bar.thickness),U=_.selectAll("g.value-arc").data([f.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var V,q,$,H=U.select("path");k(A)?(H.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(V=N,q=E(i[0].lastY),$=E(i[0].y),function(){var t=n(q,$);return function(e){return V.endAngle(t(e))()}})),f._lastValue=i[0].y):H.attr("d","number"===typeof i[0].y?N.endAngle(E(i[0].y)):"M0,0Z"),H.call(T),U.exit().remove(),B=[];var W=f.gauge.threshold.value;(W||0===W)&&B.push({range:[W,W],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var G=_.selectAll("g.threshold-arc").data(B);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(P).call(T),G.exit().remove();var Y=_.selectAll("g.gauge-outline").data([x]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:W,layer:G,size:B,gaugeBg:L,gaugeOutline:P,transitionOpts:f,onComplete:g});var Y=z.selectAll("g.bullet").data(R?e:[]);Y.exit().remove();var Z=z.selectAll("g.bulletaxis").data(R?e:[]);Z.exit().remove(),R&&function(t,e,r,n){var i,a,o,l,c,u=r[0].trace,d=n.gauge,f=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=u.domain,b=n.transitionOpts,_=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform",s(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,A=u.gauge.bar.thickness*w,M=v.x[0],C=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function E(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*w})).attr("height",(function(t){return t.thickness*w}))}(i=S(t,u.gauge.axis))._id="xbulletaxis",i.domain=[M,C],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(p.drawTicks(t,i,{vals:"inside"===i.ticks?p.clipEnds(i,a):a,layer:f,path:p.makeTickPath(i,c,l),transFn:o}),p.drawLabels(t,i,{vals:a,layer:f,transFn:o,labelFns:p.makeLabelFns(i,c)}));var L=[m].concat(u.gauge.steps),P=d.selectAll("g.bg-bullet").data(L);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(E).call(T),P.exit().remove();var I=d.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(w-A)/2).call(T),k(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),I.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),O=d.selectAll("g.threshold-bullet").data(z);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(x.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),O.exit().remove();var D=d.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(E).call(T),D.exit().remove()}(t,0,e,{gauge:Y,layer:Z,size:B,gaugeBg:L,gaugeOutline:P,transitionOpts:f,onComplete:g});var X=z.selectAll("text.title").data(e);X.exit().remove(),X.enter().append("text").classed("title",!0),X.attr("text-anchor",(function(){return R?b.right:b[I.title.align]})).text(I.title.text).call(u.font,I.title.font).call(d.convertToTspans,t),X.attr("transform",(function(){var t,e=B.l+B.w*_[I.title.align],r=h.titlePadding,n=u.bBox(X.node());return O?(D&&(t=I.gauge.axis.visible?u.bBox(G.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(t=v-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)):t=I._numbersTop-r-n.bottom,s(e,t)}))}))}}}),J_=d({"src/traces/indicator/index.js"(t,e){e.exports={moduleType:"trace",name:"indicator",basePlotModule:W_(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:G_(),supplyDefaults:Z_().supplyDefaults,calc:X_().calc,plot:K_(),meta:{}}}}),Q_=d({"lib/indicator.js"(t,e){e.exports=J_()}}),tw=d({"src/traces/table/attributes.js"(t,e){var r=xn(),n=D().extendFlat,i=Pt().overrideAll,a=R(),o=ka().attributes,s=Ce().descriptionOnlyNumbers;e.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}}),ew=d({"src/traces/table/defaults.js"(t,e){var r=se(),n=tw(),i=ka().defaults;e.exports=function(t,e,a,o){function s(i,a){return r.coerce(t,e,n,i,a)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s<n;s++)o.push(s);e("columnorder",o)}(e,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),r.coerceFont(s,"cells.font",o.font),e._length=null}}}),rw=d({"src/traces/table/calc.js"(t,e){var r=Ox().wrap;e.exports=function(){return r({})}}}),nw=d({"src/traces/table/constants.js"(t,e){e.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),iw=d({"src/traces/table/data_preparation_helper.js"(t,e){var r=nw(),n=D().extendFlat,i=k(),a=M().isTypedArray,o=M().isArrayOrTypedArray;function s(t){if(o(t)){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,s(t[r]));return e}return t}function l(t,e){return t+e}function c(t){var e,r=t.slice(),n=1/0,i=0;for(e=0;e<r.length;e++)a(r[e])?r[e]=Array.from(r[e]):o(r[e])||(r[e]=[r[e]]),n=Math.min(n,r[e].length),i=Math.max(i,r[e].length);if(n!==i)for(e=0;e<r.length;e++){var s=i-r[e].length;s&&(r[e]=r[e].concat(u(s)))}return r}function u(t){for(var e=new Array(t),r=0;r<t;r++)e[r]="";return e}function h(t){return t.calcdata.columns.reduce((function(e,r){return r.xIndex<t.xIndex?e+r.columnWidth:e}),0)}function d(t,e){return Object.keys(t).map((function(r){return n({},t[r],{auxiliaryBlocks:e})}))}function p(t,e){for(var r,n={},i=0,a=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,c=0;c<t.length;c++)r=t[c],o.rows.push({rowIndex:c,rowHeight:r}),((a+=r)>=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var a=c(e.cells.values),f=function(t){return t.slice(e.header.values.length,t.length)},m=c(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(f(a).map((function(){return u((m[0]||[""]).length)}))),y=e.domain,v=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),b=e.header.values.length?g[0].map((function(){return e.header.height})):[r.emptyHeaderHeight],_=a.length?a[0].map((function(){return e.cells.height})):[],w=b.reduce(l,0),k=p(_,x-w+r.uplift),T=d(p(b,w),[]),S=d(k,T),A={},M=e._fullInput.columnorder;o(M)&&(M=Array.from(M)),M=M.concat(f(a.map((function(t,e){return e}))));var C=g.map((function(t,r){var n=o(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),E=C.reduce(l,0);C=C.map((function(t){return t/E*v}));var L=Math.max(s(e.header.line.width),s(e.cells.line.width)),P={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:x,columnOrder:M,groupHeight:x,rowBlocks:S,headerRowBlocks:T,scrollY:0,cells:n({},e.cells,{values:a}),headerCells:n({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:h,x:void 0,calcdata:void 0,columnWidth:C[e]}}))};return P.columns.forEach((function(t){t.calcdata=P,t.x=h(t)})),P}}}),aw=d({"src/traces/table/data_split_helpers.js"(t){var e=D().extendFlat;t.splitToPanels=function(t){var r=[0,0],n=e({},t,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:e({},t.calcdata,{cells:t.calcdata.headerCells})});return[e({},t,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),e({},t,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}}}),ow=d({"src/traces/table/plot.js"(t,e){var r=nw(),n=v(),i=se(),a=i.numberFormat,o=Ox(),s=Je(),l=Ae(),c=se().raiseToTop,u=se().strTranslate,h=se().cancelTransition,d=iw(),p=aw(),f=q();function m(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function g(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function y(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function x(t){return[].concat.apply([],t.map((function(t){return t}))).map((function(t){return t.__data__}))}function b(t,e,i){var a=t.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return R(e,e.length-1)+(e.length?F(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-C(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom})).attr("transform",(function(t){var e=t.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(e,C(t))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(t){return u(0,t.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(t){return t.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||L(e,t,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t})).on("drag",L(e,t)).on("dragend",(function(){}))),h.attr("y2",(function(t){return t.scrollbarState.scrollableAreaHeight})),e._context.staticPlot&&(c.remove(),h.remove())}function _(t,e,i,a){var l=function(t){var e=t.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return e.enter().append("g").classed(r.cn.columnCells,!0),e.exit().remove(),e}(i),c=function(t){var e=t.selectAll("."+r.cn.columnCell).data(p.splitToCells,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.columnCell,!0),e.exit().remove(),e}(l);!function(t){t.each((function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:T(r.size,n,e),color:T(r.color,n,e),family:T(r.family,n,e),weight:T(r.weight,n,e),style:T(r.style,n,e),variant:T(r.variant,n,e),textcase:T(r.textcase,n,e),lineposition:T(r.lineposition,n,e),shadow:T(r.shadow,n,e)};t.rowNumber=t.key,t.align=T(t.calcdata.cells.align,n,e),t.cellBorderWidth=T(t.calcdata.cells.line.width,n,e),t.font=i}))}(c);var u=function(t){var e=t.selectAll("."+r.cn.cellRect).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("rect").classed(r.cn.cellRect,!0),e}(c);!function(t){t.attr("width",(function(t){return t.column.columnWidth})).attr("stroke-width",(function(t){return t.cellBorderWidth})).each((function(t){var e=n.select(this);f.stroke(e,T(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),f.fill(e,T(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(u);var h=function(t){var e=t.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(c),d=function(t){var e=t.selectAll("."+r.cn.cellText).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),e}(h);!function(t){t.each((function(t){s.font(n.select(this),t.font)}))}(d),w(d,e,a,t),D(c)}function w(t,e,i,o){t.text((function(t){var e=t.column.specIndex,n=t.rowNumber,i=t.value,o="string"===typeof i,s=o&&i.match(/<br>/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"===typeof(c=i)&&c.match(r.latexCheck);t.latex=u;var h,d,p=u?"":T(t.calcdata.cells.prefix,e,n)||"",f=u?"":T(t.calcdata.cells.suffix,e,n)||"",m=u?null:T(t.calcdata.cells.format,e,n)||null,g=p+(m?a(m)(t.value):t.value)+f;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=k(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?k(g):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/<a href=/gi,"<a_href="):g).split(r.wrapSplitCharacter),v=" "===r.wrapSplitCharacter?y.map((function(t){return t.replace(/<a_href=/gi,"<a href=")})):y;t.fragments=v.map((function(t){return{text:t,width:null}})),t.fragments.push({fragment:r.wrapSpacer,width:null}),d=v.join(r.lineBreaker)+r.lineBreaker+r.wrapSpacer}else delete t.fragments,d=g;return d})).attr("dy",(function(t){return t.needsConvertToTspans?0:"0.75em"})).each((function(t){var a=this,s=n.select(a),c=t.wrappingNeeded?I:z;t.needsConvertToTspans?l.convertToTspans(s,o,c(i,a,e,o,t)):n.select(a.parentNode).attr("transform",(function(t){return u(O(t),r.cellPad)})).attr("text-anchor",(function(t){return{left:"start",center:"middle",right:"end"}[t.align]}))}))}function k(t){return-1!==t.indexOf(r.wrapSplitCharacter)}function T(t,e,r){if(i.isArrayOrTypedArray(t)){var n=t[Math.min(e,t.length-1)];return i.isArrayOrTypedArray(n)?n[Math.min(r,n.length-1)]:n}return t}function S(t,e,n){t.transition().ease(r.releaseTransitionEase).duration(r.releaseTransitionDuration).attr("transform",u(e.x,n))}function A(t){return"cells"===t.type}function M(t){return"header"===t.type}function C(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce((function(t,e){return t+F(e,1/0)}),0)}function E(t,e,r){var n=x(e)[0];if(void 0!==n){var i=n.rowBlocks,a=n.calcdata,o=R(i,i.length),s=n.calcdata.groupHeight-C(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),c=function(t,e,r){for(var n=[],i=0,a=0;a<t.length;a++){for(var o=t[a],s=o.rows,l=0,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,e<i+l&&e+r>i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(P(t,r,e,c,n.prevPages,n,0),P(t,r,e,c,n.prevPages,n,1),b(r,t))}}function L(t,e,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(A);return E(t,h,l),s.scrollY===u}}function P(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));_(t,e,a,r),i[o]=n[o]})))}function I(t,e,i,a){return function(){var o=n.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var n,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(t.value+=l.join(r.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,t,a),n.select(e.parentNode.parentNode).call(D)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=j(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,d=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(d,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+r.cn.columnCell).call(D),E(null,t.filter(A),0),b(i,a,!0)),s.attr("transform",(function(){var t=this,e=t.parentNode.getBoundingClientRect(),i=n.select(t.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=i.top-e.top+(a?a.matrix.f:r.cellPad);return u(O(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":default:return r.cellPad;case"right":return t.column.columnWidth-(e||0)-r.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function D(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+F(e,1/0)}),0),r=F(j(t),t.key);return u(0,r+e)})).selectAll("."+r.cn.cellRect).attr("height",(function(t){return(e=j(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function R(t,e){for(var r=0,n=e-1;n>=0;n--)r+=B(t[n]);return r}function F(t,e){for(var r=0,n=0;n<t.rows.length&&t.rows[n].rowIndex<e;n++)r+=t.rows[n].rowHeight;return r}function B(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n<t.rows.length;n++)r+=t.rows[n].rowHeight;return t.allRowsHeight=r,r}function j(t){return t.rowBlocks[t.page]}e.exports=function(t,e){var i=!t._context.staticPlot,a=t._fullLayout._paper.selectAll("."+r.cn.table).data(e.map((function(e){var r=o.unwrap(e).trace;return d(t,r)})),o.keyFun);a.exit().remove(),a.enter().append("g").classed(r.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),a.attr("width",(function(t){return t.width+t.size.l+t.size.r})).attr("height",(function(t){return t.height+t.size.t+t.size.b})).attr("transform",(function(t){return u(t.translateX,t.translateY)}));var l=a.selectAll("."+r.cn.tableControlView).data(o.repeat,o.keyFun),f=l.enter().append("g").classed(r.cn.tableControlView,!0).style("box-sizing","content-box");if(i){var v="onwheel"in document?"wheel":"mousewheel";f.on("mousemove",(function(e){l.filter((function(t){return e===t})).call(b,t)})).on(v,(function(e){if(!e.scrollbarState.wheeling){e.scrollbarState.wheeling=!0;var r=e.scrollY+n.event.deltaY;L(t,l,null,r)(e)||(n.event.stopPropagation(),n.event.preventDefault()),e.scrollbarState.wheeling=!1}})).call(b,t,!0)}l.attr("transform",(function(t){return u(t.size.l,t.size.t)}));var w=l.selectAll("."+r.cn.scrollBackground).data(o.repeat,o.keyFun);w.enter().append("rect").classed(r.cn.scrollBackground,!0).attr("fill","none"),w.attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),l.each((function(e){s.setClipUrl(n.select(this),g(t,e),t)}));var k=l.selectAll("."+r.cn.yColumn).data((function(t){return t.columns}),o.keyFun);k.enter().append("g").classed(r.cn.yColumn,!0),k.exit().remove(),k.attr("transform",(function(t){return u(t.x,0)})),i&&k.call(n.behavior.drag().origin((function(e){return S(n.select(this),e,-r.uplift),c(this),e.calcdata.columnDragInProgress=!0,b(l.filter((function(t){return e.calcdata.key===t.key})),t),e})).on("drag",(function(t){var e=n.select(this),i=function(e){return(t===e?n.event.x:e.x)+e.columnWidth/2};t.x=Math.max(-r.overdrag,Math.min(t.calcdata.width+r.overdrag-t.columnWidth,n.event.x)),x(k).filter((function(e){return e.calcdata.key===t.calcdata.key})).sort((function(t,e){return i(t)-i(e)})).forEach((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e)})),k.filter((function(e){return t!==e})).transition().ease(r.transitionEase).duration(r.transitionDuration).attr("transform",(function(t){return u(t.x,0)})),e.call(h).attr("transform",u(t.x,-r.uplift))})).on("dragend",(function(e){var r=n.select(this),i=e.calcdata;e.x=e.xScale(e),e.calcdata.columnDragInProgress=!1,S(r,e,0),function(t,e,r){var n=e.gdColumnsOriginalOrder;e.gdColumns.sort((function(t,e){return r[n.indexOf(t)]-r[n.indexOf(e)]})),e.columnorder=r,t.emit("plotly_restyle")}(t,i,i.columns.map((function(t){return t.xIndex})))}))),k.each((function(e){s.setClipUrl(n.select(this),y(t,e),t)}));var T=k.selectAll("."+r.cn.columnBlock).data(p.splitToPanels,o.keyFun);T.enter().append("g").classed(r.cn.columnBlock,!0).attr("id",(function(t){return t.key})),T.style("cursor",(function(t){return t.dragHandle?"ew-resize":t.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var C=T.filter(M),P=T.filter(A);i&&P.call(n.behavior.drag().origin((function(t){return n.event.stopPropagation(),t})).on("drag",L(t,l,-1)).on("dragend",(function(){}))),_(t,l,C,T),_(t,l,P,T);var I=l.selectAll("."+r.cn.scrollAreaClip).data(o.repeat,o.keyFun);I.enter().append("clipPath").classed(r.cn.scrollAreaClip,!0).attr("id",(function(e){return g(t,e)}));var z=I.selectAll("."+r.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);z.enter().append("rect").classed(r.cn.scrollAreaClipRect,!0).attr("x",-r.overdrag).attr("y",-r.uplift).attr("fill","none"),z.attr("width",(function(t){return t.width+2*r.overdrag})).attr("height",(function(t){return t.height+r.uplift})),k.selectAll("."+r.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append("g").classed(r.cn.columnBoundary,!0);var O=k.selectAll("."+r.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);O.enter().append("clipPath").classed(r.cn.columnBoundaryClippath,!0),O.attr("id",(function(e){return y(t,e)}));var D=O.selectAll("."+r.cn.columnBoundaryRect).data(o.repeat,o.keyFun);D.enter().append("rect").classed(r.cn.columnBoundaryRect,!0).attr("fill","none"),D.attr("width",(function(t){return t.columnWidth+2*m(t)})).attr("height",(function(t){return t.calcdata.height+2*m(t)+r.uplift})).attr("x",(function(t){return-m(t)})).attr("y",(function(t){return-m(t)})),E(null,P,l)}}}),sw=d({"src/traces/table/base_plot.js"(t){var e=_e().getModuleCalcData,r=ow(),n="table";t.name=n,t.plot=function(t){var i=e(t.calcdata,n)[0];i.length&&r(t,i)},t.clean=function(t,e,r,i){var a=i._has&&i._has(n),o=e._has&&e._has(n);a&&!o&&i._paperdiv.selectAll(".table").remove()}}}),lw=d({"src/traces/table/index.js"(t,e){e.exports={attributes:tw(),supplyDefaults:ew(),calc:rw(),plot:ow(),moduleType:"trace",name:"table",basePlotModule:sw(),categories:["noOpacity"],meta:{}}}}),cw=d({"lib/table.js"(t,e){e.exports=lw()}}),uw=d({"src/traces/carpet/axis_attributes.js"(t,e){var r=R(),n=V(),i=Ee(),a=Ce().descriptionWithDates,o=Pt().overrideAll,s=It().dash,l=D().extendFlat;e.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:r({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:i.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:l({},i.labelalias,{editType:"calc"}),tickfont:r({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:a("tick label")},tickformatstops:o(i.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:l({},s,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:l({},s,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:n.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}}),hw=d({"src/traces/carpet/attributes.js"(t,e){var r=R(),n=uw(),i=V(),a=r({editType:"calc"}),o=wn().zorder;a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=i.defaultLine,e.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:n,baxis:n,font:a,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},zorder:o}}}),dw=d({"src/traces/carpet/xy_defaults.js"(t,e){var r=se().isArray1D;e.exports=function(t,e,n){var i=n("x"),a=i&&i.length,o=n("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!r(i)||s&&!r(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}}}),pw=d({"src/traces/carpet/axis_defaults.js"(t,e){var r=hw(),n=q().addOpacity,i=Vt(),a=se(),o=De(),s=je(),l=Ne(),c=bi(),u=tr(),h=er();e.exports=function(t,e,d){var p=d.letter,f=d.font||{},m=r[p+"axis"];function g(r,n){return a.coerce(t,e,m,r,n)}function y(r,n){return a.coerce2(t,e,m,r,n)}d.name&&(e._name=d.name,e._id=d.name),g("autotypenumbers",d.autotypenumbersDflt);var v=g("type");"-"===v&&(d.data&&function(t,e){if("-"===t.type){var r=t._id.charAt(0),n=t[r+"calendar"];t.type=h(e,n,{autotypenumbers:t.autotypenumbers})}}(e,d.data),"-"===e.type?e.type="linear":v=t.type=e.type),g("smoothing"),g("cheatertype"),g("showticklabels"),g("labelprefix",p+" = "),g("labelsuffix"),g("showtickprefix"),g("showticksuffix"),g("separatethousands"),g("tickformat"),g("exponentformat"),g("minexponent"),g("showexponent"),g("categoryorder"),g("tickmode"),g("tickvals"),g("ticktext"),g("tick0"),g("dtick"),"array"===e.tickmode&&(g("arraytick0"),g("arraydtick")),g("labelpadding"),e._hovertitle=p,"date"===v&&i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",d.calendar),u(e,d.fullLayout),e.c2p=a.identity;var x=g("color",d.dfltColor),b=x===t.color?x:f.color;g("title.text")&&(a.coerceFont(g,"title.font",f,{overrideDflt:{size:a.bigFont(f.size),color:b}}),g("title.offset")),g("tickangle"),g("autorange",!e.isValidRange(t.range))&&g("rangemode"),g("range"),e.cleanRange(),g("fixedrange"),o(t,e,g,v),l(t,e,g,v,d),s(t,e,g,v,d),c(t,e,g,{data:d.data,dataAttr:p});var _=y("gridcolor",n(x,.3)),w=y("gridwidth"),k=y("griddash"),T=g("showgrid");T||(delete e.gridcolor,delete e.gridwidth,delete e.griddash);var S=y("startlinecolor",x),A=y("startlinewidth",w);g("startline",e.showgrid||!!S||!!A)||(delete e.startlinecolor,delete e.startlinewidth);var M=y("endlinecolor",x),C=y("endlinewidth",w);return g("endline",e.showgrid||!!M||!!C)||(delete e.endlinecolor,delete e.endlinewidth),T?(g("minorgridcount"),g("minorgridwidth",w),g("minorgriddash",k),g("minorgridcolor",n(_,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgriddash,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridwidth,delete e.griddash),"none"===e.showticklabels&&(delete e.tickfont,delete e.tickangle,delete e.showexponent,delete e.exponentformat,delete e.minexponent,delete e.tickformat,delete e.showticksuffix,delete e.showtickprefix),e.showticksuffix||delete e.ticksuffix,e.showtickprefix||delete e.tickprefix,g("tickmode"),e}}}),fw=d({"src/traces/carpet/ab_defaults.js"(t,e){var r=pw(),n=ge();e.exports=function(t,e,i,a,o){a("a")||(a("da"),a("a0")),a("b")||(a("db"),a("b0")),function(t,e,i,a){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=t[o]||{},c=n.newContainer(e,o),u={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:s+"axis",letter:s,font:e.font,name:o,data:t[s],calendar:e.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i};r(l,c,u),c._categories=c._categories||[],t[o]||"-"===l.type||(t[o]={type:l.type})}))}(t,e,i,o)}}}),mw=d({"src/traces/carpet/defaults.js"(t,e){var r=se(),n=dw(),i=fw(),a=hw(),o=V();e.exports=function(t,e,s,l){function c(n,i){return r.coerce(t,e,a,n,i)}e._clipPathId="clip"+e.uid+"carpet";var u=c("color",o.defaultLine);r.coerceFont(c,"font",l.font),c("carpet"),i(t,e,l,c,u),e.a&&e.b?(e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0),n(t,e,c)||(e.visible=!1),e._cheater&&c("cheaterslope"),c("zorder")):e.visible=!1}}}),gw=d({"src/traces/carpet/map_1d_array.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n){var i;for(r(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],i=0;i<e.length;i++)t[i]=n(e[i]);return t}}}),yw=d({"src/traces/carpet/makepath.js"(t,e){e.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+","+e[n]),r&&n<t.length-a&&(i.push("C"),i.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return i.join(r?"":"L")}}}),vw=d({"src/traces/carpet/orient_text.js"(t,e){e.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,c=1;if(a){var u=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),d=(i[0]*a[0]+i[1]*a[1])/u/h;c=Math.max(0,d)}var p=180*Math.atan2(s,o)/Math.PI;return p<-90?(p+=180,l=-l):p>90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}}}),xw=d({"src/traces/carpet/plot.js"(t,e){var r=v(),n=Je(),i=gw(),a=yw(),o=vw(),s=Ae(),l=se(),c=l.strRotate,u=l.strTranslate,h=Se();function d(t,e,o,s,l,c,u){var h="const-"+l+"-lines",d=o.selectAll("."+h).data(c);d.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),d.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,t.c2p),h=i([],c,e.c2p),d="M"+a(u,h,s.smoothing);r.select(this).attr("d",d).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),d.exit().remove()}function p(t,e,i,a,l,h,d,p){var f=h.selectAll("text."+p).data(d);f.enter().append("text").classed(p,!0);var m=0,g={};return f.each((function(l,h){var d;if("auto"===l.axis.tickangle)d=o(a,e,i,l.xy,l.dxy);else{var p=(l.axis.tickangle+180)*Math.PI/180;d=o(a,e,i,l.xy,[Math.cos(p),Math.sin(p)])}h||(g={angle:d.angle,flip:d.flip});var f=(l.endAnchor?-1:1)*d.flip,y=r.select(this).attr({"text-anchor":f>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,t),v=n.bBox(this);y.attr("transform",u(d.p[0],d.p[1])+c(d.angle)+u(l.axis.labelpadding*f,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),f.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,n,s){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis,f=t._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(e){var n=r.select(this),s=e[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),b=l.ensureSingle(n,"g","majorlayer"),_=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),d(u,h,b,0,"a",y._gridlines,!0),d(u,h,b,0,"b",v._gridlines,!0),d(u,h,x,0,"a",y._minorgridlines,!0),d(u,h,x,0,"b",v._minorgridlines,!0),d(u,h,_,0,"a-boundary",y._boundarylines,c),d(u,h,_,0,"b-boundary",v._boundarylines,c);var k=p(t,u,h,m,0,w,y._labels,"a-label"),T=p(t,u,h,m,0,w,v._labels,"b-label");!function(t,e,r,n,i,a,s,c){var u,h,d,p,f=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(f+m),h=y,d=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,d,r.dxydb_rough(u,h))),g(t,e,r,0,d,p,r.aaxis,i,a,s,"a-title"),u=f,h=.5*(y+v),d=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,d,r.dxyda_rough(u,h))),g(t,e,r,0,d,p,r.baxis,i,a,c,"b-title")}(t,w,m,0,u,h,k,T),function(t,e,r,n,o){var s,c,u,h,d=r.select("#"+t._clipPathId);d.size()||(d=r.append("clipPath").classed("carpetclip",!0));var p=l.ensureSingle(d,"path","carpetboundary"),f=e.clipsegments,m=[];for(h=0;h<f.length;h++)s=f[h],c=i([],s.x,n.c2p),u=i([],s.y,o.c2p),m.push(a(c,u,s.bicubic));var g="M"+m.join("L")+"Z";d.attr("id",t._clipPathId),p.attr("d",g)}(m,s,f,u,h)}))};var f=h.LINE_SPACING,m=(1-h.MID_SHIFT)/f+1;function g(t,e,i,a,l,h,d,p,g,y,v){var x=[];d.title.text&&x.push(d.title.text);var b=e.selectAll("text."+v).data(x),_=y.maxExtent;b.enter().append("text").classed(v,!0),b.each((function(){var e=o(i,p,g,l,h);-1===["start","both"].indexOf(d.showticklabels)&&(_=0);var a=d.title.font.size;_+=a+d.title.offset;var v=(y.angle+(y.flip<0?180:0)-e.angle+450)%360,x=v>90&&v<270,b=r.select(this);b.text(d.title.text).call(s.convertToTspans,t),x&&(_=(-s.lineCount(b)+m)*f*a-_),b.attr("transform",u(e.p[0],e.p[1])+c(e.angle)+u(0,_)).attr("text-anchor","middle").call(n.font,d.title.font)})),b.exit().remove()}}}),bw=d({"src/traces/carpet/cheater_basis.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,c,u=[],h=r(t)?t.length:t,d=r(e)?e.length:e,p=r(t)?t:null,f=r(e)?e:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(h-1)),f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(d-1));var m=1/0,g=-1/0;for(a=0;a<d;a++)for(u[a]=[],l=f?(f[a]-f[0])*s:a/(d-1),i=0;i<h;i++)c=(p?(p[i]-p[0])*o:i/(h-1))-l*n,m=Math.min(c,m),g=Math.max(c,g),u[a][i]=c;var y=1/(g-m),v=-m*y;for(a=0;a<d;a++)for(i=0;i<h;i++)u[a][i]=y*u[a][i]+v;return u}}}),_w=d({"src/traces/carpet/array_minmax.js"(t,e){var r=se().isArrayOrTypedArray;function n(t,e){if(!r(t)||e>=10)return null;for(var i=1/0,a=-1/0,o=t.length,s=0;s<o;s++){var l=t[s];if(r(l)){var c=n(l,e+1);c&&(i=Math.min(c[0],i),a=Math.max(c[1],a))}else i=Math.min(l,i),a=Math.max(l,a)}return[i,a]}e.exports=function(t){return n(t,0)}}}),ww=d({"src/traces/carpet/calc_gridlines.js"(t,e){var r=nr(),n=D().extendFlat;e.exports=function(t,e,i){var a,o,s,l,c,u,h,d,p,f,m,g,y,v,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],T=t["_"+i],S=t[i+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var A=t._xctrl,M=t._yctrl,C=A[0].length,E=A.length,L=t._a.length,P=t._b.length;r.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function z(r){var n,a,o,s,l,c,u,h,p,f,m,g,y=[],v=[],x={};if("b"===e)for(a=t.b2j(r),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=L,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n<L;n++)c=Math.min(L-2,n),u=n-c,h=t.evalxy([],n,a),S.smoothing&&n>0&&(p=t.dxydi([],n-1,o,0,s),y.push(l[0]+p[0]/3),v.push(l[1]+p[1]/3),f=t.dxydi([],n-1,o,1,s),y.push(h[0]-f[0]/3),v.push(h[1]-f[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=t.a2i(r),c=Math.floor(Math.max(0,Math.min(L-2,n))),u=n-c,x.length=L,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a<P;a++)o=Math.min(P-2,a),s=a-o,h=t.evalxy([],n,a),S.smoothing&&a>0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=e,x.axis=b,x.crossAxis=S,x.value=r,x.constvar=i,x.index=d,x.x=y,x.y=v,x.smoothing=S.smoothing,x}function O(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=T.length,"b"===e)for(o=Math.max(0,Math.min(P-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(e){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;n<C;n++)c[n]=A[r*I][n],u[n]=M[r*I][n];else for(a=Math.max(0,Math.min(L-2,r)),s=Math.min(1,Math.max(0,r-a)),h.xy=function(e){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydj([],a,e,s,r)},n=0;n<E;n++)c[n]=A[n][r*I],u[n]=M[n][r*I];return h.axisLetter=e,h.axis=b,h.crossAxis=S,h.value=x[r],h.constvar=i,h.index=r,h.x=c,h.y=u,h.smoothing=S.smoothing,h}if("array"===b.tickmode){for(l=5e-15,u=(c=[Math.floor((x.length-1-b.arraytick0)/b.arraydtick*(1+l)),Math.ceil(-b.arraytick0/b.arraydtick/(1+l))].sort((function(t,e){return t-e})))[0]-1,h=c[1]+1,d=u;d<h;d++)(o=b.arraytick0+b.arraydtick*d)<0||o>x.length-1||_.push(n(O(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=u;d<h;d++)if(s=b.arraytick0+b.arraydtick*d,m=Math.min(s+b.arraydtick,x.length-1),!(s<0||s>x.length-1)&&!(m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<b.minorgridcount;a++)(v=m-s)<=0||(f=g+(y-g)*(a+1)/(b.minorgridcount+1)*(b.arraydtick/v))<x[0]||f>x[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],d=u;d<=h;d++)p=b.tick0+b.dtick*d,_.push(n(z(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=u-1;d<h+1;d++)for(p=b.tick0+b.dtick*d,a=0;a<b.minorgridcount;a++)(f=p+b.dtick*(a+1)/(b.minorgridcount+1))<x[0]||f>x[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}}}),kw=d({"src/traces/carpet/calc_labels.js"(t,e){var r=nr(),n=D().extendFlat;e.exports=function(t,e){var i,a,o,s=e._labels=[],l=e._gridlines;for(i=0;i<l.length;i++)o=l[i],-1!==["start","both"].indexOf(e.showticklabels)&&(a=r.tickText(e,o.value),n(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a)),-1!==["end","both"].indexOf(e.showticklabels)&&(a=r.tickText(e,o.value),n(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a))}}}),Tw=d({"src/traces/carpet/calc_clippath.js"(t,e){e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=u;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=t[i][u],o[i]=e[i][u];for(s.push({x:a,y:o,bicubic:c}),i=u,a=[],o=[];i>=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Sw=d({"src/traces/carpet/smooth_fill_2d_array.js"(t,e){var r=se();e.exports=function(t,e,n){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function h(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<c-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<u-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}var d,p,f,m,g,y,v,x,b,_,w,k=0;for(i=0;i<c;i++)for(a=0;a<u;a++)void 0===t[a][i]&&(s.push(i),l.push(a),t[a][i]=h(i,a)),k=Math.max(k,Math.abs(t[a][i]));if(!s.length)return t;var T=0,S=0,A=s.length;do{for(T=0,o=0;o<A;o++){i=s[o],a=l[o];var M,C,E,L,P,I,z=0,O=0;0===i?(E=e[P=Math.min(c-1,2)],L=e[1],M=t[a][P],O+=(C=t[a][1])+(C-M)*(e[0]-L)/(L-E),z++):i===c-1&&(E=e[P=Math.max(0,c-3)],L=e[c-2],M=t[a][P],O+=(C=t[a][c-2])+(C-M)*(e[c-1]-L)/(L-E),z++),(0===i||i===c-1)&&a>0&&a<u-1&&(d=n[a+1]-n[a],O+=((p=n[a]-n[a-1])*t[a+1][i]+d*t[a-1][i])/(p+d),z++),0===a?(E=n[I=Math.min(u-1,2)],L=n[1],M=t[I][i],O+=(C=t[1][i])+(C-M)*(n[0]-L)/(L-E),z++):a===u-1&&(E=n[I=Math.max(0,u-3)],L=n[u-2],M=t[I][i],O+=(C=t[u-2][i])+(C-M)*(n[u-1]-L)/(L-E),z++),(0===a||a===u-1)&&i>0&&i<c-1&&(d=e[i+1]-e[i],O+=((p=e[i]-e[i-1])*t[a][i+1]+d*t[a][i-1])/(p+d),z++),z?O/=z:(f=e[i+1]-e[i],m=e[i]-e[i-1],x=(g=n[a+1]-n[a])*(y=n[a]-n[a-1])*(g+y),O=((v=f*m*(f+m))*(y*t[a+1][i]+g*t[a-1][i])+x*(m*t[a][i+1]+f*t[a][i-1]))/(x*(m+f)+v*(y+g))),T+=(_=(b=O-t[a][i])/k)*_,w=z?0:.85,t[a][i]+=b*(1+w)}T=Math.sqrt(T)}while(S++<100&&T>1e-5);return r.log("Smoother converged to",T,"after",S,"iterations"),t}}}),Aw=d({"src/traces/carpet/constants.js"(t,e){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Mw=d({"src/traces/carpet/catmull_rom.js"(t,e){e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,d=c*(l+c)*3,p=l*(l+c)*3;return[[e[0]+(d&&u/d),e[1]+(d&&h/d)],[e[0]-(p&&u/p),e[1]-(p&&h/p)]]}}}),Cw=d({"src/traces/carpet/compute_control_points.js"(t,e){var r=Mw(),n=se().ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,a,o,s,l){var c,u,h,d,p,f,m,g,y,v,x=a[0].length,b=a.length,_=s?3*x-2:x,w=l?3*b-2:b;for(t=n(t,w),e=n(e,w),h=0;h<w;h++)t[h]=n(t[h],_),e[h]=n(e[h],_);for(u=0,d=0;u<b;u++,d+=l?3:1)for(p=t[d],f=e[d],m=a[u],g=o[u],c=0,h=0;c<x;c++,h+=s?3:1)p[h]=m[c],f[h]=g[c];if(s)for(u=0,d=0;u<b;u++,d+=l?3:1){for(c=1,h=3;c<x-1;c++,h+=3)y=r([a[u][c-1],o[u][c-1]],[a[u][c],o[u][c]],[a[u][c+1],o[u][c+1]],s),t[d][h-1]=y[0][0],e[d][h-1]=y[0][1],t[d][h+1]=y[1][0],e[d][h+1]=y[1][1];v=i([t[d][0],e[d][0]],[t[d][2],e[d][2]],[t[d][3],e[d][3]]),t[d][1]=v[0],e[d][1]=v[1],v=i([t[d][_-1],e[d][_-1]],[t[d][_-3],e[d][_-3]],[t[d][_-4],e[d][_-4]]),t[d][_-2]=v[0],e[d][_-2]=v[1]}if(l)for(h=0;h<_;h++){for(d=3;d<w-3;d+=3)y=r([t[d-3][h],e[d-3][h]],[t[d][h],e[d][h]],[t[d+3][h],e[d+3][h]],l),t[d-1][h]=y[0][0],e[d-1][h]=y[0][1],t[d+1][h]=y[1][0],e[d+1][h]=y[1][1];v=i([t[0][h],e[0][h]],[t[2][h],e[2][h]],[t[3][h],e[3][h]]),t[1][h]=v[0],e[1][h]=v[1],v=i([t[w-1][h],e[w-1][h]],[t[w-3][h],e[w-3][h]],[t[w-4][h],e[w-4][h]]),t[w-2][h]=v[0],e[w-2][h]=v[1]}if(s&&l)for(d=1;d<w;d+=(d+1)%3===0?2:1){for(h=3;h<_-3;h+=3)y=r([t[d][h-3],e[d][h-3]],[t[d][h],e[d][h]],[t[d][h+3],e[d][h+3]],s),t[d][h-1]=.5*(t[d][h-1]+y[0][0]),e[d][h-1]=.5*(e[d][h-1]+y[0][1]),t[d][h+1]=.5*(t[d][h+1]+y[1][0]),e[d][h+1]=.5*(e[d][h+1]+y[1][1]);v=i([t[d][0],e[d][0]],[t[d][2],e[d][2]],[t[d][3],e[d][3]]),t[d][1]=.5*(t[d][1]+v[0]),e[d][1]=.5*(e[d][1]+v[1]),v=i([t[d][_-1],e[d][_-1]],[t[d][_-3],e[d][_-3]],[t[d][_-4],e[d][_-4]]),t[d][_-2]=.5*(t[d][_-2]+v[0]),e[d][_-2]=.5*(e[d][_-2]+v[1])}return[t,e]}}}),Ew=d({"src/traces/carpet/create_spline_evaluator.js"(t,e){e.exports=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){var i,s,l,c,u,h;e||(e=[]);var d=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-p));d*=3,p*=3;var g=f*f,y=g*f,v=1-f,x=v*v,b=x*v,_=m*m,w=_*m,k=1-m,T=k*k,S=T*k;for(h=0;h<t.length;h++)i=b*(u=t[h])[p][d]+3*(x*f*u[p][d+1]+v*g*u[p][d+2])+y*u[p][d+3],s=b*u[p+1][d]+3*(x*f*u[p+1][d+1]+v*g*u[p+1][d+2])+y*u[p+1][d+3],l=b*u[p+2][d]+3*(x*f*u[p+2][d+1]+v*g*u[p+2][d+2])+y*u[p+2][d+3],c=b*u[p+3][d]+3*(x*f*u[p+3][d+1]+v*g*u[p+3][d+2])+y*u[p+3][d+3],e[h]=S*i+3*(T*m*s+k*_*l)+w*c;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,c,u,h,d=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-p));d*=3;var g=f*f,y=g*f,v=1-f,x=v*v,b=x*v,_=1-m;for(u=0;u<t.length;u++)i=_*(h=t[u])[p][d]+m*h[p+1][d],s=_*h[p][d+1]+m*h[p+1][d+1],l=_*h[p][d+2]+m*h[p+1][d+1],c=_*h[p][d+3]+m*h[p+1][d+1],e[u]=b*i+3*(x*f*s+v*g*l)+y*c;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,c,u,h,d=Math.max(0,Math.min(Math.floor(r),a)),p=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-d)),m=Math.max(0,Math.min(1,n-p));p*=3;var g=m*m,y=g*m,v=1-m,x=v*v,b=x*v,_=1-f;for(u=0;u<t.length;u++)i=_*(h=t[u])[p][d]+f*h[p][d+1],s=_*h[p+1][d]+f*h[p+1][d+1],l=_*h[p+2][d]+f*h[p+2][d+1],c=_*h[p+3][d]+f*h[p+3][d+1],e[u]=b*i+3*(x*m*s+v*g*l)+y*c;return e}:function(e,r,n){e||(e=[]);var i,s,l,c,u=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),d=Math.max(0,Math.min(1,r-u)),p=Math.max(0,Math.min(1,n-h)),f=1-p,m=1-d;for(l=0;l<t.length;l++)i=m*(c=t[l])[h][u]+d*c[h][u+1],s=m*c[h+1][u]+d*c[h+1][u+1],e[l]=f*i+p*s;return e}}}}),Lw=d({"src/traces/carpet/create_i_derivative_evaluator.js"(t,e){e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),r*=3,n*=3;var d=i*i,p=1-i,f=p*p,m=p*i*2,g=-3*f,y=3*(f-m),v=3*(m-d),x=3*d,b=a*a,_=b*a,w=1-a,k=w*w,T=k*w;for(h=0;h<t.length;h++)o=g*(u=t[h])[n][r]+y*u[n][r+1]+v*u[n][r+2]+x*u[n][r+3],s=g*u[n+1][r]+y*u[n+1][r+1]+v*u[n+1][r+2]+x*u[n+1][r+3],l=g*u[n+2][r]+y*u[n+2][r+1]+v*u[n+2][r+2]+x*u[n+2][r+3],c=g*u[n+3][r]+y*u[n+3][r+1]+v*u[n+3][r+2]+x*u[n+3][r+3],e[h]=T*o+3*(k*a*s+w*b*l)+_*c;return e}:e?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),r*=3;var u=i*i,h=1-i,d=h*h,p=h*i*2,f=-3*d,m=3*(d-p),g=3*(p-u),y=3*u,v=1-a;for(l=0;l<t.length;l++)o=f*(c=t[l])[n][r]+m*c[n][r+1]+g*c[n][r+2]+y*c[n][r+3],s=f*c[n+1][r]+m*c[n+1][r+1]+g*c[n+1][r+2]+y*c[n+1][r+3],e[l]=v*o+a*s;return e}:r?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),n*=3;var d=a*a,p=d*a,f=1-a,m=f*f,g=m*f;for(u=0;u<t.length;u++)o=(h=t[u])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],c=h[n+3][r+1]-h[n+3][r],e[u]=g*o+3*(m*a*s+f*d*l)+p*c;return e}:function(e,r,n,i,a){var o,s,l,c;e||(e=[]);var u=1-a;for(l=0;l<t.length;l++)o=(c=t[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],e[l]=u*o+a*s;return e}}}}),Pw=d({"src/traces/carpet/create_j_derivative_evaluator.js"(t,e){e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),r*=3,n*=3;var d=i*i,p=d*i,f=1-i,m=f*f,g=m*f,y=a*a,v=1-a,x=v*v,b=v*a*2,_=-3*x,w=3*(x-b),k=3*(b-y),T=3*y;for(h=0;h<t.length;h++)o=_*(u=t[h])[n][r]+w*u[n+1][r]+k*u[n+2][r]+T*u[n+3][r],s=_*u[n][r+1]+w*u[n+1][r+1]+k*u[n+2][r+1]+T*u[n+3][r+1],l=_*u[n][r+2]+w*u[n+1][r+2]+k*u[n+2][r+2]+T*u[n+3][r+2],c=_*u[n][r+3]+w*u[n+1][r+3]+k*u[n+2][r+3]+T*u[n+3][r+3],e[h]=g*o+3*(m*i*s+f*d*l)+p*c;return e}:e?function(e,r,n,i,a){var o,s,l,c,u,h;e||(e=[]),r*=3;var d=a*a,p=d*a,f=1-a,m=f*f,g=m*f;for(u=0;u<t.length;u++)o=(h=t[u])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],c=h[n+1][r+3]-h[n][r+3],e[u]=g*o+3*(m*a*s+f*d*l)+p*c;return e}:r?function(e,r,n,i,a){var o,s,l,c;e||(e=[]),n*=3;var u=1-i,h=a*a,d=1-a,p=d*d,f=d*a*2,m=-3*p,g=3*(p-f),y=3*(f-h),v=3*h;for(l=0;l<t.length;l++)o=m*(c=t[l])[n][r]+g*c[n+1][r]+y*c[n+2][r]+v*c[n+3][r],s=m*c[n][r+1]+g*c[n+1][r+1]+y*c[n+2][r+1]+v*c[n+3][r+1],e[l]=u*o+i*s;return e}:function(e,r,n,i,a){var o,s,l,c;e||(e=[]);var u=1-i;for(l=0;l<t.length;l++)o=(c=t[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],e[l]=u*o+i*s;return e}}}}),Iw=d({"src/traces/carpet/set_convert.js"(t,e){var r=Aw(),n=Ht().findBin,i=Cw(),a=Ew(),o=Lw(),s=Pw();e.exports=function(t){var e=t._a,l=t._b,c=e.length,u=l.length,h=t.aaxis,d=t.baxis,p=e[0],f=e[c-1],m=l[0],g=l[u-1],y=e[e.length-1]-e[0],v=l[l.length-1]-l[0],x=y*r.RELATIVE_CULL_TOLERANCE,b=v*r.RELATIVE_CULL_TOLERANCE;p-=x,f+=x,m-=b,g+=b,t.isVisible=function(t,e){return t>p&&t<f&&e>m&&e<g},t.isOccluded=function(t,e){return t<p||t>f||e<m||e>g},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,d.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=a([t._xctrl,t._yctrl],c,u,h.smoothing,d.smoothing),t.dxydi=o([t._xctrl,t._yctrl],h.smoothing,d.smoothing),t.dxydj=s([t._xctrl,t._yctrl],h.smoothing,d.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),r=t[1]-e;return(1-r)*l[e]+r*l[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(n(t,e),c-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),u-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(u-1,e+(t-r)/(i-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(r,n,i){if(!i&&(r<e[0]||r>e[c-1]|n<l[0]||n>l[u-1]))return[!1,!1];var a=t.a2i(r),o=t.b2j(n),s=t.evalxy([],a,o);if(i){var h,d,p,f,m=0,g=0,y=[];r<e[0]?(h=0,d=0,m=(r-e[0])/(e[1]-e[0])):r>e[c-1]?(h=c-2,d=1,m=(r-e[c-1])/(e[c-1]-e[c-2])):d=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),n<l[0]?(p=0,f=0,g=(n-l[0])/(l[1]-l[0])):n>l[u-1]?(p=u-2,f=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):f=o-(p=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(t.dxydi(y,h,p,d,f),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(t.dxydj(y,h,p,d,f),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(l.length-2,t));return l[e+1]-l[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}}),zw=d({"src/traces/carpet/calc.js"(t,e){var r=nr(),n=se().isArray1D,i=bw(),a=_w(),o=ww(),s=kw(),l=Tw(),c=Io(),u=Sw(),h=Po(),d=Iw();e.exports=function(t,e){var p=r.getFromId(t,e.xaxis),f=r.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(e,m,g,"a","b",x);var b=e._a=e._a||e.a,_=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var k="index"===m.cheatertype?b.length:b,T="index"===g.cheatertype?_.length:_;y=i(k,T,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),u(y,b,_),u(v,b,_),d(e),e.setScale();var S=a(y),A=a(v),M=.5*(S[1]-S[0]),C=.5*(S[1]+S[0]),E=.5*(A[1]-A[0]),L=.5*(A[1]+A[0]),P=1.3;return S=[C-M*P,C+M*P],A=[L-E*P,L+E*P],e._extremes[p._id]=r.findExtremes(p,S,{padded:!0}),e._extremes[f._id]=r.findExtremes(f,A,{padded:!0}),o(e,"a","b"),o(e,"b","a"),s(e,m),s(e,g),w.clipsegments=l(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=b,w.b=_,[w]}}}),Ow=d({"src/traces/carpet/index.js"(t,e){e.exports={attributes:hw(),supplyDefaults:mw(),plot:xw(),calc:zw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Dw=d({"lib/carpet.js"(t,e){e.exports=Ow()}}),Rw=d({"src/traces/scattercarpet/attributes.js"(t,e){var r=_n(),n=wn(),i=N(),a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=Pe(),l=D().extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),Fw=d({"src/traces/scattercarpet/defaults.js"(t,e){var r=se(),n=bn(),i=Ge(),a=Wn(),o=Gn(),s=Yn(),l=Zn(),c=Xn(),u=Rw();e.exports=function(t,e,h,d){function p(n,i){return r.coerce(t,e,u,n,i)}p("carpet"),e.xaxis="x",e.yaxis="y";var f=p("a"),m=p("b"),g=Math.min(f.length,m.length);if(g){e._length=g,p("text"),p("texttemplate"),p("hovertext"),p("mode",g<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(e)&&a(t,e,h,d,p,{gradient:!0}),i.hasLines(e)&&(o(t,e,h,d,p,{backoff:!0}),s(t,e,p),p("connectgaps")),i.hasText(e)&&l(t,e,d,p);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(p("marker.maxdisplayed"),y.push("points")),p("fill"),"none"!==e.fill&&(c(t,e,h,p),i.hasLines(e)||s(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),"fills"!==p("hoveron",y.join("+")||"points")&&p("hovertemplate"),p("zorder"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}}),Bw=d({"src/traces/scattercarpet/format_labels.js"(t,e){e.exports=function(t,e){var r={},n=e._carpet,i=n.ab2ij([t.a,t.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),l=i[1]-s,c=n.evalxy([],a,s,o,l);return r.yLabel=c[1].toFixed(3),r}}}),jw=d({"src/traces/carpet/lookup_carpetid.js"(t,e){e.exports=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&"carpet"===a.type&&(r||(r=a),a.carpet===e.carpet))return a}return r}}}),Nw=d({"src/traces/scattercarpet/calc.js"(t,e){var r=k(),n=ri(),i=ni(),a=ii(),o=ai().calcMarkerSize,s=jw();e.exports=function(t,e){var l=e._carpetTrace=s(t,e);if(l&&l.visible&&"legendonly"!==l.visible){var c;e.xaxis=l.xaxis,e.yaxis=l.yaxis;var u,h,d=e._length,p=new Array(d),f=!1;for(c=0;c<d;c++)if(u=e.a[c],h=e.b[c],r(u)&&r(h)){var m=l.ab2xy(+u,+h,!0),g=l.isVisible(+u,+h);g||(f=!0),p[c]={x:m[0],y:m[1],a:u,b:h,vis:g}}else p[c]={x:!1,y:!1};return e._needsCull=f,p[0].carpet=l,p[0].trace=e,o(e,d),n(t,e),i(p,e),a(p,e),p}}}}),Uw=d({"src/traces/scattercarpet/plot.js"(t,e){var r=hi(),n=nr(),i=Je();e.exports=function(t,e,a,o){var s,l,c,u=a[0][0].carpet,h=n.getFromId(t,u.xaxis||"x"),d=n.getFromId(t,u.yaxis||"y"),p={xaxis:h,yaxis:d,plot:e.plot};for(s=0;s<a.length;s++)(l=a[s][0].trace)._xA=h,l._yA=d;for(r(t,p,a,o),s=0;s<a.length;s++)l=a[s][0].trace,c=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(c,a[s][0].carpet._clipPathId,t)}}}),Vw=d({"src/traces/scattercarpet/hover.js"(t,e){var r=gi(),n=se().fillText;e.exports=function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),u),o}var d=s.cd[s.index];s.a=d.a,s.b=d.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var p=s.trace,f=p._carpet,m=p._module.formatLabels(d,p);s.yLabel=m.yLabel,delete s.text;var g=[];if(!p.hovertemplate){var y=(d.hi||p.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&v(f.aaxis,d.a),-1!==y.indexOf("b")&&v(f.baxis,d.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&n(d,p,g),s.extraText=g.join("<br>")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}}}),qw=d({"src/traces/scattercarpet/event_data.js"(t,e){e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t.y=a.y,t}}}),$w=d({"src/traces/scattercarpet/index.js"(t,e){e.exports={attributes:Rw(),supplyDefaults:Fw(),colorbar:di(),formatLabels:Bw(),calc:Nw(),plot:Uw(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Vw(),selectPoints:yi(),eventData:qw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ai(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Hw=d({"lib/scattercarpet.js"(t,e){e.exports=$w()}}),Ww=d({"src/traces/contourcarpet/attributes.js"(t,e){var r=bo(),n=ss(),i=Pe(),a=D().extendFlat,o=n.contours;e.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),Gw=d({"src/traces/contourcarpet/defaults.js"(t,e){var r=se(),n=_o(),i=Ww(),a=Ls(),o=cs(),s=hs();e.exports=function(t,e,l,c){function u(n,a){return r.coerce(t,e,i,n,a)}if(u("carpet"),t.a&&t.b){if(!n(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?a(t,e,u,c,l,{hasHover:!1}):(o(t,e,u,(function(n){return r.coerce2(t,e,i,n)})),s(t,e,u,c,{hasHover:!1}))}else e._defaultColor=l,e._length=null;u("zorder")}}}),Yw=d({"src/traces/contourcarpet/calc.js"(t,e){var r=He(),n=se(),i=Po(),a=Io(),o=zo(),s=Oo(),l=Do(),c=Gw(),u=jw(),h=ps();e.exports=function(t,e){var d=e._carpetTrace=u(t,e);if(d&&d.visible&&"legendonly"!==d.visible){if(!e.a||!e.b){var p=t.data[d.index],f=t.data[e.index];f.a||(f.a=p.a),f.b||(f.b=p.b),c(f,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var c,u,h,d,p,f,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),c=e._a=e._a||e.a,d=e._b=e._b||e.b,c=c?y.makeCalcdata(e,"_a"):[],d=d?v.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,f=e.db||1,m=e._z=a(e._z||e.z,e.transpose),e._emptypoints=s(m),o(m,e._emptypoints);var x=n.maxRowLength(m),b="scaled"===e.xtype?"":c,_=l(e,b,u,h,x,y),w="scaled"===e.ytype?"":d,k=l(e,w,p,f,m.length,v),T={a:_,b:k,z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[T]}(t,e);return h(e,e._z),m}}}}),Zw=d({"src/traces/carpet/axis_aligned_line.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,c,u,h,d,p,f,m,g,y,v=r(n)?"a":"b",x=("a"===v?t.aaxis:t.baxis).smoothing,b="a"===v?t.a2i:t.b2j,_="a"===v?n:i,w="a"===v?i:n,k="a"===v?e.a.length:e.b.length,T="a"===v?e.b.length:e.a.length,S=Math.floor("a"===v?t.b2j(w):t.a2i(w)),A="a"===v?function(e){return t.evalxy([],e,S)}:function(e){return t.evalxy([],S,e)};x&&(s=Math.max(0,Math.min(T-2,S)),l=S-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var M=b(_[0]),C=b(_[1]),E=M<C?1:-1,L=1e-8*(C-M),P=E>0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,z=E>0?Math.min:Math.max,O=E>0?Math.max:Math.min,D=P(M+L),R=I(C-L),F=[[h=A(M)]];for(a=D;a*E<R*E;a+=E)c=[],m=O(M,a),y=(g=z(C,a+E))-m,u=Math.max(0,Math.min(k-2,Math.floor(.5*(m+g)))),d=A(g),x&&(p=o(u,m-u),f=o(u,g-u),c.push([h[0]+p[0]/3*y,h[1]+p[1]/3*y]),c.push([d[0]-f[0]/3*y,d[1]-f[1]/3*y])),c.push(d),F.push(c),h=d;return F}}}),Xw=d({"src/traces/contourcarpet/plot.js"(t,e){var r=v(),n=gw(),i=yw(),a=Je(),o=se(),s=ys(),l=vs(),c=ks(),u=gs(),h=_s(),d=bs(),p=ws(),f=jw(),m=Zw();function g(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,v,b){var _=e.xaxis,w=e.yaxis;o.makeTraceGroups(b,v,"contour").each((function(v){var b=r.select(this),k=v[0],T=k.trace,S=T._carpetTrace=f(t,T),A=t.calcdata[S.index][0];if(S.visible&&"legendonly"!==S.visible){var M=k.a,C=k.b,E=T.contours,L=d(E,e,k),P="constraint"===E.type,I=E._operation,z=P?"="===I?"lines":"fill":E.coloring,O=[[M[0],C[C.length-1]],[M[M.length-1],C[C.length-1]],[M[M.length-1],C[0]],[M[0],C[0]]];s(L);var D=1e-8*(M[M.length-1]-M[0]),R=1e-8*(C[C.length-1]-C[0]);l(L,D,R);var F,B,j,N,U=L;"constraint"===E.type&&(U=h(L,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r<t.length;r++){for(o=(a=t[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(u=a.edgepaths[n],l=[],i=0;i<u.length;i++)l[i]=e(u[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(u=a.paths[n],c=[],i=0;i<u.length;i++)c[i]=e(u[i]);s.push(c)}}}(L,$);var V=[];for(N=A.clipsegments.length-1;N>=0;N--)F=A.clipsegments[N],B=n([],F.x,_.c2p),j=n([],F.y,w.c2p),B.reverse(),j.reverse(),V.push(i(B,j,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,a,s,l){var c,u,h,d,p=o.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);p.enter().append("path"),p.exit().remove();var f=[];for(d=0;d<e.length;d++)c=e[d],u=n([],c.x,r.c2p),h=n([],c.y,a.c2p),f.push(i(u,h,c.bicubic));p.attr("d","M"+f.join("L")+"Z").style("stroke","none")}(b,A.clipsegments,_,w,P,z),function(t,e,n,i,s,l,c,u,h,d,f){var g="fill"===d;g&&p(s,t.contours);var y=o.ensureSingle(e,"g","contourfill").selectAll("path").data(g?s:[]);y.enter().append("path"),y.exit().remove(),y.each((function(t){var e=(t.prefixBoundary?f:"")+function(t,e,r,n,i,s,l,c){var u,h,d,p,f,g,y,v="",x=e.edgepaths.map((function(t,e){return e})),b=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(t){return Math.abs(t[1]-r[0][1])<w}function T(t){return Math.abs(t[1]-r[2][1])<w}function S(t){return Math.abs(t[0]-r[0][0])<_}function A(t){return Math.abs(t[0]-r[2][0])<_}function M(t,e){var r,n,a,o,u="";for(k(t)&&!A(t)||T(t)&&!S(t)?(o=i.aaxis,a=m(i,s,[t[0],e[0]],.5*(t[1]+e[1]))):(o=i.baxis,a=m(i,s,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<a.length;r++)for(u+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];u+=[l.c2p(h[0]),c.c2p(h[1])]+" "}return u}for(u=0,h=null;x.length;){var C=e.edgepaths[u][0];for(h&&(v+=M(h,C)),y=a.smoothopen(e.edgepaths[u].map(n),e.smoothing),v+=b?y:y.replace(/^M/,"L"),x.splice(x.indexOf(u),1),h=e.edgepaths[u][e.edgepaths[u].length-1],f=-1,p=0;p<4;p++){if(!h){o.log("Missing end?",u,e);break}for(k(h)&&!A(h)?d=r[1]:S(h)?d=r[0]:T(h)?d=r[3]:A(h)&&(d=r[2]),g=0;g<e.edgepaths.length;g++){var E=e.edgepaths[g][0];Math.abs(h[0]-d[0])<_?Math.abs(h[0]-E[0])<_&&(E[1]-h[1])*(d[1]-E[1])>=0&&(d=E,f=g):Math.abs(h[1]-d[1])<w?Math.abs(h[1]-E[1])<w&&(E[0]-h[0])*(d[0]-E[0])>=0&&(d=E,f=g):o.log("endpt to newendpt is not vert. or horz.",h,d,E)}if(f>=0)break;v+=M(h,d),h=d}if(f===e.edgepaths.length){o.log("unclosed perimeter path");break}u=f,(b=-1===x.indexOf(u))&&(u=x[0],v+=M(h,d)+"Z",h=null)}for(u=0;u<e.paths.length;u++)v+=a.smoothclosed(e.paths[u].map(n),e.smoothing);return v}(0,t,l,c,u,h,n,i);e?r.select(this).attr("d",e).style("stroke","none"):r.select(this).remove()}))}(T,b,_,w,U,O,$,S,A,z,q),function(t,e,n,i,s,l,h){var d=n._context.staticPlot,p=o.ensureSingle(t,"g","contourlines"),f=!1!==s.showlines,m=s.showlabels,v=f&&m,b=c.createLines(p,f||m,e,d),_=c.createLineClip(p,v,n,i.trace.uid),w=t.selectAll("g.contourlabels").data(m?[0]:[]);if(w.exit().remove(),w.enter().append("g").classed("contourlabels",!0),m){var k=l.xaxis,T=l.yaxis,S=k._length,A=T._length,M=[[[0,0],[S,0],[S,A],[0,A]]],C=[];o.clearLocationCache();var E=c.labelFormatter(n,i),L=a.tester.append("text").attr("data-notex",1).call(a.font,s.labelfont),P={left:0,right:S,center:S/2,top:0,bottom:A,middle:A/2},I=Math.sqrt(S*S+A*A),z=u.LABELDISTANCE*I/Math.max(1,e.length/u.LABELINCREASE);b.each((function(t){var e=c.calcTextOpts(t.level,E,L,n);r.select(this).selectAll("path").each((function(r){var n=this,i=o.getVisibleSegment(n,P,e.height/2);if(i&&(function(t,e,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)e===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=i.a[0],c=i.a[i.a.length-1],u=i.b[0],h=i.b[i.b.length-1],d=g(t,0,1),p=g(t,n.total,n.total-1),f=v(o[0],d),m=n.total-v(o[o.length-1],p);n.min<f&&(n.min=f),n.max>m&&(n.max=m),n.len=n.max-n.min}function v(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)<o||Math.abs(t[0]-c)<o)&&(r=y(i.dxydb_rough(t[0],t[1],o)),n=Math.max(n,a*x(e,r)/2)),(Math.abs(t[1]-u)<o||Math.abs(t[1]-h)<o)&&(r=y(i.dxyda_rough(t[0],t[1],o)),n=Math.max(n,a*x(e,r)/2)),n}}(n,r,t,i,h,e.height),!(i.len<(e.width+e.height)*u.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/z),u.LABELMAX),s=0;s<a;s++){var l=c.findBestTextLocation(n,i,e,C,P);if(!l)break;c.addLabelData(l,e,C,M)}}))})),L.remove(),c.drawLabels(w,C,n,_,v?M:null)}m&&!f&&b.remove()}(b,L,t,k,E,e,S),a.setClipUrl(b,S._clipPathId,t)}function $(t){var e=S.ab2xy(t[0],t[1],!0);return[_.c2p(e[0]),w.c2p(e[1])]}}))}}}),Kw=d({"src/traces/contourcarpet/index.js"(t,e){e.exports={attributes:Ww(),supplyDefaults:Gw(),colorbar:As(),calc:Yw(),plot:Xw(),style:Ss(),moduleType:"trace",name:"contourcarpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),Jw=d({"lib/contourcarpet.js"(t,e){e.exports=Kw()}}),Qw=d({"src/traces/ohlc/attributes.js"(t,e){var r=se().extendFlat,n=wn(),i=Ce().axisHoverFormat,a=It().dash,o=j(),s=Tl(),l=s.INCREASING.COLOR,c=s.DECREASING.COLOR,u=n.line;function h(t){return{line:{color:r({},u.color,{dflt:t}),width:u.width,dash:a,editType:"style"},editType:"style"}}e.exports={xperiod:n.xperiod,xperiod0:n.xperiod0,xperiodalignment:n.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:r({},u.width,{}),dash:r({},a,{}),editType:"style"},increasing:h(l),decreasing:h(c),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:r({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:n.zorder}}}),tk=d({"src/traces/ohlc/ohlc_defaults.js"(t,e){var r=Vt(),n=se();e.exports=function(t,e,i,a){var o=i("x"),s=i("open"),l=i("high"),c=i("low"),u=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,n.minRowLength(o))),e._length=h,h}}}}),ek=d({"src/traces/ohlc/defaults.js"(t,e){var r=se(),n=tk(),i=$n(),a=Qw();function o(t,e,r,n){r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}e.exports=function(t,e,s,l){function c(n,i){return r.coerce(t,e,a,n,i)}n(t,e,c,l)?(i(t,e,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),o(0,e,c,"increasing"),o(0,e,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),l._requestRangeslider[e.xaxis]=!0,c("zorder")):e.visible=!1}}}),rk=d({"src/traces/ohlc/calc.js"(t,e){var r=se(),n=r._,i=nr(),a=ei(),o=T().BADNUM;function s(t,e,r,n){return{o:t,h:e,l:r,c:n}}function l(t,e,a,s,l,c){for(var u=l.makeCalcdata(e,"open"),h=l.makeCalcdata(e,"high"),d=l.makeCalcdata(e,"low"),p=l.makeCalcdata(e,"close"),f=r.isArrayOrTypedArray(e.text),m=r.isArrayOrTypedArray(e.hovertext),g=!0,y=null,v=!!e.xperiodalignment,x=[],b=0;b<s.length;b++){var _=s[b],w=u[b],k=h[b],T=d[b],S=p[b];if(_!==o&&w!==o&&k!==o&&T!==o&&S!==o){S===w?null!==y&&S!==y&&(g=S>y):g=S>w,y=S;var A=c(w,k,T,S);A.pos=_,A.yc=(w+S)/2,A.i=b,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[T,k],v&&(A.orig_p=a[b]),f&&(A.tx=e.text[b]),m&&(A.htx=e.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,r.concat(d,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var n=i.getFromId(t,e.xaxis),o=i.getFromId(t,e.yaxis),c=function(t,e,n){var i=n._minDiff;if(!i){var o,s=t._fullData,l=[];for(i=1/0,o=0;o<s.length;o++){var c=s[o];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===e._id){l.push(c);var u=e.makeCalcdata(c,"x");c._origX=u;var h=a(n,e,"x",u).vals;c._xcalc=h;var d=r.distinctVals(h).minDiff;d&&isFinite(d)&&(i=Math.min(i,d))}}for(i===1/0&&(i=1),o=0;o<l.length;o++)l[o]._minDiff=i}return i*n.tickwidth}(t,n,e),u=e._minDiff;e._minDiff=null;var h=e._origX;e._origX=null;var d=e._xcalc;e._xcalc=null;var p=l(t,e,h,d,o,s);return e._extremes[n._id]=i.findExtremes(n,d,{vpad:u/2}),p.length?(r.extendFlat(p[0].t,{wHover:u/2,tickLen:c}),p):[{t:{empty:!0}}]},calcCommon:l}}}),nk=d({"src/traces/ohlc/plot.js"(t,e){var r=v(),n=se();e.exports=function(t,e,i,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;n.makeTraceGroups(a,i,"trace ohlc").each((function(t){var e=r.select(this),i=t[0],a=i.t;if(!0!==i.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(n.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}}}),ik=d({"src/traces/ohlc/style.js"(t,e){var r=v(),n=Je(),i=q();e.exports=function(t,e,a){var o=a||r.select(t).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(t){var e=t[0].trace;r.select(this).selectAll("path").each((function(t){if(!t.empty){var a=e[t.dir].line;r.select(this).style("fill","none").call(i.stroke,a.color).call(n.dashLine,a.dash,a.width).style("opacity",e.selectedpoints&&!t.selected?.3:1)}}))}))}}}),ak=d({"src/traces/ohlc/hover.js"(t,e){var r=nr(),n=se(),i=zr(),a=q(),o=se().fillText,s=Tl(),l={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function c(t,e,r,n){var o,s,l=t.cd,c=t.xa,u=l[0].trace,h=l[0].t,d=u.type,p="ohlc"===d?"l":"min",f="ohlc"===d?"h":"max",m=h.bPos||0,g=h.bdPos||h.tickLen,y=h.wHover,v=Math.min(1,g/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function x(t){var r=function(t){return t.pos+m-e}(t);return i.inbox(r-y,r+y,o)}function b(t){var e=t[p],n=t[f];return e===n||i.inbox(e-r,n-r,o)}function _(t){return(x(t)+b(t))/2}o=t.maxHoverDistance-v,s=t.maxSpikeDistance-v;var w=i.getDistanceFunction(n,x,b,_);if(i.getClosest(l,w,t),!1===t.index)return null;var k=l[t.index];if(k.empty)return null;var T=u[k.dir],S=T.line.color;return a.opacity(S)&&T.line.width?t.color=S:t.color=T.fillcolor,t.x0=c.c2p(k.pos+m-g,!0),t.x1=c.c2p(k.pos+m+g,!0),t.xLabelVal=void 0!==k.orig_p?k.orig_p:k.pos,t.spikeDistance=_(k)*s/o,t.xSpike=c.c2p(k.pos,!0),t}function u(t,e,i,a){var o=t.cd,s=t.ya,l=o[0].trace,u=o[0].t,h=[],d=c(t,e,i,a);if(!d)return[];var p=o[d.index].hi||l.hoverinfo,f=p.split("+");if("all"!==p&&-1===f.indexOf("y"))return[];for(var m=["high","open","close","low"],g={},y=0;y<m.length;y++){var v,x=m[y],b=l[x][d.index],_=s.c2p(b,!0);b in g?(v=g[b]).yLabel+="<br>"+u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat):((v=n.extendFlat({},d)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat),v.name="",h.push(v),g[b]=v)}return h}function h(t,e,n,i){var a=t.cd,s=t.ya,u=a[0].trace,h=a[0].t,d=c(t,e,n,i);if(!d)return[];var p=a[d.index],f=d.index=p.i,m=p.dir;function g(t){return h.labels[t]+r.hoverLabelText(s,u[t][f],u.yhoverformat)}var y=p.hi||u.hoverinfo,v=y.split("+"),x="all"===y,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return _&&o(p,u,w),d.extraText=w.join("<br>"),d.y0=d.y1=s.c2p(p.yc,!0),[d]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?u(t,e,r,n):h(t,e,r,n)},hoverSplit:u,hoverOnPoints:h}}}),ok=d({"src/traces/ohlc/select.js"(t,e){e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];e.contains([i.c2p(l.pos+s),a.c2p(l.yc)],null,l.i,t)?(o.push({pointNumber:l.i,x:i.c2d(l.pos),y:a.c2d(l.yc)}),l.selected=1):l.selected=0}return o}}}),sk=d({"src/traces/ohlc/index.js"(t,e){e.exports={moduleType:"trace",name:"ohlc",basePlotModule:Ai(),categories:["cartesian","svg","showLegend"],meta:{},attributes:Qw(),supplyDefaults:ek(),calc:rk().calc,plot:nk(),style:ik(),hoverPoints:ak().hoverPoints,selectPoints:ok()}}}),lk=d({"lib/ohlc.js"(t,e){e.exports=sk()}}),ck=d({"src/traces/candlestick/attributes.js"(t,e){var r=se().extendFlat,n=Ce().axisHoverFormat,i=Qw(),a=oo();function o(t){return{line:{color:r({},a.line.color,{dflt:t}),width:a.line.width,editType:"style"},fillcolor:a.fillcolor,editType:"style"}}e.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:r({},a.line.width,{}),editType:"style"},increasing:o(i.increasing.line.color.dflt),decreasing:o(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:r({},a.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel,zorder:a.zorder}}}),uk=d({"src/traces/candlestick/defaults.js"(t,e){var r=se(),n=q(),i=tk(),a=$n(),o=ck();function s(t,e,r,i){var a=r(i+".line.color");r(i+".line.width",e.line.width),r(i+".fillcolor",n.addOpacity(a,.5))}e.exports=function(t,e,n,l){function c(n,i){return r.coerce(t,e,o,n,i)}i(t,e,c,l)?(a(t,e,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(0,e,c,"increasing"),s(0,e,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),l._requestRangeslider[e.xaxis]=!0,c("zorder")):e.visible=!1}}}),hk=d({"src/traces/candlestick/calc.js"(t,e){var r=se(),n=nr(),i=ei(),a=rk().calcCommon;function o(t,e,r,n){return{min:r,q1:Math.min(t,n),med:n,q3:Math.max(t,n),max:e}}e.exports=function(t,e){var s=t._fullLayout,l=n.getFromId(t,e.xaxis),c=n.getFromId(t,e.yaxis),u=l.makeCalcdata(e,"x"),h=i(e,l,"x",u).vals,d=a(t,e,u,h,c,o);return d.length?(r.extendFlat(d[0].t,{num:s._numBoxes,dPos:r.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),s._numBoxes++,d):[{t:{empty:!0}}]}}}),dk=d({"src/traces/candlestick/index.js"(t,e){e.exports={moduleType:"trace",name:"candlestick",basePlotModule:Ai(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:ck(),layoutAttributes:so(),supplyLayoutDefaults:co().supplyLayoutDefaults,crossTraceCalc:ho().crossTraceCalc,supplyDefaults:uk(),calc:hk(),plot:po().plot,layerName:"boxlayer",style:fo().style,hoverPoints:ak().hoverPoints,selectPoints:ok()}}}),pk=d({"lib/candlestick.js"(t,e){e.exports=dk()}}),fk=d({"src/plots/polar/set_convert.js"(t,e){var r=se(),n=tr(),i=r.deg2rad,a=r.rad2deg;e.exports=function(t,e,o){switch(n(t,o),t._id){case"x":case"radialaxis":!function(t,e){var r=e._subplot;t.setGeometry=function(){var e=t._rl[0],n=t._rl[1],i=r.innerRadius,a=(r.radius-i)/(n-e),o=i/a,s=e>n?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var n=t.type;if("linear"===n){var o=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(o(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?a(t):t}(t,e))}}t.makeCalcdata=function(e,r){var n,i,a=e[r],o=e._length,s=function(r){return t.d2c(r,e.thetaunit)};if(a)for(n=new Array(o),i=0;i<o;i++)n[i]=s(a[i]);else{var l=r+"0",c="d"+r,u=l in e?s(e[l]):0,h=e[c]?s(e[c]):(t.period||2*Math.PI)/o;for(n=new Array(o),i=0;i<o;i++)n[i]=u+i*h}return n},t.setGeometry=function(){var o,s,l,c,u=e.sector,h=u.map(i),d={clockwise:-1,counterclockwise:1}[t.direction],p=i(t.rotation),f=function(t){return d*t+p},m=function(t){return(t-p)/d};switch(n){case"linear":s=o=r.identity,c=i,l=a,t.range=r.isFullCircle(h)?[u[0],u[0]+360]:h.map(m).map(a);break;case"category":var g=t._categories.length,y=t.period?Math.max(t.period,g):g;0===y&&(y=1),s=c=function(t){return 2*t*Math.PI/y},o=l=function(t){return t*y/Math.PI/2},t.range=[0,y]}t.c2g=function(t){return f(s(t))},t.g2c=function(t){return o(m(t))},t.t2g=function(t){return f(c(t))},t.g2t=function(t){return l(m(t))}}}(t,e)}}}}),mk=d({"src/plots/polar/constants.js"(t,e){e.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}}),gk=d({"src/plots/polar/helpers.js"(t,e){var r=se(),n=fn().tester,i=r.findIndexOfMin,a=r.isAngleInsideSector,o=r.angleDelta,s=r.angleDist;function l(t,e,r,n){var i,a,o=n[0],s=n[1],l=u(Math.sin(e)-Math.sin(t)),c=u(Math.cos(e)-Math.cos(t)),h=Math.tan(r),d=u(1/h),p=l/c,f=s-p*o;return d?l&&c?a=h*(i=f/(h-p)):c?(i=s*d,a=s):(i=o,a=o*h):l&&c?(i=0,a=f):c?(i=0,a=s):i=a=NaN,[i,a]}function c(t,e,n,o){return r.isFullCircle([e,n])?function(t,e){var r,n=e.length,i=new Array(n+1);for(r=0;r<n;r++){var a=e[r];i[r]=[t*Math.cos(a),t*Math.sin(a)]}return i[r]=i[0].slice(),i}(t,o):function(t,e,n,o){var c,u,h=o.length,d=[];function p(e){return[t*Math.cos(e),t*Math.sin(e)]}function f(t,e,r){return l(t,e,r,p(t))}function m(t){return r.mod(t,h)}function g(t){return a(t,[e,n])}var y=i(o,(function(t){return g(t)?s(t,e):1/0})),v=f(o[y],o[m(y-1)],e);for(d.push(v),c=y,u=0;u<h;c++,u++){var x=o[m(c)];if(!g(x))break;d.push(p(x))}var b=i(o,(function(t){return g(t)?s(t,n):1/0})),_=f(o[b],o[m(b+1)],n);return d.push(_),d.push([0,0]),d.push(d[0].slice()),d}(t,e,n,o)}function u(t){return Math.abs(t)>1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a<n;a++){var o=t[a];i[a]=[e+o[0],r-o[1]]}return i}e.exports={isPtInsidePolygon:function(t,e,r,i,o){if(!a(e,i))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var u=n(c(s,i[0],i[1],o)),h=n(c(l,i[0],i[1],o)),d=[t*Math.cos(e),t*Math.sin(e)];return h.contains(d)&&!u.contains(d)},findPolygonOffset:function(t,e,r,n){for(var i=1/0,a=1/0,o=c(t,e,r,n),s=0;s<o.length;s++){var l=o[s];i=Math.min(i,l[0]),a=Math.min(a,-l[1])}return[i,a]},findEnclosingVertexAngles:function(t,e){var n=i(e,(function(e){var r=o(e,t);return r>0?r:1/0})),a=r.mod(n+1,e.length);return[e[n],e[a]]},findIntersectionXY:l,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:u,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t<e?(s=t,l=e):(s=e,l=t);var u=h(c(s,r,n,i),a,o);return"M"+h(c(l,r,n,i),a,o).reverse().join("L")+"M"+u.join("L")}}}}),yk=d({"src/plots/smith/helpers.js"(t,e){function r(t){return t<0?-1:t>0?1:0}function n(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function i(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function a(t,e){return e*t.radius}e.exports={smith:n,reactanceArc:function(t,e,r,o){var s=i(t,n([r,e])),l=s[0],c=s[1],u=i(t,n([o,e])),h=u[0],d=u[1];if(0===e)return["M"+l+","+c,"L"+h+","+d].join(" ");var p=a(t,1/Math.abs(e));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+h+","+d].join(" ")},resistanceArc:function(t,e,o,s){var l=a(t,1/(e+1)),c=i(t,n([e,o])),u=c[0],h=c[1],d=i(t,n([e,s])),p=d[0],f=d[1];if(r(o)!==r(s)){var m=i(t,n([e,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0<o?0:1)+" "+m[0]+","+m[1],"A"+l+","+l+" 0 0,"+(s<0?0:1)+p+","+f].join(" ")}return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(s<o?0:1)+" "+p+","+f].join(" ")},smithTransform:i}}}),vk=d({"src/plots/polar/polar.js"(t,e){var r=v(),n=O(),i=Vt(),a=se(),o=a.strRotate,s=a.strTranslate,l=q(),c=Je(),u=ke(),h=nr(),d=tr(),p=fk(),f=rr().doAutoRange,m=Cn(),g=hr(),y=zr(),x=Qe(),b=Mn().prepSelect,_=Mn().selectOnClick,w=Mn().clearOutline,k=dr(),T=Dr(),S=rn().redrawReglTraces,A=Se().MID_SHIFT,M=mk(),C=gk(),E=yk(),L=E.smith,P=E.reactanceArc,I=E.resistanceArc,z=E.smithTransform,D=a._,R=a.mod,F=a.deg2rad,B=a.rad2deg;function j(t,e,r){this.isSmith=r||!1,this.id=e,this.gd=t,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var n=t._fullLayout,i="clip"+n._uid+e;this.clipIds.forTraces=i+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"smith":"polar")+"layer"].append("g").attr("class",e),this.getHole=function(t){return this.isSmith?0:t.hole},this.getSector=function(t){return this.isSmith?[0,360]:t.sector},this.getRadial=function(t){return this.isSmith?t.realaxis:t.radialaxis},this.getAngular=function(t){return this.isSmith?t.imaginaryaxis:t.angularaxis},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var N=j.prototype;function U(t){var e=t.ticks+String(t.ticklen)+String(t.showticklabels);return"side"in t&&(e+=t.side),e}function V(t,e){return e[a.findIndexOfMin(e,(function(e){return a.angleDist(t,e)}))]}function $(t,e,r){return e?(t.attr("display",null),t.attr(r)):t&&t.attr("display","none"),t}e.exports=function(t,e,r){return new j(t,e,r)},N.plot=function(t,e){for(var r=this,n=e[r.id],i=!1,a=0;a<t.length;a++)if(!1===t[a][0].trace.cliponaxis){i=!0;break}r._hasClipOnAxisFalse=i,r.updateLayers(e,n),r.updateLayout(e,n),u.generalUpdatePerTraceModule(r.gd,r,t,n),r.updateFx(e,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)},N.updateLayers=function(t,e){var n=this,i=n.isSmith,a=n.layers,o=n.getRadial(e),s=n.getAngular(e),l=M.layerNames,c=l.indexOf("frontplot"),u=l.slice(0,c),h="below traces"===s.layer,d="below traces"===o.layer;h&&u.push("angular-line"),d&&u.push("radial-line"),h&&u.push("angular-axis"),d&&u.push("radial-axis"),u.push("frontplot"),h||u.push("angular-line"),d||u.push("radial-line"),h||u.push("angular-axis"),d||u.push("radial-axis");var p=(i?"smith":"polar")+"sublayer",f=n.framework.selectAll("."+p).data(u,String);f.enter().append("g").attr("class",(function(t){return p+" "+t})).each((function(t){var e=a[t]=r.select(this);switch(t){case"frontplot":i||e.append("g").classed("barlayer",!0),e.append("g").classed("scatterlayer",!0);break;case"backplot":e.append("g").classed("maplayer",!0);break;case"plotbg":a.bg=e.append("path");break;case"radial-grid":case"angular-grid":e.style("fill","none");break;case"radial-line":e.append("line").style("fill","none");break;case"angular-line":e.append("path").style("fill","none")}})),f.order()},N.updateLayout=function(t,e){var r=this,n=r.layers,i=t._size,a=r.getRadial(e),o=r.getAngular(e),u=e.domain.x,h=e.domain.y;r.xOffset=i.l+i.w*u[0],r.yOffset=i.t+i.h*(1-h[1]);var d=r.xLength=i.w*(u[1]-u[0]),p=r.yLength=i.h*(h[1]-h[0]),f=r.getSector(e);r.sectorInRad=f.map(F);var m,g,y,v,x,b=r.sectorBBox=function(t){var e,r,n,i,a=t[0],o=t[1],s=o-a,l=R(a,360),c=l+s,u=Math.cos(F(l)),h=Math.sin(F(l)),d=Math.cos(F(c)),p=Math.sin(F(c));return i=l<=90&&c>=90||l>90&&c>=450?1:h<=0&&p<=0?0:Math.max(h,p),e=l<=180&&c>=180||l>180&&c>=540?-1:u>=0&&d>=0?0:Math.min(u,d),r=l<=270&&c>=270||l>270&&c>=630?-1:h>=0&&p>=0?0:Math.min(h,p),n=c>=360?1:u<=0&&d<=0?0:Math.max(u,d),[e,r,n,i]}(f),_=b[2]-b[0],w=b[3]-b[1],k=p/d,T=Math.abs(w/_);k>T?(m=d,x=(p-(g=d*T))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(d-(m=p/T))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var S,A=r.xOffset2=i.l+i.w*y[0],M=r.yOffset2=i.t+i.h*(1-v[1]),C=r.radius=m/_,E=r.innerRadius=r.getHole(e)*C,L=r.cx=A-C*b[0],P=r.cy=M+C*b[3],I=r.cxx=L-A,z=r.cyy=P-M,O=a.side;"counterclockwise"===O?(S=O,O="top"):"clockwise"===O&&(S=O,O="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:O,_trueSide:S,domain:[E/i.w,C/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:v});var D=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",D).attr("transform",s(I,z)),n.frontplot.attr("transform",s(A,M)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",D).attr("transform",s(L,P)).call(l.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return p(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);d(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*a,t[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);f(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],l):i._rl[0]=Math.min(i._rl[0],l)}},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,d=r.cx,p=r.cy,f=r.getRadial(e),m=R(r.getSector(e)[0],360),g=r.radialAxis,y=u<c,v=r.isSmith;v||(r.fillViewInitialKey("radialaxis.angle",f.angle),r.fillViewInitialKey("radialaxis.range",g.range.slice()),g.setGeometry()),"auto"===g.tickangle&&m>90&&m<=270&&(g.tickangle=180);var x=v?function(t){var e=z(r,L([t.x,0]));return s(e[0]-d,e[1]-p)}:function(t){return s(g.l2p(t.x)+u,0)},b=v?function(t){return I(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},_=U(f);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,k=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),T=v?k:h.clipEnds(g,k),S=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(S=-S),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:k,layer:i["radial-axis"],path:h.makeTickPath(g,0,S),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:T,layer:i["radial-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:k,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var A=r.radialAxisAngle=r.vangles?B(V(F(f.angle),r.vangles)):f.angle,M=s(d,p),C=M+o(-A);$(i["radial-axis"],y&&(f.showticklabels||f.ticks),{transform:C}),$(i["radial-grid"],y&&f.showgrid,{transform:v?"":M}),$(i["radial-line"].select("line"),y&&f.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:C}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),u=n.id+"title",h=0;if(l.title){var d=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,f=l.side;h="top"===f?p:"counterclockwise"===f?-(d+.4*p):d+.8*p}var m=void 0!==r?r:n.radialAxisAngle,g=F(m),y=Math.cos(g),v=Math.sin(g),b=o+a/2*y+h*v,_=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:D(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,d=r.cx,p=r.cy,f=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",f.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=z(r,L([0,t.x]));return Math.atan2(e[0]-d,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=B(m.tick0),m.dtick=B(m.dtick));var v=function(t){return s(d+c*Math.cos(t),p-c*Math.sin(t))},x=g?function(t){var e=z(r,L([0,t.x]));return s(e[0],e[1])}:function(t){return v(y(t))},b=g?function(t){var e=z(r,L([0,t.x])),n=Math.atan2(e[0]-d,e[1]-p)-Math.PI/2;return s(e[0],e[1])+o(-B(n))}:function(t){var e=y(t);return v(e)+o(-B(e))},_=g?function(t){return P(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[d+u*r,p-u*n]+"L"+[d+c*r,p-c*n]},w=h.makeLabelFns(m,0).labelStandoff,k={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*A)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},T=U(f);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=T);var S,M=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(M[0].text="\u221e",M[0].fontSize*=1.75),"linear"===e.gridshape?(S=M.map(y),a.angleDelta(S[0],S[1])<0&&(S=S.slice().reverse())):S=null,r.vangles=S,"category"===m.type&&(M=M.filter((function(t){return a.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var C="inside"===m.ticks?-1:1,E=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:M,layer:i["angular-axis"],path:"M"+C*E+",0h"+C*m.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,m,{vals:M,layer:i["angular-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:M,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:k})}$(i["angular-line"].select("path"),f.showline,{d:r.pathSubplot(),transform:s(d,p)}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,d=t._zoomlayer,p=M.MINZOOM,f=M.OFFEDGE,v=l.radius,x=l.innerRadius,k=l.cx,T=l.cy,S=l.cxx,A=l.cyy,E=l.sectorInRad,L=l.vangles,P=l.radialAxis,I=C.clampTiny,z=C.findXYatLength,O=C.findEnclosingVertexAngles,D=M.cornerHalfWidth,R=M.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===t.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(k,T)),F.onmousemove=function(t){y.hover(u,t,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){u._dragging||g.unhover(u,t)};var B,j,N,U,V,q,$,H,W,G={element:F,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(t,e){return Math.sqrt(t*t+e*e)}function Z(t,e){return Y(t-S,e-A)}function X(t,e){return Math.atan2(A-e,t-S)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return l.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-D,s=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),s=I((a[0]+o[0])/2),c=I((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,d=z(D,u,s,c);n=z(R,h,d[0][0],d[0][1]),i=z(R,h,d[1][0],d[1][1])}else{var p,f;c?(p=R,f=D):(p=D,f=R),n=[[s-p,c-f],[s+p,c-f]],i=[[s-p,c+f],[s+p,c+f]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),t<f?t=0:v-t<f?t=v:e<f?e=0:v-e<f&&(e=v),Math.abs(e-t)>p?(t<e?(N=t,U=e):(N=e,U=t),!0):(N=null,U=null,!1)}function et(t,e){t=t||V,e=e||"M0,0Z",H.attr("d",t),W.attr("d",e),m.transitionZoombox(H,W,q,$),q=!0;var r={};ot(r),u.emit("plotly_relayouting",r)}function rt(t,r){var n,i,a=B+(t*=e),s=j+(r*=o),c=Z(B,j),u=Math.min(Z(a,s),v),h=X(B,j);tt(c,u)&&(n=V+l.pathSector(U),N&&(n+=l.pathSector(N)),i=J(N,h)+J(U,h)),et(n,i)}function nt(t,e,r,n){var i=C.findIntersectionXY(r,n,r,[t-S,A-e]);return Y(i[0],i[1])}function it(t,e){var r,n,i=B+t,a=j+e,o=X(B,j),s=X(i,a),c=O(o,L),u=O(s,L);tt(nt(B,j,c[0],c[1]),Math.min(nt(i,a,u[0],u[1]),v))&&(r=V+l.pathSector(U),N&&(r+=l.pathSector(N)),n=[Q(N,c[0],c[1]),Q(U,c[0],c[1])].join(" ")),et(r,n)}function at(){if(m.removeZoombox(u),null!==N&&null!==U){var t={};ot(t),m.showDoubleClickNotifier(u),i.call("_guiRelayout",u,t)}}function ot(t){var e=P._rl,r=(e[1]-e[0])/(1-x/v)/v,n=[e[0]+(N-x)*r,e[0]+(U-x)*r];t[l.id+".radialaxis.range"]=n}function st(t,e){var r=u._fullLayout.clickmode;if(m.removeZoombox(u),2===t){var n={};for(var a in l.viewInitial)n[l.id+"."+a]=l.viewInitial[a];u.emit("plotly_doubleclick",null),i.call("_guiRelayout",u,n)}r.indexOf("select")>-1&&1===t&&_(e,u,[l.xaxis],[l.yaxis],l.id,G),r.indexOf("event")>-1&&y.click(u,e,l.id)}G.prepFn=function(t,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var f=a.apply3DTransform(p)(r-h.left,i-h.top);if(B=f[0],j=f[1],L){var g=C.findPolygonOffset(v,E[0],E[1],L);B+=S+g[0],j+=A+g[1]}switch(s){case"zoom":G.clickFn=st,c||(G.moveFn=L?it:rt,G.doneFn=at,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var t=u._fullLayout[l.id];$=n(t.bgcolor).getLuminance(),(H=m.makeZoombox(d,$,k,T,V)).attr("fill-rule","evenodd"),W=m.makeCorners(d,k,T),w(u)}());break;case"select":case"lasso":b(t,r,i,G,s)}},g.init(G)},N.updateRadialDrag=function(t,e,n){var l=this,c=l.gd,u=l.layers,h=l.radius,d=l.innerRadius,p=l.cx,f=l.cy,y=l.radialAxis,v=M.radialDragBoxSize,x=v/2;if(y.visible){var b,_,k,A=F(l.radialAxisAngle),C=y._rl,E=C[0],L=C[1],P=C[n],I=.75*(C[1]-C[0])/(1-l.getHole(e))/h;n?(b=p+(h+x)*Math.cos(A),_=f-(h+x)*Math.sin(A),k="radialdrag"):(b=p+(d-x)*Math.cos(A),_=f-(d-x)*Math.sin(A),k="radialdrag-inner");var z,O,D,R=m.makeRectDragger(u,k,"crosshair",-x,-x,v,v),j={element:R,gd:c};!1===t.dragmode&&(j.dragmode=!1),$(r.select(R),y.visible&&d<h,{transform:s(b,_)}),j.prepFn=function(){z=null,O=null,D=null,j.moveFn=N,j.doneFn=U,w(c)},j.clampFn=function(t,e){return Math.sqrt(t*t+e*e)<M.MINDRAG&&(t=0,e=0),[t,e]},g.init(j)}function N(t,e){if(z)z(t,e);else{var r=[t,-e],i=[Math.cos(A),Math.sin(A)],o=Math.abs(a.dot(r,i)/Math.sqrt(a.dot(r,r)));isNaN(o)||(z=o<.5?q:H)}var s={};!function(t){null!==O?t[l.id+".radialaxis.angle"]=O:null!==D&&(t[l.id+".radialaxis.range["+n+"]"]=D)}(s),c.emit("plotly_relayouting",s)}function U(){null!==O?i.call("_guiRelayout",c,l.id+".radialaxis.angle",O):null!==D&&i.call("_guiRelayout",c,l.id+".radialaxis.range["+n+"]",D)}function q(t,e){if(0!==n){var r=b+t,i=_+e;O=Math.atan2(f-i,r-p),l.vangles&&(O=V(O,l.vangles)),O=B(O);var a=s(p,f)+o(-O);u["radial-axis"].attr("transform",a),u["radial-line"].select("line").attr("transform",a);var c=l.gd._fullLayout,h=c[l.id];l.updateRadialAxisTitle(c,h,O)}}function H(t,e){var r=a.dot([t,-e],[Math.cos(A),Math.sin(A)]);if(D=P-I*r,I>0===(n?D>E:D<L)){var o=c._fullLayout,s=o[l.id];y.range[n]=D,y._rl[n]=D,l.updateRadialAxis(o,s),l.xaxis.setRange(),l.xaxis.setScale(),l.yaxis.setRange(),l.yaxis.setScale();var u=!1;for(var h in l.traceHash){var d=l.traceHash[h],p=a.filterVisible(d);d[0][0].trace._module.plot(c,l,p,s),i.traceIs(h,"gl")&&p.length&&(u=!0)}u&&(T(c),S(c))}else D=null}},N.updateAngularDrag=function(t){var e=this,n=e.gd,l=e.layers,u=e.radius,h=e.angularAxis,d=e.cx,p=e.cy,f=e.cxx,y=e.cyy,v=M.angularDragBoxSize,x=m.makeDragger(l,"path","angulardrag",!1===t.dragmode?"none":"move"),b={element:x,gd:n};function _(t,e){return Math.atan2(y+v-e,t-f-v)}!1===t.dragmode?b.dragmode=!1:r.select(x).attr("d",e.pathAnnulus(u,u+v)).attr("transform",s(d,p)).call(k,"move");var A,C,E,L,P,I,z=l.frontplot.select(".scatterlayer").selectAll(".trace"),O=z.selectAll(".point"),D=z.selectAll(".textpoint");function R(u,m){var g=e.gd._fullLayout,v=g[e.id],x=_(A+u*t._invScaleX,C+m*t._invScaleY),b=B(x-I);if(L=E+b,l.frontplot.attr("transform",s(e.xOffset2,e.yOffset2)+o([-b,f,y])),e.vangles){P=e.radialAxisAngle+b;var w=s(d,p)+o(-b),k=s(d,p)+o(-P);l.bg.attr("transform",w),l["radial-grid"].attr("transform",w),l["radial-axis"].attr("transform",k),l["radial-line"].select("line").attr("transform",k),e.updateRadialAxisTitle(g,v,P)}else e.clipPaths.forTraces.select("path").attr("transform",s(f,y)+o(b));O.each((function(){var t=r.select(this),e=c.getTranslate(t);t.attr("transform",s(e.x,e.y)+o([b]))})),D.each((function(){var t=r.select(this),e=t.select("text"),n=c.getTranslate(t);t.attr("transform",o([b,e.attr("x"),e.attr("y")])+s(n.x,n.y))})),h.rotation=a.modHalf(L,360),e.updateAngularAxis(g,v),e._hasClipOnAxisFalse&&!a.isFullCircle(e.sectorInRad)&&z.call(c.hideOutsideRangePoints,e);var M=!1;for(var R in e.traceHash)if(i.traceIs(R,"gl")){var j=e.traceHash[R],N=a.filterVisible(j);j[0][0].trace._module.plot(n,e,N,v),N.length&&(M=!0)}M&&(T(n),S(n));var U={};F(U),n.emit("plotly_relayouting",U)}function F(t){t[e.id+".angularaxis.rotation"]=L,e.vangles&&(t[e.id+".radialaxis.angle"]=P)}function j(){D.select("text").attr("transform",null);var t={};F(t),i.call("_guiRelayout",n,t)}b.prepFn=function(r,i,o){var s=t[e.id];E=s.angularaxis.rotation;var l=x.getBoundingClientRect();A=i-l.left,C=o-l.top,n._fullLayout._calcInverseTransform(n);var c=a.apply3DTransform(t._invTransform)(A,C);A=c[0],C=c[1],I=_(A,C),b.moveFn=R,b.doneFn=j,w(n)},e.vangles&&!a.isFullCircle(e.sectorInRad)&&(b.prepFn=a.noop,k(r.select(x),null)),g.init(b)},N.isPtInside=function(t){if(this.isSmith)return!0;var e=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(t.theta),i=this.radialAxis,o=i.c2l(t.r),s=i._rl;return(r?C.isPtInsidePolygon:a.isPtInsideSector)(o,n,s,e,r)},N.pathArc=function(t){var e=this.sectorInRad,r=this.vangles;return(r?C.pathPolygon:a.pathArc)(t,e[0],e[1],r)},N.pathSector=function(t){var e=this.sectorInRad,r=this.vangles;return(r?C.pathPolygon:a.pathSector)(t,e[0],e[1],r)},N.pathAnnulus=function(t,e){var r=this.sectorInRad,n=this.vangles;return(n?C.pathPolygonAnnulus:a.pathAnnulus)(t,e,r[0],r[1],n)},N.pathSubplot=function(){var t=this.innerRadius,e=this.radius;return t?this.pathAnnulus(t,e):this.pathSector(e)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}}}),xk=d({"src/plots/polar/layout_attributes.js"(t,e){var r=V(),n=Ee(),i=ka().attributes,a=se().extendFlat,o=Pt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,layer:n.layer},"plot","from-root"),c={visible:a({},n.visible,{dflt:!0}),type:a({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},autorange:a({},n.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:a({},n.minallowed,{editType:"plot"}),maxallowed:a({},n.maxallowed,{editType:"plot"}),range:a({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:n.categoryorder,categoryarray:n.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:n.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:a({},n.title.text,{editType:"plot",dflt:""}),font:a({},n.title.font,{editType:"plot"}),editType:"plot"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(c,s,l);var u={visible:a({},n.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:n.autotypenumbers,categoryorder:n.categoryorder,categoryarray:n.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(u,s,l),e.exports={domain:i({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:r.background},radialaxis:c,angularaxis:u,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),bk=d({"src/plots/polar/layout_defaults.js"(t,e){var r=se(),n=q(),i=ge(),a=qs(),o=_e().getSubplotData,s=De(),l=Re(),c=je(),u=Ne(),h=bi(),d=_i(),p=ir(),f=er(),m=xk(),g=fk(),y=mk(),v=y.axisNames;function x(t,e,a,f){var x=a("bgcolor");f.bgColor=n.combine(x,f.paper_bgcolor);var _=a("sector");a("hole");var w,k=o(f.fullData,y.name,f.id),T=f.layoutOut;function S(t,e){return a(w+"."+t,e)}for(var A=0;A<v.length;A++){w=v[A],r.isPlainObject(t[w])||(t[w]={});var M=t[w],C=i.newContainer(e,w);C._id=C._name=w,C._attr=f.id+"."+w,C._traceIndices=k.map((function(t){return t.index}));var E=y.axisName2dataArray[w],L=b(M,C,S,k,E,f);h(M,C,S,{axData:k,dataAttr:E});var P=S("visible");switch(g(C,e,T),S("uirevision",e.uirevision),C._m=1,w){case"radialaxis":S("minallowed"),S("maxallowed");var I,z=S("range"),O=C.getAutorangeDflt(z),D=S("autorange",O);!z||(null!==z[0]||null!==z[1])&&(null!==z[0]&&null!==z[1]||"reversed"!==D&&!0!==D)&&(null===z[0]||"min"!==D&&"max reversed"!==D)&&(null===z[1]||"max"!==D&&"min reversed"!==D)||(z=void 0,delete C.range,C.autorange=!0,I=!0),I||(D=S("autorange",O=C.getAutorangeDflt(z))),M.autorange=D,D&&(p(S,D,z),"linear"!==L&&"-"!==L||S("rangemode"),C.isReversed()&&(C._m=-1)),C.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if("date"===L){r.log("Polar plots do not support date angular axes yet.");for(var R=0;R<k.length;R++)k[R].visible=!1;L=M.type=C.type="linear"}S("linear"===L?"thetaunit":"period");var F=S("direction");S("rotation",{counterclockwise:0,clockwise:90}[F])}if(u(M,C,S,C.type,{tickSuffixDflt:"degrees"===C.thetaunit?"\xb0":void 0}),P){var B,j,N,U,V,q,$,H,W,G,Y=f.font||{};j=(B=S("color"))===M.color?B:Y.color,N=Y.size,U=Y.family,V=Y.weight,q=Y.style,$=Y.variant,H=Y.textcase,W=Y.lineposition,G=Y.shadow,s(M,C,S,C.type),c(M,C,S,C.type,{font:{weight:V,style:q,variant:$,textcase:H,lineposition:W,shadow:G,color:j,size:N,family:U},noAutotickangles:"angularaxis"===w,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(M,C,S,{outerTicks:!0}),d(M,C,S,{dfltColor:B,bgColor:f.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[w]}),S("layer"),"radialaxis"===w&&(S("side"),S("angle",_[0]),S("title.text"),r.coerceFont(S,"title.font",{weight:V,style:q,variant:$,textcase:H,lineposition:W,shadow:G,color:j,size:r.bigFont(N),family:U}))}"category"!==L&&S("hoverformat"),C._input=M}"category"===e.angularaxis.type&&a("gridshape")}function b(t,e,r,n,i,a){var o=r("autotypenumbers",a.autotypenumbersDflt);if("-"===r("type")){for(var s,l=0;l<n.length;l++)if(n[l].visible){s=n[l];break}s&&s[i]&&(e.type=f(s[i],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),"-"===e.type?e.type="linear":t.type=e.type}return e.type}e.exports=function(t,e,r){a(t,e,r,{type:y.name,attributes:m,handleDefaults:x,font:e.font,autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}}}),_k=d({"src/plots/polar/index.js"(t,e){var r=_e().getSubplotCalcData,n=se().counterRegex,i=vk(),a=mk(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:xk(),supplyLayoutDefaults:bk(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=e[l]._subplot;u||(u=i(t,l),e[l]._subplot=u),u.plot(c,e,t._promises)}},clean:function(t,e,r,n){for(var i=n._subplots[s]||[],a=n._has&&n._has("gl"),o=e._has&&e._has("gl"),l=a&&!o,c=0;c<i.length;c++){var u=i[c],h=n[u]._subplot;if(!e[u]&&h)for(var d in h.framework.remove(),h.layers["radial-axis-title"].remove(),h.clipPaths)h.clipPaths[d].remove();l&&h._scene&&(h._scene.destroy(),h._scene=null)}},toSVG:Ai().toSVG}}}),wk=d({"src/traces/scatterpolar/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=D().extendFlat,a=_n(),o=wn(),s=N(),l=o.line;e.exports={mode:o.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["r","theta","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}}),kk=d({"src/traces/scatterpolar/defaults.js"(t,e){var r=se(),n=Ge(),i=Wn(),a=Gn(),o=Yn(),s=Zn(),l=Xn(),c=bn().PTS_LINESONLY,u=wk();function h(t,e,n,i){var a,o=i("r"),s=i("theta");if(r.isTypedArray(o)&&(e.r=o=Array.from(o)),r.isTypedArray(s)&&(e.theta=s=Array.from(s)),o)s?a=Math.min(o.length,s.length):(a=o.length,i("theta0"),i("dtheta"));else{if(!s)return 0;a=e.theta.length,i("r0"),i("dr")}return e._length=a,a}e.exports={handleRThetaDefaults:h,supplyDefaults:function(t,e,d,p){function f(n,i){return r.coerce(t,e,u,n,i)}var m=h(0,e,0,f);if(m){f("thetaunit"),f("mode",m<c?"lines+markers":"lines"),f("text"),f("hovertext"),"fills"!==e.hoveron&&f("hovertemplate"),n.hasMarkers(e)&&i(t,e,d,p,f,{gradient:!0}),n.hasLines(e)&&(a(t,e,d,p,f,{backoff:!0}),o(t,e,f),f("connectgaps")),n.hasText(e)&&(f("texttemplate"),s(t,e,p,f));var g=[];(n.hasMarkers(e)||n.hasText(e))&&(f("cliponaxis"),f("marker.maxdisplayed"),g.push("points")),f("fill"),"none"!==e.fill&&(l(t,e,d,f),n.hasLines(e)||o(t,e,f)),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),f("hoveron",g.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}}),Tk=d({"src/traces/scatterpolar/format_labels.js"(t,e){var r=se(),n=nr();e.exports=function(t,e,i){var a,o,s={},l=i[e.subplot]._subplot;l?(a=l.radialAxis,o=l.angularAxis):(a=(l=i[e.subplot]).radialaxis,o=l.angularaxis);var c=a.c2l(t.r);s.rLabel=n.tickText(a,c,!0).text;var u="degrees"===o.thetaunit?r.rad2deg(t.theta):t.theta;return s.thetaLabel=n.tickText(o,u,!0).text,s}}}),Sk=d({"src/traces/scatterpolar/calc.js"(t,e){var r=k(),n=T().BADNUM,i=nr(),a=ri(),o=ni(),s=ii(),l=ai().calcMarkerSize;e.exports=function(t,e){for(var c=t._fullLayout,u=e.subplot,h=c[u].radialaxis,d=c[u].angularaxis,p=h.makeCalcdata(e,"r"),f=d.makeCalcdata(e,"theta"),m=e._length,g=new Array(m),y=0;y<m;y++){var v=p[y],x=f[y],b=g[y]={};r(v)&&r(x)?(b.r=v,b.theta=x):b.r=n}var _=l(e,m);return e._extremes.x=i.findExtremes(h,p,{ppad:_}),a(t,e),o(g,e),s(g,e),g}}}),Ak=d({"src/traces/scatterpolar/plot.js"(t,e){var r=hi(),n=T().BADNUM;e.exports=function(t,e,i){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=e.angularAxis,h=0;h<i.length;h++)for(var d=i[h],p=0;p<d.length;p++){0===p&&(d[0].trace._xA=o,d[0].trace._yA=s);var f=d[p],m=f.r;if(m===n)f.x=f.y=n;else{var g=c.c2g(m),y=u.c2g(f.theta);f.x=g*Math.cos(y),f.y=g*Math.sin(y)}}r(t,l,i,a)}}}),Mk=d({"src/traces/scatterpolar/hover.js"(t,e){var r=gi();function n(t,e,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="r",a._hovertitle="\u03b8";var o={};o[e.subplot]={_subplot:r};var s=e._module.formatLabels(t,e,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=t.hi||e.hoverinfo,c=[];function u(t,e){c.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["r","theta","text"]),-1!==h.indexOf("r")&&u(i,n.rLabel),-1!==h.indexOf("theta")&&u(a,n.thetaLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),Ck=d({"src/traces/scatterpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_k(),categories:["polar","symbols","showLegend","scatter-like"],attributes:wk(),supplyDefaults:kk().supplyDefaults,colorbar:di(),formatLabels:Tk(),calc:Sk(),plot:Ak(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Mk().hoverPoints,selectPoints:yi(),meta:{}}}}),Ek=d({"lib/scatterpolar.js"(t,e){e.exports=Ck()}}),Lk=d({"src/traces/scatterpolargl/attributes.js"(t,e){var r=wk(),n=Og(),i=Ot().texttemplateAttrs;e.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),Pk=d({"src/traces/scatterpolargl/defaults.js"(t,e){var r=se(),n=Ge(),i=kk().handleRThetaDefaults,a=Wn(),o=Gn(),s=Zn(),l=Xn(),c=bn().PTS_LINESONLY,u=Lk();e.exports=function(t,e,h,d){function p(n,i){return r.coerce(t,e,u,n,i)}var f=i(t,e,d,p);f?(p("thetaunit"),p("mode",f<c?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),n.hasMarkers(e)&&a(t,e,h,d,p,{noAngleRef:!0,noStandOff:!0}),n.hasLines(e)&&(o(t,e,h,d,p),p("connectgaps")),n.hasText(e)&&(p("texttemplate"),s(t,e,d,p,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),p("fill"),"none"!==e.fill&&l(t,e,h,p),r.coerceSelectionMarkerOpacity(e,p)):e.visible=!1}}}),Ik=d({"src/traces/scatterpolargl/format_labels.js"(t,e){var r=Tk();e.exports=function(t,e,n){var i=t.i;return"r"in t||(t.r=e._r[i]),"theta"in t||(t.theta=e._theta[i]),r(t,e,n)}}}),zk=d({"src/traces/scatterpolargl/calc.js"(t,e){var r=ri(),n=ai().calcMarkerSize,i=ny(),a=nr(),o=zg().TOO_MANY_POINTS;e.exports=function(t,e){var s=t._fullLayout,l=e.subplot,c=s[l].radialaxis,u=s[l].angularaxis,h=e._r=c.makeCalcdata(e,"r"),d=e._theta=u.makeCalcdata(e,"theta"),p=e._length,f={};p<h.length&&(h=h.slice(0,p)),p<d.length&&(d=d.slice(0,p)),f.r=h,f.theta=d,r(t,e);var m,g=f.opts=i.style(t,e);return p<o?m=n(e,p):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),e._extremes.x=a.findExtremes(c,h,{ppad:m}),[{x:!1,y:!1,t:f,trace:e}]}}}),Ok=d({"src/traces/scatterpolargl/hover.js"(t,e){var r=Ig(),n=Mk().makeHoverPointText;e.exports={hoverPoints:function(t,e,i,a){var o=t.cd[0].t,s=o.r,l=o.theta,c=r.hoverPoints(t,e,i,a);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var h=t.subplot,d=u.cd[u.index],p=u.trace;if(d.r=s[u.index],d.theta=l[u.index],h.isPtInside(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,n(d,p,h,u),c}}}}}),Dk=d({"src/traces/scatterpolargl/base_index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:_k(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:Lk(),supplyDefaults:Pk(),colorbar:di(),formatLabels:Ik(),calc:zk(),hoverPoints:Ok().hoverPoints,selectPoints:sy(),meta:{}}}}),Rk=d({"src/traces/scatterpolargl/plot.js"(t,e){var r=Gg(),n=k(),i=hx(),a=iy(),o=ny(),s=se(),l=zg().TOO_MANY_POINTS;e.exports=function(t,e,c){if(c.length){var u=e.radialAxis,h=e.angularAxis,d=a(t,e);return c.forEach((function(i){if(i&&i[0]&&i[0].trace){var a,c=i[0],p=c.trace,f=c.t,m=p._length,g=f.r,y=f.theta,v=f.opts,x=g.slice(),b=y.slice();for(a=0;a<g.length;a++)e.isPtInside({r:g[a],theta:y[a]})||(x[a]=NaN,b[a]=NaN);var _=new Array(2*m),w=Array(m),k=Array(m);for(a=0;a<m;a++){var T,S,A=x[a];if(n(A)){var M=u.c2g(A),C=h.c2g(b[a],p.thetaunit);T=M*Math.cos(C),S=M*Math.sin(C)}else T=S=NaN;w[a]=_[2*a]=T,k[a]=_[2*a+1]=S}f.tree=r(_),v.marker&&m>=l&&(v.marker.cluster=f.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&s.extendFlat(v.line,o.linePositions(t,p,_)),v.text&&(s.extendFlat(v.text,{positions:_},o.textPosition(t,p,v.text,v.marker)),s.extendFlat(v.textSel,{positions:_},o.textPosition(t,p,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:_},o.textPosition(t,p,v.text,v.markerUnsel))),v.fill&&!d.fill2d&&(d.fill2d=!0),v.marker&&!d.scatter2d&&(d.scatter2d=!0),v.line&&!d.line2d&&(d.line2d=!0),v.text&&!d.glText&&(d.glText=!0),d.lineOptions.push(v.line),d.fillOptions.push(v.fill),d.markerOptions.push(v.marker),d.markerSelectedOptions.push(v.markerSel),d.markerUnselectedOptions.push(v.markerUnsel),d.textOptions.push(v.text),d.textSelectedOptions.push(v.textSel),d.textUnselectedOptions.push(v.textUnsel),d.selectBatch.push([]),d.unselectBatch.push([]),f.x=w,f.y=k,f.rawx=w,f.rawy=k,f.r=g,f.theta=y,f.positions=_,f._scene=d,f.index=d.count,d.count++}})),i(t,e,c)}},e.exports.reglPrecompiled={}}}),Fk=d({"src/traces/scatterpolargl/index.js"(t,e){var r=Dk();r.plot=Rk(),e.exports=r}}),Bk=d({"lib/scatterpolargl.js"(t,e){e.exports=Fk()}}),jk=d({"src/traces/barpolar/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=D().extendFlat,i=wk(),a=$a();e.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:n({},a.base,{}),offset:n({},a.offset,{}),width:n({},a.width,{}),text:n({},a.text,{}),hovertext:n({},a.hovertext,{}),marker:function(){var t=n({},a.marker);return delete t.cornerradius,t}(),hoverinfo:i.hoverinfo,hovertemplate:r(),selected:a.selected,unselected:a.unselected}}}),Nk=d({"src/traces/barpolar/layout_attributes.js"(t,e){e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Uk=d({"src/traces/barpolar/defaults.js"(t,e){var r=se(),n=kk().handleRThetaDefaults,i=Wa(),a=jk();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}n(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,o,s),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}}}),Vk=d({"src/traces/barpolar/layout_defaults.js"(t,e){var r=se(),n=Nk();e.exports=function(t,e,i){var a,o={};function s(i,o){return r.coerce(t[a]||{},e[a],n,i,o)}for(var l=0;l<i.length;l++){var c=i[l];"barpolar"===c.type&&!0===c.visible&&(o[a=c.subplot]||(s("barmode"),s("bargap"),o[a]=1))}}}}),qk=d({"src/traces/barpolar/calc.js"(t,e){var r=Me().hasColorscale,n=He(),i=se().isArrayOrTypedArray,a=Za(),o=si().setGroupPositions,s=ii(),l=Vt().traceIs,c=se().extendFlat;e.exports={calc:function(t,e){for(var o=t._fullLayout,l=e.subplot,c=o[l].radialaxis,u=o[l].angularaxis,h=c.makeCalcdata(e,"r"),d=u.makeCalcdata(e,"theta"),p=e._length,f=new Array(p),m=h,g=d,y=0;y<p;y++)f[y]={p:g[y],s:m[y]};function v(t){var r=e[t];void 0!==r&&(e["_"+t]=i(r)?u.makeCalcdata(e,t):u.d2c(r,e.thetaunit))}return"linear"===u.type&&(v("width"),v("offset")),r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(f,e),s(f,e),f},crossTraceCalc:function(t,e,r){for(var n=t.calcdata,i=[],a=0;a<n.length;a++){var s=n[a],u=s[0].trace;!0===u.visible&&l(u,"bar")&&u.subplot===r&&i.push(s)}var h=c({},e.radialaxis,{_id:"x"}),d=e.angularaxis;o(t,d,h,i,{mode:e.barmode,norm:e.barnorm,gap:e.bargap,groupgap:e.bargroupgap})}}}}),$k=d({"src/traces/barpolar/plot.js"(t,e){var r=v(),n=k(),i=se(),a=Je(),o=gk();e.exports=function(t,e,s){var l=t._context.staticPlot,c=e.xaxis,u=e.yaxis,h=e.radialAxis,d=e.angularAxis,p=function(t){var e=t.cxx,r=t.cyy;return t.vangles?function(n,a,s,l){var c,u;i.angleDelta(s,l)>0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),f=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(f,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,a=r.select(this),o=t.rp0=h.c2p(t.s0),s=t.rp1=h.c2p(t.s1),l=t.thetag0=d.c2g(t.p0),f=t.thetag1=d.c2g(t.p1);if(n(o)&&n(s)&&n(l)&&n(f)&&o!==s&&l!==f){var m=h.c2g(t.s1),g=(l+f)/2;t.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],e=p(o,s,l,f)}else e="M0,0Z";i.ensureSingle(a,"path").attr("d",e)})),a.setClipUrl(o,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}}}),Hk=d({"src/traces/barpolar/hover.js"(t,e){var r=zr(),n=se(),i=eo().getTraceColor,a=n.fillText,o=Mk().makeHoverPointText,s=gk().isPtInsidePolygon;e.exports=function(t,e,l){var c=t.cd,u=c[0].trace,h=t.subplot,d=h.radialAxis,p=h.angularAxis,f=h.vangles,m=f?s:n.isPtInsideSector,g=t.maxHoverDistance,y=p._period||2*Math.PI,v=Math.abs(d.g2p(Math.sqrt(e*e+l*l))),x=Math.atan2(l,e);if(d.range[0]>d.range[1]&&(x+=Math.PI),r.getClosest(c,(function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],f)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=n.extendFlat({},b,{r:b.s,theta:b.p});return a(b,u,t),o(_,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}}}),Wk=d({"src/traces/barpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:_k(),categories:["polar","bar","showLegend"],attributes:jk(),layoutAttributes:Nk(),supplyDefaults:Uk(),supplyLayoutDefaults:Vk(),calc:qk().calc,crossTraceCalc:qk().crossTraceCalc,plot:$k(),colorbar:di(),formatLabels:Tk(),style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:Hk(),selectPoints:no(),meta:{}}}}),Gk=d({"lib/barpolar.js"(t,e){e.exports=Wk()}}),Yk=d({"src/plots/smith/constants.js"(t,e){e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),Zk=d({"src/plots/smith/layout_attributes.js"(t,e){var r=V(),n=Ee(),i=ka().attributes,a=se().extendFlat,o=Pt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);e.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),Xk=d({"src/plots/smith/layout_defaults.js"(t,e){var r=se(),n=q(),i=ge(),a=qs(),o=_e().getSubplotData,s=Ne(),l=je(),c=_i(),u=tr(),h=Zk(),d=Yk(),p=d.axisNames,f=function(t,e){var r={};return function(n){var i=e?e(n):n;if(i in r)return r[i];var a=t(n);return r[i]=a,a}}((function(t){return r.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map((function(t){return-t})).concat([0]).concat(t)}),String);function m(t,e,a,m){var g=a("bgcolor");m.bgColor=n.combine(g,m.paper_bgcolor);var y,v=o(m.fullData,d.name,m.id),x=m.layoutOut;function b(t,e){return a(y+"."+t,e)}for(var _=0;_<p.length;_++){y=p[_],r.isPlainObject(t[y])||(t[y]={});var w=t[y],k=i.newContainer(e,y);k._id=k._name=y,k._attr=m.id+"."+y,k._traceIndices=v.map((function(t){return t.index}));var T=b("visible");if(k.type="linear",u(k,x),s(w,k,b,k.type),T){var S,A,M,C,E="realaxis"===y;E&&b("side"),E?b("tickvals"):b("tickvals",f(e.realaxis.tickvals||h.realaxis.tickvals.dflt)),r.isTypedArray(k.tickvals)&&(k.tickvals=Array.from(k.tickvals));var L=m.font||{};T&&(A=(S=b("color"))===w.color?S:L.color,M=L.size,C=L.family),l(w,k,b,k.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!E,noExp:!0,font:{color:A,size:M,family:C}}),r.coerce2(t,e,h,y+".ticklen"),r.coerce2(t,e,h,y+".tickwidth"),r.coerce2(t,e,h,y+".tickcolor",e.color),b("ticks")||(delete e[y].ticklen,delete e[y].tickwidth,delete e[y].tickcolor),c(w,k,b,{dfltColor:S,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:h[y]}),b("layer")}b("hoverformat"),delete k.type,k._input=w}}e.exports=function(t,e,r){a(t,e,r,{noUirevision:!0,type:d.name,attributes:h,handleDefaults:m,font:e.font,paper_bgcolor:e.paper_bgcolor,fullData:r,layoutOut:e})}}}),Kk=d({"src/plots/smith/index.js"(t,e){var r=_e().getSubplotCalcData,n=se().counterRegex,i=vk(),a=Yk(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},e.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:Zk(),supplyLayoutDefaults:Xk(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,a=e._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=e[l]._subplot;u||(u=i(t,l,!0),e[l]._subplot=u),u.plot(c,e,t._promises)}},clean:function(t,e,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a],l=n[o]._subplot;if(!e[o]&&l)for(var c in l.framework.remove(),l.clipPaths)l.clipPaths[c].remove()}},toSVG:Ai().toSVG}}}),Jk=d({"src/traces/scattersmith/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=D().extendFlat,a=_n(),o=wn(),s=N(),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}}),Qk=d({"src/traces/scattersmith/defaults.js"(t,e){var r=se(),n=Ge(),i=Wn(),a=Gn(),o=Yn(),s=Zn(),l=Xn(),c=bn().PTS_LINESONLY,u=Jk();e.exports=function(t,e,h,d){function p(n,i){return r.coerce(t,e,u,n,i)}var f=function(t,e,n,i){var a,o=i("real"),s=i("imag");return o&&s&&(a=Math.min(o.length,s.length)),r.isTypedArray(o)&&(e.real=o=Array.from(o)),r.isTypedArray(s)&&(e.imag=s=Array.from(s)),e._length=a,a}(0,e,0,p);if(f){p("mode",f<c?"lines+markers":"lines"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),n.hasMarkers(e)&&i(t,e,h,d,p,{gradient:!0}),n.hasLines(e)&&(a(t,e,h,d,p,{backoff:!0}),o(t,e,p),p("connectgaps")),n.hasText(e)&&(p("texttemplate"),s(t,e,d,p));var m=[];(n.hasMarkers(e)||n.hasText(e))&&(p("cliponaxis"),p("marker.maxdisplayed"),m.push("points")),p("fill"),"none"!==e.fill&&(l(t,e,h,p),n.hasLines(e)||o(t,e,p)),"tonext"!==e.fill&&"toself"!==e.fill||m.push("fills"),p("hoveron",m.join("+")||"points"),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}}),tT=d({"src/traces/scattersmith/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot;return i.realLabel=r.tickText(a.radialAxis,t.real,!0).text,i.imagLabel=r.tickText(a.angularAxis,t.imag,!0).text,i}}}),eT=d({"src/traces/scattersmith/calc.js"(t,e){var r=k(),n=T().BADNUM,i=ri(),a=ni(),o=ii(),s=ai().calcMarkerSize;e.exports=function(t,e){for(var l=t._fullLayout,c=e.subplot,u=l[c].realaxis,h=l[c].imaginaryaxis,d=u.makeCalcdata(e,"real"),p=h.makeCalcdata(e,"imag"),f=e._length,m=new Array(f),g=0;g<f;g++){var y=d[g],v=p[g],x=m[g]={};r(y)&&r(v)?(x.real=y,x.imag=v):x.real=n}return s(e,f),i(t,e),a(m,e),o(m,e),m}}}),rT=d({"src/traces/scattersmith/plot.js"(t,e){var r=hi(),n=T().BADNUM,i=yk().smith;e.exports=function(t,e,a){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u<a.length;u++)for(var h=a[u],d=0;d<h.length;d++){0===d&&(h[0].trace._xA=s,h[0].trace._yA=l);var p=h[d],f=p.real;if(f===n)p.x=p.y=n;else{var m=i([f,p.imag]);p.x=m[0],p.y=m[1]}}r(t,c,a,o)}}}),nT=d({"src/traces/scattersmith/hover.js"(t,e){var r=gi();function n(t,e,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="real",a._hovertitle="imag";var o={};o[e.subplot]={_subplot:r};var s=e._module.formatLabels(t,e,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=t.hi||e.hoverinfo,c=[];function u(t,e){c.push(t._hovertitle+": "+e)}if(!e.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["real","imag","text"]),-1!==h.indexOf("real")&&u(i,n.realLabel),-1!==h.indexOf("imag")&&u(a,n.imagLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),iT=d({"src/traces/scattersmith/index.js"(t,e){e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Kk(),categories:["smith","symbols","showLegend","scatter-like"],attributes:Jk(),supplyDefaults:Qk(),colorbar:di(),formatLabels:tT(),calc:eT(),plot:rT(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:nT().hoverPoints,selectPoints:yi(),meta:{}}}}),aT=d({"lib/scattersmith.js"(t,e){e.exports=iT()}}),oT=d({"node_modules/world-calendars/dist/main.js"(t,e){var r=uy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}r(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),r(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(t,e,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===e[0]||t.year()>0!==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return l.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(l.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,t.calendar().local.name);return t}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(a){throw this._validateLevel--,a}}}),s.prototype=new o,r(s.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(t=e.year()+(e.year()<0?1:0))%4===0&&(t%100!==0||t%400===0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25),n=1524+(r=e+1+r-Math.floor(r/4)),i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var l=e.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),sT=d({"node_modules/world-calendars/dist/plus.js"(){var t=uy(),e=oT();t(e.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),e.local=e.regionalOptions[""],t(e.cdate.prototype,{formatDate:function(t,e){return"string"!==typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),t(e.baseCalendar.prototype,{UNIX_EPOCH:e.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:e.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,r,n){if("string"!==typeof t&&(n=r,r=t,t=""),!r)return"";if(r.calendar()!==this)throw e.local.invalidFormat||e.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var i,a=(n=n||{}).dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.monthNumbers||this.local.monthNumbers,l=n.monthNamesShort||this.local.monthNamesShort,c=n.monthNames||this.local.monthNames,u=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n<t.length&&t.charAt(x+n)===e;)n++;return x+=n-1,Math.floor(n/(r||1))>1}),h=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length<r;)i="0"+i;return i},d=function(t,e,r,n){return u(t)?n[e]:r[e]},p=this,f=function(t,e){return e?"function"===typeof c?c.call(p,t):c[t.month()-p.minMonth]:"function"===typeof l?l.call(p,t):l[t.month()-p.minMonth]},m=this.local.digits,g=function(t){return n.localNumbers&&m?m(t):t},y="",v=!1,x=0;x<t.length;x++)if(v)"'"!==t.charAt(x)||u("'")?y+=t.charAt(x):v=!1;else switch(t.charAt(x)){case"d":y+=g(h("d",r.day(),2));break;case"D":y+=d("D",r.dayOfWeek(),a,o);break;case"o":y+=h("o",r.dayOfYear(),3);break;case"w":y+=h("w",r.weekOfYear(),2);break;case"m":y+=(i=r,"function"===typeof s?s.call(p,i,u("m")):g(h("m",i.month(),2)));break;case"M":y+=f(r,u("M"));break;case"y":y+=u("y",2)?r.year():(r.year()%100<10?"0":"")+r.year()%100;break;case"Y":u("Y",2),y+=r.formatYear();break;case"J":y+=r.toJD();break;case"@":y+=(r.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":y+=(r.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?y+="'":v=!0;break;default:y+=t.charAt(x)}return y},parseDate:function(t,r,n){if(null==r)throw e.local.invalidArguments||e.regionalOptions[""].invalidArguments;if(""===(r="object"===typeof r?r.toString():r+""))return null;t=t||this.local.dateFormat;var i=(n=n||{}).shortYearCutoff||this.shortYearCutoff;i="string"!==typeof i?i:this.today().year()%100+parseInt(i,10);for(var a=n.dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.parseMonth||this.local.parseMonth,l=n.monthNumbers||this.local.monthNumbers,c=n.monthNamesShort||this.local.monthNamesShort,u=n.monthNames||this.local.monthNames,h=-1,d=-1,p=-1,f=-1,m=-1,g=!1,y=!1,v=function(e,r){for(var n=1;A+n<t.length&&t.charAt(A+n)===e;)n++;return A+=n-1,Math.floor(n/(r||1))>1},x=function(t,n){var i=v(t,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(S).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,S);return S+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"===typeof l){v("m");var t=l.call(b,r.substring(S));return S+=t.length,t}return x("m")},w=function(t,n,i,a){for(var o=v(t,a)?i:n,s=0;s<o.length;s++)if(r.substr(S,o[s].length).toLowerCase()===o[s].toLowerCase())return S+=o[s].length,s+b.minMonth;throw(e.local.unknownNameAt||e.regionalOptions[""].unknownNameAt).replace(/\{0\}/,S)},k=function(){if("function"===typeof u){var t=v("M")?u.call(b,r.substring(S)):c.call(b,r.substring(S));return S+=t.length,t}return w("M",c,u)},T=function(){if(r.charAt(S)!==t.charAt(A))throw(e.local.unexpectedLiteralAt||e.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,S);S++},S=0,A=0;A<t.length;A++)if(y)"'"!==t.charAt(A)||v("'")?T():y=!1;else switch(t.charAt(A)){case"d":f=x("d");break;case"D":w("D",a,o);break;case"o":m=x("o");break;case"w":x("w");break;case"m":p=_();break;case"M":p=k();break;case"y":var M=A;g=!v("y",2),A=M,d=x("y",2);break;case"Y":d=x("Y",2);break;case"J":h=x("J")+.5,"."===r.charAt(S)&&(S++,x("J"));break;case"@":h=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":S=r.length;break;case"'":v("'")?T():y=!0;break;default:T()}if(S<r.length)throw e.local.unexpectedText||e.regionalOptions[""].unexpectedText;if(-1===d?d=this.today().year():d<100&&g&&(d+=-1===i?1900:this.today().year()-this.today().year()%100-(d<=i?0:100)),"string"===typeof p&&(p=s.call(this,d,p)),m>-1){p=1,f=m;for(var C=this.daysInMonth(d,p);f>C;C=this.daysInMonth(d,p))p++,f-=C}return h>-1?this.fromJD(h):this.newDate(d,p,f)},determineDate:function(t,e,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"===typeof t?function(t){try{return a.parseDate(n,t,i)}catch(l){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"===typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})}}),lT=d({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=oT(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"===typeof t){var r=t.match(a);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(n,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(t){if("string"===typeof t){var e=t.match(o);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"===typeof t){var e=t.match(s);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!==typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(e,r,n){var i=this.intercalaryMonth(e);if(n&&r!==i||r<1||r>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(e,r){e.year&&(r=(e=e.year()).month());var n=this.intercalaryMonth(e);if(r<0||r>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r<n?r+1:r:r+1},intercalaryMonth:function(t){return t=this._validateYear(t),l[t-l[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(e,n,i){var a,o=this._validateYear(e,t.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,n,i)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var n=l[e-l[0]];if(r>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,s,i,t.local.invalidDate);e=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(e,n),s=this.toChineseMonth(e,n),u=function(t,e,r,n,i){var a,o,s;if("object"===typeof t)o=t,a=e||{};else{var u;if(!("number"===typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:u}}s=o.day-1;var h,d=l[o.year-l[0]],p=d>>13;h=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var f=0;f<h;f++)s+=d&1<<12-f?30:29;var m=c[o.year-c[0]],g=new Date(m>>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(e,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=r.fromJD(t),n=function(t,e,r,n){var i,a;if("object"===typeof t)i=t,a=e||{};else{if(!("number"===typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=c[i.year-c[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=c[a.year-c[0]];var u,h=new Date(o>>9&4095,(o>>5&15)-1,31&o),d=new Date(i.year,i.month-1,i.day);u=Math.round((d-h)/864e5);var p,f=l[a.year-l[0]];for(p=0;p<13;p++){var m=f&1<<12-p?30:29;if(u<m)break;u-=m}var g=f>>13;return!g||p<g?(a.isIntercalary=!1,a.month=1+p):p===g?(a.isIntercalary=!0,a.month=p):(a.isIntercalary=!1,a.month=p),a.day=1+u,a}(e.year(),e.month(),e.day()),i=this.toMonthIndex(n.year,n.month,n.isIntercalary);return this.newDate(n.year,i,n.day)},fromString:function(t){var e=t.match(i),r=this._validateYear(+e[1]),n=+e[2],a=!!e[3],o=this.toMonthIndex(r,n,a),s=+e[4];return this.newDate(r,o,s)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var c=l.year(),u=l.month(),h=this.isIntercalaryMonth(c,s),d=o&&h?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);d!==u&&l.month(d)}return l}});var i=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,a=/^\d?\d[iI]?/m,o=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,s=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;t.calendars.chinese=n;var l=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],c=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]}}),cT=d({"node_modules/world-calendars/dist/calendars/coptic.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.coptic=r}}),uT=d({"node_modules/world-calendars/dist/calendars/discworld.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),13},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(e,r,n){return(this._validate(e,r,n,t.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=r}}),hT=d({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4===3||e%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.ethiopian=r}}),dT=d({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(t){return n(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),12===r&&this.leapYear(e)||8===r&&5===n(this.daysInYear(e),10)?30:9===r&&3===n(this.daysInYear(e),10)?29:this.daysPerMonth[r-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s<r;s++)o+=this.daysInMonth(e,s)}else for(s=7;s<r;s++)o+=this.daysInMonth(e,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,i=29*e+Math.floor(r/25920);return n(3*(i+1),7)<3&&i++,i},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);return this._delay1(t+1)-r===356?2:r-e===382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.hebrew=r}}),pT=d({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),e=e<=0?e+1:e,(n=i.day())+Math.ceil(29.5*(r-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.islamic=r}}),fT=d({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()<0?r.year()+1:r.year())%4===0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),n=i.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),t.calendars.julian=r}}),mT=d({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}function i(t,e){return n(t-1,e)+1}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year();var r=Math.floor(e/400);return e%=400,e+=e<0?400:0,r+"."+Math.floor(e/20)+"."+e%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate).day()},weekDay:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),!0},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=n(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,n(e,20)]},_toTzolkin:function(t){return[i(20+(t-=this.jdEpoch),20),i(t+4,13)]},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),t.calendars.mayan=r}}),gT=d({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar;var n=t.instance("gregorian");e(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidMonth);(e=a.year())<0&&e++;for(var o=a.day(),s=1;s<a.month();s++)o+=this.daysPerMonth[s-1];return o+n.toJD(e+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),t.calendars.nanakshahi=r}}),yT=d({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=t.instance(),o=0,s=r,l=e;this._createMissingCalendarData(e);var c=e-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var r=t.instance().fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)"undefined"===typeof this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),t.calendars.nepali=r}}),vT=d({"node_modules/world-calendars/dist/calendars/persian.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Ch\xe6harshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Ch\xe6","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 682*((r.year()-(r.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);e=a.year(),r=a.month(),i=a.day();var o=e-(e>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),i=n(e,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),t.calendars.persian=r,t.calendars.jalali=r}}),xT=d({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=oT(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),t.calendars.taiwan=n}}),bT=d({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=oT(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),t.calendars.thai=n}}),_T=d({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=oT(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(e,r){for(var i=this._validate(e,r,this.minDay,t.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;o<n.length;o++){if(n[o]>i)return n[a]-n[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,i=0;i<n.length&&!(n[i]>e);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=e-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(e,r,n){var i=t.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,r,n,i){var a=t.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),t.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),wT=d({"src/components/calendars/calendars.js"(t,e){e.exports=oT(),sT(),lT(),cT(),uT(),hT(),dT(),pT(),fT(),mT(),gT(),yT(),vT(),xT(),bT(),_T()}}),kT=d({"src/components/calendars/index.js"(t,e){var r=wT(),n=se(),i=T(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(t,e,r,i){var a={};return a[r]=s,n.coerce(t,e,a,r,i)},c="##",u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function d(t){var e=h[t];return e||(e=h[t]=r.instance(t))}function p(t){return n.extendFlat({},s,{description:t})}function f(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:p(f("x"))},g=n.extendFlat({},m,{ycalendar:p(f("y"))}),y=n.extendFlat({},g,{zcalendar:p(f("z"))}),v=p(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(t,e,r,n){for(var i=0;i<r.length;i++)l(t,e,r[i]+"calendar",n.calendar)},CANONICAL_SUNDAY:{chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},CANONICAL_TICK:{chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},DFLTRANGE:{chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},getCal:d,worldCalFmt:function(t,e,r){for(var n,i,s,l,h,p=Math.floor((e+.05)/o)+a,f=d(r).fromJD(p),m=0;-1!==(m=t.indexOf("%",m));)"0"===(n=t.charAt(m+1))||"-"===n||"_"===n?(s=3,i=t.charAt(m+2),"_"===n&&(n="-")):(i=n,n="0",s=2),(l=u[i])?(h=l===c?c:f.formatDate(l[n]),t=t.substr(0,m)+h+t.substr(m+s),m+=h.length):m+=s;return t}}}}),TT=d({"lib/calendars.js"(t,e){e.exports=kT()}}),ST=d({"lib/index.js"(t,e){var r=Va();r.register([ao(),xo(),$o(),Qo(),as(),Es(),zs(),Gs(),al(),bl(),Ol(),Eu(),Nu(),Wp(),uf(),wf(),If(),cm(),mm(),Tm(),Em(),Om(),Nm(),Hm(),_g(),Pg(),px(),Px(),tb(),lb(),Mb(),zb(),Vb(),c_(),m_(),T_(),H_(),Q_(),cw(),Dw(),Hw(),Jw(),lk(),pk(),Ek(),Bk(),Gk(),aT(),TT()]),e.exports=r}});return ST()})();return window.Plotly=t,t},t.exports?t.exports=r():e.moduleName=r()},8187:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n="object"==typeof global&&global&&global.Object===Object&&global},8194:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(7170),i=r(1458);const a=t=>{const{r:e,g:r,b:a}=i.A.parse(t),o=.2126*n.A.channel.toLinear(e)+.7152*n.A.channel.toLinear(r)+.0722*n.A.channel.toLinear(a);return n.A.lang.round(o)},o=t=>a(t)>=.5,s=t=>!o(t)},8205:(t,e,r)=>{"use strict";function n(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const e of t){const[t,r]=e;e[0]=(t-n)*o-(r-i)*s+n,e[1]=(t-n)*s+(r-i)*o+i}}}function i(t,e){return t[0]===e[0]&&t[1]===e[1]}function a(t,e,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=r,s=Math.max(e,.1),l=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,c=[0,0];if(o)for(const i of l)n(i,c,o);const u=function(t,e,r){const n=[];for(const u of t){const t=[...u];i(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&n.push(t)}const a=[];e=Math.max(e,.1);const o=[];for(const i of n)for(let t=0;t<i.length-1;t++){const e=i[t],r=i[t+1];if(e[1]!==r[1]){const t=Math.min(e[1],r[1]);o.push({ymin:t,ymax:Math.max(e[1],r[1]),x:t===e[1]?e[0]:r[0],islope:(r[0]-e[0])/(r[1]-e[1])})}}if(o.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!o.length)return a;let s=[],l=o[0].ymin,c=0;for(;s.length||o.length;){if(o.length){let t=-1;for(let e=0;e<o.length&&!(o[e].ymin>l);e++)t=e;o.splice(0,t+1).forEach((t=>{s.push({s:l,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=l))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==r||c%e==0)&&s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const r=s[t].edge,n=s[e].edge;a.push([[Math.round(r.x),l],[Math.round(n.x),l]])}l+=r,s.forEach((t=>{t.edge.x=t.edge.x+r*t.edge.islope})),c++}return a}(l,s,a);if(o){for(const t of l)n(t,c,-o);!function(t,e,r){const i=[];t.forEach((t=>i.push(...t))),n(i,e,r)}(u,c,-o)}return u}function o(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let o=1;return e.roughness>=1&&((null===(r=e.randomizer)||void 0===r?void 0:r.next())||Math.random())>.7&&(o=i),a(t,i,n,o||1)}r.d(e,{A:()=>it});class s{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const r=o(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){const r=[];for(const n of t)r.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return r}}function l(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class c extends s{fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);const n=o(t,Object.assign({},e,{hachureGap:r})),i=Math.PI/180*e.hachureAngle,a=[],s=.5*r*Math.cos(i),c=.5*r*Math.sin(i);for(const[o,u]of n)l([o,u])&&a.push([[o[0]-s,o[1]+c],[...u]],[[o[0]+s,o[1]-c],[...u]]);return{type:"fillSketch",ops:this.renderLines(a,e)}}}class u extends s{fillPolygons(t,e){const r=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,n);return r.ops=r.ops.concat(i.ops),r}}class h{constructor(t){this.helper=t}fillPolygons(t,e){const r=o(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){const r=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);const a=n/4;for(const o of t){const t=l(o),s=t/n,c=Math.ceil(s)-1,u=t-c*n,h=(o[0][0]+o[1][0])/2-n/4,d=Math.min(o[0][1],o[1][1]);for(let o=0;o<c;o++){const t=d+u+o*n,s=h-a+2*Math.random()*a,l=t-a+2*Math.random()*a,c=this.helper.ellipse(s,l,i,i,e);r.push(...c.ops)}}return{type:"fillSketch",ops:r}}}class d{constructor(t){this.helper=t}fillPolygons(t,e){const r=o(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){const r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,i=[];return t.forEach((t=>{const a=l(t),o=Math.floor(a/(r+n)),s=(a+n-o*(r+n))/2;let c=t[0],u=t[1];c[0]>u[0]&&(c=t[1],u=t[0]);const h=Math.atan((u[1]-c[1])/(u[0]-c[0]));for(let l=0;l<o;l++){const t=l*(r+n),a=t+r,o=[c[0]+t*Math.cos(h)+s*Math.cos(h),c[1]+t*Math.sin(h)+s*Math.sin(h)],u=[c[0]+a*Math.cos(h)+s*Math.cos(h),c[1]+a*Math.sin(h)+s*Math.sin(h)];i.push(...this.helper.doubleLineOps(o[0],o[1],u[0],u[1],e))}})),i}}class p{constructor(t){this.helper=t}fillPolygons(t,e){const r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?r:e.zigzagOffset,i=o(t,e=Object.assign({},e,{hachureGap:r+n}));return{type:"fillSketch",ops:this.zigzagLines(i,n,e)}}zigzagLines(t,e,r){const n=[];return t.forEach((t=>{const i=l(t),a=Math.round(i/(2*e));let o=t[0],s=t[1];o[0]>s[0]&&(o=t[1],s=t[0]);const c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let l=0;l<a;l++){const t=2*l*e,i=2*(l+1)*e,a=Math.sqrt(2*Math.pow(e,2)),s=[o[0]+t*Math.cos(c),o[1]+t*Math.sin(c)],u=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],h=[s[0]+a*Math.cos(c+Math.PI/4),s[1]+a*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(s[0],s[1],h[0],h[1],r),...this.helper.doubleLineOps(h[0],h[1],u[0],u[1],r))}})),n}}const f={};class m{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const g={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function y(t,e){return t.type===e}function v(t){const e=[],r=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",i=0,a=r[i];for(;!y(a,2);){let o=0;const s=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return v("M0,0"+t);i++,o=g[a.text],n=a.text}else y(a,1)?o=g[n]:(i++,o=g[a.text],n=a.text);if(!(i+o<r.length))throw new Error("Path data ended short");for(let t=i;t<i+o;t++){const e=r[t];if(!y(e,1))throw new Error("Param not a number: "+n+","+e.text);s[s.length]=+e.text}if("number"!=typeof g[n])throw new Error("Bad segment: "+n);{const t={key:n,data:s};e.push(t),i+=o,a=r[i],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function x(t){let e=0,r=0,n=0,i=0;const a=[];for(const{key:o,data:s}of t)switch(o){case"M":a.push({key:"M",data:[...s]}),[e,r]=s,[n,i]=s;break;case"m":e+=s[0],r+=s[1],a.push({key:"M",data:[e,r]}),n=e,i=r;break;case"L":a.push({key:"L",data:[...s]}),[e,r]=s;break;case"l":e+=s[0],r+=s[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...s]}),e=s[4],r=s[5];break;case"c":{const t=s.map(((t,n)=>n%2?t+r:t+e));a.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":a.push({key:"Q",data:[...s]}),e=s[2],r=s[3];break;case"q":{const t=s.map(((t,n)=>n%2?t+r:t+e));a.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":a.push({key:"A",data:[...s]}),e=s[5],r=s[6];break;case"a":e+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,r]});break;case"H":a.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),e=s[2],r=s[3];break;case"s":{const t=s.map(((t,n)=>n%2?t+r:t+e));a.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":a.push({key:"T",data:[...s]}),e=s[0],r=s[1];break;case"t":e+=s[0],r+=s[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function b(t){const e=[];let r="",n=0,i=0,a=0,o=0,s=0,l=0;for(const{key:c,data:u}of t){switch(c){case"M":e.push({key:"M",data:[...u]}),[n,i]=u,[a,o]=u;break;case"C":e.push({key:"C",data:[...u]}),n=u[4],i=u[5],s=u[2],l=u[3];break;case"L":e.push({key:"L",data:[...u]}),[n,i]=u;break;case"H":n=u[0],e.push({key:"L",data:[n,i]});break;case"V":i=u[0],e.push({key:"L",data:[n,i]});break;case"S":{let t=0,a=0;"C"===r||"S"===r?(t=n+(n-s),a=i+(i-l)):(t=n,a=i),e.push({key:"C",data:[t,a,...u]}),s=u[0],l=u[1],n=u[2],i=u[3];break}case"T":{const[t,a]=u;let o=0,c=0;"Q"===r||"T"===r?(o=n+(n-s),c=i+(i-l)):(o=n,c=i);const h=n+2*(o-n)/3,d=i+2*(c-i)/3,p=t+2*(o-t)/3,f=a+2*(c-a)/3;e.push({key:"C",data:[h,d,p,f,t,a]}),s=o,l=c,n=t,i=a;break}case"Q":{const[t,r,a,o]=u,c=n+2*(t-n)/3,h=i+2*(r-i)/3,d=a+2*(t-a)/3,p=o+2*(r-o)/3;e.push({key:"C",data:[c,h,d,p,a,o]}),s=t,l=r,n=a,i=o;break}case"A":{const t=Math.abs(u[0]),r=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],l=u[5],c=u[6];0===t||0===r?(e.push({key:"C",data:[n,i,l,c,l,c]}),n=l,i=c):n===l&&i===c||(w(n,i,l,c,t,r,a,o,s).forEach((function(t){e.push({key:"C",data:t})})),n=l,i=c);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=o}r=c}return e}function _(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function w(t,e,r,n,i,a,o,s,l,c){const u=(h=o,Math.PI*h/180);var h;let d=[],p=0,f=0,m=0,g=0;if(c)[p,f,m,g]=c;else{[t,e]=_(t,e,-u),[r,n]=_(r,n,-u);const o=(t-r)/2,c=(e-n)/2;let h=o*o/(i*i)+c*c/(a*a);h>1&&(h=Math.sqrt(h),i*=h,a*=h);const d=i*i,y=a*a,v=d*y-d*c*c-y*o*o,x=d*c*c+y*o*o,b=(s===l?-1:1)*Math.sqrt(Math.abs(v/x));m=b*i*c/a+(t+r)/2,g=b*-a*o/i+(e+n)/2,p=Math.asin(parseFloat(((e-g)/a).toFixed(9))),f=Math.asin(parseFloat(((n-g)/a).toFixed(9))),t<m&&(p=Math.PI-p),r<m&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let y=f-p;if(Math.abs(y)>120*Math.PI/180){const t=f,e=r,s=n;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=w(r=m+i*Math.cos(f),n=g+a*Math.sin(f),e,s,i,a,o,0,l,[f,t,m,g])}y=f-p;const v=Math.cos(p),x=Math.sin(p),b=Math.cos(f),k=Math.sin(f),T=Math.tan(y/4),S=4/3*i*T,A=4/3*a*T,M=[t,e],C=[t+S*x,e-A*v],E=[r+S*k,n-A*b],L=[r,n];if(C[0]=2*M[0]-C[0],C[1]=2*M[1]-C[1],c)return[C,E,L].concat(d);{d=[C,E,L].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const r=_(d[e][0],d[e][1],u),n=_(d[e+1][0],d[e+1][1],u),i=_(d[e+2][0],d[e+2][1],u);t.push([r[0],r[1],n[0],n[1],i[0],i[1]])}return t}}const k={randOffset:function(t,e){return R(t,e)},randOffsetWithRange:function(t,e,r){return D(t,e,r)},ellipse:function(t,e,r,n,i){return C(t,e,i,M(r,n,i)).opset},doubleLineOps:function(t,e,r,n,i){return F(t,e,r,n,i,!0)}};function T(t,e,r,n,i){return{type:"path",ops:F(t,e,r,n,i)}}function S(t,e,r){const n=(t||[]).length;if(n>2){const i=[];for(let e=0;e<n-1;e++)i.push(...F(t[e][0],t[e][1],t[e+1][0],t[e+1][1],r));return e&&i.push(...F(t[n-1][0],t[n-1][1],t[0][0],t[0][1],r)),{type:"path",ops:i}}return 2===n?T(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function A(t,e){if(t.length){const r="number"==typeof t[0][0]?[t]:t,n=j(r[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:j(r[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<r.length;t++){const a=r[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const e of r)"move"!==e.op&&i.push(e)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function M(t,e,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i;let o=Math.abs(t/2),s=Math.abs(e/2);const l=1-r.curveFitting;return o+=R(o*l,r),s+=R(s*l,r),{increment:a,rx:o,ry:s}}function C(t,e,r,n){const[i,a]=U(n.increment,t,e,n.rx,n.ry,1,n.increment*D(.1,D(.4,1,r),r),r);let o=N(i,null,r);if(!r.disableMultiStroke&&0!==r.roughness){const[i]=U(n.increment,t,e,n.rx,n.ry,1.5,0,r),a=N(i,null,r);o=o.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:o}}}function E(t,e,r,n,i,a,o,s,l){const c=t,u=e;let h=Math.abs(r/2),d=Math.abs(n/2);h+=R(.01*h,l),d+=R(.01*d,l);let p=i,f=a;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const m=2*Math.PI/l.curveStepCount,g=Math.min(m/2,(f-p)/2),y=V(g,c,u,h,d,p,f,1,l);if(!l.disableMultiStroke){const t=V(g,c,u,h,d,p,f,1.5,l);y.push(...t)}return o&&(s?y.push(...F(c,u,c+h*Math.cos(p),u+d*Math.sin(p),l),...F(c,u,c+h*Math.cos(f),u+d*Math.sin(f),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+h*Math.cos(p),u+d*Math.sin(p)]})),{type:"path",ops:y}}function L(t,e){const r=b(x(v(t))),n=[];let i=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...F(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[t,r,i,o,l,c]=s;n.push(...q(t,r,i,o,l,c,a,e)),a=[l,c];break}case"Z":n.push(...F(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function P(t,e){const r=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,i=n.length;if(i>2){r.push({op:"move",data:[n[0][0]+R(t,e),n[0][1]+R(t,e)]});for(let a=1;a<i;a++)r.push({op:"lineTo",data:[n[a][0]+R(t,e),n[a][1]+R(t,e)]})}}return{type:"fillPath",ops:r}}function I(t,e){return function(t,e){let r=t.fillStyle||"hachure";if(!f[r])switch(r){case"zigzag":f[r]||(f[r]=new c(e));break;case"cross-hatch":f[r]||(f[r]=new u(e));break;case"dots":f[r]||(f[r]=new h(e));break;case"dashed":f[r]||(f[r]=new d(e));break;case"zigzag-line":f[r]||(f[r]=new p(e));break;default:r="hachure",f[r]||(f[r]=new s(e))}return f[r]}(e,k).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function O(t){return t.randomizer||(t.randomizer=new m(t.seed||0)),t.randomizer.next()}function D(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return r.roughness*n*(O(r)*(e-t)+t)}function R(t,e){return D(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function F(t,e,r,n,i){const a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?i.disableMultiStrokeFill:i.disableMultiStroke,o=B(t,e,r,n,i,!0,!1);if(a)return o;const s=B(t,e,r,n,i,!0,!0);return o.concat(s)}function B(t,e,r,n,i,a,o){const s=Math.pow(t-r,2)+Math.pow(e-n,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=l/10);const h=u/2,d=.2+.2*O(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,f=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=R(p,i,c),f=R(f,i,c);const m=[],g=()=>R(h,i,c),y=()=>R(u,i,c),v=i.preserveVertices;return a&&(o?m.push({op:"move",data:[t+(v?0:g()),e+(v?0:g())]}):m.push({op:"move",data:[t+(v?0:R(u,i,c)),e+(v?0:R(u,i,c))]})),o?m.push({op:"bcurveTo",data:[p+t+(r-t)*d+g(),f+e+(n-e)*d+g(),p+t+2*(r-t)*d+g(),f+e+2*(n-e)*d+g(),r+(v?0:g()),n+(v?0:g())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*d+y(),f+e+(n-e)*d+y(),p+t+2*(r-t)*d+y(),f+e+2*(n-e)*d+y(),r+(v?0:y()),n+(v?0:y())]}),m}function j(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+R(e,r),t[0][1]+R(e,r)]),n.push([t[0][0]+R(e,r),t[0][1]+R(e,r)]);for(let i=1;i<t.length;i++)n.push([t[i][0]+R(e,r),t[i][1]+R(e,r)]),i===t.length-1&&n.push([t[i][0]+R(e,r),t[i][1]+R(e,r)]);return N(n,null,r)}function N(t,e,r){const n=t.length,i=[];if(n>3){const a=[],o=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const r=t[e];a[0]=[r[0],r[1]],a[1]=[r[0]+(o*t[e+1][0]-o*t[e-1][0])/6,r[1]+(o*t[e+1][1]-o*t[e-1][1])/6],a[2]=[t[e+1][0]+(o*t[e][0]-o*t[e+2][0])/6,t[e+1][1]+(o*t[e][1]-o*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=r.maxRandomnessOffset;i.push({op:"lineTo",data:[e[0]+R(t,r),e[1]+R(t,r)]})}}else 3===n?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&i.push(...B(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return i}function U(t,e,r,n,i,a,o,s){const l=[],c=[];if(0===s.roughness){t/=4,c.push([e+n*Math.cos(-t),r+i*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),r+i*Math.sin(a)];l.push(t),c.push(t)}c.push([e+n*Math.cos(0),r+i*Math.sin(0)]),c.push([e+n*Math.cos(t),r+i*Math.sin(t)])}else{const u=R(.5,s)-Math.PI/2;c.push([R(a,s)+e+.9*n*Math.cos(u-t),R(a,s)+r+.9*i*Math.sin(u-t)]);const h=2*Math.PI+u-.01;for(let o=u;o<h;o+=t){const t=[R(a,s)+e+n*Math.cos(o),R(a,s)+r+i*Math.sin(o)];l.push(t),c.push(t)}c.push([R(a,s)+e+n*Math.cos(u+2*Math.PI+.5*o),R(a,s)+r+i*Math.sin(u+2*Math.PI+.5*o)]),c.push([R(a,s)+e+.98*n*Math.cos(u+o),R(a,s)+r+.98*i*Math.sin(u+o)]),c.push([R(a,s)+e+.9*n*Math.cos(u+.5*o),R(a,s)+r+.9*i*Math.sin(u+.5*o)])}return[c,l]}function V(t,e,r,n,i,a,o,s,l){const c=a+R(.1,l),u=[];u.push([R(s,l)+e+.9*n*Math.cos(c-t),R(s,l)+r+.9*i*Math.sin(c-t)]);for(let h=c;h<=o;h+=t)u.push([R(s,l)+e+n*Math.cos(h),R(s,l)+r+i*Math.sin(h)]);return u.push([e+n*Math.cos(o),r+i*Math.sin(o)]),u.push([e+n*Math.cos(o),r+i*Math.sin(o)]),N(u,null,l)}function q(t,e,r,n,i,a,o,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let u=[0,0];const h=s.disableMultiStroke?1:2,d=s.preserveVertices;for(let p=0;p<h;p++)0===p?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(d?0:R(c[0],s)),o[1]+(d?0:R(c[0],s))]}),u=d?[i,a]:[i+R(c[p],s),a+R(c[p],s)],l.push({op:"bcurveTo",data:[t+R(c[p],s),e+R(c[p],s),r+R(c[p],s),n+R(c[p],s),u[0],u[1]]});return l}function $(t){return[...t]}function H(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(3===r)n.push($(t[0]),$(t[1]),$(t[2]),$(t[2]));else{const r=[];r.push(t[0],t[0]);for(let e=1;e<t.length;e++)r.push(t[e]),e===t.length-1&&r.push(t[e]);const i=[],a=1-e;n.push($(r[0]));for(let t=1;t+2<r.length;t++){const e=r[t];i[0]=[e[0],e[1]],i[1]=[e[0]+(a*r[t+1][0]-a*r[t-1][0])/6,e[1]+(a*r[t+1][1]-a*r[t-1][1])/6],i[2]=[r[t+1][0]+(a*r[t][0]-a*r[t+2][0])/6,r[t+1][1]+(a*r[t][1]-a*r[t+2][1])/6],i[3]=[r[t+1][0],r[t+1][1]],n.push(i[1],i[2],i[3])}}return n}function W(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function G(t,e,r){const n=W(e,r);if(0===n)return W(t,e);let i=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/n;return i=Math.max(0,Math.min(1,i)),W(t,Y(e,r,i))}function Y(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Z(t,e,r,n){const i=n||[];if(function(t,e){const r=t[e+0],n=t[e+1],i=t[e+2],a=t[e+3];let o=3*n[0]-2*r[0]-a[0];o*=o;let s=3*n[1]-2*r[1]-a[1];s*=s;let l=3*i[0]-2*a[0]-r[0];l*=l;let c=3*i[1]-2*a[1]-r[1];return c*=c,o<l&&(o=l),s<c&&(s=c),o+s}(t,e)<r){const r=t[e+0];i.length?(a=i[i.length-1],o=r,Math.sqrt(W(a,o))>1&&i.push(r)):i.push(r),i.push(t[e+3])}else{const n=.5,a=t[e+0],o=t[e+1],s=t[e+2],l=t[e+3],c=Y(a,o,n),u=Y(o,s,n),h=Y(s,l,n),d=Y(c,u,n),p=Y(u,h,n),f=Y(d,p,n);Z([a,c,d,f],0,r,i),Z([f,p,h,l],0,r,i)}var a,o;return i}function X(t,e){return K(t,0,t.length,e)}function K(t,e,r,n,i){const a=i||[],o=t[e],s=t[r-1];let l=0,c=1;for(let u=e+1;u<r-1;++u){const e=G(t[u],o,s);e>l&&(l=e,c=u)}return Math.sqrt(l)>n?(K(t,e,c+1,n,a),K(t,c,r,n,a)):(a.length||a.push(o),a.push(s)),a}function J(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,r=arguments.length>2?arguments[2]:void 0;const n=[],i=(t.length-1)/3;for(let a=0;a<i;a++)Z(t,3*a,e,n);return r&&r>0?K(n,0,n.length,r):n}const Q="none";class tt{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,n,i){const a=this._o(i);return this._d("line",[T(t,e,r,n,a)],a)}rectangle(t,e,r,n,i){const a=this._o(i),o=[],s=function(t,e,r,n,i){return function(t,e){return S(t,!0,e)}([[t,e],[t+r,e],[t+r,e+n],[t,e+n]],i)}(t,e,r,n,a);if(a.fill){const i=[[t,e],[t+r,e],[t+r,e+n],[t,e+n]];"solid"===a.fillStyle?o.push(P([i],a)):o.push(I([i],a))}return a.stroke!==Q&&o.push(s),this._d("rectangle",o,a)}ellipse(t,e,r,n,i){const a=this._o(i),o=[],s=M(r,n,a),l=C(t,e,a,s);if(a.fill)if("solid"===a.fillStyle){const r=C(t,e,a,s).opset;r.type="fillPath",o.push(r)}else o.push(I([l.estimatedPoints],a));return a.stroke!==Q&&o.push(l.opset),this._d("ellipse",o,a)}circle(t,e,r,n){const i=this.ellipse(t,e,r,r,n);return i.shape="circle",i}linearPath(t,e){const r=this._o(e);return this._d("linearPath",[S(t,!1,r)],r)}arc(t,e,r,n,i,a){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0;const l=this._o(s),c=[],u=E(t,e,r,n,i,a,o,!0,l);if(o&&l.fill)if("solid"===l.fillStyle){const o=Object.assign({},l);o.disableMultiStroke=!0;const s=E(t,e,r,n,i,a,!0,!1,o);s.type="fillPath",c.push(s)}else c.push(function(t,e,r,n,i,a,o){const s=t,l=e;let c=Math.abs(r/2),u=Math.abs(n/2);c+=R(.01*c,o),u+=R(.01*u,o);let h=i,d=a;for(;h<0;)h+=2*Math.PI,d+=2*Math.PI;d-h>2*Math.PI&&(h=0,d=2*Math.PI);const p=(d-h)/o.curveStepCount,f=[];for(let m=h;m<=d;m+=p)f.push([s+c*Math.cos(m),l+u*Math.sin(m)]);return f.push([s+c*Math.cos(d),l+u*Math.sin(d)]),f.push([s,l]),I([f],o)}(t,e,r,n,i,a,l));return l.stroke!==Q&&c.push(u),this._d("arc",c,l)}curve(t,e){const r=this._o(e),n=[],i=A(t,r);if(r.fill&&r.fill!==Q)if("solid"===r.fillStyle){const e=A(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],i=t;if(i.length){const t="number"==typeof i[0][0]?[i]:i;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...J(H([n[0],n[0],n[1],n[2]]),10,(1+r.roughness)/2)):e.push(...J(H(n),10,(1+r.roughness)/2))}e.length&&n.push(I([e],r))}return r.stroke!==Q&&n.push(i),this._d("curve",n,r)}polygon(t,e){const r=this._o(e),n=[],i=S(t,!0,r);return r.fill&&("solid"===r.fillStyle?n.push(P([t],r)):n.push(I([t],r))),r.stroke!==Q&&n.push(i),this._d("polygon",n,r)}path(t,e){const r=this._o(e),n=[];if(!t)return this._d("path",n,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&"transparent"!==r.fill&&r.fill!==Q,a=r.stroke!==Q,o=!!(r.simplification&&r.simplification<1),s=function(t,e,r){const n=b(x(v(t))),i=[];let a=[],o=[0,0],s=[];const l=()=>{s.length>=4&&a.push(...J(s,1)),s=[]},c=()=>{l(),a.length&&(i.push(a),a=[])};for(const{key:h,data:d}of n)switch(h){case"M":c(),o=[d[0],d[1]],a.push(o);break;case"L":l(),a.push([d[0],d[1]]);break;case"C":if(!s.length){const t=a.length?a[a.length-1]:o;s.push([t[0],t[1]])}s.push([d[0],d[1]]),s.push([d[2],d[3]]),s.push([d[4],d[5]]);break;case"Z":l(),a.push([o[0],o[1]])}if(c(),!r)return i;const u=[];for(const h of i){const t=X(h,r);t.length&&u.push(t)}return u}(t,0,o?4-4*(r.simplification||1):(1+r.roughness)/2),l=L(t,r);if(i)if("solid"===r.fillStyle)if(1===s.length){const e=L(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(P(s,r));else n.push(I(s,r));return a&&(o?s.forEach((t=>{n.push(S(t,!1,r))})):n.push(l)),this._d("path",n,r)}opsToPath(t,e){let r="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){const e=t.sets||[],r=t.options||this.defaultOptions,n=[];for(const i of e){let t=null;switch(i.type){case"path":t={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Q};break;case"fillPath":t={d:this.opsToPath(i),stroke:Q,strokeWidth:0,fill:r.fill||Q};break;case"fillSketch":t=this.fillSketch(i,r)}t&&n.push(t)}return n}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||Q,strokeWidth:r,fill:Q}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class et{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new tt(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,a,i),n.restore();break;case"fillPath":{n.save(),n.fillStyle=r.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,i,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,r)}}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=n,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const i of e.ops){const e="number"==typeof r&&r>=0?i.data.map((t=>+t.toFixed(r))):i.data;switch(i.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a),a}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a),a}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a),a}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i),i}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,n,i,a){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0;const l=this.gen.arc(t,e,r,n,i,a,o,s);return this.draw(l),l}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){const r=this.gen.path(t,e);return this.draw(r),r}}const rt="http://www.w3.org/2000/svg";class nt{constructor(t,e){this.svg=t,this.gen=new tt(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,i=n.createElementNS(rt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const o of e){let e=null;switch(o.type){case"path":e=n.createElementNS(rt,"path"),e.setAttribute("d",this.opsToPath(o,a)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(rt,"path"),e.setAttribute("d",this.opsToPath(o,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,o,r)}e&&i.appendChild(e)}return i}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2);const i=t.createElementNS(rt,"path");return i.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",n+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a)}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a)}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a)}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i)}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,n,i,a){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0;const l=this.gen.arc(t,e,r,n,i,a,o,s);return this.draw(l)}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r)}path(t,e){const r=this.gen.path(t,e);return this.draw(r)}}var it={canvas:(t,e)=>new et(t,e),svg:(t,e)=>new nt(t,e),generator:t=>new tt(t),newSeed:()=>tt.newSeed()}},8434:(t,e,r)=>{"use strict";r.d(e,{O:()=>n});var n=(0,r(3759).K2)((t=>{let{flowchart:e}=t;const r=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:r,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:r+n}}),"getSubGraphTitleMargins")},8438:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(9885),i=r(4306);const a=(0,n.A)(i.A,"Map")},8635:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(5009),i=r(3493),a=r(5884),o=r(7664);const s=function(t,e,r){if(!(0,o.A)(r))return!1;var s=typeof e;return!!("number"==s?(0,i.A)(r)&&(0,a.A)(e,r.length):"string"==s&&e in r)&&(0,n.A)(r[e],t)}},8853:(t,e,r)=>{"use strict";t.exports=r(5896)},9408:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return a(e,t),e},s=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};Object.defineProperty(e,"__esModule",{value:!0});var l=o(r(5043)),c=r(2880),u=r(1744),h=[1,3,5],d=[(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(-").concat(h[2],"rem) scale(0.5)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-0"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-1"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 75% {transform: translateX(-").concat(h[0],"rem) scale(0.75)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-2"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 75% {transform: translateX(").concat(h[0],"rem) scale(0.75)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-3"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-4"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(").concat(h[2],"rem) scale(0.5)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-5")];e.default=function(t){var e=t.loading,r=void 0===e||e,i=t.color,a=void 0===i?"#000000":i,o=t.speedMultiplier,u=void 0===o?1:o,h=t.cssOverride,p=void 0===h?{}:h,f=t.size,m=void 0===f?15:f,g=s(t,["loading","color","speedMultiplier","cssOverride","size"]),y=(0,c.parseLengthAndUnit)(m),v=y.value,x=y.unit,b=n({display:"inherit",position:"relative"},p),_=function(t){return{position:"absolute",fontSize:"".concat(v/3).concat(x),width:"".concat(v).concat(x),height:"".concat(v).concat(x),background:a,borderRadius:"50%",animation:"".concat(d[t]," ").concat(1.5/u,"s infinite"),animationFillMode:"forwards"}};return r?l.createElement("span",n({style:b},g),l.createElement("span",{style:_(0)}),l.createElement("span",{style:_(1)}),l.createElement("span",{style:_(2)}),l.createElement("span",{style:_(3)}),l.createElement("span",{style:_(4)}),l.createElement("span",{style:_(5)})):null}},9500:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(4802),i=r(3239);const a=function(t){return(0,i.A)(t)&&"[object Arguments]"==(0,n.A)(t)};var o=Object.prototype,s=o.hasOwnProperty,l=o.propertyIsEnumerable;const c=a(function(){return arguments}())?a:function(t){return(0,i.A)(t)&&s.call(t,"callee")&&!l.call(t,"callee")}},9711:(t,e,r)=>{"use strict";r.d(e,{WY:()=>S,pC:()=>k,Gc:()=>b});var n=r(3759);const i=(t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name),a=Object.freeze({left:0,top:0,width:16,height:16}),o=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),s=Object.freeze({...a,...o}),l=Object.freeze({...s,body:"",hidden:!1});function c(t,e){const r=function(t,e){const r={};!t.hFlip!==!e.hFlip&&(r.hFlip=!0),!t.vFlip!==!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}(t,e);for(const n in l)n in o?n in t&&!(n in r)&&(r[n]=o[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function u(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function o(t){a=c(n[t]||i[t],a)}return o(e),r.forEach(o),c(t,a)}function h(t,e){if(t.icons[e])return u(t,e,[]);const r=function(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);return(e||Object.keys(r).concat(Object.keys(n))).forEach((function t(e){if(r[e])return i[e]=[];if(!(e in i)){i[e]=null;const r=n[e]&&n[e].parent,a=r&&t(r);a&&(i[e]=[r].concat(a))}return i[e]})),i}(t,[e])[e];return r?u(t,e,r):null}const d=Object.freeze({width:null,height:null}),p=Object.freeze({...d,...o}),f=/(-?[0-9.]*[0-9]+[0-9.]*)/g,m=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function g(t,e,r){if(1===e)return t;if(r=r||100,"number"===typeof t)return Math.ceil(t*e*r)/r;if("string"!==typeof t)return t;const n=t.split(f);if(null===n||!n.length)return t;const i=[];let a=n.shift(),o=m.test(a);for(;;){if(o){const t=parseFloat(a);isNaN(t)?i.push(a):i.push(Math.ceil(t*e*r)/r)}else i.push(a);if(a=n.shift(),void 0===a)return i.join("");o=!o}}const y=/\sid="(\S+)"/g,v="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let x=0;var b={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},_=new Map,w=new Map,k=(0,n.K2)((t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(n.Rm.debug("Registering icon pack:",e.name),"loader"in e)w.set(e.name,e.loader);else{if(!("icons"in e))throw n.Rm.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');_.set(e.name,e.icons)}}}),"registerIconPacks"),T=(0,n.K2)((async(t,e)=>{const r=function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const a=t.split(":");if("@"===t.slice(0,1)){if(a.length<2||a.length>3)return null;n=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const t=a.pop(),r=a.pop(),o={provider:a.length>0?a[0]:n,prefix:r,name:t};return e&&!i(o)?null:o}const o=a[0],s=o.split("-");if(s.length>1){const t={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!i(t)?null:t}if(r&&""===n){const t={provider:n,prefix:"",name:o};return e&&!i(t,r)?null:t}return null}(t,!0,void 0!==e);if(!r)throw new Error(`Invalid icon name: ${t}`);const a=r.prefix||e;if(!a)throw new Error(`Icon name must contain a prefix: ${t}`);let o=_.get(a);if(!o){const t=w.get(a);if(!t)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await t(),prefix:a},_.set(a,o)}catch(l){throw n.Rm.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=h(o,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s}),"getRegisteredIconData"),S=(0,n.K2)((async(t,e)=>{let r;try{r=await T(t,e?.fallbackPrefix)}catch(a){n.Rm.error(a),r=b}const i=function(t,e){const r={...s,...t},n={...p,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach((t=>{const e=[],r=t.hFlip,n=t.vFlip;let o,s=t.rotate;switch(r?n?s+=2:(e.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),e.push("scale(-1 1)"),i.top=i.left=0):n&&(e.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),e.push("scale(1 -1)"),i.top=i.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:o=i.height/2+i.top,e.unshift("rotate(90 "+o.toString()+" "+o.toString()+")");break;case 2:e.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:o=i.width/2+i.left,e.unshift("rotate(-90 "+o.toString()+" "+o.toString()+")")}s%2===1&&(i.left!==i.top&&(o=i.left,i.left=i.top,i.top=o),i.width!==i.height&&(o=i.width,i.width=i.height,i.height=o)),e.length&&(a=function(t,e,r){const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defs",r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("</"+e);if(-1===i||-1===a)break;const o=t.indexOf(">",a);if(-1===o)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(o+1)}return{defs:r,content:t}}(t);return i=n.defs,a=e+n.content+r,i?"<defs>"+i+"</defs>"+a:a;var i,a}(a,'<g transform="'+e.join(" ")+'">',"</g>"))}));const o=n.width,l=n.height,c=i.width,u=i.height;let h,d;null===o?(d=null===l?"1em":"auto"===l?u:l,h=g(d,c/u)):(h="auto"===o?c:o,d=null===l?g(h,u/c):"auto"===l?u:l);const f={},m=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(f[t]=e.toString())};m("width",h),m("height",d);const y=[i.left,i.top,c,u];return f.viewBox=y.join(" "),{attributes:f,viewBox:y,body:a}}(r,e);return function(t,e){let r=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;const r=[];let n;for(;n=y.exec(t);)r.push(n[1]);if(!r.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return r.forEach((r=>{const n="function"===typeof e?e(r):e+(x++).toString(),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+n+i+"$3")})),t=t.replace(new RegExp(i,"g"),"")}(i.body),i.attributes)}),"getIconSVG")},9778:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(5869),i=r(7664),a=r(286);const o=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e};var s=Object.prototype.hasOwnProperty;const l=function(t){if(!(0,i.A)(t))return o(t);var e=(0,a.A)(t),r=[];for(var n in t)("constructor"!=n||!e&&s.call(t,n))&&r.push(n);return r};var c=r(3493);const u=function(t){return(0,c.A)(t)?(0,n.A)(t,!0):l(t)}},9885:(t,e,r)=>{"use strict";r.d(e,{A:()=>y});var n=r(4067);const i=r(4306).A["__core-js_shared__"];var a=function(){var t=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();const o=function(t){return!!a&&a in t};var s=r(7664),l=r(6166),c=/^\[object .+?Constructor\]$/,u=Function.prototype,h=Object.prototype,d=u.toString,p=h.hasOwnProperty,f=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const m=function(t){return!(!(0,s.A)(t)||o(t))&&((0,n.A)(t)?f:c).test((0,l.A)(t))};const g=function(t,e){return null==t?void 0:t[e]};const y=function(t,e){var r=g(t,e);return m(r)?r:void 0}},9945:(t,e,r)=>{"use strict";r.d(e,{n:()=>n});var n={name:"mermaid",version:"11.6.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.0.4","@iconify/utils":"^2.1.33","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.11",dayjs:"^1.11.13",dompurify:"^3.2.4",katex:"^0.16.9",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^15.0.7",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.2","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",chokidar:"^4.0.3",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.0.2",jison:"^0.4.18","js-base64":"^3.7.7",jsdom:"^26.0.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.2",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.10","type-fest":"^4.35.0",typedoc:"^0.27.8","typedoc-plugin-markdown":"^4.4.2",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.0.2","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.m=t,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},(()=>{var t,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"===typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var o={};t=t||[null,e({}),e([]),e(e)];for(var s=2&i&&n;"object"==typeof s&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach((t=>o[t]=()=>n[t]));return o.default=()=>n,r.d(a,o),a}})(),r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.f={},r.e=t=>Promise.all(Object.keys(r.f).reduce(((e,n)=>(r.f[n](t,e),e)),[])),r.u=t=>"static/js/"+t+"."+{35:"b34bde96",62:"785a92ce",109:"fea37f16",126:"9837c9af",147:"660f25b1",203:"e56567f8",255:"28a7c83e",282:"876bf6b3",314:"5b42713c",318:"239ef60c",320:"f30ff8c0",349:"dfb2510e",355:"143eaed8",358:"7641aa7d",370:"721ed12b",372:"1ba03aa4",415:"d031fb39",448:"0ebff170",453:"6fae039d",461:"dcde3ae6",467:"ed8fe19b",502:"89ac9055",621:"a72de2cb",622:"95b51007",626:"6df36496",646:"3df37337",674:"cb2cf2f8",732:"b7e64c48",761:"64498d2a",807:"a9b3c2ae",824:"71eb7c8f",854:"2162dcf9",859:"88148fa8",914:"0546aa7a",922:"10b19c61",929:"7d5d6402",972:"19d4b287",974:"879246cb",987:"378e3c51"}[t]+".chunk.js",r.miniCssF=t=>{},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={},e="backstory:";r.l=(n,i,a,o)=>{if(t[n])t[n].push(i);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var h=c[u];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")==e+a){s=h;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",e+a),s.src=n),t[n]=[i];var d=(e,r)=>{s.onerror=s.onload=null,clearTimeout(p);var i=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),r.r=t=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.p="/",(()=>{var t={792:0};r.f.j=(e,n)=>{var i=r.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise(((r,n)=>i=t[e]=[r,n]));n.push(i[2]=a);var o=r.p+r.u(e),s=new Error;r.l(o,(n=>{if(r.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var i,a,o=n[0],s=n[1],l=n[2],c=0;if(o.some((e=>0!==t[e]))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)l(r)}for(e&&e(n);c<o.length;c++)a=o[c],r.o(t,a)&&t[a]&&t[a][0](),t[a]=0},n=self.webpackChunkbackstory=self.webpackChunkbackstory||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),(()=>{"use strict";var t=r(5043),e=r.t(t,2),n=r(4391);const i=t.createContext(null);function a(){return t.useContext(i)}const o="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var s=r(579);const l=function(e){const{children:r,theme:n}=e,l=a(),c=t.useMemo((()=>{const t=null===l?{...n}:function(t,e){if("function"===typeof e)return e(t);return{...t,...e}}(l,n);return null!=t&&(t[o]=null!==l),t}),[n,l]);return(0,s.jsx)(i.Provider,{value:c,children:r})};var c=function(){function t(t){var e=this;this._insertTag=function(t){var r;r=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,r),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}(e);try{r.insertRule(t,r.cssRules.length)}catch(Wf){}}else e.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach((function(t){var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)})),this.tags=[],this.ctr=0},t}(),u=Math.abs,h=String.fromCharCode,d=Object.assign;function p(t){return t.trim()}function f(t,e,r){return t.replace(e,r)}function m(t,e){return t.indexOf(e)}function g(t,e){return 0|t.charCodeAt(e)}function y(t,e,r){return t.slice(e,r)}function v(t){return t.length}function x(t){return t.length}function b(t,e){return e.push(t),t}var _=1,w=1,k=0,T=0,S=0,A="";function M(t,e,r,n,i,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:_,column:w,length:o,return:""}}function C(t,e){return d(M("",null,null,"",null,null,0),t,{length:-t.length},e)}function E(){return S=T>0?g(A,--T):0,w--,10===S&&(w=1,_--),S}function L(){return S=T<k?g(A,T++):0,w++,10===S&&(w=1,_++),S}function P(){return g(A,T)}function I(){return T}function z(t,e){return y(A,t,e)}function O(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function D(t){return _=w=1,k=v(A=t),T=0,[]}function R(t){return A="",t}function F(t){return p(z(T-1,N(91===t?t+2:40===t?t+1:t)))}function B(t){for(;(S=P())&&S<33;)L();return O(t)>2||O(S)>3?"":" "}function j(t,e){for(;--e&&L()&&!(S<48||S>102||S>57&&S<65||S>70&&S<97););return z(t,I()+(e<6&&32==P()&&32==L()))}function N(t){for(;L();)switch(S){case t:return T;case 34:case 39:34!==t&&39!==t&&N(S);break;case 40:41===t&&N(t);break;case 92:L()}return T}function U(t,e){for(;L()&&t+S!==57&&(t+S!==84||47!==P()););return"/*"+z(e,T-1)+"*"+h(47===t?t:L())}function V(t){for(;!O(P());)L();return z(t,T)}var q="-ms-",$="-moz-",H="-webkit-",W="comm",G="rule",Y="decl",Z="@keyframes";function X(t,e){for(var r="",n=x(t),i=0;i<n;i++)r+=e(t[i],i,t,e)||"";return r}function K(t,e,r,n){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case Y:return t.return=t.return||t.value;case W:return"";case Z:return t.return=t.value+"{"+X(t.children,n)+"}";case G:t.value=t.props.join(",")}return v(r=X(t.children,n))?t.return=t.value+"{"+r+"}":""}function J(t){return R(Q("",null,null,null,[""],t=D(t),0,[0],t))}function Q(t,e,r,n,i,a,o,s,l){for(var c=0,u=0,d=o,p=0,y=0,x=0,_=1,w=1,k=1,T=0,S="",A=i,M=a,C=n,z=S;w;)switch(x=T,T=L()){case 40:if(108!=x&&58==g(z,d-1)){-1!=m(z+=f(F(T),"&","&\f"),"&\f")&&(k=-1);break}case 34:case 39:case 91:z+=F(T);break;case 9:case 10:case 13:case 32:z+=B(x);break;case 92:z+=j(I()-1,7);continue;case 47:switch(P()){case 42:case 47:b(et(U(L(),I()),e,r),l);break;default:z+="/"}break;case 123*_:s[c++]=v(z)*k;case 125*_:case 59:case 0:switch(T){case 0:case 125:w=0;case 59+u:-1==k&&(z=f(z,/\f/g,"")),y>0&&v(z)-d&&b(y>32?rt(z+";",n,r,d-1):rt(f(z," ","")+";",n,r,d-2),l);break;case 59:z+=";";default:if(b(C=tt(z,e,r,c,u,i,s,S,A=[],M=[],d),a),123===T)if(0===u)Q(z,e,C,C,A,a,d,s,M);else switch(99===p&&110===g(z,3)?100:p){case 100:case 108:case 109:case 115:Q(t,C,C,n&&b(tt(t,C,C,0,0,i,s,S,i,A=[],d),M),i,M,d,s,n?A:M);break;default:Q(z,C,C,C,[""],M,0,s,M)}}c=u=y=0,_=k=1,S=z="",d=o;break;case 58:d=1+v(z),y=x;default:if(_<1)if(123==T)--_;else if(125==T&&0==_++&&125==E())continue;switch(z+=h(T),T*_){case 38:k=u>0?1:(z+="\f",-1);break;case 44:s[c++]=(v(z)-1)*k,k=1;break;case 64:45===P()&&(z+=F(L())),p=P(),u=d=v(S=z+=V(I())),T++;break;case 45:45===x&&2==v(z)&&(_=0)}}return a}function tt(t,e,r,n,i,a,o,s,l,c,h){for(var d=i-1,m=0===i?a:[""],g=x(m),v=0,b=0,_=0;v<n;++v)for(var w=0,k=y(t,d+1,d=u(b=o[v])),T=t;w<g;++w)(T=p(b>0?m[w]+" "+k:f(k,/&\f/g,m[w])))&&(l[_++]=T);return M(t,e,r,0===i?G:s,l,c,h)}function et(t,e,r){return M(t,e,r,W,h(S),y(t,2,-2),0)}function rt(t,e,r,n){return M(t,e,r,Y,y(t,0,n),y(t,n+1,-1),n)}var nt=function(t,e,r){for(var n=0,i=0;n=i,i=P(),38===n&&12===i&&(e[r]=1),!O(i);)L();return z(t,T)},it=function(t,e){return R(function(t,e){var r=-1,n=44;do{switch(O(n)){case 0:38===n&&12===P()&&(e[r]=1),t[r]+=nt(T-1,e,r);break;case 2:t[r]+=F(n);break;case 4:if(44===n){t[++r]=58===P()?"&\f":"",e[r]=t[r].length;break}default:t[r]+=h(n)}}while(n=L());return t}(D(t),e))},at=new WeakMap,ot=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,r=t.parent,n=t.column===r.column&&t.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||at.get(r))&&!n){at.set(t,!0);for(var i=[],a=it(e,i),o=r.props,s=0,l=0;s<a.length;s++)for(var c=0;c<o.length;c++,l++)t.props[l]=i[s]?a[s].replace(/&\f/g,o[c]):o[c]+" "+a[s]}}},st=function(t){if("decl"===t.type){var e=t.value;108===e.charCodeAt(0)&&98===e.charCodeAt(2)&&(t.return="",t.value="")}};function lt(t,e){switch(function(t,e){return 45^g(t,0)?(((e<<2^g(t,0))<<2^g(t,1))<<2^g(t,2))<<2^g(t,3):0}(t,e)){case 5103:return H+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return H+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return H+t+$+t+q+t+t;case 6828:case 4268:return H+t+q+t+t;case 6165:return H+t+q+"flex-"+t+t;case 5187:return H+t+f(t,/(\w+).+(:[^]+)/,H+"box-$1$2"+q+"flex-$1$2")+t;case 5443:return H+t+q+"flex-item-"+f(t,/flex-|-self/,"")+t;case 4675:return H+t+q+"flex-line-pack"+f(t,/align-content|flex-|-self/,"")+t;case 5548:return H+t+q+f(t,"shrink","negative")+t;case 5292:return H+t+q+f(t,"basis","preferred-size")+t;case 6060:return H+"box-"+f(t,"-grow","")+H+t+q+f(t,"grow","positive")+t;case 4554:return H+f(t,/([^-])(transform)/g,"$1"+H+"$2")+t;case 6187:return f(f(f(t,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),t,"")+t;case 5495:case 3959:return f(t,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return f(f(t,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H+t+t;case 4095:case 3583:case 4068:case 2532:return f(t,/(.+)-inline(.+)/,H+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(v(t)-1-e>6)switch(g(t,e+1)){case 109:if(45!==g(t,e+4))break;case 102:return f(t,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+$+(108==g(t,e+3)?"$3":"$2-$3"))+t;case 115:return~m(t,"stretch")?lt(f(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==g(t,e+1))break;case 6444:switch(g(t,v(t)-3-(~m(t,"!important")&&10))){case 107:return f(t,":",":"+H)+t;case 101:return f(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(45===g(t,14)?"inline-":"")+"box$3$1"+H+"$2$3$1"+q+"$2box$3")+t}break;case 5936:switch(g(t,e+11)){case 114:return H+t+q+f(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return H+t+q+f(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return H+t+q+f(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return H+t+q+t+t}return t}var ct=[function(t,e,r,n){if(t.length>-1&&!t.return)switch(t.type){case Y:t.return=lt(t.value,t.length);break;case Z:return X([C(t,{value:f(t.value,"@","@"+H)})],n);case G:if(t.length)return function(t,e){return t.map(e).join("")}(t.props,(function(e){switch(function(t,e){return(t=e.exec(t))?t[0]:t}(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return X([C(t,{props:[f(e,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return X([C(t,{props:[f(e,/:(plac\w+)/,":"+H+"input-$1")]}),C(t,{props:[f(e,/:(plac\w+)/,":-moz-$1")]}),C(t,{props:[f(e,/:(plac\w+)/,q+"input-$1")]})],n)}return""}))}}],ut=function(t){var e=t.key;if("css"===e){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var n,i,a=t.stylisPlugins||ct,o={},s=[];n=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),r=1;r<e.length;r++)o[e[r]]=!0;s.push(t)}));var l,u,h=[K,(u=function(t){l.insert(t)},function(t){t.root||(t=t.return)&&u(t)})],d=function(t){var e=x(t);return function(r,n,i,a){for(var o="",s=0;s<e;s++)o+=t[s](r,n,i,a)||"";return o}}([ot,st].concat(a,h));i=function(t,e,r,n){l=r,function(t){X(J(t),d)}(t?t+"{"+e.styles+"}":e.styles),n&&(p.inserted[e.name]=!0)};var p={key:e,sheet:new c({key:e,container:n,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:i};return p.sheet.hydrate(s),p};function ht(t,e,r){var n="";return r.split(" ").forEach((function(r){void 0!==t[r]?e.push(t[r]+";"):r&&(n+=r+" ")})),n}var dt=function(t,e,r){var n=t.key+"-"+e.name;!1===r&&void 0===t.registered[n]&&(t.registered[n]=e.styles)},pt=function(t,e,r){dt(t,e,r);var n=t.key+"-"+e.name;if(void 0===t.inserted[e.name]){var i=e;do{t.insert(e===i?"."+n:"",i,t.sheet,!0),i=i.next}while(void 0!==i)}};var ft={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function mt(t){var e=Object.create(null);return function(r){return void 0===e[r]&&(e[r]=t(r)),e[r]}}var gt=/[A-Z]|^ms/g,yt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,vt=function(t){return 45===t.charCodeAt(1)},xt=function(t){return null!=t&&"boolean"!==typeof t},bt=mt((function(t){return vt(t)?t:t.replace(gt,"-$&").toLowerCase()})),_t=function(t,e){switch(t){case"animation":case"animationName":if("string"===typeof e)return e.replace(yt,(function(t,e,r){return kt={name:e,styles:r,next:kt},e}))}return 1===ft[t]||vt(t)||"number"!==typeof e||0===e?e:e+"px"};function wt(t,e,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return kt={name:i.name,styles:i.styles,next:kt},i.name;var a=r;if(void 0!==a.styles){var o=a.next;if(void 0!==o)for(;void 0!==o;)kt={name:o.name,styles:o.styles,next:kt},o=o.next;return a.styles+";"}return function(t,e,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=wt(t,e,r[i])+";";else for(var a in r){var o=r[a];if("object"!==typeof o){var s=o;null!=e&&void 0!==e[s]?n+=a+"{"+e[s]+"}":xt(s)&&(n+=bt(a)+":"+_t(a,s)+";")}else if(!Array.isArray(o)||"string"!==typeof o[0]||null!=e&&void 0!==e[o[0]]){var l=wt(t,e,o);switch(a){case"animation":case"animationName":n+=bt(a)+":"+l+";";break;default:n+=a+"{"+l+"}"}}else for(var c=0;c<o.length;c++)xt(o[c])&&(n+=bt(a)+":"+_t(a,o[c])+";")}return n}(t,e,r);case"function":if(void 0!==t){var s=kt,l=r(t);return kt=s,wt(t,e,l)}}var c=r;if(null==e)return c;var u=e[c];return void 0!==u?u:c}var kt,Tt=/label:\s*([^\s;{]+)\s*(;|$)/g;function St(t,e,r){if(1===t.length&&"object"===typeof t[0]&&null!==t[0]&&void 0!==t[0].styles)return t[0];var n=!0,i="";kt=void 0;var a=t[0];null==a||void 0===a.raw?(n=!1,i+=wt(r,e,a)):i+=a[0];for(var o=1;o<t.length;o++){if(i+=wt(r,e,t[o]),n)i+=a[o]}Tt.lastIndex=0;for(var s,l="";null!==(s=Tt.exec(i));)l+="-"+s[1];var c=function(t){for(var e,r=0,n=0,i=t.length;i>=4;++n,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:kt}}var At=!!e.useInsertionEffect&&e.useInsertionEffect,Mt=At||function(t){return t()},Ct=At||t.useLayoutEffect,Et=t.createContext("undefined"!==typeof HTMLElement?ut({key:"css"}):null),Lt=(Et.Provider,function(e){return(0,t.forwardRef)((function(r,n){var i=(0,t.useContext)(Et);return e(r,i,n)}))}),Pt=t.createContext({});var It={}.hasOwnProperty,zt="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ot=function(t){var e=t.cache,r=t.serialized,n=t.isStringTag;return dt(e,r,n),Mt((function(){return pt(e,r,n)})),null},Dt=Lt((function(e,r,n){var i=e.css;"string"===typeof i&&void 0!==r.registered[i]&&(i=r.registered[i]);var a=e[zt],o=[i],s="";"string"===typeof e.className?s=ht(r.registered,o,e.className):null!=e.className&&(s=e.className+" ");var l=St(o,void 0,t.useContext(Pt));s+=r.key+"-"+l.name;var c={};for(var u in e)It.call(e,u)&&"css"!==u&&u!==zt&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),t.createElement(t.Fragment,null,t.createElement(Ot,{cache:r,serialized:l,isStringTag:"string"===typeof a}),t.createElement(a,c))}));const Rt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const r=t.useContext(Pt);return r&&(n=r,0!==Object.keys(n).length)?r:e;var n},Ft=t.createContext();const Bt=()=>t.useContext(Ft)??!1,jt=function(t){let{value:e,...r}=t;return(0,s.jsx)(Ft.Provider,{value:e??!0,...r})};function Nt(t,e){const r={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=n;if("components"===i||"slots"===i)r[i]={...t[i],...r[i]};else if("componentsProps"===i||"slotProps"===i){const n=t[i],a=e[i];if(a)if(n){r[i]={...a};for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)){const e=t;r[i][e]=Nt(n[e],a[e])}}else r[i]=a;else r[i]=n||{}}else void 0===r[i]&&(r[i]=t[i])}return r}const Ut=t.createContext(void 0);function Vt(e){let{props:r,name:n}=e;return function(t){const{theme:e,name:r,props:n}=t;if(!e||!e.components||!e.components[r])return n;const i=e.components[r];return i.defaultProps?Nt(i.defaultProps,n):i.styleOverrides||i.variants?n:Nt(i,n)}({props:r,name:n,theme:{components:t.useContext(Ut)}})}const qt=function(t){let{value:e,children:r}=t;return(0,s.jsx)(Ut.Provider,{value:e,children:r})},$t={};function Ht(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.useMemo((()=>{const t=e&&r[e]||r;if("function"===typeof n){const a=n(t),o=e?{...r,[e]:a}:a;return i?()=>o:o}return e?{...r,[e]:n}:{...r,...n}}),[e,r,n,i])}const Wt=function(t){const{children:e,theme:r,themeId:n}=t,i=Rt($t),o=a()||$t,c=Ht(n,i,r),u=Ht(n,o,r,!0),h="rtl"===(n?c[n]:c).direction;return(0,s.jsx)(l,{theme:u,children:(0,s.jsx)(Pt.Provider,{value:c,children:(0,s.jsx)(jt,{value:h,children:(0,s.jsx)(qt,{value:n?c[n].components:c.components,children:e})})})})},Gt="$$material";function Yt(t){let{theme:e,...r}=t;const n=Gt in e?e[Gt]:void 0;return(0,s.jsx)(Wt,{...r,themeId:n?Gt:void 0,theme:n||e})}function Zt(t){const e=new URL(`https://mui.com/production-error/?code=${t}`);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.forEach((t=>e.searchParams.append("args[]",t))),`Minified MUI error #${t}; visit ${e} for the full message.`}function Xt(t){if("string"!==typeof t)throw new Error(Zt(7));return t.charAt(0).toUpperCase()+t.slice(1)}var Kt=r(191);function Jt(t){if("object"!==typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);return(null===e||e===Object.prototype||null===Object.getPrototypeOf(e))&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Qt(e){if(t.isValidElement(e)||(0,Kt.Hy)(e)||!Jt(e))return e;const r={};return Object.keys(e).forEach((t=>{r[t]=Qt(e[t])})),r}function te(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const i=n.clone?{...e}:e;return Jt(e)&&Jt(r)&&Object.keys(r).forEach((a=>{t.isValidElement(r[a])||(0,Kt.Hy)(r[a])?i[a]=r[a]:Jt(r[a])&&Object.prototype.hasOwnProperty.call(e,a)&&Jt(e[a])?i[a]=te(e[a],r[a],n):n.clone?i[a]=Jt(r[a])?Qt(r[a]):r[a]:i[a]=r[a]})),i}const ee=function(t,e){return e?te(t,e,{clone:!1}):t};const re={xs:0,sm:600,md:900,lg:1200,xl:1536},ne={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${re[t]}px)`},ie={containerQueries:t=>({up:e=>{let r="number"===typeof e?e:re[e]||e;return"number"===typeof r&&(r=`${r}px`),t?`@container ${t} (min-width:${r})`:`@container (min-width:${r})`}})};function ae(t,e,r){const n=t.theme||{};if(Array.isArray(e)){const t=n.breakpoints||ne;return e.reduce(((n,i,a)=>(n[t.up(t.keys[a])]=r(e[a]),n)),{})}if("object"===typeof e){const t=n.breakpoints||ne;return Object.keys(e).reduce(((i,a)=>{if(function(t,e){return"@"===e||e.startsWith("@")&&(t.some((t=>e.startsWith(`@${t}`)))||!!e.match(/^@\d/))}(t.keys,a)){const t=function(t,e){const r=e.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,i]=r,a=Number.isNaN(+n)?n||0:+n;return t.containerQueries(i).up(a)}(n.containerQueries?n:ie,a);t&&(i[t]=r(e[a],a))}else if(Object.keys(t.values||re).includes(a)){i[t.up(a)]=r(e[a],a)}else{const t=a;i[t]=e[t]}return i}),{})}return r(e)}function oe(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.keys?.reduce(((e,r)=>(e[t.up(r)]={},e)),{});return e||{}}function se(t,e){return t.reduce(((t,e)=>{const r=t[e];return(!r||0===Object.keys(r).length)&&delete t[e],t}),e)}function le(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||"string"!==typeof e)return null;if(t&&t.vars&&r){const r=`vars.${e}`.split(".").reduce(((t,e)=>t&&t[e]?t[e]:null),t);if(null!=r)return r}return e.split(".").reduce(((t,e)=>t&&null!=t[e]?t[e]:null),t)}function ce(t,e,r){let n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof t?t(r):Array.isArray(t)?t[r]||i:le(t,r)||i,e&&(n=e(n,i,t)),n}const ue=function(t){const{prop:e,cssProperty:r=t.prop,themeKey:n,transform:i}=t,a=t=>{if(null==t[e])return null;const a=t[e],o=le(t.theme,n)||{};return ae(t,a,(t=>{let n=ce(o,i,t);return t===n&&"string"===typeof t&&(n=ce(o,i,`${e}${"default"===t?"":Xt(t)}`,t)),!1===r?n:{[r]:n}}))};return a.propTypes={},a.filterProps=[e],a};const he={m:"margin",p:"padding"},de={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},pe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},fe=function(t){const e={};return r=>(void 0===e[r]&&(e[r]=t(r)),e[r])}((t=>{if(t.length>2){if(!pe[t])return[t];t=pe[t]}const[e,r]=t.split(""),n=he[e],i=de[r]||"";return Array.isArray(i)?i.map((t=>n+t)):[n+i]})),me=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],ge=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],ye=[...me,...ge];function ve(t,e,r,n){const i=le(t,e,!0)??r;return"number"===typeof i||"string"===typeof i?t=>"string"===typeof t?t:"string"===typeof i?i.startsWith("var(")&&0===t?0:i.startsWith("var(")&&1===t?i:`calc(${t} * ${i})`:i*t:Array.isArray(i)?t=>{if("string"===typeof t)return t;const e=Math.abs(t);const r=i[e];return t>=0?r:"number"===typeof r?-r:"string"===typeof r&&r.startsWith("var(")?`calc(-1 * ${r})`:`-${r}`}:"function"===typeof i?i:()=>{}}function xe(t){return ve(t,"spacing",8)}function be(t,e){return"string"===typeof e||null==e?e:t(e)}function _e(t,e,r,n){if(!e.includes(r))return null;const i=function(t,e){return r=>t.reduce(((t,n)=>(t[n]=be(e,r),t)),{})}(fe(r),n);return ae(t,t[r],i)}function we(t,e){const r=xe(t.theme);return Object.keys(t).map((n=>_e(t,e,n,r))).reduce(ee,{})}function ke(t){return we(t,me)}function Te(t){return we(t,ge)}function Se(t){return we(t,ye)}ke.propTypes={},ke.filterProps=me,Te.propTypes={},Te.filterProps=ge,Se.propTypes={},Se.filterProps=ye;const Ae=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e.reduce(((t,e)=>(e.filterProps.forEach((r=>{t[r]=e})),t)),{}),i=t=>Object.keys(t).reduce(((e,r)=>n[r]?ee(e,n[r](t)):e),{});return i.propTypes={},i.filterProps=e.reduce(((t,e)=>t.concat(e.filterProps)),[]),i};function Me(t){return"number"!==typeof t?t:`${t}px solid`}function Ce(t,e){return ue({prop:t,themeKey:"borders",transform:e})}const Ee=Ce("border",Me),Le=Ce("borderTop",Me),Pe=Ce("borderRight",Me),Ie=Ce("borderBottom",Me),ze=Ce("borderLeft",Me),Oe=Ce("borderColor"),De=Ce("borderTopColor"),Re=Ce("borderRightColor"),Fe=Ce("borderBottomColor"),Be=Ce("borderLeftColor"),je=Ce("outline",Me),Ne=Ce("outlineColor"),Ue=t=>{if(void 0!==t.borderRadius&&null!==t.borderRadius){const e=ve(t.theme,"shape.borderRadius",4),r=t=>({borderRadius:be(e,t)});return ae(t,t.borderRadius,r)}return null};Ue.propTypes={},Ue.filterProps=["borderRadius"];Ae(Ee,Le,Pe,Ie,ze,Oe,De,Re,Fe,Be,Ue,je,Ne);const Ve=t=>{if(void 0!==t.gap&&null!==t.gap){const e=ve(t.theme,"spacing",8),r=t=>({gap:be(e,t)});return ae(t,t.gap,r)}return null};Ve.propTypes={},Ve.filterProps=["gap"];const qe=t=>{if(void 0!==t.columnGap&&null!==t.columnGap){const e=ve(t.theme,"spacing",8),r=t=>({columnGap:be(e,t)});return ae(t,t.columnGap,r)}return null};qe.propTypes={},qe.filterProps=["columnGap"];const $e=t=>{if(void 0!==t.rowGap&&null!==t.rowGap){const e=ve(t.theme,"spacing",8),r=t=>({rowGap:be(e,t)});return ae(t,t.rowGap,r)}return null};$e.propTypes={},$e.filterProps=["rowGap"];Ae(Ve,qe,$e,ue({prop:"gridColumn"}),ue({prop:"gridRow"}),ue({prop:"gridAutoFlow"}),ue({prop:"gridAutoColumns"}),ue({prop:"gridAutoRows"}),ue({prop:"gridTemplateColumns"}),ue({prop:"gridTemplateRows"}),ue({prop:"gridTemplateAreas"}),ue({prop:"gridArea"}));function He(t,e){return"grey"===e?e:t}Ae(ue({prop:"color",themeKey:"palette",transform:He}),ue({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:He}),ue({prop:"backgroundColor",themeKey:"palette",transform:He}));function We(t){return t<=1&&0!==t?100*t+"%":t}const Ge=ue({prop:"width",transform:We}),Ye=t=>{if(void 0!==t.maxWidth&&null!==t.maxWidth){const e=e=>{const r=t.theme?.breakpoints?.values?.[e]||re[e];return r?"px"!==t.theme?.breakpoints?.unit?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:We(e)}};return ae(t,t.maxWidth,e)}return null};Ye.filterProps=["maxWidth"];const Ze=ue({prop:"minWidth",transform:We}),Xe=ue({prop:"height",transform:We}),Ke=ue({prop:"maxHeight",transform:We}),Je=ue({prop:"minHeight",transform:We}),Qe=(ue({prop:"size",cssProperty:"width",transform:We}),ue({prop:"size",cssProperty:"height",transform:We}),Ae(Ge,Ye,Ze,Xe,Ke,Je,ue({prop:"boxSizing"})),{border:{themeKey:"borders",transform:Me},borderTop:{themeKey:"borders",transform:Me},borderRight:{themeKey:"borders",transform:Me},borderBottom:{themeKey:"borders",transform:Me},borderLeft:{themeKey:"borders",transform:Me},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Me},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ue},color:{themeKey:"palette",transform:He},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:He},backgroundColor:{themeKey:"palette",transform:He},p:{style:Te},pt:{style:Te},pr:{style:Te},pb:{style:Te},pl:{style:Te},px:{style:Te},py:{style:Te},padding:{style:Te},paddingTop:{style:Te},paddingRight:{style:Te},paddingBottom:{style:Te},paddingLeft:{style:Te},paddingX:{style:Te},paddingY:{style:Te},paddingInline:{style:Te},paddingInlineStart:{style:Te},paddingInlineEnd:{style:Te},paddingBlock:{style:Te},paddingBlockStart:{style:Te},paddingBlockEnd:{style:Te},m:{style:ke},mt:{style:ke},mr:{style:ke},mb:{style:ke},ml:{style:ke},mx:{style:ke},my:{style:ke},margin:{style:ke},marginTop:{style:ke},marginRight:{style:ke},marginBottom:{style:ke},marginLeft:{style:ke},marginX:{style:ke},marginY:{style:ke},marginInline:{style:ke},marginInlineStart:{style:ke},marginInlineEnd:{style:ke},marginBlock:{style:ke},marginBlockStart:{style:ke},marginBlockEnd:{style:ke},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ve},rowGap:{style:$e},columnGap:{style:qe},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:We},maxWidth:{style:Ye},minWidth:{transform:We},height:{transform:We},maxHeight:{transform:We},minHeight:{transform:We},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}});const tr=function(){function t(t,e,r,n){const i={[t]:e,theme:r},a=n[t];if(!a)return{[t]:e};const{cssProperty:o=t,themeKey:s,transform:l,style:c}=a;if(null==e)return null;if("typography"===s&&"inherit"===e)return{[t]:e};const u=le(r,s)||{};if(c)return c(i);return ae(i,e,(e=>{let r=ce(u,l,e);return e===r&&"string"===typeof e&&(r=ce(u,l,`${t}${"default"===e?"":Xt(e)}`,e)),!1===o?r:{[o]:r}}))}return function e(r){const{sx:n,theme:i={}}=r||{};if(!n)return null;const a=i.unstable_sxConfig??Qe;function o(r){let n=r;if("function"===typeof r)n=r(i);else if("object"!==typeof r)return r;if(!n)return null;const o=oe(i.breakpoints),s=Object.keys(o);let l=o;return Object.keys(n).forEach((r=>{const o=function(t,e){return"function"===typeof t?t(e):t}(n[r],i);if(null!==o&&void 0!==o)if("object"===typeof o)if(a[r])l=ee(l,t(r,o,i,a));else{const t=ae({theme:i},o,(t=>({[r]:t})));!function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e.reduce(((t,e)=>t.concat(Object.keys(e))),[]),i=new Set(n);return e.every((t=>i.size===Object.keys(t).length))}(t,o)?l=ee(l,t):l[r]=e({sx:o,theme:i})}else l=ee(l,t(r,o,i,a))})),function(t,e){if(!t.containerQueries)return e;const r=Object.keys(e).filter((t=>t.startsWith("@container"))).sort(((t,e)=>{const r=/min-width:\s*([0-9.]+)/;return+(t.match(r)?.[1]||0)-+(e.match(r)?.[1]||0)}));return r.length?r.reduce(((t,r)=>{const n=e[r];return delete t[r],t[r]=n,t}),{...e}):e}(i,se(s,l))}return Array.isArray(n)?n.map(o):o(n)}}();tr.filterProps=["sx"];const er=tr;r(219);var rr=function(e,r){var n=arguments;if(null==r||!It.call(r,"css"))return t.createElement.apply(void 0,n);var i=n.length,a=new Array(i);a[0]=Dt,a[1]=function(t,e){var r={};for(var n in e)It.call(e,n)&&(r[n]=e[n]);return r[zt]=t,r}(e,r);for(var o=2;o<i;o++)a[o]=n[o];return t.createElement.apply(null,a)};!function(t){var e;e||(e=t.JSX||(t.JSX={}))}(rr||(rr={}));var nr=Lt((function(e,r){var n=St([e.styles],void 0,t.useContext(Pt)),i=t.useRef();return Ct((function(){var t=r.key+"-global",e=new r.sheet.constructor({key:t,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy}),a=!1,o=document.querySelector('style[data-emotion="'+t+" "+n.name+'"]');return r.sheet.tags.length&&(e.before=r.sheet.tags[0]),null!==o&&(a=!0,o.setAttribute("data-emotion",t),e.hydrate([o])),i.current=[e,a],function(){e.flush()}}),[r]),Ct((function(){var t=i.current,e=t[0];if(t[1])t[1]=!1;else{if(void 0!==n.next&&pt(r,n.next,!0),e.tags.length){var a=e.tags[e.tags.length-1].nextElementSibling;e.before=a,e.flush()}r.insert("",n,e,!1)}}),[r,n.name]),null}));function ir(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return St(e)}function ar(){var t=ir.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function or(t){const{styles:e,defaultTheme:r={}}=t,n="function"===typeof e?t=>{return e(void 0===(n=t)||null===n||0===Object.keys(n).length?r:t);var n}:e;return(0,s.jsx)(nr,{styles:n})}const sr="undefined"!==typeof window?t.useLayoutEffect:t.useEffect,lr="mode",cr="color-scheme",ur="data-color-scheme";function hr(){}const dr=t=>{let{key:e,storageWindow:r}=t;return r||"undefined"===typeof window||(r=window),{get(t){if("undefined"===typeof window)return;if(!r)return t;let n;try{n=r.localStorage.getItem(e)}catch{}return n||t},set:t=>{if(r)try{r.localStorage.setItem(e,t)}catch{}},subscribe:t=>{if(!r)return hr;const n=r=>{const n=r.newValue;r.key===e&&t(n)};return r.addEventListener("storage",n),()=>{r.removeEventListener("storage",n)}}}};function pr(){}function fr(t){if("undefined"!==typeof window&&"function"===typeof window.matchMedia&&"system"===t){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}function mr(t,e){return"light"===t.mode||"system"===t.mode&&"light"===t.systemMode?e("light"):"dark"===t.mode||"system"===t.mode&&"dark"===t.systemMode?e("dark"):void 0}function gr(e){const{defaultMode:r="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:a=[],modeStorageKey:o=lr,colorSchemeStorageKey:s=cr,storageWindow:l=("undefined"===typeof window?void 0:window),storageManager:c=dr,noSsr:u=!1}=e,h=a.join(","),d=a.length>1,p=t.useMemo((()=>c?.({key:o,storageWindow:l})),[c,o,l]),f=t.useMemo((()=>c?.({key:`${s}-light`,storageWindow:l})),[c,s,l]),m=t.useMemo((()=>c?.({key:`${s}-dark`,storageWindow:l})),[c,s,l]),[g,y]=t.useState((()=>{const t=p?.get(r)||r,e=f?.get(n)||n,a=m?.get(i)||i;return{mode:t,systemMode:fr(t),lightColorScheme:e,darkColorScheme:a}})),[v,x]=t.useState(u||!d);t.useEffect((()=>{x(!0)}),[]);const b=function(t){return mr(t,(e=>"light"===e?t.lightColorScheme:"dark"===e?t.darkColorScheme:void 0))}(g),_=t.useCallback((t=>{y((e=>{if(t===e.mode)return e;const n=t??r;return p?.set(n),{...e,mode:n,systemMode:fr(n)}}))}),[p,r]),w=t.useCallback((t=>{t?"string"===typeof t?t&&!h.includes(t)?console.error(`\`${t}\` does not exist in \`theme.colorSchemes\`.`):y((e=>{const r={...e};return mr(e,(e=>{"light"===e&&(f?.set(t),r.lightColorScheme=t),"dark"===e&&(m?.set(t),r.darkColorScheme=t)})),r})):y((e=>{const r={...e},a=null===t.light?n:t.light,o=null===t.dark?i:t.dark;return a&&(h.includes(a)?(r.lightColorScheme=a,f?.set(a)):console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)),o&&(h.includes(o)?(r.darkColorScheme=o,m?.set(o)):console.error(`\`${o}\` does not exist in \`theme.colorSchemes\`.`)),r})):y((t=>(f?.set(n),m?.set(i),{...t,lightColorScheme:n,darkColorScheme:i})))}),[h,f,m,n,i]),k=t.useCallback((t=>{"system"===g.mode&&y((e=>{const r=t?.matches?"dark":"light";return e.systemMode===r?e:{...e,systemMode:r}}))}),[g.mode]),T=t.useRef(k);return T.current=k,t.useEffect((()=>{if("function"!==typeof window.matchMedia||!d)return;const t=function(){return T.current(...arguments)},e=window.matchMedia("(prefers-color-scheme: dark)");return e.addListener(t),t(e),()=>{e.removeListener(t)}}),[d]),t.useEffect((()=>{if(d){const t=p?.subscribe((t=>{t&&!["light","dark","system"].includes(t)||_(t||r)}))||pr,e=f?.subscribe((t=>{t&&!h.match(t)||w({light:t})}))||pr,n=m?.subscribe((t=>{t&&!h.match(t)||w({dark:t})}))||pr;return()=>{t(),e(),n()}}}),[w,_,h,r,l,d,p,f,m]),{...g,mode:v?g.mode:void 0,systemMode:v?g.systemMode:void 0,colorScheme:v?b:void 0,setMode:_,setColorScheme:w}}const yr=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(e,Math.min(t,r))};function vr(t){return yr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function xr(t){if(t.type)return t;if("#"===t.charAt(0))return xr(function(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(e);return r&&1===r[0].length&&(r=r.map((t=>t+t))),r?`rgb${4===r.length?"a":""}(${r.map(((t,e)=>e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3)).join(", ")})`:""}(t));const e=t.indexOf("("),r=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(Zt(9,t));let n,i=t.substring(e+1,t.length-1);if("color"===r){if(i=i.split(" "),n=i.shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(n))throw new Error(Zt(10,n))}else i=i.split(",");return i=i.map((t=>parseFloat(t))),{type:r,values:i,colorSpace:n}}const br=(t,e)=>{try{return(t=>{const e=xr(t);return e.values.slice(0,3).map(((t,r)=>e.type.includes("hsl")&&0!==r?`${t}%`:t)).join(" ")})(t)}catch(r){return t}};function _r(t){const{type:e,colorSpace:r}=t;let{values:n}=t;return e.includes("rgb")?n=n.map(((t,e)=>e<3?parseInt(t,10):t)):e.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),n=e.includes("color")?`${r} ${n.join(" ")}`:`${n.join(", ")}`,`${e}(${n})`}function wr(t){t=xr(t);const{values:e}=t,r=e[0],n=e[1]/100,i=e[2]/100,a=n*Math.min(i,1-i),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+r/30)%12;return i-a*Math.max(Math.min(e-3,9-e,1),-1)};let s="rgb";const l=[Math.round(255*o(0)),Math.round(255*o(8)),Math.round(255*o(4))];return"hsla"===t.type&&(s+="a",l.push(e[3])),_r({type:s,values:l})}function kr(t){let e="hsl"===(t=xr(t)).type||"hsla"===t.type?xr(wr(t)).values:t.values;return e=e.map((e=>("color"!==t.type&&(e/=255),e<=.03928?e/12.92:((e+.055)/1.055)**2.4))),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Tr(t,e){return t=xr(t),e=vr(e),"rgb"!==t.type&&"hsl"!==t.type||(t.type+="a"),"color"===t.type?t.values[3]=`/${e}`:t.values[3]=e,_r(t)}function Sr(t,e,r){try{return Tr(t,e)}catch(n){return t}}function Ar(t,e){if(t=xr(t),e=vr(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let r=0;r<3;r+=1)t.values[r]*=1-e;return _r(t)}function Mr(t,e,r){try{return Ar(t,e)}catch(n){return t}}function Cr(t,e){if(t=xr(t),e=vr(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let r=0;r<3;r+=1)t.values[r]+=(255-t.values[r])*e;else if(t.type.includes("color"))for(let r=0;r<3;r+=1)t.values[r]+=(1-t.values[r])*e;return _r(t)}function Er(t,e,r){try{return Cr(t,e)}catch(n){return t}}function Lr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return kr(t)>.5?Ar(t,e):Cr(t,e)}function Pr(t,e,r){try{return Lr(t,e)}catch(n){return t}}const Ir={black:"#000",white:"#fff"},zr={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Or={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Dr={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Rr={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Fr={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Br={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},jr={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function Nr(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ir.white,default:Ir.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Ur=Nr();function Vr(){return{text:{primary:Ir.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ir.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const qr=Vr();function $r(t,e,r,n){const i=n.light||n,a=n.dark||1.5*n;t[e]||(t.hasOwnProperty(r)?t[e]=t[r]:"light"===e?t.light=Cr(t.main,i):"dark"===e&&(t.dark=Ar(t.main,a)))}function Hr(t){const{mode:e="light",contrastThreshold:r=3,tonalOffset:n=.2,...i}=t,a=t.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Fr[200],light:Fr[50],dark:Fr[400]}:{main:Fr[700],light:Fr[400],dark:Fr[800]}}(e),o=t.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Or[200],light:Or[50],dark:Or[400]}:{main:Or[500],light:Or[300],dark:Or[700]}}(e),s=t.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Dr[500],light:Dr[300],dark:Dr[700]}:{main:Dr[700],light:Dr[400],dark:Dr[800]}}(e),l=t.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Br[400],light:Br[300],dark:Br[700]}:{main:Br[700],light:Br[500],dark:Br[900]}}(e),c=t.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:jr[400],light:jr[300],dark:jr[700]}:{main:jr[800],light:jr[500],dark:jr[900]}}(e),u=t.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Rr[400],light:Rr[300],dark:Rr[700]}:{main:"#ed6c02",light:Rr[500],dark:Rr[900]}}(e);function h(t){const e=function(t,e){const r=kr(t),n=kr(e);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(t,qr.text.primary)>=r?qr.text.primary:Ur.text.primary;return e}const d=t=>{let{color:e,name:r,mainShade:i=500,lightShade:a=300,darkShade:o=700}=t;if(e={...e},!e.main&&e[i]&&(e.main=e[i]),!e.hasOwnProperty("main"))throw new Error(Zt(11,r?` (${r})`:"",i));if("string"!==typeof e.main)throw new Error(Zt(12,r?` (${r})`:"",JSON.stringify(e.main)));return $r(e,"light",a,n),$r(e,"dark",o,n),e.contrastText||(e.contrastText=h(e.main)),e};let p;"light"===e?p=Nr():"dark"===e&&(p=Vr());return te({common:{...Ir},mode:e,primary:d({color:a,name:"primary"}),secondary:d({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:s,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:zr,contrastThreshold:r,getContrastText:h,augmentColor:d,tonalOffset:n,...p},i)}function Wr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";function e(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];if(!n.length)return"";const a=n[0];return"string"!==typeof a||a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, ${a}`:`, var(--${t?`${t}-`:""}${a}${e(...n.slice(1))})`}return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return`var(--${t?`${t}-`:""}${r}${e(...i)})`}}function Gr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xe({spacing:t});if(t.mui)return t;const r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(0===r.length?[1]:r).map((t=>{const r=e(t);return"number"===typeof r?`${r}px`:r})).join(" ")};return r.mui=!0,r}function Yr(t){const e={};return Object.entries(t).forEach((t=>{const[r,n]=t;"object"===typeof n&&(e[r]=`${n.fontStyle?`${n.fontStyle} `:""}${n.fontVariant?`${n.fontVariant} `:""}${n.fontWeight?`${n.fontWeight} `:""}${n.fontStretch?`${n.fontStretch} `:""}${n.fontSize||""}${n.lineHeight?`/${n.lineHeight} `:""}${n.fontFamily||""}`)})),e}const Zr=function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=t;e.forEach(((t,a)=>{a===e.length-1?Array.isArray(i)?i[Number(t)]=r:i&&"object"===typeof i&&(i[t]=r):i&&"object"===typeof i&&(i[t]||(i[t]=n.includes(t)?[]:{}),i=i[t])}))};function Xr(t,e){const{prefix:r,shouldSkipGeneratingVar:n}=e||{},i={},a={},o={};var s,l;return s=(t,e,s)=>{if(("string"===typeof e||"number"===typeof e)&&(!n||!n(t,e))){const n=`--${r?`${r}-`:""}${t.join("-")}`,l=((t,e)=>"number"===typeof e?["lineHeight","fontWeight","opacity","zIndex"].some((e=>t.includes(e)))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e)(t,e);Object.assign(i,{[n]:l}),Zr(a,t,`var(${n})`,s),Zr(o,t,`var(${n}, ${l})`,s)}},l=t=>"vars"===t[0],function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Object.entries(e).forEach((e=>{let[i,a]=e;(!l||l&&!l([...r,i]))&&void 0!==a&&null!==a&&("object"===typeof a&&Object.keys(a).length>0?t(a,[...r,i],Array.isArray(a)?[...n,i]:n):s([...r,i],a,n))}))}(t),{css:i,vars:a,varsWithDefaults:o}}const Kr=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{getSelector:r=g,disableCssColorScheme:n,colorSchemeSelector:i}=e,{colorSchemes:a={},components:o,defaultColorScheme:s="light",...l}=t,{vars:c,css:u,varsWithDefaults:h}=Xr(l,e);let d=h;const p={},{[s]:f,...m}=a;if(Object.entries(m||{}).forEach((t=>{let[r,n]=t;const{vars:i,css:a,varsWithDefaults:o}=Xr(n,e);d=te(d,o),p[r]={css:a,vars:i}})),f){const{css:t,vars:r,varsWithDefaults:n}=Xr(f,e);d=te(d,n),p[s]={css:t,vars:r}}function g(e,r){let n=i;if("class"===i&&(n=".%s"),"data"===i&&(n="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(n=`[${i}="%s"]`),e){if("media"===n){if(t.defaultColorScheme===e)return":root";const n=a[e]?.palette?.mode||e;return{[`@media (prefers-color-scheme: ${n})`]:{":root":r}}}if(n)return t.defaultColorScheme===e?`:root, ${n.replace("%s",String(e))}`:n.replace("%s",String(e))}return":root"}return{vars:d,generateThemeVars:()=>{let t={...c};return Object.entries(p).forEach((e=>{let[,{vars:r}]=e;t=te(t,r)})),t},generateStyleSheets:()=>{const e=[],i=t.defaultColorScheme||"light";function o(t,r){Object.keys(r).length&&e.push("string"===typeof t?{[t]:{...r}}:t)}o(r(void 0,{...u}),u);const{[i]:s,...l}=p;if(s){const{css:t}=s,e=a[i]?.palette?.mode,l=!n&&e?{colorScheme:e,...t}:{...t};o(r(i,{...l}),l)}return Object.entries(l).forEach((t=>{let[e,{css:i}]=t;const s=a[e]?.palette?.mode,l=!n&&s?{colorScheme:s,...i}:{...i};o(r(e,{...l}),l)})),e}}};function Jr(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...i}=t,a=(t=>{const e=Object.keys(t).map((e=>({key:e,val:t[e]})))||[];return e.sort(((t,e)=>t.val-e.val)),e.reduce(((t,e)=>({...t,[e.key]:e.val})),{})})(e),o=Object.keys(a);function s(t){return`@media (min-width:${"number"===typeof e[t]?e[t]:t}${r})`}function l(t){return`@media (max-width:${("number"===typeof e[t]?e[t]:t)-n/100}${r})`}function c(t,i){const a=o.indexOf(i);return`@media (min-width:${"number"===typeof e[t]?e[t]:t}${r}) and (max-width:${(-1!==a&&"number"===typeof e[o[a]]?e[o[a]]:i)-n/100}${r})`}return{keys:o,values:a,up:s,down:l,between:c,only:function(t){return o.indexOf(t)+1<o.length?c(t,o[o.indexOf(t)+1]):s(t)},not:function(t){const e=o.indexOf(t);return 0===e?s(o[1]):e===o.length-1?l(o[e]):c(t,o[o.indexOf(t)+1]).replace("@media","@media not all and")},unit:r,...i}}const Qr={borderRadius:4};function tn(t,e){const r=this;if(r.vars){if(!r.colorSchemes?.[t]||"function"!==typeof r.getColorSchemeSelector)return{};let n=r.getColorSchemeSelector(t);return"&"===n?e:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:e})}return r.palette.mode===t?e:{}}const en=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:e={},palette:r={},spacing:n,shape:i={},...a}=t;let o=te({breakpoints:Jr(e),direction:"ltr",components:{},palette:{mode:"light",...r},spacing:Gr(n),shape:{...Qr,...i}},a);o=function(t){const e=(t,e)=>t.replace("@media",e?`@container ${e}`:"@container");function r(r,n){r.up=function(){return e(t.breakpoints.up(...arguments),n)},r.down=function(){return e(t.breakpoints.down(...arguments),n)},r.between=function(){return e(t.breakpoints.between(...arguments),n)},r.only=function(){return e(t.breakpoints.only(...arguments),n)},r.not=function(){const r=e(t.breakpoints.not(...arguments),n);return r.includes("not all and")?r.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):r}}const n={},i=t=>(r(n,t),n);return r(i),{...t,containerQueries:i}}(o),o.applyStyles=tn;for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return o=l.reduce(((t,e)=>te(t,e)),o),o.unstable_sxConfig={...Qe,...a?.unstable_sxConfig},o.unstable_sx=function(t){return er({sx:t,theme:this})},o};function rn(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}const nn={textTransform:"uppercase"},an='"Roboto", "Helvetica", "Arial", sans-serif';function on(t,e){const{fontFamily:r=an,fontSize:n=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...h}="function"===typeof e?e(t):e;const d=n/14,p=u||(t=>t/l*d+"rem"),f=(t,e,n,i,a)=>{return{fontFamily:r,fontWeight:t,fontSize:p(e),lineHeight:n,...r===an?{letterSpacing:(o=i/e,Math.round(1e5*o)/1e5)+"em"}:{},...a,...c};var o},m={h1:f(i,96,1.167,-1.5),h2:f(i,60,1.2,-.5),h3:f(a,48,1.167,0),h4:f(a,34,1.235,.25),h5:f(a,24,1.334,0),h6:f(o,20,1.6,.15),subtitle1:f(a,16,1.75,.15),subtitle2:f(o,14,1.57,.1),body1:f(a,16,1.5,.15),body2:f(a,14,1.43,.15),button:f(o,14,1.75,.4,nn),caption:f(a,12,1.66,.4),overline:f(a,12,2.66,1,nn),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return te({htmlFontSize:l,pxToRem:p,fontFamily:r,fontSize:n,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,...m},h,{clone:!1})}function sn(){return[`${arguments.length<=0?void 0:arguments[0]}px ${arguments.length<=1?void 0:arguments[1]}px ${arguments.length<=2?void 0:arguments[2]}px ${arguments.length<=3?void 0:arguments[3]}px rgba(0,0,0,0.2)`,`${arguments.length<=4?void 0:arguments[4]}px ${arguments.length<=5?void 0:arguments[5]}px ${arguments.length<=6?void 0:arguments[6]}px ${arguments.length<=7?void 0:arguments[7]}px rgba(0,0,0,0.14)`,`${arguments.length<=8?void 0:arguments[8]}px ${arguments.length<=9?void 0:arguments[9]}px ${arguments.length<=10?void 0:arguments[10]}px ${arguments.length<=11?void 0:arguments[11]}px rgba(0,0,0,0.12)`].join(",")}const ln=["none",sn(0,2,1,-1,0,1,1,0,0,1,3,0),sn(0,3,1,-2,0,2,2,0,0,1,5,0),sn(0,3,3,-2,0,3,4,0,0,1,8,0),sn(0,2,4,-1,0,4,5,0,0,1,10,0),sn(0,3,5,-1,0,5,8,0,0,1,14,0),sn(0,3,5,-1,0,6,10,0,0,1,18,0),sn(0,4,5,-2,0,7,10,1,0,2,16,1),sn(0,5,5,-3,0,8,10,1,0,3,14,2),sn(0,5,6,-3,0,9,12,1,0,3,16,2),sn(0,6,6,-3,0,10,14,1,0,4,18,3),sn(0,6,7,-4,0,11,15,1,0,4,20,3),sn(0,7,8,-4,0,12,17,2,0,5,22,4),sn(0,7,8,-4,0,13,19,2,0,5,24,4),sn(0,7,9,-4,0,14,21,2,0,5,26,4),sn(0,8,9,-5,0,15,22,2,0,6,28,5),sn(0,8,10,-5,0,16,24,2,0,6,30,5),sn(0,8,11,-5,0,17,26,2,0,6,32,5),sn(0,9,11,-5,0,18,28,2,0,7,34,6),sn(0,9,12,-6,0,19,29,2,0,7,36,6),sn(0,10,13,-6,0,20,31,3,0,8,38,7),sn(0,10,13,-6,0,21,33,3,0,8,40,7),sn(0,10,14,-6,0,22,35,3,0,8,42,7),sn(0,11,14,-7,0,23,36,3,0,9,44,8),sn(0,11,15,-7,0,24,38,3,0,9,46,8)],cn={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},un={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function hn(t){return`${Math.round(t)}ms`}function dn(t){if(!t)return 0;const e=t/36;return Math.min(Math.round(10*(4+15*e**.25+e/5)),3e3)}function pn(t){const e={...cn,...t.easing},r={...un,...t.duration};return{getAutoHeightDuration:dn,create:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:i=r.standard,easing:a=e.easeInOut,delay:o=0,...s}=n;return(Array.isArray(t)?t:[t]).map((t=>`${t} ${"string"===typeof i?i:hn(i)} ${a} ${"string"===typeof o?o:hn(o)}`)).join(",")},...t,easing:e,duration:r}}const fn={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function mn(){const t={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return function t(e){const r=Object.entries(e);for(let i=0;i<r.length;i++){const[a,o]=r[i];!Jt(n=o)&&"undefined"!==typeof n&&"string"!==typeof n&&"boolean"!==typeof n&&"number"!==typeof n&&!Array.isArray(n)||a.startsWith("unstable_")?delete e[a]:Jt(o)&&(e[a]={...o},t(e[a]))}var n}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';\n\nconst theme = ${JSON.stringify(t,null,2)};\n\ntheme.breakpoints = createBreakpoints(theme.breakpoints || {});\ntheme.transitions = createTransitions(theme.transitions || {});\n\nexport default theme;`}const gn=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:e,mixins:r={},spacing:n,palette:i={},transitions:a={},typography:o={},shape:s,...l}=t;if(t.vars&&void 0===t.generateThemeVars)throw new Error(Zt(20));const c=Hr(i),u=en(t);let h=te(u,{mixins:rn(u.breakpoints,r),palette:c,shadows:ln.slice(),typography:on(c,o),transitions:pn(a),zIndex:{...fn}});h=te(h,l);for(var d=arguments.length,p=new Array(d>1?d-1:0),f=1;f<d;f++)p[f-1]=arguments[f];return h=p.reduce(((t,e)=>te(t,e)),h),h.unstable_sxConfig={...Qe,...l?.unstable_sxConfig},h.unstable_sx=function(t){return er({sx:t,theme:this})},h.toRuntimeSource=mn,h};function yn(t){let e;return e=t<1?5.11916*t**2:4.5*Math.log(t+1)+2,Math.round(10*e)/1e3}const vn=[...Array(25)].map(((t,e)=>{if(0===e)return"none";const r=yn(e);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`}));function xn(t){return{inputPlaceholder:"dark"===t?.5:.42,inputUnderline:"dark"===t?.7:.42,switchTrackDisabled:"dark"===t?.2:.12,switchTrack:"dark"===t?.3:.38}}function bn(t){return"dark"===t?vn:[]}function _n(t){return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||"palette"===t[0]&&!!t[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const wn=t=>[...[...Array(25)].map(((e,r)=>`--${t?`${t}-`:""}overlays-${r}`)),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],kn=t=>(e,r)=>{const n=t.rootSelector||":root",i=t.colorSchemeSelector;let a=i;if("class"===i&&(a=".%s"),"data"===i&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),t.defaultColorScheme===e){if("dark"===e){const i={};return wn(t.cssVarPrefix).forEach((t=>{i[t]=r[t],delete r[t]})),"media"===a?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:i}}:a?{[a.replace("%s",e)]:i,[`${n}, ${a.replace("%s",e)}`]:r}:{[n]:{...r,...i}}}if(a&&"media"!==a)return`${n}, ${a.replace("%s",String(e))}`}else if(e){if("media"===a)return{[`@media (prefers-color-scheme: ${String(e)})`]:{[n]:r}};if(a)return a.replace("%s",String(e))}return n};function Tn(t,e,r){!t[e]&&r&&(t[e]=r)}function Sn(t){return"string"===typeof t&&t.startsWith("hsl")?wr(t):t}function An(t,e){`${e}Channel`in t||(t[`${e}Channel`]=br(Sn(t[e])))}const Mn=t=>{try{return t()}catch(e){}};function Cn(t,e,r,n){if(!e)return;e=!0===e?{}:e;const i="dark"===n?"dark":"light";if(!r)return void(t[n]=function(t){const{palette:e={mode:"light"},opacity:r,overlays:n,...i}=t,a=Hr(e);return{palette:a,opacity:{...xn(a.mode),...r},overlays:n||bn(a.mode),...i}}({...e,palette:{mode:i,...e?.palette}}));const{palette:a,...o}=gn({...r,palette:{mode:i,...e?.palette}});return t[n]={...e,palette:a,opacity:{...xn(i),...e?.opacity},overlays:e?.overlays||bn(i)},o}function En(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{colorSchemes:e={light:!0},defaultColorScheme:r,disableCssColorScheme:n=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:a=_n,colorSchemeSelector:o=(e.light&&e.dark?"media":void 0),rootSelector:s=":root",...l}=t,c=Object.keys(e)[0],u=r||(e.light&&"light"!==c?"light":c),h=function(){return Wr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mui")}(i),{[u]:d,light:p,dark:f,...m}=e,g={...m};let y=d;if(("dark"===u&&!("dark"in e)||"light"===u&&!("light"in e))&&(y=!0),!y)throw new Error(Zt(21,u));const v=Cn(g,y,l,u);p&&!g.light&&Cn(g,p,void 0,"light"),f&&!g.dark&&Cn(g,f,void 0,"dark");let x={defaultColorScheme:u,...v,cssVarPrefix:i,colorSchemeSelector:o,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...Yr(v.typography),...v.font},spacing:(b=l.spacing,"number"===typeof b?`${b}px`:"string"===typeof b||"function"===typeof b||Array.isArray(b)?b:"8px")};var b;Object.keys(x.colorSchemes).forEach((t=>{const e=x.colorSchemes[t].palette,r=t=>{const r=t.split("-"),n=r[1],i=r[2];return h(t,e[n][i])};var n;if("light"===e.mode&&(Tn(e.common,"background","#fff"),Tn(e.common,"onBackground","#000")),"dark"===e.mode&&(Tn(e.common,"background","#000"),Tn(e.common,"onBackground","#fff")),n=e,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach((t=>{n[t]||(n[t]={})})),"light"===e.mode){Tn(e.Alert,"errorColor",Mr(e.error.light,.6)),Tn(e.Alert,"infoColor",Mr(e.info.light,.6)),Tn(e.Alert,"successColor",Mr(e.success.light,.6)),Tn(e.Alert,"warningColor",Mr(e.warning.light,.6)),Tn(e.Alert,"errorFilledBg",r("palette-error-main")),Tn(e.Alert,"infoFilledBg",r("palette-info-main")),Tn(e.Alert,"successFilledBg",r("palette-success-main")),Tn(e.Alert,"warningFilledBg",r("palette-warning-main")),Tn(e.Alert,"errorFilledColor",Mn((()=>e.getContrastText(e.error.main)))),Tn(e.Alert,"infoFilledColor",Mn((()=>e.getContrastText(e.info.main)))),Tn(e.Alert,"successFilledColor",Mn((()=>e.getContrastText(e.success.main)))),Tn(e.Alert,"warningFilledColor",Mn((()=>e.getContrastText(e.warning.main)))),Tn(e.Alert,"errorStandardBg",Er(e.error.light,.9)),Tn(e.Alert,"infoStandardBg",Er(e.info.light,.9)),Tn(e.Alert,"successStandardBg",Er(e.success.light,.9)),Tn(e.Alert,"warningStandardBg",Er(e.warning.light,.9)),Tn(e.Alert,"errorIconColor",r("palette-error-main")),Tn(e.Alert,"infoIconColor",r("palette-info-main")),Tn(e.Alert,"successIconColor",r("palette-success-main")),Tn(e.Alert,"warningIconColor",r("palette-warning-main")),Tn(e.AppBar,"defaultBg",r("palette-grey-100")),Tn(e.Avatar,"defaultBg",r("palette-grey-400")),Tn(e.Button,"inheritContainedBg",r("palette-grey-300")),Tn(e.Button,"inheritContainedHoverBg",r("palette-grey-A100")),Tn(e.Chip,"defaultBorder",r("palette-grey-400")),Tn(e.Chip,"defaultAvatarColor",r("palette-grey-700")),Tn(e.Chip,"defaultIconColor",r("palette-grey-700")),Tn(e.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Tn(e.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Tn(e.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Tn(e.LinearProgress,"primaryBg",Er(e.primary.main,.62)),Tn(e.LinearProgress,"secondaryBg",Er(e.secondary.main,.62)),Tn(e.LinearProgress,"errorBg",Er(e.error.main,.62)),Tn(e.LinearProgress,"infoBg",Er(e.info.main,.62)),Tn(e.LinearProgress,"successBg",Er(e.success.main,.62)),Tn(e.LinearProgress,"warningBg",Er(e.warning.main,.62)),Tn(e.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.11)`),Tn(e.Slider,"primaryTrack",Er(e.primary.main,.62)),Tn(e.Slider,"secondaryTrack",Er(e.secondary.main,.62)),Tn(e.Slider,"errorTrack",Er(e.error.main,.62)),Tn(e.Slider,"infoTrack",Er(e.info.main,.62)),Tn(e.Slider,"successTrack",Er(e.success.main,.62)),Tn(e.Slider,"warningTrack",Er(e.warning.main,.62));const t=Pr(e.background.default,.8);Tn(e.SnackbarContent,"bg",t),Tn(e.SnackbarContent,"color",Mn((()=>e.getContrastText(t)))),Tn(e.SpeedDialAction,"fabHoverBg",Pr(e.background.paper,.15)),Tn(e.StepConnector,"border",r("palette-grey-400")),Tn(e.StepContent,"border",r("palette-grey-400")),Tn(e.Switch,"defaultColor",r("palette-common-white")),Tn(e.Switch,"defaultDisabledColor",r("palette-grey-100")),Tn(e.Switch,"primaryDisabledColor",Er(e.primary.main,.62)),Tn(e.Switch,"secondaryDisabledColor",Er(e.secondary.main,.62)),Tn(e.Switch,"errorDisabledColor",Er(e.error.main,.62)),Tn(e.Switch,"infoDisabledColor",Er(e.info.main,.62)),Tn(e.Switch,"successDisabledColor",Er(e.success.main,.62)),Tn(e.Switch,"warningDisabledColor",Er(e.warning.main,.62)),Tn(e.TableCell,"border",Er(Sr(e.divider,1),.88)),Tn(e.Tooltip,"bg",Sr(e.grey[700],.92))}if("dark"===e.mode){Tn(e.Alert,"errorColor",Er(e.error.light,.6)),Tn(e.Alert,"infoColor",Er(e.info.light,.6)),Tn(e.Alert,"successColor",Er(e.success.light,.6)),Tn(e.Alert,"warningColor",Er(e.warning.light,.6)),Tn(e.Alert,"errorFilledBg",r("palette-error-dark")),Tn(e.Alert,"infoFilledBg",r("palette-info-dark")),Tn(e.Alert,"successFilledBg",r("palette-success-dark")),Tn(e.Alert,"warningFilledBg",r("palette-warning-dark")),Tn(e.Alert,"errorFilledColor",Mn((()=>e.getContrastText(e.error.dark)))),Tn(e.Alert,"infoFilledColor",Mn((()=>e.getContrastText(e.info.dark)))),Tn(e.Alert,"successFilledColor",Mn((()=>e.getContrastText(e.success.dark)))),Tn(e.Alert,"warningFilledColor",Mn((()=>e.getContrastText(e.warning.dark)))),Tn(e.Alert,"errorStandardBg",Mr(e.error.light,.9)),Tn(e.Alert,"infoStandardBg",Mr(e.info.light,.9)),Tn(e.Alert,"successStandardBg",Mr(e.success.light,.9)),Tn(e.Alert,"warningStandardBg",Mr(e.warning.light,.9)),Tn(e.Alert,"errorIconColor",r("palette-error-main")),Tn(e.Alert,"infoIconColor",r("palette-info-main")),Tn(e.Alert,"successIconColor",r("palette-success-main")),Tn(e.Alert,"warningIconColor",r("palette-warning-main")),Tn(e.AppBar,"defaultBg",r("palette-grey-900")),Tn(e.AppBar,"darkBg",r("palette-background-paper")),Tn(e.AppBar,"darkColor",r("palette-text-primary")),Tn(e.Avatar,"defaultBg",r("palette-grey-600")),Tn(e.Button,"inheritContainedBg",r("palette-grey-800")),Tn(e.Button,"inheritContainedHoverBg",r("palette-grey-700")),Tn(e.Chip,"defaultBorder",r("palette-grey-700")),Tn(e.Chip,"defaultAvatarColor",r("palette-grey-300")),Tn(e.Chip,"defaultIconColor",r("palette-grey-300")),Tn(e.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Tn(e.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Tn(e.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Tn(e.LinearProgress,"primaryBg",Mr(e.primary.main,.5)),Tn(e.LinearProgress,"secondaryBg",Mr(e.secondary.main,.5)),Tn(e.LinearProgress,"errorBg",Mr(e.error.main,.5)),Tn(e.LinearProgress,"infoBg",Mr(e.info.main,.5)),Tn(e.LinearProgress,"successBg",Mr(e.success.main,.5)),Tn(e.LinearProgress,"warningBg",Mr(e.warning.main,.5)),Tn(e.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.13)`),Tn(e.Slider,"primaryTrack",Mr(e.primary.main,.5)),Tn(e.Slider,"secondaryTrack",Mr(e.secondary.main,.5)),Tn(e.Slider,"errorTrack",Mr(e.error.main,.5)),Tn(e.Slider,"infoTrack",Mr(e.info.main,.5)),Tn(e.Slider,"successTrack",Mr(e.success.main,.5)),Tn(e.Slider,"warningTrack",Mr(e.warning.main,.5));const t=Pr(e.background.default,.98);Tn(e.SnackbarContent,"bg",t),Tn(e.SnackbarContent,"color",Mn((()=>e.getContrastText(t)))),Tn(e.SpeedDialAction,"fabHoverBg",Pr(e.background.paper,.15)),Tn(e.StepConnector,"border",r("palette-grey-600")),Tn(e.StepContent,"border",r("palette-grey-600")),Tn(e.Switch,"defaultColor",r("palette-grey-300")),Tn(e.Switch,"defaultDisabledColor",r("palette-grey-600")),Tn(e.Switch,"primaryDisabledColor",Mr(e.primary.main,.55)),Tn(e.Switch,"secondaryDisabledColor",Mr(e.secondary.main,.55)),Tn(e.Switch,"errorDisabledColor",Mr(e.error.main,.55)),Tn(e.Switch,"infoDisabledColor",Mr(e.info.main,.55)),Tn(e.Switch,"successDisabledColor",Mr(e.success.main,.55)),Tn(e.Switch,"warningDisabledColor",Mr(e.warning.main,.55)),Tn(e.TableCell,"border",Mr(Sr(e.divider,1),.68)),Tn(e.Tooltip,"bg",Sr(e.grey[700],.92))}An(e.background,"default"),An(e.background,"paper"),An(e.common,"background"),An(e.common,"onBackground"),An(e,"divider"),Object.keys(e).forEach((t=>{const r=e[t];"tonalOffset"!==t&&r&&"object"===typeof r&&(r.main&&Tn(e[t],"mainChannel",br(Sn(r.main))),r.light&&Tn(e[t],"lightChannel",br(Sn(r.light))),r.dark&&Tn(e[t],"darkChannel",br(Sn(r.dark))),r.contrastText&&Tn(e[t],"contrastTextChannel",br(Sn(r.contrastText))),"text"===t&&(An(e[t],"primary"),An(e[t],"secondary")),"action"===t&&(r.active&&An(e[t],"active"),r.selected&&An(e[t],"selected")))}))}));for(var _=arguments.length,w=new Array(_>1?_-1:0),k=1;k<_;k++)w[k-1]=arguments[k];x=w.reduce(((t,e)=>te(t,e)),x);const T={prefix:i,disableCssColorScheme:n,shouldSkipGeneratingVar:a,getSelector:kn(x)},{vars:S,generateThemeVars:A,generateStyleSheets:M}=Kr(x,T);return x.vars=S,Object.entries(x.colorSchemes[x.defaultColorScheme]).forEach((t=>{let[e,r]=t;x[e]=r})),x.generateThemeVars=A,x.generateStyleSheets=M,x.generateSpacing=function(){return Gr(l.spacing,xe(this))},x.getColorSchemeSelector=function(t){return function(e){return"media"===t?`@media (prefers-color-scheme: ${e})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${e}"] &`:"class"===t?`.${e} &`:"data"===t?`[data-${e}] &`:`${t.replace("%s",e)} &`:"&"}}(o),x.spacing=x.generateSpacing(),x.shouldSkipGeneratingVar=a,x.unstable_sxConfig={...Qe,...l?.unstable_sxConfig},x.unstable_sx=function(t){return er({sx:t,theme:this})},x.toRuntimeSource=mn,x}function Ln(t,e,r){t.colorSchemes&&r&&(t.colorSchemes[e]={...!0!==r&&r,palette:Hr({...!0===r?{}:r.palette,mode:e})})}function Pn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{palette:e,cssVariables:r=!1,colorSchemes:n=(e?void 0:{light:!0}),defaultColorScheme:i=e?.mode,...a}=t,o=i||"light",s=n?.[o],l={...n,...e?{[o]:{..."boolean"!==typeof s&&s,palette:e}}:void 0};for(var c=arguments.length,u=new Array(c>1?c-1:0),h=1;h<c;h++)u[h-1]=arguments[h];if(!1===r){if(!("colorSchemes"in t))return gn(t,...u);let r=e;"palette"in t||l[o]&&(!0!==l[o]?r=l[o].palette:"dark"===o&&(r={mode:"dark"}));const n=gn({...t,palette:r},...u);return n.defaultColorScheme=o,n.colorSchemes=l,"light"===n.palette.mode&&(n.colorSchemes.light={...!0!==l.light&&l.light,palette:n.palette},Ln(n,"dark",l.dark)),"dark"===n.palette.mode&&(n.colorSchemes.dark={...!0!==l.dark&&l.dark,palette:n.palette},Ln(n,"light",l.light)),n}return e||"light"in l||"light"!==o||(l.light=!0),En({...a,colorSchemes:l,defaultColorScheme:o,..."boolean"!==typeof r&&r},...u)}const In={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:zn,useColorScheme:On,getInitColorSchemeScript:Dn}=function(e){const{themeId:r,theme:n={},modeStorageKey:i=lr,colorSchemeStorageKey:o=cr,disableTransitionOnChange:l=!1,defaultColorScheme:c,resolveTheme:u}=e,h={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},d=t.createContext(void 0),p={},f={},m="string"===typeof c?c:c.light,g="string"===typeof c?c:c.dark;return{CssVarsProvider:function(e){const{children:h,theme:m,modeStorageKey:g=i,colorSchemeStorageKey:y=o,disableTransitionOnChange:v=l,storageManager:x,storageWindow:b=("undefined"===typeof window?void 0:window),documentNode:_=("undefined"===typeof document?void 0:document),colorSchemeNode:w=("undefined"===typeof document?void 0:document.documentElement),disableNestedContext:k=!1,disableStyleSheetGeneration:T=!1,defaultMode:S="system",forceThemeRerender:A=!1,noSsr:M}=e,C=t.useRef(!1),E=a(),L=t.useContext(d),P=!!L&&!k,I=t.useMemo((()=>m||("function"===typeof n?n():n)),[m]),z=I[r],O=z||I,{colorSchemes:D=p,components:R=f,cssVarPrefix:F}=O,B=Object.keys(D).filter((t=>!!D[t])).join(","),j=t.useMemo((()=>B.split(",")),[B]),N="string"===typeof c?c:c.light,U="string"===typeof c?c:c.dark,V=D[N]&&D[U]?S:D[O.defaultColorScheme]?.palette?.mode||O.palette?.mode,{mode:q,setMode:$,systemMode:H,lightColorScheme:W,darkColorScheme:G,colorScheme:Y,setColorScheme:Z}=gr({supportedColorSchemes:j,defaultLightColorScheme:N,defaultDarkColorScheme:U,modeStorageKey:g,colorSchemeStorageKey:y,defaultMode:V,storageManager:x,storageWindow:b,noSsr:M});let X=q,K=Y;P&&(X=L.mode,K=L.colorScheme);let J=K||O.defaultColorScheme;O.vars&&!A&&(J=O.defaultColorScheme);const Q=t.useMemo((()=>{const t=O.generateThemeVars?.()||O.vars,e={...O,components:R,colorSchemes:D,cssVarPrefix:F,vars:t};if("function"===typeof e.generateSpacing&&(e.spacing=e.generateSpacing()),J){const t=D[J];t&&"object"===typeof t&&Object.keys(t).forEach((r=>{t[r]&&"object"===typeof t[r]?e[r]={...e[r],...t[r]}:e[r]=t[r]}))}return u?u(e):e}),[O,J,R,D,F]),tt=O.colorSchemeSelector;sr((()=>{if(K&&w&&tt&&"media"!==tt){const t=tt;let e=tt;if("class"===t&&(e=".%s"),"data"===t&&(e="[data-%s]"),t?.startsWith("data-")&&!t.includes("%s")&&(e=`[${t}="%s"]`),e.startsWith("."))w.classList.remove(...j.map((t=>e.substring(1).replace("%s",t)))),w.classList.add(e.substring(1).replace("%s",K));else{const t=e.replace("%s",K).match(/\[([^\]]+)\]/);if(t){const[e,r]=t[1].split("=");r||j.forEach((t=>{w.removeAttribute(e.replace(K,t))})),w.setAttribute(e,r?r.replace(/"|'/g,""):"")}else w.setAttribute(e,K)}}}),[K,tt,w,j]),t.useEffect((()=>{let t;if(v&&C.current&&_){const e=_.createElement("style");e.appendChild(_.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),_.head.appendChild(e),window.getComputedStyle(_.body),t=setTimeout((()=>{_.head.removeChild(e)}),1)}return()=>{clearTimeout(t)}}),[K,v,_]),t.useEffect((()=>(C.current=!0,()=>{C.current=!1})),[]);const et=t.useMemo((()=>({allColorSchemes:j,colorScheme:K,darkColorScheme:G,lightColorScheme:W,mode:X,setColorScheme:Z,setMode:$,systemMode:H})),[j,K,G,W,X,Z,$,H,Q.colorSchemeSelector]);let rt=!0;(T||!1===O.cssVariables||P&&E?.cssVarPrefix===F)&&(rt=!1);const nt=(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)(Wt,{themeId:z?r:void 0,theme:Q,children:h}),rt&&(0,s.jsx)(or,{styles:Q.generateStyleSheets?.()||[]})]});return P?nt:(0,s.jsx)(d.Provider,{value:et,children:nt})},useColorScheme:()=>t.useContext(d)||h,getInitColorSchemeScript:t=>function(t){const{defaultMode:e="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:i=lr,colorSchemeStorageKey:a=cr,attribute:o=ur,colorSchemeNode:l="document.documentElement",nonce:c}=t||{};let u="",h=o;if("class"===o&&(h=".%s"),"data"===o&&(h="[data-%s]"),h.startsWith(".")){const t=h.substring(1);u+=`${l}.classList.remove('${t}'.replace('%s', light), '${t}'.replace('%s', dark));\n ${l}.classList.add('${t}'.replace('%s', colorScheme));`}const d=h.match(/\[([^\]]+)\]/);if(d){const[t,e]=d[1].split("=");e||(u+=`${l}.removeAttribute('${t}'.replace('%s', light));\n ${l}.removeAttribute('${t}'.replace('%s', dark));`),u+=`\n ${l}.setAttribute('${t}'.replace('%s', colorScheme), ${e?`${e}.replace('%s', colorScheme)`:'""'});`}else u+=`${l}.setAttribute('${h}', colorScheme);`;return(0,s.jsx)("script",{suppressHydrationWarning:!0,nonce:"undefined"===typeof window?c:"",dangerouslySetInnerHTML:{__html:`(function() {\ntry {\n let colorScheme = '';\n const mode = localStorage.getItem('${i}') || '${e}';\n const dark = localStorage.getItem('${a}-dark') || '${n}';\n const light = localStorage.getItem('${a}-light') || '${r}';\n if (mode === 'system') {\n // handle system mode\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = dark\n } else {\n colorScheme = light\n }\n }\n if (mode === 'light') {\n colorScheme = light;\n }\n if (mode === 'dark') {\n colorScheme = dark;\n }\n if (colorScheme) {\n ${u}\n }\n} catch(e){}})();`}},"mui-color-scheme-init")}({colorSchemeStorageKey:o,defaultLightColorScheme:m,defaultDarkColorScheme:g,modeStorageKey:i,...t})}}({themeId:Gt,theme:()=>Pn({cssVariables:!0}),colorSchemeStorageKey:In.colorSchemeStorageKey,modeStorageKey:In.modeStorageKey,defaultColorScheme:{light:In.defaultLightColorScheme,dark:In.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:on(t.palette,t.typography)};return e.unstable_sx=function(t){return er({sx:t,theme:this})},e}});const Rn=zn;function Fn(t){let{theme:e,...r}=t;if("function"===typeof e)return(0,s.jsx)(Yt,{theme:e,...r});const n=Gt in e?e[Gt]:e;return"colorSchemes"in n?(0,s.jsx)(Rn,{theme:e,...r}):"vars"in n?(0,s.jsx)(Yt,{theme:e,...r}):(0,s.jsx)(Yt,{theme:{...e,vars:null},...r})}const Bn=Pn({palette:{primary:{main:"#1A2536",contrastText:"#D3CDBF"},secondary:{main:"#4A7A7D",contrastText:"#FFFFFF"},text:{primary:"#2E2E2E",secondary:"#1A2536"},background:{default:"#D3CDBF",paper:"#FFFFFF"},action:{active:"#D4A017",hover:"rgba(212, 160, 23, 0.1)"},custom:{highlight:"#D4A017",contrast:"#2E2E2E"}},typography:{fontFamily:"'Roboto', sans-serif",h1:{fontSize:"2rem",fontWeight:500,color:"#2E2E2E"},body1:{fontSize:"1rem",color:"#2E2E2E"}},components:{MuiLink:{styleOverrides:{root:{color:"#4A7A7D",textDecoration:"none","&:hover":{color:"#D4A017",textDecoration:"underline"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none","&:hover":{backgroundColor:"rgba(212, 160, 23, 0.2)"}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"#1A2536"}}}}});function jn(e,r,n,i,a){const[o,s]=t.useState((()=>a&&n?n(e).matches:i?i(e).matches:r));return sr((()=>{if(!n)return;const t=n(e),r=()=>{s(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}}),[e,n]),o}const Nn={...e}.useSyncExternalStore;function Un(e,r,n,i,a){const o=t.useCallback((()=>r),[r]),s=t.useMemo((()=>{if(a&&n)return()=>n(e).matches;if(null!==i){const{matches:t}=i(e);return()=>t}return o}),[o,e,i,a,n]),[l,c]=t.useMemo((()=>{if(null===n)return[o,()=>()=>{}];const t=n(e);return[()=>t.matches,e=>(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)})]}),[o,n,e]);return Nn(c,l,s)}function Vn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:e}=t;return function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Rt();n&&e&&(n=n[e]||n);const i="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:a=!1,matchMedia:o=(i?window.matchMedia:null),ssrMatchMedia:s=null,noSsr:l=!1}=function(t){const{theme:e,name:r,props:n}=t;return e&&e.components&&e.components[r]&&e.components[r].defaultProps?Nt(e.components[r].defaultProps,n):n}({name:"MuiUseMediaQuery",props:r,theme:n});let c="function"===typeof t?t(n):t;c=c.replace(/^@media( ?)/m,"");return(void 0!==Nn?Un:jn)(c,a,o,s,l)}}Vn();const qn=Vn({themeId:Gt});function $n(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=$n(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}const Hn=function(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=$n(t))&&(n&&(n+=" "),n+=e);return n};function Wn(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};for(const i in t){const a=t[i];let o="",s=!0;for(let t=0;t<a.length;t+=1){const n=a[t];n&&(o+=(!0===s?"":" ")+e(n),s=!1,r&&r[n]&&(o+=" "+r[n]))}n[i]=o}return n}function Gn(){return Gn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Gn.apply(null,arguments)}var Yn=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Zn=mt((function(t){return Yn.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91})),Xn=function(t){return"theme"!==t},Kn=function(t){return"string"===typeof t&&t.charCodeAt(0)>96?Zn:Xn},Jn=function(t,e,r){var n;if(e){var i=e.shouldForwardProp;n=t.__emotion_forwardProp&&i?function(e){return t.__emotion_forwardProp(e)&&i(e)}:i}return"function"!==typeof n&&r&&(n=t.__emotion_forwardProp),n},Qn=function(t){var e=t.cache,r=t.serialized,n=t.isStringTag;return dt(e,r,n),Mt((function(){return pt(e,r,n)})),null},ti=function e(r,n){var i,a,o=r.__emotion_real===r,s=o&&r.__emotion_base||r;void 0!==n&&(i=n.label,a=n.target);var l=Jn(r,n,o),c=l||Kn(s),u=!c("as");return function(){var h=arguments,d=o&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==i&&d.push("label:"+i+";"),null==h[0]||void 0===h[0].raw)d.push.apply(d,h);else{var p=h[0];d.push(p[0]);for(var f=h.length,m=1;m<f;m++)d.push(h[m],p[m])}var g=Lt((function(e,r,n){var i=u&&e.as||s,o="",h=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=t.useContext(Pt)}"string"===typeof e.className?o=ht(r.registered,h,e.className):null!=e.className&&(o=e.className+" ");var m=St(d.concat(h),r.registered,p);o+=r.key+"-"+m.name,void 0!==a&&(o+=" "+a);var g=u&&void 0===l?Kn(i):c,y={};for(var v in e)u&&"as"===v||g(v)&&(y[v]=e[v]);return y.className=o,n&&(y.ref=n),t.createElement(t.Fragment,null,t.createElement(Qn,{cache:r,serialized:m,isStringTag:"string"===typeof i}),t.createElement(i,y))}));return g.displayName=void 0!==i?i:"Styled("+("string"===typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=r.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=d,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+a}}),g.withComponent=function(t,r){return e(t,Gn({},n,r,{shouldForwardProp:Jn(g,r,!0)})).apply(void 0,d)},g}}.bind(null);function ei(t,e){return ti(t,e)}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(t){ti[t]=ti(t)}));const ri=[];function ni(t){return ri[0]=t,St(ri)}function ii(t){const{variants:e,...r}=t,n={variants:e,style:ni(r),isProcessed:!0};return n.style===r||e&&e.forEach((t=>{"function"!==typeof t.style&&(t.style=ni(t.style))})),n}const ai=en();function oi(t){return"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t}function si(t){return t?(e,r)=>r[t]:null}function li(t,e){const r="function"===typeof e?e(t):e;if(Array.isArray(r))return r.flatMap((e=>li(t,e)));if(Array.isArray(r?.variants)){let e;if(r.isProcessed)e=r.style;else{const{variants:t,...n}=r;e=n}return ci(t,r.variants,[e])}return r?.isProcessed?r.style:r}function ci(t,e){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t:for(let i=0;i<e.length;i+=1){const a=e[i];if("function"===typeof a.props){if(r??={...t,...t.ownerState,ownerState:t.ownerState},!a.props(r))continue}else for(const e in a.props)if(t[e]!==a.props[e]&&t.ownerState?.[e]!==a.props[e])continue t;"function"===typeof a.style?(r??={...t,...t.ownerState,ownerState:t.ownerState},n.push(a.style(r))):n.push(a.style)}return n}function ui(t,e){}function hi(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}const di=Pn();const pi=function(t){return"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t},fi=t=>pi(t)&&"classes"!==t,mi=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:e,defaultTheme:r=ai,rootShouldForwardProp:n=oi,slotShouldForwardProp:i=oi}=t;function a(t){!function(t,e,r){t.theme=function(t){for(const e in t)return!1;return!0}(t.theme)?r:t.theme[e]||t.theme}(t,e,r)}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}(t,(t=>t.filter((t=>t!==er))));const{name:r,slot:o,skipVariantsResolver:s,skipSx:l,overridesResolver:c=si(hi(o)),...u}=e,h=void 0!==s?s:o&&"Root"!==o&&"root"!==o||!1,d=l||!1;let p=oi;"Root"===o||"root"===o?p=n:o?p=i:function(t){return"string"===typeof t&&t.charCodeAt(0)>96}(t)&&(p=void 0);const f=ei(t,{shouldForwardProp:p,label:ui(r,o),...u}),m=t=>{if("function"===typeof t&&t.__emotion_real!==t)return function(e){return li(e,t)};if(Jt(t)){const e=ii(t);return e.variants?function(t){return li(t,e)}:e.style}return t},g=function(){const e=[];for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];const s=i.map(m),l=[];if(e.push(a),r&&c&&l.push((function(t){const e=t.theme,n=e.components?.[r]?.styleOverrides;if(!n)return null;const i={};for(const r in n)i[r]=li(t,n[r]);return c(t,i)})),r&&!h&&l.push((function(t){const e=t.theme,n=e?.components?.[r]?.variants;return n?ci(t,n):null})),d||l.push(er),Array.isArray(s[0])){const t=s.shift(),r=new Array(e.length).fill(""),n=new Array(l.length).fill("");let i;i=[...r,...t,...n],i.raw=[...r,...t.raw,...n],e.unshift(i)}const u=[...e,...s,...l],p=f(...u);return t.muiName&&(p.muiName=t.muiName),p};return f.withConfig&&(g.withConfig=f.withConfig),g}}({themeId:Gt,defaultTheme:di,rootShouldForwardProp:fi}),gi=mi;function yi(t){return Vt(t)}const vi=en();const xi=function(){return Rt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:vi)};function bi(){const t=xi(di);return t[Gt]||t}const _i={theme:void 0};const wi=function(t){let e,r;return function(n){let i=e;return void 0!==i&&n.theme===r||(_i.theme=n.theme,i=ii(t(_i)),e=i,r=n.theme),i}},ki=t=>t,Ti=(()=>{let t=ki;return{configure(e){t=e},generate:e=>t(e),reset(){t=ki}}})(),Si={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ai(t,e){const r=Si[e];return r?`${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui"}-${r}`:`${Ti.generate(t)}-${e}`}function Mi(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const n={};return e.forEach((e=>{n[e]=Ai(t,e,r)})),n}function Ci(t){return Ai("MuiPaper",t)}Mi("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Ei=gi("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],!r.square&&e.rounded,"elevation"===r.variant&&e[`elevation${r.elevation}`]]}})(wi((t=>{let{theme:e}=t;return{backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:t=>{let{ownerState:e}=t;return!e.square},style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}}))),Li=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiPaper"}),n=bi(),{className:i,component:a="div",elevation:o=1,square:l=!1,variant:c="elevation",...u}=r,h={...r,component:a,elevation:o,square:l,variant:c},d=(t=>{const{square:e,elevation:r,variant:n,classes:i}=t;return Wn({root:["root",n,!e&&"rounded","elevation"===n&&`elevation${r}`]},Ci,i)})(h);return(0,s.jsx)(Ei,{as:a,ownerState:h,className:Hn(d.root,i),ref:e,...u,style:{..."elevation"===c&&{"--Paper-shadow":(n.vars||n).shadows[o],...n.vars&&{"--Paper-overlay":n.vars.overlays?.[o]},...!n.vars&&"dark"===n.palette.mode&&{"--Paper-overlay":`linear-gradient(${Tr("#fff",yn(o))}, ${Tr("#fff",yn(o))})`}},...u.style}})}));function Pi(t){return Ai("MuiCard",t)}Mi("MuiCard",["root"]);const Ii=gi(Li,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),zi=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiCard"}),{className:n,raised:i=!1,...a}=r,o={...r,raised:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},Pi,e)})(o);return(0,s.jsx)(Ii,{className:Hn(l.root,n),elevation:i?8:void 0,ref:e,ownerState:o,...a})})),Oi=Xt;function Di(t){return Ai("MuiSvgIcon",t)}Mi("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Ri=gi("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,"inherit"!==r.color&&e[`color${Oi(r.color)}`],e[`fontSize${Oi(r.fontSize)}`]]}})(wi((t=>{let{theme:e}=t;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter((t=>{let[,e]=t;return e&&e.main})).map((t=>{let[r]=t;return{props:{color:r},style:{color:(e.vars??e).palette?.[r]?.main}}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}}))),Fi=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:h=!1,titleAccess:d,viewBox:p="0 0 24 24",...f}=n,m=t.isValidElement(i)&&"svg"===i.type,g={...n,color:o,component:l,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:h,viewBox:p,hasSvgAsChild:m},y={};h||(y.viewBox=p);const v=(t=>{const{color:e,fontSize:r,classes:n}=t;return Wn({root:["root","inherit"!==e&&`color${Oi(e)}`,`fontSize${Oi(r)}`]},Di,n)})(g);return(0,s.jsxs)(Ri,{as:l,className:Hn(v.root,a),focusable:"false",color:u,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r,...y,...f,...m&&i.props,ownerState:g,children:[m?i.props.children:i,d?(0,s.jsx)("title",{children:d}):null]})}));Fi.muiName="SvgIcon";const Bi=Fi;function ji(e,r){function n(t,r){return(0,s.jsx)(Bi,{"data-testid":void 0,ref:r,...t,children:e})}return n.muiName=Bi.muiName,t.memo(t.forwardRef(n))}const Ni=ji((0,s.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function Ui(t){return Ai("MuiAvatar",t)}Mi("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);function Vi(t,e){"function"===typeof t?t(e):t&&(t.current=e)}function qi(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.useMemo((()=>r.every((t=>null==t))?null:t=>{r.forEach((e=>{Vi(e,t)}))}),r)}const $i=function(t){return"string"===typeof t};const Hi=function(t,e,r){return void 0===t||$i(t)?e:{...e,ownerState:{...e.ownerState,...r}}};const Wi=function(t,e,r){return"function"===typeof t?t(e,r):t};const Gi=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===t)return{};const r={};return Object.keys(t).filter((r=>r.match(/^on[A-Z]/)&&"function"===typeof t[r]&&!e.includes(r))).forEach((e=>{r[e]=t[e]})),r};const Yi=function(t){if(void 0===t)return{};const e={};return Object.keys(t).filter((e=>!(e.match(/^on[A-Z]/)&&"function"===typeof t[e]))).forEach((r=>{e[r]=t[r]})),e};const Zi=function(t){const{getSlotProps:e,additionalProps:r,externalSlotProps:n,externalForwardedProps:i,className:a}=t;if(!e){const t=Hn(r?.className,a,i?.className,n?.className),e={...r?.style,...i?.style,...n?.style},o={...r,...i,...n};return t.length>0&&(o.className=t),Object.keys(e).length>0&&(o.style=e),{props:o,internalRef:void 0}}const o=Gi({...i,...n}),s=Yi(n),l=Yi(i),c=e(o),u=Hn(c?.className,r?.className,a,i?.className,n?.className),h={...c?.style,...r?.style,...i?.style,...n?.style},d={...c,...r,...l,...s};return u.length>0&&(d.className=u),Object.keys(h).length>0&&(d.style=h),{props:d,internalRef:c.ref}};function Xi(t,e){const{className:r,elementType:n,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...l}=e,{component:c,slots:u={[t]:void 0},slotProps:h={[t]:void 0},...d}=a,p=u[t]||n,f=Wi(h[t],i),{props:{component:m,...g},internalRef:y}=Zi({className:r,...l,externalForwardedProps:"root"===t?d:void 0,externalSlotProps:f}),v=qi(y,f?.ref,e.ref),x="root"===t?m||c:m;return[p,Hi(p,{..."root"===t&&!c&&!u[t]&&o,..."root"!==t&&!u[t]&&o,...g,...x&&!s&&{as:x},...x&&s&&{component:x},ref:v},i)]}const Ki=gi("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],r.colorDefault&&e.colorDefault]}})(wi((t=>{let{theme:e}=t;return{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}}))),Ji=gi("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Qi=gi(Ni,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});const ta=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiAvatar"}),{alt:i,children:a,className:o,component:l="div",slots:c={},slotProps:u={},imgProps:h,sizes:d,src:p,srcSet:f,variant:m="circular",...g}=n;let y=null;const v={...n,component:l,variant:m},x=function(e){let{crossOrigin:r,referrerPolicy:n,src:i,srcSet:a}=e;const[o,s]=t.useState(!1);return t.useEffect((()=>{if(!i&&!a)return;s(!1);let t=!0;const e=new Image;return e.onload=()=>{t&&s("loaded")},e.onerror=()=>{t&&s("error")},e.crossOrigin=r,e.referrerPolicy=n,e.src=i,a&&(e.srcset=a),()=>{t=!1}}),[r,n,i,a]),o}({...h,..."function"===typeof u.img?u.img(v):u.img,src:p,srcSet:f}),b=p||f,_=b&&"error"!==x;v.colorDefault=!_,delete v.ownerState;const w=(t=>{const{classes:e,variant:r,colorDefault:n}=t;return Wn({root:["root",r,n&&"colorDefault"],img:["img"],fallback:["fallback"]},Ui,e)})(v),[k,T]=Xi("img",{className:w.img,elementType:Ji,externalForwardedProps:{slots:c,slotProps:{img:{...h,...u.img}}},additionalProps:{alt:i,src:p,srcSet:f,sizes:d},ownerState:v});return y=_?(0,s.jsx)(k,{...T}):a||0===a?a:b&&i?i[0]:(0,s.jsx)(Qi,{ownerState:v,className:w.fallback}),(0,s.jsx)(Ki,{as:l,className:Hn(w.root,o),ref:r,...g,ownerState:v,children:y})})),ea=ta;const ra=function(t){const{elementType:e,externalSlotProps:r,ownerState:n,skipResolvingSlotProps:i=!1,...a}=t,o=i?{}:Wi(r,n),{props:s,internalRef:l}=Zi({...a,externalSlotProps:o}),c=qi(l,o?.ref,t.additionalProps?.ref);return Hi(e,{...s,ref:c},n)};function na(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];clearTimeout(e),e=setTimeout((()=>{t.apply(this,i)}),r)}return n.clear=()=>{clearTimeout(e)},n}const ia=na;function aa(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}const oa=sr;function sa(t){return t&&t.ownerDocument||document}function la(t){return sa(t).defaultView||window}const ca=la,ua={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const ha=ji((0,s.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),da=ji((0,s.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function pa(t){try{return t.matches(":focus-visible")}catch(e){0}return!1}const fa=qi;const ma=function(e){const r=t.useRef(e);return sr((()=>{r.current=e})),t.useRef((function(){return(0,r.current)(...arguments)})).current},ga=ma,ya={};function va(e,r){const n=t.useRef(ya);return n.current===ya&&(n.current=e(r)),n}class xa{static create(){return new xa}static use(){const e=va(xa.create).current,[r,n]=t.useState(!1);return e.shouldMount=r,e.setShouldMount=n,t.useEffect(e.mountEffect,[r]),e}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let t,e;const r=new Promise(((r,n)=>{t=r,e=n}));return r.resolve=t,r.reject=e,r}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.mount().then((()=>this.ref.current?.start(...e)))}stop(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.mount().then((()=>this.ref.current?.stop(...e)))}pulsate(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.mount().then((()=>this.ref.current?.pulsate(...e)))}}function ba(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}function _a(t,e){return _a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_a(t,e)}function wa(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_a(t,e)}const ka=t.createContext(null);function Ta(e,r){var n=Object.create(null);return e&&t.Children.map(e,(function(t){return t})).forEach((function(e){n[e.key]=function(e){return r&&(0,t.isValidElement)(e)?r(e):e}(e)})),n}function Sa(t,e,r){return null!=r[e]?r[e]:t.props[e]}function Aa(e,r,n){var i=Ta(e.children),a=function(t,e){function r(r){return r in e?e[r]:t[r]}t=t||{},e=e||{};var n,i=Object.create(null),a=[];for(var o in t)o in e?a.length&&(i[o]=a,a=[]):a.push(o);var s={};for(var l in e){if(i[l])for(n=0;n<i[l].length;n++){var c=i[l][n];s[i[l][n]]=r(c)}s[l]=r(l)}for(n=0;n<a.length;n++)s[a[n]]=r(a[n]);return s}(r,i);return Object.keys(a).forEach((function(o){var s=a[o];if((0,t.isValidElement)(s)){var l=o in r,c=o in i,u=r[o],h=(0,t.isValidElement)(u)&&!u.props.in;!c||l&&!h?c||!l||h?c&&l&&(0,t.isValidElement)(u)&&(a[o]=(0,t.cloneElement)(s,{onExited:n.bind(null,s),in:u.props.in,exit:Sa(s,"exit",e),enter:Sa(s,"enter",e)})):a[o]=(0,t.cloneElement)(s,{in:!1}):a[o]=(0,t.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:Sa(s,"exit",e),enter:Sa(s,"enter",e)})}})),a}var Ma=Object.values||function(t){return Object.keys(t).map((function(e){return t[e]}))},Ca=function(e){function r(t,r){var n,i=(n=e.call(this,t,r)||this).handleExited.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n));return n.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},n}wa(r,e);var n=r.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},r.getDerivedStateFromProps=function(e,r){var n,i,a=r.children,o=r.handleExited;return{children:r.firstRender?(n=e,i=o,Ta(n.children,(function(e){return(0,t.cloneElement)(e,{onExited:i.bind(null,e),in:!0,appear:Sa(e,"appear",n),enter:Sa(e,"enter",n),exit:Sa(e,"exit",n)})}))):Aa(e,a,o),firstRender:!1}},n.handleExited=function(t,e){var r=Ta(this.props.children);t.key in r||(t.props.onExited&&t.props.onExited(e),this.mounted&&this.setState((function(e){var r=Gn({},e.children);return delete r[t.key],{children:r}})))},n.render=function(){var e=this.props,r=e.component,n=e.childFactory,i=ba(e,["component","childFactory"]),a=this.state.contextValue,o=Ma(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===r?t.createElement(ka.Provider,{value:a},o):t.createElement(ka.Provider,{value:a},t.createElement(r,i,o))},r}(t.Component);Ca.propTypes={},Ca.defaultProps={component:"div",childFactory:function(t){return t}};const Ea=Ca,La=[];class Pa{static create(){return new Pa}currentId=null;start(t,e){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,e()}),t)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Ia(){const e=va(Pa.create).current;var r;return r=e.disposeEffect,t.useEffect(r,La),e}const za=function(e){const{className:r,classes:n,pulsate:i=!1,rippleX:a,rippleY:o,rippleSize:l,in:c,onExited:u,timeout:h}=e,[d,p]=t.useState(!1),f=Hn(r,n.ripple,n.rippleVisible,i&&n.ripplePulsate),m={width:l,height:l,top:-l/2+o,left:-l/2+a},g=Hn(n.child,d&&n.childLeaving,i&&n.childPulsate);return c||d||p(!0),t.useEffect((()=>{if(!c&&null!=u){const t=setTimeout(u,h);return()=>{clearTimeout(t)}}}),[u,c,h]),(0,s.jsx)("span",{className:f,style:m,children:(0,s.jsx)("span",{className:g})})};const Oa=Mi("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Da=ar`
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`,Ra=ar`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`,Fa=ar`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`,Ba=gi("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),ja=gi(za,{name:"MuiTouchRipple",slot:"Ripple"})`
opacity: 0;
position: absolute;
&.${Oa.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${Da};
animation-duration: ${550}ms;
animation-timing-function: ${t=>{let{theme:e}=t;return e.transitions.easing.easeInOut}};
}
&.${Oa.ripplePulsate} {
animation-duration: ${t=>{let{theme:e}=t;return e.transitions.duration.shorter}}ms;
}
& .${Oa.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${Oa.childLeaving} {
opacity: 0;
animation-name: ${Ra};
animation-duration: ${550}ms;
animation-timing-function: ${t=>{let{theme:e}=t;return e.transitions.easing.easeInOut}};
}
& .${Oa.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${Fa};
animation-duration: 2500ms;
animation-timing-function: ${t=>{let{theme:e}=t;return e.transitions.easing.easeInOut}};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`,Na=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:a={},className:o,...l}=n,[c,u]=t.useState([]),h=t.useRef(0),d=t.useRef(null);t.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[c]);const p=t.useRef(!1),f=Ia(),m=t.useRef(null),g=t.useRef(null),y=t.useCallback((t=>{const{pulsate:e,rippleX:r,rippleY:n,rippleSize:i,cb:o}=t;u((t=>[...t,(0,s.jsx)(ja,{classes:{ripple:Hn(a.ripple,Oa.ripple),rippleVisible:Hn(a.rippleVisible,Oa.rippleVisible),ripplePulsate:Hn(a.ripplePulsate,Oa.ripplePulsate),child:Hn(a.child,Oa.child),childLeaving:Hn(a.childLeaving,Oa.childLeaving),childPulsate:Hn(a.childPulsate,Oa.childPulsate)},timeout:550,pulsate:e,rippleX:r,rippleY:n,rippleSize:i},h.current)])),h.current+=1,d.current=o}),[a]),v=t.useCallback((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:n=!1,center:a=i||e.pulsate,fakeElement:o=!1}=e;if("mousedown"===t?.type&&p.current)return void(p.current=!1);"touchstart"===t?.type&&(p.current=!0);const s=o?null:g.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,h;if(a||void 0===t||0===t.clientX&&0===t.clientY||!t.clientX&&!t.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:e,clientY:r}=t.touches&&t.touches.length>0?t.touches[0]:t;c=Math.round(e-l.left),u=Math.round(r-l.top)}if(a)h=Math.sqrt((2*l.width**2+l.height**2)/3),h%2===0&&(h+=1);else{const t=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,e=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;h=Math.sqrt(t**2+e**2)}t?.touches?null===m.current&&(m.current=()=>{y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})},f.start(80,(()=>{m.current&&(m.current(),m.current=null)}))):y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})}),[i,y,f]),x=t.useCallback((()=>{v({},{pulsate:!0})}),[v]),b=t.useCallback(((t,e)=>{if(f.clear(),"touchend"===t?.type&&m.current)return m.current(),m.current=null,void f.start(0,(()=>{b(t,e)}));m.current=null,u((t=>t.length>0?t.slice(1):t)),d.current=e}),[f]);return t.useImperativeHandle(r,(()=>({pulsate:x,start:v,stop:b})),[x,v,b]),(0,s.jsx)(Ba,{className:Hn(Oa.root,a.root,o),ref:g,...l,children:(0,s.jsx)(Ea,{component:null,exit:!0,children:c})})})),Ua=Na;function Va(t){return Ai("MuiButtonBase",t)}const qa=Mi("MuiButtonBase",["root","disabled","focusVisible"]),$a=gi("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${qa.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}});function Ha(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return ga((i=>(r&&r(i),n||t[e](i),!0)))}const Wa=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:a=!1,children:o,className:l,component:c="button",disabled:u=!1,disableRipple:h=!1,disableTouchRipple:d=!1,focusRipple:p=!1,focusVisibleClassName:f,LinkComponent:m="a",onBlur:g,onClick:y,onContextMenu:v,onDragLeave:x,onFocus:b,onFocusVisible:_,onKeyDown:w,onKeyUp:k,onMouseDown:T,onMouseLeave:S,onMouseUp:A,onTouchEnd:M,onTouchMove:C,onTouchStart:E,tabIndex:L=0,TouchRippleProps:P,touchRippleRef:I,type:z,...O}=n,D=t.useRef(null),R=xa.use(),F=fa(R.ref,I),[B,j]=t.useState(!1);u&&B&&j(!1),t.useImperativeHandle(i,(()=>({focusVisible:()=>{j(!0),D.current.focus()}})),[]);const N=R.shouldMount&&!h&&!u;t.useEffect((()=>{B&&p&&!h&&R.pulsate()}),[h,p,B,R]);const U=Ha(R,"start",T,d),V=Ha(R,"stop",v,d),q=Ha(R,"stop",x,d),$=Ha(R,"stop",A,d),H=Ha(R,"stop",(t=>{B&&t.preventDefault(),S&&S(t)}),d),W=Ha(R,"start",E,d),G=Ha(R,"stop",M,d),Y=Ha(R,"stop",C,d),Z=Ha(R,"stop",(t=>{pa(t.target)||j(!1),g&&g(t)}),!1),X=ga((t=>{D.current||(D.current=t.currentTarget),pa(t.target)&&(j(!0),_&&_(t)),b&&b(t)})),K=()=>{const t=D.current;return c&&"button"!==c&&!("A"===t.tagName&&t.href)},J=ga((t=>{p&&!t.repeat&&B&&" "===t.key&&R.stop(t,(()=>{R.start(t)})),t.target===t.currentTarget&&K()&&" "===t.key&&t.preventDefault(),w&&w(t),t.target===t.currentTarget&&K()&&"Enter"===t.key&&!u&&(t.preventDefault(),y&&y(t))})),Q=ga((t=>{p&&" "===t.key&&B&&!t.defaultPrevented&&R.stop(t,(()=>{R.pulsate(t)})),k&&k(t),y&&t.target===t.currentTarget&&K()&&" "===t.key&&!t.defaultPrevented&&y(t)}));let tt=c;"button"===tt&&(O.href||O.to)&&(tt=m);const et={};"button"===tt?(et.type=void 0===z?"button":z,et.disabled=u):(O.href||O.to||(et.role="button"),u&&(et["aria-disabled"]=u));const rt=fa(r,D),nt={...n,centerRipple:a,component:c,disabled:u,disableRipple:h,disableTouchRipple:d,focusRipple:p,tabIndex:L,focusVisible:B},it=(t=>{const{disabled:e,focusVisible:r,focusVisibleClassName:n,classes:i}=t,a=Wn({root:["root",e&&"disabled",r&&"focusVisible"]},Va,i);return r&&n&&(a.root+=` ${n}`),a})(nt);return(0,s.jsxs)($a,{as:tt,className:Hn(it.root,l),ownerState:nt,onBlur:Z,onClick:y,onContextMenu:V,onFocus:X,onKeyDown:J,onKeyUp:Q,onMouseDown:U,onMouseLeave:H,onMouseUp:$,onDragLeave:q,onTouchEnd:G,onTouchMove:Y,onTouchStart:W,ref:rt,tabIndex:u?-1:L,type:z,...et,...O,children:[o,N?(0,s.jsx)(Ua,{ref:F,center:a,...P}):null]})}));function Ga(t){return Ai("MuiTabScrollButton",t)}const Ya=Mi("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Za=gi(Wa,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Ya.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Xa=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTabScrollButton"}),{className:n,slots:i={},slotProps:a={},direction:o,orientation:l,disabled:c,...u}=r,h=Bt(),d={isRtl:h,...r},p=(t=>{const{classes:e,orientation:r,disabled:n}=t;return Wn({root:["root",r,n&&"disabled"]},Ga,e)})(d),f=i.StartScrollButtonIcon??ha,m=i.EndScrollButtonIcon??da,g=ra({elementType:f,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),y=ra({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return(0,s.jsx)(Za,{component:"div",className:Hn(p.root,n),ref:e,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,..."vertical"===l&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:"left"===o?(0,s.jsx)(f,{...g}):(0,s.jsx)(m,{...y})})}));function Ka(t){return Ai("MuiTabs",t)}const Ja=Mi("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Qa=sa,to=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,eo=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ro=(t,e,r)=>{let n=!1,i=r(t,e);for(;i;){if(i===t.firstChild){if(n)return;n=!0}const e=i.disabled||"true"===i.getAttribute("aria-disabled");if(i.hasAttribute("tabindex")&&!e)return void i.focus();i=r(t,i)}},no=gi("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Ja.scrollButtons}`]:e.scrollButtons},{[`& .${Ja.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(wi((t=>{let{theme:e}=t;return{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:t=>{let{ownerState:e}=t;return e.vertical},style:{flexDirection:"column"}},{props:t=>{let{ownerState:e}=t;return e.scrollButtonsHideMobile},style:{[`& .${Ja.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}}))),io=gi("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:t=>{let{ownerState:e}=t;return e.fixed},style:{overflowX:"hidden",width:"100%"}},{props:t=>{let{ownerState:e}=t;return e.hideScrollbar},style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:t=>{let{ownerState:e}=t;return e.scrollableX},style:{overflowX:"auto",overflowY:"hidden"}},{props:t=>{let{ownerState:e}=t;return e.scrollableY},style:{overflowY:"auto",overflowX:"hidden"}}]}),ao=gi("div",{name:"MuiTabs",slot:"List",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.list,e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})({display:"flex",variants:[{props:t=>{let{ownerState:e}=t;return e.vertical},style:{flexDirection:"column"}},{props:t=>{let{ownerState:e}=t;return e.centered},style:{justifyContent:"center"}}]}),oo=gi("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(wi((t=>{let{theme:e}=t;return{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:t=>{let{ownerState:e}=t;return e.vertical},style:{height:"100%",width:2,right:0}}]}}))),so=gi((function(e){const{onChange:r,...n}=e,i=t.useRef(),a=t.useRef(null),o=()=>{i.current=a.current.offsetHeight-a.current.clientHeight};return oa((()=>{const t=ia((()=>{const t=i.current;o(),t!==i.current&&r(i.current)})),e=ca(a.current);return e.addEventListener("resize",t),()=>{t.clear(),e.removeEventListener("resize",t)}}),[r]),t.useEffect((()=>{o(),r(i.current)}),[r]),(0,s.jsx)("div",{style:ua,...n,ref:a})}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),lo={};const co=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTabs"}),i=bi(),a=Bt(),{"aria-label":o,"aria-labelledby":l,action:c,centered:u=!1,children:h,className:d,component:p="div",allowScrollButtonsMobile:f=!1,indicatorColor:m="primary",onChange:g,orientation:y="horizontal",ScrollButtonComponent:v,scrollButtons:x="auto",selectionFollowsFocus:b,slots:_={},slotProps:w={},TabIndicatorProps:k={},TabScrollButtonProps:T={},textColor:S="primary",value:A,variant:M="standard",visibleScrollbar:C=!1,...E}=n,L="scrollable"===M,P="vertical"===y,I=P?"scrollTop":"scrollLeft",z=P?"top":"left",O=P?"bottom":"right",D=P?"clientHeight":"clientWidth",R=P?"height":"width",F={...n,component:p,allowScrollButtonsMobile:f,indicatorColor:m,orientation:y,vertical:P,scrollButtons:x,textColor:S,variant:M,visibleScrollbar:C,fixed:!L,hideScrollbar:L&&!C,scrollableX:L&&!P,scrollableY:L&&P,centered:u&&!L,scrollButtonsHideMobile:!f},B=(t=>{const{vertical:e,fixed:r,hideScrollbar:n,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:l}=t;return Wn({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",i&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",e&&"flexContainerVertical",e&&"vertical",o&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},Ka,l)})(F),j=ra({elementType:_.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:F}),N=ra({elementType:_.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:F});const[U,V]=t.useState(!1),[q,$]=t.useState(lo),[H,W]=t.useState(!1),[G,Y]=t.useState(!1),[Z,X]=t.useState(!1),[K,J]=t.useState({overflow:"hidden",scrollbarWidth:0}),Q=new Map,tt=t.useRef(null),et=t.useRef(null),rt={slots:_,slotProps:{indicator:k,scrollButton:T,...w}},nt=()=>{const t=tt.current;let e,r;if(t){const r=t.getBoundingClientRect();e={clientWidth:t.clientWidth,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,scrollWidth:t.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(t&&!1!==A){const t=et.current.children;if(t.length>0){const e=t[Q.get(A)];0,r=e?e.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:r}},it=ga((()=>{const{tabsMeta:t,tabMeta:e}=nt();let r,n=0;P?(r="top",e&&t&&(n=e.top-t.top+t.scrollTop)):(r=a?"right":"left",e&&t&&(n=(a?-1:1)*(e[r]-t[r]+t.scrollLeft)));const i={[r]:n,[R]:e?e[R]:0};if("number"!==typeof q[r]||"number"!==typeof q[R])$(i);else{const t=Math.abs(q[r]-i[r]),e=Math.abs(q[R]-i[R]);(t>=1||e>=1)&&$(i)}})),at=function(t){let{animation:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e?function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{};const{ease:a=aa,duration:o=300}=n;let s=null;const l=e[t];let c=!1;const u=()=>{c=!0},h=n=>{if(c)return void i(new Error("Animation cancelled"));null===s&&(s=n);const u=Math.min(1,(n-s)/o);e[t]=a(u)*(r-l)+l,u>=1?requestAnimationFrame((()=>{i(null)})):requestAnimationFrame(h)};l===r?i(new Error("Element already at target position")):requestAnimationFrame(h)}(I,tt.current,t,{duration:i.transitions.duration.standard}):tt.current[I]=t},ot=t=>{let e=tt.current[I];e+=P?t:t*(a?-1:1),at(e)},st=()=>{const t=tt.current[D];let e=0;const r=Array.from(et.current.children);for(let n=0;n<r.length;n+=1){const i=r[n];if(e+i[D]>t){0===n&&(e=t);break}e+=i[D]}return e},lt=()=>{ot(-1*st())},ct=()=>{ot(st())},[ut,{onChange:ht,...dt}]=Xi("scrollbar",{className:Hn(B.scrollableX,B.hideScrollbar),elementType:so,shouldForwardComponentProp:!0,externalForwardedProps:rt,ownerState:F}),pt=t.useCallback((t=>{ht?.(t),J({overflow:null,scrollbarWidth:t})}),[ht]),[ft,mt]=Xi("scrollButtons",{className:Hn(B.scrollButtons,T.className),elementType:Xa,externalForwardedProps:rt,ownerState:F,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:_.startScrollButtonIcon||_.StartScrollButtonIcon,EndScrollButtonIcon:_.endScrollButtonIcon||_.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:j,endScrollButtonIcon:N}}}),gt=ga((t=>{const{tabsMeta:e,tabMeta:r}=nt();if(r&&e)if(r[z]<e[z]){const n=e[I]+(r[z]-e[z]);at(n,{animation:t})}else if(r[O]>e[O]){const n=e[I]+(r[O]-e[O]);at(n,{animation:t})}})),yt=ga((()=>{L&&!1!==x&&X(!Z)}));t.useEffect((()=>{const t=ia((()=>{tt.current&&it()}));let e;const r=r=>{r.forEach((t=>{t.removedNodes.forEach((t=>{e?.unobserve(t)})),t.addedNodes.forEach((t=>{e?.observe(t)}))})),t(),yt()},n=ca(tt.current);let i;return n.addEventListener("resize",t),"undefined"!==typeof ResizeObserver&&(e=new ResizeObserver(t),Array.from(et.current.children).forEach((t=>{e.observe(t)}))),"undefined"!==typeof MutationObserver&&(i=new MutationObserver(r),i.observe(et.current,{childList:!0})),()=>{t.clear(),n.removeEventListener("resize",t),i?.disconnect(),e?.disconnect()}}),[it,yt]),t.useEffect((()=>{const t=Array.from(et.current.children),e=t.length;if("undefined"!==typeof IntersectionObserver&&e>0&&L&&!1!==x){const r=t[0],n=t[e-1],i={root:tt.current,threshold:.99},a=new IntersectionObserver((t=>{W(!t[0].isIntersecting)}),i);a.observe(r);const o=new IntersectionObserver((t=>{Y(!t[0].isIntersecting)}),i);return o.observe(n),()=>{a.disconnect(),o.disconnect()}}}),[L,x,Z,h?.length]),t.useEffect((()=>{V(!0)}),[]),t.useEffect((()=>{it()})),t.useEffect((()=>{gt(lo!==q)}),[gt,q]),t.useImperativeHandle(c,(()=>({updateIndicator:it,updateScrollButtons:yt})),[it,yt]);const[vt,xt]=Xi("indicator",{className:Hn(B.indicator,k.className),elementType:oo,externalForwardedProps:rt,ownerState:F,additionalProps:{style:q}}),bt=(0,s.jsx)(vt,{...xt});let _t=0;const wt=t.Children.map(h,(e=>{if(!t.isValidElement(e))return null;const r=void 0===e.props.value?_t:e.props.value;Q.set(r,_t);const n=r===A;return _t+=1,t.cloneElement(e,{fullWidth:"fullWidth"===M,indicator:n&&!U&&bt,selected:n,selectionFollowsFocus:b,onChange:g,textColor:S,value:r,...1!==_t||!1!==A||e.props.tabIndex?{}:{tabIndex:0}})})),kt=(()=>{const t={};t.scrollbarSizeListener=L?(0,s.jsx)(ut,{...dt,onChange:pt}):null;const e=L&&("auto"===x&&(H||G)||!0===x);return t.scrollButtonStart=e?(0,s.jsx)(ft,{direction:a?"right":"left",onClick:lt,disabled:!H,...mt}):null,t.scrollButtonEnd=e?(0,s.jsx)(ft,{direction:a?"left":"right",onClick:ct,disabled:!G,...mt}):null,t})(),[Tt,St]=Xi("root",{ref:r,className:Hn(B.root,d),elementType:no,externalForwardedProps:{...rt,...E,component:p},ownerState:F}),[At,Mt]=Xi("scroller",{ref:tt,className:B.scroller,elementType:io,externalForwardedProps:rt,ownerState:F,additionalProps:{style:{overflow:K.overflow,[P?"margin"+(a?"Left":"Right"):"marginBottom"]:C?void 0:-K.scrollbarWidth}}}),[Ct,Et]=Xi("list",{ref:et,className:Hn(B.list,B.flexContainer),elementType:ao,externalForwardedProps:rt,ownerState:F,getSlotProps:t=>({...t,onKeyDown:e=>{(t=>{if(t.altKey||t.shiftKey||t.ctrlKey||t.metaKey)return;const e=et.current,r=Qa(e).activeElement;if("tab"!==r.getAttribute("role"))return;let n="horizontal"===y?"ArrowLeft":"ArrowUp",i="horizontal"===y?"ArrowRight":"ArrowDown";switch("horizontal"===y&&a&&(n="ArrowRight",i="ArrowLeft"),t.key){case n:t.preventDefault(),ro(e,r,eo);break;case i:t.preventDefault(),ro(e,r,to);break;case"Home":t.preventDefault(),ro(e,null,to);break;case"End":t.preventDefault(),ro(e,null,eo)}})(e),t.onKeyDown?.(e)}})});return(0,s.jsxs)(Tt,{...St,children:[kt.scrollButtonStart,kt.scrollbarSizeListener,(0,s.jsxs)(At,{...Mt,children:[(0,s.jsx)(Ct,{"aria-label":o,"aria-labelledby":l,"aria-orientation":"vertical"===y?"vertical":null,role:"tablist",...Et,children:wt}),U&&bt]}),kt.scrollButtonEnd]})})),uo=co;function ho(t){return Ai("MuiTab",t)}const po=Mi("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),fo=gi(Wa,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Oi(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${po.iconWrapper}`]:e.iconWrapper},{[`& .${po.icon}`]:e.icon}]}})(wi((t=>{let{theme:e}=t;return{...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:t=>{let{ownerState:e}=t;return e.label&&("top"===e.iconPosition||"bottom"===e.iconPosition)},style:{flexDirection:"column"}},{props:t=>{let{ownerState:e}=t;return e.label&&"top"!==e.iconPosition&&"bottom"!==e.iconPosition},style:{flexDirection:"row"}},{props:t=>{let{ownerState:e}=t;return e.icon&&e.label},style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:t=>{let{ownerState:e,iconPosition:r}=t;return e.icon&&e.label&&"top"===r},style:{[`& > .${po.icon}`]:{marginBottom:6}}},{props:t=>{let{ownerState:e,iconPosition:r}=t;return e.icon&&e.label&&"bottom"===r},style:{[`& > .${po.icon}`]:{marginTop:6}}},{props:t=>{let{ownerState:e,iconPosition:r}=t;return e.icon&&e.label&&"start"===r},style:{[`& > .${po.icon}`]:{marginRight:e.spacing(1)}}},{props:t=>{let{ownerState:e,iconPosition:r}=t;return e.icon&&e.label&&"end"===r},style:{[`& > .${po.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${po.selected}`]:{opacity:1},[`&.${po.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${po.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${po.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${po.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${po.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:t=>{let{ownerState:e}=t;return e.fullWidth},style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:t=>{let{ownerState:e}=t;return e.wrapped},style:{fontSize:e.typography.pxToRem(12)}}]}}))),mo=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTab"}),{className:i,disabled:a=!1,disableFocusRipple:o=!1,fullWidth:l,icon:c,iconPosition:u="top",indicator:h,label:d,onChange:p,onClick:f,onFocus:m,selected:g,selectionFollowsFocus:y,textColor:v="inherit",value:x,wrapped:b=!1,..._}=n,w={...n,disabled:a,disableFocusRipple:o,selected:g,icon:!!c,iconPosition:u,label:!!d,fullWidth:l,textColor:v,wrapped:b},k=(t=>{const{classes:e,textColor:r,fullWidth:n,wrapped:i,icon:a,label:o,selected:s,disabled:l}=t;return Wn({root:["root",a&&o&&"labelIcon",`textColor${Oi(r)}`,n&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]},ho,e)})(w),T=c&&d&&t.isValidElement(c)?t.cloneElement(c,{className:Hn(k.icon,c.props.className)}):c;return(0,s.jsxs)(fo,{focusRipple:!o,className:Hn(k.root,i),ref:r,role:"tab","aria-selected":g,disabled:a,onClick:t=>{!g&&p&&p(t,x),f&&f(t)},onFocus:t=>{y&&!g&&p&&p(t,x),m&&m(t)},ownerState:w,tabIndex:g?0:-1,..._,children:["top"===u||"start"===u?(0,s.jsxs)(t.Fragment,{children:[T,d]}):(0,s.jsxs)(t.Fragment,{children:[d,T]}),h]})}));function go(e){return parseInt(t.version,10)>=19?e?.props?.ref||null:e?.ref||null}var yo=r(7950);const vo=!1;var xo="unmounted",bo="exited",_o="entering",wo="entered",ko="exiting",To=function(e){function r(t,r){var n;n=e.call(this,t,r)||this;var i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=bo,n.appearStatus=_o):i=wo:i=t.unmountOnExit||t.mountOnEnter?xo:bo,n.state={status:i},n.nextCallback=null,n}wa(r,e),r.getDerivedStateFromProps=function(t,e){return t.in&&e.status===xo?{status:bo}:null};var n=r.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var r=this.state.status;this.props.in?r!==_o&&r!==wo&&(e=_o):r!==_o&&r!==wo||(e=ko)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,r,n=this.props.timeout;return t=e=r=n,null!=n&&"number"!==typeof n&&(t=n.exit,e=n.enter,r=void 0!==n.appear?n.appear:e),{exit:t,enter:e,appear:r}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===_o){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this);r&&function(t){t.scrollTop}(r)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===bo&&this.setState({status:xo})},n.performEnter=function(t){var e=this,r=this.props.enter,n=this.context?this.context.isMounting:t,i=this.props.nodeRef?[n]:[yo.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),l=n?s.appear:s.enter;!t&&!r||vo?this.safeSetState({status:wo},(function(){e.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:_o},(function(){e.props.onEntering(a,o),e.onTransitionEnd(l,(function(){e.safeSetState({status:wo},(function(){e.props.onEntered(a,o)}))}))})))},n.performExit=function(){var t=this,e=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:yo.findDOMNode(this);e&&!vo?(this.props.onExit(n),this.safeSetState({status:ko},(function(){t.props.onExiting(n),t.onTransitionEnd(r.exit,(function(){t.safeSetState({status:bo},(function(){t.props.onExited(n)}))}))}))):this.safeSetState({status:bo},(function(){t.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,e.nextCallback=null,t(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var r=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this),n=null==t&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===xo)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,ba(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t.createElement(ka.Provider,{value:null},"function"===typeof n?n(e,i):t.cloneElement(t.Children.only(n),i))},r}(t.Component);function So(){}To.contextType=ka,To.propTypes={},To.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:So,onEntering:So,onEntered:So,onExit:So,onExiting:So,onExited:So},To.UNMOUNTED=xo,To.EXITED=bo,To.ENTERING=_o,To.ENTERED=wo,To.EXITING=ko;const Ao=To,Mo=t=>t.scrollTop;function Co(t,e){const{timeout:r,easing:n,style:i={}}=t;return{duration:i.transitionDuration??("number"===typeof r?r:r[e.mode]||0),easing:i.transitionTimingFunction??("object"===typeof n?n[e.mode]:n),delay:i.transitionDelay}}function Eo(t){return`scale(${t}, ${t**2})`}const Lo={entering:{opacity:1,transform:Eo(1)},entered:{opacity:1,transform:"none"}},Po="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Io=t.forwardRef((function(e,r){const{addEndListener:n,appear:i=!0,children:a,easing:o,in:l,onEnter:c,onEntered:u,onEntering:h,onExit:d,onExited:p,onExiting:f,style:m,timeout:g="auto",TransitionComponent:y=Ao,...v}=e,x=Ia(),b=t.useRef(),_=bi(),w=t.useRef(null),k=fa(w,go(a),r),T=t=>e=>{if(t){const r=w.current;void 0===e?t(r):t(r,e)}},S=T(h),A=T(((t,e)=>{Mo(t);const{duration:r,delay:n,easing:i}=Co({style:m,timeout:g,easing:o},{mode:"enter"});let a;"auto"===g?(a=_.transitions.getAutoHeightDuration(t.clientHeight),b.current=a):a=r,t.style.transition=[_.transitions.create("opacity",{duration:a,delay:n}),_.transitions.create("transform",{duration:Po?a:.666*a,delay:n,easing:i})].join(","),c&&c(t,e)})),M=T(u),C=T(f),E=T((t=>{const{duration:e,delay:r,easing:n}=Co({style:m,timeout:g,easing:o},{mode:"exit"});let i;"auto"===g?(i=_.transitions.getAutoHeightDuration(t.clientHeight),b.current=i):i=e,t.style.transition=[_.transitions.create("opacity",{duration:i,delay:r}),_.transitions.create("transform",{duration:Po?i:.666*i,delay:Po?r:r||.333*i,easing:n})].join(","),t.style.opacity=0,t.style.transform=Eo(.75),d&&d(t)})),L=T(p);return(0,s.jsx)(y,{appear:i,in:l,nodeRef:w,onEnter:A,onEntered:M,onEntering:S,onExit:E,onExited:L,onExiting:C,addEndListener:t=>{"auto"===g&&x.start(b.current||0,t),n&&n(w.current,t)},timeout:"auto"===g?null:g,...v,children:(e,r)=>{let{ownerState:n,...i}=r;return t.cloneElement(a,{style:{opacity:0,transform:Eo(.75),visibility:"exited"!==e||l?void 0:"hidden",...Lo[e],...m,...a.props.style},ref:k,...i})}})}));Io&&(Io.muiSupportAuto=!0);const zo=Io;function Oo(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Do(t){return t instanceof Oo(t).Element||t instanceof Element}function Ro(t){return t instanceof Oo(t).HTMLElement||t instanceof HTMLElement}function Fo(t){return"undefined"!==typeof ShadowRoot&&(t instanceof Oo(t).ShadowRoot||t instanceof ShadowRoot)}var Bo=Math.max,jo=Math.min,No=Math.round;function Uo(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Vo(){return!/^((?!chrome|android).)*safari/i.test(Uo())}function qo(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Ro(t)&&(i=t.offsetWidth>0&&No(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&No(n.height)/t.offsetHeight||1);var o=(Do(t)?Oo(t):window).visualViewport,s=!Vo()&&r,l=(n.left+(s&&o?o.offsetLeft:0))/i,c=(n.top+(s&&o?o.offsetTop:0))/a,u=n.width/i,h=n.height/a;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function $o(t){var e=Oo(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ho(t){return t?(t.nodeName||"").toLowerCase():null}function Wo(t){return((Do(t)?t.ownerDocument:t.document)||window.document).documentElement}function Go(t){return qo(Wo(t)).left+$o(t).scrollLeft}function Yo(t){return Oo(t).getComputedStyle(t)}function Zo(t){var e=Yo(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Xo(t,e,r){void 0===r&&(r=!1);var n=Ro(e),i=Ro(e)&&function(t){var e=t.getBoundingClientRect(),r=No(e.width)/t.offsetWidth||1,n=No(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),a=Wo(e),o=qo(t,i,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&(("body"!==Ho(e)||Zo(a))&&(s=function(t){return t!==Oo(t)&&Ro(t)?{scrollLeft:(e=t).scrollLeft,scrollTop:e.scrollTop}:$o(t);var e}(e)),Ro(e)?((l=qo(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=Go(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function Ko(t){var e=qo(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Jo(t){return"html"===Ho(t)?t:t.assignedSlot||t.parentNode||(Fo(t)?t.host:null)||Wo(t)}function Qo(t){return["html","body","#document"].indexOf(Ho(t))>=0?t.ownerDocument.body:Ro(t)&&Zo(t)?t:Qo(Jo(t))}function ts(t,e){var r;void 0===e&&(e=[]);var n=Qo(t),i=n===(null==(r=t.ownerDocument)?void 0:r.body),a=Oo(n),o=i?[a].concat(a.visualViewport||[],Zo(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(ts(Jo(o)))}function es(t){return["table","td","th"].indexOf(Ho(t))>=0}function rs(t){return Ro(t)&&"fixed"!==Yo(t).position?t.offsetParent:null}function ns(t){for(var e=Oo(t),r=rs(t);r&&es(r)&&"static"===Yo(r).position;)r=rs(r);return r&&("html"===Ho(r)||"body"===Ho(r)&&"static"===Yo(r).position)?e:r||function(t){var e=/firefox/i.test(Uo());if(/Trident/i.test(Uo())&&Ro(t)&&"fixed"===Yo(t).position)return null;var r=Jo(t);for(Fo(r)&&(r=r.host);Ro(r)&&["html","body"].indexOf(Ho(r))<0;){var n=Yo(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}var is="top",as="bottom",os="right",ss="left",ls="auto",cs=[is,as,os,ss],us="start",hs="end",ds="viewport",ps="popper",fs=cs.reduce((function(t,e){return t.concat([e+"-"+us,e+"-"+hs])}),[]),ms=[].concat(cs,[ls]).reduce((function(t,e){return t.concat([e,e+"-"+us,e+"-"+hs])}),[]),gs=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ys(t){var e=new Map,r=new Set,n=[];function i(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!r.has(t)){var n=e.get(t);n&&i(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){r.has(t.name)||i(t)})),n}function vs(t){var e;return function(){return e||(e=new Promise((function(r){Promise.resolve().then((function(){e=void 0,r(t())}))}))),e}}var xs={placement:"bottom",modifiers:[],strategy:"absolute"};function bs(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some((function(t){return!(t&&"function"===typeof t.getBoundingClientRect)}))}function _s(t){void 0===t&&(t={});var e=t,r=e.defaultModifiers,n=void 0===r?[]:r,i=e.defaultOptions,a=void 0===i?xs:i;return function(t,e,r){void 0===r&&(r=a);var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},xs,a),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},o=[],s=!1,l={state:i,setOptions:function(r){var s="function"===typeof r?r(i.options):r;c(),i.options=Object.assign({},a,i.options,s),i.scrollParents={reference:Do(t)?ts(t):t.contextElement?ts(t.contextElement):[],popper:ts(e)};var u=function(t){var e=ys(t);return gs.reduce((function(t,r){return t.concat(e.filter((function(t){return t.phase===r})))}),[])}(function(t){var e=t.reduce((function(t,e){var r=t[e.name];return t[e.name]=r?Object.assign({},r,e,{options:Object.assign({},r.options,e.options),data:Object.assign({},r.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(n,i.options.modifiers)));return i.orderedModifiers=u.filter((function(t){return t.enabled})),i.orderedModifiers.forEach((function(t){var e=t.name,r=t.options,n=void 0===r?{}:r,a=t.effect;if("function"===typeof a){var s=a({state:i,name:e,instance:l,options:n}),c=function(){};o.push(s||c)}})),l.update()},forceUpdate:function(){if(!s){var t=i.elements,e=t.reference,r=t.popper;if(bs(e,r)){i.rects={reference:Xo(e,ns(r),"fixed"===i.options.strategy),popper:Ko(r)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach((function(t){return i.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<i.orderedModifiers.length;n++)if(!0!==i.reset){var a=i.orderedModifiers[n],o=a.fn,c=a.options,u=void 0===c?{}:c,h=a.name;"function"===typeof o&&(i=o({state:i,options:u,name:h,instance:l})||i)}else i.reset=!1,n=-1}}},update:vs((function(){return new Promise((function(t){l.forceUpdate(),t(i)}))})),destroy:function(){c(),s=!0}};if(!bs(t,e))return l;function c(){o.forEach((function(t){return t()})),o=[]}return l.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),l}}var ws={passive:!0};function ks(t){return t.split("-")[0]}function Ts(t){return t.split("-")[1]}function Ss(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function As(t){var e,r=t.reference,n=t.element,i=t.placement,a=i?ks(i):null,o=i?Ts(i):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case is:e={x:s,y:r.y-n.height};break;case as:e={x:s,y:r.y+r.height};break;case os:e={x:r.x+r.width,y:l};break;case ss:e={x:r.x-n.width,y:l};break;default:e={x:r.x,y:r.y}}var c=a?Ss(a):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case us:e[c]=e[c]-(r[u]/2-n[u]/2);break;case hs:e[c]=e[c]+(r[u]/2-n[u]/2)}}return e}var Ms={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Cs(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,h=t.isFixed,d=o.x,p=void 0===d?0:d,f=o.y,m=void 0===f?0:f,g="function"===typeof u?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),x=ss,b=is,_=window;if(c){var w=ns(r),k="clientHeight",T="clientWidth";if(w===Oo(r)&&"static"!==Yo(w=Wo(r)).position&&"absolute"===s&&(k="scrollHeight",T="scrollWidth"),i===is||(i===ss||i===os)&&a===hs)b=as,m-=(h&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,m*=l?1:-1;if(i===ss||(i===is||i===as)&&a===hs)x=os,p-=(h&&w===_&&_.visualViewport?_.visualViewport.width:w[T])-n.width,p*=l?1:-1}var S,A=Object.assign({position:s},c&&Ms),M=!0===u?function(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:No(r*i)/i||0,y:No(n*i)/i||0}}({x:p,y:m},Oo(r)):{x:p,y:m};return p=M.x,m=M.y,l?Object.assign({},A,((S={})[b]=v?"0":"",S[x]=y?"0":"",S.transform=(_.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",S)):Object.assign({},A,((e={})[b]=v?m+"px":"",e[x]=y?p+"px":"",e.transform="",e))}const Es={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},i=e.elements[t];Ro(i)&&Ho(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(t){var e=n[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],i=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce((function(t,e){return t[e]="",t}),{});Ro(n)&&Ho(n)&&(Object.assign(n.style,a),Object.keys(i).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};const Ls={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=void 0===i?[0,0]:i,o=ms.reduce((function(t,r){return t[r]=function(t,e,r){var n=ks(t),i=[ss,is].indexOf(n)>=0?-1:1,a="function"===typeof r?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ss,os].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}(r,e.rects,a),t}),{}),s=o[e.placement],l=s.x,c=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}};var Ps={left:"right",right:"left",bottom:"top",top:"bottom"};function Is(t){return t.replace(/left|right|bottom|top/g,(function(t){return Ps[t]}))}var zs={start:"end",end:"start"};function Os(t){return t.replace(/start|end/g,(function(t){return zs[t]}))}function Ds(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Fo(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Rs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Fs(t,e,r){return e===ds?Rs(function(t,e){var r=Oo(t),n=Wo(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=Vo();(c||!c&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+Go(t),y:l}}(t,r)):Do(e)?function(t,e){var r=qo(t,!1,"fixed"===e);return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}(e,r):Rs(function(t){var e,r=Wo(t),n=$o(t),i=null==(e=t.ownerDocument)?void 0:e.body,a=Bo(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Bo(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+Go(t),l=-n.scrollTop;return"rtl"===Yo(i||r).direction&&(s+=Bo(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(Wo(t)))}function Bs(t,e,r,n){var i="clippingParents"===e?function(t){var e=ts(Jo(t)),r=["absolute","fixed"].indexOf(Yo(t).position)>=0&&Ro(t)?ns(t):t;return Do(r)?e.filter((function(t){return Do(t)&&Ds(t,r)&&"body"!==Ho(t)})):[]}(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce((function(e,r){var i=Fs(t,r,n);return e.top=Bo(i.top,e.top),e.right=jo(i.right,e.right),e.bottom=jo(i.bottom,e.bottom),e.left=Bo(i.left,e.left),e}),Fs(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function js(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Ns(t,e){return e.reduce((function(e,r){return e[r]=t,e}),{})}function Us(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=void 0===n?t.placement:n,a=r.strategy,o=void 0===a?t.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?ds:c,h=r.elementContext,d=void 0===h?ps:h,p=r.altBoundary,f=void 0!==p&&p,m=r.padding,g=void 0===m?0:m,y=js("number"!==typeof g?g:Ns(g,cs)),v=d===ps?"reference":ps,x=t.rects.popper,b=t.elements[f?v:d],_=Bs(Do(b)?b:b.contextElement||Wo(t.elements.popper),l,u,o),w=qo(t.elements.reference),k=As({reference:w,element:x,strategy:"absolute",placement:i}),T=Rs(Object.assign({},x,k)),S=d===ps?T:w,A={top:_.top-S.top+y.top,bottom:S.bottom-_.bottom+y.bottom,left:_.left-S.left+y.left,right:S.right-_.right+y.right},M=t.modifiersData.offset;if(d===ps&&M){var C=M[i];Object.keys(A).forEach((function(t){var e=[os,as].indexOf(t)>=0?1:-1,r=[is,as].indexOf(t)>=0?"y":"x";A[t]+=C[r]*e}))}return A}const Vs={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0===o||o,l=r.fallbackPlacements,c=r.padding,u=r.boundary,h=r.rootBoundary,d=r.altBoundary,p=r.flipVariations,f=void 0===p||p,m=r.allowedAutoPlacements,g=e.options.placement,y=ks(g),v=l||(y===g||!f?[Is(g)]:function(t){if(ks(t)===ls)return[];var e=Is(t);return[Os(t),e,Os(e)]}(g)),x=[g].concat(v).reduce((function(t,r){return t.concat(ks(r)===ls?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?ms:l,u=Ts(n),h=u?s?fs:fs.filter((function(t){return Ts(t)===u})):cs,d=h.filter((function(t){return c.indexOf(t)>=0}));0===d.length&&(d=h);var p=d.reduce((function(e,r){return e[r]=Us(t,{placement:r,boundary:i,rootBoundary:a,padding:o})[ks(r)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:r,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):r)}),[]),b=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,T=x[0],S=0;S<x.length;S++){var A=x[S],M=ks(A),C=Ts(A)===us,E=[is,as].indexOf(M)>=0,L=E?"width":"height",P=Us(e,{placement:A,boundary:u,rootBoundary:h,altBoundary:d,padding:c}),I=E?C?os:ss:C?as:is;b[L]>_[L]&&(I=Is(I));var z=Is(I),O=[];if(a&&O.push(P[M]<=0),s&&O.push(P[I]<=0,P[z]<=0),O.every((function(t){return t}))){T=A,k=!1;break}w.set(A,O)}if(k)for(var D=function(t){var e=x.find((function(e){var r=w.get(e);if(r)return r.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},R=f?3:1;R>0;R--){if("break"===D(R))break}e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function qs(t,e,r){return Bo(t,jo(e,r))}const $s={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0!==o&&o,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,h=r.padding,d=r.tether,p=void 0===d||d,f=r.tetherOffset,m=void 0===f?0:f,g=Us(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),y=ks(e.placement),v=Ts(e.placement),x=!v,b=Ss(y),_="x"===b?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,T=e.rects.popper,S="function"===typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,A="number"===typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(w){if(a){var E,L="y"===b?is:ss,P="y"===b?as:os,I="y"===b?"height":"width",z=w[b],O=z+g[L],D=z-g[P],R=p?-T[I]/2:0,F=v===us?k[I]:T[I],B=v===us?-T[I]:-k[I],j=e.elements.arrow,N=p&&j?Ko(j):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=U[L],q=U[P],$=qs(0,k[I],N[I]),H=x?k[I]/2-R-$-V-A.mainAxis:F-$-V-A.mainAxis,W=x?-k[I]/2+R+$+q+A.mainAxis:B+$+q+A.mainAxis,G=e.elements.arrow&&ns(e.elements.arrow),Y=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,Z=null!=(E=null==M?void 0:M[b])?E:0,X=z+W-Z,K=qs(p?jo(O,z+H-Z-Y):O,z,p?Bo(D,X):D);w[b]=K,C[b]=K-z}if(s){var J,Q="x"===b?is:ss,tt="x"===b?as:os,et=w[_],rt="y"===_?"height":"width",nt=et+g[Q],it=et-g[tt],at=-1!==[is,ss].indexOf(y),ot=null!=(J=null==M?void 0:M[_])?J:0,st=at?nt:et-k[rt]-T[rt]-ot+A.altAxis,lt=at?et+k[rt]+T[rt]-ot-A.altAxis:it,ct=p&&at?function(t,e,r){var n=qs(t,e,r);return n>r?r:n}(st,et,lt):qs(p?st:nt,et,p?lt:it);w[_]=ct,C[_]=ct-et}e.modifiersData[n]=C}},requiresIfExists:["offset"]};const Hs={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=ks(r.placement),l=Ss(s),c=[ss,os].indexOf(s)>=0?"height":"width";if(a&&o){var u=function(t,e){return js("number"!==typeof(t="function"===typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Ns(t,cs))}(i.padding,r),h=Ko(a),d="y"===l?is:ss,p="y"===l?as:os,f=r.rects.reference[c]+r.rects.reference[l]-o[l]-r.rects.popper[c],m=o[l]-r.rects.reference[l],g=ns(a),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,x=u[d],b=y-h[c]-u[p],_=y/2-h[c]/2+v,w=qs(x,_,b),k=l;r.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!==typeof n||(n=e.elements.popper.querySelector(n)))&&Ds(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ws(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Gs(t){return[is,os,as,ss].some((function(e){return t[e]>=0}))}var Ys=_s({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=void 0===i||i,o=n.resize,s=void 0===o||o,l=Oo(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach((function(t){t.addEventListener("scroll",r.update,ws)})),s&&l.addEventListener("resize",r.update,ws),function(){a&&c.forEach((function(t){t.removeEventListener("scroll",r.update,ws)})),s&&l.removeEventListener("resize",r.update,ws)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=As({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=void 0===n||n,a=r.adaptive,o=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:ks(e.placement),variation:Ts(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Cs(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Cs(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Es,Ls,Vs,$s,Hs,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=Us(e,{elementContext:"reference"}),s=Us(e,{altBoundary:!0}),l=Ws(o,n),c=Ws(s,i,a),u=Gs(l),h=Gs(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}}]});const Zs=t.forwardRef((function(e,r){const{children:n,container:i,disablePortal:a=!1}=e,[o,s]=t.useState(null),l=qi(t.isValidElement(n)?go(n):null,r);if(sr((()=>{a||s(function(t){return"function"===typeof t?t():t}(i)||document.body)}),[i,a]),sr((()=>{if(o&&!a)return Vi(r,o),()=>{Vi(r,null)}}),[r,o,a]),a){if(t.isValidElement(n)){const e={ref:l};return t.cloneElement(n,e)}return n}return o?yo.createPortal(n,o):o}));function Xs(t){return Ai("MuiPopper",t)}Mi("MuiPopper",["root"]);function Ks(t){return"function"===typeof t?t():t}function Js(t){return void 0!==t.nodeType}const Qs={},tl=t.forwardRef((function(e,r){const{anchorEl:n,children:i,direction:a,disablePortal:o,modifiers:l,open:c,placement:u,popperOptions:h,popperRef:d,slotProps:p={},slots:f={},TransitionProps:m,ownerState:g,...y}=e,v=t.useRef(null),x=qi(v,r),b=t.useRef(null),_=qi(b,d),w=t.useRef(_);sr((()=>{w.current=_}),[_]),t.useImperativeHandle(d,(()=>b.current),[]);const k=function(t,e){if("ltr"===e)return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}(u,a),[T,S]=t.useState(k),[A,M]=t.useState(Ks(n));t.useEffect((()=>{b.current&&b.current.forceUpdate()})),t.useEffect((()=>{n&&M(Ks(n))}),[n]),sr((()=>{if(!A||!c)return;let t=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:t=>{let{state:e}=t;S(e.placement)}}];null!=l&&(t=t.concat(l)),h&&null!=h.modifiers&&(t=t.concat(h.modifiers));const e=Ys(A,v.current,{placement:k,...h,modifiers:t});return w.current(e),()=>{e.destroy(),w.current(null)}}),[A,o,l,c,h,k]);const C={placement:T};null!==m&&(C.TransitionProps=m);const E=(t=>{const{classes:e}=t;return Wn({root:["root"]},Xs,e)})(e),L=f.root??"div",P=ra({elementType:L,externalSlotProps:p.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:x},ownerState:e,className:E.root});return(0,s.jsx)(L,{...P,children:"function"===typeof i?i(C):i})})),el=t.forwardRef((function(e,r){const{anchorEl:n,children:i,container:a,direction:o="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:h,placement:d="bottom",popperOptions:p=Qs,popperRef:f,style:m,transition:g=!1,slotProps:y={},slots:v={},...x}=e,[b,_]=t.useState(!0);if(!c&&!h&&(!g||b))return null;let w;if(a)w=a;else if(n){const t=Ks(n);w=t&&Js(t)?sa(t).body:sa(null).body}const k=h||!c||g&&!b?void 0:"none",T=g?{in:h,onEnter:()=>{_(!1)},onExited:()=>{_(!0)}}:void 0;return(0,s.jsx)(Zs,{disablePortal:l,container:w,children:(0,s.jsx)(tl,{anchorEl:n,direction:o,disablePortal:l,modifiers:u,ref:r,open:g?!b:h,placement:d,popperOptions:p,popperRef:f,slotProps:y,slots:v,...x,style:{position:"fixed",top:0,left:0,display:k,...m},TransitionProps:T,children:i})})})),rl=gi(el,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),nl=t.forwardRef((function(t,e){const r=Bt(),n=yi({props:t,name:"MuiPopper"}),{anchorEl:i,component:a,components:o,componentsProps:l,container:c,disablePortal:u,keepMounted:h,modifiers:d,open:p,placement:f,popperOptions:m,popperRef:g,transition:y,slots:v,slotProps:x,...b}=n,_=v?.root??o?.Root,w={anchorEl:i,container:c,disablePortal:u,keepMounted:h,modifiers:d,open:p,placement:f,popperOptions:m,popperRef:g,transition:y,...b};return(0,s.jsx)(rl,{as:a,direction:r?"rtl":"ltr",slots:{root:_},slotProps:x??l,...w,ref:e})}));let il=0;const al={...e}.useId;function ol(e){if(void 0!==al){const t=al();return e??t}return function(e){const[r,n]=t.useState(e),i=e||r;return t.useEffect((()=>{null==r&&(il+=1,n(`mui-${il}`))}),[r]),i}(e)}const sl=ol;const ll=function(e){let{controlled:r,default:n,name:i,state:a="value"}=e;const{current:o}=t.useRef(void 0!==r),[s,l]=t.useState(n);return[o?r:s,t.useCallback((t=>{o||l(t)}),[])]};function cl(t){return Ai("MuiTooltip",t)}const ul=Mi("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);const hl=gi(nl,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.popper,!r.disableInteractive&&e.popperInteractive,r.arrow&&e.popperArrow,!r.open&&e.popperClose]}})(wi((t=>{let{theme:e}=t;return{zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:t=>{let{ownerState:e}=t;return!e.disableInteractive},style:{pointerEvents:"auto"}},{props:t=>{let{open:e}=t;return!e},style:{pointerEvents:"none"}},{props:t=>{let{ownerState:e}=t;return e.arrow},style:{[`&[data-popper-placement*="bottom"] .${ul.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${ul.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${ul.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${ul.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:t=>{let{ownerState:e}=t;return e.arrow&&!e.isRtl},style:{[`&[data-popper-placement*="right"] .${ul.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:t=>{let{ownerState:e}=t;return e.arrow&&!!e.isRtl},style:{[`&[data-popper-placement*="right"] .${ul.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:t=>{let{ownerState:e}=t;return e.arrow&&!e.isRtl},style:{[`&[data-popper-placement*="left"] .${ul.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:t=>{let{ownerState:e}=t;return e.arrow&&!!e.isRtl},style:{[`&[data-popper-placement*="left"] .${ul.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}}))),dl=gi("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.tooltip,r.touch&&e.touch,r.arrow&&e.tooltipArrow,e[`tooltipPlacement${Oi(r.placement.split("-")[0])}`]]}})(wi((t=>{let{theme:e}=t;return{backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Tr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${ul.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${ul.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${ul.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${ul.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:t=>{let{ownerState:e}=t;return e.arrow},style:{position:"relative",margin:0}},{props:t=>{let{ownerState:e}=t;return e.touch},style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:(r=16/14,Math.round(1e5*r)/1e5)+"em",fontWeight:e.typography.fontWeightRegular}},{props:t=>{let{ownerState:e}=t;return!e.isRtl},style:{[`.${ul.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${ul.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:t=>{let{ownerState:e}=t;return!e.isRtl&&e.touch},style:{[`.${ul.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${ul.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:t=>{let{ownerState:e}=t;return!!e.isRtl},style:{[`.${ul.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${ul.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:t=>{let{ownerState:e}=t;return!!e.isRtl&&e.touch},style:{[`.${ul.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${ul.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:t=>{let{ownerState:e}=t;return e.touch},style:{[`.${ul.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:t=>{let{ownerState:e}=t;return e.touch},style:{[`.${ul.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]};var r}))),pl=gi("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(wi((t=>{let{theme:e}=t;return{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Tr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}})));let fl=!1;const ml=new Pa;let gl={x:0,y:0};function yl(t,e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];e&&e(r,...i),t(r,...i)}}const vl=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:a,classes:o,components:l={},componentsProps:c={},describeChild:u=!1,disableFocusListener:h=!1,disableHoverListener:d=!1,disableInteractive:p=!1,disableTouchListener:f=!1,enterDelay:m=100,enterNextDelay:g=0,enterTouchDelay:y=700,followCursor:v=!1,id:x,leaveDelay:b=0,leaveTouchDelay:_=1500,onClose:w,onOpen:k,open:T,placement:S="bottom",PopperComponent:A,PopperProps:M={},slotProps:C={},slots:E={},title:L,TransitionComponent:P,TransitionProps:I,...z}=n,O=t.isValidElement(a)?a:(0,s.jsx)("span",{children:a}),D=bi(),R=Bt(),[F,B]=t.useState(),[j,N]=t.useState(null),U=t.useRef(!1),V=p||v,q=Ia(),$=Ia(),H=Ia(),W=Ia(),[G,Y]=ll({controlled:T,default:!1,name:"Tooltip",state:"open"});let Z=G;const X=sl(x),K=t.useRef(),J=ga((()=>{void 0!==K.current&&(document.body.style.WebkitUserSelect=K.current,K.current=void 0),W.clear()}));t.useEffect((()=>J),[J]);const Q=t=>{ml.clear(),fl=!0,Y(!0),k&&!Z&&k(t)},tt=ga((t=>{ml.start(800+b,(()=>{fl=!1})),Y(!1),w&&Z&&w(t),q.start(D.transitions.duration.shortest,(()=>{U.current=!1}))})),et=t=>{U.current&&"touchstart"!==t.type||(F&&F.removeAttribute("title"),$.clear(),H.clear(),m||fl&&g?$.start(fl?g:m,(()=>{Q(t)})):Q(t))},rt=t=>{$.clear(),H.start(b,(()=>{tt(t)}))},[,nt]=t.useState(!1),it=t=>{pa(t.target)||(nt(!1),rt(t))},at=t=>{F||B(t.currentTarget),pa(t.target)&&(nt(!0),et(t))},ot=t=>{U.current=!0;const e=O.props;e.onTouchStart&&e.onTouchStart(t)},st=t=>{ot(t),H.clear(),q.clear(),J(),K.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",W.start(y,(()=>{document.body.style.WebkitUserSelect=K.current,et(t)}))},lt=t=>{O.props.onTouchEnd&&O.props.onTouchEnd(t),J(),H.start(_,(()=>{tt(t)}))};t.useEffect((()=>{if(Z)return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)};function t(t){"Escape"===t.key&&tt(t)}}),[tt,Z]);const ct=fa(go(O),B,r);L||0===L||(Z=!1);const ut=t.useRef(),ht={},dt="string"===typeof L;u?(ht.title=Z||!dt||d?null:L,ht["aria-describedby"]=Z?X:null):(ht["aria-label"]=dt?L:null,ht["aria-labelledby"]=Z&&!dt?X:null);const pt={...ht,...z,...O.props,className:Hn(z.className,O.props.className),onTouchStart:ot,ref:ct,...v?{onMouseMove:t=>{const e=O.props;e.onMouseMove&&e.onMouseMove(t),gl={x:t.clientX,y:t.clientY},ut.current&&ut.current.update()}}:{}};const ft={};f||(pt.onTouchStart=st,pt.onTouchEnd=lt),d||(pt.onMouseOver=yl(et,pt.onMouseOver),pt.onMouseLeave=yl(rt,pt.onMouseLeave),V||(ft.onMouseOver=et,ft.onMouseLeave=rt)),h||(pt.onFocus=yl(at,pt.onFocus),pt.onBlur=yl(it,pt.onBlur),V||(ft.onFocus=at,ft.onBlur=it));const mt={...n,isRtl:R,arrow:i,disableInteractive:V,placement:S,PopperComponentProp:A,touch:U.current},gt="function"===typeof C.popper?C.popper(mt):C.popper,yt=t.useMemo((()=>{let t=[{name:"arrow",enabled:Boolean(j),options:{element:j,padding:4}}];return M.popperOptions?.modifiers&&(t=t.concat(M.popperOptions.modifiers)),gt?.popperOptions?.modifiers&&(t=t.concat(gt.popperOptions.modifiers)),{...M.popperOptions,...gt?.popperOptions,modifiers:t}}),[j,M.popperOptions,gt?.popperOptions]),vt=(t=>{const{classes:e,disableInteractive:r,arrow:n,touch:i,placement:a}=t;return Wn({popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",i&&"touch",`tooltipPlacement${Oi(a.split("-")[0])}`],arrow:["arrow"]},cl,e)})(mt),xt="function"===typeof C.transition?C.transition(mt):C.transition,bt={slots:{popper:l.Popper,transition:l.Transition??P,tooltip:l.Tooltip,arrow:l.Arrow,...E},slotProps:{arrow:C.arrow??c.arrow,popper:{...M,...gt??c.popper},tooltip:C.tooltip??c.tooltip,transition:{...I,...xt??c.transition}}},[_t,wt]=Xi("popper",{elementType:hl,externalForwardedProps:bt,ownerState:mt,className:Hn(vt.popper,M?.className)}),[kt,Tt]=Xi("transition",{elementType:zo,externalForwardedProps:bt,ownerState:mt}),[St,At]=Xi("tooltip",{elementType:dl,className:vt.tooltip,externalForwardedProps:bt,ownerState:mt}),[Mt,Ct]=Xi("arrow",{elementType:pl,className:vt.arrow,externalForwardedProps:bt,ownerState:mt,ref:N});return(0,s.jsxs)(t.Fragment,{children:[t.cloneElement(O,pt),(0,s.jsx)(_t,{as:A??nl,placement:S,anchorEl:v?{getBoundingClientRect:()=>({top:gl.y,left:gl.x,right:gl.x,bottom:gl.y,width:0,height:0})}:F,popperRef:ut,open:!!F&&Z,id:X,transition:!0,...ft,...wt,popperOptions:yt,children:t=>{let{TransitionProps:e}=t;return(0,s.jsx)(kt,{timeout:D.transitions.duration.shorter,...e,...Tt,children:(0,s.jsxs)(St,{...At,children:[L,i?(0,s.jsx)(Mt,{...Ct}):null]})})}})]})})),xl=vl;function bl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e=>{let[,r]=e;return r&&function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!function(t){return"string"===typeof t.main}(t))return!1;for(const r of e)if(!t.hasOwnProperty(r)||"string"!==typeof t[r])return!1;return!0}(r,t)}}function _l(t){return Ai("MuiAppBar",t)}Mi("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const wl=(t,e)=>t?`${t?.replace(")","")}, ${e})`:e,kl=gi(Li,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`position${Oi(r.position)}`],e[`color${Oi(r.color)}`]]}})(wi((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(bl(["contrastText"])).map((t=>{let[r]=t;return{props:{color:r},style:{"--AppBar-background":(e.vars??e).palette[r].main,"--AppBar-color":(e.vars??e).palette[r].contrastText}}})),{props:t=>!0===t.enableColorOnDark&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>!1===t.enableColorOnDark&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?wl(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?wl(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}}))),Tl=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiAppBar"}),{className:n,color:i="primary",enableColorOnDark:a=!1,position:o="fixed",...l}=r,c={...r,color:i,position:o,enableColorOnDark:a},u=(t=>{const{color:e,position:r,classes:n}=t;return Wn({root:["root",`color${Oi(e)}`,`position${Oi(r)}`]},_l,n)})(c);return(0,s.jsx)(kl,{square:!0,component:"header",ownerState:c,elevation:4,className:Hn(u.root,n,"fixed"===o&&"mui-fixed"),ref:e,...l})})),Sl=Tl,Al=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Ml(t){const e=[],r=[];return Array.from(t.querySelectorAll(Al)).forEach(((t,n)=>{const i=function(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?"true"===t.contentEditable||("AUDIO"===t.nodeName||"VIDEO"===t.nodeName||"DETAILS"===t.nodeName)&&null===t.getAttribute("tabindex")?0:t.tabIndex:e}(t);-1!==i&&function(t){return!(t.disabled||"INPUT"===t.tagName&&"hidden"===t.type||function(t){if("INPUT"!==t.tagName||"radio"!==t.type)return!1;if(!t.name)return!1;const e=e=>t.ownerDocument.querySelector(`input[type="radio"]${e}`);let r=e(`[name="${t.name}"]:checked`);return r||(r=e(`[name="${t.name}"]`)),r!==t}(t))}(t)&&(0===i?e.push(t):r.push({documentOrder:n,tabIndex:i,node:t}))})),r.sort(((t,e)=>t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex)).map((t=>t.node)).concat(e)}function Cl(){return!0}const El=function(e){const{children:r,disableAutoFocus:n=!1,disableEnforceFocus:i=!1,disableRestoreFocus:a=!1,getTabbable:o=Ml,isEnabled:l=Cl,open:c}=e,u=t.useRef(!1),h=t.useRef(null),d=t.useRef(null),p=t.useRef(null),f=t.useRef(null),m=t.useRef(!1),g=t.useRef(null),y=qi(go(r),g),v=t.useRef(null);t.useEffect((()=>{c&&g.current&&(m.current=!n)}),[n,c]),t.useEffect((()=>{if(!c||!g.current)return;const t=sa(g.current);return g.current.contains(t.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),m.current&&g.current.focus()),()=>{a||(p.current&&p.current.focus&&(u.current=!0,p.current.focus()),p.current=null)}}),[c]),t.useEffect((()=>{if(!c||!g.current)return;const t=sa(g.current),e=e=>{v.current=e,!i&&l()&&"Tab"===e.key&&t.activeElement===g.current&&e.shiftKey&&(u.current=!0,d.current&&d.current.focus())},r=()=>{const e=g.current;if(null===e)return;if(!t.hasFocus()||!l()||u.current)return void(u.current=!1);if(e.contains(t.activeElement))return;if(i&&t.activeElement!==h.current&&t.activeElement!==d.current)return;if(t.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!m.current)return;let r=[];if(t.activeElement!==h.current&&t.activeElement!==d.current||(r=o(g.current)),r.length>0){const t=Boolean(v.current?.shiftKey&&"Tab"===v.current?.key),e=r[0],n=r[r.length-1];"string"!==typeof e&&"string"!==typeof n&&(t?n.focus():e.focus())}else e.focus()};t.addEventListener("focusin",r),t.addEventListener("keydown",e,!0);const n=setInterval((()=>{t.activeElement&&"BODY"===t.activeElement.tagName&&r()}),50);return()=>{clearInterval(n),t.removeEventListener("focusin",r),t.removeEventListener("keydown",e,!0)}}),[n,i,a,l,c,o]);const x=t=>{null===p.current&&(p.current=t.relatedTarget),m.current=!0};return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:h,"data-testid":"sentinelStart"}),t.cloneElement(r,{ref:y,onFocus:t=>{null===p.current&&(p.current=t.relatedTarget),m.current=!0,f.current=t.target;const e=r.props.onFocus;e&&e(t)}}),(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:d,"data-testid":"sentinelEnd"})]})},Ll={entering:{opacity:1},entered:{opacity:1}},Pl=t.forwardRef((function(e,r){const n=bi(),i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:l,easing:c,in:u,onEnter:h,onEntered:d,onEntering:p,onExit:f,onExited:m,onExiting:g,style:y,timeout:v=i,TransitionComponent:x=Ao,...b}=e,_=t.useRef(null),w=fa(_,go(l),r),k=t=>e=>{if(t){const r=_.current;void 0===e?t(r):t(r,e)}},T=k(p),S=k(((t,e)=>{Mo(t);const r=Co({style:y,timeout:v,easing:c},{mode:"enter"});t.style.webkitTransition=n.transitions.create("opacity",r),t.style.transition=n.transitions.create("opacity",r),h&&h(t,e)})),A=k(d),M=k(g),C=k((t=>{const e=Co({style:y,timeout:v,easing:c},{mode:"exit"});t.style.webkitTransition=n.transitions.create("opacity",e),t.style.transition=n.transitions.create("opacity",e),f&&f(t)})),E=k(m);return(0,s.jsx)(x,{appear:o,in:u,nodeRef:_,onEnter:S,onEntered:A,onEntering:T,onExit:C,onExited:E,onExiting:M,addEndListener:t=>{a&&a(_.current,t)},timeout:v,...b,children:(e,r)=>{let{ownerState:n,...i}=r;return t.cloneElement(l,{style:{opacity:0,visibility:"exited"!==e||u?void 0:"hidden",...Ll[e],...y,...l.props.style},ref:w,...i})}})})),Il=Pl;function zl(t){return Ai("MuiBackdrop",t)}Mi("MuiBackdrop",["root","invisible"]);const Ol=gi("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.invisible&&e.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Dl=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiBackdrop"}),{children:n,className:i,component:a="div",invisible:o=!1,open:l,components:c={},componentsProps:u={},slotProps:h={},slots:d={},TransitionComponent:p,transitionDuration:f,...m}=r,g={...r,component:a,invisible:o},y=(t=>{const{classes:e,invisible:r}=t;return Wn({root:["root",r&&"invisible"]},zl,e)})(g),v={slots:{transition:p,root:c.Root,...d},slotProps:{...u,...h}},[x,b]=Xi("root",{elementType:Ol,externalForwardedProps:v,className:Hn(y.root,i),ownerState:g}),[_,w]=Xi("transition",{elementType:Il,externalForwardedProps:v,ownerState:g});return(0,s.jsx)(_,{in:l,timeout:f,...m,...w,children:(0,s.jsx)(x,{"aria-hidden":!0,...b,classes:y,ref:e,children:n})})}));function Rl(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.reduce(((t,e)=>null==e?t:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n),e.apply(this,n)}),(()=>{}))}function Fl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function Bl(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function jl(t){return parseInt(la(t).getComputedStyle(t).paddingRight,10)||0}function Nl(t,e,r,n,i){const a=[e,r,...n];[].forEach.call(t.children,(t=>{const e=!a.includes(t),r=!function(t){const e=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r="INPUT"===t.tagName&&"hidden"===t.getAttribute("type");return e||r}(t);e&&r&&Bl(t,i)}))}function Ul(t,e){let r=-1;return t.some(((t,n)=>!!e(t)&&(r=n,!0))),r}function Vl(t,e){const r=[],n=t.container;if(!e.disableScrollLock){if(function(t){const e=sa(t);return e.body===t?la(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}(n)){const t=Fl(la(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${jl(n)+t}px`;const e=sa(n).querySelectorAll(".mui-fixed");[].forEach.call(e,(e=>{r.push({value:e.style.paddingRight,property:"padding-right",el:e}),e.style.paddingRight=`${jl(e)+t}px`}))}let t;if(n.parentNode instanceof DocumentFragment)t=sa(n).body;else{const e=n.parentElement,r=la(n);t="HTML"===e?.nodeName&&"scroll"===r.getComputedStyle(e).overflowY?e:n}r.push({value:t.style.overflow,property:"overflow",el:t},{value:t.style.overflowX,property:"overflow-x",el:t},{value:t.style.overflowY,property:"overflow-y",el:t}),t.style.overflow="hidden"}return()=>{r.forEach((t=>{let{value:e,el:r,property:n}=t;e?r.style.setProperty(n,e):r.style.removeProperty(n)}))}}const ql=()=>{},$l=new class{constructor(){this.modals=[],this.containers=[]}add(t,e){let r=this.modals.indexOf(t);if(-1!==r)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Bl(t.modalRef,!1);const n=function(t){const e=[];return[].forEach.call(t.children,(t=>{"true"===t.getAttribute("aria-hidden")&&e.push(t)})),e}(e);Nl(e,t.mount,t.modalRef,n,!0);const i=Ul(this.containers,(t=>t.container===e));return-1!==i?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:e,restore:null,hiddenSiblings:n}),r)}mount(t,e){const r=Ul(this.containers,(e=>e.modals.includes(t))),n=this.containers[r];n.restore||(n.restore=Vl(n,e))}remove(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(t);if(-1===r)return r;const n=Ul(this.containers,(e=>e.modals.includes(t))),i=this.containers[n];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),0===i.modals.length)i.restore&&i.restore(),t.modalRef&&Bl(t.modalRef,e),Nl(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(n,1);else{const t=i.modals[i.modals.length-1];t.modalRef&&Bl(t.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}};const Hl=function(e){const{container:r,disableEscapeKeyDown:n=!1,disableScrollLock:i=!1,closeAfterTransition:a=!1,onTransitionEnter:o,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:h}=e,d=t.useRef({}),p=t.useRef(null),f=t.useRef(null),m=qi(f,h),[g,y]=t.useState(!u),v=function(t){return!!t&&t.props.hasOwnProperty("in")}(l);let x=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(x=!1);const b=()=>(d.current.modalRef=f.current,d.current.mount=p.current,d.current),_=()=>{$l.mount(b(),{disableScrollLock:i}),f.current&&(f.current.scrollTop=0)},w=ma((()=>{const t=function(t){return"function"===typeof t?t():t}(r)||sa(p.current).body;$l.add(b(),t),f.current&&_()})),k=()=>$l.isTopModal(b()),T=ma((t=>{p.current=t,t&&(u&&k()?_():f.current&&Bl(f.current,x))})),S=t.useCallback((()=>{$l.remove(b(),x)}),[x]);t.useEffect((()=>()=>{S()}),[S]),t.useEffect((()=>{u?w():v&&a||S()}),[u,S,v,a,w]);const A=t=>e=>{t.onKeyDown?.(e),"Escape"===e.key&&229!==e.which&&k()&&(n||(e.stopPropagation(),c&&c(e,"escapeKeyDown")))},M=t=>e=>{t.onClick?.(e),e.target===e.currentTarget&&c&&c(e,"backdropClick")};return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=Gi(e);delete r.onTransitionEnter,delete r.onTransitionExited;const n={...r,...t};return{role:"presentation",...n,onKeyDown:A(n),ref:m}},getBackdropProps:function(){const t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{"aria-hidden":!0,...t,onClick:M(t),open:u}},getTransitionProps:()=>({onEnter:Rl((()=>{y(!1),o&&o()}),l?.props.onEnter??ql),onExited:Rl((()=>{y(!0),s&&s(),a&&S()}),l?.props.onExited??ql)}),rootRef:m,portalRef:T,isTopModal:k,exited:g,hasTransition:v}};function Wl(t){return Ai("MuiModal",t)}Mi("MuiModal",["root","hidden","backdrop"]);const Gl=gi("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.open&&r.exited&&e.hidden]}})(wi((t=>{let{theme:e}=t;return{position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:t=>{let{ownerState:e}=t;return!e.open&&e.exited},style:{visibility:"hidden"}}]}}))),Yl=gi(Dl,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Zl=t.forwardRef((function(e,r){const n=yi({name:"MuiModal",props:e}),{BackdropComponent:i=Yl,BackdropProps:a,classes:o,className:l,closeAfterTransition:c=!1,children:u,container:h,component:d,components:p={},componentsProps:f={},disableAutoFocus:m=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:y=!1,disablePortal:v=!1,disableRestoreFocus:x=!1,disableScrollLock:b=!1,hideBackdrop:_=!1,keepMounted:w=!1,onClose:k,onTransitionEnter:T,onTransitionExited:S,open:A,slotProps:M={},slots:C={},theme:E,...L}=n,P={...n,closeAfterTransition:c,disableAutoFocus:m,disableEnforceFocus:g,disableEscapeKeyDown:y,disablePortal:v,disableRestoreFocus:x,disableScrollLock:b,hideBackdrop:_,keepMounted:w},{getRootProps:I,getBackdropProps:z,getTransitionProps:O,portalRef:D,isTopModal:R,exited:F,hasTransition:B}=Hl({...P,rootRef:r}),j={...P,exited:F},N=(t=>{const{open:e,exited:r,classes:n}=t;return Wn({root:["root",!e&&r&&"hidden"],backdrop:["backdrop"]},Wl,n)})(j),U={};if(void 0===u.props.tabIndex&&(U.tabIndex="-1"),B){const{onEnter:t,onExited:e}=O();U.onEnter=t,U.onExited=e}const V={slots:{root:p.Root,backdrop:p.Backdrop,...C},slotProps:{...f,...M}},[q,$]=Xi("root",{ref:r,elementType:Gl,externalForwardedProps:{...V,...L,component:d},getSlotProps:I,ownerState:j,className:Hn(l,N?.root,!j.open&&j.exited&&N?.hidden)}),[H,W]=Xi("backdrop",{ref:a?.ref,elementType:i,externalForwardedProps:V,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:t=>z({...t,onClick:e=>{t?.onClick&&t.onClick(e)}}),className:Hn(a?.className,N?.backdrop),ownerState:j});return w||A||B&&!F?(0,s.jsx)(Zs,{ref:D,container:h,disablePortal:v,children:(0,s.jsxs)(q,{...$,children:[!_&&i?(0,s.jsx)(H,{...W}):null,(0,s.jsx)(El,{disableEnforceFocus:g,disableAutoFocus:m,disableRestoreFocus:x,isEnabled:R,open:A,children:t.cloneElement(u,U)})]})}):null})),Xl=Zl;function Kl(t,e,r){var n;const i=function(t,e,r){const n=e.getBoundingClientRect(),i=r&&r.getBoundingClientRect(),a=ca(e);let o;if(e.fakeTransform)o=e.fakeTransform;else{const t=a.getComputedStyle(e);o=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("transform")}let s=0,l=0;if(o&&"none"!==o&&"string"===typeof o){const t=o.split("(")[1].split(")")[0].split(",");s=parseInt(t[4],10),l=parseInt(t[5],10)}return"left"===t?i?`translateX(${i.right+s-n.left}px)`:`translateX(${a.innerWidth+s-n.left}px)`:"right"===t?i?`translateX(-${n.right-i.left-s}px)`:`translateX(-${n.left+n.width-s}px)`:"up"===t?i?`translateY(${i.bottom+l-n.top}px)`:`translateY(${a.innerHeight+l-n.top}px)`:i?`translateY(-${n.top-i.top+n.height-l}px)`:`translateY(-${n.top+n.height-l}px)`}(t,e,"function"===typeof(n=r)?n():n);i&&(e.style.webkitTransform=i,e.style.transform=i)}const Jl=t.forwardRef((function(e,r){const n=bi(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:l=!0,children:c,container:u,direction:h="down",easing:d=i,in:p,onEnter:f,onEntered:m,onEntering:g,onExit:y,onExited:v,onExiting:x,style:b,timeout:_=a,TransitionComponent:w=Ao,...k}=e,T=t.useRef(null),S=fa(go(c),T,r),A=t=>e=>{t&&(void 0===e?t(T.current):t(T.current,e))},M=A(((t,e)=>{Kl(h,t,u),Mo(t),f&&f(t,e)})),C=A(((t,e)=>{const r=Co({timeout:_,style:b,easing:d},{mode:"enter"});t.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),t.style.transition=n.transitions.create("transform",{...r}),t.style.webkitTransform="none",t.style.transform="none",g&&g(t,e)})),E=A(m),L=A(x),P=A((t=>{const e=Co({timeout:_,style:b,easing:d},{mode:"exit"});t.style.webkitTransition=n.transitions.create("-webkit-transform",e),t.style.transition=n.transitions.create("transform",e),Kl(h,t,u),y&&y(t)})),I=A((t=>{t.style.webkitTransition="",t.style.transition="",v&&v(t)})),z=t.useCallback((()=>{T.current&&Kl(h,T.current,u)}),[h,u]);return t.useEffect((()=>{if(p||"down"===h||"right"===h)return;const t=ia((()=>{T.current&&Kl(h,T.current,u)})),e=ca(T.current);return e.addEventListener("resize",t),()=>{t.clear(),e.removeEventListener("resize",t)}}),[h,p,u]),t.useEffect((()=>{p||z()}),[p,z]),(0,s.jsx)(w,{nodeRef:T,onEnter:M,onEntered:E,onEntering:C,onExit:P,onExited:I,onExiting:L,addEndListener:t=>{o&&o(T.current,t)},appear:l,in:p,timeout:_,...k,children:(e,r)=>{let{ownerState:n,...i}=r;return t.cloneElement(c,{ref:S,style:{visibility:"exited"!==e||p?void 0:"hidden",...b,...c.props.style},...i})}})})),Ql=Jl;function tc(t){return Ai("MuiDrawer",t)}Mi("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);function ec(t,e){if(!t)return e;function r(t,e){const r={};return Object.keys(e).forEach((n=>{(function(t,e){const r=t.charCodeAt(2);return"o"===t[0]&&"n"===t[1]&&r>=65&&r<=90&&"function"===typeof e})(n,e[n])&&"function"===typeof t[n]&&(r[n]=function(){t[n](...arguments),e[n](...arguments)})})),r}if("function"===typeof t||"function"===typeof e)return n=>{const i="function"===typeof e?e(n):e,a="function"===typeof t?t({...n,...i}):t,o=Hn(n?.className,i?.className,a?.className),s=r(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};const n=e,i=r(t,n),a=Hn(n?.className,t?.className);return{...e,...t,...i,...!!a&&{className:a},...n?.style&&t?.style&&{style:{...n.style,...t.style}},...n?.sx&&t?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(t.sx)?t.sx:[t.sx]]}}}const rc=(t,e)=>{const{ownerState:r}=t;return[e.root,("permanent"===r.variant||"persistent"===r.variant)&&e.docked,e.modal]},nc=gi(Xl,{name:"MuiDrawer",slot:"Root",overridesResolver:rc})(wi((t=>{let{theme:e}=t;return{zIndex:(e.vars||e).zIndex.drawer}}))),ic=gi("div",{shouldForwardProp:fi,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:rc})({flex:"0 0 auto"}),ac=gi(Li,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`paperAnchor${Oi(r.anchor)}`],"temporary"!==r.variant&&e[`paperAnchorDocked${Oi(r.anchor)}`]]}})(wi((t=>{let{theme:e}=t;return{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:t=>{let{ownerState:e}=t;return"left"===e.anchor&&"temporary"!==e.variant},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:t=>{let{ownerState:e}=t;return"top"===e.anchor&&"temporary"!==e.variant},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:t=>{let{ownerState:e}=t;return"right"===e.anchor&&"temporary"!==e.variant},style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:t=>{let{ownerState:e}=t;return"bottom"===e.anchor&&"temporary"!==e.variant},style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}}))),oc={left:"right",right:"left",top:"down",bottom:"up"};const sc=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiDrawer"}),i=bi(),a=Bt(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:l="left",BackdropProps:c,children:u,className:h,elevation:d=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:f,...m}={},onClose:g,open:y=!1,PaperProps:v={},SlideProps:x,TransitionComponent:b,transitionDuration:_=o,variant:w="temporary",slots:k={},slotProps:T={},...S}=n,A=t.useRef(!1);t.useEffect((()=>{A.current=!0}),[]);const M=function(t,e){let{direction:r}=t;return"rtl"===r&&function(t){return["left","right"].includes(t)}(e)?oc[e]:e}({direction:a?"rtl":"ltr"},l),C=l,E={...n,anchor:C,elevation:d,open:y,variant:w,...S},L=(t=>{const{classes:e,anchor:r,variant:n}=t;return Wn({root:["root",`anchor${Oi(r)}`],docked:[("permanent"===n||"persistent"===n)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Oi(r)}`,"temporary"!==n&&`paperAnchorDocked${Oi(r)}`]},tc,e)})(E),P={slots:{transition:b,...k},slotProps:{paper:v,transition:x,...T,backdrop:ec(T.backdrop||{...c,...f},{transitionDuration:_})}},[I,z]=Xi("root",{ref:r,elementType:nc,className:Hn(L.root,L.modal,h),shouldForwardComponentProp:!0,ownerState:E,externalForwardedProps:{...P,...S,...m},additionalProps:{open:y,onClose:g,hideBackdrop:p,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[O,D]=Xi("paper",{elementType:ac,shouldForwardComponentProp:!0,className:Hn(L.paper,v.className),ownerState:E,externalForwardedProps:P,additionalProps:{elevation:"temporary"===w?d:0,square:!0}}),[R,F]=Xi("docked",{elementType:ic,ref:r,className:Hn(L.root,L.docked,h),ownerState:E,externalForwardedProps:P,additionalProps:S}),[B,j]=Xi("transition",{elementType:Ql,ownerState:E,externalForwardedProps:P,additionalProps:{in:y,direction:oc[M],timeout:_,appear:A.current}}),N=(0,s.jsx)(O,{...D,children:u});if("permanent"===w)return(0,s.jsx)(R,{...F,children:N});const U=(0,s.jsx)(B,{...j,children:N});return"persistent"===w?(0,s.jsx)(R,{...F,children:U}):(0,s.jsx)(I,{...z,children:U})}));function lc(t){return Ai("MuiToolbar",t)}Mi("MuiToolbar",["root","gutters","regular","dense"]);const cc=gi("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableGutters&&e.gutters,e[r.variant]]}})(wi((t=>{let{theme:e}=t;return{position:"relative",display:"flex",alignItems:"center",variants:[{props:t=>{let{ownerState:e}=t;return!e.disableGutters},style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}}))),uc=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiToolbar"}),{className:n,component:i="div",disableGutters:a=!1,variant:o="regular",...l}=r,c={...r,component:i,disableGutters:a,variant:o},u=(t=>{const{classes:e,disableGutters:r,variant:n}=t;return Wn({root:["root",!r&&"gutters",n]},lc,e)})(c);return(0,s.jsx)(cc,{as:i,className:Hn(u.root,n),ref:e,ownerState:c,...l})})),hc=ji((0,s.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}));function dc(t){return Ai("MuiCircularProgress",t)}Mi("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const pc=44,fc=ar`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`,mc=ar`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`,gc="string"!==typeof fc?ir`
animation: ${fc} 1.4s linear infinite;
`:null,yc="string"!==typeof mc?ir`
animation: ${mc} 1.4s ease-in-out infinite;
`:null,vc=gi("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`color${Oi(r.color)}`]]}})(wi((t=>{let{theme:e}=t;return{display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:gc||{animation:`${fc} 1.4s linear infinite`}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{color:(e.vars||e).palette[r].main}}}))]}}))),xc=gi("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),bc=gi("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.circle,e[`circle${Oi(r.variant)}`],r.disableShrink&&e.circleDisableShrink]}})(wi((t=>{let{theme:e}=t;return{stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:t=>{let{ownerState:e}=t;return"indeterminate"===e.variant&&!e.disableShrink},style:yc||{animation:`${mc} 1.4s ease-in-out infinite`}}]}}))),_c=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiCircularProgress"}),{className:n,color:i="primary",disableShrink:a=!1,size:o=40,style:l,thickness:c=3.6,value:u=0,variant:h="indeterminate",...d}=r,p={...r,color:i,disableShrink:a,size:o,thickness:c,value:u,variant:h},f=(t=>{const{classes:e,variant:r,color:n,disableShrink:i}=t;return Wn({root:["root",r,`color${Oi(n)}`],svg:["svg"],circle:["circle",`circle${Oi(r)}`,i&&"circleDisableShrink"]},dc,e)})(p),m={},g={},y={};if("determinate"===h){const t=2*Math.PI*((pc-c)/2);m.strokeDasharray=t.toFixed(3),y["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*t).toFixed(3)}px`,g.transform="rotate(-90deg)"}return(0,s.jsx)(vc,{className:Hn(f.root,n),style:{width:o,height:o,...g,...l},ownerState:p,ref:e,role:"progressbar",...y,...d,children:(0,s.jsx)(xc,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,s.jsx)(bc,{className:f.circle,style:m,ownerState:p,cx:pc,cy:pc,r:(pc-c)/2,fill:"none",strokeWidth:c})})})})),wc=_c;function kc(t){return Ai("MuiIconButton",t)}const Tc=Mi("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Sc=gi(Wa,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.loading&&e.loading,"default"!==r.color&&e[`color${Oi(r.color)}`],r.edge&&e[`edge${Oi(r.edge)}`],e[`size${Oi(r.size)}`]]}})(wi((t=>{let{theme:e}=t;return{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]}})),wi((t=>{let{theme:e}=t;return{variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{color:(e.vars||e).palette[r].main}}})),...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr((e.vars||e).palette[r].main,e.palette.action.hoverOpacity)}}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${Tc.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Tc.loading}`]:{color:"transparent"}}}))),Ac=gi("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})((t=>{let{theme:e}=t;return{display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]}})),Mc=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiIconButton"}),{edge:n=!1,children:i,className:a,color:o="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:h,loading:d=null,loadingIndicator:p,...f}=r,m=sl(h),g=p??(0,s.jsx)(wc,{"aria-labelledby":m,color:"inherit",size:16}),y={...r,edge:n,color:o,disabled:l,disableFocusRipple:c,loading:d,loadingIndicator:g,size:u},v=(t=>{const{classes:e,disabled:r,color:n,edge:i,size:a,loading:o}=t;return Wn({root:["root",o&&"loading",r&&"disabled","default"!==n&&`color${Oi(n)}`,i&&`edge${Oi(i)}`,`size${Oi(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},kc,e)})(y);return(0,s.jsxs)(Sc,{id:d?m:h,className:Hn(v.root,a),centerRipple:!0,focusRipple:!c,disabled:l||d,ref:e,...f,ownerState:y,children:["boolean"===typeof d&&(0,s.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,s.jsx)(Ac,{className:v.loadingIndicator,ownerState:y,children:d&&g})}),i]})})),Cc=Mc;function Ec(t){const{sx:e,...r}=t,{systemProps:n,otherProps:i}=(t=>{const e={systemProps:{},otherProps:{}},r=t?.theme?.unstable_sxConfig??Qe;return Object.keys(t).forEach((n=>{r[n]?e.systemProps[n]=t[n]:e.otherProps[n]=t[n]})),e})(r);let a;return a=Array.isArray(e)?[n,...e]:"function"===typeof e?function(){const t=e(...arguments);return Jt(t)?{...n,...t}:n}:{...n,...e},{...i,sx:a}}const Lc=Mi("MuiBox",["root"]),Pc=Pn(),Ic=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:r,defaultTheme:n,defaultClassName:i="MuiBox-root",generateClassName:a}=e,o=ei("div",{shouldForwardProp:t=>"theme"!==t&&"sx"!==t&&"as"!==t})(er);return t.forwardRef((function(t,e){const l=xi(n),{className:c,component:u="div",...h}=Ec(t);return(0,s.jsx)(o,{as:u,ref:e,className:Hn(c,a?a(i):i),theme:r&&l[r]||l,...h})}))}({themeId:Gt,defaultTheme:Pc,defaultClassName:Lc.root,generateClassName:Ti.generate}),zc=Ic;const Oc=function(t){let{styles:e,themeId:r,defaultTheme:n={}}=t;const i=xi(n),a="function"===typeof e?e(r&&i[r]||i):e;return(0,s.jsx)(or,{styles:a})};const Dc=function(t){return(0,s.jsx)(Oc,{...t,defaultTheme:di,themeId:Gt})};function Rc(t){return function(e){return(0,s.jsx)(Dc,{styles:"function"===typeof t?r=>t({theme:r,...e}):t})}}const Fc="function"===typeof Rc({}),Bc=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),jc=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),Nc=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r={};e&&t.colorSchemes&&"function"===typeof t.getColorSchemeSelector&&Object.entries(t.colorSchemes).forEach((e=>{let[n,i]=e;const a=t.getColorSchemeSelector(n);a.startsWith("@")?r[a]={":root":{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={colorScheme:i.palette?.mode}}));let n={html:Bc(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...jc(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...r};const i=t.components?.MuiCssBaseline?.styleOverrides;return i&&(n=[n,i]),n},Uc="mui-ecs",Vc=Rc(Fc?t=>{let{theme:e,enableColorScheme:r}=t;return Nc(e,r)}:t=>{let{theme:e}=t;return(t=>{const e=Nc(t,!1),r=Array.isArray(e)?e[0]:e;return!t.vars&&r&&(r.html[`:root:has(${Uc})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach((e=>{let[n,i]=e;const a=t.getColorSchemeSelector(n);a.startsWith("@")?r[a]={[`:root:not(:has(.${Uc}))`]:{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={[`&:not(:has(.${Uc}))`]:{colorScheme:i.palette?.mode}}})),e})(e)});const qc=function(e){const r=yi({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:i=!1}=r;return(0,s.jsxs)(t.Fragment,{children:[Fc&&(0,s.jsx)(Vc,{enableColorScheme:i}),!Fc&&!i&&(0,s.jsx)("span",{className:Uc,style:{display:"none"}}),n]})},$c=ji((0,s.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}));function Hc(t){return Ai("MuiButton",t)}const Wc=Mi("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const Gc=t.createContext({});const Yc=t.createContext(void 0),Zc=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Xc=gi(Wa,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`${r.variant}${Oi(r.color)}`],e[`size${Oi(r.size)}`],e[`${r.variant}Size${Oi(r.size)}`],"inherit"===r.color&&e.colorInherit,r.disableElevation&&e.disableElevation,r.fullWidth&&e.fullWidth,r.loading&&e.loading]}})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],n="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Wc.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Wc.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Wc.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Wc.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.5)`:Tr(e.palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette[r].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette[r].main,e.palette.action.hoverOpacity)}}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:r,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Wc.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Wc.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Wc.loading}`]:{color:"transparent"}}}]}}))),Kc=gi("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.startIcon,r.loading&&e.startIconLoadingStart,e[`iconSize${Oi(r.size)}`]]}})((t=>{let{theme:e}=t;return{display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Zc]}})),Jc=gi("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.endIcon,r.loading&&e.endIconLoadingEnd,e[`iconSize${Oi(r.size)}`]]}})((t=>{let{theme:e}=t;return{display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Zc]}})),Qc=gi("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})((t=>{let{theme:e}=t;return{display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}})),tu=gi("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(t,e)=>e.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),eu=t.forwardRef((function(e,r){const n=t.useContext(Gc),i=t.useContext(Yc),a=yi({props:Nt(n,e),name:"MuiButton"}),{children:o,color:l="primary",component:c="button",className:u,disabled:h=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:m,fullWidth:g=!1,id:y,loading:v=null,loadingIndicator:x,loadingPosition:b="center",size:_="medium",startIcon:w,type:k,variant:T="text",...S}=a,A=sl(y),M=x??(0,s.jsx)(wc,{"aria-labelledby":A,color:"inherit",size:16}),C={...a,color:l,component:c,disabled:h,disableElevation:d,disableFocusRipple:p,fullWidth:g,loading:v,loadingIndicator:M,loadingPosition:b,size:_,type:k,variant:T},E=(t=>{const{color:e,disableElevation:r,fullWidth:n,size:i,variant:a,loading:o,loadingPosition:s,classes:l}=t,c=Wn({root:["root",o&&"loading",a,`${a}${Oi(e)}`,`size${Oi(i)}`,`${a}Size${Oi(i)}`,`color${Oi(e)}`,r&&"disableElevation",n&&"fullWidth",o&&`loadingPosition${Oi(s)}`],startIcon:["icon","startIcon",`iconSize${Oi(i)}`],endIcon:["icon","endIcon",`iconSize${Oi(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},Hc,l);return{...l,...c}})(C),L=(w||v&&"start"===b)&&(0,s.jsx)(Kc,{className:E.startIcon,ownerState:C,children:w||(0,s.jsx)(tu,{className:E.loadingIconPlaceholder,ownerState:C})}),P=(f||v&&"end"===b)&&(0,s.jsx)(Jc,{className:E.endIcon,ownerState:C,children:f||(0,s.jsx)(tu,{className:E.loadingIconPlaceholder,ownerState:C})}),I=i||"",z="boolean"===typeof v?(0,s.jsx)("span",{className:E.loadingWrapper,style:{display:"contents"},children:v&&(0,s.jsx)(Qc,{className:E.loadingIndicator,ownerState:C,children:M})}):null;return(0,s.jsxs)(Xc,{ownerState:C,className:Hn(n.className,E.root,u,I),component:c,disabled:h||v,focusRipple:!p,focusVisibleClassName:Hn(E.focusVisible,m),ref:r,type:k,id:v?A:y,...S,classes:E,children:[L,"end"!==b&&z,o,"end"===b&&z,P]})})),ru=eu,nu=t=>{const{prompt:e,submitQuery:r}=t;let n=t.tunables;return"string"===typeof n&&(n=JSON.parse(n)),void 0===r?(0,s.jsx)(zc,{children:e}):(0,s.jsx)(ru,{variant:"outlined",sx:{color:t=>t.palette.custom.highlight,borderColor:t=>t.palette.custom.highlight,m:1},size:"small",onClick:t=>{r(e,n)},children:e})};function iu(t){return Ai("MuiTypography",t)}Mi("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const au={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ou=Ec,su=gi("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.variant&&e[r.variant],"inherit"!==r.align&&e[`align${Oi(r.align)}`],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})(wi((t=>{let{theme:e}=t;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter((t=>{let[e,r]=t;return"inherit"!==e&&r&&"object"===typeof r})).map((t=>{let[e,r]=t;return{props:{variant:e},style:r}})),...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{color:(e.vars||e).palette[r].main}}})),...Object.entries(e.palette?.text||{}).filter((t=>{let[,e]=t;return"string"===typeof e})).map((t=>{let[r]=t;return{props:{color:`text${Oi(r)}`},style:{color:(e.vars||e).palette.text[r]}}})),{props:t=>{let{ownerState:e}=t;return"inherit"!==e.align},style:{textAlign:"var(--Typography-textAlign)"}},{props:t=>{let{ownerState:e}=t;return e.noWrap},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:t=>{let{ownerState:e}=t;return e.gutterBottom},style:{marginBottom:"0.35em"}},{props:t=>{let{ownerState:e}=t;return e.paragraph},style:{marginBottom:16}}]}}))),lu={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},cu=t.forwardRef((function(t,e){const{color:r,...n}=yi({props:t,name:"MuiTypography"}),i=ou({...n,...!au[r]&&{color:r}}),{align:a="inherit",className:o,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:h=!1,variant:d="body1",variantMapping:p=lu,...f}=i,m={...i,align:a,color:r,className:o,component:l,gutterBottom:c,noWrap:u,paragraph:h,variant:d,variantMapping:p},g=l||(h?"p":p[d]||lu[d])||"span",y=(t=>{const{align:e,gutterBottom:r,noWrap:n,paragraph:i,variant:a,classes:o}=t;return Wn({root:["root",a,"inherit"!==t.align&&`align${Oi(e)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]},iu,o)})(m);return(0,s.jsx)(su,{as:g,ref:e,className:Hn(y.root,o),...f,ownerState:m,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...f.style}})})),uu=cu,hu=ji((0,s.jsx)("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}));var du=r(9408),pu=r.n(du);function fu(t){return Ai("MuiDivider",t)}Mi("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const mu=gi("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.absolute&&e.absolute,e[r.variant],r.light&&e.light,"vertical"===r.orientation&&e.vertical,r.flexItem&&e.flexItem,r.children&&e.withChildren,r.children&&"vertical"===r.orientation&&e.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&e.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&e.textAlignLeft]}})(wi((t=>{let{theme:e}=t;return{margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:Tr(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:t=>{let{ownerState:e}=t;return!!e.children},style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:t=>{let{ownerState:e}=t;return e.children&&"vertical"!==e.orientation},style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:t=>{let{ownerState:e}=t;return"vertical"===e.orientation&&e.children},style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:t=>{let{ownerState:e}=t;return"right"===e.textAlign&&"vertical"!==e.orientation},style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:t=>{let{ownerState:e}=t;return"left"===e.textAlign&&"vertical"!==e.orientation},style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}}))),gu=gi("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.wrapper,"vertical"===r.orientation&&e.wrapperVertical]}})(wi((t=>{let{theme:e}=t;return{display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}}))),yu=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiDivider"}),{absolute:n=!1,children:i,className:a,orientation:o="horizontal",component:l=(i||"vertical"===o?"div":"hr"),flexItem:c=!1,light:u=!1,role:h=("hr"!==l?"separator":void 0),textAlign:d="center",variant:p="fullWidth",...f}=r,m={...r,absolute:n,component:l,flexItem:c,light:u,orientation:o,role:h,textAlign:d,variant:p},g=(t=>{const{absolute:e,children:r,classes:n,flexItem:i,light:a,orientation:o,textAlign:s,variant:l}=t;return Wn({root:["root",e&&"absolute",l,a&&"light","vertical"===o&&"vertical",i&&"flexItem",r&&"withChildren",r&&"vertical"===o&&"withChildrenVertical","right"===s&&"vertical"!==o&&"textAlignRight","left"===s&&"vertical"!==o&&"textAlignLeft"],wrapper:["wrapper","vertical"===o&&"wrapperVertical"]},fu,n)})(m);return(0,s.jsx)(mu,{as:l,className:Hn(g.root,a),role:h,ref:e,ownerState:m,"aria-orientation":"separator"!==h||"hr"===l&&"vertical"!==o?void 0:o,...f,children:i?(0,s.jsx)(gu,{className:g.wrapper,ownerState:m,children:i}):null})}));yu&&(yu.muiSkipListHighlight=!0);const vu=yu;function xu(t){return Ai("MuiCollapse",t)}Mi("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const bu=gi("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.orientation],"entered"===r.state&&e.entered,"exited"===r.state&&!r.in&&"0px"===r.collapsedSize&&e.hidden]}})(wi((t=>{let{theme:e}=t;return{height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:t=>{let{ownerState:e}=t;return"exited"===e.state&&!e.in&&"0px"===e.collapsedSize},style:{visibility:"hidden"}}]}}))),_u=gi("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),wu=gi("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ku=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiCollapse"}),{addEndListener:i,children:a,className:o,collapsedSize:l="0px",component:c,easing:u,in:h,onEnter:d,onEntered:p,onEntering:f,onExit:m,onExited:g,onExiting:y,orientation:v="vertical",style:x,timeout:b=un.standard,TransitionComponent:_=Ao,...w}=n,k={...n,orientation:v,collapsedSize:l},T=(t=>{const{orientation:e,classes:r}=t;return Wn({root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]},xu,r)})(k),S=bi(),A=Ia(),M=t.useRef(null),C=t.useRef(),E="number"===typeof l?`${l}px`:l,L="horizontal"===v,P=L?"width":"height",I=t.useRef(null),z=fa(r,I),O=t=>e=>{if(t){const r=I.current;void 0===e?t(r):t(r,e)}},D=()=>M.current?M.current[L?"clientWidth":"clientHeight"]:0,R=O(((t,e)=>{M.current&&L&&(M.current.style.position="absolute"),t.style[P]=E,d&&d(t,e)})),F=O(((t,e)=>{const r=D();M.current&&L&&(M.current.style.position="");const{duration:n,easing:i}=Co({style:x,timeout:b,easing:u},{mode:"enter"});if("auto"===b){const e=S.transitions.getAutoHeightDuration(r);t.style.transitionDuration=`${e}ms`,C.current=e}else t.style.transitionDuration="string"===typeof n?n:`${n}ms`;t.style[P]=`${r}px`,t.style.transitionTimingFunction=i,f&&f(t,e)})),B=O(((t,e)=>{t.style[P]="auto",p&&p(t,e)})),j=O((t=>{t.style[P]=`${D()}px`,m&&m(t)})),N=O(g),U=O((t=>{const e=D(),{duration:r,easing:n}=Co({style:x,timeout:b,easing:u},{mode:"exit"});if("auto"===b){const r=S.transitions.getAutoHeightDuration(e);t.style.transitionDuration=`${r}ms`,C.current=r}else t.style.transitionDuration="string"===typeof r?r:`${r}ms`;t.style[P]=E,t.style.transitionTimingFunction=n,y&&y(t)}));return(0,s.jsx)(_,{in:h,onEnter:R,onEntered:B,onEntering:F,onExit:j,onExited:N,onExiting:U,addEndListener:t=>{"auto"===b&&A.start(C.current||0,t),i&&i(I.current,t)},nodeRef:I,timeout:"auto"===b?null:b,...w,children:(t,e)=>{let{ownerState:r,...n}=e;return(0,s.jsx)(bu,{as:c,className:Hn(T.root,o,{entered:T.entered,exited:!h&&"0px"===E&&T.hidden}[t]),style:{[L?"minWidth":"minHeight"]:E,...x},ref:z,ownerState:{...k,state:t},...n,children:(0,s.jsx)(_u,{ownerState:{...k,state:t},className:T.wrapper,ref:M,children:(0,s.jsx)(wu,{ownerState:{...k,state:t},className:T.wrapperInner,children:a})})})}})}));ku&&(ku.muiSupportAuto=!0);const Tu=ku;const Su=t.createContext({});function Au(t){return Ai("MuiAccordion",t)}const Mu=Mi("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Cu=gi(Li,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Mu.region}`]:e.region},e.root,!r.square&&e.rounded,!r.disableGutters&&e.gutters]}})(wi((t=>{let{theme:e}=t;const r={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],r),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],r)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Mu.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Mu.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}})),wi((t=>{let{theme:e}=t;return{variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${Mu.expanded}`]:{margin:"16px 0"}}}]}}))),Eu=gi("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(t,e)=>e.heading})({all:"unset"}),Lu=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiAccordion"}),{children:i,className:a,defaultExpanded:o=!1,disabled:l=!1,disableGutters:c=!1,expanded:u,onChange:h,square:d=!1,slots:p={},slotProps:f={},TransitionComponent:m,TransitionProps:g,...y}=n,[v,x]=ll({controlled:u,default:o,name:"Accordion",state:"expanded"}),b=t.useCallback((t=>{x(!v),h&&h(t,!v)}),[v,h,x]),[_,...w]=t.Children.toArray(i),k=t.useMemo((()=>({expanded:v,disabled:l,disableGutters:c,toggle:b})),[v,l,c,b]),T={...n,square:d,disabled:l,disableGutters:c,expanded:v},S=(t=>{const{classes:e,square:r,expanded:n,disabled:i,disableGutters:a}=t;return Wn({root:["root",!r&&"rounded",n&&"expanded",i&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},Au,e)})(T),A={slots:{transition:m,...p},slotProps:{transition:g,...f}},[M,C]=Xi("root",{elementType:Cu,externalForwardedProps:{...A,...y},className:Hn(S.root,a),shouldForwardComponentProp:!0,ownerState:T,ref:r,additionalProps:{square:d}}),[E,L]=Xi("heading",{elementType:Eu,externalForwardedProps:A,className:S.heading,ownerState:T}),[P,I]=Xi("transition",{elementType:Tu,externalForwardedProps:A,ownerState:T});return(0,s.jsxs)(M,{...C,children:[(0,s.jsx)(E,{...L,children:(0,s.jsx)(Su.Provider,{value:k,children:_})}),(0,s.jsx)(P,{in:v,timeout:"auto",...I,children:(0,s.jsx)("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region",className:S.region,children:w})})]})}));function Pu(t){return Ai("MuiAccordionSummary",t)}const Iu=Mi("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),zu=gi(Wa,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(wi((t=>{let{theme:e}=t;const r={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],r),[`&.${Iu.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Iu.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${Iu.disabled})`]:{cursor:"pointer"},variants:[{props:t=>!t.disableGutters,style:{[`&.${Iu.expanded}`]:{minHeight:64}}}]}}))),Ou=gi("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,e)=>e.content})(wi((t=>{let{theme:e}=t;return{display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${Iu.expanded}`]:{margin:"20px 0"}}}]}}))),Du=gi("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,e)=>e.expandIconWrapper})(wi((t=>{let{theme:e}=t;return{display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${Iu.expanded}`]:{transform:"rotate(180deg)"}}}))),Ru=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiAccordionSummary"}),{children:i,className:a,expandIcon:o,focusVisibleClassName:l,onClick:c,slots:u,slotProps:h,...d}=n,{disabled:p=!1,disableGutters:f,expanded:m,toggle:g}=t.useContext(Su),y={...n,expanded:m,disabled:p,disableGutters:f},v=(t=>{const{classes:e,expanded:r,disabled:n,disableGutters:i}=t;return Wn({root:["root",r&&"expanded",n&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",r&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",r&&"expanded"]},Pu,e)})(y),x={slots:u,slotProps:h},[b,_]=Xi("root",{ref:r,shouldForwardComponentProp:!0,className:Hn(v.root,a),elementType:zu,externalForwardedProps:{...x,...d},ownerState:y,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:p,"aria-expanded":m,focusVisibleClassName:Hn(v.focusVisible,l)},getSlotProps:t=>({...t,onClick:e=>{t.onClick?.(e),(t=>{g&&g(t),c&&c(t)})(e)}})}),[w,k]=Xi("content",{className:v.content,elementType:Ou,externalForwardedProps:x,ownerState:y}),[T,S]=Xi("expandIconWrapper",{className:v.expandIconWrapper,elementType:Du,externalForwardedProps:x,ownerState:y});return(0,s.jsxs)(b,{..._,children:[(0,s.jsx)(w,{...k,children:i}),o&&(0,s.jsx)(T,{...S,children:o})]})}));function Fu(t){return Ai("MuiAccordionDetails",t)}Mi("MuiAccordionDetails",["root"]);const Bu=gi("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(wi((t=>{let{theme:e}=t;return{padding:e.spacing(1,2,2)}}))),ju=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiAccordionDetails"}),{className:n,...i}=r,a=r,o=(t=>{const{classes:e}=t;return Wn({root:["root"]},Fu,e)})(a);return(0,s.jsx)(Bu,{className:Hn(o.root,n),ref:e,ownerState:a,...i})}));const Nu=t.createContext();function Uu(t){return Ai("MuiTable",t)}Mi("MuiTable",["root","stickyHeader"]);const Vu=gi("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.stickyHeader&&e.stickyHeader]}})(wi((t=>{let{theme:e}=t;return{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:t=>{let{ownerState:e}=t;return e.stickyHeader},style:{borderCollapse:"separate"}}]}}))),qu="table",$u=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTable"}),{className:i,component:a=qu,padding:o="normal",size:l="medium",stickyHeader:c=!1,...u}=n,h={...n,component:a,padding:o,size:l,stickyHeader:c},d=(t=>{const{classes:e,stickyHeader:r}=t;return Wn({root:["root",r&&"stickyHeader"]},Uu,e)})(h),p=t.useMemo((()=>({padding:o,size:l,stickyHeader:c})),[o,l,c]);return(0,s.jsx)(Nu.Provider,{value:p,children:(0,s.jsx)(Vu,{as:a,role:a===qu?null:"table",ref:r,className:Hn(d.root,i),ownerState:h,...u})})})),Hu=$u;const Wu=t.createContext();function Gu(t){return Ai("MuiTableBody",t)}Mi("MuiTableBody",["root"]);const Yu=gi("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),Zu={variant:"body"},Xu="tbody",Ku=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTableBody"}),{className:n,component:i=Xu,...a}=r,o={...r,component:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},Gu,e)})(o);return(0,s.jsx)(Wu.Provider,{value:Zu,children:(0,s.jsx)(Yu,{className:Hn(l.root,n),as:i,ref:e,role:i===Xu?null:"rowgroup",ownerState:o,...a})})}));function Ju(t){return Ai("MuiTableCell",t)}const Qu=Mi("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),th=gi("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`size${Oi(r.size)}`],"normal"!==r.padding&&e[`padding${Oi(r.padding)}`],"inherit"!==r.align&&e[`align${Oi(r.align)}`],r.stickyHeader&&e.stickyHeader]}})(wi((t=>{let{theme:e}=t;return{...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid\n ${"light"===e.palette.mode?Cr(Tr(e.palette.divider,1),.88):Ar(Tr(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Qu.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:t=>{let{ownerState:e}=t;return e.stickyHeader},style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}}))),eh=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:l,scope:c,size:u,sortDirection:h,variant:d,...p}=n,f=t.useContext(Nu),m=t.useContext(Wu),g=m&&"head"===m.variant;let y;y=o||(g?"th":"td");let v=c;"td"===y?v=void 0:!v&&g&&(v="col");const x=d||m&&m.variant,b={...n,align:i,component:y,padding:l||(f&&f.padding?f.padding:"normal"),size:u||(f&&f.size?f.size:"medium"),sortDirection:h,stickyHeader:"head"===x&&f&&f.stickyHeader,variant:x},_=(t=>{const{classes:e,variant:r,align:n,padding:i,size:a,stickyHeader:o}=t;return Wn({root:["root",r,o&&"stickyHeader","inherit"!==n&&`align${Oi(n)}`,"normal"!==i&&`padding${Oi(i)}`,`size${Oi(a)}`]},Ju,e)})(b);let w=null;return h&&(w="asc"===h?"ascending":"descending"),(0,s.jsx)(th,{as:y,ref:r,className:Hn(_.root,a),"aria-sort":w,scope:v,ownerState:b,...p})})),rh=eh;function nh(t){return Ai("MuiTableContainer",t)}Mi("MuiTableContainer",["root"]);const ih=gi("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),ah=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTableContainer"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},nh,e)})(o);return(0,s.jsx)(ih,{ref:e,as:i,className:Hn(l.root,n),ownerState:o,...a})}));function oh(t){return Ai("MuiTableHead",t)}Mi("MuiTableHead",["root"]);const sh=gi("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),lh={variant:"head"},ch="thead",uh=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTableHead"}),{className:n,component:i=ch,...a}=r,o={...r,component:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},oh,e)})(o);return(0,s.jsx)(Wu.Provider,{value:lh,children:(0,s.jsx)(sh,{as:i,className:Hn(l.root,n),ref:e,role:i===ch?null:"rowgroup",ownerState:o,...a})})}));function hh(t){return Ai("MuiTableRow",t)}const dh=Mi("MuiTableRow",["root","selected","hover","head","footer"]),ph=gi("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.head&&e.head,r.footer&&e.footer]}})(wi((t=>{let{theme:e}=t;return{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${dh.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${dh.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Tr(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Tr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}}))),fh="tr",mh=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiTableRow"}),{className:i,component:a=fh,hover:o=!1,selected:l=!1,...c}=n,u=t.useContext(Wu),h={...n,component:a,hover:o,selected:l,head:u&&"head"===u.variant,footer:u&&"footer"===u.variant},d=(t=>{const{classes:e,selected:r,hover:n,head:i,footer:a}=t;return Wn({root:["root",r&&"selected",n&&"hover",i&&"head",a&&"footer"]},hh,e)})(h);return(0,s.jsx)(ph,{as:a,ref:r,className:Hn(d.root,i),role:a===fh?null:"row",ownerState:h,...c})})),gh=mh;function yh(t){return Ai("MuiCardContent",t)}Mi("MuiCardContent",["root"]);const vh=gi("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),xh=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiCardContent"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},yh,e)})(o);return(0,s.jsx)(vh,{as:i,className:Hn(l.root,n),ownerState:o,ref:e,...a})}));function bh(t){return Ai("MuiCardActions",t)}Mi("MuiCardActions",["root","spacing"]);const _h=gi("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),wh=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiCardActions"}),{disableSpacing:n=!1,className:i,...a}=r,o={...r,disableSpacing:n},l=(t=>{const{classes:e,disableSpacing:r}=t;return Wn({root:["root",!r&&"spacing"]},bh,e)})(o);return(0,s.jsx)(_h,{className:Hn(l.root,i),ownerState:o,ref:e,...a})})),kh=ji((0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Th=gi((t=>{const{expand:e,...r}=t;return(0,s.jsx)(Cc,{...r})}))((t=>{let{theme:e}=t;return{marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),variants:[{props:t=>{let{expand:e}=t;return!e},style:{transform:"rotate(0deg)"}},{props:t=>{let{expand:e}=t;return!!e},style:{transform:"rotate(180deg)"}}]}}));var Sh={},Ah=(0,t.createContext)(Sh),Mh=(t,e)=>Gn({},t,e),Ch=(0,t.createContext)((()=>{}));function Eh(){return(0,t.useContext)(Ch)}Ch.displayName="JVR.DispatchShowTools";var Lh=t=>{var{initial:e,dispatch:r,children:n}=t;return(0,s.jsx)(Ah.Provider,{value:e,children:(0,s.jsx)(Ch.Provider,{value:r,children:n})})};Lh.displayName="JVR.ShowTools";var Ph={},Ih=(0,t.createContext)(Ph),zh=(t,e)=>Gn({},t,e),Oh=()=>(0,t.useContext)(Ih),Dh=(0,t.createContext)((()=>{}));Dh.displayName="JVR.DispatchExpands";var Rh=t=>{var{initial:e,dispatch:r,children:n}=t;return(0,s.jsx)(Ih.Provider,{value:e,children:(0,s.jsx)(Dh.Provider,{value:r,children:n})})};Rh.displayName="JVR.Expands";var Fh={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},Bh=(0,t.createContext)(Fh),jh=(t,e)=>Gn({},t,e),Nh=()=>(0,t.useContext)(Bh),Uh=(0,t.createContext)((()=>{}));function Vh(t){var{initial:e,dispatch:r,children:n}=t;return(0,s.jsx)(Bh.Provider,{value:e,children:(0,s.jsx)(Uh.Provider,{value:r,children:n})})}Uh.displayName="JVR.DispatchTypes",Vh.displayName="JVR.Types";var qh=["style"];function $h(t){var{style:e}=t,r=ba(t,qh),n=Gn({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},e);return(0,s.jsx)("svg",Gn({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:n},r,{children:(0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}$h.displayName="JVR.TriangleArrow";var Hh={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:(0,s.jsx)($h,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},Wh=(0,t.createContext)(Hh),Gh=(t,e)=>Gn({},t,e),Yh=()=>(0,t.useContext)(Wh),Zh=(0,t.createContext)((()=>{}));Zh.displayName="JVR.DispatchSymbols";var Xh=t=>{var{initial:e,dispatch:r,children:n}=t;return(0,s.jsx)(Wh.Provider,{value:e,children:(0,s.jsx)(Zh.Provider,{value:r,children:n})})};Xh.displayName="JVR.Symbols";var Kh={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},Jh=(0,t.createContext)(Kh),Qh=(t,e)=>Gn({},t,e),td=()=>(0,t.useContext)(Jh),ed=(0,t.createContext)((()=>{}));ed.displayName="JVR.DispatchSection";var rd=t=>{var{initial:e,dispatch:r,children:n}=t;return(0,s.jsx)(Jh.Provider,{value:e,children:(0,s.jsx)(ed.Provider,{value:r,children:n})})};rd.displayName="JVR.Section";var nd={objectSortKeys:!1,indentWidth:15},id=(0,t.createContext)(nd);id.displayName="JVR.Context";var ad=(0,t.createContext)((()=>{}));function od(t,e){return Gn({},t,e)}ad.displayName="JVR.DispatchContext";var sd=()=>(0,t.useContext)(id),ld=e=>{var{children:r,initialState:n,initialTypes:i}=e,[a,o]=(0,t.useReducer)(od,Object.assign({},nd,n)),[l,c]=(0,t.useReducer)(Mh,Sh),[u,h]=(0,t.useReducer)(zh,Ph),[d,p]=(0,t.useReducer)(jh,Fh),[f,m]=(0,t.useReducer)(Gh,Hh),[g,y]=(0,t.useReducer)(Qh,Kh);return(0,t.useEffect)((()=>o(Gn({},n))),[n]),(0,s.jsx)(id.Provider,{value:a,children:(0,s.jsx)(ad.Provider,{value:o,children:(0,s.jsx)(Lh,{initial:l,dispatch:c,children:(0,s.jsx)(Rh,{initial:u,dispatch:h,children:(0,s.jsx)(Vh,{initial:Gn({},d,i),dispatch:p,children:(0,s.jsx)(Xh,{initial:f,dispatch:m,children:(0,s.jsx)(rd,{initial:g,dispatch:y,children:r})})})})})})})};ld.displayName="JVR.Provider";var cd=["isNumber","value","parentValue","keyName","keys"],ud=["as","render"],hd=["as","render"],dd=["as","render"],pd=["as","style","render"],fd=["as","render"],md=["as","render"],gd=["as","render"],yd=["as","render"],vd=t=>{var{Quote:e={}}=Yh(),{isNumber:r,value:n,parentValue:i,keyName:a,keys:o}=t,l=ba(t,cd);if(r)return null;var{as:c,render:u}=e,h=c||"span",d=Gn({},l,ba(e,ud)),p=u&&"function"===typeof u&&u(d,{value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])});return p||(0,s.jsx)(h,Gn({},d))};vd.displayName="JVR.Quote";var xd=t=>{var{ValueQuote:e={}}=Yh(),r=Gn({},(function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(t),t)),{as:n,render:i}=e,a=n||"span",o=Gn({},r,ba(e,hd)),l=i&&"function"===typeof i&&i(o,{});return l||(0,s.jsx)(a,Gn({},o))};xd.displayName="JVR.ValueQuote";var bd=t=>{var{value:e,parentValue:r,keyName:n,keys:i}=t,{Colon:a={}}=Yh(),{as:o,render:l}=a,c=ba(a,dd),u=o||"span",h=l&&"function"===typeof l&&l(c,{value:e,parentValue:r,keyName:n,keys:i||(n?[n]:[])});return h||(0,s.jsx)(u,Gn({},c))};bd.displayName="JVR.Colon";var _d=t=>{var{Arrow:e={}}=Yh(),r=Oh(),{expandKey:n,style:i,value:a,parentValue:o,keyName:l,keys:c}=t,u=!!r[n],{as:h,style:d,render:p}=e,f=ba(e,pd),m=h||"span",g=p&&"function"===typeof p,y=Gn({},f,{"data-expanded":u,style:Gn({},d,i)}),v=g&&p(y,{value:a,parentValue:o,keyName:l,keys:c||(l?[l]:[])});return v||(0,s.jsx)(m,Gn({},f,{style:Gn({},d,i)}))};_d.displayName="JVR.Arrow";var wd=t=>{var{isBrackets:e,value:r,parentValue:n,keyName:i,keys:a}=t,{BracketsLeft:o={},BraceLeft:l={}}=Yh(),c={value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])};if(e){var{as:u,render:h}=o,d=ba(o,fd),p=u||"span",f=h&&"function"===typeof h&&h(d,c);return f||(0,s.jsx)(p,Gn({},d))}var{as:m,render:g}=l,y=ba(l,md),v=m||"span",x=g&&"function"===typeof g&&g(y,c);return x||(0,s.jsx)(v,Gn({},y))};wd.displayName="JVR.BracketsOpen";var kd=t=>{var{isBrackets:e,isVisiable:r,value:n,parentValue:i,keyName:a,keys:o}=t,l={value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!r)return null;var{BracketsRight:c={},BraceRight:u={}}=Yh();if(e){var{as:h,render:d}=c,p=ba(c,gd),f=h||"span",m=d&&"function"===typeof d&&d(p,l);return m||(0,s.jsx)(f,Gn({},p))}var{as:g,render:y}=u,v=ba(u,yd),x=g||"span",b=y&&"function"===typeof y&&y(v,l);return b||(0,s.jsx)(x,Gn({},v))};kd.displayName="JVR.BracketsClose";var Td=t=>{var e,{value:r,expandKey:n,level:i,keys:a=[]}=t,o=Oh(),l=Array.isArray(r),{collapsed:c,shouldExpandNodeInitially:u}=sd(),h=r instanceof Set,d="boolean"===typeof c?c:"number"===typeof c&&i>c,p=null!=(e=o[n])?e:d,f=Object.keys(r).length;if(void 0===o[n]&&u&&u(p,{value:r,keys:a,level:i}))return null;if(p||0===f)return null;return(0,s.jsx)("div",{style:{paddingLeft:4},children:(0,s.jsx)(kd,{isBrackets:l||h,isVisiable:!0})})};Td.displayName="JVR.NestedClose";var Sd=["as","render"],Ad=["as","render"],Md=["as","render"],Cd=["as","render"],Ed=["as","render"],Ld=["as","render"],Pd=["as","render"],Id=["as","render"],zd=["as","render"],Od=["as","render"],Dd=["as","render"],Rd=["as","render"],Fd=["as","render"],Bd=t=>{if(void 0===t)return"0n";if("string"===typeof t)try{t=BigInt(t)}catch(Wf){return"0n"}return t?t.toString()+"n":"0n"},jd=t=>{var{value:e,keyName:r}=t,{Set:n={},displayDataTypes:i}=Nh();if(!(e instanceof Set)||!i)return null;var{as:a,render:o}=n,l=ba(n,Sd),c=o&&"function"===typeof o&&o(l,{type:"type",value:e,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,Gn({},l))};jd.displayName="JVR.SetComp";var Nd=t=>{var{value:e,keyName:r}=t,{Map:n={},displayDataTypes:i}=Nh();if(!(e instanceof Map)||!i)return null;var{as:a,render:o}=n,l=ba(n,Ad),c=o&&"function"===typeof o&&o(l,{type:"type",value:e,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,Gn({},l))};Nd.displayName="JVR.MapComp";var Ud={opacity:.75,paddingRight:4},Vd=e=>{var{children:r="",keyName:n}=e,{Str:i={},displayDataTypes:a}=Nh(),{shortenTextAfterLength:o=30,stringEllipsis:l="..."}=sd(),{as:c,render:u}=i,h=ba(i,Md),d=r,[p,f]=(0,t.useState)(o&&d.length>o);(0,t.useEffect)((()=>f(o&&d.length>o)),[o]);var m=c||"span",g=Gn({},Ud,i.style||{});o>0&&(h.style=Gn({},h.style,{cursor:d.length<=o?"initial":"pointer"}),d.length>o&&(h.onClick=()=>{f(!p)}));var y=p?""+d.slice(0,o)+l:d,v=u&&"function"===typeof u,x=v&&u(Gn({},h,{style:g}),{type:"type",value:r,keyName:n}),b=p?"w-rjv-value w-rjv-value-short":"w-rjv-value",_=v&&u(Gn({},h,{children:y,className:b}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(x||(0,s.jsx)(m,Gn({},h,{style:g}))),_||(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)(xd,{}),(0,s.jsx)(m,Gn({},h,{className:b,children:y})),(0,s.jsx)(xd,{})]})]})};Vd.displayName="JVR.TypeString";var qd=e=>{var{children:r,keyName:n}=e,{True:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Cd),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};qd.displayName="JVR.TypeTrue";var $d=e=>{var{children:r,keyName:n}=e,{False:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Ed),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};$d.displayName="JVR.TypeFalse";var Hd=e=>{var{children:r,keyName:n}=e,{Float:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Ld),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};Hd.displayName="JVR.TypeFloat";var Wd=e=>{var{children:r,keyName:n}=e,{Int:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Pd),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};Wd.displayName="JVR.TypeInt";var Gd=e=>{var{children:r,keyName:n}=e,{Bigint:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Id),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:Bd(null==r?void 0:r.toString())}))]})};Gd.displayName="JVR.TypeFloat";var Yd=e=>{var{children:r,keyName:n}=e,{Url:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,zd),u=o||"span",h=Gn({},Ud,i.style),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:null==r?void 0:r.href,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f||(0,s.jsxs)("a",Gn({href:null==r?void 0:r.href,target:"_blank"},c,{className:"w-rjv-value",children:[(0,s.jsx)(xd,{}),null==r?void 0:r.href,(0,s.jsx)(xd,{})]}))]})};Yd.displayName="JVR.TypeUrl";var Zd=e=>{var{children:r,keyName:n}=e,{Date:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Od),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=r instanceof Date?r.toLocaleString():r,m=d&&l(Gn({},c,{children:f,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),m||(0,s.jsx)(u,Gn({},c,{className:"w-rjv-value",children:f}))]})};Zd.displayName="JVR.TypeDate";var Xd=e=>{var{children:r,keyName:n}=e,{Undefined:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Dd),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f]})};Xd.displayName="JVR.TypeUndefined";var Kd=e=>{var{children:r,keyName:n}=e,{Null:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Rd),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f]})};Kd.displayName="JVR.TypeNull";var Jd=e=>{var{children:r,keyName:n}=e,{Nan:i={},displayDataTypes:a}=Nh(),{as:o,render:l}=i,c=ba(i,Fd),u=o||"span",h=Gn({},Ud,i.style||{}),d=l&&"function"===typeof l,p=d&&l(Gn({},c,{style:h}),{type:"type",value:r,keyName:n}),f=d&&l(Gn({},c,{children:null==r?void 0:r.toString(),className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(t.Fragment,{children:[a&&(p||(0,s.jsx)(u,Gn({},c,{style:h}))),f]})};Jd.displayName="JVR.TypeNan";var Qd=t=>{var{value:e,keyName:r}=t,n={keyName:r};return e instanceof URL?(0,s.jsx)(Yd,Gn({},n,{children:e})):"string"===typeof e?(0,s.jsx)(Vd,Gn({},n,{children:e})):!0===e?(0,s.jsx)(qd,Gn({},n,{children:e})):!1===e?(0,s.jsx)($d,Gn({},n,{children:e})):null===e?(0,s.jsx)(Kd,Gn({},n,{children:e})):void 0===e?(0,s.jsx)(Xd,Gn({},n,{children:e})):e instanceof Date?(0,s.jsx)(Zd,Gn({},n,{children:e})):"number"===typeof e&&isNaN(e)?(0,s.jsx)(Jd,Gn({},n,{children:e})):"number"===typeof e&&(t=>Number(t)===t&&t%1!==0||isNaN(t))(e)?(0,s.jsx)(Hd,Gn({},n,{children:e})):"bigint"===typeof e?(0,s.jsx)(Gd,Gn({},n,{children:e})):"number"===typeof e?(0,s.jsx)(Wd,Gn({},n,{children:e})):null};function tp(e,r,n){var i=(0,t.useContext)(Zh),a=[e.className,r.className].filter(Boolean).join(" "),o=Gn({},e,r,{className:a,style:Gn({},e.style,r.style),children:r.children||e.children});(0,t.useEffect)((()=>i({[n]:o})),[r])}function ep(e,r,n){var i=(0,t.useContext)(Uh),a=[e.className,r.className].filter(Boolean).join(" "),o=Gn({},e,r,{className:a,style:Gn({},e.style,r.style),children:r.children||e.children});(0,t.useEffect)((()=>i({[n]:o})),[r])}function rp(e,r,n){var i=(0,t.useContext)(ed),a=[e.className,r.className].filter(Boolean).join(" "),o=Gn({},e,r,{className:a,style:Gn({},e.style,r.style),children:r.children||e.children});(0,t.useEffect)((()=>i({[n]:o})),[r])}Qd.displayName="JVR.Value";var np=["as","render"],ip=t=>{var{KeyName:e={}}=td();return rp(e,t,"KeyName"),null};ip.displayName="JVR.KeyName";var ap=t=>{var{children:e,value:r,parentValue:n,keyName:i,keys:a}=t,o={color:"number"===typeof e?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:l={}}=td(),{as:c,render:u}=l,h=ba(l,np);h.style=Gn({},h.style,o);var d=c||"span",p=u&&"function"===typeof u&&u(Gn({},h,{children:e}),{value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])});return p||(0,s.jsx)(d,Gn({},h,{children:e}))};ap.displayName="JVR.KeyNameComp";var op=["children","value","parentValue","keyName","keys"],sp=["as","render","children"],lp=t=>{var{Row:e={}}=td();return rp(e,t,"Row"),null};lp.displayName="JVR.Row";var cp=t=>{var{children:e,value:r,parentValue:n,keyName:i,keys:a}=t,o=ba(t,op),{Row:l={}}=td(),{as:c,render:u}=l,h=ba(l,sp),d=c||"div",p=u&&"function"===typeof u&&u(Gn({},o,h,{children:e}),{value:r,keyName:i,parentValue:n,keys:a});return p||(0,s.jsx)(d,Gn({},o,h,{children:e}))};function up(e){var{value:r,highlightUpdates:n,highlightContainer:i}=e,a=function(e){var r=(0,t.useRef)();return(0,t.useEffect)((()=>{r.current=e})),r.current}(r),o=(0,t.useMemo)((()=>!(!n||void 0===a)&&(typeof r!==typeof a||("number"===typeof r?(!isNaN(r)||!isNaN(a))&&r!==a:Array.isArray(r)!==Array.isArray(a)||"object"!==typeof r&&"function"!==typeof r&&(r!==a||void 0)))),[n,r]);(0,t.useEffect)((()=>{i&&i.current&&o&&"animate"in i.current&&i.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})}),[o,r,i])}cp.displayName="JVR.RowComp";var hp=["keyName","value","parentValue","expandKey","keys"],dp=["as","render"],pp=e=>{var{keyName:r,value:n,parentValue:i,expandKey:a,keys:o}=e,l=ba(e,hp),{onCopied:c,enableClipboard:u}=sd(),h=(0,t.useContext)(Ah)[a],[d,p]=(0,t.useState)(!1),{Copied:f={}}=td();if(!1===u||!h)return null;var m={style:{display:"inline-flex"},fill:d?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:t=>{t.stopPropagation();var e="";e="number"===typeof n&&n===1/0?"Infinity":"number"===typeof n&&isNaN(n)?"NaN":"bigint"===typeof n?Bd(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,((t,e)=>"bigint"===typeof e?Bd(e):e),2),c&&c(e,n),p(!0),(navigator.clipboard||{writeText:t=>new Promise(((e,r)=>{var n=document.createElement("textarea");n.style.position="absolute",n.style.opacity="0",n.style.left="-99999999px",n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy")?e():r(),n.remove()}))}).writeText(e).then((()=>{var t=setTimeout((()=>{p(!1),clearTimeout(t)}),3e3)})).catch((t=>{}))}},{render:g}=f,y=ba(f,dp),v=Gn({},y,l,m,{style:Gn({},y.style,l.style,m.style)}),x=g&&"function"===typeof g&&g(Gn({},v,{"data-copied":d}),{value:n,keyName:r,keys:o,parentValue:i});return x||(d?(0,s.jsx)("svg",Gn({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):(0,s.jsx)("svg",Gn({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};function fp(){var e=(0,t.useRef)(null);return null===e.current&&(e.current="custom-id-"+Math.random().toString(36).substr(2,9)),e.current}pp.displayName="JVR.Copied";var mp=t=>{var e,{value:r,expandKey:n="",level:i,keys:a=[]}=t,o=Oh(),{objectSortKeys:l,indentWidth:c,collapsed:u,shouldExpandNodeInitially:h}=sd(),d=Array.isArray(r),p="boolean"===typeof u?u:"number"===typeof u&&i>u,f=null!=(e=o[n])?e:p;if(void 0===o[n]&&h&&h(f,{value:r,keys:a,level:i}))return null;if(f)return null;var m=d?Object.entries(r).map((t=>[Number(t[0]),t[1]])):Object.entries(r);l&&(m=!0===l?m.sort(((t,e)=>{var[r]=t,[n]=e;return"string"===typeof r&&"string"===typeof n?r.localeCompare(n):0})):m.sort(((t,e)=>{var[r,n]=t,[i,a]=e;return"string"===typeof r&&"string"===typeof i?l(r,i,n,a):0})));var g={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:c,marginLeft:6};return(0,s.jsx)("div",{className:"w-rjv-wrap",style:g,children:m.map(((t,e)=>{var[n,o]=t;return(0,s.jsx)(yp,{parentValue:r,keyName:n,keys:[...a,n],value:o,level:i},e)}))})};mp.displayName="JVR.KeyValues";var gp=e=>{var{keyName:r,parentValue:n,keys:i,value:a}=e,{highlightUpdates:o}=sd(),l="number"===typeof r,c=(0,t.useRef)(null);up({value:a,highlightUpdates:o,highlightContainer:c});var u={keyName:r,value:a,keys:i,parentValue:n};return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsxs)("span",{ref:c,children:[(0,s.jsx)(vd,Gn({isNumber:l,"data-placement":"left"},u)),(0,s.jsx)(ap,Gn({},u,{children:r})),(0,s.jsx)(vd,Gn({isNumber:l,"data-placement":"right"},u))]}),(0,s.jsx)(bd,Gn({},u))]})};gp.displayName="JVR.KayName";var yp=t=>{var{keyName:e,value:r,parentValue:n,level:i=0,keys:a=[]}=t,o=Eh(),l=fp(),c=Array.isArray(r),u=r instanceof Set,h=r instanceof Map,d=r instanceof Date,p=r instanceof URL;if(r&&"object"===typeof r&&!c&&!u&&!h&&!d&&!p||c||u||h){var f=u?Array.from(r):h?Object.fromEntries(r):r;return(0,s.jsx)(Pp,{keyName:e,value:f,parentValue:n,initialValue:r,keys:a,level:i+1})}var m={onMouseEnter:()=>o({[l]:!0}),onMouseLeave:()=>o({[l]:!1})};return(0,s.jsxs)(cp,Gn({className:"w-rjv-line",value:r,keyName:e,keys:a,parentValue:n},m,{children:[(0,s.jsx)(gp,{keyName:e,value:r,keys:a,parentValue:n}),(0,s.jsx)(Qd,{keyName:e,value:r}),(0,s.jsx)(pp,{keyName:e,value:r,keys:a,parentValue:n,expandKey:l})]}))};yp.displayName="JVR.KeyValuesItem";var vp=["value","keyName"],xp=["as","render"],bp=t=>{var{CountInfoExtra:e={}}=td();return rp(e,t,"CountInfoExtra"),null};bp.displayName="JVR.CountInfoExtra";var _p=t=>{var{value:e={},keyName:r}=t,n=ba(t,vp),{CountInfoExtra:i={}}=td(),{as:a,render:o}=i,l=ba(i,xp);if(!o&&!l.children)return null;var c=a||"span",u=o&&"function"===typeof o,h=Gn({},l,n),d=u&&o(h,{value:e,keyName:r});return d||(0,s.jsx)(c,Gn({},h))};_p.displayName="JVR.CountInfoExtraComps";var wp=["value","keyName"],kp=["as","render"],Tp=t=>{var{CountInfo:e={}}=td();return rp(e,t,"CountInfo"),null};Tp.displayName="JVR.CountInfo";var Sp=t=>{var{value:e={},keyName:r}=t,n=ba(t,wp),{displayObjectSize:i}=sd(),{CountInfo:a={}}=td();if(!i)return null;var{as:o,render:l}=a,c=ba(a,kp),u=o||"span";c.style=Gn({},c.style,t.style);var h=Object.keys(e).length;c.children||(c.children=h+" item"+(1===h?"":"s"));var d=Gn({},c,n),p=l&&"function"===typeof l&&l(Gn({},d,{"data-length":h}),{value:e,keyName:r});return p||(0,s.jsx)(u,Gn({},d))};Sp.displayName="JVR.CountInfoComp";var Ap=["as","render"],Mp=t=>{var{Ellipsis:e={}}=td();return rp(e,t,"Ellipsis"),null};Mp.displayName="JVR.Ellipsis";var Cp=t=>{var{isExpanded:e,value:r,keyName:n}=t,{Ellipsis:i={}}=td(),{as:a,render:o}=i,l=ba(i,Ap),c=a||"span",u=o&&"function"===typeof o&&o(Gn({},l,{"data-expanded":e}),{value:r,keyName:n});return u||(!e||"object"===typeof r&&0==Object.keys(r).length?null:(0,s.jsx)(c,Gn({},l)))};Cp.displayName="JVR.EllipsisComp";var Ep=e=>{var r,{keyName:n,expandKey:i,keys:a=[],initialValue:o,value:l,parentValue:c,level:u}=e,h=Oh(),d=(0,t.useContext)(Dh),{onExpand:p,collapsed:f,shouldExpandNodeInitially:m}=sd(),g=Array.isArray(l),y=l instanceof Set,v="boolean"===typeof f?f:"number"===typeof f&&u>f,x="object"===typeof l,b=null!=(r=h[i])?r:v,_=m&&m(b,{value:l,keys:a,level:u});void 0===h[i]&&void 0!==_&&(b=_);var w={transform:"rotate("+(b?"-90":"0")+"deg)",transition:"all 0.3s"},k=0!==Object.keys(l).length&&(g||y||x),T={style:{display:"inline-flex",alignItems:"center"}};k&&(T.onClick=()=>{var t={expand:!b,value:l,keyid:i,keyName:n};p&&p(t),d({[i]:t.expand})});var S={keyName:n,value:l,keys:a,parentValue:c};return(0,s.jsxs)("span",Gn({},T,{children:[k&&(0,s.jsx)(_d,Gn({style:w,expandKey:i},S)),(n||"number"===typeof n)&&(0,s.jsx)(gp,Gn({},S)),(0,s.jsx)(jd,{value:o,keyName:n}),(0,s.jsx)(Nd,{value:o,keyName:n}),(0,s.jsx)(wd,Gn({isBrackets:g||y},S)),(0,s.jsx)(Cp,{keyName:n,value:l,isExpanded:b}),(0,s.jsx)(kd,Gn({isVisiable:b||!k,isBrackets:g||y},S)),(0,s.jsx)(Sp,{value:l,keyName:n}),(0,s.jsx)(_p,{value:l,keyName:n}),(0,s.jsx)(pp,{keyName:n,value:l,expandKey:i,parentValue:c,keys:a})]}))};Ep.displayName="JVR.NestedOpen";var Lp=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],Pp=(0,t.forwardRef)(((t,e)=>{var{className:r="",parentValue:n,level:i=1,value:a,initialValue:o,keys:l,keyName:c}=t,u=ba(t,Lp),h=Eh(),d=fp(),p=[r,"w-rjv-inner"].filter(Boolean).join(" "),f={onMouseEnter:()=>h({[d]:!0}),onMouseLeave:()=>h({[d]:!1})};return(0,s.jsxs)("div",Gn({className:p,ref:e},u,f,{children:[(0,s.jsx)(Ep,{expandKey:d,value:a,level:i,keys:l,parentValue:n,keyName:c,initialValue:o}),(0,s.jsx)(mp,{expandKey:d,value:a,level:i,keys:l,parentValue:n,keyName:c}),(0,s.jsx)(Td,{expandKey:d,value:a,level:i,keys:l})]}))}));Pp.displayName="JVR.Container";var Ip=t=>{var{BraceLeft:e={}}=Yh();return tp(e,t,"BraceLeft"),null};Ip.displayName="JVR.BraceLeft";var zp=t=>{var{BraceRight:e={}}=Yh();return tp(e,t,"BraceRight"),null};zp.displayName="JVR.BraceRight";var Op=t=>{var{BracketsLeft:e={}}=Yh();return tp(e,t,"BracketsLeft"),null};Op.displayName="JVR.BracketsLeft";var Dp=t=>{var{BracketsRight:e={}}=Yh();return tp(e,t,"BracketsRight"),null};Dp.displayName="JVR.BracketsRight";var Rp=t=>{var{Arrow:e={}}=Yh();return tp(e,t,"Arrow"),null};Rp.displayName="JVR.Arrow";var Fp=t=>{var{Colon:e={}}=Yh();return tp(e,t,"Colon"),null};Fp.displayName="JVR.Colon";var Bp=t=>{var{Quote:e={}}=Yh();return tp(e,t,"Quote"),null};Bp.displayName="JVR.Quote";var jp=t=>{var{ValueQuote:e={}}=Yh();return tp(e,t,"ValueQuote"),null};jp.displayName="JVR.ValueQuote";var Np=t=>{var{Bigint:e={}}=Nh();return ep(e,t,"Bigint"),null};Np.displayName="JVR.Bigint";var Up=t=>{var{Date:e={}}=Nh();return ep(e,t,"Date"),null};Up.displayName="JVR.Date";var Vp=t=>{var{False:e={}}=Nh();return ep(e,t,"False"),null};Vp.displayName="JVR.False";var qp=t=>{var{Float:e={}}=Nh();return ep(e,t,"Float"),null};qp.displayName="JVR.Float";var $p=t=>{var{Int:e={}}=Nh();return ep(e,t,"Int"),null};$p.displayName="JVR.Int";var Hp=t=>{var{Map:e={}}=Nh();return ep(e,t,"Map"),null};Hp.displayName="JVR.Map";var Wp=t=>{var{Nan:e={}}=Nh();return ep(e,t,"Nan"),null};Wp.displayName="JVR.Nan";var Gp=t=>{var{Null:e={}}=Nh();return ep(e,t,"Null"),null};Gp.displayName="JVR.Null";var Yp=t=>{var{Set:e={}}=Nh();return ep(e,t,"Set"),null};Yp.displayName="JVR.Set";var Zp=t=>{var{Str:e={}}=Nh();return ep(e,t,"Str"),null};Zp.displayName="JVR.StringText";var Xp=t=>{var{True:e={}}=Nh();return ep(e,t,"True"),null};Xp.displayName="JVR.True";var Kp=t=>{var{Undefined:e={}}=Nh();return ep(e,t,"Undefined"),null};Kp.displayName="JVR.Undefined";var Jp=t=>{var{Url:e={}}=Nh();return ep(e,t,"Url"),null};Jp.displayName="JVR.Url";var Qp=t=>{var{Copied:e={}}=td();return rp(e,t,"Copied"),null};Qp.displayName="JVR.Copied";var tf=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied"],ef=(0,t.forwardRef)(((t,e)=>{var{className:r="",style:n,value:i,children:a,collapsed:o,shouldExpandNodeInitially:l,indentWidth:c=15,displayObjectSize:u=!0,shortenTextAfterLength:h=30,stringEllipsis:d,highlightUpdates:p=!0,enableClipboard:f=!0,displayDataTypes:m=!0,objectSortKeys:g=!1,onExpand:y,onCopied:v}=t,x=ba(t,tf),b=Gn({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},n),_=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");return(0,s.jsxs)(ld,{initialState:{value:i,objectSortKeys:g,indentWidth:c,shouldExpandNodeInitially:l,displayObjectSize:u,collapsed:o,enableClipboard:f,shortenTextAfterLength:h,stringEllipsis:d,highlightUpdates:p,onCopied:v,onExpand:y},initialTypes:{displayDataTypes:m},children:[(0,s.jsx)(Pp,Gn({value:i},x,{ref:e,className:_,style:b})),a]})}));ef.Bigint=Np,ef.Date=Up,ef.False=Vp,ef.Float=qp,ef.Int=$p,ef.Map=Hp,ef.Nan=Wp,ef.Null=Gp,ef.Set=Yp,ef.String=Zp,ef.True=Xp,ef.Undefined=Kp,ef.Url=Jp,ef.ValueQuote=jp,ef.Arrow=Rp,ef.Colon=Fp,ef.Quote=Bp,ef.Ellipsis=Mp,ef.BraceLeft=Ip,ef.BraceRight=zp,ef.BracketsLeft=Op,ef.BracketsRight=Dp,ef.Copied=Qp,ef.CountInfo=Tp,ef.CountInfoExtra=bp,ef.KeyName=ip,ef.Row=lp,ef.displayName="JVR.JsonView";const rf=ef,nf=ji((0,s.jsx)("path",{d:"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"})),af=ji((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),of=ji((0,s.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),sf=ji((0,s.jsx)("path",{d:"M15 9H9v6h6zm-2 4h-2v-2h2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2zm-4 6H7V7h10z"})),lf=ji([(0,s.jsx)("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),(0,s.jsx)("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]);function cf(e){const{role:r,children:n,sx:i,className:a,title:o,onExpand:l,expandable:c}=e,[u,h]=(0,t.useState)(void 0===e.expanded||e.expanded),d=bi(),p="16px",f={padding:d.spacing(1,2),fontSize:"0.875rem",alignSelf:"flex-start",maxWidth:"100%",minWidth:"100%",height:"fit-content","& > *":{color:"inherit",overflow:"hidden",m:0},"& > :last-child":{mb:0,m:0,p:0}},m={assistant:{...f,backgroundColor:d.palette.primary.main,border:`1px solid ${d.palette.secondary.main}`,borderRadius:`${p} ${p} ${p} 0`,color:d.palette.primary.contrastText},content:{...f,backgroundColor:"#F5F2EA",border:`1px solid ${d.palette.custom.highlight}`,borderRadius:0,alignSelf:"center",color:d.palette.text.primary,padding:"8px 8px",marginBottom:"0px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)",fontSize:"0.9rem",lineHeight:"1.3",fontFamily:d.typography.fontFamily},error:{...f,backgroundColor:"#F8E7E7",border:"1px solid #D83A3A",borderRadius:p,maxWidth:"90%",minWidth:"90%",alignSelf:"center",color:"#8B2525",padding:"10px 16px",boxShadow:"0 1px 3px rgba(216, 58, 58, 0.15)"},"fact-check":"qualifications","job-description":"content","job-requirements":"qualifications",info:{...f,backgroundColor:"#BFD8D8",border:`1px solid ${d.palette.secondary.main}`,borderRadius:p,color:d.palette.text.primary,opacity:.95},processing:"status",qualifications:{...f,backgroundColor:d.palette.primary.light,border:`1px solid ${d.palette.secondary.main}`,borderRadius:`${p} ${p} ${p} 0`,color:d.palette.primary.contrastText},resume:"content",searching:"status",status:{...f,backgroundColor:"rgba(74, 122, 125, 0.15)",border:`1px solid ${d.palette.secondary.light}`,borderRadius:"4px",maxWidth:"75%",minWidth:"75%",alignSelf:"center",color:d.palette.secondary.dark,fontWeight:500,fontSize:"0.95rem",padding:"8px 12px",opacity:.9,transition:"opacity 0.3s ease-in-out"},streaming:"assistant",system:{...f,backgroundColor:"#EDEAE0",border:`1px dashed ${d.palette.custom.highlight}`,borderRadius:p,maxWidth:"90%",minWidth:"90%",alignSelf:"center",color:d.palette.text.primary,fontStyle:"italic"},thinking:"status",user:{...f,backgroundColor:d.palette.background.default,border:`1px solid ${d.palette.custom.highlight}`,borderRadius:`${p} ${p} 0 ${p}`,alignSelf:"flex-end",color:d.palette.primary.main}};for(const[t,s]of Object.entries(m))"string"===typeof s&&(m[t]=m[s]);const g={error:(0,s.jsx)(af,{color:"error"}),info:(0,s.jsx)(of,{color:"info"}),processing:(0,s.jsx)(nf,{}),searching:(0,s.jsx)(sf,{}),thinking:(0,s.jsx)(lf,{}),tooling:(0,s.jsx)(nf,{})};return c||"content"===r&&o?(0,s.jsxs)(Lu,{expanded:u,className:a,onChange:()=>{l&&l(),h(!u)},sx:{...m[r],...i},children:[(0,s.jsx)(Ru,{expandIcon:(0,s.jsx)(kh,{}),slotProps:{content:{sx:{fontWeight:"bold",fontSize:"1.1rem",m:0,p:0,display:"flex",justifyItems:"center"}}},children:o||""}),(0,s.jsx)(ju,{sx:{mt:0,mb:0,p:0,pl:2,pr:2},children:n})]}):(0,s.jsxs)(zc,{className:a,sx:{...r in m?m[r]:m.status,gap:1,display:"flex",...i,flexDirection:"row"},children:[void 0!==g[r]&&g[r],(0,s.jsx)(zc,{sx:{p:0,m:0,gap:0,display:"flex",flexGrow:1,flexDirection:"column"},children:n})]})}function uf(){return uf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},uf.apply(this,arguments)}const hf=["children","options"],df="0",pf="1",ff="2",mf="3",gf="4",yf="5",vf="6",xf="7",bf="8",_f="9",wf="10",kf="11",Tf="12",Sf="13",Af="14",Mf="15",Cf="16",Ef="17",Lf="18",Pf="19",If="20",zf="21",Of="22",Df="23",Rf="24",Ff="25",Bf="27",jf="28",Nf="29",Uf="30",Vf="31",qf="32",$f="33";var Hf,Wf;(Wf=Hf||(Hf={}))[Wf.MAX=0]="MAX",Wf[Wf.HIGH=1]="HIGH",Wf[Wf.MED=2]="MED",Wf[Wf.LOW=3]="LOW",Wf[Wf.MIN=4]="MIN";const Gf=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(((t,e)=>(t[e.toLowerCase()]=e,t)),{class:"className",for:"htmlFor"}),Yf={amp:"&",apos:"'",gt:">",lt:"<",nbsp:"\xa0",quot:"\u201c"},Zf=["style","script"],Xf=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Kf=/mailto:/i,Jf=/\n{2,}$/,Qf=/^(\s*>[\s\S]*?)(?=\n\n|$)/,tm=/^ *> ?/gm,em=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,rm=/^ {2,}\n/,nm=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,im=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,am=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,om=/^(`+)((?:\\`|[^`])+)\1/,sm=/^(?:\n *)*\n/,lm=/\r\n?/g,cm=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,um=/^\[\^([^\]]+)]/,hm=/\f/g,dm=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,pm=/^\s*?\[(x|\s)\]/,fm=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,mm=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,gm=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,ym=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,vm=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,xm=/^<!--[\s\S]*?(?:-->)/,bm=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,_m=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,wm=/^\{.*\}$/,km=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Tm=/^<([^ >]+@[^ >]+)>/,Sm=/^<([^ >]+:\/[^ >]+)>/,Am=/-([a-z])?/gi,Mm=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Cm=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Em=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Lm=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Pm=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Im=/\t/g,zm=/(^ *\||\| *$)/g,Om=/^ *:-+: *$/,Dm=/^ *:-+ *$/,Rm=/^ *-+: *$/,Fm="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Bm=new RegExp(`^([*_])\\1${Fm}\\1\\1(?!\\1)`),jm=new RegExp(`^([*_])${Fm}\\1(?!\\1)`),Nm=new RegExp(`^(==)${Fm}\\1`),Um=new RegExp(`^(~~)${Fm}\\1`),Vm=/^\\([^0-9A-Za-z\s])/,qm=/\\([^0-9A-Za-z\s])/g,$m=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,Hm=/^\n+/,Wm=/^([ \t]*)/,Gm=/\\([^\\])/g,Ym=/(?:^|\n)( *)$/,Zm="(?:\\d+\\.)",Xm="(?:[*+-])";function Km(t){return"( *)("+(1===t?Zm:Xm)+") +"}const Jm=Km(1),Qm=Km(2);function tg(t){return new RegExp("^"+(1===t?Jm:Qm))}const eg=tg(1),rg=tg(2);function ng(t){return new RegExp("^"+(1===t?Jm:Qm)+"[^\\n]*(?:\\n(?!\\1"+(1===t?Zm:Xm)+" )[^\\n]*)*(\\n|$)","gm")}const ig=ng(1),ag=ng(2);function og(t){const e=1===t?Zm:Xm;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}const sg=og(1),lg=og(2);function cg(t,e){const r=1===e,n=r?sg:lg,i=r?ig:ag,a=r?eg:rg;return{match:bg((function(t,e){const r=Ym.exec(e.prevCapture);return r&&(e.list||!e.inline&&!e.simple)?n.exec(t=r[1]+t):null})),order:1,parse(t,e,n){const o=r?+t[2]:void 0,s=t[0].replace(Jf,"\n").match(i);let l=!1;return{items:s.map((function(t,r){const i=a.exec(t)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),c=t.replace(o,"").replace(a,""),u=r===s.length-1,h=-1!==c.indexOf("\n\n")||u&&l;l=h;const d=n.inline,p=n.list;let f;n.list=!0,h?(n.inline=!1,f=fg(c)+"\n\n"):(n.inline=!0,f=fg(c));const m=e(f,n);return n.inline=d,n.list=p,m})),ordered:r,start:o}},render:(e,r,n)=>t(e.ordered?"ol":"ul",{key:n.key,start:e.type===If?e.start:void 0},e.items.map((function(e,i){return t("li",{key:i},r(e,n))})))}}const ug=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),hg=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,dg=[Qf,im,am,fm,gm,mm,Mm,sg,lg],pg=[...dg,/^[^\n]+(?: \n|\n{2,})/,ym,xm,_m];function fg(t){let e=t.length;for(;e>0&&t[e-1]<=" ";)e--;return t.slice(0,e)}function mg(t){return t.replace(/[\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xc6]/g,"a").replace(/[\xe7\xc7]/g,"c").replace(/[\xf0\xd0]/g,"d").replace(/[\xc8\xc9\xca\xcb\xe9\xe8\xea\xeb]/g,"e").replace(/[\xcf\xef\xce\xee\xcd\xed\xcc\xec]/g,"i").replace(/[\xd1\xf1]/g,"n").replace(/[\xf8\xd8\u0153\u0152\xd5\xf5\xd4\xf4\xd3\xf3\xd2\xf2]/g,"o").replace(/[\xdc\xfc\xdb\xfb\xda\xfa\xd9\xf9]/g,"u").replace(/[\u0178\xff\xdd\xfd]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function gg(t){return Rm.test(t)?"right":Om.test(t)?"center":Dm.test(t)?"left":null}function yg(t,e,r,n){const i=r.inTable;r.inTable=!0;let a=[[]],o="";function s(){if(!o)return;const t=a[a.length-1];t.push.apply(t,e(o,r)),o=""}return t.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach(((t,e,r)=>{"|"===t.trim()&&(s(),n)?0!==e&&e!==r.length-1&&a.push([]):o+=t})),s(),r.inTable=i,a}function vg(t,e,r){r.inline=!0;const n=t[2]?t[2].replace(zm,"").split("|").map(gg):[],i=t[3]?function(t,e,r){return t.trim().split("\n").map((function(t){return yg(t,e,r,!0)}))}(t[3],e,r):[],a=yg(t[1],e,r,!!i.length);return r.inline=!1,i.length?{align:n,cells:i,header:a,type:Ff}:{children:a,type:zf}}function xg(t,e){return null==t.align[e]?{}:{textAlign:t.align[e]}}function bg(t){return t.inline=1,t}function _g(t){return bg((function(e,r){return r.inline?t.exec(e):null}))}function wg(t){return bg((function(e,r){return r.inline||r.simple?t.exec(e):null}))}function kg(t){return function(e,r){return r.inline||r.simple?null:t.exec(e)}}function Tg(t){return bg((function(e){return t.exec(e)}))}function Sg(t,e){if(e.inline||e.simple)return null;let r="";t.split("\n").every((t=>(t+="\n",!dg.some((e=>e.test(t)))&&(r+=t,!!t.trim()))));const n=fg(r);return""==n?null:[r,,n]}function Ag(t){try{if(decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return null}catch(t){return null}return t}function Mg(t){return t.replace(Gm,"$1")}function Cg(t,e,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;const a=t(e,r);return r.inline=n,r.simple=i,a}function Eg(t,e,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;const a=t(e,r);return r.inline=n,r.simple=i,a}function Lg(t,e,r){const n=r.inline||!1;r.inline=!1;const i=t(e,r);return r.inline=n,i}const Pg=(t,e,r)=>({children:Cg(e,t[2],r)});function Ig(){return{}}function zg(){return null}function Og(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.filter(Boolean).join(" ")}function Dg(t,e,r){let n=t;const i=e.split(".");for(;i.length&&(n=n[i[0]],void 0!==n);)i.shift();return n||r}function Rg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(t,e){const n=Dg(r.overrides,`${t}.props`,{});for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];return r.createElement(function(t,e){const r=Dg(e,t);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Dg(e,`${t}.component`,t):t}(t,r.overrides),uf({},e,n,{className:Og(null==e?void 0:e.className,n.className)||void 0}),...a)}function i(t){t=t.replace(dm,"");let e=!1;r.forceInline?e=!0:r.forceBlock||(e=!1===Pm.test(t));const i=u(c(e?t:`${fg(t).replace(Hm,"")}\n\n`,{inline:e}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===r.wrapper)return i;const a=r.wrapper||(e?"span":"div");let o;if(i.length>1||r.forceWrapper)o=i;else{if(1===i.length)return o=i[0],"string"==typeof o?n("span",{key:"outer"},o):o;o=null}return r.createElement(a,{key:"outer"},o)}function a(t,e){const n=e.match(Xf);return n?n.reduce((function(e,n){const a=n.indexOf("=");if(-1!==a){const o=function(t){return-1!==t.indexOf("-")&&null===t.match(bm)&&(t=t.replace(Am,(function(t,e){return e.toUpperCase()}))),t}(n.slice(0,a)).trim(),s=function(t){const e=t[0];return('"'===e||"'"===e)&&t.length>=2&&t[t.length-1]===e?t.slice(1,-1):t}(n.slice(a+1).trim()),l=Gf[o]||o;if("ref"===l)return e;const c=e[l]=function(t,e,r,n){return"style"===e?r.split(/;\s?/).reduce((function(t,e){const r=e.slice(0,e.indexOf(":"));return t[r.trim().replace(/(-[a-z])/g,(t=>t[1].toUpperCase()))]=e.slice(r.length+1).trim(),t}),{}):"href"===e||"src"===e?n(r,t,e):(r.match(wm)&&(r=r.slice(1,r.length-1)),"true"===r||"false"!==r&&r)}(t,o,s,r.sanitizer);"string"==typeof c&&(ym.test(c)||_m.test(c))&&(e[l]=i(c.trim()))}else"style"!==n&&(e[Gf[n]||n]=!0);return e}),{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||Ag,r.slugify=r.slugify||mg,r.namedCodesToUnicode=r.namedCodesToUnicode?uf({},Yf,r.namedCodesToUnicode):Yf,r.createElement=r.createElement||t.createElement;const o=[],s={},l={[df]:{match:kg(Qf),order:1,parse(t,e,r){const[,n,i]=t[0].replace(tm,"").match(em);return{alert:n,children:e(i,r)}},render(t,e,i){const a={key:i.key};return t.alert&&(a.className="markdown-alert-"+r.slugify(t.alert.toLowerCase(),mg),t.children.unshift({attrs:{},children:[{type:Bf,text:t.alert}],noInnerParse:!0,type:kf,tag:"header"})),n("blockquote",a,e(t.children,i))}},[pf]:{match:Tg(rm),order:1,parse:Ig,render:(t,e,r)=>n("br",{key:r.key})},[ff]:{match:kg(nm),order:1,parse:Ig,render:(t,e,r)=>n("hr",{key:r.key})},[mf]:{match:kg(am),order:0,parse:t=>({lang:void 0,text:fg(t[0].replace(/^ {4}/gm,"")).replace(qm,"$1")}),render:(t,e,r)=>n("pre",{key:r.key},n("code",uf({},t.attrs,{className:t.lang?`lang-${t.lang}`:""}),t.text))},[gf]:{match:kg(im),order:0,parse:t=>({attrs:a("code",t[3]||""),lang:t[2]||void 0,text:t[4].replace(qm,"$1"),type:mf})},[yf]:{match:wg(om),order:3,parse:t=>({text:t[2].replace(qm,"$1")}),render:(t,e,r)=>n("code",{key:r.key},t.text)},[vf]:{match:kg(cm),order:0,parse:t=>(o.push({footnote:t[2],identifier:t[1]}),{}),render:zg},[xf]:{match:_g(um),order:1,parse:t=>({target:`#${r.slugify(t[1],mg)}`,text:t[1]}),render:(t,e,i)=>n("a",{key:i.key,href:r.sanitizer(t.target,"a","href")},n("sup",{key:i.key},t.text))},[bf]:{match:_g(pm),order:1,parse:t=>({completed:"x"===t[1].toLowerCase()}),render:(t,e,r)=>n("input",{checked:t.completed,key:r.key,readOnly:!0,type:"checkbox"})},[_f]:{match:kg(r.enforceAtxHeadings?mm:fm),order:1,parse:(t,e,n)=>({children:Cg(e,t[2],n),id:r.slugify(t[2],mg),level:t[1].length}),render:(t,e,r)=>n(`h${t.level}`,{id:t.id,key:r.key},e(t.children,r))},[wf]:{match:kg(gm),order:0,parse:(t,e,r)=>({children:Cg(e,t[1],r),level:"="===t[2]?1:2,type:_f})},[kf]:{match:Tg(ym),order:1,parse(t,e,r){const[,n]=t[3].match(Wm),i=new RegExp(`^${n}`,"gm"),o=t[3].replace(i,""),s=(l=o,pg.some((t=>t.test(l)))?Lg:Cg);var l;const c=t[1].toLowerCase(),u=-1!==Zf.indexOf(c),h=(u?c:t[1]).trim(),d={attrs:a(h,t[2]),noInnerParse:u,tag:h};return r.inAnchor=r.inAnchor||"a"===c,u?d.text=t[3]:d.children=s(e,o,r),r.inAnchor=!1,d},render:(t,e,r)=>n(t.tag,uf({key:r.key},t.attrs),t.text||(t.children?e(t.children,r):""))},[Sf]:{match:Tg(_m),order:1,parse(t){const e=t[1].trim();return{attrs:a(e,t[2]||""),tag:e}},render:(t,e,r)=>n(t.tag,uf({},t.attrs,{key:r.key}))},[Tf]:{match:Tg(xm),order:1,parse:()=>({}),render:zg},[Af]:{match:wg(hg),order:1,parse:t=>({alt:t[1],target:Mg(t[2]),title:t[3]}),render:(t,e,i)=>n("img",{key:i.key,alt:t.alt||void 0,title:t.title||void 0,src:r.sanitizer(t.target,"img","src")})},[Mf]:{match:_g(ug),order:3,parse:(t,e,r)=>({children:Eg(e,t[1],r),target:Mg(t[2]),title:t[3]}),render:(t,e,i)=>n("a",{key:i.key,href:r.sanitizer(t.target,"a","href"),title:t.title},e(t.children,i))},[Cf]:{match:_g(Sm),order:0,parse:t=>({children:[{text:t[1],type:Bf}],target:t[1],type:Mf})},[Ef]:{match:bg(((t,e)=>e.inAnchor||r.disableAutoLink?null:_g(km)(t,e))),order:0,parse:t=>({children:[{text:t[1],type:Bf}],target:t[1],title:void 0,type:Mf})},[Lf]:{match:_g(Tm),order:0,parse(t){let e=t[1],r=t[1];return Kf.test(r)||(r="mailto:"+r),{children:[{text:e.replace("mailto:",""),type:Bf}],target:r,type:Mf}}},[If]:cg(n,1),[$f]:cg(n,2),[Pf]:{match:kg(sm),order:3,parse:Ig,render:()=>"\n"},[zf]:{match:bg(Sg),order:3,parse:Pg,render:(t,e,r)=>n("p",{key:r.key},e(t.children,r))},[Of]:{match:_g(Cm),order:0,parse:t=>(s[t[1]]={target:t[2],title:t[4]},{}),render:zg},[Df]:{match:wg(Em),order:0,parse:t=>({alt:t[1]||void 0,ref:t[2]}),render:(t,e,i)=>s[t.ref]?n("img",{key:i.key,alt:t.alt,src:r.sanitizer(s[t.ref].target,"img","src"),title:s[t.ref].title}):null},[Rf]:{match:_g(Lm),order:0,parse:(t,e,r)=>({children:e(t[1],r),fallbackChildren:t[0],ref:t[2]}),render:(t,e,i)=>s[t.ref]?n("a",{key:i.key,href:r.sanitizer(s[t.ref].target,"a","href"),title:s[t.ref].title},e(t.children,i)):n("span",{key:i.key},t.fallbackChildren)},[Ff]:{match:kg(Mm),order:1,parse:vg,render(t,e,r){const i=t;return n("table",{key:r.key},n("thead",null,n("tr",null,i.header.map((function(t,a){return n("th",{key:a,style:xg(i,a)},e(t,r))})))),n("tbody",null,i.cells.map((function(t,a){return n("tr",{key:a},t.map((function(t,a){return n("td",{key:a,style:xg(i,a)},e(t,r))})))}))))}},[Bf]:{match:Tg($m),order:4,parse:t=>({text:t[0].replace(vm,((t,e)=>r.namedCodesToUnicode[e]?r.namedCodesToUnicode[e]:t))}),render:t=>t.text},[jf]:{match:wg(Bm),order:2,parse:(t,e,r)=>({children:e(t[2],r)}),render:(t,e,r)=>n("strong",{key:r.key},e(t.children,r))},[Nf]:{match:wg(jm),order:3,parse:(t,e,r)=>({children:e(t[2],r)}),render:(t,e,r)=>n("em",{key:r.key},e(t.children,r))},[Uf]:{match:wg(Vm),order:1,parse:t=>({text:t[1],type:Bf})},[Vf]:{match:wg(Nm),order:3,parse:Pg,render:(t,e,r)=>n("mark",{key:r.key},e(t.children,r))},[qf]:{match:wg(Um),order:3,parse:Pg,render:(t,e,r)=>n("del",{key:r.key},e(t.children,r))}};!0===r.disableParsingRawHTML&&(delete l[kf],delete l[Sf]);const c=function(t){let e=Object.keys(t);function r(n,i){let a,o,s=[],l="",c="";for(i.prevCapture=i.prevCapture||"";n;){let u=0;for(;u<e.length;){if(l=e[u],a=t[l],i.inline&&!a.match.inline){u++;continue}const h=a.match(n,i);if(h){c=h[0],i.prevCapture+=c,n=n.substring(c.length),o=a.parse(h,r,i),null==o.type&&(o.type=l),s.push(o);break}u++}}return i.prevCapture="",s}return e.sort((function(e,r){let n=t[e].order,i=t[r].order;return n!==i?n-i:e<r?-1:1})),function(t,e){return r(function(t){return t.replace(lm,"\n").replace(hm,"").replace(Im," ")}(t),e)}}(l),u=(h=function(t,e){return function(r,n,i){const a=t[r.type].render;return e?e((()=>a(r,n,i)),r,n,i):a(r,n,i)}}(l,r.renderRule),function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)){const n=r.key,i=[];let a=!1;for(let o=0;o<e.length;o++){r.key=o;const n=t(e[o],r),s="string"==typeof n;s&&a?i[i.length-1]+=n:null!==n&&i.push(n),a=s}return r.key=n,i}return h(e,t,r)});var h;const d=i(e);return o.length?n("div",null,d,n("footer",{key:"footer"},o.map((function(t){return n("div",{id:r.slugify(t.identifier,mg),key:t.identifier},t.identifier,u(c(t.footnote,{inline:!0})))})))):d}const Fg=e=>{let{children:r="",options:n}=e,i=function(t,e){if(null==t)return{};var r,n,i={},a=Object.keys(t);for(n=0;n<a.length;n++)e.indexOf(r=a[n])>=0||(i[r]=t[r]);return i}(e,hf);return t.cloneElement(Rg(r,n),i)};var Bg=function(){return Bg=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Bg.apply(this,arguments)};function jg(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}"function"==typeof SuppressedError&&SuppressedError;var Ng=function(t){return(0,s.jsx)(zc,Bg({},t))};function Ug(t){return Ai("MuiLink",t)}const Vg=Mi("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),qg=t=>{let{theme:e,ownerState:r}=t;const n=r.color,i=le(e,`palette.${n}.main`,!1)||le(e,`palette.${n}`,!1)||r.color,a=le(e,`palette.${n}.mainChannel`)||le(e,`palette.${n}Channel`);return"vars"in e&&a?`rgba(${a} / 0.4)`:Tr(i,.4)},$g={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Hg=gi(uu,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`underline${Oi(r.underline)}`],"button"===r.component&&e.button]}})(wi((t=>{let{theme:e}=t;return{variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:t=>{let{underline:e,ownerState:r}=t;return"always"===e&&"inherit"!==r.color},style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{underline:"always",color:r},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.4)`:Tr(e.palette[r].main,.4)}}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Tr(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:Tr(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Vg.focusVisible}`]:{outline:"auto"}}}]}}))),Wg=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiLink"}),i=bi(),{className:a,color:o="primary",component:l="a",onBlur:c,onFocus:u,TypographyClasses:h,underline:d="always",variant:p="inherit",sx:f,...m}=n,[g,y]=t.useState(!1),v={...n,color:o,component:l,focusVisible:g,underline:d,variant:p},x=(t=>{const{classes:e,component:r,focusVisible:n,underline:i}=t;return Wn({root:["root",`underline${Oi(i)}`,"button"===r&&"button",n&&"focusVisible"]},Ug,e)})(v);return(0,s.jsx)(Hg,{color:o,className:Hn(x.root,a),classes:h,component:l,onBlur:t=>{pa(t.target)||y(!1),c&&c(t)},onFocus:t=>{pa(t.target)&&y(!0),u&&u(t)},ref:r,ownerState:v,variant:p,...m,sx:[...void 0===$g[o]?[{color:o}]:[],...Array.isArray(f)?f:[f]],style:{...m.style,..."always"===d&&"inherit"!==o&&!$g[o]&&{"--Link-underlineColor":qg({theme:i,ownerState:v})}}})})),Gg=Wg;function Yg(t){return Ai("MuiTableFooter",t)}Mi("MuiTableFooter",["root"]);const Zg=gi("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-footer-group"}),Xg={variant:"footer"},Kg="tfoot",Jg=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTableFooter"}),{className:n,component:i=Kg,...a}=r,o={...r,component:i},l=(t=>{const{classes:e}=t;return Wn({root:["root"]},Yg,e)})(o);return(0,s.jsx)(Wu.Provider,{value:Xg,children:(0,s.jsx)(Zg,{as:i,className:Hn(l.root,n),ref:e,role:i===Kg?null:"rowgroup",ownerState:o,...a})})}));var Qg=function(t){return(0,s.jsx)(uu,Bg({},t))},ty=function(t){var e=t.children,r=void 0===e?"":e,n=t.style,i=jg(t,["children","style"]);return(0,s.jsx)("pre",Bg({style:Bg({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},n)},i,{children:r}))},ey=function(t){var e=t.children,r=void 0===e?"":e,n=t.language,i=void 0===n?"tsx":n,a=t.Highlight,o=t.themes,l=t.theme,c=t.hideLineNumbers;return(0,s.jsx)(a,{code:r,language:i,theme:l||o.vsDark,children:function(e){var r=e.style,n=e.tokens,i=e.getLineProps,a=e.getTokenProps;return(0,s.jsx)("pre",{style:Bg(Bg({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},r),t.styles),children:n.map((function(t,e){return(0,s.jsxs)("div",Bg({},i({line:t}),{children:[!c&&(0,s.jsxs)("span",{children:[e+1," "]}),t.map((function(t,e){return(0,s.jsx)("span",Bg({},a({token:t})),e)}))]}),e)}))})}})},ry=function(t){var e=t.children,r=t.Highlight,n=t.themes,i=t.prismTheme,a=t.styles,o=t.hideLineNumbers;if(e&&e.props&&e.props.className&&e.props.className.startsWith("lang-")){var l=e.props.children,c=e.props.className?e.props.className.replace("lang-",""):"tsx";if("enableMermaid"in t&&t.enableMermaid&&"mermaid"===c){if(t.enableMermaid&&"DiagramComponent"in t&&t.DiagramComponent)return(0,s.jsx)(t.DiagramComponent,{enableMermaid:!0,mermaidConfig:t.mermaidConfig,children:l});console.error("Make sure you've passed the Diagram component to the MuiMarkdown properly, you can import it from 'mui-markdown/Diagram'.")}return r&&n?(0,s.jsx)(ey,{Highlight:r,themes:n,language:c,theme:i,styles:a,hideLineNumbers:o,children:l}):(0,s.jsx)(ty,{style:a,children:l})}return(0,s.jsx)(Ng,{component:"pre",sx:{whiteSpace:"pre-wrap"},children:e})},ny=function(t){return(0,s.jsx)(rh,Bg({},t,{sx:Bg({whiteSpace:"nowrap"},t.sx)}))},iy=function(t){return(0,s.jsx)(Hu,Bg({},t))},ay={a:function(t){return(0,s.jsx)(Gg,Bg({},t))},blockquote:function(t){var e=t.children;return(0,s.jsx)(Ng,{component:"blockquote",dir:"auto",sx:{borderInlineStart:"3px solid",paddingInlineStart:"1.5rem",borderColor:"text.secondary",m:"0.25rem 0"},children:e})},code:function(t){var e=t.children,r=t.style,n=jg(t,["children","style"]);return(0,s.jsx)("code",Bg({style:Bg({backgroundColor:"rgba(126, 125, 124, 0.1)",borderRadius:"0.25rem",padding:"0.25rem 0.5rem"},r)},n,{children:e}))},h1:function(t){var e=t.children,r=t.component,n=void 0===r?"h1":r,i=t.variant,a=void 0===i?"h1":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},h2:function(t){var e=t.children,r=t.component,n=void 0===r?"h2":r,i=t.variant,a=void 0===i?"h2":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},h3:function(t){var e=t.children,r=t.component,n=void 0===r?"h3":r,i=t.variant,a=void 0===i?"h3":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},h4:function(t){var e=t.children,r=t.component,n=void 0===r?"h4":r,i=t.variant,a=void 0===i?"h4":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},h5:function(t){var e=t.children,r=t.component,n=void 0===r?"h5":r,i=t.variant,a=void 0===i?"h5":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},h6:function(t){var e=t.children,r=t.component,n=void 0===r?"h6":r,i=t.variant,a=void 0===i?"h6":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},hr:function(t){return(0,s.jsx)(vu,Bg({},t))},ol:function(t){var e=t.children,r=t.component,n=void 0===r?"ol":r,i=jg(t,["children","component"]);return(0,s.jsx)(Qg,Bg({component:n},i,{children:e}))},p:function(t){var e=t.children,r=t.component,n=void 0===r?"p":r,i=t.variant,a=void 0===i?"body1":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},pre:ry,span:function(t){var e=t.children,r=t.component,n=void 0===r?"span":r,i=t.variant,a=void 0===i?"body1":i,o=jg(t,["children","component","variant"]);return(0,s.jsx)(Qg,Bg({component:n,variant:a},o,{children:e}))},table:function(t){var e=t.children,r=t.sx,n=jg(t,["children","sx"]);return(0,s.jsx)(Ng,{sx:r?Bg({overflow:"auto"},r):function(t){var e=t.palette;return Bg({overflow:"auto"},function(t){return{"::-webkit-scrollbar":{width:"8px",height:"6px"},"::-webkit-scrollbar-track":{background:"dark"===t.mode?t.background.default:t.background.paper,borderRadius:"8px",overflow:"hidden"},"::-webkit-scrollbar-thumb":{background:Ar(t.background.default,.05),borderRadius:"8px"}}}(e))},children:(0,s.jsx)(Ng,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:(0,s.jsx)(iy,Bg({},n,{children:e}))})})},tbody:function(t){return(0,s.jsx)(Ku,Bg({},t))},td:ny,tfoot:function(t){return(0,s.jsx)(Jg,Bg({},t))},th:ny,thead:function(t){return(0,s.jsx)(uh,Bg({},t))},tr:function(t){return(0,s.jsx)(gh,Bg({},t))},ul:function(t){var e=t.children,r=t.component,n=void 0===r?"ul":r,i=jg(t,["children","component"]);return(0,s.jsx)(Qg,Bg({component:n},i,{children:e}))}},oy=function(t){void 0===t&&(t={});var e=t.overrides,r=jg(t,["overrides"]);return Bg(Bg(Bg({},ay),e),{pre:{component:ry,props:r}})},sy=function(t){var e=t.children,r=void 0===e?"":e,n=function(t){var e=t.options,r=t.overrides,n=oy(t);return e?e.overrides?e:Bg(Bg({},e),{overrides:n}):{overrides:r||n}}(t);return function(t){return"options"in t&&"overrides"in t}(t)&&console.error("Cannot set both 'options' and 'overrides' in the MuiMarkdown component props."),(0,s.jsx)(Fg,{options:n,children:r})},ly=(Bg({},ay),{"--w-rjv-font-family":"monospace","--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#9cdcfe","--w-rjv-background-color":"#1e1e1e","--w-rjv-line-color":"#36334280","--w-rjv-arrow-color":"#838383","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#9cdcfe","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#d4d4d4","--w-rjv-colon-color":"#d4d4d4","--w-rjv-brackets-color":"#d4d4d4","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#ce9178","--w-rjv-type-int-color":"#b5cea8","--w-rjv-type-float-color":"#b5cea8","--w-rjv-type-bigint-color":"#b5cea8","--w-rjv-type-boolean-color":"#569cd6","--w-rjv-type-date-color":"#b5cea8","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#569cd6","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#569cd6"}),cy=r(522),uy=r(53),hy=(r(1580),r(2598),r(958),r(8434),r(9711)),dy=(r(2596),r(634)),py=r(9945),fy=r(3957),my=r(3759),gy=r(7330),yy=r(700),vy="comm",xy="rule",by="decl",_y=Math.abs,wy=String.fromCharCode;Object.assign;function ky(t){return t.trim()}function Ty(t,e,r){return t.replace(e,r)}function Sy(t,e,r){return t.indexOf(e,r)}function Ay(t,e){return 0|t.charCodeAt(e)}function My(t,e,r){return t.slice(e,r)}function Cy(t){return t.length}function Ey(t,e){return e.push(t),t}function Ly(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function Py(t,e,r,n){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case"@namespace":case by:return t.return=t.return||t.value;case vy:return"";case"@keyframes":return t.return=t.value+"{"+Ly(t.children,n)+"}";case xy:if(!Cy(t.value=t.props.join(",")))return""}return Cy(r=Ly(t.children,n))?t.return=t.value+"{"+r+"}":""}var Iy=1,zy=1,Oy=0,Dy=0,Ry=0,Fy="";function By(t,e,r,n,i,a,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:Iy,column:zy,length:o,return:"",siblings:s}}function jy(){return Ry=Dy<Oy?Ay(Fy,Dy++):0,zy++,10===Ry&&(zy=1,Iy++),Ry}function Ny(){return Ay(Fy,Dy)}function Uy(){return Dy}function Vy(t,e){return My(Fy,t,e)}function qy(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $y(t){return Iy=zy=1,Oy=Cy(Fy=t),Dy=0,[]}function Hy(t){return Fy="",t}function Wy(t){return ky(Vy(Dy-1,Zy(91===t?t+2:40===t?t+1:t)))}function Gy(t){for(;(Ry=Ny())&&Ry<33;)jy();return qy(t)>2||qy(Ry)>3?"":" "}function Yy(t,e){for(;--e&&jy()&&!(Ry<48||Ry>102||Ry>57&&Ry<65||Ry>70&&Ry<97););return Vy(t,Uy()+(e<6&&32==Ny()&&32==jy()))}function Zy(t){for(;jy();)switch(Ry){case t:return Dy;case 34:case 39:34!==t&&39!==t&&Zy(Ry);break;case 40:41===t&&Zy(t);break;case 92:jy()}return Dy}function Xy(t,e){for(;jy()&&t+Ry!==57&&(t+Ry!==84||47!==Ny()););return"/*"+Vy(e,Dy-1)+"*"+wy(47===t?t:jy())}function Ky(t){for(;!qy(Ny());)jy();return Vy(t,Dy)}function Jy(t){return Hy(Qy("",null,null,null,[""],t=$y(t),0,[0],t))}function Qy(t,e,r,n,i,a,o,s,l){for(var c=0,u=0,h=o,d=0,p=0,f=0,m=1,g=1,y=1,v=0,x="",b=i,_=a,w=n,k=x;g;)switch(f=v,v=jy()){case 40:if(108!=f&&58==Ay(k,h-1)){-1!=Sy(k+=Ty(Wy(v),"&","&\f"),"&\f",_y(c?s[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:k+=Wy(v);break;case 9:case 10:case 13:case 32:k+=Gy(f);break;case 92:k+=Yy(Uy()-1,7);continue;case 47:switch(Ny()){case 42:case 47:Ey(ev(Xy(jy(),Uy()),e,r,l),l),5!=qy(f||1)&&5!=qy(Ny()||1)||!Cy(k)||" "===My(k,-1,void 0)||(k+=" ");break;default:k+="/"}break;case 123*m:s[c++]=Cy(k)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(k=Ty(k,/\f/g,"")),p>0&&(Cy(k)-h||0===m&&47===f)&&Ey(p>32?rv(k+";",n,r,h-1,l):rv(Ty(k," ","")+";",n,r,h-2,l),l);break;case 59:k+=";";default:if(Ey(w=tv(k,e,r,c,u,i,s,x,b=[],_=[],h,a),a),123===v)if(0===u)Qy(k,e,w,w,b,a,h,s,_);else{switch(d){case 99:if(110===Ay(k,3))break;case 108:if(97===Ay(k,2))break;default:u=0;case 100:case 109:case 115:}u?Qy(t,w,w,n&&Ey(tv(t,w,w,0,0,i,s,x,i,b=[],h,_),_),i,_,h,s,n?b:_):Qy(k,w,w,w,[""],_,0,s,_)}}c=u=p=0,m=y=1,x=k="",h=o;break;case 58:h=1+Cy(k),p=f;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==(Ry=Dy>0?Ay(Fy,--Dy):0,zy--,10===Ry&&(zy=1,Iy--),Ry))continue;switch(k+=wy(v),v*m){case 38:y=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(Cy(k)-1)*y,y=1;break;case 64:45===Ny()&&(k+=Wy(jy())),d=Ny(),u=h=Cy(x=k+=Ky(Uy())),v++;break;case 45:45===f&&2==Cy(k)&&(m=0)}}return a}function tv(t,e,r,n,i,a,o,s,l,c,u,h){for(var d=i-1,p=0===i?a:[""],f=function(t){return t.length}(p),m=0,g=0,y=0;m<n;++m)for(var v=0,x=My(t,d+1,d=_y(g=o[m])),b=t;v<f;++v)(b=ky(g>0?p[v]+" "+x:Ty(x,/&\f/g,p[v])))&&(l[y++]=b);return By(t,e,r,0===i?xy:s,l,c,u,h)}function ev(t,e,r,n){return By(t,e,r,vy,wy(Ry),My(t,2,-2),0,n)}function rv(t,e,r,n,i){return By(t,e,r,by,My(t,0,n),My(t,n+1,-1),n,i)}var nv=r(7977),iv=r(7590),av={id:"c4",detector:(0,my.K2)((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(732).then(r.bind(r,7732));return{id:"c4",diagram:t}}),"loader")},ov="flowchart",sv=(0,my.K2)(((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t)),"detector"),lv={id:ov,detector:sv,loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(467).then(r.bind(r,4467));return{id:ov,diagram:t}}),"loader")},cv="flowchart-v2",uv=(0,my.K2)(((t,e)=>"dagre-d3"!==e?.flowchart?.defaultRenderer&&("elk"===e?.flowchart?.defaultRenderer&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==e?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(t))),"detector"),hv={id:cv,detector:uv,loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(467).then(r.bind(r,4467));return{id:cv,diagram:t}}),"loader")},dv={id:"er",detector:(0,my.K2)((t=>/^\s*erDiagram/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(761).then(r.bind(r,3761));return{id:"er",diagram:t}}),"loader")},pv="gitGraph",fv={id:pv,detector:(0,my.K2)((t=>/^\s*gitGraph/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(358)]).then(r.bind(r,5358));return{id:pv,diagram:t}}),"loader")},mv="gantt",gv={id:mv,detector:(0,my.K2)((t=>/^\s*gantt/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(448).then(r.bind(r,3448));return{id:mv,diagram:t}}),"loader")},yv="info",vv={id:yv,detector:(0,my.K2)((t=>/^\s*info/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(461)]).then(r.bind(r,5461));return{id:yv,diagram:t}}),"loader")},xv={id:"pie",detector:(0,my.K2)((t=>/^\s*pie/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(109)]).then(r.bind(r,3490));return{id:"pie",diagram:t}}),"loader")},bv="quadrantChart",_v={id:bv,detector:(0,my.K2)((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(203).then(r.bind(r,5203));return{id:bv,diagram:t}}),"loader")},wv="xychart",kv={id:wv,detector:(0,my.K2)((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(621).then(r.bind(r,8621));return{id:wv,diagram:t}}),"loader")},Tv="requirement",Sv={id:Tv,detector:(0,my.K2)((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(320).then(r.bind(r,5320));return{id:Tv,diagram:t}}),"loader")},Av="sequence",Mv={id:Av,detector:(0,my.K2)((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(314).then(r.bind(r,9314));return{id:Av,diagram:t}}),"loader")},Cv="class",Ev=(0,my.K2)(((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t)),"detector"),Lv={id:Cv,detector:Ev,loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(35),r.e(972)]).then(r.bind(r,5972));return{id:Cv,diagram:t}}),"loader")},Pv="classDiagram",Iv=(0,my.K2)(((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t)),"detector"),zv={id:Pv,detector:Iv,loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(35),r.e(126)]).then(r.bind(r,2126));return{id:Pv,diagram:t}}),"loader")},Ov="state",Dv=(0,my.K2)(((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t)),"detector"),Rv={id:Ov,detector:Dv,loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(62),r.e(355),r.e(147)]).then(r.bind(r,8147));return{id:Ov,diagram:t}}),"loader")},Fv="stateDiagram",Bv=(0,my.K2)(((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer)),"detector"),jv={id:Fv,detector:Bv,loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(355),r.e(807)]).then(r.bind(r,2807));return{id:Fv,diagram:t}}),"loader")},Nv="journey",Uv={id:Nv,detector:(0,my.K2)((t=>/^\s*journey/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(859).then(r.bind(r,1859));return{id:Nv,diagram:t}}),"loader")},Vv=(0,my.K2)(((t,e,r)=>{my.Rm.debug("rendering svg for syntax error\n");const n=(0,fy.D)(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,my.a$)(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)}),"draw"),qv={draw:Vv},$v=qv,Hv={db:{},renderer:qv,parser:{parse:(0,my.K2)((()=>{}),"parse")}},Wv="flowchart-elk",Gv=(0,my.K2)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!(/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0)}),"detector"),Yv={id:Wv,detector:Gv,loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(467).then(r.bind(r,4467));return{id:Wv,diagram:t}}),"loader")},Zv="timeline",Xv={id:Zv,detector:(0,my.K2)((t=>/^\s*timeline/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(282).then(r.bind(r,5282));return{id:Zv,diagram:t}}),"loader")},Kv="mindmap",Jv={id:Kv,detector:(0,my.K2)((t=>/^\s*mindmap/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(646),r.e(255)]).then(r.bind(r,3255));return{id:Kv,diagram:t}}),"loader")},Qv="kanban",tx={id:Qv,detector:(0,my.K2)((t=>/^\s*kanban/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(922).then(r.bind(r,2922));return{id:Qv,diagram:t}}),"loader")},ex="sankey",rx={id:ex,detector:(0,my.K2)((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await r.e(370).then(r.bind(r,370));return{id:ex,diagram:t}}),"loader")},nx="packet",ix={id:nx,detector:(0,my.K2)((t=>/^\s*packet-beta/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(674)]).then(r.bind(r,4674));return{id:nx,diagram:t}}),"loader")},ax="radar",ox={id:ax,detector:(0,my.K2)((t=>/^\s*radar-beta/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(622)]).then(r.bind(r,6622));return{id:ax,diagram:t}}),"loader")},sx="block",lx={id:sx,detector:(0,my.K2)((t=>/^\s*block-beta/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(824)]).then(r.bind(r,7824));return{id:sx,diagram:t}}),"loader")},cx="architecture",ux={id:cx,detector:(0,my.K2)((t=>/^\s*architecture/.test(t)),"detector"),loader:(0,my.K2)((async()=>{const{diagram:t}=await Promise.all([r.e(854),r.e(502),r.e(646),r.e(415)]).then(r.bind(r,415));return{id:cx,diagram:t}}),"loader")},hx=!1,dx=(0,my.K2)((()=>{hx||(hx=!0,(0,my.Js)("error",Hv,(t=>"error"===t.toLowerCase().trim())),(0,my.Js)("---",{db:{clear:(0,my.K2)((()=>{}),"clear")},styles:{},renderer:{draw:(0,my.K2)((()=>{}),"draw")},parser:{parse:(0,my.K2)((()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")}),"parse")},init:(0,my.K2)((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),(0,my.Xd)(av,tx,zv,Lv,dv,gv,vv,xv,Sv,Mv,Yv,hv,lv,Jv,Xv,fv,jv,Rv,Uv,_v,rx,ix,kv,lx,ux,ox))}),"addDiagrams"),px=(0,my.K2)((async()=>{my.Rm.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(my.mW).map((async t=>{let[e,{detector:r,loader:n}]=t;if(n)try{(0,my.Gs)(e)}catch{try{const{diagram:t,id:e}=await n();(0,my.Js)(e,t,r)}catch(i){throw my.Rm.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete my.mW[e],i}}})))).filter((t=>"rejected"===t.status));if(t.length>0){my.Rm.error(`Failed to load ${t.length} external diagrams`);for(const e of t)my.Rm.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams");function fx(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function mx(t,e,r,n){if(void 0!==t.insert){if(r){const e=`chart-desc-${n}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(r)}if(e){const r=`chart-title-${n}`;t.attr("aria-labelledby",r),t.insert("title",":first-child").attr("id",r).text(e)}}}(0,my.K2)(fx,"setA11yDiagramInfo"),(0,my.K2)(mx,"addSVGa11yTitleDescription");var gx=class t{constructor(t,e,r,n,i){this.type=t,this.text=e,this.db=r,this.parser=n,this.renderer=i}static#t=(()=>(0,my.K2)(this,"Diagram"))();static async fromText(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,my.zj)(),i=(0,my.Ch)(e,n);e=(0,dy.C4)(e)+"\n";try{(0,my.Gs)(i)}catch{const t=(0,my.J$)(i);if(!t)throw new my.C0(`Diagram ${i} not found.`);const{id:e,diagram:r}=await t();(0,my.Js)(e,r)}const{db:a,parser:o,renderer:s,init:l}=(0,my.Gs)(i);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(n),r.title&&a.setDiagramTitle?.(r.title),await o.parse(e),new t(i,e,a,o,s)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},yx=[],vx=(0,my.K2)((()=>{yx.forEach((t=>{t()})),yx=[]}),"attachFunctions"),xx=(0,my.K2)((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function bx(t){const e=t.match(my.EJ);if(!e)return{text:t,metadata:{}};let r=(0,cy.H)(e[1],{schema:cy.r})??{};r="object"!==typeof r||Array.isArray(r)?{}:r;const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}(0,my.K2)(bx,"extractFrontMatter");var _x=(0,my.K2)((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),wx=(0,my.K2)((t=>{const{text:e,metadata:r}=bx(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}}),"processFrontmatter"),kx=(0,my.K2)((t=>{const e=dy._K.detectInit(t)??{},r=dy._K.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some((t=>{let{type:e}=t;return"wrap"===e})):"wrap"===r?.type&&(e.wrap=!0),{text:(0,dy.vU)(t),directive:e}}),"processDirectives");function Tx(t){const e=_x(t),r=wx(e),n=kx(r.text),i=(0,dy.$t)(r.config,n.directive);return{code:t=xx(n.text),title:r.title,config:i}}function Sx(t){const e=(new TextEncoder).encode(t),r=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(r)}(0,my.K2)(Tx,"preprocessDiagram"),(0,my.K2)(Sx,"toBase64");var Ax=["foreignobject"],Mx=["dominant-baseline"];function Cx(t){const e=Tx(t);return(0,my.cL)(),(0,my.xA)(e.config??{}),e}async function Ex(t,e){dx();try{const{code:e,config:r}=Cx(t);return{diagramType:(await Nx(e)).type,config:r}}catch(r){if(e?.suppressErrors)return!1;throw r}}(0,my.K2)(Cx,"processAndSetConfigs"),(0,my.K2)(Ex,"parse");var Lx=(0,my.K2)((function(t,e){return`\n.${t} ${e} { ${(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).join(" !important; ")} !important; }`}),"cssImportantStyles"),Px=(0,my.K2)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map,r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const n=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach((t=>{(0,iv.A)(t.styles)||n.forEach((e=>{r+=Lx(t.id,e,t.styles)})),(0,iv.A)(t.textStyles)||(r+=Lx(t.id,"tspan",(t?.textStyles||[]).map((t=>t.replace("color","fill")))))}))}return r}),"createCssStyles"),Ix=(0,my.K2)(((t,e,r,n)=>{const i=Px(t,r);return Ly(Jy(`${n}{${(0,my.tM)(e,i,t.themeVariables)}}`),Py)}),"createUserStyles"),zx=(0,my.K2)((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(arguments.length>2?arguments[2]:void 0)||(arguments.length>1?arguments[1]:void 0)||(t=t.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),t=(0,dy.Sm)(t),t=t.replace(/<br>/g,"<br/>"),t}),"cleanUpSvgCode"),Ox=(0,my.K2)((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return`<iframe style="width:100%;height:${e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":"100%"};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${Sx(`<body style="margin:0">${t}</body>`)}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n The "iframe" tag is not supported by your browser.\n</iframe>`}),"putIntoIFrame"),Dx=(0,my.K2)(((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const o=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&o.attr("xmlns:xlink",i),o.append("g"),t}),"appendDivSvgG");function Rx(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,my.K2)(Rx,"sandboxedIframe");var Fx=(0,my.K2)(((t,e,r,n)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(n)?.remove()}),"removeExistingElements"),Bx=(0,my.K2)((async function(t,e,r){dx();const n=Cx(e);e=n.code;const i=(0,my.zj)();my.Rm.debug(i),e.length>(i?.maxTextSize??5e4)&&(e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const a="#"+t,o="i"+t,s="#"+o,l="d"+t,c="#"+l,u=(0,my.K2)((()=>{const t=d?s:c,e=(0,yy.Ltv)(t).node();e&&"remove"in e&&e.remove()}),"removeTempElements");let h=(0,yy.Ltv)("body");const d="sandbox"===i.securityLevel,p="loose"===i.securityLevel,f=i.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),d){const t=Rx((0,yy.Ltv)(r),o);h=(0,yy.Ltv)(t.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=(0,yy.Ltv)(r);Dx(h,t,l,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(Fx(document,t,l,o),d){const t=Rx((0,yy.Ltv)("body"),o);h=(0,yy.Ltv)(t.nodes()[0].contentDocument.body),h.node().style.margin=0}else h=(0,yy.Ltv)("body");Dx(h,t,l)}let m,g;try{m=await gx.fromText(e,{title:n.title})}catch(C){if(i.suppressErrorRendering)throw u(),C;m=await gx.fromText("error"),g=C}const y=h.select(c).node(),v=m.type,x=y.firstChild,b=x.firstChild,_=m.renderer.getClasses?.(e,m),w=Ix(i,v,_,a),k=document.createElement("style");k.innerHTML=w,x.insertBefore(k,b);try{await m.renderer.draw(e,t,py.n.version,m)}catch(Wf){throw i.suppressErrorRendering?u():$v.draw(e,t,py.n.version),Wf}const T=h.select(`${c} svg`),S=m.db.getAccTitle?.(),A=m.db.getAccDescription?.();Ux(v,T,S,A),h.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let M=h.select(c).node().innerHTML;if(my.Rm.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),M=zx(M,d,(0,my._3)(i.arrowMarkerAbsolute)),d){const t=h.select(c+" svg").node();M=Ox(M,t)}else p||(M=nv.A.sanitize(M,{ADD_TAGS:Ax,ADD_ATTR:Mx,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(vx(),g)throw g;return u(),{diagramType:v,svg:M,bindFunctions:m.db.bindFunctions}}),"render");function jx(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(0,my.hH)({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),(0,my.wZ)(e),e?.theme&&e.theme in my.H$?e.themeVariables=my.H$[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=my.H$.default.getThemeVariables(e.themeVariables));const r="object"===typeof e?(0,my.UU)(e):(0,my.Q2)();(0,my.He)(r.logLevel),dx()}(0,my.K2)(jx,"initialize");var Nx=(0,my.K2)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{code:r}=Tx(t);return gx.fromText(r,e)}),"getDiagramFromText");function Ux(t,e,r,n){fx(e,t),mx(e,r,n,e.attr("id"))}(0,my.K2)(Ux,"addA11yInfo");var Vx=Object.freeze({render:Bx,parse:Ex,getDiagramFromText:Nx,initialize:jx,getConfig:my.zj,setConfig:my.Nk,getSiteConfig:my.Q2,updateSiteConfig:my.B6,reset:(0,my.K2)((()=>{(0,my.cL)()}),"reset"),globalReset:(0,my.K2)((()=>{(0,my.cL)(my.sb)}),"globalReset"),defaultConfig:my.sb});(0,my.He)((0,my.zj)().logLevel),(0,my.cL)((0,my.zj)());var qx=(0,my.K2)(((t,e,r)=>{my.Rm.warn(t),(0,dy.dq)(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))}),"handleError"),$x=(0,my.K2)((async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{querySelector:".mermaid"};try{await Hx(t)}catch(Wf){if((0,dy.dq)(Wf)&&my.Rm.error(Wf.str),rb.parseError&&rb.parseError(Wf),!t.suppressErrors)throw my.Rm.error("Use the suppressErrors option to suppress these errors"),Wf}}),"run"),Hx=(0,my.K2)((async function(){let{postRenderCallback:t,querySelector:e,nodes:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{querySelector:".mermaid"};const n=Vx.getConfig();let i;if(my.Rm.debug((t?"":"No ")+"Callback function found"),r)i=r;else{if(!e)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(e)}my.Rm.debug(`Found ${i.length} diagrams`),void 0!==n?.startOnLoad&&(my.Rm.debug("Start On Load: "+n?.startOnLoad),Vx.updateSiteConfig({startOnLoad:n?.startOnLoad}));const a=new dy._K.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const s=[];for(const c of Array.from(i)){if(my.Rm.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const e=`mermaid-${a.next()}`;o=c.innerHTML,o=(0,gy.T)(dy._K.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const r=dy._K.detectInit(o);r&&my.Rm.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:n}=await eb(e,o,c);c.innerHTML=r,t&&await t(e),n&&n(c)}catch(l){qx(l,s,rb.parseError)}}if(s.length>0)throw s[0]}),"runThrowsErrors"),Wx=(0,my.K2)((function(t){Vx.initialize(t)}),"initialize"),Gx=(0,my.K2)((async function(t,e,r){my.Rm.warn("mermaid.init is deprecated. Please use run instead."),t&&Wx(t);const n={postRenderCallback:r,querySelector:".mermaid"};"string"===typeof e?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await $x(n)}),"init"),Yx=(0,my.K2)((async function(t){let{lazyLoad:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dx(),(0,my.Xd)(...t),!1===e&&await px()}),"registerExternalDiagrams"),Zx=(0,my.K2)((function(){if(rb.startOnLoad){const{startOnLoad:t}=Vx.getConfig();t&&rb.run().catch((t=>my.Rm.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!==typeof document&&window.addEventListener("load",Zx,!1);var Xx=(0,my.K2)((function(t){rb.parseError=t}),"setParseErrorHandler"),Kx=[],Jx=!1,Qx=(0,my.K2)((async()=>{if(!Jx){for(Jx=!0;Kx.length>0;){const t=Kx.shift();if(t)try{await t()}catch(Wf){my.Rm.error("Error executing queue",Wf)}}Jx=!1}}),"executeQueue"),tb=(0,my.K2)((async(t,e)=>new Promise(((r,n)=>{const i=(0,my.K2)((()=>new Promise(((i,a)=>{Vx.parse(t,e).then((t=>{i(t),r(t)}),(t=>{my.Rm.error("Error parsing",t),rb.parseError?.(t),a(t),n(t)}))}))),"performCall");Kx.push(i),Qx().catch(n)}))),"parse"),eb=(0,my.K2)(((t,e,r)=>new Promise(((n,i)=>{const a=(0,my.K2)((()=>new Promise(((a,o)=>{Vx.render(t,e,r).then((t=>{a(t),n(t)}),(t=>{my.Rm.error("Error parsing",t),rb.parseError?.(t),o(t),i(t)}))}))),"performCall");Kx.push(a),Qx().catch(i)}))),"render"),rb={startOnLoad:!0,mermaidAPI:Vx,parse:tb,render:eb,init:Gx,run:$x,registerExternalDiagrams:Yx,registerLayoutLoaders:uy.sO,initialize:Wx,parseError:void 0,contentLoaded:Zx,setParseErrorHandler:Xx,detectType:my.Ch,registerIconPacks:hy.pC},nb=rb;const ib=(e,r,n)=>{const i=(0,t.useRef)(n),a=(0,t.useRef)(null),o=(0,t.useRef)(null);(0,t.useEffect)((()=>{i.current=n}),[n]),(0,t.useEffect)((()=>{const t=e.current,n=null===r||void 0===r?void 0:r.current;if(!t)return;const s=function(t,e){let r=null,n=0;const i=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];const s=Date.now();if(s-n>=e)return n=s,r&&(clearTimeout(r),r=null),void t(...a);r||(r=setTimeout((()=>{n=Date.now(),t(...a),r=null}),e-(s-n)))};return i.cancel=function(){r&&(clearTimeout(r),r=null)},i}((t=>{requestAnimationFrame((()=>i.current()))}),500),l=new ResizeObserver((t=>{s("resize")})),c=new MutationObserver((t=>{s("mutation")}));return l.observe(t),n&&l.observe(n),c.observe(t,{childList:!0,subtree:!0,characterData:!0}),a.current=l,o.current=c,()=>{s.cancel(),l.disconnect(),c.disconnect()}}),[e,r])},ab={startOnLoad:!0,securityLevel:"loose",fontFamily:"Fira Code"},ob=e=>{const{chart:r,sx:n,className:i,mermaidConfig:a}=e,[o,l]=(0,t.useState)(!1),c=(0,t.useRef)(null),u=(0,t.useCallback)((()=>{if(c.current){const{width:t,height:e}=c.current.getBoundingClientRect();t>0&&e>0&&l(!0)}}),[c,l]);return(0,t.useEffect)((()=>{(async()=>{if(c.current&&o&&r)try{await nb.initialize(a||ab),await nb.run({nodes:[c.current]})}catch(Wf){console.error("Mermaid render error:",Wf,c.current)}})()}),[c,a,o,r]),ib(c,null,u),(0,s.jsx)(zc,{className:i||"Mermaid",ref:c,sx:{display:"flex",flexGrow:1,...n},children:r})},sb=e=>{const{sx:r,className:n,children:i,autoscroll:a,textFieldRef:o,fallbackThreshold:l=.33,contentUpdateTrigger:c}=e,u=(0,t.useRef)(null),h=function(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.33,i=arguments.length>3?arguments[3]:void 0;const a=(0,t.useRef)(null),o=(0,t.useRef)(0),s=(0,t.useRef)(null),l=(0,t.useRef)(!1),c=(0,t.useCallback)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const i=a.current;if(!i)return;let o=!1;const s=e.current;if(s){const e=i.getBoundingClientRect(),n=s.getBoundingClientRect(),a=e.top,c=a+i.clientHeight,u=n.top<c&&n.bottom>a;o=(t||u)&&!l.current,o&&requestAnimationFrame((()=>{i.scrollTo({top:i.scrollHeight,behavior:r?"smooth":"auto"})}))}else{o=i.scrollHeight-i.scrollTop-i.clientHeight<=i.clientHeight*n&&!l.current,o&&requestAnimationFrame((()=>{i.scrollTo({top:i.scrollHeight,behavior:r?"smooth":"auto"})}))}}),[n,r,e]);return(0,t.useEffect)((()=>{const t=a.current,r=e.current;if(!t)return;const n=()=>{const e=t.scrollTop;l.current=e<o.current,o.current=e,s.current&&clearTimeout(s.current),s.current=setTimeout((()=>{l.current=!1}),500)},i=()=>{setTimeout((()=>{requestAnimationFrame((()=>c(!0)))}),0)};return t.addEventListener("scroll",n),r&&r.addEventListener("paste",i),c(),()=>{t.removeEventListener("scroll",n),r&&r.removeEventListener("paste",i),s.current&&clearTimeout(s.current)}}),[r,e,n,i,c]),ib(a,e,c),a}(null!==o&&void 0!==o?o:u,!0,l,c);return(0,s.jsx)(zc,{className:`Scrollable ${n||""}`,sx:{display:"flex",margin:"0 auto",flexGrow:1,overflow:"auto",...r},ref:void 0!==a&&!1!==a?h:void 0,children:i})};class lb extends Error{constructor(t,e){super("".concat(t," at position ").concat(e)),this.position=e}}function cb(t){return/^[0-9A-Fa-f]$/.test(t)}function ub(t){return t>="0"&&t<="9"}function hb(t){return t>=" "}function db(t){return",:[]/{}()\n+".includes(t)}function pb(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||"_"===t||"$"===t}function fb(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||"_"===t||"$"===t||t>="0"&&t<="9"}const mb=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,gb=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function yb(t){return",[]/{}\n+".includes(t)}function vb(t){return Tb(t)||xb.test(t)}const xb=/^[[{\w-]$/;function bb(t){return"\n"===t||"\r"===t||"\t"===t||"\b"===t||"\f"===t}function _b(t,e){const r=t.charCodeAt(e);return 32===r||10===r||9===r||13===r}function wb(t,e){const r=t.charCodeAt(e);return 32===r||9===r||13===r}function kb(t,e){const r=t.charCodeAt(e);return 160===r||r>=8192&&r<=8202||8239===r||8287===r||12288===r}function Tb(t){return Sb(t)||Mb(t)}function Sb(t){return'"'===t||"\u201c"===t||"\u201d"===t}function Ab(t){return'"'===t}function Mb(t){return"'"===t||"\u2018"===t||"\u2019"===t||"`"===t||"\xb4"===t}function Cb(t){return"'"===t}function Eb(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=t.lastIndexOf(e);return-1!==n?t.substring(0,n)+(r?"":t.substring(n+1)):t}function Lb(t,e){let r=t.length;if(!_b(t,r-1))return t+e;for(;_b(t,r-1);)r--;return t.substring(0,r)+e+t.substring(r)}function Pb(t,e,r){return t.substring(0,e)+t.substring(e+r)}const Ib={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},zb={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function Ob(t){let e=0,r="";l();i()||function(){throw new lb("Unexpected end of json string",t.length)}(),l();const n=c(",");for(n&&a(),vb(t[e])&&function(t){return/[,\n][ \t\r]*$/.test(t)}(r)?(n||(r=Lb(r,",")),function(){let t=!0,e=!0;for(;e;){if(t)t=!1;else{c(",")||(r=Lb(r,","))}e=i()}e||(r=Eb(r,","));r="[\n".concat(r,"\n]")}()):n&&(r=Eb(r,","));"}"===t[e]||"]"===t[e];)e++,a();if(e>=t.length)return r;function i(){a();const n=function(){if("{"===t[e]){r+="{",e++,a(),u(",")&&a();let n=!0;for(;e<t.length&&"}"!==t[e];){let o;n?(o=!0,n=!1):(o=c(","),o||(r=Lb(r,",")),a()),h();if(!(d()||m(!0))){"}"===t[e]||"{"===t[e]||"]"===t[e]||"["===t[e]||void 0===t[e]?r=Eb(r,","):b();break}a();const s=c(":"),l=e>=t.length;s||(vb(t[e])||l?r=Lb(r,":"):_());i()||(s||l?r+="null":_())}return"}"===t[e]?(r+="}",e++):r=Lb(r,"}"),!0}return!1}()||function(){if("["===t[e]){r+="[",e++,a(),u(",")&&a();let n=!0;for(;e<t.length&&"]"!==t[e];){if(n)n=!1;else{c(",")||(r=Lb(r,","))}h();if(!i()){r=Eb(r,",");break}}return"]"===t[e]?(r+="]",e++):r=Lb(r,"]"),!0}return!1}()||d()||function(){const n=e;if("-"===t[e]){if(e++,y())return v(n),!0;if(!ub(t[e]))return e=n,!1}for(;ub(t[e]);)e++;if("."===t[e]){if(e++,y())return v(n),!0;if(!ub(t[e]))return e=n,!1;for(;ub(t[e]);)e++}if("e"===t[e]||"E"===t[e]){if(e++,"-"!==t[e]&&"+"!==t[e]||e++,y())return v(n),!0;if(!ub(t[e]))return e=n,!1;for(;ub(t[e]);)e++}if(!y())return e=n,!1;if(e>n){const i=t.slice(n,e),a=/^0\d/.test(i);return r+=a?'"'.concat(i,'"'):i,!0}return!1}()||f("true","true")||f("false","false")||f("null","null")||f("True","true")||f("False","false")||f("None","null")||m(!1)||function(){if("/"===t[e]){const n=e;for(e++;e<t.length&&("/"!==t[e]||"\\"===t[e-1]);)e++;return e++,r+='"'.concat(t.substring(n,e),'"'),!0}}();return a(),n}function a(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const r=e;let n=o(t);do{n=s(),n&&(n=o(t))}while(n);return e>r}function o(n){const i=n?_b:wb;let a="";for(;;)if(i(t,e))a+=t[e],e++;else{if(!kb(t,e))break;a+=" ",e++}return a.length>0&&(r+=a,!0)}function s(){if("/"===t[e]&&"*"===t[e+1]){for(;e<t.length&&!Db(t,e);)e++;return e+=2,!0}if("/"===t[e]&&"/"===t[e+1]){for(;e<t.length&&"\n"!==t[e];)e++;return!0}return!1}function l(){if("```"===t.slice(e,e+3)){if(e+=3,pb(t[e]))for(;e<t.length&&fb(t[e]);)e++;return a(),!0}return!1}function c(n){return t[e]===n&&(r+=t[e],e++,!0)}function u(r){return t[e]===r&&(e++,!0)}function h(){return a(),"."===t[e]&&"."===t[e+1]&&"."===t[e+2]&&(e+=3,a(),u(","),!0)}function d(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,o="\\"===t[e];if(o&&(e++,o=!0),Tb(t[e])){const s=Ab(t[e])?Ab:Cb(t[e])?Cb:Mb(t[e])?Mb:Sb,l=e,c=r.length;let h='"';for(e++;;){if(e>=t.length){const i=g(e-1);return!n&&db(t.charAt(i))?(e=l,r=r.substring(0,c),d(!0)):(h=Lb(h,'"'),r+=h,!0)}if(e===i)return h=Lb(h,'"'),r+=h,!0;if(s(t[e])){const i=e,o=h.length;if(h+='"',e++,r+=h,a(!1),n||e>=t.length||db(t[e])||Tb(t[e])||ub(t[e]))return p(),!0;const s=g(i-1),u=t.charAt(s);if(","===u)return e=l,r=r.substring(0,c),d(!1,s);if(db(u))return e=l,r=r.substring(0,c),d(!0);r=r.substring(0,c),e=i+1,h="".concat(h.substring(0,o),"\\").concat(h.substring(o))}else{if(n&&yb(t[e])){if(":"===t[e-1]&&mb.test(t.substring(l+1,e+2)))for(;e<t.length&&gb.test(t[e]);)h+=t[e],e++;return h=Lb(h,'"'),r+=h,p(),!0}if("\\"===t[e]){const r=t.charAt(e+1);if(void 0!==zb[r])h+=t.slice(e,e+2),e+=2;else if("u"===r){let r=2;for(;r<6&&cb(t[e+r]);)r++;6===r?(h+=t.slice(e,e+6),e+=6):e+r>=t.length?e=t.length:w()}else h+=r,e+=2}else{const r=t.charAt(e);'"'===r&&"\\"!==t[e-1]?(h+="\\".concat(r),e++):bb(r)?(h+=Ib[r],e++):(hb(r)||x(r),h+=r,e++)}}o&&u("\\")}}return!1}function p(){let n=!1;for(a();"+"===t[e];){n=!0,e++,a(),r=Eb(r,'"',!0);const t=r.length,i=d();r=i?Pb(r,t,1):Lb(r,'"')}return n}function f(n,i){return t.slice(e,e+n.length)===n&&(r+=i,e+=n.length,!0)}function m(n){const a=e;if(pb(t[e])){for(;e<t.length&&fb(t[e]);)e++;let r=e;for(;_b(t,r);)r++;if("("===t[r])return e=r+1,i(),")"===t[e]&&(e++,";"===t[e]&&e++),!0}for(;e<t.length&&!yb(t[e])&&!Tb(t[e])&&(!n||":"!==t[e]);)e++;if(":"===t[e-1]&&mb.test(t.substring(a,e+2)))for(;e<t.length&&gb.test(t[e]);)e++;if(e>a){for(;_b(t,e-1)&&e>0;)e--;const n=t.slice(a,e);return r+="undefined"===n?"null":JSON.stringify(n),'"'===t[e]&&e++,!0}}function g(e){let r=e;for(;r>0&&_b(t,r);)r--;return r}function y(){return e>=t.length||db(t[e])||_b(t,e)}function v(n){r+="".concat(t.slice(n,e),"0")}function x(t){throw new lb("Invalid character ".concat(JSON.stringify(t)),e)}function b(){throw new lb("Object key expected",e)}function _(){throw new lb("Colon expected",e)}function w(){const r=t.slice(e,e+6);throw new lb('Invalid unicode character "'.concat(r,'"'),e)}!function(){throw new lb("Unexpected character ".concat(JSON.stringify(t[e])),e)}()}function Db(t,e){return"*"===t[e]&&"/"===t[e+1]}const Rb=t=>{const{className:e,content:r,submitQuery:n,sx:i}=t,a=bi(),o={pre:{component:t=>{var e,r;const{className:n}=t.children.props,i=(null===(e=t.children)||void 0===e||null===(r=e.props)||void 0===r?void 0:r.children)||"";if("lang-mermaid"===n)return(0,s.jsx)(ob,{className:"Mermaid",chart:i});if("lang-markdown"===n)return(0,s.jsx)(sy,{children:i});if("lang-json"===n)try{const t=Ob(i);return(0,s.jsx)(sb,{autoscroll:!0,className:"JsonViewScrollable",children:(0,s.jsx)(rf,{className:"JsonView",style:{...ly,fontSize:"0.8rem",maxHeight:"20rem",padding:"14px 0",overflow:"hidden",width:"100%",minHeight:"max-content",backgroundColor:"transparent"},displayDataTypes:!1,objectSortKeys:!1,collapsed:!1,value:JSON.parse(t),children:(0,s.jsx)(rf.String,{render:t=>{let{children:e,...r}=t;if("string"===typeof e&&e.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"flex",border:"none",...r.style},children:e})}})})})}catch(Wf){console.log("jsonrepair error",Wf)}return(0,s.jsx)("pre",{children:(0,s.jsx)("code",{className:n,children:t.children})})}},a:{component:Gg,props:{sx:{wordBreak:"break-all",color:a.palette.secondary.main,textDecoration:"none","&:hover":{color:a.palette.custom.highlight,textDecoration:"underline"}}}},chatQuery:void 0};return n&&(o.ChatQuery={component:nu,props:{submitQuery:n}}),(0,s.jsx)(zc,{className:`MuiMarkdown ${e||""}`,sx:{display:"flex",m:0,p:0,boxSizing:"border-box",flexGrow:1,height:"auto",...i},children:(0,s.jsx)(sy,{overrides:o,children:r})})};var Fb=r(537);function Bb(t){return parseInt(t,10)||0}const jb={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function Nb(t){return function(t){for(const e in t)return!1;return!0}(t)||0===t.outerHeightStyle&&!t.overflowing}const Ub=t.forwardRef((function(e,r){const{onChange:n,maxRows:i,minRows:a=1,style:o,value:l,...c}=e,{current:u}=t.useRef(null!=l),h=t.useRef(null),d=qi(r,h),p=t.useRef(null),f=t.useRef(null),m=t.useCallback((()=>{const t=h.current,r=f.current;if(!t||!r)return;const n=la(t).getComputedStyle(t);if("0px"===n.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const o=n.boxSizing,s=Bb(n.paddingBottom)+Bb(n.paddingTop),l=Bb(n.borderBottomWidth)+Bb(n.borderTopWidth),c=r.scrollHeight;r.value="x";const u=r.scrollHeight;let d=c;a&&(d=Math.max(Number(a)*u,d)),i&&(d=Math.min(Number(i)*u,d)),d=Math.max(d,u);return{outerHeightStyle:d+("border-box"===o?s+l:0),overflowing:Math.abs(d-c)<=1}}),[i,a,e.placeholder]),g=ma((()=>{const t=h.current,e=m();if(!t||!e||Nb(e))return!1;const r=e.outerHeightStyle;return null!=p.current&&p.current!==r})),y=t.useCallback((()=>{const t=h.current,e=m();if(!t||!e||Nb(e))return;const r=e.outerHeightStyle;p.current!==r&&(p.current=r,t.style.height=`${r}px`),t.style.overflow=e.overflowing?"hidden":""}),[m]),v=t.useRef(-1);sr((()=>{const t=na(y),e=h?.current;if(!e)return;const r=la(e);let n;return r.addEventListener("resize",t),"undefined"!==typeof ResizeObserver&&(n=new ResizeObserver((()=>{g()&&(n.unobserve(e),cancelAnimationFrame(v.current),y(),v.current=requestAnimationFrame((()=>{n.observe(e)})))})),n.observe(e)),()=>{t.clear(),cancelAnimationFrame(v.current),r.removeEventListener("resize",t),n&&n.disconnect()}}),[m,y,g]),sr((()=>{y()}));return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)("textarea",{value:l,onChange:t=>{u||y(),n&&n(t)},ref:d,rows:a,style:o,...c}),(0,s.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...jb,...o,paddingTop:0,paddingBottom:0}})]})})),Vb=Ub;const qb=function(t){return"string"===typeof t};function $b(t){let{props:e,states:r,muiFormControl:n}=t;return r.reduce(((t,r)=>(t[r]=e[r],n&&"undefined"===typeof e[r]&&(t[r]=n[r]),t)),{})}const Hb=t.createContext(void 0);function Wb(){return t.useContext(Hb)}function Gb(t){return null!=t&&!(Array.isArray(t)&&0===t.length)}function Yb(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t&&(Gb(t.value)&&""!==t.value||e&&Gb(t.defaultValue)&&""!==t.defaultValue)}function Zb(t){return Ai("MuiInputBase",t)}const Xb=Mi("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Kb;const Jb=(t,e)=>{const{ownerState:r}=t;return[e.root,r.formControl&&e.formControl,r.startAdornment&&e.adornedStart,r.endAdornment&&e.adornedEnd,r.error&&e.error,"small"===r.size&&e.sizeSmall,r.multiline&&e.multiline,r.color&&e[`color${Oi(r.color)}`],r.fullWidth&&e.fullWidth,r.hiddenLabel&&e.hiddenLabel]},Qb=(t,e)=>{const{ownerState:r}=t;return[e.input,"small"===r.size&&e.inputSizeSmall,r.multiline&&e.inputMultiline,"search"===r.type&&e.inputTypeSearch,r.startAdornment&&e.inputAdornedStart,r.endAdornment&&e.inputAdornedEnd,r.hiddenLabel&&e.inputHiddenLabel]},t_=gi("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Jb})(wi((t=>{let{theme:e}=t;return{...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Xb.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:t=>{let{ownerState:e}=t;return e.multiline},style:{padding:"4px 0 5px"}},{props:t=>{let{ownerState:e,size:r}=t;return e.multiline&&"small"===r},style:{paddingTop:1}},{props:t=>{let{ownerState:e}=t;return e.fullWidth},style:{width:"100%"}}]}}))),e_=gi("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Qb})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode,n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},i={opacity:"0 !important"},a=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Xb.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${Xb.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:t=>{let{ownerState:e}=t;return!e.disableInjectingGlobalStyles},style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:t=>{let{ownerState:e}=t;return e.multiline},style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}}))),r_=Rc({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),n_=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:a,autoFocus:o,className:l,color:c,components:u={},componentsProps:h={},defaultValue:d,disabled:p,disableInjectingGlobalStyles:f,endAdornment:m,error:g,fullWidth:y=!1,id:v,inputComponent:x="input",inputProps:b={},inputRef:_,margin:w,maxRows:k,minRows:T,multiline:S=!1,name:A,onBlur:M,onChange:C,onClick:E,onFocus:L,onKeyDown:P,onKeyUp:I,placeholder:z,readOnly:O,renderSuffix:D,rows:R,size:F,slotProps:B={},slots:j={},startAdornment:N,type:U="text",value:V,...q}=n,$=null!=b.value?b.value:V,{current:H}=t.useRef(null!=$),W=t.useRef(),G=t.useCallback((t=>{0}),[]),Y=fa(W,_,b.ref,G),[Z,X]=t.useState(!1),K=Wb();const J=$b({props:n,muiFormControl:K,states:["color","disabled","error","hiddenLabel","size","required","filled"]});J.focused=K?K.focused:Z,t.useEffect((()=>{!K&&p&&Z&&(X(!1),M&&M())}),[K,p,Z,M]);const Q=K&&K.onFilled,tt=K&&K.onEmpty,et=t.useCallback((t=>{Yb(t)?Q&&Q():tt&&tt()}),[Q,tt]);oa((()=>{H&&et({value:$})}),[$,et,H]);t.useEffect((()=>{et(W.current)}),[]);let rt=x,nt=b;S&&"input"===rt&&(nt=R?{type:void 0,minRows:R,maxRows:R,...nt}:{type:void 0,maxRows:k,minRows:T,...nt},rt=Vb);t.useEffect((()=>{K&&K.setAdornedStart(Boolean(N))}),[K,N]);const it={...n,color:J.color||"primary",disabled:J.disabled,endAdornment:m,error:J.error,focused:J.focused,formControl:K,fullWidth:y,hiddenLabel:J.hiddenLabel,multiline:S,size:J.size,startAdornment:N,type:U},at=(t=>{const{classes:e,color:r,disabled:n,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:h,size:d,startAdornment:p,type:f}=t;return Wn({root:["root",`color${Oi(r)}`,n&&"disabled",i&&"error",l&&"fullWidth",o&&"focused",s&&"formControl",d&&"medium"!==d&&`size${Oi(d)}`,u&&"multiline",p&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",h&&"readOnly"],input:["input",n&&"disabled","search"===f&&"inputTypeSearch",u&&"inputMultiline","small"===d&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",a&&"inputAdornedEnd",h&&"readOnly"]},Zb,e)})(it),ot=j.root||u.Root||t_,st=B.root||h.root||{},lt=j.input||u.Input||e_;return nt={...nt,...B.input??h.input},(0,s.jsxs)(t.Fragment,{children:[!f&&"function"===typeof r_&&(Kb||(Kb=(0,s.jsx)(r_,{}))),(0,s.jsxs)(ot,{...st,ref:r,onClick:t=>{W.current&&t.currentTarget===t.target&&W.current.focus(),E&&E(t)},...q,...!qb(ot)&&{ownerState:{...it,...st.ownerState}},className:Hn(at.root,st.className,l,O&&"MuiInputBase-readOnly"),children:[N,(0,s.jsx)(Hb.Provider,{value:null,children:(0,s.jsx)(lt,{"aria-invalid":J.error,"aria-describedby":i,autoComplete:a,autoFocus:o,defaultValue:d,disabled:J.disabled,id:v,onAnimationStart:t=>{et("mui-auto-fill-cancel"===t.animationName?W.current:{value:"x"})},name:A,placeholder:z,readOnly:O,required:J.required,rows:R,value:$,onKeyDown:P,onKeyUp:I,type:U,...nt,...!qb(lt)&&{as:rt,ownerState:{...it,...nt.ownerState}},ref:Y,className:Hn(at.input,nt.className,O&&"MuiInputBase-readOnly"),onBlur:t=>{M&&M(t),b.onBlur&&b.onBlur(t),K&&K.onBlur?K.onBlur(t):X(!1)},onChange:function(t){if(!H){const e=t.target||W.current;if(null==e)throw new Error(Zt(1));et({value:e.value})}for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];b.onChange&&b.onChange(t,...r),C&&C(t,...r)},onFocus:t=>{L&&L(t),b.onFocus&&b.onFocus(t),K&&K.onFocus?K.onFocus(t):X(!0)}})}),m,D?D({...J,startAdornment:N}):null]})]})})),i_=n_;function a_(t){return Ai("MuiInput",t)}const o_={...Xb,...Mi("MuiInput",["root","underline","input"])},s_=gi(t_,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...Jb(t,e),!r.disableUnderline&&e.underline]}})(wi((t=>{let{theme:e}=t;let r="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:t=>{let{ownerState:e}=t;return e.formControl},style:{"label + &":{marginTop:16}}},{props:t=>{let{ownerState:e}=t;return!e.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${o_.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${o_.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${o_.disabled}, .${o_.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${o_.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}}))]}}))),l_=gi(e_,{name:"MuiInput",slot:"Input",overridesResolver:Qb})({}),c_=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:h={},type:d="text",...p}=r,f=(t=>{const{classes:e,disableUnderline:r}=t,n=Wn({root:["root",!r&&"underline"],input:["input"]},a_,e);return{...e,...n}})(r),m={root:{ownerState:{disableUnderline:n}}},g=u??a?te(u??a,m):m,y=h.root??i.Root??s_,v=h.input??i.Input??l_;return(0,s.jsx)(i_,{slots:{root:y,input:v},slotProps:g,fullWidth:o,inputComponent:l,multiline:c,ref:e,type:d,...p,classes:f})}));c_.muiName="Input";const u_=c_;function h_(t){return Ai("MuiFilledInput",t)}const d_={...Xb,...Mi("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},p_=gi(t_,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[...Jb(t,e),!r.disableUnderline&&e.underline]}})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode,n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${d_.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${d_.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o},variants:[{props:t=>{let{ownerState:e}=t;return!e.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${d_.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${d_.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${d_.disabled}, .${d_.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${d_.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{disableUnderline:!1,color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r]?.main}`}}}})),{props:t=>{let{ownerState:e}=t;return e.startAdornment},style:{paddingLeft:12}},{props:t=>{let{ownerState:e}=t;return e.endAdornment},style:{paddingRight:12}},{props:t=>{let{ownerState:e}=t;return e.multiline},style:{padding:"25px 12px 8px"}},{props:t=>{let{ownerState:e,size:r}=t;return e.multiline&&"small"===r},style:{paddingTop:21,paddingBottom:4}},{props:t=>{let{ownerState:e}=t;return e.multiline&&e.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:t=>{let{ownerState:e}=t;return e.multiline&&e.hiddenLabel&&"small"===e.size},style:{paddingTop:8,paddingBottom:9}}]}}))),f_=gi(e_,{name:"MuiFilledInput",slot:"Input",overridesResolver:Qb})(wi((t=>{let{theme:e}=t;return{paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:t=>{let{ownerState:e}=t;return e.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:t=>{let{ownerState:e}=t;return e.startAdornment},style:{paddingLeft:0}},{props:t=>{let{ownerState:e}=t;return e.endAdornment},style:{paddingRight:0}},{props:t=>{let{ownerState:e}=t;return e.hiddenLabel&&"small"===e.size},style:{paddingTop:8,paddingBottom:9}},{props:t=>{let{ownerState:e}=t;return e.multiline},style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}}))),m_=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiFilledInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:h,slots:d={},type:p="text",...f}=r,m={...r,disableUnderline:n,fullWidth:o,inputComponent:c,multiline:u,type:p},g=(t=>{const{classes:e,disableUnderline:r,startAdornment:n,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=t,l=Wn({root:["root",!r&&"underline",n&&"adornedStart",i&&"adornedEnd","small"===a&&`size${Oi(a)}`,o&&"hiddenLabel",s&&"multiline"],input:["input"]},h_,e);return{...e,...l}})(r),y={root:{ownerState:m},input:{ownerState:m}},v=h??a?te(y,h??a):y,x=d.root??i.Root??p_,b=d.input??i.Input??f_;return(0,s.jsx)(i_,{slots:{root:x,input:b},slotProps:v,fullWidth:o,inputComponent:c,multiline:u,ref:e,type:p,...f,classes:g})}));m_.muiName="Input";const g_=m_;var y_;const v_=gi("fieldset",{shouldForwardProp:fi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),x_=gi("legend",{shouldForwardProp:fi})(wi((t=>{let{theme:e}=t;return{float:"unset",width:"auto",overflow:"hidden",variants:[{props:t=>{let{ownerState:e}=t;return!e.withLabel},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:t=>{let{ownerState:e}=t;return e.withLabel},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:t=>{let{ownerState:e}=t;return e.withLabel&&e.notched},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}})));function b_(t){return Ai("MuiOutlinedInput",t)}const __={...Xb,...Mi("MuiOutlinedInput",["root","notchedOutline","input"])},w_=gi(t_,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiOutlinedInput",slot:"Root",overridesResolver:Jb})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${__.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${__.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${__.focused} .${__.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{[`&.${__.focused} .${__.notchedOutline}`]:{borderColor:(e.vars||e).palette[r].main}}}})),{props:{},style:{[`&.${__.error} .${__.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${__.disabled} .${__.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:t=>{let{ownerState:e}=t;return e.startAdornment},style:{paddingLeft:14}},{props:t=>{let{ownerState:e}=t;return e.endAdornment},style:{paddingRight:14}},{props:t=>{let{ownerState:e}=t;return e.multiline},style:{padding:"16.5px 14px"}},{props:t=>{let{ownerState:e,size:r}=t;return e.multiline&&"small"===r},style:{padding:"8.5px 14px"}}]}}))),k_=gi((function(t){const{children:e,classes:r,className:n,label:i,notched:a,...o}=t,l=null!=i&&""!==i,c={...t,notched:a,withLabel:l};return(0,s.jsx)(v_,{"aria-hidden":!0,className:n,ownerState:c,...o,children:(0,s.jsx)(x_,{ownerState:c,children:l?(0,s.jsx)("span",{children:i}):y_||(y_=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"}))})})}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:r}}))),T_=gi(e_,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Qb})(wi((t=>{let{theme:e}=t;return{padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:t=>{let{ownerState:e}=t;return e.multiline},style:{padding:0}},{props:t=>{let{ownerState:e}=t;return e.startAdornment},style:{paddingLeft:0}},{props:t=>{let{ownerState:e}=t;return e.endAdornment},style:{paddingRight:0}}]}}))),S_=t.forwardRef((function(e,r){var n;const i=yi({props:e,name:"MuiOutlinedInput"}),{components:a={},fullWidth:o=!1,inputComponent:l="input",label:c,multiline:u=!1,notched:h,slots:d={},type:p="text",...f}=i,m=(t=>{const{classes:e}=t,r=Wn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},b_,e);return{...e,...r}})(i),g=Wb(),y=$b({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:g,fullWidth:o,hiddenLabel:y.hiddenLabel,multiline:u,size:y.size,type:p},x=d.root??a.Root??w_,b=d.input??a.Input??T_;return(0,s.jsx)(i_,{slots:{root:x,input:b},renderSuffix:e=>(0,s.jsx)(k_,{ownerState:v,className:m.notchedOutline,label:null!=c&&""!==c&&y.required?n||(n=(0,s.jsxs)(t.Fragment,{children:[c,"\u2009","*"]})):c,notched:"undefined"!==typeof h?h:Boolean(e.startAdornment||e.filled||e.focused)}),fullWidth:o,inputComponent:l,multiline:u,ref:r,type:p,...f,classes:{...m,notchedOutline:null}})}));S_.muiName="Input";const A_=S_;function M_(t){return Ai("MuiFormLabel",t)}const C_=Mi("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),E_=gi("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,"secondary"===r.color&&e.colorSecondary,r.filled&&e.filled]}})(wi((t=>{let{theme:e}=t;return{color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(bl()).map((t=>{let[r]=t;return{props:{color:r},style:{[`&.${C_.focused}`]:{color:(e.vars||e).palette[r].main}}}})),{props:{},style:{[`&.${C_.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${C_.error}`]:{color:(e.vars||e).palette.error.main}}}]}}))),L_=gi("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wi((t=>{let{theme:e}=t;return{[`&.${C_.error}`]:{color:(e.vars||e).palette.error.main}}}))),P_=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiFormLabel"}),{children:n,className:i,color:a,component:o="label",disabled:l,error:c,filled:u,focused:h,required:d,...p}=r,f=$b({props:r,muiFormControl:Wb(),states:["color","required","focused","disabled","error","filled"]}),m={...r,color:f.color||"primary",component:o,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required},g=(t=>{const{classes:e,color:r,focused:n,disabled:i,error:a,filled:o,required:s}=t;return Wn({root:["root",`color${Oi(r)}`,i&&"disabled",a&&"error",o&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]},M_,e)})(m);return(0,s.jsxs)(E_,{as:o,ownerState:m,className:Hn(g.root,i),ref:e,...p,children:[n,f.required&&(0,s.jsxs)(L_,{ownerState:m,"aria-hidden":!0,className:g.asterisk,children:["\u2009","*"]})]})})),I_=P_;function z_(t){return Ai("MuiInputLabel",t)}Mi("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const O_=gi(I_,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${C_.asterisk}`]:e.asterisk},e.root,r.formControl&&e.formControl,"small"===r.size&&e.sizeSmall,r.shrink&&e.shrink,!r.disableAnimation&&e.animated,r.focused&&e.focused,e[r.variant]]}})(wi((t=>{let{theme:e}=t;return{display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:t=>{let{ownerState:e}=t;return e.formControl},style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:t=>{let{ownerState:e}=t;return e.shrink},style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:t=>{let{ownerState:e}=t;return!e.disableAnimation},style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:t=>{let{variant:e,ownerState:r}=t;return"filled"===e&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:t=>{let{variant:e,ownerState:r,size:n}=t;return"filled"===e&&r.shrink&&"small"===n},style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:t=>{let{variant:e,ownerState:r}=t;return"outlined"===e&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}}))),D_=t.forwardRef((function(t,e){const r=yi({name:"MuiInputLabel",props:t}),{disableAnimation:n=!1,margin:i,shrink:a,variant:o,className:l,...c}=r,u=Wb();let h=a;"undefined"===typeof h&&u&&(h=u.filled||u.focused||u.adornedStart);const d=$b({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),p={...r,disableAnimation:n,formControl:u,shrink:h,size:d.size,variant:d.variant,required:d.required,focused:d.focused},f=(t=>{const{classes:e,formControl:r,size:n,shrink:i,disableAnimation:a,variant:o,required:s}=t,l=Wn({root:["root",r&&"formControl",!a&&"animated",i&&"shrink",n&&"medium"!==n&&`size${Oi(n)}`,o],asterisk:[s&&"asterisk"]},z_,e);return{...e,...l}})(p);return(0,s.jsx)(O_,{"data-shrink":h,ref:e,className:Hn(f.root,l),...c,ownerState:p,classes:f})}));const R_=function(e,r){return t.isValidElement(e)&&-1!==r.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)};function F_(t){return Ai("MuiFormControl",t)}Mi("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const B_=gi("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`margin${Oi(r.margin)}`],r.fullWidth&&e.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),j_=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiFormControl"}),{children:i,className:a,color:o="primary",component:l="div",disabled:c=!1,error:u=!1,focused:h,fullWidth:d=!1,hiddenLabel:p=!1,margin:f="none",required:m=!1,size:g="medium",variant:y="outlined",...v}=n,x={...n,color:o,component:l,disabled:c,error:u,fullWidth:d,hiddenLabel:p,margin:f,required:m,size:g,variant:y},b=(t=>{const{classes:e,margin:r,fullWidth:n}=t;return Wn({root:["root","none"!==r&&`margin${Oi(r)}`,n&&"fullWidth"]},F_,e)})(x),[_,w]=t.useState((()=>{let e=!1;return i&&t.Children.forEach(i,(t=>{if(!R_(t,["Input","Select"]))return;const r=R_(t,["Select"])?t.props.input:t;r&&r.props.startAdornment&&(e=!0)})),e})),[k,T]=t.useState((()=>{let e=!1;return i&&t.Children.forEach(i,(t=>{R_(t,["Input","Select"])&&(Yb(t.props,!0)||Yb(t.props.inputProps,!0))&&(e=!0)})),e})),[S,A]=t.useState(!1);c&&S&&A(!1);const M=void 0===h||c?S:h;let C;t.useRef(!1);const E=t.useCallback((()=>{T(!0)}),[]),L=t.useCallback((()=>{T(!1)}),[]),P=t.useMemo((()=>({adornedStart:_,setAdornedStart:w,color:o,disabled:c,error:u,filled:k,focused:M,fullWidth:d,hiddenLabel:p,size:g,onBlur:()=>{A(!1)},onFocus:()=>{A(!0)},onEmpty:L,onFilled:E,registerEffect:C,required:m,variant:y})),[_,o,c,u,k,M,d,p,C,L,E,m,g,y]);return(0,s.jsx)(Hb.Provider,{value:P,children:(0,s.jsx)(B_,{as:l,ownerState:x,className:Hn(b.root,a),ref:r,...v,children:i})})})),N_=j_;function U_(t){return Ai("MuiFormHelperText",t)}const V_=Mi("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var q_;const $_=gi("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.size&&e[`size${Oi(r.size)}`],r.contained&&e.contained,r.filled&&e.filled]}})(wi((t=>{let{theme:e}=t;return{color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${V_.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${V_.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:t=>{let{ownerState:e}=t;return e.contained},style:{marginLeft:14,marginRight:14}}]}}))),H_=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiFormHelperText"}),{children:n,className:i,component:a="p",disabled:o,error:l,filled:c,focused:u,margin:h,required:d,variant:p,...f}=r,m=$b({props:r,muiFormControl:Wb(),states:["variant","size","disabled","error","filled","focused","required"]}),g={...r,component:a,contained:"filled"===m.variant||"outlined"===m.variant,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete g.ownerState;const y=(t=>{const{classes:e,contained:r,size:n,disabled:i,error:a,filled:o,focused:s,required:l}=t;return Wn({root:["root",i&&"disabled",a&&"error",n&&`size${Oi(n)}`,r&&"contained",s&&"focused",o&&"filled",l&&"required"]},U_,e)})(g);return(0,s.jsx)($_,{as:a,className:Hn(y.root,i),ref:e,...f,ownerState:g,children:" "===n?q_||(q_=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):n})}));const W_=t.createContext({});function G_(t){return Ai("MuiList",t)}Mi("MuiList",["root","padding","dense","subheader"]);const Y_=gi("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disablePadding&&e.padding,r.dense&&e.dense,r.subheader&&e.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:t=>{let{ownerState:e}=t;return!e.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:t=>{let{ownerState:e}=t;return e.subheader},style:{paddingTop:0}}]}),Z_=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiList"}),{children:i,className:a,component:o="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...h}=n,d=t.useMemo((()=>({dense:l})),[l]),p={...n,component:o,dense:l,disablePadding:c},f=(t=>{const{classes:e,disablePadding:r,dense:n,subheader:i}=t;return Wn({root:["root",!r&&"padding",n&&"dense",i&&"subheader"]},G_,e)})(p);return(0,s.jsx)(W_.Provider,{value:d,children:(0,s.jsxs)(Y_,{as:o,className:Hn(f.root,a),ref:r,ownerState:p,...h,children:[u,i]})})})),X_=Fl;function K_(t,e,r){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:r?null:t.firstChild}function J_(t,e,r){return t===e?r?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:r?null:t.lastChild}function Q_(t,e){if(void 0===e)return!0;let r=t.innerText;return void 0===r&&(r=t.textContent),r=r.trim().toLowerCase(),0!==r.length&&(e.repeating?r[0]===e.keys[0]:r.startsWith(e.keys.join("")))}function tw(t,e,r,n,i,a){let o=!1,s=i(t,e,!!e&&r);for(;s;){if(s===t.firstChild){if(o)return!1;o=!0}const e=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Q_(s,a)&&!e)return s.focus(),!0;s=i(t,s,r)}return!1}const ew=t.forwardRef((function(e,r){const{actions:n,autoFocus:i=!1,autoFocusItem:a=!1,children:o,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:h,variant:d="selectedMenu",...p}=e,f=t.useRef(null),m=t.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});oa((()=>{i&&f.current.focus()}),[i]),t.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(t,e)=>{let{direction:r}=e;const n=!f.current.style.width;if(t.clientHeight<f.current.clientHeight&&n){const e=`${X_(ca(t))}px`;f.current.style["rtl"===r?"paddingLeft":"paddingRight"]=e,f.current.style.width=`calc(100% + ${e})`}return f.current}})),[]);const g=fa(f,r);let y=-1;t.Children.forEach(o,((e,r)=>{t.isValidElement(e)?(e.props.disabled||("selectedMenu"===d&&e.props.selected||-1===y)&&(y=r),y===r&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(y+=1,y>=o.length&&(y=-1))):y===r&&(y+=1,y>=o.length&&(y=-1))}));const v=t.Children.map(o,((e,r)=>{if(r===y){const r={};return a&&(r.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===d&&(r.tabIndex=0),t.cloneElement(e,r)}return e}));return(0,s.jsx)(Z_,{role:"menu",ref:g,className:l,onKeyDown:t=>{const e=f.current,r=t.key;if(t.ctrlKey||t.metaKey||t.altKey)return void(h&&h(t));const n=Qa(e).activeElement;if("ArrowDown"===r)t.preventDefault(),tw(e,n,u,c,K_);else if("ArrowUp"===r)t.preventDefault(),tw(e,n,u,c,J_);else if("Home"===r)t.preventDefault(),tw(e,null,u,c,K_);else if("End"===r)t.preventDefault(),tw(e,null,u,c,J_);else if(1===r.length){const i=m.current,a=r.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);const s=n&&!i.repeating&&Q_(n,i);i.previousKeyMatched&&(s||tw(e,n,!1,c,K_,i))?t.preventDefault():i.previousKeyMatched=!1}h&&h(t)},tabIndex:i?0:-1,...p,children:v})}));function rw(t){return Ai("MuiPopover",t)}Mi("MuiPopover",["root","paper"]);function nw(t,e){let r=0;return"number"===typeof e?r=e:"center"===e?r=t.height/2:"bottom"===e&&(r=t.height),r}function iw(t,e){let r=0;return"number"===typeof e?r=e:"center"===e?r=t.width/2:"right"===e&&(r=t.width),r}function aw(t){return[t.horizontal,t.vertical].map((t=>"number"===typeof t?`${t}px`:t)).join(" ")}function ow(t){return"function"===typeof t?t():t}const sw=gi(Xl,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),lw=gi(Li,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),cw=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiPopover"}),{action:i,anchorEl:a,anchorOrigin:o={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:h,container:d,elevation:p=8,marginThreshold:f=16,open:m,PaperProps:g={},slots:y={},slotProps:v={},transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:_="auto",TransitionProps:w={},disableScrollLock:k=!1,...T}=n,S=t.useRef(),A={...n,anchorOrigin:o,anchorReference:c,elevation:p,marginThreshold:f,transformOrigin:x,TransitionComponent:b,transitionDuration:_,TransitionProps:w},M=(t=>{const{classes:e}=t;return Wn({root:["root"],paper:["paper"]},rw,e)})(A),C=t.useCallback((()=>{if("anchorPosition"===c)return l;const t=ow(a),e=(t&&1===t.nodeType?t:Qa(S.current).body).getBoundingClientRect();return{top:e.top+nw(e,o.vertical),left:e.left+iw(e,o.horizontal)}}),[a,o.horizontal,o.vertical,l,c]),E=t.useCallback((t=>({vertical:nw(t,x.vertical),horizontal:iw(t,x.horizontal)})),[x.horizontal,x.vertical]),L=t.useCallback((t=>{const e={width:t.offsetWidth,height:t.offsetHeight},r=E(e);if("none"===c)return{top:null,left:null,transformOrigin:aw(r)};const n=C();let i=n.top-r.vertical,o=n.left-r.horizontal;const s=i+e.height,l=o+e.width,u=ca(ow(a)),h=u.innerHeight-f,d=u.innerWidth-f;if(null!==f&&i<f){const t=i-f;i-=t,r.vertical+=t}else if(null!==f&&s>h){const t=s-h;i-=t,r.vertical+=t}if(null!==f&&o<f){const t=o-f;o-=t,r.horizontal+=t}else if(l>d){const t=l-d;o-=t,r.horizontal+=t}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:aw(r)}}),[a,c,C,E,f]),[P,I]=t.useState(m),z=t.useCallback((()=>{const t=S.current;if(!t)return;const e=L(t);null!==e.top&&t.style.setProperty("top",e.top),null!==e.left&&(t.style.left=e.left),t.style.transformOrigin=e.transformOrigin,I(!0)}),[L]);t.useEffect((()=>(k&&window.addEventListener("scroll",z),()=>window.removeEventListener("scroll",z))),[a,k,z]);t.useEffect((()=>{m&&z()})),t.useImperativeHandle(i,(()=>m?{updatePosition:()=>{z()}}:null),[m,z]),t.useEffect((()=>{if(!m)return;const t=ia((()=>{z()})),e=ca(ow(a));return e.addEventListener("resize",t),()=>{t.clear(),e.removeEventListener("resize",t)}}),[a,m,z]);let O=_;const D={slots:{transition:b,...y},slotProps:{transition:w,paper:g,...v}},[R,F]=Xi("transition",{elementType:zo,externalForwardedProps:D,ownerState:A,getSlotProps:t=>({...t,onEntering:(e,r)=>{t.onEntering?.(e,r),z()},onExited:e=>{t.onExited?.(e),I(!1)}}),additionalProps:{appear:!0,in:m}});"auto"!==_||R.muiSupportAuto||(O=void 0);const B=d||(a?Qa(ow(a)).body:void 0),[j,{slots:N,slotProps:U,...V}]=Xi("root",{ref:r,elementType:sw,externalForwardedProps:{...D,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:ec("function"===typeof v.backdrop?v.backdrop(A):v.backdrop,{invisible:!0})},container:B,open:m},ownerState:A,className:Hn(M.root,h)}),[q,$]=Xi("paper",{ref:S,className:M.paper,elementType:lw,externalForwardedProps:D,shouldForwardComponentProp:!0,additionalProps:{elevation:p,style:P?void 0:{opacity:0}},ownerState:A});return(0,s.jsx)(j,{...V,...!qb(j)&&{slots:N,slotProps:U,disableScrollLock:k},children:(0,s.jsx)(R,{...F,timeout:O,children:(0,s.jsx)(q,{...$,children:u})})})})),uw=cw;function hw(t){return Ai("MuiMenu",t)}Mi("MuiMenu",["root","paper","list"]);const dw={vertical:"top",horizontal:"right"},pw={vertical:"top",horizontal:"left"},fw=gi(uw,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),mw=gi(lw,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),gw=gi(ew,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),yw=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:a,className:o,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:h,PaperProps:d={},PopoverClasses:p,transitionDuration:f="auto",TransitionProps:{onEntering:m,...g}={},variant:y="selectedMenu",slots:v={},slotProps:x={},...b}=n,_=Bt(),w={...n,autoFocus:i,disableAutoFocusItem:l,MenuListProps:c,onEntering:m,PaperProps:d,transitionDuration:f,TransitionProps:g,variant:y},k=(t=>{const{classes:e}=t;return Wn({root:["root"],paper:["paper"],list:["list"]},hw,e)})(w),T=i&&!l&&h,S=t.useRef(null);let A=-1;t.Children.map(a,((e,r)=>{t.isValidElement(e)&&(e.props.disabled||("selectedMenu"===y&&e.props.selected||-1===A)&&(A=r))}));const M={slots:v,slotProps:{list:c,transition:g,paper:d,...x}},C=ra({elementType:v.root,externalSlotProps:x.root,ownerState:w,className:[k.root,o]}),[E,L]=Xi("paper",{className:k.paper,elementType:mw,externalForwardedProps:M,shouldForwardComponentProp:!0,ownerState:w}),[P,I]=Xi("list",{className:Hn(k.list,c.className),elementType:gw,shouldForwardComponentProp:!0,externalForwardedProps:M,getSlotProps:t=>({...t,onKeyDown:e=>{(t=>{"Tab"===t.key&&(t.preventDefault(),u&&u(t,"tabKeyDown"))})(e),t.onKeyDown?.(e)}}),ownerState:w}),z="function"===typeof M.slotProps.transition?M.slotProps.transition(w):M.slotProps.transition;return(0,s.jsx)(fw,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:_?"right":"left"},transformOrigin:_?dw:pw,slots:{root:v.root,paper:E,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:C,paper:L,backdrop:"function"===typeof x.backdrop?x.backdrop(w):x.backdrop,transition:{...z,onEntering:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];((t,e)=>{S.current&&S.current.adjustStyleForScrollbar(t,{direction:_?"rtl":"ltr"}),m&&m(t,e)})(...e),z?.onEntering?.(...e)}}},open:h,ref:r,transitionDuration:f,ownerState:w,...b,classes:p,children:(0,s.jsx)(P,{actions:S,autoFocus:i&&(-1===A||l),autoFocusItem:T,variant:y,...I,children:a})})}));function vw(t){return Ai("MuiNativeSelect",t)}const xw=Mi("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),bw=gi("select")((t=>{let{theme:e}=t;return{MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${xw.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:t=>{let{ownerState:e}=t;return"filled"!==e.variant&&"outlined"!==e.variant},style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]}})),_w=gi(bw,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:fi,overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.select,e[r.variant],r.error&&e.error,{[`&.${xw.multiple}`]:e.multiple}]}})({}),ww=gi("svg")((t=>{let{theme:e}=t;return{position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${xw.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:t=>{let{ownerState:e}=t;return e.open},style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}})),kw=gi(ww,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Oi(r.variant)}`],r.open&&e.iconOpen]}})({}),Tw=t.forwardRef((function(e,r){const{className:n,disabled:i,error:a,IconComponent:o,inputRef:l,variant:c="standard",...u}=e,h={...e,disabled:i,variant:c,error:a},d=(t=>{const{classes:e,variant:r,disabled:n,multiple:i,open:a,error:o}=t;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"]},vw,e)})(h);return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)(_w,{ownerState:h,className:Hn(d.select,n),disabled:i,ref:l||r,...u}),e.multiple?null:(0,s.jsx)(kw,{as:o,ownerState:h,className:d.icon})]})}));function Sw(t){return Ai("MuiSelect",t)}const Aw=Mi("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Mw;const Cw=gi(bw,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`&.${Aw.select}`]:e.select},{[`&.${Aw.select}`]:e[r.variant]},{[`&.${Aw.error}`]:e.error},{[`&.${Aw.multiple}`]:e.multiple}]}})({[`&.${Aw.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ew=gi(ww,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.icon,r.variant&&e[`icon${Oi(r.variant)}`],r.open&&e.iconOpen]}})({}),Lw=gi("input",{shouldForwardProp:t=>pi(t)&&"classes"!==t,name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Pw(t,e){return"object"===typeof e&&null!==e?t===e:String(t)===String(e)}function Iw(t){return null==t||"string"===typeof t&&!t.trim()}const zw=t.forwardRef((function(e,r){const{"aria-describedby":n,"aria-label":i,autoFocus:a,autoWidth:o,children:l,className:c,defaultOpen:u,defaultValue:h,disabled:d,displayEmpty:p,error:f=!1,IconComponent:m,inputRef:g,labelId:y,MenuProps:v={},multiple:x,name:b,onBlur:_,onChange:w,onClose:k,onFocus:T,onOpen:S,open:A,readOnly:M,renderValue:C,required:E,SelectDisplayProps:L={},tabIndex:P,type:I,value:z,variant:O="standard",...D}=e,[R,F]=ll({controlled:z,default:h,name:"Select"}),[B,j]=ll({controlled:A,default:u,name:"Select"}),N=t.useRef(null),U=t.useRef(null),[V,q]=t.useState(null),{current:$}=t.useRef(null!=A),[H,W]=t.useState(),G=fa(r,g),Y=t.useCallback((t=>{U.current=t,t&&q(t)}),[]),Z=V?.parentNode;t.useImperativeHandle(G,(()=>({focus:()=>{U.current.focus()},node:N.current,value:R})),[R]),t.useEffect((()=>{u&&B&&V&&!$&&(W(o?null:Z.clientWidth),U.current.focus())}),[V,o]),t.useEffect((()=>{a&&U.current.focus()}),[a]),t.useEffect((()=>{if(!y)return;const t=Qa(U.current).getElementById(y);if(t){const e=()=>{getSelection().isCollapsed&&U.current.focus()};return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)}}}),[y]);const X=(t,e)=>{t?S&&S(e):k&&k(e),$||(W(o?null:Z.clientWidth),j(t))},K=t.Children.toArray(l),J=t=>e=>{let r;if(e.currentTarget.hasAttribute("tabindex")){if(x){r=Array.isArray(R)?R.slice():[];const e=R.indexOf(t.props.value);-1===e?r.push(t.props.value):r.splice(e,1)}else r=t.props.value;if(t.props.onClick&&t.props.onClick(e),R!==r&&(F(r),w)){const n=e.nativeEvent||e,i=new n.constructor(n.type,n);Object.defineProperty(i,"target",{writable:!0,value:{value:r,name:b}}),w(i,t)}x||X(!1,e)}},Q=null!==V&&B;let tt,et;delete D["aria-invalid"];const rt=[];let nt=!1,it=!1;(Yb({value:R})||p)&&(C?tt=C(R):nt=!0);const at=K.map((e=>{if(!t.isValidElement(e))return null;let r;if(x){if(!Array.isArray(R))throw new Error(Zt(2));r=R.some((t=>Pw(t,e.props.value))),r&&nt&&rt.push(e.props.children)}else r=Pw(R,e.props.value),r&&nt&&(et=e.props.children);return r&&(it=!0),t.cloneElement(e,{"aria-selected":r?"true":"false",onClick:J(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:r,value:void 0,"data-value":e.props.value})}));nt&&(tt=x?0===rt.length?null:rt.reduce(((t,e,r)=>(t.push(e),r<rt.length-1&&t.push(", "),t)),[]):et);let ot,st=H;!o&&$&&V&&(st=Z.clientWidth),ot="undefined"!==typeof P?P:d?null:0;const lt=L.id||(b?`mui-component-select-${b}`:void 0),ct={...e,variant:O,value:R,open:Q,error:f},ut=(t=>{const{classes:e,variant:r,disabled:n,multiple:i,open:a,error:o}=t;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]},Sw,e)})(ct),ht={...v.PaperProps,...v.slotProps?.paper},dt=ol();return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)(Cw,{as:"div",ref:Y,tabIndex:ot,role:"combobox","aria-controls":Q?dt:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":Q?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[y,lt].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":E?"true":void 0,"aria-invalid":f?"true":void 0,onKeyDown:t=>{if(!M){[" ","ArrowUp","ArrowDown","Enter"].includes(t.key)&&(t.preventDefault(),X(!0,t))}},onMouseDown:d||M?null:t=>{0===t.button&&(t.preventDefault(),U.current.focus(),X(!0,t))},onBlur:t=>{!Q&&_&&(Object.defineProperty(t,"target",{writable:!0,value:{value:R,name:b}}),_(t))},onFocus:T,...L,ownerState:ct,className:Hn(L.className,ut.select,c),id:lt,children:Iw(tt)?Mw||(Mw=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):tt}),(0,s.jsx)(Lw,{"aria-invalid":f,value:Array.isArray(R)?R.join(","):R,name:b,ref:N,"aria-hidden":!0,onChange:t=>{const e=K.find((e=>e.props.value===t.target.value));void 0!==e&&(F(e.props.value),w&&w(t,e))},tabIndex:-1,disabled:d,className:ut.nativeInput,autoFocus:a,required:E,...D,ownerState:ct}),(0,s.jsx)(Ew,{as:m,className:ut.icon,ownerState:ct}),(0,s.jsx)(yw,{id:`menu-${b||""}`,anchorEl:Z,open:Q,onClose:t=>{X(!1,t)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...v,slotProps:{...v.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":x?"true":void 0,disableListWrap:!0,id:dt,...v.MenuListProps},paper:{...ht,style:{minWidth:st,...null!=ht?ht.style:null}}},children:at})]})})),Ow=zw,Dw=ji((0,s.jsx)("path",{d:"M7 10l5 5 5-5z"})),Rw={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>fi(t)&&"variant"!==t,slot:"Root"},Fw=gi(u_,Rw)(""),Bw=gi(A_,Rw)(""),jw=gi(g_,Rw)(""),Nw=t.forwardRef((function(e,r){const n=yi({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:a,classes:o={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:h=Dw,id:d,input:p,inputProps:f,label:m,labelId:g,MenuProps:y,multiple:v=!1,native:x=!1,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:T,variant:S="outlined",...A}=n,M=x?Tw:Ow,C=$b({props:n,muiFormControl:Wb(),states:["variant","error"]}),E=C.variant||S,L={...n,variant:E,classes:o},P=(t=>{const{classes:e}=t,r=Wn({root:["root"]},Sw,e);return{...e,...r}})(L),{root:I,...z}=P,O=p||{standard:(0,s.jsx)(Fw,{ownerState:L}),outlined:(0,s.jsx)(Bw,{label:m,ownerState:L}),filled:(0,s.jsx)(jw,{ownerState:L})}[E],D=fa(r,go(O));return(0,s.jsx)(t.Fragment,{children:t.cloneElement(O,{inputComponent:M,inputProps:{children:a,error:C.error,IconComponent:h,variant:E,type:void 0,multiple:v,...x?{id:d}:{autoWidth:i,defaultOpen:c,displayEmpty:u,labelId:g,MenuProps:y,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:{id:d,...T}},...f,classes:f?te(z,f.classes):z,...p?p.props.inputProps:{}},...(v&&x||u)&&"outlined"===E?{notched:!0}:{},ref:D,className:Hn(O.props.className,l,P.root),...!p&&{variant:E},...A})})}));Nw.muiName="Select";const Uw=Nw;function Vw(t){return Ai("MuiTextField",t)}Mi("MuiTextField",["root"]);const qw={standard:u_,filled:g_,outlined:A_},$w=gi(N_,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Hw=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiTextField"}),{autoComplete:n,autoFocus:i=!1,children:a,className:o,color:l="primary",defaultValue:c,disabled:u=!1,error:h=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:f,id:m,InputLabelProps:g,inputProps:y,InputProps:v,inputRef:x,label:b,maxRows:_,minRows:w,multiline:k=!1,name:T,onBlur:S,onChange:A,onFocus:M,placeholder:C,required:E=!1,rows:L,select:P=!1,SelectProps:I,slots:z={},slotProps:O={},type:D,value:R,variant:F="outlined",...B}=r,j={...r,autoFocus:i,color:l,disabled:u,error:h,fullWidth:p,multiline:k,required:E,select:P,variant:F},N=(t=>{const{classes:e}=t;return Wn({root:["root"]},Vw,e)})(j);const U=ol(m),V=f&&U?`${U}-helper-text`:void 0,q=b&&U?`${U}-label`:void 0,$=qw[F],H={slots:z,slotProps:{input:v,inputLabel:g,htmlInput:y,formHelperText:d,select:I,...O}},W={},G=H.slotProps.inputLabel;"outlined"===F&&(G&&"undefined"!==typeof G.shrink&&(W.notched=G.shrink),W.label=b),P&&(I&&I.native||(W.id=void 0),W["aria-describedby"]=void 0);const[Y,Z]=Xi("root",{elementType:$w,shouldForwardComponentProp:!0,externalForwardedProps:{...H,...B},ownerState:j,className:Hn(N.root,o),ref:e,additionalProps:{disabled:u,error:h,fullWidth:p,required:E,color:l,variant:F}}),[X,K]=Xi("input",{elementType:$,externalForwardedProps:H,additionalProps:W,ownerState:j}),[J,Q]=Xi("inputLabel",{elementType:D_,externalForwardedProps:H,ownerState:j}),[tt,et]=Xi("htmlInput",{elementType:"input",externalForwardedProps:H,ownerState:j}),[rt,nt]=Xi("formHelperText",{elementType:H_,externalForwardedProps:H,ownerState:j}),[it,at]=Xi("select",{elementType:Uw,externalForwardedProps:H,ownerState:j}),ot=(0,s.jsx)(X,{"aria-describedby":V,autoComplete:n,autoFocus:i,defaultValue:c,fullWidth:p,multiline:k,name:T,rows:L,maxRows:_,minRows:w,type:D,value:R,id:U,inputRef:x,onBlur:S,onChange:A,onFocus:M,placeholder:C,inputProps:et,slots:{input:z.htmlInput?tt:void 0},...K});return(0,s.jsxs)(Y,{...Z,children:[null!=b&&""!==b&&(0,s.jsx)(J,{htmlFor:U,id:q,...Q,children:b}),P?(0,s.jsx)(it,{"aria-describedby":V,id:U,labelId:q,value:R,input:ot,...at,children:a}):ot,f&&(0,s.jsx)(rt,{id:V,...nt,children:f})]})})),Ww=Hw;function Gw(t){return Ai("MuiFormControlLabel",t)}const Yw=Mi("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Zw=gi("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${Yw.label}`]:e.label},e.root,e[`labelPlacement${Oi(r.labelPlacement)}`]]}})(wi((t=>{let{theme:e}=t;return{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Yw.disabled}`]:{cursor:"default"},[`& .${Yw.label}`]:{[`&.${Yw.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:t=>{let{labelPlacement:e}=t;return"start"===e||"top"===e||"bottom"===e},style:{marginLeft:16}}]}}))),Xw=gi("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(wi((t=>{let{theme:e}=t;return{[`&.${Yw.error}`]:{color:(e.vars||e).palette.error.main}}}))),Kw=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiFormControlLabel"}),{checked:i,className:a,componentsProps:o={},control:l,disabled:c,disableTypography:u,inputRef:h,label:d,labelPlacement:p="end",name:f,onChange:m,required:g,slots:y={},slotProps:v={},value:x,...b}=n,_=Wb(),w=c??l.props.disabled??_?.disabled,k=g??l.props.required,T={disabled:w,required:k};["checked","name","onChange","value","inputRef"].forEach((t=>{"undefined"===typeof l.props[t]&&"undefined"!==typeof n[t]&&(T[t]=n[t])}));const S=$b({props:n,muiFormControl:_,states:["error"]}),A={...n,disabled:w,labelPlacement:p,required:k,error:S.error},M=(t=>{const{classes:e,disabled:r,labelPlacement:n,error:i,required:a}=t;return Wn({root:["root",r&&"disabled",`labelPlacement${Oi(n)}`,i&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",i&&"error"]},Gw,e)})(A),C={slots:y,slotProps:{...o,...v}},[E,L]=Xi("typography",{elementType:uu,externalForwardedProps:C,ownerState:A});let P=d;return null==P||P.type===uu||u||(P=(0,s.jsx)(E,{component:"span",...L,className:Hn(M.label,L?.className),children:P})),(0,s.jsxs)(Zw,{className:Hn(M.root,a),ownerState:A,ref:r,...b,children:[t.cloneElement(l,T),k?(0,s.jsxs)("div",{children:[P,(0,s.jsxs)(Xw,{ownerState:A,"aria-hidden":!0,className:M.asterisk,children:["\u2009","*"]})]}):P]})}));function Jw(t){return Ai("PrivateSwitchBase",t)}Mi("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Qw=gi(Wa)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:t=>{let{edge:e,ownerState:r}=t;return"start"===e&&"small"!==r.size},style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:t=>{let{edge:e,ownerState:r}=t;return"end"===e&&"small"!==r.size},style:{marginRight:-12}}]}),tk=gi("input",{shouldForwardProp:fi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ek=t.forwardRef((function(t,e){const{autoFocus:r,checked:n,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:h,inputProps:d,inputRef:p,name:f,onBlur:m,onChange:g,onFocus:y,readOnly:v,required:x=!1,tabIndex:b,type:_,value:w,slots:k={},slotProps:T={},...S}=t,[A,M]=ll({controlled:n,default:Boolean(a),name:"SwitchBase",state:"checked"}),C=Wb();let E=o;C&&"undefined"===typeof E&&(E=C.disabled);const L="checkbox"===_||"radio"===_,P={...t,checked:A,disabled:E,disableFocusRipple:l,edge:c},I=(t=>{const{classes:e,checked:r,disabled:n,edge:i}=t;return Wn({root:["root",r&&"checked",n&&"disabled",i&&`edge${Oi(i)}`],input:["input"]},Jw,e)})(P),z={slots:k,slotProps:{input:d,...T}},[O,D]=Xi("root",{ref:e,elementType:Qw,className:I.root,shouldForwardComponentProp:!0,externalForwardedProps:{...z,component:"span",...S},getSlotProps:t=>({...t,onFocus:e=>{t.onFocus?.(e),(t=>{y&&y(t),C&&C.onFocus&&C.onFocus(t)})(e)},onBlur:e=>{t.onBlur?.(e),(t=>{m&&m(t),C&&C.onBlur&&C.onBlur(t)})(e)}}),ownerState:P,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:E,role:void 0,tabIndex:null}}),[R,F]=Xi("input",{ref:p,elementType:tk,className:I.input,externalForwardedProps:z,getSlotProps:t=>({...t,onChange:e=>{t.onChange?.(e),(t=>{if(t.nativeEvent.defaultPrevented)return;const e=t.target.checked;M(e),g&&g(t,e)})(e)}}),ownerState:P,additionalProps:{autoFocus:r,checked:n,defaultChecked:a,disabled:E,id:L?h:void 0,name:f,readOnly:v,required:x,tabIndex:b,type:_,..."checkbox"===_&&void 0===w?{}:{value:w}}});return(0,s.jsxs)(O,{...D,children:[(0,s.jsx)(R,{...F}),A?i:u]})})),rk=ek;function nk(t){return Ai("MuiSwitch",t)}const ik=Mi("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),ak=gi("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.edge&&e[`edge${Oi(r.edge)}`],e[`size${Oi(r.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${ik.thumb}`]:{width:16,height:16},[`& .${ik.switchBase}`]:{padding:4,[`&.${ik.checked}`]:{transform:"translateX(16px)"}}}}]}),ok=gi(rk,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.switchBase,{[`& .${ik.input}`]:e.input},"default"!==r.color&&e[`color${Oi(r.color)}`]]}})(wi((t=>{let{theme:e}=t;return{position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${ik.checked}`]:{transform:"translateX(20px)"},[`&.${ik.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${ik.checked} + .${ik.track}`]:{opacity:.5},[`&.${ik.disabled} + .${ik.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:""+("light"===e.palette.mode?.12:.2)},[`& .${ik.input}`]:{left:"-100%",width:"300%"}}})),wi((t=>{let{theme:e}=t;return{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(bl(["light"])).map((t=>{let[r]=t;return{props:{color:r},style:{[`&.${ik.checked}`]:{color:(e.vars||e).palette[r].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Tr(e.palette[r].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ik.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${r}DisabledColor`]:`${"light"===e.palette.mode?Cr(e.palette[r].main,.62):Ar(e.palette[r].main,.55)}`}},[`&.${ik.checked} + .${ik.track}`]:{backgroundColor:(e.vars||e).palette[r].main}}}}))]}}))),sk=gi("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(wi((t=>{let{theme:e}=t;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${"light"===e.palette.mode?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:""+("light"===e.palette.mode?.38:.3)}}))),lk=gi("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(wi((t=>{let{theme:e}=t;return{boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}}))),ck=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiSwitch"}),{className:n,color:i="primary",edge:a=!1,size:o="medium",sx:l,slots:c={},slotProps:u={},...h}=r,d={...r,color:i,edge:a,size:o},p=(t=>{const{classes:e,edge:r,size:n,color:i,checked:a,disabled:o}=t,s=Wn({root:["root",r&&`edge${Oi(r)}`,`size${Oi(n)}`],switchBase:["switchBase",`color${Oi(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},nk,e);return{...e,...s}})(d),f={slots:c,slotProps:u},[m,g]=Xi("root",{className:Hn(p.root,n),elementType:ak,externalForwardedProps:f,ownerState:d,additionalProps:{sx:l}}),[y,v]=Xi("thumb",{className:p.thumb,elementType:lk,externalForwardedProps:f,ownerState:d}),x=(0,s.jsx)(y,{...v}),[b,_]=Xi("track",{className:p.track,elementType:sk,externalForwardedProps:f,ownerState:d});return(0,s.jsxs)(m,{...g,children:[(0,s.jsx)(ok,{type:"checkbox",icon:x,checkedIcon:x,ref:e,ownerState:d,...h,classes:{...p,root:p.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...u.switchBase&&{root:"function"===typeof u.switchBase?u.switchBase(d):u.switchBase},...u.input&&{input:"function"===typeof u.input?u.input(d):u.input}}}),(0,s.jsx)(b,{..._})]})})),uk=ck,hk=t=>{const e=Math.min(...t),r=Math.max(...t)-e;return 0===r?t.map((()=>.5)):t.map((t=>(t-e)/r))},dk={query:"\ud83d\udd0d",resume:"\ud83d\udcc4",projects:"\ud83d\udcc1",jobs:"\ud83d\udcc1","performance-reviews":"\ud83d\udcc4",news:"\ud83d\udcf0"},pk={query:"#D4A017",resume:"#4A7A7D",projects:"#1A2536",news:"#D3CDBF","performance-reviews":"#FFD0D0",jobs:"#F3aD8F"},fk={query:10},mk={query:"circle"},gk=e=>{const{setSnack:r,rag:n,inline:i,connectionBase:a,sessionId:o,sx:l}=e,[c,u]=(0,t.useState)(null),[h,d]=(0,t.useState)(""),[p,f]=(0,t.useState)(void 0),[m,g]=(0,t.useState)(void 0),[y,v]=(0,t.useState)(!0),x=(0,t.useRef)(null),[b,_]=(0,t.useState)(null),w=bi(),k=qn(w.breakpoints.down("md"));if((0,t.useEffect)((()=>{if(void 0!==m&&m.dimensions!==(y?3:2)||void 0===o)return;(async()=>{try{const t=await fetch(a+`/api/umap/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dimensions:y?2:3})}),e=await t.json();e.dimensions=y?2:3,g(e)}catch(t){console.error("Error obtaining collection information:",t),r("Unable to obtain collection information.","error")}})()}),[m,g,a,r,o,y]),(0,t.useEffect)((()=>{if(!m||!m.embeddings)return;if(0===m.embeddings.length)return;const t=[...m.embeddings],e=[...m.documents||[]],r=[...m.metadatas||[]],i=[...m.ids||[]];let a=t.every((t=>2===t.length)),o=t.every((t=>3===t.length));if(y&&!a||!y&&!o)return;if(y&&n&&n.umap_embedding_2d&&(r.unshift({doc_type:"query"}),e.unshift("Query"),t.unshift(n.umap_embedding_2d)),!y&&n&&n.umap_embedding_3d&&(r.unshift({doc_type:"query"}),e.unshift("Query"),t.unshift(n.umap_embedding_3d)),void 0!==p&&(r.unshift({doc_type:"query"}),e.unshift(p.query||""),y&&p.umap_embedding_2d&&t.unshift(p.umap_embedding_2d),!y&&p.umap_embedding_3d&&t.unshift(p.umap_embedding_3d)),a=t.every((t=>2===t.length)),o=t.every((t=>3===t.length)),!a&&!o)return void console.warn("Modified vectors are neither 2D nor 3D");const s=r.map((t=>t.doc_type||"unknown")),l=s.map(((t,e)=>(fk[t]||(fk[t]=5),n&&n.ids.includes(i[e])||p&&p.ids&&p.ids.includes(i[e])?fk[t]+5:fk[t]))),c=s.map((t=>(mk[t]||(mk[t]="circle"),mk[t]))),h=s.map((t=>(pk[t]||(pk[t]="#ff0000"),pk[t]))),d=r.map(((t,r)=>({doc:e[r],type:t.doc_type||"unknown"}))),f=hk(t.map((t=>t[0]))),g=hk(t.map((t=>t[1]))),v=o?hk(t.map((t=>t[2]))):void 0,x={x:f,y:g,mode:"markers",marker:{size:l,symbol:c,color:h,opacity:.8},customdata:d,type:null!==v&&void 0!==v&&v.length?"scatter3d":"scatter"};o&&(x.z=v),u({data:x,layout:{autosize:!0,paper_bgcolor:"#FFFFFF",plot_bgcolor:"#FFFFFF",font:{family:"Roboto, sans-serif",color:"#2E2E2E"},hovermode:"closest",scene:{bgcolor:"#FFFFFF",zaxis:{title:"Z",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"}},xaxis:{title:"X",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},yaxis:{title:"Y",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},margin:{r:0,b:0,l:0,t:0}}})}),[m,p,n,y,u,r]),void 0===r)return console.error("setSnack function is undefined"),null;const T=async t=>{if(t.trim()){d("");try{const e=await fetch(`${a}/api/similarity/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t,dimensions:y?2:3})}),r=await e.json();f(r)}catch(e){console.error("Error obtaining query similarity information:",e),r("Unable to obtain query similarity information.","error")}}};return c&&void 0!==o?(0,s.jsxs)(zi,{className:"VectorVisualizer",sx:{display:"flex",position:"relative",flexDirection:"column",flexGrow:1,...l},children:[!i&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",flexGrow:0,minHeight:"2.5rem",maxHeight:"2.5rem",height:"2.5rem",justifyContent:"center",alignItems:"center",m:0,p:0,mb:1},children:"RAG Vector Visualization"}),(0,s.jsxs)(zi,{sx:{p:0,m:0,display:"flex",flexGrow:1,position:"relative",flexDirection:k?"column":"row"},children:[(0,s.jsxs)(zc,{sx:{p:0,m:0,display:"flex",flexGrow:1,position:"relative",flexDirection:"column"},children:[(0,s.jsxs)(zc,{sx:{borderBottom:"1px solid #2E2E2E",p:0,m:0,display:"flex",flexGrow:0,height:k?"auto":"320px",minHeight:k?"auto":"320px",maxHeight:k?"auto":"320px",position:"relative",flexDirection:"column"},children:[(0,s.jsx)(Kw,{sx:{display:"flex",position:"relative",width:"fit-content",ml:1,mb:"-2.5rem",zIndex:100,flexBasis:0,flexGrow:0},control:(0,s.jsx)(uk,{checked:!y}),onChange:()=>v(!y),label:"3D"}),(0,s.jsx)(Fb.A,{ref:x,onClick:t=>{const e=t.points[0];console.log("Point:",e);const r=e.customdata.type,n=e.customdata.doc,i=dk[r]||"\u2753";var a;_({visible:!0,background:e["marker.color"],color:(a=e["marker.color"],.299*parseInt(a.slice(1,3),16)+.587*parseInt(a.slice(3,5),16)+.114*parseInt(a.slice(5,7),16)>186?"#2E2E2E":"#FFFFFF"),content:`${i} ${r.toUpperCase()}\n${n}`})},data:[c.data],useResizeHandler:!0,config:{responsive:!0,displaylogo:!1,showSendToCloud:!1,staticPlot:!1},style:{display:"flex",flexGrow:1,minHeight:"240px",padding:0,margin:0,width:"100%",height:"100%"},layout:c.layout})]}),!i&&p&&(0,s.jsx)(sb,{sx:{display:"flex",position:"relative",width:"100%",flexGrow:1,height:"max-content",backgroundColor:"white"},children:(0,s.jsx)(rf,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:p,style:{padding:"14px 0",fontSize:"0.8rem",overflow:"hidden",width:"100%",minHeight:"max-content"}})}),!i&&!p&&(0,s.jsx)(zc,{sx:{p:1},children:"Enter query below to view distances."})]}),!i&&(0,s.jsx)(sb,{sx:{borderLeft:k?"none":"1px solid #2E2E2E",display:"flex",flexDirection:"column",flexGrow:k?1:.5,width:k?"100%":"600px",maxWidth:k?"100%":"600px",mt:0,p:.5,color:(null===b||void 0===b?void 0:b.color)||"#2E2E2E",background:(null===b||void 0===b?void 0:b.background)||"#FFFFFF",whiteSpace:"pre-line",zIndex:1e3,overflow:"auto",overflowWrap:"break-all",wordBreak:"break-all"},children:(0,s.jsx)(Rb,{sx:{p:1,pt:0},content:(null===b||void 0===b?void 0:b.content)||"Select a node in the visualization."})})]}),!i&&void 0!==p&&(0,s.jsxs)(zi,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",flexGrow:0,minHeight:"2.5rem",maxHeight:"2.5rem",height:"2.5rem",alignItems:"center",mt:1,pb:0},children:["Query: ",p.query]}),!i&&(0,s.jsxs)(zc,{className:"Query",sx:{display:"flex",flexDirection:"row",p:1},children:[(0,s.jsx)(Ww,{variant:"outlined",fullWidth:!0,type:"text",value:h,onChange:t=>d(t.target.value),onKeyDown:t=>{"Enter"===t.key&&T(h)},placeholder:"Enter query to find related documents...",id:"QueryInput"}),(0,s.jsx)(xl,{title:"Send",children:(0,s.jsx)(ru,{sx:{m:1},variant:"contained",onClick:()=>{T(h)},children:(0,s.jsx)(hu,{})})})]})]}):(0,s.jsx)(zc,{sx:{display:"flex",flexGrow:1,justifyContent:"center",alignItems:"center"},children:(0,s.jsx)("div",{children:"Loading visualization..."})})},yk=ji((0,s.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),vk=ji((0,s.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),xk=e=>{let{content:r,sx:n}=e;const[i,a]=(0,t.useState)(!1);return(0,s.jsx)(xl,{title:"Copy to clipboard",placement:"top",arrow:!0,children:(0,s.jsx)(Cc,{onClick:()=>{void 0!==r&&navigator.clipboard.writeText(r.trim()).then((()=>{a(!0),setTimeout((()=>a(!1)),2e3)}))},sx:{width:24,height:24,opacity:.75,bgcolor:"background.paper","&:hover":{bgcolor:"action.hover",opacity:1},...n},size:"small",color:i?"success":"default",children:i?(0,s.jsx)(vk,{sx:{width:16,height:16}}):(0,s.jsx)(yk,{sx:{width:16,height:16}})})})},bk=t=>{const{rag:e,tools:r,eval_count:n,eval_duration:i,prompt_eval_count:a,prompt_eval_duration:o}=t.metadata||{},l=t.messageProps.message;let c="<|system|>\n";return c+=l.system_prompt+"\n\n",c+=l.context_prompt,(0,s.jsxs)(s.Fragment,{children:[0!==o&&0!==i&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(ah,{component:zi,className:"PromptStats",sx:{mb:1},children:(0,s.jsxs)(Hu,{"aria-label":"prompt stats",size:"small",children:[(0,s.jsx)(uh,{children:(0,s.jsxs)(gh,{children:[(0,s.jsx)(rh,{}),(0,s.jsx)(rh,{align:"right",children:"Tokens"}),(0,s.jsx)(rh,{align:"right",children:"Time (s)"}),(0,s.jsx)(rh,{align:"right",children:"TPS"})]})}),(0,s.jsxs)(Ku,{children:[(0,s.jsxs)(gh,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(rh,{component:"th",scope:"row",children:"Prompt"}),(0,s.jsx)(rh,{align:"right",children:a}),(0,s.jsx)(rh,{align:"right",children:Math.round(o/10**7)/100}),(0,s.jsx)(rh,{align:"right",children:Math.round(a*10**9/o)})]},"prompt"),(0,s.jsxs)(gh,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(rh,{component:"th",scope:"row",children:"Response"}),(0,s.jsx)(rh,{align:"right",children:n}),(0,s.jsx)(rh,{align:"right",children:Math.round(i/10**7)/100}),(0,s.jsx)(rh,{align:"right",children:Math.round(n*10**9/i)})]},"response"),(0,s.jsxs)(gh,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(rh,{component:"th",scope:"row",children:"Total"}),(0,s.jsx)(rh,{align:"right",children:a+n}),(0,s.jsx)(rh,{align:"right",children:Math.round((o+i)/10**7)/100}),(0,s.jsx)(rh,{align:"right",children:Math.round((a+n)*10**9/(o+i))})]},"total")]})]})})}),void 0!==r&&r.tool_calls&&0!==r.tool_calls.length&&(0,s.jsxs)(Lu,{sx:{boxSizing:"border-box"},children:[(0,s.jsx)(Ru,{expandIcon:(0,s.jsx)(kh,{}),children:(0,s.jsx)(zc,{sx:{fontSize:"0.8rem"},children:"Tools queried"})}),(0,s.jsx)(ju,{children:r.tool_calls.map(((t,e)=>(0,s.jsxs)(zc,{sx:{m:0,p:1,pt:0,display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"},children:[0!==e&&(0,s.jsx)(vu,{}),(0,s.jsx)(zc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"column",mt:1,mb:1,fontWeight:"bold"},children:t.name}),(0,s.jsx)(rf,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:JSON.parse(t.content),style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(rf.String,{render:t=>{let{children:e,...r}=t;if("string"===typeof e&&e.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"flex",border:"none",...r.style},children:e})}})})]},e)))})]}),e.map((e=>(0,s.jsxs)(Lu,{children:[(0,s.jsx)(Ru,{expandIcon:(0,s.jsx)(kh,{}),children:(0,s.jsxs)(zc,{sx:{fontSize:"0.8rem"},children:["Top RAG ",e.ids.length," matches from '",e.name,"' collection against embedding vector of ",e.query_embedding.length," dimensions"]})}),(0,s.jsxs)(ju,{children:[(0,s.jsxs)(zc,{sx:{fontSize:"0.8rem"},children:["UMAP Vector Visualization of '",e.name,"' RAG"]}),(0,s.jsx)(gk,{inline:!0,...t.messageProps,...t.metadata,rag:e}),e.ids.map(((t,r)=>(0,s.jsxs)(zc,{children:[(0,s.jsx)(vu,{}),(0,s.jsxs)(zc,{sx:{whiteSpace:"nowrap",fontSize:"0.75rem",p:0,m:0,pt:.5},children:["Doc ID: ",e.ids[r]]}),(0,s.jsxs)(zc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"row",mb:.5,mt:.5},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingRight:"1rem",minWidth:"10rem"},children:[(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Distance: ",Math.round(100*e.distances[r])/100]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Type: ",e.metadatas[r].doc_type]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Chunk Len: ",e.documents[r].length]})]}),(0,s.jsx)("div",{style:{display:"flex",padding:"3px",flexGrow:1,border:"1px solid #E0E0E0",maxHeight:"5rem",overflow:"auto"},children:e.documents[r]})]})]},r)))]})]},e.name))),(0,s.jsxs)(Lu,{children:[(0,s.jsx)(Ru,{expandIcon:(0,s.jsx)(kh,{}),children:(0,s.jsx)(zc,{sx:{fontSize:"0.8rem"},children:"Full Response Details"})}),(0,s.jsxs)(ju,{children:[(0,s.jsxs)(zc,{sx:{pb:1},children:["Copy LLM submission: ",(0,s.jsx)(xk,{content:c})]}),(0,s.jsx)(rf,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:l,style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(rf.String,{render:t=>{let{children:e,...r}=t;if("string"===typeof e&&e.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"inline",border:"none",...r.style},children:e.trim()})}})})]})]})]})},_k=e=>{const{message:r,submitQuery:n,sx:i,className:a,onExpand:o}=e,[l,c]=(0,t.useState)(!1),u=(0,t.useRef)(null),h=()=>{c(!l)};if(void 0===r)return(0,s.jsx)(s.Fragment,{});if(void 0===r.content)return console.info("Message content is undefined"),(0,s.jsx)(s.Fragment,{});const d=r.content.trim()||"Waiting for LLM to spool up...";return(0,s.jsxs)(cf,{className:a||"Message",...r,onExpand:o,sx:{display:"flex",flexDirection:"column",pb:r.metadata?0:"8px",m:0,mt:1,marginBottom:"0px !important",...i},children:[(0,s.jsx)(xh,{ref:u,sx:{position:"relative",display:"flex",flexDirection:"column",overflowX:"auto",m:0,p:0,paddingBottom:"0px !important"},children:"user"!==r.role?(0,s.jsx)(sb,{className:"MessageContent",autoscroll:!0,fallbackThreshold:.5,sx:{p:0,m:0,maxHeight:"streaming"===r.role?"20rem":"unset",display:"flex",flexGrow:1,overflow:"auto"},children:(0,s.jsx)(Rb,{content:d,submitQuery:n})}):(0,s.jsx)(uu,{className:"MessageContent",ref:u,variant:"body2",sx:{display:"flex",color:"text.secondary"},children:r.content})}),(0,s.jsxs)(wh,{disableSpacing:!0,sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",p:0,m:0},children:[(void 0===r.disableCopy||!1===r.disableCopy)&&["assistant","content"].includes(r.role)&&(0,s.jsx)(xk,{content:r.content}),r.metadata&&(0,s.jsxs)(zc,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(ru,{variant:"text",onClick:h,sx:{color:"darkgrey",p:0},children:"LLM information for this query"}),(0,s.jsx)(Th,{expand:l,onClick:h,"aria-expanded":l,"aria-label":"show more",children:(0,s.jsx)(kh,{})})]})]}),r.metadata&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(Tu,{in:l,timeout:"auto",unmountOnExit:!0,children:(0,s.jsx)(xh,{children:(0,s.jsx)(bk,{messageProps:e,metadata:r.metadata})})})})]})};function wk(t){return Ai("MuiDialog",t)}const kk=Mi("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const Tk=t.createContext({}),Sk=gi(Dl,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),Ak=gi(Xl,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Mk=gi("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.container,e[`scroll${Oi(r.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Ck=gi(Li,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.paper,e[`scrollPaper${Oi(r.scroll)}`],e[`paperWidth${Oi(String(r.maxWidth))}`],r.fullWidth&&e.paperFullWidth,r.fullScreen&&e.paperFullScreen]}})(wi((t=>{let{theme:e}=t;return{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:t=>{let{ownerState:e}=t;return!e.maxWidth},style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${kk.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter((t=>"xs"!==t)).map((t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${kk.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}}))),{props:t=>{let{ownerState:e}=t;return e.fullWidth},style:{width:"calc(100% - 64px)"}},{props:t=>{let{ownerState:e}=t;return e.fullScreen},style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${kk.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}}))),Ek=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiDialog"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:h,children:d,className:p,disableEscapeKeyDown:f=!1,fullScreen:m=!1,fullWidth:g=!1,maxWidth:y="sm",onClick:v,onClose:x,open:b,PaperComponent:_=Li,PaperProps:w={},scroll:k="paper",slots:T={},slotProps:S={},TransitionComponent:A=Il,transitionDuration:M=a,TransitionProps:C,...E}=n,L={...n,disableEscapeKeyDown:f,fullScreen:m,fullWidth:g,maxWidth:y,scroll:k},P=(t=>{const{classes:e,scroll:r,maxWidth:n,fullWidth:i,fullScreen:a}=t;return Wn({root:["root"],container:["container",`scroll${Oi(r)}`],paper:["paper",`paperScroll${Oi(r)}`,`paperWidth${Oi(String(n))}`,i&&"paperFullWidth",a&&"paperFullScreen"]},wk,e)})(L),I=t.useRef(),z=ol(l),O=t.useMemo((()=>({titleId:z})),[z]),D={slots:{transition:A,...T},slotProps:{transition:C,paper:w,backdrop:h,...S}},[R,F]=Xi("root",{elementType:Ak,shouldForwardComponentProp:!0,externalForwardedProps:D,ownerState:L,className:Hn(P.root,p),ref:r}),[B,j]=Xi("backdrop",{elementType:Sk,shouldForwardComponentProp:!0,externalForwardedProps:D,ownerState:L}),[N,U]=Xi("paper",{elementType:Ck,shouldForwardComponentProp:!0,externalForwardedProps:D,ownerState:L,className:Hn(P.paper,w.className)}),[V,q]=Xi("container",{elementType:Mk,externalForwardedProps:D,ownerState:L,className:Hn(P.container)}),[$,H]=Xi("transition",{elementType:Il,externalForwardedProps:D,ownerState:L,additionalProps:{appear:!0,in:b,timeout:M,role:"presentation"}});return(0,s.jsx)(R,{closeAfterTransition:!0,slots:{backdrop:B},slotProps:{backdrop:{transitionDuration:M,as:u,...j}},disableEscapeKeyDown:f,onClose:x,open:b,onClick:t=>{v&&v(t),I.current&&(I.current=null,x&&x(t,"backdropClick"))},...F,...E,children:(0,s.jsx)($,{...H,children:(0,s.jsx)(V,{onMouseDown:t=>{I.current=t.target===t.currentTarget},...q,children:(0,s.jsx)(N,{as:_,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":z,"aria-modal":c,...U,children:(0,s.jsx)(Tk.Provider,{value:O,children:d})})})})})})),Lk=Ek;function Pk(t){return Ai("MuiDialogTitle",t)}const Ik=Mi("MuiDialogTitle",["root"]),zk=gi(uu,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Ok=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiDialogTitle"}),{className:i,id:a,...o}=n,l=n,c=(t=>{const{classes:e}=t;return Wn({root:["root"]},Pk,e)})(l),{titleId:u=a}=t.useContext(Tk);return(0,s.jsx)(zk,{component:"h2",className:Hn(c.root,i),ownerState:l,ref:r,variant:"h6",id:a??u,...o})}));function Dk(t){return Ai("MuiDialogContent",t)}Mi("MuiDialogContent",["root","dividers"]);const Rk=gi("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.dividers&&e.dividers]}})(wi((t=>{let{theme:e}=t;return{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:t=>{let{ownerState:e}=t;return e.dividers},style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:t=>{let{ownerState:e}=t;return!e.dividers},style:{[`.${Ik.root} + &`]:{paddingTop:0}}}]}}))),Fk=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiDialogContent"}),{className:n,dividers:i=!1,...a}=r,o={...r,dividers:i},l=(t=>{const{classes:e,dividers:r}=t;return Wn({root:["root",r&&"dividers"]},Dk,e)})(o);return(0,s.jsx)(Rk,{className:Hn(l.root,n),ownerState:o,ref:e,...a})}));function Bk(t){return Ai("MuiDialogContentText",t)}Mi("MuiDialogContentText",["root"]);const jk=gi(uu,{shouldForwardProp:t=>fi(t)||"classes"===t,name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Nk=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiDialogContentText"}),{children:n,className:i,...a}=r,o=(t=>{const{classes:e}=t,r=Wn({root:["root"]},Bk,e);return{...e,...r}})(a);return(0,s.jsx)(jk,{component:"p",variant:"body1",color:"textSecondary",ref:e,ownerState:a,className:Hn(o.root,i),...r,classes:o})}));function Uk(t){return Ai("MuiDialogActions",t)}Mi("MuiDialogActions",["root","spacing"]);const Vk=gi("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:t=>{let{ownerState:e}=t;return!e.disableSpacing},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),qk=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiDialogActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(t=>{const{classes:e,disableSpacing:r}=t;return Wn({root:["root",!r&&"spacing"]},Uk,e)})(o);return(0,s.jsx)(Vk,{className:Hn(l.root,n),ownerState:o,ref:e,...a})})),$k=ji((0,s.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"})),Hk=e=>{const{onDelete:r,disabled:n,label:i,color:a}=e,[o,l]=(0,t.useState)(!1),c=bi(),u=qn(c.breakpoints.down("md")),h=()=>{l(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(xl,{title:i?`Reset ${i}`:"Reset",children:(0,s.jsxs)("span",{style:{display:"flex"},children:[" ",(0,s.jsx)(Cc,{"aria-label":"reset",onClick:()=>{l(!0)},color:a||"inherit",sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",disabled:n,children:(0,s.jsx)($k,{})})]})}),(0,s.jsxs)(Lk,{fullScreen:u,open:o,onClose:h,"aria-labelledby":"responsive-dialog-title",children:[(0,s.jsx)(Ok,{id:"responsive-dialog-title",children:"Confirm Reset"}),(0,s.jsx)(Fk,{children:(0,s.jsxs)(Nk,{children:["This action will permanently reset ",i?i.toLocaleLowerCase():"all data"," without the ability to recover it. Are you sure you want to continue?"]})}),(0,s.jsxs)(qk,{children:[(0,s.jsx)(ru,{autoFocus:!0,onClick:h,children:"Cancel"}),(0,s.jsxs)(ru,{onClick:()=>{r(),l(!1)},color:"error",variant:"contained",children:["Reset ",i||"Everything"]})]})]})]})},Wk=e=>{let{value:r,disabled:n=!1,multiline:i=!1,placeholder:a,onChange:o,onKeyDown:l}=e;const c=bi(),u=(0,t.useRef)(null),h=(0,t.useRef)(null);(0,t.useEffect)((()=>{if(i&&u.current&&h.current){const t=h.current,e=u.current;t.value=r||a||"",window.requestAnimationFrame((()=>{const r=getComputedStyle(e),n=parseFloat(r.paddingTop||"0")+parseFloat(r.paddingBottom||"0"),i=t.scrollHeight+n;e.style.height=`${i}px`}))}}),[r,i,u,h,a]);const d=t=>{o&&o(t)},p=t=>{l&&l(t)},f={width:"100%",padding:"16.5px 14px",resize:"none",overflow:"hidden",boxSizing:"border-box",minHeight:"calc(1.5rem + 28px)",lineHeight:"1.5",borderRadius:"4px",fontSize:"16px",backgroundColor:"rgba(0, 0, 0, 0)",fontFamily:c.typography.fontFamily};return i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("textarea",{className:"BackstoryTextField",ref:u,value:r,disabled:n,placeholder:a,onChange:d,onKeyDown:p,style:{...f,height:"auto"}}),(0,s.jsx)("textarea",{className:"BackgroundTextField",ref:h,"aria-hidden":"true",value:a||"",style:{...f,position:"relative",top:"-9999px",left:"-9999px",visibility:"hidden",padding:"0px",margin:"0px",overflow:"auto",height:"0px",minHeight:"0px"},readOnly:!0,tabIndex:-1})]}):(0,s.jsx)("input",{className:"BackstoryTextField",type:"text",value:r,disabled:n,placeholder:a,onChange:d,onKeyDown:p,style:f})},Gk={role:"status",content:"Establishing connection with server..."},Yk=(0,t.forwardRef)(((e,r)=>{let{className:n,type:i,prompt:a,emptyPrompt:o,actionLabel:l,resetAction:c,multiline:u,resetLabel:h,connectionBase:d,sessionId:p,setSnack:f,defaultPrompts:m,hideDefaultPrompts:g,defaultQuery:y,preamble:v,hidePreamble:x,messageFilter:b,messages:_,sx:w,onResponse:k}=e;const[T,S]=(0,t.useState)(""),[A,M]=(0,t.useState)(0),[C,E]=(0,t.useState)(!1),[L,P]=(0,t.useState)(0),[I,z]=(0,t.useState)([]),[O,D]=(0,t.useState)([]),[R,F]=(0,t.useState)(void 0),[B,j]=(0,t.useState)(void 0),N=(0,t.useRef)(null),[U,V]=(0,t.useState)({context_used:0,max_context:0}),[q,$]=(0,t.useState)(!1),[H,W]=(0,t.useState)(!0),G=(0,t.useRef)([]),Y=(0,t.useRef)(null);(0,t.useEffect)((()=>{G.current=I}),[I]);const Z=(0,t.useCallback)((()=>{(async()=>{try{const t=await fetch(d+`/api/context-status/${p}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Server responded with ${t.status}: ${t.statusText}`);const e=await t.json();V(e)}catch(t){console.error("Error getting context status:",t),f("Unable to obtain context status.","error")}})()}),[V,d,f,p,i]);(0,t.useEffect)((()=>{let t=[];t=void 0===b?I:b(I),0===t.length?D([...v||[],..._||[]]):D([...x?[]:v||[],..._||[],...t])}),[I,D,b,v,_,x]);const X=(0,t.useCallback)((async()=>{let t=5;for(;--t>0;)try{const t=await fetch(d+`/api/history/${p}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Server responded with ${t.status}: ${t.statusText}`);const{messages:e}=await t.json();if(void 0===e||0===e.length)console.log(`History returned for ${i} from server with 0 entries`),z([]),W(!0);else{console.log(`History returned for ${i} from server with ${e.length} entries:`,e);z(e.flatMap((t=>[{role:"user",content:t.prompt||""},{...t,role:"done"===t.status?"assistant":t.status,content:t.response||""}]))),W(!1)}return F(void 0),j(void 0),void Z()}catch(e){console.error("Error generating session ID:",e),F({role:"error",content:`Unable to obtain history from server. Retrying in 3 seconds (${t} remain.)`}),setTimeout((()=>{F(void 0)}),3e3),await new Promise((t=>setTimeout(t,3e3))),f("Unable to obtain chat history.","error")}}),[z,Z,d,f,i,p]);(0,t.useEffect)((()=>{void 0!==p?X():F(Gk)}),[X,p,E]);const K=()=>{N.current&&(clearInterval(N.current),N.current=null,P(0))};(0,t.useImperativeHandle)(r,(()=>({submitQuery:(t,e)=>{J(t,e)},fetchHistory:()=>X()}))),(0,t.useEffect)((()=>{const t=Math.round(100*U.context_used/U.max_context);t>=90&&!q&&(f(`${t}% of context used. You may wish to start a new chat.`,"warning"),$(!0)),t<90&&q&&$(!1),M(t)}),[U,$,q,M,f]);const J=async(t,e)=>{if((t=t.trim())||!y||a||(t=y.trim()),t){W(!1),z([...G.current,{role:"user",origin:i,content:t,disableCopy:!0}]),await new Promise((t=>setTimeout(t,0))),S("");try{E(!0);const r=Date.now().toString();let n;F({role:"status",content:"Submitting request...",id:r,isProcessing:!0}),await new Promise((t=>setTimeout(t,0))),n=e?{options:e,prompt:t.trim()}:{prompt:t.trim()};const a=await fetch(d+`/api/chat/${p}/${i}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(f("Query sent.","info"),!a.ok)throw new Error(`Server responded with ${a.status}: ${a.statusText}`);if(!a.body)throw new Error("Response body is null");let o="";const s=a.body.getReader(),l=new TextDecoder;let c="";const u=async t=>{let e=JSON.parse(t);switch(e.status){case"done":console.log("Done processing:",e),K(),j(void 0),F(void 0);const t=e;z([...G.current,{...t,role:"assistant",origin:i,content:t.response||""}]),await new Promise((t=>setTimeout(t,0)));e.metadata&&Z(),k&&k(e);break;case"error":z([...G.current,{...e,role:"error",origin:i,content:e.response||""}]),E(!1),K(),await new Promise((t=>setTimeout(t,0)));break;default:"streaming"===e.status?(o+=e.chunk,j({role:e.status,content:o})):(F({role:e.status,content:e.response}),o=""),r=Math.ceil(e.remaining_time),N.current&&clearInterval(N.current),P(r),N.current=setInterval((()=>{P((t=>t<=1?(clearInterval(N.current),N.current=null,0):t-1))}),1e3),await new Promise((t=>setTimeout(t,0)))}var r};for(;;){const{done:t,value:e}=await s.read();if(t)break;c+=l.decode(e,{stream:!0});let r=c.split("\n");c=r.pop()||"";for(const n of r)if(n.trim())try{await u(n)}catch(Wf){f("Error processing query","error"),console.error(Wf)}}if(c.trim())try{await u(c)}catch(Wf){f("Error processing query","error"),console.error(Wf)}K(),E(!1)}catch(r){console.error("Fetch error:",r),f("Unable to process query","error"),F({role:"error",content:"Unable to process query"}),setTimeout((()=>{F(void 0)}),5e3),E(!1),K(),await new Promise((t=>setTimeout(t,0)))}}};return(0,s.jsxs)(sb,{className:n||"Conversation",autoscroll:!0,textFieldRef:Y,fallbackThreshold:.5,sx:{p:1,mt:0,...w},children:[O.map(((t,e)=>(0,s.jsx)(_k,{sendQuery:J,message:t,connectionBase:d,sessionId:p,setSnack:f},e))),void 0!==R&&(0,s.jsx)(_k,{sendQuery:J,connectionBase:d,sessionId:p,setSnack:f,message:R}),void 0!==B&&(0,s.jsx)(_k,{sendQuery:J,connectionBase:d,sessionId:p,setSnack:f,message:B}),(0,s.jsxs)(zc,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",m:1},children:[(0,s.jsx)(pu(),{size:"10px",loading:C,"aria-label":"Loading Spinner","data-testid":"loader"}),!0===C&&L>0&&(0,s.jsxs)(zc,{sx:{pt:1,fontSize:"0.7rem",color:"darkgrey"},children:["Response will be stopped in: ",L,"s"]})]}),(0,s.jsxs)(zc,{className:"Query",sx:{display:"flex",flexDirection:"column",p:1},children:[a&&(0,s.jsx)("div",{ref:Y,children:(0,s.jsx)(Wk,{disabled:C,multiline:!!u,value:T,onChange:t=>S(t.target.value),onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||J(T)},placeholder:a})}),(0,s.jsxs)(zc,{sx:{display:"flex",justifyContent:"center",flexDirection:"row"},children:[(0,s.jsx)(Hk,{label:h||"all data",disabled:void 0===p||void 0!==R||H,onDelete:()=>{(async()=>{try{const t=await fetch(d+`/api/reset/${p}/${i}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({reset:["history"]})});if(!t.ok)throw new Error(`Server responded with ${t.status}: ${t.statusText}`);if(!t.body)throw new Error("Response body is null");z([]),W(!0)}catch(Wf){f("Error resetting history","error"),console.error("Error resetting history:",Wf)}})(),c&&c()}}),(0,s.jsx)(xl,{title:l||"Send",children:(0,s.jsx)("span",{style:{display:"flex",flexGrow:1},children:(0,s.jsxs)(ru,{sx:{m:1,gap:1,flexGrow:1},variant:"contained",disabled:void 0===p||void 0!==R,onClick:()=>{J(T)},children:[l,(0,s.jsx)(hu,{})]})})})]},"jobActions")]}),(H||!g)&&void 0!==m&&m.length&&(0,s.jsx)(zc,{sx:{display:"flex",flexDirection:"column"},children:m.map(((t,e)=>(0,s.jsx)(zc,{children:t},e)))}),(0,s.jsxs)(zc,{sx:{ml:"0.25rem",fontSize:"0.6rem",color:"darkgrey",display:"flex",flexShrink:1,flexDirection:"row",gap:1,mb:"auto",mt:1},children:["Context used: ",A,"% ",U.context_used,"/",U.max_context,A>=90?(0,s.jsx)(uu,{sx:{fontSize:"0.6rem",color:"red"},children:"WARNING: Context almost exhausted. You should start a new chat."}):A>=50?(0,s.jsx)(uu,{sx:{fontSize:"0.6rem",color:"orange"},children:"NOTE: Context is getting long. Queries will be slower, and the LLM may stop issuing tool calls."}):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsx)(zc,{sx:{display:"flex",flexGrow:1}})]})})),Zk=e=>{let{sx:r,connectionBase:n,sessionId:i,setSnack:a}=e;const[o,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)(!1),[h,d]=(0,t.useState)(!1),p=(0,t.useRef)(null),f=(0,t.useRef)(null),m=(0,t.useRef)(null),[g,y]=(0,t.useState)(0),v=t=>{var e;console.log(`handleJobQuery: ${t} -- `,p.current?" sending":"no handler"),null===(e=p.current)||void 0===e||e.submitQuery(t)},x=t=>{var e;console.log(`handleResumeQuery: ${t} -- `,f.current?" sending":"no handler"),null===(e=f.current)||void 0===e||e.submitQuery(t)},b=t=>{var e;console.log(`handleFactsQuery: ${t} -- `,m.current?" sending":"no handler"),null===(e=m.current)||void 0===e||e.submitQuery(t)},_=(0,t.useCallback)((t=>{if(void 0===t||0===t.length)return[];t.length>2&&(u(!0),d(!0)),t.length>0&&(t[0].role="content",t[0].title="Job Description",t[0].disableCopy=!1,t[0].expandable=!0),t.length>3&&(t[3].role="job-requirements",t[3].title="Job Requirements",t[3].disableCopy=!1,t[3].expanded=!1,t[3].expandable=!0);const e=t.filter(((t,e)=>1!==e&&2!==e));return e}),[u,d]),w=(0,t.useCallback)((t=>{if(void 0===t||0===t.length)return[];t.length>1&&(t[1].role="qualifications",t[1].title="Candidate qualifications",t[1].disableCopy=!1,t[1].expanded=!1,t[1].expandable=!0),t.length>3&&(t[3].role="resume",t[3].title="Generated Resume",t[3].disableCopy=!1,t[3].expanded=!0,t[3].expandable=!0);const e=t.filter(((t,e)=>0!==e&&2!==e));return e}),[]),k=(0,t.useCallback)((t=>{if(void 0===t||0===t.length)return[];t.length>1&&(t[1].role="fact-check",t[1].title="Fact Check",t[1].disableCopy=!1,t[1].expanded=!0,t[1].expandable=!0);const e=t.filter(((t,e)=>0!==e));return e}),[]),T=(0,t.useCallback)((async t=>{console.log("onJobResponse",t),t.actions&&t.actions.includes("job_description")&&await p.current.fetchHistory(),t.actions&&t.actions.includes("resume_generated")&&(await f.current.fetchHistory(),u(!0),y(1)),t.actions&&t.actions.includes("facts_checked")&&(await m.current.fetchHistory(),d(!0))}),[d,u,y]),S=(0,t.useCallback)((t=>{console.log("onResumeResponse",t),d(!0)}),[d]),A=(0,t.useCallback)((t=>{console.log("onFactsResponse",t)}),[]),M=(0,t.useCallback)((()=>{l(!1),u(!1),d(!1)}),[l,u,d]),C=(0,t.useCallback)((()=>{u(!1),d(!1)}),[u,d]),E=(0,t.useCallback)((()=>{d(!1)}),[d]),L=(0,t.useCallback)((t=>{console.log("renderJobDescriptionView");const e=[(0,s.jsxs)(zc,{sx:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)(nu,{prompt:"What are the key skills necessary for this position?",tunables:{enable_tools:!1},submitQuery:v}),(0,s.jsx)(nu,{prompt:"How much should this position pay (accounting for inflation)?",tunables:{enable_tools:!1},submitQuery:v})]})],r=[{role:"info",content:"Once you paste a job description and press **Generate Resume**, the system will perform the following actions:\n\n1. **RAG**: Collects information from the RAG database relavent to the job description\n2. **Isolated Analysis**: Three sub-stages\n 1. **Job Analysis**: Extracts requirements from job description only\n 2. **Candidate Analysis**: Catalogs qualifications from resume/context only\n 3. **Mapping Analysis**: Identifies legitimate matches between requirements and qualifications\n3. **Resume Generation**: Uses mapping output to create a tailored resume with evidence-based content\n4. **Verification**: Performs fact-checking to catch any remaining fabrications\n 1. **Re-generation**: If verification does not pass, a second attempt is made to correct any issues"}];return o?(0,s.jsx)(Yk,{ref:p,type:"job_description",actionLabel:"Send",prompt:"Ask a question about this job description...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:_,defaultPrompts:e,resetAction:M,onResponse:T,sessionId:i,connectionBase:n,setSnack:a,sx:t}):(0,s.jsx)(Yk,{ref:p,type:"job_description",actionLabel:"Generate Resume",preamble:r,hidePreamble:!0,prompt:"Paste a job description, then click Generate...",multiline:!0,resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:_,resetAction:M,onResponse:T,sessionId:i,connectionBase:n,setSnack:a,sx:t})}),[n,_,o,i,a,T,M,h,c]),P=(0,t.useCallback)((t=>{const e=[(0,s.jsxs)(zc,{sx:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)(nu,{prompt:"Is this resume a good fit for the provided job description?",tunables:{enable_tools:!1},submitQuery:x}),(0,s.jsx)(nu,{prompt:"Provide a more concise resume.",tunables:{enable_tools:!1},submitQuery:x})]})];return h?(0,s.jsx)(Yk,{ref:f,type:"resume",actionLabel:"Send",prompt:"Ask a question about this job resume...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:w,onResponse:S,resetAction:C,sessionId:i,connectionBase:n,setSnack:a,defaultPrompts:e,sx:t}):(0,s.jsx)(Yk,{ref:f,type:"resume",actionLabel:"Fact Check",defaultQuery:"Fact check the resume.",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:w,onResponse:S,resetAction:C,sessionId:i,connectionBase:n,setSnack:a,sx:t})}),[n,w,h,i,a,S,C,c]),I=(0,t.useCallback)((t=>{const e=[(0,s.jsx)(zc,{sx:{display:"flex",flexDirection:"column"},children:(0,s.jsx)(nu,{prompt:"Rewrite the resume to address any discrepancies.",tunables:{enable_tools:!1},submitQuery:b})})];return(0,s.jsx)(Yk,{ref:m,type:"fact_check",actionLabel:"Send",prompt:"Ask a question about any discrepencies...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:k,defaultPrompts:e,resetAction:E,onResponse:A,sessionId:i,connectionBase:n,setSnack:a,sx:t})}),[n,i,a,A,k,E,c,h]);return(0,s.jsxs)(zc,{className:"ResumeBuilder",sx:{p:0,m:0,display:"flex",flexGrow:1,margin:"0 auto",overflow:"hidden",backgroundColor:"#F5F5F5",flexDirection:"column",maxWidth:"1024px"},children:[(0,s.jsxs)(uo,{value:g,onChange:(t,e)=>{y(e)},variant:"fullWidth",sx:{bgcolor:"background.paper"},children:[(0,s.jsx)(mo,{value:0,label:"Job Description"}),c&&(0,s.jsx)(mo,{value:1,label:"Resume"}),h&&(0,s.jsx)(mo,{value:2,label:"Fact Check"})]}),(0,s.jsxs)(zc,{sx:{display:"flex",flexDirection:"column",flexGrow:1,p:0,width:"100%",...r,overflow:"hidden"},children:[(0,s.jsx)(zc,{sx:{display:0===g?"flex":"none"},children:L({height:"calc(100vh - 72px - 48px)"})}),(0,s.jsx)(zc,{sx:{display:1===g?"flex":"none"},children:P({height:"calc(100vh - 72px - 48px)"})}),(0,s.jsx)(zc,{sx:{display:2===g?"flex":"none"},children:I({height:"calc(100vh - 72px - 48px)"})})]})]})};const Xk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoHideDuration:r=null,disableWindowBlurListener:n=!1,onClose:i,open:a,resumeHideDuration:o}=e,s=Ia();t.useEffect((()=>{if(a)return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)};function t(t){t.defaultPrevented||"Escape"===t.key&&i?.(t,"escapeKeyDown")}}),[a,i]);const l=ma(((t,e)=>{i?.(t,e)})),c=ma((t=>{i&&null!=t&&s.start(t,(()=>{l(null,"timeout")}))}));t.useEffect((()=>(a&&c(r),s.clear)),[a,r,c,s]);const u=s.clear,h=t.useCallback((()=>{null!=r&&c(null!=o?o:.5*r)}),[r,o,c]),d=t=>e=>{const r=t.onFocus;r?.(e),u()},p=t=>e=>{const r=t.onMouseEnter;r?.(e),u()},f=t=>e=>{const r=t.onMouseLeave;r?.(e),h()};return t.useEffect((()=>{if(!n&&a)return window.addEventListener("focus",h),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",u)}}),[n,a,h,u]),{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={...Gi(e),...Gi(t)};return{role:"presentation",...t,...r,onBlur:(n=r,t=>{const e=n.onBlur;e?.(t),h()}),onFocus:d(r),onMouseEnter:p(r),onMouseLeave:f(r)};var n},onClickAway:t=>{i?.(t,"clickaway")}}};function Kk(t){return t.substring(2).toLowerCase()}function Jk(e){const{children:r,disableReactTree:n=!1,mouseEvent:i="onClick",onClickAway:a,touchEvent:o="onTouchEnd"}=e,s=t.useRef(!1),l=t.useRef(null),c=t.useRef(!1),u=t.useRef(!1);t.useEffect((()=>(setTimeout((()=>{c.current=!0}),0),()=>{c.current=!1})),[]);const h=qi(go(r),l),d=ma((t=>{const e=u.current;u.current=!1;const r=sa(l.current);if(!c.current||!l.current||"clientX"in t&&function(t,e){return e.documentElement.clientWidth<t.clientX||e.documentElement.clientHeight<t.clientY}(t,r))return;if(s.current)return void(s.current=!1);let i;i=t.composedPath?t.composedPath().includes(l.current):!r.documentElement.contains(t.target)||l.current.contains(t.target),i||!n&&e||a(t)})),p=t=>e=>{u.current=!0;const n=r.props[t];n&&n(e)},f={ref:h};return!1!==o&&(f[o]=p(o)),t.useEffect((()=>{if(!1!==o){const t=Kk(o),e=sa(l.current),r=()=>{s.current=!0};return e.addEventListener(t,d),e.addEventListener("touchmove",r),()=>{e.removeEventListener(t,d),e.removeEventListener("touchmove",r)}}}),[d,o]),!1!==i&&(f[i]=p(i)),t.useEffect((()=>{if(!1!==i){const t=Kk(i),e=sa(l.current);return e.addEventListener(t,d),()=>{e.removeEventListener(t,d)}}}),[d,i]),t.cloneElement(r,f)}function Qk(t){return Ai("MuiSnackbarContent",t)}Mi("MuiSnackbarContent",["root","message","action"]);const tT=gi(Li,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode?.8:.98,n=Lr(e.palette.background.default,r);return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}}))),eT=gi("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),rT=gi("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),nT=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiSnackbarContent"}),{action:n,className:i,message:a,role:o="alert",...l}=r,c=r,u=(t=>{const{classes:e}=t;return Wn({root:["root"],action:["action"],message:["message"]},Qk,e)})(c);return(0,s.jsxs)(tT,{role:o,square:!0,elevation:6,className:Hn(u.root,i),ownerState:c,ref:e,...l,children:[(0,s.jsx)(eT,{className:u.message,ownerState:c,children:a}),n?(0,s.jsx)(rT,{className:u.action,ownerState:c,children:n}):null]})}));function iT(t){return Ai("MuiSnackbar",t)}Mi("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const aT=gi("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[`anchorOrigin${Oi(r.anchorOrigin.vertical)}${Oi(r.anchorOrigin.horizontal)}`]]}})(wi((t=>{let{theme:e}=t;return{zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:t=>{let{ownerState:e}=t;return"top"===e.anchorOrigin.vertical},style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:t=>{let{ownerState:e}=t;return"top"!==e.anchorOrigin.vertical},style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:t=>{let{ownerState:e}=t;return"left"===e.anchorOrigin.horizontal},style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:t=>{let{ownerState:e}=t;return"right"===e.anchorOrigin.horizontal},style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:t=>{let{ownerState:e}=t;return"center"===e.anchorOrigin.horizontal},style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}}))),oT=t.forwardRef((function(e,r){const n=yi({props:e,name:"MuiSnackbar"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:o,anchorOrigin:{vertical:l,horizontal:c}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:h,className:d,ClickAwayListenerProps:p,ContentProps:f,disableWindowBlurListener:m=!1,message:g,onBlur:y,onClose:v,onFocus:x,onMouseEnter:b,onMouseLeave:_,open:w,resumeHideDuration:k,slots:T={},slotProps:S={},TransitionComponent:A,transitionDuration:M=a,TransitionProps:{onEnter:C,onExited:E,...L}={},...P}=n,I={...n,anchorOrigin:{vertical:l,horizontal:c},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:A,transitionDuration:M},z=(t=>{const{classes:e,anchorOrigin:r}=t;return Wn({root:["root",`anchorOrigin${Oi(r.vertical)}${Oi(r.horizontal)}`]},iT,e)})(I),{getRootProps:O,onClickAway:D}=Xk({...I}),[R,F]=t.useState(!0),B={slots:{transition:A,...T},slotProps:{content:f,clickAwayListener:p,transition:L,...S}},[j,N]=Xi("root",{ref:r,className:[z.root,d],elementType:aT,getSlotProps:O,externalForwardedProps:{...B,...P},ownerState:I}),[U,{ownerState:V,...q}]=Xi("clickAwayListener",{elementType:Jk,externalForwardedProps:B,getSlotProps:t=>({onClickAway:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.onClickAway?.(...r),D(...r)}}),ownerState:I}),[$,H]=Xi("content",{elementType:nT,shouldForwardComponentProp:!0,externalForwardedProps:B,additionalProps:{message:g,action:o},ownerState:I}),[W,G]=Xi("transition",{elementType:zo,externalForwardedProps:B,getSlotProps:t=>({onEnter:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.onEnter?.(...r),((t,e)=>{F(!1),C&&C(t,e)})(...r)},onExited:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.onExited?.(...r),(t=>{F(!0),E&&E(t)})(...r)}}),additionalProps:{appear:!0,in:w,timeout:M,direction:"top"===l?"down":"up"},ownerState:I});return!w&&R?null:(0,s.jsx)(U,{...q,...T.clickAwayListener&&{ownerState:V},children:(0,s.jsx)(j,{...N,children:(0,s.jsx)(W,{...G,children:h||(0,s.jsx)($,{...H})})})})})),sT=oT;function lT(t){return Ai("MuiAlert",t)}const cT=Mi("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),uT=ji((0,s.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),hT=ji((0,s.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),dT=ji((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),pT=ji((0,s.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),fT=ji((0,s.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),mT=gi(Li,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,e[r.variant],e[`${r.variant}${Oi(r.color||r.severity)}`]]}})(wi((t=>{let{theme:e}=t;const r="light"===e.palette.mode?Ar:Cr,n="light"===e.palette.mode?Cr:Ar;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(bl(["light"])).map((t=>{let[i]=t;return{props:{colorSeverity:i,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${i}Color`]:r(e.palette[i].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${i}StandardBg`]:n(e.palette[i].light,.9),[`& .${cT.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:e.palette[i].main}}}})),...Object.entries(e.palette).filter(bl(["light"])).map((t=>{let[n]=t;return{props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:r(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${cT.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}}})),...Object.entries(e.palette).filter(bl(["dark"])).map((t=>{let[r]=t;return{props:{colorSeverity:r,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)}}}}))]}}))),gT=gi("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),yT=gi("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),vT=gi("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),xT={success:(0,s.jsx)(uT,{fontSize:"inherit"}),warning:(0,s.jsx)(hT,{fontSize:"inherit"}),error:(0,s.jsx)(dT,{fontSize:"inherit"}),info:(0,s.jsx)(pT,{fontSize:"inherit"})},bT=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiAlert"}),{action:n,children:i,className:a,closeText:o="Close",color:l,components:c={},componentsProps:u={},icon:h,iconMapping:d=xT,onClose:p,role:f="alert",severity:m="success",slotProps:g={},slots:y={},variant:v="standard",...x}=r,b={...r,color:l,severity:m,variant:v,colorSeverity:l||m},_=(t=>{const{variant:e,color:r,severity:n,classes:i}=t;return Wn({root:["root",`color${Oi(r||n)}`,`${e}${Oi(r||n)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]},lT,i)})(b),w={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...y},slotProps:{...u,...g}},[k,T]=Xi("root",{ref:e,shouldForwardComponentProp:!0,className:Hn(_.root,a),elementType:mT,externalForwardedProps:{...w,...x},ownerState:b,additionalProps:{role:f,elevation:0}}),[S,A]=Xi("icon",{className:_.icon,elementType:gT,externalForwardedProps:w,ownerState:b}),[M,C]=Xi("message",{className:_.message,elementType:yT,externalForwardedProps:w,ownerState:b}),[E,L]=Xi("action",{className:_.action,elementType:vT,externalForwardedProps:w,ownerState:b}),[P,I]=Xi("closeButton",{elementType:Cc,externalForwardedProps:w,ownerState:b}),[z,O]=Xi("closeIcon",{elementType:fT,externalForwardedProps:w,ownerState:b});return(0,s.jsxs)(k,{...T,children:[!1!==h?(0,s.jsx)(S,{...A,children:h||d[m]||xT[m]}):null,(0,s.jsx)(M,{...C,children:i}),null!=n?(0,s.jsx)(E,{...L,children:n}):null,null==n&&p?(0,s.jsx)(E,{...L,children:(0,s.jsx)(P,{size:"small","aria-label":o,title:o,color:"inherit",onClick:p,...I,children:(0,s.jsx)(z,{fontSize:"small",...O})})}):null]})})),_T=bT,wT=(0,t.forwardRef)(((e,r)=>{let{className:n,sx:i}=e;const[a,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(""),[u,h]=(0,t.useState)("success"),d=(0,t.useCallback)((function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";setTimeout((()=>{c(t),h(e),o(!0)}))}),[c,h,o]);(0,t.useImperativeHandle)(r,(()=>({setSnack:(t,e)=>{d(t,e)}})));const p=(t,e)=>{"clickaway"!==e&&o(!1)};return(0,s.jsx)(sT,{className:n||"Snack",sx:{...i},open:a,autoHideDuration:"success"===u||"info"===u?1500:6e3,onClose:p,children:(0,s.jsx)(_T,{onClose:p,severity:u,variant:"filled",sx:{width:"100%"},children:l})})}));function kT(t){return Ai("MuiAccordionActions",t)}Mi("MuiAccordionActions",["root","spacing"]);const TT=gi("div",{name:"MuiAccordionActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,!r.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",variants:[{props:t=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),ST=t.forwardRef((function(t,e){const r=yi({props:t,name:"MuiAccordionActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(t=>{const{classes:e,disableSpacing:r}=t;return Wn({root:["root",!r&&"spacing"]},kT,e)})(o);return(0,s.jsx)(TT,{className:Hn(l.root,n),ref:e,ownerState:o,...a})})),AT=e=>{let{systemInfo:r}=e;const[n,i]=(0,t.useState)([]),a=t=>t.replace(/\(R\)/g,"\xae").replace(/\(C\)/g,"\xa9").replace(/\(TM\)/g,"\u2122");return(0,t.useEffect)((()=>{if(void 0===r)return;const t=Object.entries(r).flatMap((t=>{let[e,r]=t;return Array.isArray(r)?r.map(((t,r)=>(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsxs)("div",{children:[a(e)," ",r]}),(0,s.jsxs)("div",{children:[a(t.name)," ",t.discrete?`w/ ${Math.round(t.memory/1073741824)}GB RAM`:"(integrated)"]})]},r))):(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsx)("div",{children:a(e)}),(0,s.jsx)("div",{children:a(String(r))})]},e)}));i(t)}),[r]),(0,s.jsx)("div",{className:"SystemInfo",children:n})},MT=e=>{let{sessionId:r,setSnack:n,connectionBase:i}=e;const[a,o]=(0,t.useState)(""),[l,c]=(0,t.useState)(void 0),[u,h]=(0,t.useState)([]),[d,p]=(0,t.useState)([]),[f,m]=(0,t.useState)(""),[g,y]=(0,t.useState)(5),[v,x]=(0,t.useState)(void 0);(0,t.useEffect)((()=>{if(void 0===v||f===v.system_prompt||!f.trim()||void 0===r)return;(async t=>{try{const e=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({system_prompt:t})}),a=await e.json();v.system_prompt=a.system_prompt,m(a.system_prompt),n("System prompt updated","success")}catch(e){console.error("Fetch error:",e),n("System prompt update failed","error")}})(f)}),[f,i,r,n,v]),(0,t.useEffect)((()=>{if(void 0===v||g===v.message_history_length||!g||void 0===r)return;(async t=>{try{const e=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({message_history_length:t})}),a=(await e.json()).message_history_length;a!==g&&(y(a),n("Message history length updated","success"))}catch(e){console.error("Fetch error:",e),n("Message history length update failed","error")}})(g)}),[g,y,i,r,n,v]);(0,t.useEffect)((()=>{void 0===l&&void 0!==r&&fetch(i+`/api/system-info/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{c(t)})).catch((t=>{console.error("Error obtaining system information:",t),n("Unable to obtain system information.","error")}))}),[l,c,i,n,r]),(0,t.useEffect)((()=>{o(f.trim())}),[f,o]);(0,t.useEffect)((()=>{if(void 0!==v||void 0===r)return;(async()=>{const t=await fetch(i+`/api/tunables/${r}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}),e=await t.json();console.log("Server tunables: ",e),x(e),m(e.system_prompt),y(e.message_history_length),h(e.tools),p(e.rags)})()}),[r,i,x,m,y,v,h,p]);return(0,s.jsx)("div",{className:"Controls",children:(0,s.jsxs)(Lu,{children:[(0,s.jsx)(Ru,{expandIcon:(0,s.jsx)(kh,{}),children:(0,s.jsx)(uu,{component:"span",children:"System Information"})}),(0,s.jsx)(ju,{children:"The server is running on the following hardware:"}),(0,s.jsx)(ST,{children:(0,s.jsx)(AT,{systemInfo:l})})]})})};function CT(t){const{className:e,active:r,children:n,sx:i,...a}=t;return(0,s.jsx)(zc,{className:e||"BackstoryTab",sx:{display:r?"flex":"none",...i},...a,children:n})}const ET=e=>{const{setSnack:r,submitQuery:n,connectionBase:i,filepath:a,content:o,title:l,expanded:c,disableCopy:u,onExpand:h}=e,[d,p]=(0,t.useState)("");return(0,t.useEffect)((()=>{if(""!==d||!a)return;(async()=>{try{const t=await fetch(a,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error(`${a} not found.`);const e=await t.text();p(e)}catch(t){console.error("Error obtaining About content information:",t),p(`${a} not found.`)}})()}),[d,p,a]),(0,s.jsx)(_k,{sx:{display:"flex",flexDirection:"column",p:1,m:0,flexGrow:0},message:{role:"content",title:l,content:d||o||""},connectionBase:i,submitQuery:n,setSnack:r,expanded:c,disableCopy:u,onExpand:h})},LT=(PT=window.location,console.log(`getConnectionBase(${PT})`),PT.host.match(/.*battle-linux.*/)?PT.protocol+"//battle-linux.ketrenos.com:8912":PT.protocol+"//"+PT.host);var PT;const IT=()=>{const[e,r]=(0,t.useState)(void 0),[n,i]=(0,t.useState)(!1),[a,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(0),u=qn("(min-width:650px)"),h=(0,t.useRef)(u),d=(0,t.useRef)(null),p=bi(),f=qn(p.breakpoints.down("md")),m=(0,t.useRef)(null);(0,t.useEffect)((()=>{h.current!==u&&(n&&i(!1),h.current=u)}),[u,i,n]);const g=(0,t.useCallback)(((t,e)=>{var r;null===(r=m.current)||void 0===r||r.setSnack(t,e)}),[m]),y=(t,e)=>{var r;console.log(`handleSubmitChatQuery: ${t} ${e||{}} -- `,d.current?" sending":"no handler"),null===(r=d.current)||void 0===r||r.submitQuery(t,e),c(0)},v=t=>{console.log("Document expanded:",t)},x=(0,t.useMemo)((()=>{console.log(document);const t=[{role:"content",title:"Welcome to Backstory",disableCopy:!0,content:"\n Backstory is a RAG enabled expert system with access to real-time data running self-hosted\n (no cloud) versions of industry leading Large and Small Language Models (LLM/SLMs).\n It was written by James Ketrenos in order to provide answers to\n questions potential employers may have about his work history.\n \n What would you like to know about James?\n "}],r=[(0,s.jsxs)(zc,{sx:{display:"flex",flexDirection:f?"column":"row"},children:[(0,s.jsx)(nu,{prompt:"What is James Ketrenos' work history?",tunables:{enable_tools:!1},submitQuery:y}),(0,s.jsx)(nu,{prompt:"What programming languages has James used?",tunables:{enable_tools:!1},submitQuery:y}),(0,s.jsx)(nu,{prompt:"What are James' professional strengths?",tunables:{enable_tools:!1},submitQuery:y}),(0,s.jsx)(nu,{prompt:"What are today's headlines on CNBC.com?",tunables:{enable_tools:!0,enable_rag:!1,enable_context:!1},submitQuery:y})]}),(0,s.jsx)(zc,{sx:{p:1},children:(0,s.jsx)(sy,{children:"As with all LLM interactions, the results may not be 100% accurate. If you have questions about my career, I'd love to hear from you. You can send me an email at **james_backstory@ketrenos.com**."})})];return[{label:"",path:"",tabProps:{label:"Backstory",sx:{flexGrow:1,fontSize:"1rem"},icon:(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),iconPosition:"start"},children:(0,s.jsx)(Yk,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},ref:d,type:"chat",prompt:"What would you like to know about James?",resetLabel:"chat",sessionId:e,connectionBase:LT,setSnack:g,preamble:t,defaultPrompts:r})},{label:"Resume Builder",path:"resume-builder",children:(0,s.jsx)(Zk,{sx:{margin:"0 auto",height:"calc(100vh - 72px)",overflow:"auto",backgroundColor:"#F5F5F5",display:"flex",flexGrow:1},setSnack:g,connectionBase:LT,sessionId:e})},{label:"Context Visualizer",path:"context-visualizer",children:(0,s.jsx)(sb,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},children:(0,s.jsx)(gk,{sx:{p:1},connectionBase:LT,sessionId:e,setSnack:g})})},{label:"About",path:"about",children:(0,s.jsxs)(sb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:[(0,s.jsx)(ET,{title:"About",filepath:"/docs/about.md",onExpand:()=>{v("about")},expanded:!1,sessionId:e,connectionBase:LT,submitQuery:y,setSnack:g}),(0,s.jsx)(ET,{title:"Resume Generation Architecture",filepath:"/docs/resume-generation.md",onExpand:()=>{v("resume-generation")},expanded:!1,sessionId:e,connectionBase:LT,submitQuery:y,setSnack:g}),(0,s.jsx)(ET,{title:"Application Architecture",filepath:"/docs/about-app.md",onExpand:()=>{v("resume-generation")},expanded:!1,sessionId:e,connectionBase:LT,submitQuery:y,setSnack:g})]})},{path:"settings",tabProps:{sx:{flexShrink:1,flexGrow:0,fontSize:"1rem"},icon:(0,s.jsx)(hc,{})},children:(0,s.jsx)(sb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:void 0!==e&&(0,s.jsx)(MT,{sessionId:e,setSnack:g,connectionBase:LT})})}]}),[e,g,f]),b=(0,t.useCallback)((async t=>{try{const e=await fetch(LT+"/api/context",{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Server is temporarily down.");const n=(await e.json()).id;if(console.log(`Session created: ${n}`),void 0===t){r(n);const t=`/${n}`;window.history.replaceState({},"",t)}else{const e=t.length<2?"":t[0];let i=x.findIndex((t=>t.path===e));-1===i?(console.log(`Invalid path "${e}" -- redirecting to default`),window.history.replaceState({},"",`/${n}`),c(0)):(window.history.replaceState({},"",`/${t.join("/")}/${n}`),x[i].route=t[2]||"",c(i)),r(n)}}catch(e){console.error(e),g("Server is temporarily down","error")}}),[g,x]);(0,t.useEffect)((()=>{const t=new URL(window.location.href).pathname.split("/").filter(Boolean);if(t.length<1)console.log("No session id or path -- creating new session"),b();else{const e=t.length<2?"":t[0],n=t.length<2?t[0]:t[1];if(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89ab][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/i.test(n)){let i=x.findIndex((t=>t.path===e));-1===i&&(console.log(`Invalid path "${e}" -- redirecting to default`),i=0),x[i].route=t[2]||"",r(n),c(i)}else console.log(`Invalid session id ${n}-- creating new session`),b([t[0]])}}),[r,g,x,b]);const _=()=>{o(!0),i(!1)},w=(t,r)=>{if(r>x.length)return;c(r);const n=x[r].path;let i=`/${e}`;n&&(i=`/${n}/${e}`),window.history.pushState({},"",i),_()};(0,t.useEffect)((()=>{const t=()=>{const t=new URL(window.location.href).pathname.split("/").filter(Boolean),e=t.length<2?"":t[0],n=t.length<2?t[0]:t[1];let i=x.findIndex((t=>t.path===e));-1===i&&(console.log(`Invalid path "${e}" -- redirecting to default`),i=0),r(n),c(i)};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}),[r,x]);const k=gi("div")((()=>({minHeight:"72px",height:"72px"})));return(0,s.jsxs)(zc,{className:"App",sx:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)(qc,{}),(0,s.jsx)(Sl,{position:"fixed",sx:{zIndex:t=>t.zIndex.drawer+1,maxWidth:"100vw"},children:(0,s.jsx)(uc,{children:(0,s.jsxs)(zc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[!u&&(0,s.jsxs)(zc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[(0,s.jsx)(Cc,{sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",color:"inherit",onClick:()=>{a||i(!n)},children:(0,s.jsx)(xl,{title:"Navigation",children:(0,s.jsx)($c,{})})}),(0,s.jsx)(xl,{title:"Backstory",children:(0,s.jsxs)(zc,{sx:{m:1,gap:1,display:"flex",flexDirection:"row",alignItems:"center",fontWeight:"bold",fontSize:"1.0rem",cursor:"pointer"},onClick:()=>{c(0),i(!1)},children:[(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),"BACKSTORY"]})})]}),!1===n&&u&&(0,s.jsx)(uo,{sx:{display:"flex",flexGrow:1},value:l,indicatorColor:"secondary",textColor:"inherit",variant:"fullWidth",allowScrollButtonsMobile:!0,onChange:w,"aria-label":"Backstory navigation",children:x.map(((t,e)=>(0,s.jsx)(mo,{value:e,label:t.label,...t.tabProps},e)))})]})})}),(0,s.jsx)(k,{}),(0,s.jsxs)(zc,{sx:{display:"flex",flexGrow:1,flexDirection:"column"},children:[(0,s.jsx)(zc,{component:"nav","aria-label":"mailbox folders",children:(0,s.jsxs)(sc,{container:window.document.body,variant:"temporary",open:n,onTransitionEnd:()=>{o(!1)},onClose:_,sx:{display:"block","& .MuiDrawer-paper":{boxSizing:"border-box"}},slotProps:{root:{keepMounted:!0}},children:[(0,s.jsx)(uc,{}),(0,s.jsx)(zi,{className:"MenuCard",children:(0,s.jsx)(uo,{sx:{display:"flex",flexGrow:1},orientation:"vertical",value:l,indicatorColor:"secondary",textColor:"inherit",variant:"scrollable",allowScrollButtonsMobile:!0,onChange:w,"aria-label":"Backstory navigation",children:x.map(((t,e)=>(0,s.jsx)(mo,{value:e,label:t.label,...t.tabProps},e)))})})]})}),x.map(((t,e)=>(0,s.jsx)(CT,{active:e===l,children:t.children},e)))]}),(0,s.jsx)(wT,{ref:m})]})},zT=t=>{t&&t instanceof Function&&r.e(453).then(r.bind(r,8834)).then((e=>{let{getCLS:r,getFID:n,getFCP:i,getLCP:a,getTTFB:o}=e;r(t),n(t),i(t),a(t),o(t)}))};n.createRoot(document.getElementById("root")).render((0,s.jsx)(t.StrictMode,{children:(0,s.jsx)(Fn,{theme:Bn,children:(0,s.jsx)(IT,{})})})),zT()})()})();
//# sourceMappingURL=main.b1c48cdf.js.map