@carto/airship-bridge
Advanced tools
Comparing version 2.3.2-rc.0 to 2.3.2-rc.1
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AsBridge=e():t.AsBridge=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){(function(r){var n;e=t.exports=Z,n="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,o=e.re=[],a=e.src=[],s=0,u=s++;a[u]="0|[1-9]\\d*";var l=s++;a[l]="[0-9]+";var c=s++;a[c]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=s++;a[p]="("+a[u]+")\\.("+a[u]+")\\.("+a[u]+")";var h=s++;a[h]="("+a[l]+")\\.("+a[l]+")\\.("+a[l]+")";var f=s++;a[f]="(?:"+a[u]+"|"+a[c]+")";var m=s++;a[m]="(?:"+a[l]+"|"+a[c]+")";var _=s++;a[_]="(?:-("+a[f]+"(?:\\."+a[f]+")*))";var d=s++;a[d]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var v=s++;a[v]="[0-9A-Za-z-]+";var g=s++;a[g]="(?:\\+("+a[v]+"(?:\\."+a[v]+")*))";var y=s++,b="v?"+a[p]+a[_]+"?"+a[g]+"?";a[y]="^"+b+"$";var w="[v=\\s]*"+a[h]+a[d]+"?"+a[g]+"?",x=s++;a[x]="^"+w+"$";var L=s++;a[L]="((?:<|>)?=?)";var j=s++;a[j]=a[l]+"|x|X|\\*";var O=s++;a[O]=a[u]+"|x|X|\\*";var P=s++;a[P]="[v=\\s]*("+a[O]+")(?:\\.("+a[O]+")(?:\\.("+a[O]+")(?:"+a[_]+")?"+a[g]+"?)?)?";var E=s++;a[E]="[v=\\s]*("+a[j]+")(?:\\.("+a[j]+")(?:\\.("+a[j]+")(?:"+a[d]+")?"+a[g]+"?)?)?";var N=s++;a[N]="^"+a[L]+"\\s*"+a[P]+"$";var T=s++;a[T]="^"+a[L]+"\\s*"+a[E]+"$";var z=s++;a[z]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var S=s++;a[S]="(?:~>?)";var k=s++;a[k]="(\\s*)"+a[S]+"\\s+",o[k]=new RegExp(a[k],"g");var D=s++;a[D]="^"+a[S]+a[P]+"$";var C=s++;a[C]="^"+a[S]+a[E]+"$";var H=s++;a[H]="(?:\\^)";var A=s++;a[A]="(\\s*)"+a[H]+"\\s+",o[A]=new RegExp(a[A],"g");var V=s++;a[V]="^"+a[H]+a[P]+"$";var R=s++;a[R]="^"+a[H]+a[E]+"$";var F=s++;a[F]="^"+a[L]+"\\s*("+w+")$|^$";var W=s++;a[W]="^"+a[L]+"\\s*("+b+")$|^$";var $=s++;a[$]="(\\s*)"+a[L]+"\\s*("+w+"|"+a[P]+")",o[$]=new RegExp(a[$],"g");var M=s++;a[M]="^\\s*("+a[P]+")\\s+-\\s+("+a[P]+")\\s*$";var I=s++;a[I]="^\\s*("+a[E]+")\\s+-\\s+("+a[E]+")\\s*$";var B=s++;a[B]="(<|>)?=?\\s*\\*";for(var U=0;U<35;U++)n(U,a[U]),o[U]||(o[U]=new RegExp(a[U]));function q(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof Z)return t;if("string"!=typeof t)return null;if(t.length>256)return null;if(!(e.loose?o[x]:o[y]).test(t))return null;try{return new Z(t,e)}catch(t){return null}}function Z(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof Z){if(t.loose===e.loose)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof Z))return new Z(t,e);n("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?o[x]:o[y]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<i)return e}return t})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}e.parse=q,e.valid=function(t,e){var r=q(t,e);return r?r.version:null},e.clean=function(t,e){var r=q(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},e.SemVer=Z,Z.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Z.prototype.toString=function(){return this.version},Z.prototype.compare=function(t){return n("SemVer.compare",this.version,this.options,t),t instanceof Z||(t=new Z(t,this.options)),this.compareMain(t)||this.comparePre(t)},Z.prototype.compareMain=function(t){return t instanceof Z||(t=new Z(t,this.options)),G(this.major,t.major)||G(this.minor,t.minor)||G(this.patch,t.patch)},Z.prototype.comparePre=function(t){if(t instanceof Z||(t=new Z(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],i=t.prerelease[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return G(r,i)}while(++e)},Z.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new Z(t,r).inc(e,n).version}catch(t){return null}},e.diff=function(t,e){if(Y(t,e))return null;var r=q(t),n=q(e),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return o},e.compareIdentifiers=G;var X=/^[0-9]+$/;function G(t,e){var r=X.test(t),n=X.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1}function J(t,e,r){return new Z(t,r).compare(new Z(e,r))}function K(t,e,r){return J(t,e,r)>0}function Q(t,e,r){return J(t,e,r)<0}function Y(t,e,r){return 0===J(t,e,r)}function tt(t,e,r){return 0!==J(t,e,r)}function et(t,e,r){return J(t,e,r)>=0}function rt(t,e,r){return J(t,e,r)<=0}function nt(t,e,r,n){switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return Y(t,r,n);case"!=":return tt(t,r,n);case">":return K(t,r,n);case">=":return et(t,r,n);case"<":return Q(t,r,n);case"<=":return rt(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}function it(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof it){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof it))return new it(t,e);n("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===ot?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}e.rcompareIdentifiers=function(t,e){return G(e,t)},e.major=function(t,e){return new Z(t,e).major},e.minor=function(t,e){return new Z(t,e).minor},e.patch=function(t,e){return new Z(t,e).patch},e.compare=J,e.compareLoose=function(t,e){return J(t,e,!0)},e.rcompare=function(t,e,r){return J(e,t,r)},e.sort=function(t,r){return t.sort((function(t,n){return e.compare(t,n,r)}))},e.rsort=function(t,r){return t.sort((function(t,n){return e.rcompare(t,n,r)}))},e.gt=K,e.lt=Q,e.eq=Y,e.neq=tt,e.gte=et,e.lte=rt,e.cmp=nt,e.Comparator=it;var ot={};function at(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof at)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new at(t.raw,e);if(t instanceof it)return new at(t.value,e);if(!(this instanceof at))return new at(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function st(t){return!t||"x"===t.toLowerCase()||"*"===t}function ut(t,e,r,n,i,o,a,s,u,l,c,p,h){return((e=st(r)?"":st(n)?">="+r+".0.0":st(i)?">="+r+"."+n+".0":">="+e)+" "+(s=st(u)?"":st(l)?"<"+(+u+1)+".0.0":st(c)?"<"+u+"."+(+l+1)+".0":p?"<="+u+"."+l+"."+c+"-"+p:"<="+s)).trim()}function lt(t,e,r){for(var i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(i=0;i<t.length;i++)if(n(t[i].semver),t[i].semver!==ot&&t[i].semver.prerelease.length>0){var o=t[i].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}function ct(t,e,r){try{e=new at(e,r)}catch(t){return!1}return e.test(t)}function pt(t,e,r,n){var i,o,a,s,u;switch(t=new Z(t,n),e=new at(e,n),r){case">":i=K,o=rt,a=Q,s=">",u=">=";break;case"<":i=Q,o=et,a=K,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ct(t,e,n))return!1;for(var l=0;l<e.set.length;++l){var c=e.set[l],p=null,h=null;if(c.forEach((function(t){t.semver===ot&&(t=new it(">=0.0.0")),p=p||t,h=h||t,i(t.semver,p.semver,n)?p=t:a(t.semver,h.semver,n)&&(h=t)})),p.operator===s||p.operator===u)return!1;if((!h.operator||h.operator===s)&&o(t,h.semver))return!1;if(h.operator===u&&a(t,h.semver))return!1}return!0}it.prototype.parse=function(t){var e=this.options.loose?o[F]:o[W],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new Z(r[2],this.options.loose):this.semver=ot},it.prototype.toString=function(){return this.value},it.prototype.test=function(t){return n("Comparator.test",t,this.options.loose),this.semver===ot||("string"==typeof t&&(t=new Z(t,this.options)),nt(t,this.operator,this.semver,this.options))},it.prototype.intersects=function(t,e){if(!(t instanceof it))throw new TypeError("a Comparator is required");var r;if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return r=new at(t.value,e),ct(this.value,r,e);if(""===t.operator)return r=new at(this.value,e),ct(t.semver,r,e);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=nt(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=nt(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||i||o&&a||s||u},e.Range=at,at.prototype.format=function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range},at.prototype.toString=function(){return this.range},at.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var r=e?o[I]:o[M];t=t.replace(r,ut),n("hyphen replace",t),t=t.replace(o[$],"$1$2$3"),n("comparator trim",t,o[$]),t=(t=(t=t.replace(o[k],"$1~")).replace(o[A],"$1^")).split(/\s+/).join(" ");var i=e?o[F]:o[W],a=t.split(" ").map((function(t){return function(t,e){return n("comp",t,e),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){n("caret",t,e);var r=e.loose?o[R]:o[V];return t.replace(r,(function(e,r,i,o,a){var s;return n("caret",t,e,r,i,o,a),st(r)?s="":st(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":st(o)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":a?(n("replaceCaret pr",a),s="0"===r?"0"===i?">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+"-"+a+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"),n("caret return",s),s}))}(t,e)})).join(" ")}(t,e),n("caret",t),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){var r=e.loose?o[C]:o[D];return t.replace(r,(function(e,r,i,o,a){var s;return n("tilde",t,e,r,i,o,a),st(r)?s="":st(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":st(o)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":a?(n("replaceTilde pr",a),s=">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s}))}(t,e)})).join(" ")}(t,e),n("tildes",t),t=function(t,e){return n("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return function(t,e){t=t.trim();var r=e.loose?o[T]:o[N];return t.replace(r,(function(e,r,i,o,a,s){n("xRange",t,e,r,i,o,a,s);var u=st(i),l=u||st(o),c=l||st(a);return"="===r&&c&&(r=""),u?e=">"===r||"<"===r?"<0.0.0":"*":r&&c?(l&&(o=0),a=0,">"===r?(r=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),e=r+i+"."+o+"."+a):l?e=">="+i+".0.0 <"+(+i+1)+".0.0":c&&(e=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),n("xRange return",e),e}))}(t,e)})).join(" ")}(t,e),n("xrange",t),t=function(t,e){return n("replaceStars",t,e),t.trim().replace(o[B],"")}(t,e),n("stars",t),t}(t,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(t){return!!t.match(i)}))),a=a.map((function(t){return new it(t,this.options)}),this)},at.prototype.intersects=function(t,e){if(!(t instanceof at))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return t.set.some((function(t){return t.every((function(t){return r.intersects(t,e)}))}))}))}))},e.toComparators=function(t,e){return new at(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))},at.prototype.test=function(t){if(!t)return!1;"string"==typeof t&&(t=new Z(t,this.options));for(var e=0;e<this.set.length;e++)if(lt(this.set[e],t,this.options))return!0;return!1},e.satisfies=ct,e.maxSatisfying=function(t,e,r){var n=null,i=null;try{var o=new at(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(n&&-1!==i.compare(t)||(i=new Z(n=t,r)))})),n},e.minSatisfying=function(t,e,r){var n=null,i=null;try{var o=new at(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(n&&1!==i.compare(t)||(i=new Z(n=t,r)))})),n},e.minVersion=function(t,e){t=new at(t,e);var r=new Z("0.0.0");if(t.test(r))return r;if(r=new Z("0.0.0-0"),t.test(r))return r;r=null;for(var n=0;n<t.set.length;++n){t.set[n].forEach((function(t){var e=new Z(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":r&&!K(r,e)||(r=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}))}if(r&&t.test(r))return r;return null},e.validRange=function(t,e){try{return new at(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,r){return pt(t,e,"<",r)},e.gtr=function(t,e,r){return pt(t,e,">",r)},e.outside=pt,e.prerelease=function(t,e){var r=q(t,e);return r&&r.prerelease.length?r.prerelease:null},e.intersects=function(t,e,r){return t=new at(t,r),e=new at(e,r),t.intersects(e)},e.coerce=function(t){if(t instanceof Z)return t;if("string"!=typeof t)return null;var e=t.match(o[z]);if(null==e)return null;return q(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}}).call(this,r(1))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,l=[],c=!1,p=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):p=-1,l.length&&f())}function f(){if(!c){var t=s(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++p<e;)u&&u[p].run();p=-1,e=l.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function _(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new m(t,e)),1!==l.length||c||s(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t){return"string"==typeof t?t:t.propertyName}function o(t){return"string"==typeof t?null:t}r.r(e),r.d(e,"VLBridge",(function(){return Z})),r.d(e,"VL",(function(){return X}));var a=function(){function t(t,e,r,i){this._layersSelector=n(t),this._carto=e,this._layers=r,this._mapLayers=i}return t.prototype.build=function(){var t=this;this._carto.on("loaded",this._mapLayers,(function(){t._layersSelector.layers=t._layers,t._layersSelector.forceUpdate(),t._layersSelector.addEventListener("onToggleLayer",(function(e){var r=t._mapLayers[e.detail.index];r[r.visible?"hide":"show"]()}))}))},t}();function s(t){return"#"+l(t.r)+l(t.g)+l(t.b)+l(Math.floor(255*t.a))}function u(t){return"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function l(t){return isNaN(t)||void 0===t?"":t.toString(16).padStart(2,"0").toUpperCase()}function c(t,e,r){void 0===r&&(r=!1),r&&t.on("updated",(function(){e(!1)})),t.viz?e(!0):t.on("loaded",(function(){e(!0)}))}var p=function(){return(p=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}).apply(this,arguments)};function h(t,e){void 0===e&&(e={});var r=t.getLegendData(e.config),n=Math.floor(r.data.length/2);return r.data[n].value}function f(t,e,r){void 0===r&&(r={});var n=t[e];return"ramp"===n.expressionName||"opacity"===n.expressionName?u(h(n,r)):"color"===n.type?u(n.value):"#000"}function m(t,e,r){void 0===r&&(r={});var n=t[e];return"ramp"===n.expressionName?r?h(n,r):16:"number"===n.type?n.value:16}function _(t,e,r){void 0===e&&(e=null),void 0===r&&(r={});var n=e&&t.variables[e]?t.variables[e]:t.symbol;return"ramp"===n.expressionName?h(n,r):n.value}function d(t,e){var r=t.layer,n=t.props,i=r.viz;return i?p({color:f(i,"color",e),label:n.label,marker:i.symbol.default?void 0:_(i,e),strokeColor:f(i,"strokeColor",e),strokeStyle:0===m(i,"strokeWidth",e)?"hidden":void 0,type:r.metadata.geomType,width:m(i,"width",e)},n):{}}function v(t){return t.props?t:{layer:t,props:{label:t.id}}}var g=function(){function t(){}return t.layersLegend=function(t,e,r){var i=this;void 0===r&&(r={}),t=n(t);var o=e.map(v);o.forEach((function(e,n,a){c(e.layer,(function(){var e=o.map(d.bind(i,r));r.format&&(e.label=r.format(e.label,n,a)),t.data=e,r.onLoad&&setTimeout(r.onLoad,0)}),r.dynamic)}))},t.rampLegend=function(t,e,r,i){void 0===i&&(i={}),t=n(t);var o=v(e);c(o.layer,(function(){var e=d(o,i),n=o.layer.viz[r],a=i.config,u=i.config.variable||r,l=o.layer.viz.variables[u]?o.layer.viz.variables[u]:o.layer.viz[u],c=l.getLegendData(a).data,h=c.map((function(t,o,a){var u,c,h,f,m;return p({},e,((u={})[r]=function(t,e){return"color"===t.type?s(e):e}(n,t.value),u.label=i.format?i.format(t.key,o,a):(c=l.key,Array.isArray(c)?(f=(h=c)[0],m=h[1],f===-1/0?"< "+m.toFixed(2):m===1/0?"> "+f.toFixed(2):f.toFixed(2)+" - "+m.toFixed(2)):c.toFixed?c.toFixed(2):c),u))}));Array.isArray(o.props)&&o.props.length===c.length?t.data=h.map((function(t,e){return p({},t,o.props[e])})):t.data=h,i.onLoad&&setTimeout(i.onLoad,0)}),i.dynamic)},t}(),y=r(0),b=r.n(y),w=function(){function t(t,e,r,i,o,a,s,u,l,c,p){var h=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._animationWidget=n(t),this._column=r,this._variableName=i||"animation",this._propertyName=o||"filter",this._carto=e,this._duration=a,this._fade=s,this._autoplay=u||!1,this._animationWidget.playing=this._autoplay,this._animationWidget.isLoading=!0,this._layer=l,this._formatCb=p,l.viz?(this._onLayerLoaded(),c()):l.on("loaded",(function(){h._onLayerLoaded(),c()}))}return Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.restart=function(){this._animation.setProgressPct(0)},t.prototype.setRange=function(){},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._animationWidget.duration=this._animation.duration.value,this._animationWidget.playing=this._autoplay,this._animationWidget.isLoading=!1,this._animationWidget.addEventListener("play",(function(){t._animation.play()})),this._animationWidget.addEventListener("pause",(function(){t._animation.pause()})),this._animationWidget.addEventListener("seek",(function(e){t._animation.setProgressPct(e.detail[0]/100),t._animation.notify(),t._animationWidget.progressValue=t._formatProgressValue()})),this._layer.on("updated",(function(){t._animationWidget.progress=100*t._animation.getProgressPct(),t._animationWidget.progressValue=t._formatProgressValue()}))},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]||(this._viz.variables[this._variableName]=this._propertyName&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation()),this._viz.variables[this._variableName]},t.prototype._formatProgressValue=function(){var t=this._animation.getProgressValue();return t instanceof Date?this._formatCb?this._formatCb(t):t.toISOString():t instanceof Object&&this._isVLTimeZoneDate(t)?this._formatCb?this._formatCb(t._date):t._date.toISOString():this._formatCb?this._formatCb(t):t},t.prototype._isVLTimeZoneDate=function(t){return"_date"in t},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._column),t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))),this._duration,t.fade(this._fade[0],this._fade[1]))},t}();var x=function(t){return t=t||Object.create(null),{on:function(e,r){(t[e]||(t[e]=[])).push(r)},off:function(e,r){t[e]&&t[e].splice(t[e].indexOf(r)>>>0,1)},emit:function(e,r){(t[e]||[]).slice().map((function(t){t(r)})),(t["*"]||[]).slice().map((function(t){t(e,r)}))}}},L=function(){function t(e,r,n,i,o,a,s){void 0===a&&(a=!0),void 0===s&&(s=1);var u=r.expressions;this._emitter=x(),this._name="asbind_"+e+"_"+n+"_"+t._counter,this._column=n,this._layer=i,this._source=o,this._readOnly=a,t._counter++,this._weight="number"==typeof s?s:u.prop(s),this._loadLegendData=this._loadLegendData.bind(this,this._name)}return Object.defineProperty(t.prototype,"globalExpression",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"column",{get:function(){return this._column},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnPropName",{get:function(){return this._name+"_col"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this._readOnly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.setLegendData=function(t){this._legendData=t.data},t.prototype.enableColorMapping=function(){this._mapColors=!0,this._layer.viz?this._loadLegendData():this._layer.on("loaded",this._loadLegendData)},t.prototype._filterChanged=function(){this._emitter.emit("filterChanged",this._name)},t.prototype._loadLegendData=function(t){void 0===t&&(t="color");var e=this._layer.viz[t];e.getLegendData&&this.setLegendData(e.getLegendData(this._getLegendConfig()))},t.prototype._getLegendConfig=function(){},t._counter=0,t}();function j(t,e){return P(t.value,e.value,E)}function O(t,e){return P(t.value,e.value,N)}function P(t,e,r){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r(t[n],e[n]))return!1;return!0}function E(t,e){return t.x[0]!==e.x[0]||t.x[1]!==e.x[1]||t.y!==e.y}function N(t,e){return t.x!==e.x||t.y!==e.y}function T(t){return t.value.map((function(t){return{end:t.x[1],start:t.x[0],value:t.y}}))}function z(t){return t.value.map((function(t){return{end:new Date(t.x[1]),start:new Date(t.x[0]),value:t.y}}))}function S(t,e){return t.value.map((function(t){return{category:t.x,color:k(t.x,e),end:void 0,start:void 0,value:t.y}}))}function k(t,e){if(e){var r=e.find((function(e){return e.key===t}));return r?function(t){return"string"==typeof t?t:s(t)}(r.value):void 0}}var D,C=function(t,e){void 0===e&&(e=[]);var r=t.getAllCategories(),n=t.value.reduce((function(t,e){return t[e.x]=e,t}),{});return r.map((function(t){var r=n[t.name];return{color:k(t.name,e),name:t.name,value:r?r.y:null}})).sort((function(t,e){return e.value-t.value}))},H=(D=function(t,e){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),A=function(t){function e(e,r,i,o,a,s,u,l,c){void 0===u&&(u=!0);var p=t.call(this,"category",e,o,r,a,u,s)||this;return p._selection=[],p._lastHistogram=null,p._button=null,p._widget=n(i),p._carto=e,p._button=n(l),p._expression=c,p._widget.disableInteractivity=u,p._widget.showClearButton=!u,p.selectionChanged=p.selectionChanged.bind(p),u||(p._widget.addEventListener("categoriesSelected",p.selectionChanged),p._button&&p._button.addEventListener&&p._button.addEventListener("click",(function(){p._filterChanged()}))),p}return H(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",(function(){var t=e._dataLayer.viz.variables[e.name];t&&(null!==e._lastHistogram&&O(e._lastHistogram,t)||(e._lastHistogram={value:t.value},e._widget.categories=C(t,e._legendData)))}))},Object.defineProperty(e.prototype,"filter",{get:function(){return 0===this._selection.length?null:"@"+this.columnPropName+" in ["+this._selection.map((function(t){return"'"+t+"'"})).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._expression?this._expression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),e.prototype.selectionChanged=function(t){this._selection=t.detail,0!==this._selection.length&&this._button||this._filterChanged()},e}(L),V=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),R=function(t){function e(e,r,i,o,a,s,u,l,c,p){void 0===u&&(u=!0),void 0===c&&(c=!1),void 0===p&&(p=null);var h=t.call(this,"histogram_"+e,r,a,i,s,u,l)||this;return h._selection=null,h._inputExpression=null,h._totals=!1,h._widget=n(o),h._carto=r,h._totals=c,h._widget.disableInteractivity=u,h._widget.showClear=!u,h._inputExpression=p,h.selectionChanged=h.selectionChanged.bind(h),u||h._widget.addEventListener("selectionChanged",h.selectionChanged),h}return V(e,t),e.prototype.removeHistogramLayer=function(){this._layer.remove()},e.prototype.setDataLayer=function(t){this._dataLayer=t,this.bindDataLayer()},e.prototype._getLegendConfig=function(){return{samples:this._buckets}},e}(L),F=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(t){function e(e,r,n,i,o,a,s,u,l){void 0===a&&(a=!0),void 0===u&&(u=!1),void 0===l&&(l=null);var c=t.call(this,"categorical",e,r,n,i,o,a,s,u,l)||this;return c._lastHistogram=null,c}return F(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._selection?null:"@"+this.columnPropName+" in ["+this._selection.map((function(t){return"'"+t+"'"})).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",(function(){t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._widget.backgroundData=S(t._globalHistogram));var e=t._dataLayer.viz.variables[t.name];if(e&&(null===t._lastHistogram||!O(t._lastHistogram,e)))if(t._lastHistogram={value:e.value},t._globalHistogram){var r=t._globalHistogram.value.map((function(t){var r=e.value.find((function(e){return e.x===t.x}));return{x:t.x,y:r?r.y:0}}));t._widget.data=S({value:r},t._legendData)}else t._widget.data=S(e,t._legendData)}))},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=t.detail.selection;this._selection=e.map((function(t){return t}))}this._filterChanged()},e}(R),$=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),M=function(t){function e(e,r,n,i,o,a,s,u,l,c,p){void 0===o&&(o=20),void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===p&&(p=null);var h=t.call(this,"numerical",e,r,n,i,s,l,a,c,p)||this;return h._lastHistogram=null,h._buckets=void 0!==u?u.length:o,h._bucketRanges=u,h}return $(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){if(null===this._selection||this._isTimeSeries)return null;var t=this._selection[0],e=this._selection[1],r=t instanceof Date?"date('"+t.toISOString()+"')":t,n=e instanceof Date?"date('"+e.toISOString()+"')":e;return"(@"+this.columnPropName+" >= "+r+" and @"+this.columnPropName+" <= "+n+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){if(this._totals&&!this._globalHistogram)return null;var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg(),this._weight)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg(),this._weight)},enumerable:!0,configurable:!0}),e.prototype.setTimeSeries=function(t){this._isTimeSeries=t},e.prototype.enableColorMapping=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.setLegendData=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",(function(){if(t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._globalHistogram)){var e=t._globalHistogram.input.type;t._bucketRanges=t._globalHistogram.value.map((function(t){return[t.x[0],t.x[1]]})),t._emitter.emit("expressionReady",{name:t.name,expression:t.expression}),t._widget.backgroundData="number"===e?T(t._globalHistogram):z(t._globalHistogram)}var r=t._dataLayer.viz.variables[t.name];if(r&&null!==r.value&&(null===t._lastHistogram||!j(t._lastHistogram,r))){e=r.input.type;t._emitter.emit("rangeChanged",[r.value[0].x[0],r.value[r.value.length-1].x[1]]),t._lastHistogram={value:r.value,input:{type:e}},t._widget.data="number"===e?T(r):z(r)}}))},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=this._isTimeSeries?t.detail:t.detail.selection;this._selection=[e[0],e[1]]}this._emitter.emit("rangeChanged",this._selection),this._filterChanged()},e.prototype._bucketArg=function(){return void 0!==this._bucketRanges?this._bucketRanges:this._buckets},e}(R),I=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),B=function(t){function e(e,r,i,o,a){var s=t.call(this,"global_range",e,o,r,a,!1)||this;return s._value=null,s._widget=n(i),s._carto=e,s._widget.addEventListener("change",(function(t){s._value=t.detail,s._filterChanged()})),s}return I(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",(function(){var t=e._dataLayer.viz.variables[e.name];t&&!e._populated&&(e._widget.minValue=t.value[0],e._widget.maxValue=t.value[1],e._widget.range=t.value,e._populated=!0)}))},Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._value?null:"@"+this.columnPropName+" > "+this._value[0]+" and @"+this.columnPropName+" < "+this._value[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.list([t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))])},enumerable:!0,configurable:!0}),e}(L),U=function(){function t(t,e,r,i,o,a,s,u,l,c){var p=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._timeSeriesWidget=n(i),this._layer=e,this._carto=t,this._columnName=r,this._duration=a,this._fade=s,this._variableName=u||"animation",this._propertyName=l||"filter",this._autoplay=c||!1,e.viz?(this._onLayerLoaded(),o()):e.on("loaded",(function(){p._onLayerLoaded(),o()}))}return t.prototype.removeHistogramLayer=function(){this._dataLayer.remove()},t.prototype.setRange=function(t){if(this._animation&&this._animation.input&&this._animation.input.min&&this._animation.input.max)if(null===t)this._animation.input.min.blendTo(this._min,0),this._animation.input.max.blendTo(this._max,0),this._animation.duration.blendTo(this._duration,0);else if(t[0]!==t[1]){var e=this._carto.expressions,r=void 0,n=void 0,i=void 0;"Blend"===this._animation.input.min.expressionName&&"Transition"!==this._animation.input.min.mix.expressionName&&("number"==typeof t[0]&&"number"==typeof t[1]?(r=t[0],n=t[1],i=Math.min(1,(n-r)/(this._max.value-this._min.value))):t[0]instanceof Date&&t[1]instanceof Date&&(r=e.time(t[0]),n=e.time(t[1]),i=Math.min(1,(t[0].getTime()-t[1].getTime())/(this._max.value-this._min.value))),this._animation.input.min.blendTo(r,0),this._animation.input.max.blendTo(n,0),this._animation.duration.blendTo(this._duration*i,0))}},Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setDuration=function(t){this._duration=t,this._animation.duration.blendTo(t,0)},Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),t.prototype.restart=function(){this._animation.setProgressPct(0)},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz.variables[this._variableName]=this._animation,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._max=this._animation.input.max,this._min=this._animation.input.min,this._duration=this._animation.duration.value,this._layer.on("updated",(function(){t._timeSeriesWidget.progress=100*t._animation.getProgressPct(),t._timeSeriesWidget.playing=t._animation.isPlaying()})),this._timeSeriesWidget.animated=this._autoplay,this._timeSeriesWidget.addEventListener("seek",(function(e){t._animation.setProgressPct(e.detail/100),t._timeSeriesWidget.progress=e.detail})),this._timeSeriesWidget.addEventListener("play",(function(){t._animation.play()})),this._timeSeriesWidget.addEventListener("pause",(function(){t._animation.pause()}))},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:this._propertyName&&this._viz[this._propertyName]&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation()},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._columnName)),this._duration,t.fade(this._fade[0],this._fade[1]))},t}(),q=function(){function t(t){var e=t.carto,r=t.map,n=t.layer,i=t.source;if(this._vizFilters=[],this._carto=e,this._map=r,this._layer=n,this._source=i,this._id=this._layer.id,this._rebuildFilters=this._rebuildFilters.bind(this),this._updateDataLayerVariables=this._updateDataLayerVariables.bind(this),!this._carto.expressions.globalHistogram)throw new Error("Provided VL version "+this._carto.version+" lacks globalHistogram support.");if(!b.a.satisfies(this._carto.version,"^1.2.3"))throw new Error("Provided VL version "+this._carto.version+" not supported. Must satisfy ^1.2.3")}return t.prototype.numericalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,a=r.bucketRanges,s=r.weight,u=r.readOnly,l=r.totals,c=i(e),p=o(e),h=new M(this._carto,this._layer,t,c,n,s,this._source,a,u,l,p);return this._addFilter(h),h},t.prototype.categoricalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.totals,s=r.weight,u=i(e),l=o(e),c=new W(this._carto,this._layer,t,u,this._source,n,s,a,l);return this._addFilter(c),c},t.prototype.histogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,i=r.bucketRanges,o=r.readOnly,a=r.weight,s=r.totals;if(void 0===n&&void 0===i){var u=t;return this.categoricalHistogram(u,e,{readOnly:o,totals:s,weight:a})}return this.numericalHistogram(t,e,{bucketRanges:i,buckets:n,readOnly:o,totals:s,weight:a})},t.prototype.category=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.button,s=r.weight,u=i(e),l=o(e),c=new A(this._carto,this._layer,t,u,this._source,s,n,a,l);return this._addFilter(c),c},t.prototype.timeSeries=function(t,e,r){var n=this;if(void 0===r&&(r={}),this._animation)throw new Error("There can only be one animation");var i=r.buckets,o=r.bucketRanges,a=r.readOnly,s=r.totals,u=r.weight,l=r.duration,c=r.fade,p=r.variableName,h=r.propertyName,f=r.autoplay;this._animation=new U(this._carto,this._layer,e,t,(function(){"filter"===h&&n._rebuildFilters()}),l,c,p,h,f);var m=this.numericalHistogram(t,e,{bucketRanges:o,buckets:i,readOnly:a,totals:s,weight:u});return m.setTimeSeries(!0),m.on("rangeChanged",(function(t){n._animation.setRange(t)})),this._animation},t.prototype.animationControls=function(t,e,r){var n=this;void 0===r&&(r={});var i=r.duration,o=r.fade,a=r.variableName,s=r.propertyName,u=void 0===s?"filter":s,l=r.autoplay;return this._animation=new w(t,this._carto,e,a,u,i,o,l,this._layer,(function(){"filter"===u&&n._rebuildFilters()}),null),this._animation},t.prototype.globalRange=function(t,e){var r=new B(this._carto,this._layer,t,e,this._source);return this._addFilter(r),r},t.prototype.build=function(){var t=this;if(0!==this._vizFilters.length){var e=function(){t._appendVariables(),t._buildDataLayer()};this._layer.viz?e():this._layer.on("loaded",e)}},t.prototype._addFilter=function(t){t.on("filterChanged",this._rebuildFilters),t.on("expressionReady",this._updateDataLayerVariables),this._vizFilters.push(t)},t.prototype._appendVariables=function(){var t=this,e=this._carto.expressions;this._vizFilters.forEach((function(r){return t._layer.viz.variables[r.columnPropName]=e.prop(r.column)}))},t.prototype._buildDataLayer=function(){var t=this,e=this._getVariables(),r=this._carto.expressions,n=new this._carto.Viz({color:r.rgba(0,0,0,0),strokeWidth:0,variables:e});this._readOnlyLayer=new this._carto.Layer("asbind_ro_"+this._id,this._source,n),this._readOnlyLayer.addTo(this._map),this._vizFilters.forEach((function(e){return e.setDataLayer(t._readOnlyLayer)}))},t.prototype._getVariables=function(){for(var t=void 0!==this._readOnlyLayer?this._readOnlyLayer.viz.variables:{},e=0,r=this._vizFilters;e<r.length;e++){var n=r[e],i=n.name;n.globalExpression&&(t[i+"_global"]=n.globalExpression),n.expression&&(t[i]=n.expression),t[n.columnPropName]=this._carto.expressions.prop(n.column)}return t},t.prototype._updateDataLayerVariables=function(t){this._readOnlyLayer.viz&&(this._readOnlyLayer.viz.variables[t.name]=t.expression)},t.prototype._rebuildFilters=function(){var t=this._combineFilters(this._vizFilters.filter((function(t){return null!==t.filter})).map((function(t){return t.filter})));this._readOnlyLayer&&this._readOnlyLayer.viz.filter.blendTo(t,0),this._layer.viz.filter.isAnimated()&&this._animation&&this._layer.viz.variables[this._animation.variableName]&&(t="@"+this._animation.variableName+" and "+t),this._layer.viz.filter.blendTo(t,0),this._animation&&this._animation.restart()},t.prototype._combineFilters=function(t){return 0===t.length?"1":t.join(" and ")},t}(),Z=q,X={Bridge:q,Layers:a,Legends:g}}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AsBridge=e():t.AsBridge=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){(function(r){var n;e=t.exports=h,n="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=Number.MAX_SAFE_INTEGER||9007199254740991,o=e.re=[],a=e.src=[],s=e.tokens={},u=0;function l(t){s[t]=u++}l("NUMERICIDENTIFIER"),a[s.NUMERICIDENTIFIER]="0|[1-9]\\d*",l("NUMERICIDENTIFIERLOOSE"),a[s.NUMERICIDENTIFIERLOOSE]="[0-9]+",l("NONNUMERICIDENTIFIER"),a[s.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",l("MAINVERSION"),a[s.MAINVERSION]="("+a[s.NUMERICIDENTIFIER]+")\\.("+a[s.NUMERICIDENTIFIER]+")\\.("+a[s.NUMERICIDENTIFIER]+")",l("MAINVERSIONLOOSE"),a[s.MAINVERSIONLOOSE]="("+a[s.NUMERICIDENTIFIERLOOSE]+")\\.("+a[s.NUMERICIDENTIFIERLOOSE]+")\\.("+a[s.NUMERICIDENTIFIERLOOSE]+")",l("PRERELEASEIDENTIFIER"),a[s.PRERELEASEIDENTIFIER]="(?:"+a[s.NUMERICIDENTIFIER]+"|"+a[s.NONNUMERICIDENTIFIER]+")",l("PRERELEASEIDENTIFIERLOOSE"),a[s.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[s.NUMERICIDENTIFIERLOOSE]+"|"+a[s.NONNUMERICIDENTIFIER]+")",l("PRERELEASE"),a[s.PRERELEASE]="(?:-("+a[s.PRERELEASEIDENTIFIER]+"(?:\\."+a[s.PRERELEASEIDENTIFIER]+")*))",l("PRERELEASELOOSE"),a[s.PRERELEASELOOSE]="(?:-?("+a[s.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[s.PRERELEASEIDENTIFIERLOOSE]+")*))",l("BUILDIDENTIFIER"),a[s.BUILDIDENTIFIER]="[0-9A-Za-z-]+",l("BUILD"),a[s.BUILD]="(?:\\+("+a[s.BUILDIDENTIFIER]+"(?:\\."+a[s.BUILDIDENTIFIER]+")*))",l("FULL"),l("FULLPLAIN"),a[s.FULLPLAIN]="v?"+a[s.MAINVERSION]+a[s.PRERELEASE]+"?"+a[s.BUILD]+"?",a[s.FULL]="^"+a[s.FULLPLAIN]+"$",l("LOOSEPLAIN"),a[s.LOOSEPLAIN]="[v=\\s]*"+a[s.MAINVERSIONLOOSE]+a[s.PRERELEASELOOSE]+"?"+a[s.BUILD]+"?",l("LOOSE"),a[s.LOOSE]="^"+a[s.LOOSEPLAIN]+"$",l("GTLT"),a[s.GTLT]="((?:<|>)?=?)",l("XRANGEIDENTIFIERLOOSE"),a[s.XRANGEIDENTIFIERLOOSE]=a[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),a[s.XRANGEIDENTIFIER]=a[s.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),a[s.XRANGEPLAIN]="[v=\\s]*("+a[s.XRANGEIDENTIFIER]+")(?:\\.("+a[s.XRANGEIDENTIFIER]+")(?:\\.("+a[s.XRANGEIDENTIFIER]+")(?:"+a[s.PRERELEASE]+")?"+a[s.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),a[s.XRANGEPLAINLOOSE]="[v=\\s]*("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[s.XRANGEIDENTIFIERLOOSE]+")(?:"+a[s.PRERELEASELOOSE]+")?"+a[s.BUILD]+"?)?)?",l("XRANGE"),a[s.XRANGE]="^"+a[s.GTLT]+"\\s*"+a[s.XRANGEPLAIN]+"$",l("XRANGELOOSE"),a[s.XRANGELOOSE]="^"+a[s.GTLT]+"\\s*"+a[s.XRANGEPLAINLOOSE]+"$",l("COERCE"),a[s.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),o[s.COERCERTL]=new RegExp(a[s.COERCE],"g"),l("LONETILDE"),a[s.LONETILDE]="(?:~>?)",l("TILDETRIM"),a[s.TILDETRIM]="(\\s*)"+a[s.LONETILDE]+"\\s+",o[s.TILDETRIM]=new RegExp(a[s.TILDETRIM],"g");l("TILDE"),a[s.TILDE]="^"+a[s.LONETILDE]+a[s.XRANGEPLAIN]+"$",l("TILDELOOSE"),a[s.TILDELOOSE]="^"+a[s.LONETILDE]+a[s.XRANGEPLAINLOOSE]+"$",l("LONECARET"),a[s.LONECARET]="(?:\\^)",l("CARETTRIM"),a[s.CARETTRIM]="(\\s*)"+a[s.LONECARET]+"\\s+",o[s.CARETTRIM]=new RegExp(a[s.CARETTRIM],"g");l("CARET"),a[s.CARET]="^"+a[s.LONECARET]+a[s.XRANGEPLAIN]+"$",l("CARETLOOSE"),a[s.CARETLOOSE]="^"+a[s.LONECARET]+a[s.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),a[s.COMPARATORLOOSE]="^"+a[s.GTLT]+"\\s*("+a[s.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),a[s.COMPARATOR]="^"+a[s.GTLT]+"\\s*("+a[s.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),a[s.COMPARATORTRIM]="(\\s*)"+a[s.GTLT]+"\\s*("+a[s.LOOSEPLAIN]+"|"+a[s.XRANGEPLAIN]+")",o[s.COMPARATORTRIM]=new RegExp(a[s.COMPARATORTRIM],"g");l("HYPHENRANGE"),a[s.HYPHENRANGE]="^\\s*("+a[s.XRANGEPLAIN]+")\\s+-\\s+("+a[s.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),a[s.HYPHENRANGELOOSE]="^\\s*("+a[s.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[s.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),a[s.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c<u;c++)n(c,a[c]),o[c]||(o[c]=new RegExp(a[c]));function p(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof h)return t;if("string"!=typeof t)return null;if(t.length>256)return null;if(!(e.loose?o[s.LOOSE]:o[s.FULL]).test(t))return null;try{return new h(t,e)}catch(t){return null}}function h(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof h){if(t.loose===e.loose)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof h))return new h(t,e);n("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?o[s.LOOSE]:o[s.FULL]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<i)return e}return t})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}e.parse=p,e.valid=function(t,e){var r=p(t,e);return r?r.version:null},e.clean=function(t,e){var r=p(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},e.SemVer=h,h.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},h.prototype.toString=function(){return this.version},h.prototype.compare=function(t){return n("SemVer.compare",this.version,this.options,t),t instanceof h||(t=new h(t,this.options)),this.compareMain(t)||this.comparePre(t)},h.prototype.compareMain=function(t){return t instanceof h||(t=new h(t,this.options)),m(this.major,t.major)||m(this.minor,t.minor)||m(this.patch,t.patch)},h.prototype.comparePre=function(t){if(t instanceof h||(t=new h(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],i=t.prerelease[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return m(r,i)}while(++e)},h.prototype.compareBuild=function(t){t instanceof h||(t=new h(t,this.options));var e=0;do{var r=this.build[e],i=t.build[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return m(r,i)}while(++e)},h.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new h(t,r).inc(e,n).version}catch(t){return null}},e.diff=function(t,e){if(g(t,e))return null;var r=p(t),n=p(e),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return o},e.compareIdentifiers=m;var f=/^[0-9]+$/;function m(t,e){var r=f.test(t),n=f.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1}function d(t,e,r){return new h(t,r).compare(new h(e,r))}function _(t,e,r){return d(t,e,r)>0}function v(t,e,r){return d(t,e,r)<0}function g(t,e,r){return 0===d(t,e,r)}function y(t,e,r){return 0!==d(t,e,r)}function E(t,e,r){return d(t,e,r)>=0}function b(t,e,r){return d(t,e,r)<=0}function L(t,e,r,n){switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return g(t,r,n);case"!=":return y(t,r,n);case">":return _(t,r,n);case">=":return E(t,r,n);case"<":return v(t,r,n);case"<=":return b(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}function O(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof O){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof O))return new O(t,e);n("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===R?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}e.rcompareIdentifiers=function(t,e){return m(e,t)},e.major=function(t,e){return new h(t,e).major},e.minor=function(t,e){return new h(t,e).minor},e.patch=function(t,e){return new h(t,e).patch},e.compare=d,e.compareLoose=function(t,e){return d(t,e,!0)},e.compareBuild=function(t,e,r){var n=new h(t,r),i=new h(e,r);return n.compare(i)||n.compareBuild(i)},e.rcompare=function(t,e,r){return d(e,t,r)},e.sort=function(t,r){return t.sort((function(t,n){return e.compareBuild(t,n,r)}))},e.rsort=function(t,r){return t.sort((function(t,n){return e.compareBuild(n,t,r)}))},e.gt=_,e.lt=v,e.eq=g,e.neq=y,e.gte=E,e.lte=b,e.cmp=L,e.Comparator=O;var R={};function I(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof I)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new I(t.raw,e);if(t instanceof O)return new I(t.value,e);if(!(this instanceof I))return new I(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((function(t){return this.parseRange(t.trim())}),this).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function N(t,e){for(var r=!0,n=t.slice(),i=n.pop();r&&n.length;)r=n.every((function(t){return i.intersects(t,e)})),i=n.pop();return r}function T(t){return!t||"x"===t.toLowerCase()||"*"===t}function w(t,e,r,n,i,o,a,s,u,l,c,p,h){return((e=T(r)?"":T(n)?">="+r+".0.0":T(i)?">="+r+"."+n+".0":">="+e)+" "+(s=T(u)?"":T(l)?"<"+(+u+1)+".0.0":T(c)?"<"+u+"."+(+l+1)+".0":p?"<="+u+"."+l+"."+c+"-"+p:"<="+s)).trim()}function A(t,e,r){for(var i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(i=0;i<t.length;i++)if(n(t[i].semver),t[i].semver!==R&&t[i].semver.prerelease.length>0){var o=t[i].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}function P(t,e,r){try{e=new I(e,r)}catch(t){return!1}return e.test(t)}function S(t,e,r,n){var i,o,a,s,u;switch(t=new h(t,n),e=new I(e,n),r){case">":i=_,o=b,a=v,s=">",u=">=";break;case"<":i=v,o=E,a=_,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P(t,e,n))return!1;for(var l=0;l<e.set.length;++l){var c=e.set[l],p=null,f=null;if(c.forEach((function(t){t.semver===R&&(t=new O(">=0.0.0")),p=p||t,f=f||t,i(t.semver,p.semver,n)?p=t:a(t.semver,f.semver,n)&&(f=t)})),p.operator===s||p.operator===u)return!1;if((!f.operator||f.operator===s)&&o(t,f.semver))return!1;if(f.operator===u&&a(t,f.semver))return!1}return!0}O.prototype.parse=function(t){var e=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new h(r[2],this.options.loose):this.semver=R},O.prototype.toString=function(){return this.value},O.prototype.test=function(t){if(n("Comparator.test",t,this.options.loose),this.semver===R||t===R)return!0;if("string"==typeof t)try{t=new h(t,this.options)}catch(t){return!1}return L(t,this.operator,this.semver,this.options)},O.prototype.intersects=function(t,e){if(!(t instanceof O))throw new TypeError("a Comparator is required");var r;if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new I(t.value,e),P(this.value,r,e));if(""===t.operator)return""===t.value||(r=new I(this.value,e),P(t.semver,r,e));var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=L(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=L(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||i||o&&a||s||u},e.Range=I,I.prototype.format=function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range},I.prototype.toString=function(){return this.range},I.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var r=e?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(r,w),n("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],"$1$2$3"),n("comparator trim",t,o[s.COMPARATORTRIM]),t=(t=(t=t.replace(o[s.TILDETRIM],"$1~")).replace(o[s.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=e?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],a=t.split(" ").map((function(t){return function(t,e){return n("comp",t,e),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){n("caret",t,e);var r=e.loose?o[s.CARETLOOSE]:o[s.CARET];return t.replace(r,(function(e,r,i,o,a){var s;return n("caret",t,e,r,i,o,a),T(r)?s="":T(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":T(o)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":a?(n("replaceCaret pr",a),s="0"===r?"0"===i?">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+"-"+a+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"),n("caret return",s),s}))}(t,e)})).join(" ")}(t,e),n("caret",t),t=function(t,e){return t.trim().split(/\s+/).map((function(t){return function(t,e){var r=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(r,(function(e,r,i,o,a){var s;return n("tilde",t,e,r,i,o,a),T(r)?s="":T(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":T(o)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":a?(n("replaceTilde pr",a),s=">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s}))}(t,e)})).join(" ")}(t,e),n("tildes",t),t=function(t,e){return n("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return function(t,e){t=t.trim();var r=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(r,(function(r,i,o,a,s,u){n("xRange",t,r,i,o,a,s,u);var l=T(o),c=l||T(a),p=c||T(s),h=p;return"="===i&&h&&(i=""),u=e.includePrerelease?"-0":"",l?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&h?(c&&(a=0),s=0,">"===i?(i=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",c?o=+o+1:a=+a+1),r=i+o+"."+a+"."+s+u):c?r=">="+o+".0.0"+u+" <"+(+o+1)+".0.0"+u:p&&(r=">="+o+"."+a+".0"+u+" <"+o+"."+(+a+1)+".0"+u),n("xRange return",r),r}))}(t,e)})).join(" ")}(t,e),n("xrange",t),t=function(t,e){return n("replaceStars",t,e),t.trim().replace(o[s.STAR],"")}(t,e),n("stars",t),t}(t,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(t){return!!t.match(i)}))),a=a.map((function(t){return new O(t,this.options)}),this)},I.prototype.intersects=function(t,e){if(!(t instanceof I))throw new TypeError("a Range is required");return this.set.some((function(r){return N(r,e)&&t.set.some((function(t){return N(t,e)&&r.every((function(r){return t.every((function(t){return r.intersects(t,e)}))}))}))}))},e.toComparators=function(t,e){return new I(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))},I.prototype.test=function(t){if(!t)return!1;if("string"==typeof t)try{t=new h(t,this.options)}catch(t){return!1}for(var e=0;e<this.set.length;e++)if(A(this.set[e],t,this.options))return!0;return!1},e.satisfies=P,e.maxSatisfying=function(t,e,r){var n=null,i=null;try{var o=new I(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(n&&-1!==i.compare(t)||(i=new h(n=t,r)))})),n},e.minSatisfying=function(t,e,r){var n=null,i=null;try{var o=new I(e,r)}catch(t){return null}return t.forEach((function(t){o.test(t)&&(n&&1!==i.compare(t)||(i=new h(n=t,r)))})),n},e.minVersion=function(t,e){t=new I(t,e);var r=new h("0.0.0");if(t.test(r))return r;if(r=new h("0.0.0-0"),t.test(r))return r;r=null;for(var n=0;n<t.set.length;++n){t.set[n].forEach((function(t){var e=new h(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":r&&!_(r,e)||(r=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}}))}if(r&&t.test(r))return r;return null},e.validRange=function(t,e){try{return new I(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,r){return S(t,e,"<",r)},e.gtr=function(t,e,r){return S(t,e,">",r)},e.outside=S,e.prerelease=function(t,e){var r=p(t,e);return r&&r.prerelease.length?r.prerelease:null},e.intersects=function(t,e,r){return t=new I(t,r),e=new I(e,r),t.intersects(e)},e.coerce=function(t,e){if(t instanceof h)return t;"number"==typeof t&&(t=String(t));if("string"!=typeof t)return null;var r=null;if((e=e||{}).rtl){for(var n;(n=o[s.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),o[s.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;o[s.COERCERTL].lastIndex=-1}else r=t.match(o[s.COERCE]);if(null===r)return null;return p(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),e)}}).call(this,r(1))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,l=[],c=!1,p=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):p=-1,l.length&&f())}function f(){if(!c){var t=s(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++p<e;)u&&u[p].run();p=-1,e=l.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function d(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new m(t,e)),1!==l.length||c||s(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t){return"string"==typeof t?t:t.propertyName}function o(t){return"string"==typeof t?null:t}r.r(e),r.d(e,"VLBridge",(function(){return $})),r.d(e,"VL",(function(){return Y}));var a=function(){function t(t,e,r,i){this._layersSelector=n(t),this._carto=e,this._layers=r,this._mapLayers=i}return t.prototype.build=function(){var t=this;this._carto.on("loaded",this._mapLayers,(function(){t._layersSelector.layers=t._layers,t._layersSelector.forceUpdate(),t._layersSelector.addEventListener("onToggleLayer",(function(e){var r=t._mapLayers[e.detail.index];r[r.visible?"hide":"show"]()}))}))},t}();function s(t){return"#"+l(t.r)+l(t.g)+l(t.b)+l(Math.floor(255*t.a))}function u(t){return"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function l(t){return isNaN(t)||void 0===t?"":t.toString(16).padStart(2,"0").toUpperCase()}function c(t,e,r){void 0===r&&(r=!1),r&&t.on("updated",(function(){e(!1)})),t.viz?e(!0):t.on("loaded",(function(){e(!0)}))}var p=function(){return(p=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}).apply(this,arguments)};function h(t,e){void 0===e&&(e={});var r=t.getLegendData(e.config),n=Math.floor(r.data.length/2);return r.data[n].value}function f(t,e,r){void 0===r&&(r={});var n=t[e];return"ramp"===n.expressionName||"opacity"===n.expressionName?u(h(n,r)):"color"===n.type?u(n.value):"#000"}function m(t,e,r){void 0===r&&(r={});var n=t[e];return"ramp"===n.expressionName?r?h(n,r):16:"number"===n.type?n.value:16}function d(t,e,r){void 0===e&&(e=null),void 0===r&&(r={});var n=e&&t.variables[e]?t.variables[e]:t.symbol;return"ramp"===n.expressionName?h(n,r):n.value}function _(t,e){var r=t.layer,n=t.props,i=r.viz;return i?p({color:f(i,"color",e),label:n.label,marker:i.symbol.default?void 0:d(i,e),strokeColor:f(i,"strokeColor",e),strokeStyle:0===m(i,"strokeWidth",e)?"hidden":void 0,type:r.metadata.geomType,width:m(i,"width",e)},n):{}}function v(t){return t.props?t:{layer:t,props:{label:t.id}}}var g=function(){function t(){}return t.layersLegend=function(t,e,r){var i=this;void 0===r&&(r={}),t=n(t);var o=e.map(v);o.forEach((function(e,n,a){c(e.layer,(function(){var e=o.map(_.bind(i,r));r.format&&(e.label=r.format(e.label,n,a)),t.data=e,r.onLoad&&setTimeout(r.onLoad,0)}),r.dynamic)}))},t.rampLegend=function(t,e,r,i){void 0===i&&(i={}),t=n(t);var o=v(e);c(o.layer,(function(){var e=_(o,i),n=o.layer.viz[r],a=i.config,u=i.config.variable||r,l=o.layer.viz.variables[u]?o.layer.viz.variables[u]:o.layer.viz[u],c=l.getLegendData(a).data,h=c.map((function(t){var o,a,u,c,h;return p(p({},e),((o={})[r]=function(t,e){return"color"===t.type?s(e):e}(n,t.value),o.label=i.format?i.format(t.key):(a=l.key,Array.isArray(a)?(c=(u=a)[0],h=u[1],c===-1/0?"< "+h.toFixed(2):h===1/0?"> "+c.toFixed(2):c.toFixed(2)+" - "+h.toFixed(2)):a.toFixed?a.toFixed(2):a),o))}));Array.isArray(o.props)&&o.props.length===c.length?t.data=h.map((function(t,e){return p(p({},t),o.props[e])})):t.data=h,i.onLoad&&setTimeout(i.onLoad,0)}),i.dynamic)},t}(),y=r(0),E=r.n(y),b=function(){function t(t,e,r,i,o,a,s,u,l,c,p){var h=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._animationWidget=n(t),this._column=r,this._variableName=i||"animation",this._propertyName=o||"filter",this._carto=e,this._duration=a,this._fade=s,this._autoplay=u||!1,this._animationWidget.playing=this._autoplay,this._animationWidget.isLoading=!0,this._layer=l,this._formatCb=p,l.viz?(this._onLayerLoaded(),c()):l.on("loaded",(function(){h._onLayerLoaded(),c()}))}return Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.restart=function(){this._animation.setProgressPct(0)},t.prototype.setRange=function(){},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._animationWidget.duration=this._animation.duration.value,this._animationWidget.playing=this._autoplay,this._animationWidget.isLoading=!1,this._animationWidget.addEventListener("play",(function(){t._animation.play()})),this._animationWidget.addEventListener("pause",(function(){t._animation.pause()})),this._animationWidget.addEventListener("seek",(function(e){t._animation.setProgressPct(e.detail[0]/100),t._animation.notify(),t._animationWidget.progressValue=t._formatProgressValue()})),this._layer.on("updated",(function(){t._animationWidget.progress=100*t._animation.getProgressPct(),t._animationWidget.progressValue=t._formatProgressValue()}))},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]||(this._viz.variables[this._variableName]=this._propertyName&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation()),this._viz.variables[this._variableName]},t.prototype._formatProgressValue=function(){var t=this._animation.getProgressValue();return t instanceof Date?this._formatCb?this._formatCb(t):t.toISOString():t instanceof Object&&this._isVLTimeZoneDate(t)?this._formatCb?this._formatCb(t._date):t._date.toISOString():this._formatCb?this._formatCb(t):t},t.prototype._isVLTimeZoneDate=function(t){return"_date"in t},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._column),t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))),this._duration,t.fade(this._fade[0],this._fade[1]))},t}();var L=function(t){return t=t||Object.create(null),{on:function(e,r){(t[e]||(t[e]=[])).push(r)},off:function(e,r){t[e]&&t[e].splice(t[e].indexOf(r)>>>0,1)},emit:function(e,r){(t[e]||[]).slice().map((function(t){t(r)})),(t["*"]||[]).slice().map((function(t){t(e,r)}))}}},O=function(){function t(e,r,n,i,o,a,s){void 0===a&&(a=!0),void 0===s&&(s=1);var u=r.expressions;this._emitter=L(),this._name="asbind_"+e+"_"+n+"_"+t._counter,this._column=n,this._layer=i,this._source=o,this._readOnly=a,t._counter++,this._weight="number"==typeof s?s:u.prop(s),this._loadLegendData=this._loadLegendData.bind(this,this._name)}return Object.defineProperty(t.prototype,"globalExpression",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"column",{get:function(){return this._column},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnPropName",{get:function(){return this._name+"_col"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this._readOnly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.setLegendData=function(t){this._legendData=t.data},t.prototype.enableColorMapping=function(){this._mapColors=!0,this._layer.viz?this._loadLegendData():this._layer.on("loaded",this._loadLegendData)},t.prototype._filterChanged=function(){this._emitter.emit("filterChanged",this._name)},t.prototype._loadLegendData=function(t){void 0===t&&(t="color");var e=this._layer.viz[t];e.getLegendData&&this.setLegendData(e.getLegendData(this._getLegendConfig()))},t.prototype._getLegendConfig=function(){},t._counter=0,t}();function R(t,e){return N(t.value,e.value,T)}function I(t,e){return N(t.value,e.value,w)}function N(t,e,r){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r(t[n],e[n]))return!1;return!0}function T(t,e){return t.x[0]!==e.x[0]||t.x[1]!==e.x[1]||t.y!==e.y}function w(t,e){return t.x!==e.x||t.y!==e.y}function A(t){return t.value.map((function(t){return{end:t.x[1],start:t.x[0],value:t.y}}))}function P(t){return t.value.map((function(t){return{end:new Date(t.x[1]),start:new Date(t.x[0]),value:t.y}}))}function S(t,e){return t.value.map((function(t){return{category:t.x,color:x(t.x,e),end:void 0,start:void 0,value:t.y}}))}function x(t,e){if(e){var r=e.find((function(e){return e.key===t}));return r?function(t){return"string"==typeof t?t:s(t)}(r.value):void 0}}var D,C=function(t,e){void 0===e&&(e=[]);var r=t.getAllCategories(),n=t.value.reduce((function(t,e){return t[e.x]=e,t}),{});return r.map((function(t){var r=n[t.name];return{color:x(t.name,e),name:t.name,value:r?r.y:null}})).sort((function(t,e){return e.value-t.value}))},j=(D=function(t,e){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),F=function(t){function e(e,r,i,o,a,s,u,l,c){void 0===u&&(u=!0);var p=t.call(this,"category",e,o,r,a,u,s)||this;return p._selection=[],p._lastHistogram=null,p._button=null,p._widget=n(i),p._carto=e,p._button=n(l),p._expression=c,p._widget.disableInteractivity=u,p._widget.showClearButton=!u,p.selectionChanged=p.selectionChanged.bind(p),u||(p._widget.addEventListener("categoriesSelected",p.selectionChanged),p._button&&p._button.addEventListener&&p._button.addEventListener("click",(function(){p._filterChanged()}))),p}return j(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",(function(){var t=e._dataLayer.viz.variables[e.name];t&&(null!==e._lastHistogram&&I(e._lastHistogram,t)||(e._lastHistogram={value:t.value},e._widget.categories=C(t,e._legendData)))}))},Object.defineProperty(e.prototype,"filter",{get:function(){return 0===this._selection.length?null:"@"+this.columnPropName+" in ["+this._selection.map((function(t){return"'"+t+"'"})).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._expression?this._expression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),e.prototype.selectionChanged=function(t){this._selection=t.detail,0!==this._selection.length&&this._button||this._filterChanged()},e}(O),M=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),z=function(t){function e(e,r,i,o,a,s,u,l,c,p){void 0===u&&(u=!0),void 0===c&&(c=!1),void 0===p&&(p=null);var h=t.call(this,"histogram_"+e,r,a,i,s,u,l)||this;return h._selection=null,h._inputExpression=null,h._totals=!1,h._widget=n(o),h._carto=r,h._totals=c,h._widget.disableInteractivity=u,h._widget.showClear=!u,h._inputExpression=p,h.selectionChanged=h.selectionChanged.bind(h),u||h._widget.addEventListener("selectionChanged",h.selectionChanged),h}return M(e,t),e.prototype.removeHistogramLayer=function(){this._layer.remove()},e.prototype.setDataLayer=function(t){this._dataLayer=t,this.bindDataLayer()},e.prototype._getLegendConfig=function(){return{samples:this._buckets}},e}(O),H=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),k=function(t){function e(e,r,n,i,o,a,s,u,l){void 0===a&&(a=!0),void 0===u&&(u=!1),void 0===l&&(l=null);var c=t.call(this,"categorical",e,r,n,i,o,a,s,u,l)||this;return c._lastHistogram=null,c}return H(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._selection?null:"@"+this.columnPropName+" in ["+this._selection.map((function(t){return"'"+t+"'"})).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._weight)},enumerable:!0,configurable:!0}),e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",(function(){t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._widget.backgroundData=S(t._globalHistogram));var e=t._dataLayer.viz.variables[t.name];if(e&&(null===t._lastHistogram||!I(t._lastHistogram,e)))if(t._lastHistogram={value:e.value},t._globalHistogram){var r=t._globalHistogram.value.map((function(t){var r=e.value.find((function(e){return e.x===t.x}));return{x:t.x,y:r?r.y:0}}));t._widget.data=S({value:r},t._legendData)}else t._widget.data=S(e,t._legendData)}))},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=t.detail.selection;this._selection=e.map((function(t){return t}))}this._filterChanged()},e}(z),G=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),U=function(t){function e(e,r,n,i,o,a,s,u,l,c,p){void 0===o&&(o=20),void 0===l&&(l=!0),void 0===c&&(c=!1),void 0===p&&(p=null);var h=t.call(this,"numerical",e,r,n,i,s,l,a,c,p)||this;return h._lastHistogram=null,h._buckets=void 0!==u?u.length:o,h._bucketRanges=u,h}return G(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){if(null===this._selection||this._isTimeSeries)return null;var t=this._selection[0],e=this._selection[1],r=t instanceof Date?"date('"+t.toISOString()+"')":t,n=e instanceof Date?"date('"+e.toISOString()+"')":e;return"(@"+this.columnPropName+" >= "+r+" and @"+this.columnPropName+" <= "+n+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){if(this._totals&&!this._globalHistogram)return null;var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg(),this._weight)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg(),this._weight)},enumerable:!0,configurable:!0}),e.prototype.setTimeSeries=function(t){this._isTimeSeries=t},e.prototype.enableColorMapping=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.setLegendData=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",(function(){if(t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._globalHistogram)){var e=t._globalHistogram.input.type;t._bucketRanges=t._globalHistogram.value.map((function(t){return[t.x[0],t.x[1]]})),t._emitter.emit("expressionReady",{name:t.name,expression:t.expression}),t._widget.backgroundData="number"===e?A(t._globalHistogram):P(t._globalHistogram)}var r=t._dataLayer.viz.variables[t.name];if(r&&null!==r.value&&(null===t._lastHistogram||!R(t._lastHistogram,r))){e=r.input.type;t._emitter.emit("rangeChanged",[r.value[0].x[0],r.value[r.value.length-1].x[1]]),t._lastHistogram={value:r.value,input:{type:e}},t._widget.data="number"===e?A(r):P(r)}}))},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=this._isTimeSeries?t.detail:t.detail.selection;this._selection=[e[0],e[1]]}this._emitter.emit("rangeChanged",this._selection),this._filterChanged()},e.prototype._bucketArg=function(){return void 0!==this._bucketRanges?this._bucketRanges:this._buckets},e}(z),V=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),X=function(t){function e(e,r,i,o,a){var s=t.call(this,"global_range",e,o,r,a,!1)||this;return s._value=null,s._widget=n(i),s._carto=e,s._widget.addEventListener("change",(function(t){s._value=t.detail,s._filterChanged()})),s}return V(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",(function(){var t=e._dataLayer.viz.variables[e.name];t&&!e._populated&&(e._widget.minValue=t.value[0],e._widget.maxValue=t.value[1],e._widget.range=t.value,e._populated=!0)}))},Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._value?null:"@"+this.columnPropName+" > "+this._value[0]+" and @"+this.columnPropName+" < "+this._value[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.list([t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))])},enumerable:!0,configurable:!0}),e}(O),B=function(){function t(t,e,r,i,o,a,s,u,l,c){var p=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._timeSeriesWidget=n(i),this._layer=e,this._carto=t,this._columnName=r,this._duration=a,this._fade=s,this._variableName=u||"animation",this._propertyName=l||"filter",this._autoplay=c||!1,e.viz?(this._onLayerLoaded(),o()):e.on("loaded",(function(){p._onLayerLoaded(),o()}))}return t.prototype.removeHistogramLayer=function(){this._dataLayer.remove()},t.prototype.setRange=function(t){if(this._animation&&this._animation.input&&this._animation.input.min&&this._animation.input.max)if(null===t)this._animation.input.min.blendTo(this._min,0),this._animation.input.max.blendTo(this._max,0),this._animation.duration.blendTo(this._duration,0);else if(t[0]!==t[1]){var e=this._carto.expressions,r=void 0,n=void 0,i=void 0;"Blend"===this._animation.input.min.expressionName&&"Transition"!==this._animation.input.min.mix.expressionName&&("number"==typeof t[0]&&"number"==typeof t[1]?(r=t[0],n=t[1],i=Math.min(1,(n-r)/(this._max.value-this._min.value))):t[0]instanceof Date&&t[1]instanceof Date&&(r=e.time(t[0]),n=e.time(t[1]),i=Math.min(1,(t[0].getTime()-t[1].getTime())/(this._max.value-this._min.value))),this._animation.input.min.blendTo(r,0),this._animation.input.max.blendTo(n,0),this._animation.duration.blendTo(this._duration*i,0))}},Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setDuration=function(t){this._duration=t,this._animation.duration.blendTo(t,0)},Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),t.prototype.restart=function(){this._animation.setProgressPct(0)},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz.variables[this._variableName]=this._animation,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._max=this._animation.input.max,this._min=this._animation.input.min,this._duration=this._animation.duration.value,this._layer.on("updated",(function(){t._timeSeriesWidget.progress=100*t._animation.getProgressPct(),t._timeSeriesWidget.playing=t._animation.isPlaying()})),this._timeSeriesWidget.animated=this._autoplay,this._timeSeriesWidget.addEventListener("seek",(function(e){t._animation.setProgressPct(e.detail/100),t._timeSeriesWidget.progress=e.detail})),this._timeSeriesWidget.addEventListener("play",(function(){t._animation.play()})),this._timeSeriesWidget.addEventListener("pause",(function(){t._animation.pause()}))},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:this._propertyName&&this._viz[this._propertyName]&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation()},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._columnName)),this._duration,t.fade(this._fade[0],this._fade[1]))},t}(),W=function(){function t(t){var e=t.carto,r=t.map,n=t.layer,i=t.source;if(this._vizFilters=[],this._carto=e,this._map=r,this._layer=n,this._source=i,this._id=this._layer.id,this._rebuildFilters=this._rebuildFilters.bind(this),this._updateDataLayerVariables=this._updateDataLayerVariables.bind(this),!this._carto.expressions.globalHistogram)throw new Error("Provided VL version "+this._carto.version+" lacks globalHistogram support.");if(!E.a.satisfies(this._carto.version,"^1.2.3"))throw new Error("Provided VL version "+this._carto.version+" not supported. Must satisfy ^1.2.3")}return t.prototype.numericalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,a=r.bucketRanges,s=r.weight,u=r.readOnly,l=r.totals,c=i(e),p=o(e),h=new U(this._carto,this._layer,t,c,n,s,this._source,a,u,l,p);return this._addFilter(h),h},t.prototype.categoricalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.totals,s=r.weight,u=i(e),l=o(e),c=new k(this._carto,this._layer,t,u,this._source,n,s,a,l);return this._addFilter(c),c},t.prototype.histogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,i=r.bucketRanges,o=r.readOnly,a=r.weight,s=r.totals;if(void 0===n&&void 0===i){var u=t;return this.categoricalHistogram(u,e,{readOnly:o,totals:s,weight:a})}return this.numericalHistogram(t,e,{bucketRanges:i,buckets:n,readOnly:o,totals:s,weight:a})},t.prototype.category=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.button,s=r.weight,u=i(e),l=o(e),c=new F(this._carto,this._layer,t,u,this._source,s,n,a,l);return this._addFilter(c),c},t.prototype.timeSeries=function(t,e,r){var n=this;if(void 0===r&&(r={}),this._animation)throw new Error("There can only be one animation");var i=r.buckets,o=r.bucketRanges,a=r.readOnly,s=r.totals,u=r.weight,l=r.duration,c=r.fade,p=r.variableName,h=r.propertyName,f=r.autoplay;this._animation=new B(this._carto,this._layer,e,t,(function(){"filter"===h&&n._rebuildFilters()}),l,c,p,h,f);var m=this.numericalHistogram(t,e,{bucketRanges:o,buckets:i,readOnly:a,totals:s,weight:u});return m.setTimeSeries(!0),m.on("rangeChanged",(function(t){n._animation.setRange(t)})),this._animation},t.prototype.animationControls=function(t,e,r){var n=this;void 0===r&&(r={});var i=r.duration,o=r.fade,a=r.variableName,s=r.propertyName,u=void 0===s?"filter":s,l=r.autoplay;return this._animation=new b(t,this._carto,e,a,u,i,o,l,this._layer,(function(){"filter"===u&&n._rebuildFilters()}),null),this._animation},t.prototype.globalRange=function(t,e){var r=new X(this._carto,this._layer,t,e,this._source);return this._addFilter(r),r},t.prototype.build=function(){var t=this;if(0!==this._vizFilters.length){var e=function(){t._appendVariables(),t._buildDataLayer()};this._layer.viz?e():this._layer.on("loaded",e)}},t.prototype._addFilter=function(t){t.on("filterChanged",this._rebuildFilters),t.on("expressionReady",this._updateDataLayerVariables),this._vizFilters.push(t)},t.prototype._appendVariables=function(){var t=this,e=this._carto.expressions;this._vizFilters.forEach((function(r){return t._layer.viz.variables[r.columnPropName]=e.prop(r.column)}))},t.prototype._buildDataLayer=function(){var t=this,e=this._getVariables(),r=this._carto.expressions,n=new this._carto.Viz({color:r.rgba(0,0,0,0),strokeWidth:0,variables:e});this._readOnlyLayer=new this._carto.Layer("asbind_ro_"+this._id,this._source,n),this._readOnlyLayer.addTo(this._map),this._vizFilters.forEach((function(e){return e.setDataLayer(t._readOnlyLayer)}))},t.prototype._getVariables=function(){for(var t=void 0!==this._readOnlyLayer?this._readOnlyLayer.viz.variables:{},e=0,r=this._vizFilters;e<r.length;e++){var n=r[e],i=n.name;n.globalExpression&&(t[i+"_global"]=n.globalExpression),n.expression&&(t[i]=n.expression),t[n.columnPropName]=this._carto.expressions.prop(n.column)}return t},t.prototype._updateDataLayerVariables=function(t){this._readOnlyLayer.viz&&(this._readOnlyLayer.viz.variables[t.name]=t.expression)},t.prototype._rebuildFilters=function(){var t=this._combineFilters(this._vizFilters.filter((function(t){return null!==t.filter})).map((function(t){return t.filter})));this._readOnlyLayer&&this._readOnlyLayer.viz.filter.blendTo(t,0),this._layer.viz.filter.isAnimated()&&this._animation&&this._layer.viz.variables[this._animation.variableName]&&(t="@"+this._animation.variableName+" and "+t),this._layer.viz.filter.blendTo(t,0),this._animation&&this._animation.restart()},t.prototype._combineFilters=function(t){return 0===t.length?"1":t.join(" and ")},t}(),$=W,Y={Bridge:W,Layers:a,Legends:g}}])})); |
@@ -16,5 +16,6 @@ import { VLAnimation, VLTimeZoneDate } from '../../types'; | ||
constructor(animationWidget: any | string, carto: any, column: string, variableName: string, propertyName: string, duration: number, fade: [number, number], autoplay: boolean, layer: any, readyCb: () => void, formatCb: (value: number | Date | VLTimeZoneDate) => string); | ||
readonly animation: VLAnimation; | ||
readonly variableName: string; | ||
propertyName: string; | ||
get animation(): VLAnimation; | ||
get variableName(): string; | ||
get propertyName(): string; | ||
set propertyName(name: string); | ||
restart(): void; | ||
@@ -21,0 +22,0 @@ setRange(): void; |
@@ -48,3 +48,3 @@ import mitt from 'mitt'; | ||
*/ | ||
abstract readonly filter: string; | ||
abstract get filter(): string; | ||
/** | ||
@@ -59,3 +59,3 @@ * This function should be implemented by each filter to create the appropriate data source expression. For instance | ||
*/ | ||
abstract readonly expression: any; | ||
abstract get expression(): any; | ||
/** | ||
@@ -69,3 +69,3 @@ * If the filter returns this, this expression will be assigned to a variable called this.name_global | ||
*/ | ||
readonly globalExpression: any; | ||
get globalExpression(): any; | ||
/** | ||
@@ -79,3 +79,3 @@ * Returns the name of the filter. The name is a compound of the type, the column and an internal counter to prevent | ||
*/ | ||
readonly name: string; | ||
get name(): string; | ||
/** | ||
@@ -88,4 +88,4 @@ * Get the column of the filter. | ||
*/ | ||
readonly column: string; | ||
readonly columnPropName: string; | ||
get column(): string; | ||
get columnPropName(): string; | ||
/** | ||
@@ -98,3 +98,3 @@ * Get whether the filter is read only or not. | ||
*/ | ||
readonly readOnly: boolean; | ||
get readOnly(): boolean; | ||
/** | ||
@@ -107,3 +107,3 @@ * Get the currently set CARTO VL Visualization layer. | ||
*/ | ||
readonly layer: any; | ||
get layer(): any; | ||
/** | ||
@@ -116,3 +116,3 @@ * Get the current CARTO VL source. | ||
*/ | ||
readonly source: any; | ||
get source(): any; | ||
/** | ||
@@ -119,0 +119,0 @@ * Bind to an event of the filter. Currently only `filterChanged` is supported. |
@@ -29,5 +29,5 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
setDataLayer(layer: any): void; | ||
readonly filter: string; | ||
readonly expression: any; | ||
get filter(): string; | ||
get expression(): any; | ||
private selectionChanged; | ||
} |
@@ -36,3 +36,3 @@ import { BaseHistogramFilter } from './BaseHistogramFilter'; | ||
*/ | ||
readonly filter: string; | ||
get filter(): string; | ||
/** | ||
@@ -45,6 +45,6 @@ * Returns a viewportHistogram with only the column as an argument (no buckets) | ||
*/ | ||
readonly expression: any; | ||
readonly globalExpression: any; | ||
get expression(): any; | ||
get globalExpression(): any; | ||
protected bindDataLayer(): void; | ||
protected selectionChanged(evt: CustomEvent<any>): void; | ||
} |
@@ -50,3 +50,3 @@ import { BucketRange } from '../../types'; | ||
*/ | ||
readonly filter: string; | ||
get filter(): string; | ||
/** | ||
@@ -61,4 +61,4 @@ * Generates a viewportHistogram with either a number of buckets or an array of buckets. | ||
*/ | ||
readonly expression: string; | ||
readonly globalExpression: any; | ||
get expression(): string; | ||
get globalExpression(): any; | ||
/** | ||
@@ -65,0 +65,0 @@ * Mark this histogram as a the source for a time-series. |
@@ -147,9 +147,9 @@ var __assign = (this && this.__assign) || function () { | ||
var legendData = data.getLegendData(config).data; | ||
var parsedData = legendData.map(function (legend, index, arr) { | ||
var parsedData = legendData.map(function (legend) { | ||
var _a; | ||
return __assign({}, baseStyle, (_a = {}, _a[prop] = _formatProp(vizProp, legend.value), _a.label = options.format ? options.format(legend.key, index, arr) : _formatLegendKey(data.key), _a)); | ||
return __assign(__assign({}, baseStyle), (_a = {}, _a[prop] = _formatProp(vizProp, legend.value), _a.label = options.format ? options.format(legend.key) : _formatLegendKey(data.key), _a)); | ||
}); | ||
if (Array.isArray(parsedLayer.props) && parsedLayer.props.length === legendData.length) { | ||
widget.data = parsedData.map(function (d, i) { | ||
return __assign({}, d, parsedLayer.props[i]); | ||
return __assign(__assign({}, d), parsedLayer.props[i]); | ||
}); | ||
@@ -156,0 +156,0 @@ } |
@@ -17,4 +17,4 @@ import { BaseFilter } from '../base/BaseFilter'; | ||
setDataLayer(layer: any): void; | ||
readonly filter: string; | ||
readonly expression: any; | ||
get filter(): string; | ||
get expression(): any; | ||
} |
@@ -47,6 +47,7 @@ import { VLAnimation } from '../../types'; | ||
setRange(range: [number, number] | [Date, Date]): void; | ||
readonly variableName: string; | ||
propertyName: string; | ||
get variableName(): string; | ||
get propertyName(): string; | ||
set propertyName(name: string); | ||
setDuration(duration: number): void; | ||
readonly animation: VLAnimation; | ||
get animation(): VLAnimation; | ||
restart(): void; | ||
@@ -53,0 +54,0 @@ /** |
{ | ||
"name": "@carto/airship-bridge", | ||
"version": "2.3.2-rc.0", | ||
"version": "2.3.2-rc.1", | ||
"description": "Airship bridge to other libs (CARTO VL, CARTO.js)", | ||
@@ -17,8 +17,8 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "23.3.10", | ||
"jest": "23.6.0", | ||
"ts-jest": "^23.10.5", | ||
"@types/jest": "25.2.1", | ||
"jest": "26.0.1", | ||
"ts-jest": "25.5.0", | ||
"ts-loader": "^5.3.1", | ||
"tslint": "^5.20.1", | ||
"typescript": "3.5.3", | ||
"typescript": "3.8.3", | ||
"webpack": "^4.27.0", | ||
@@ -30,3 +30,3 @@ "webpack-cli": "^3.1.2" | ||
}, | ||
"gitHead": "a70c873ba209ddc0ed5c7ce67e461b6efb55c329" | ||
"gitHead": "3b1947d8d30c2f56fdea328ce356c3e5bc0a7397" | ||
} |
@@ -181,7 +181,7 @@ import { select } from '../../util/Utils'; | ||
const legendData = data.getLegendData(config).data; | ||
const parsedData = legendData.map((legend, index, arr) => { | ||
const parsedData = legendData.map((legend) => { | ||
return { | ||
...baseStyle, | ||
[prop]: _formatProp(vizProp, legend.value), | ||
label: options.format ? options.format(legend.key, index, arr) : _formatLegendKey(data.key) | ||
label: options.format ? options.format(legend.key) : _formatLegendKey(data.key) | ||
}; | ||
@@ -188,0 +188,0 @@ }); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
418542
5875
0