Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@globalfishingwatch/dataviews-client

Package Overview
Dependencies
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@globalfishingwatch/dataviews-client - npm Package Compare versions

Comparing version 12.0.1 to 12.1.0

dist/resources-slice-9aea02d4.js

2

dist/dataviews-client.js

@@ -1,2 +0,2 @@

export{D as default}from"./resources-slice-f89b2d8b.js";import"lodash";import"@globalfishingwatch/api-client";import"@globalfishingwatch/api-types";import"@globalfishingwatch/layer-composer/dist/generators";import"@globalfishingwatch/layer-composer";import"@globalfishingwatch/fourwings-aggregate";import"@reduxjs/toolkit";import"luxon";import"@globalfishingwatch/data-transforms";
export{D as default}from"./resources-slice-9aea02d4.js";import"lodash";import"@globalfishingwatch/api-client";import"@globalfishingwatch/api-types";import"luxon";import"@globalfishingwatch/fourwings-aggregate";import"@globalfishingwatch/data-transforms";import"@globalfishingwatch/layer-composer";import"@reduxjs/toolkit";
//# sourceMappingURL=dataviews-client.js.map

@@ -1,2 +0,2 @@

import{_ as t,r as n,a,b as o,c as l}from"./resources-slice-f89b2d8b.js";export{D as default,f as fetchResourceThunk,m as mergeWorkspaceUrlDataviewInstances,r as resolveDataviewDatasetResource,b as resolveDataviewEventsResources,d as resolveDataviews,e as resolveEndpoint,g as resourcesSlice,h as selectResourceByUrl,s as selectResources,i as selectResourcesLoading}from"./resources-slice-f89b2d8b.js";import{uniq as u}from"lodash";import{DatasetStatus as c,DatasetTypes as v,DatasetCategory as p,DataviewCategory as y,EndpointId as w}from"@globalfishingwatch/api-types";import{Generators as M,Group as x,DEFAULT_HEATMAP_INTERVALS as k,COLOR_RAMP_DEFAULT_NUM_STEPS as N}from"@globalfishingwatch/layer-composer";import{AggregationOperation as T,VALUE_MULTIPLIER as A}from"@globalfishingwatch/fourwings-aggregate";import"@globalfishingwatch/api-client";import"@globalfishingwatch/layer-composer/dist/generators";import"@reduxjs/toolkit";import"luxon";import"@globalfishingwatch/data-transforms";function S(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function E(t){let n=t,e=t;function r(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r}return 1===t.length&&(n=(n,e)=>t(n)-e,e=function(t){return(n,e)=>S(t(n),e)}(t)),{left:r,center:function(t,e,i,a){null==i&&(i=0),null==a&&(a=t.length);const o=r(t,e,i,a-1);return o>i&&n(t[o-1],e)>-n(t[o],e)?o-1:o},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}const R=E(S).right;E((function(t){return null===t?NaN:+t})).center;var I=R,U=Math.sqrt(50),j=Math.sqrt(10),C=Math.sqrt(2);function H(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=U?10:a>=j?5:a>=C?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=U?10:a>=j?5:a>=C?2:1)}function F(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function q(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function $(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function z(){}var L=1/.7,_="\\s*([+-]?\\d+)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V=/^#([0-9a-f]{3,8})$/,Z=new RegExp("^rgb\\("+[_,_,_]+"\\)$"),B=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),W=new RegExp("^rgba\\("+[_,_,_,O]+"\\)$"),G=new RegExp("^rgba\\("+[P,P,P,O]+"\\)$"),X=new RegExp("^hsl\\("+[O,P,P]+"\\)$"),Y=new RegExp("^hsla\\("+[O,P,P,O]+"\\)$"),J={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function K(){return this.rgb().formatHex()}function Q(){return this.rgb().formatRgb()}function tt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=V.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?nt(n):3===e?new at(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?et(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?et(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Z.exec(t))?new at(n[1],n[2],n[3],1):(n=B.exec(t))?new at(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=W.exec(t))?et(n[1],n[2],n[3],n[4]):(n=G.exec(t))?et(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=X.exec(t))?st(n[1],n[2]/100,n[3]/100,1):(n=Y.exec(t))?st(n[1],n[2]/100,n[3]/100,n[4]):J.hasOwnProperty(t)?nt(J[t]):"transparent"===t?new at(NaN,NaN,NaN,0):null}function nt(t){return new at(t>>16&255,t>>8&255,255&t,1)}function et(t,n,e,r){return r<=0&&(t=n=e=NaN),new at(t,n,e,r)}function rt(t){return t instanceof z||(t=tt(t)),t?new at((t=t.rgb()).r,t.g,t.b,t.opacity):new at}function it(t,n,e,r){return 1===arguments.length?rt(t):new at(t,n,e,null==r?1:r)}function at(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ot(){return"#"+ut(this.r)+ut(this.g)+ut(this.b)}function lt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ut(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function st(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new dt(t,n,e,r)}function ct(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);if(t instanceof z||(t=tt(t)),!t)return new dt;if(t instanceof dt)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),o=NaN,l=a-i,u=(a+i)/2;return l?(o=n===a?(e-r)/l+6*(e<r):e===a?(r-n)/l+2:(n-e)/l+4,l/=u<.5?a+i:2-a-i,o*=60):l=u>0&&u<1?0:o,new dt(o,l,u,t.opacity)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ht(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}q(z,tt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:K,formatHex:K,formatHsl:function(){return ct(this).formatHsl()},formatRgb:Q,toString:Q}),q(at,it,$(z,{brighter:function(t){return t=null==t?L:Math.pow(L,t),new at(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new at(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ot,formatHex:ot,formatRgb:lt,toString:lt})),q(dt,(function(t,n,e,r){return 1===arguments.length?ct(t):new dt(t,n,e,null==r?1:r)}),$(z,{brighter:function(t){return t=null==t?L:Math.pow(L,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new at(ht(t>=240?t-240:t+120,i,r),ht(t,i,r),ht(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ft=t=>()=>t;function gt(t){return 1==(t=+t)?vt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ft(isNaN(n)?e:n)}}function vt(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):ft(isNaN(t)?n:t)}var pt=function t(n){var e=gt(n);function r(t,n){var r=e((t=it(t)).r,(n=it(n)).r),i=e(t.g,n.g),a=e(t.b,n.b),o=vt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=a(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function mt(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(a){for(e=0;e<r;++e)i[e]=t[e]*(1-a)+n[e]*a;return i}}function yt(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(e=0;e<i;++e)a[e]=Tt(t[e],n[e]);for(;e<r;++e)o[e]=n[e];return function(t){for(e=0;e<i;++e)o[e]=a[e](t);return o}}function bt(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function wt(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function Mt(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=Tt(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var xt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kt=new RegExp(xt.source,"g");function Nt(t,n){var e,r,i,a=xt.lastIndex=kt.lastIndex=0,o=-1,l=[],u=[];for(t+="",n+="";(e=xt.exec(t))&&(r=kt.exec(n));)(i=r.index)>a&&(i=n.slice(a,i),l[o]?l[o]+=i:l[++o]=i),(e=e[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:wt(e,r)})),a=kt.lastIndex;return a<n.length&&(i=n.slice(a),l[o]?l[o]+=i:l[++o]=i),l.length<2?u[0]?function(t){return function(n){return t(n)+""}}(u[0].x):function(t){return function(){return t}}(n):(n=u.length,function(t){for(var e,r=0;r<n;++r)l[(e=u[r]).i]=e.x(t);return l.join("")})}function Tt(t,n){var e,r,i=typeof n;return null==n||"boolean"===i?ft(n):("number"===i?wt:"string"===i?(e=tt(n))?(n=e,pt):Nt:n instanceof tt?pt:n instanceof Date?bt:(r=n,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(n)?yt:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?Mt:wt:mt))(t,n)}function At(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}function St(t){return+t}var Et=[0,1];function Rt(t){return t}function Dt(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function It(t,n,e){var r=t[0],i=t[1],a=n[0],o=n[1];return i<r?(r=Dt(i,r),a=e(o,a)):(r=Dt(r,i),a=e(a,o)),function(t){return a(r(t))}}function Ut(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<r;)i[o]=Dt(t[o],t[o+1]),a[o]=e(n[o],n[o+1]);return function(n){var e=I(t,n,1,r)-1;return a[e](i[e](n))}}function jt(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ct(){var t,n,e,r,i,a,o=Et,l=Et,u=Tt,s=Rt;function c(){var t=Math.min(o.length,l.length);return s!==Rt&&(s=function(t,n){var e;return t>n&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(o[0],o[t-1])),r=t>2?Ut:It,i=a=null,d}function d(n){return isNaN(n=+n)?e:(i||(i=r(o.map(t),l,u)))(t(s(n)))}return d.invert=function(e){return s(n((a||(a=r(l,o.map(t),wt)))(e)))},d.domain=function(t){return arguments.length?(o=Array.from(t,St),c()):o.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),c()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),u=At,c()},d.clamp=function(t){return arguments.length?(s=!!t||Rt,c()):s!==Rt},d.interpolate=function(t){return arguments.length?(u=t,c()):u},d.unknown=function(t){return arguments.length?(e=t,d):e},function(e,r){return t=e,n=r,c()}}function Ht(){return Ct()(Rt,Rt)}function Ft(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function qt(t){return(t=Ft(Math.abs(t)))?t[1]:NaN}var $t,zt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lt(t){if(!(n=zt.exec(t)))throw new Error("invalid format: "+t);var n;return new _t({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function _t(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ot(t,n){var e=Ft(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Lt.prototype=_t.prototype,_t.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Pt={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Ot(100*t,n),r:Ot,s:function(t,n){var e=Ft(t,n);if(!e)return t+"";var r=e[0],i=e[1],a=i-($t=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ft(t,Math.max(0,n+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Vt(t){return t}var Zt,Bt,Wt,Gt=Array.prototype.map,Xt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yt(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Vt:(n=Gt.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,l=n[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),a.push(t.substring(i-=l,i+l)),!((u+=l+1)>r));)l=n[o=(o+1)%n.length];return a.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?Vt:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Gt.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function d(t){var n=(t=Lt(t)).fill,e=t.align,d=t.sign,h=t.symbol,f=t.zero,g=t.width,v=t.comma,p=t.precision,m=t.trim,y=t.type;"n"===y?(v=!0,y="g"):Pt[y]||(void 0===p&&(p=12),m=!0,y="g"),(f||"0"===n&&"="===e)&&(f=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===h?a:/[%p]/.test(y)?u:"",M=Pt[y],x=/[defgprs%]/.test(y);function k(t){var i,a,u,h=b,k=w;if("c"===y)k=M(t)+k,t="";else{var N=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:M(Math.abs(t),p),m&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),N&&0==+t&&"+"!==d&&(N=!1),h=(N?"("===d?d:s:"-"===d||"("===d?"":d)+h,k=("s"===y?Xt[8+$t/3]:"")+k+(N&&"("===d?")":""),x)for(i=-1,a=t.length;++i<a;)if(48>(u=t.charCodeAt(i))||u>57){k=(46===u?o+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}v&&!f&&(t=r(t,1/0));var T=h.length+t.length+k.length,A=T<g?new Array(g-T+1).join(n):"";switch(v&&f&&(t=r(A+t,A.length?g-k.length:1/0),A=""),e){case"<":t=h+t+k+A;break;case"=":t=h+A+t+k;break;case"^":t=A.slice(0,T=A.length>>1)+h+t+k+A.slice(T);break;default:t=A+h+t+k}return l(t)}return p=void 0===p?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),k.toString=function(){return t+""},k}return{format:d,formatPrefix:function(t,n){var e=d(((t=Lt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(qt(n)/3))),i=Math.pow(10,-r),a=Xt[8+r/3];return function(t){return e(i*t)+a}}}}function Jt(t,n,e,r){var i,a=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=U?i*=10:a>=j?i*=5:a>=C&&(i*=2),n<t?-i:i}(t,n,e);switch((r=Lt(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(qt(n)/3)))-qt(Math.abs(t)))}(a,o))||(r.precision=i),Wt(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,qt(n)-qt(t))+1}(a,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-qt(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Bt(r)}function Kt(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){var r,i,a,o,l=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(o=H(t,n,e))||!isFinite(o))return[];if(o>0){let e=Math.round(t/o),r=Math.round(n/o);for(e*o<t&&++e,r*o>n&&--r,a=new Array(i=r-e+1);++l<i;)a[l]=(e+l)*o}else{o=-o;let e=Math.round(t*o),r=Math.round(n*o);for(e/o<t&&++e,r/o>n&&--r,a=new Array(i=r-e+1);++l<i;)a[l]=(e+l)/o}return r&&a.reverse(),a}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return Jt(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,a=n(),o=0,l=a.length-1,u=a[o],s=a[l],c=10;for(s<u&&(i=u,u=s,s=i,i=o,o=l,l=i);c-- >0;){if((i=H(u,s,e))===r)return a[o]=u,a[l]=s,n(a);if(i>0)u=Math.floor(u/i)*i,s=Math.ceil(s/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,s=Math.floor(s*i)/i}r=i}return t},t}function Qt(){var t=Ht();return t.copy=function(){return jt(t,Qt())},F.apply(t,arguments),Kt(t)}Zt=Yt({thousands:",",grouping:[3],currency:["$",""]}),Bt=Zt.format,Wt=Zt.formatPrefix;var tn="__",nn="mergedAnimatedHeatmap",en=function(t){var n=new Date(t);return new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes()))};function rn(e,r,i){var l,u,s,d,h,f,g,m,b,k,S,E,R,D,I,U,j,C,H,F,q,$,z,L,_,O,P,V,Z=r||{},B=Z.debug,W=void 0!==B&&B,G=Z.highlightedTime,X=Z.highlightedEvent,Y=t({id:e.id},e.config);switch(null===(l=e.config)||void 0===l?void 0:l.type){case M.Type.TileCluster:var J=n(e,v.Events),K=J.dataset,Q=J.url;return K&&Q?(Y.tilesUrl=Q,t(t({},Y),X&&{currentEventId:X.id})):(console.warn("No dataset config for TileCluster generator",e),[]);case M.Type.Track:G&&(Y.highlightedTime=G);var tt=e.datasets&&(null===(s=null===(u=e.datasets)||void 0===u?void 0:u[0])||void 0===s?void 0:s.type)===v.UserTracks?v.UserTracks:v.Tracks,nt=n(e,tt).url;if(nt&&(null==i?void 0:i[nt])){var et=null==i?void 0:i[nt];Y.data=et.data}var rt=o(e);if((null==rt?void 0:rt.length)&&rt.some((function(t){var n,e=t.url;return null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.data}))){var it=rt.flatMap((function(t){var n,e=t.url;return e?null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.data:[]})),at=t({id:e.id+"__vessel_events",event:null===(d=e.config)||void 0===d?void 0:d.event,pointsToSegmentsSwitchLevel:null===(h=e.config)||void 0===h?void 0:h.pointsToSegmentsSwitchLevel,type:M.Type.VesselEvents,showIcons:null===(f=e.config)||void 0===f?void 0:f.showIcons,showAuthorizationStatus:null===(g=e.config)||void 0===g?void 0:g.showAuthorizationStatus,data:it,color:null===(m=e.config)||void 0===m?void 0:m.color,track:Y.data},X&&{currentEventId:X.id});return[Y,at]}return Y;case M.Type.Heatmap:var ot=null===(b=e.datasets)||void 0===b?void 0:b.find((function(t){return t.type===v.Fourwings})),lt=null===(k=null==ot?void 0:ot.endpoints)||void 0===k?void 0:k.find((function(t){return t.id===w.FourwingsTiles})),ut=null===(S=null==ot?void 0:ot.endpoints)||void 0===S?void 0:S.find((function(t){return t.id===w.FourwingsLegend}));return Y=t(t({},Y),{maxZoom:e.config.maxZoom||8,fetchStats:!e.config.breaks,static:e.config.static||!1,datasets:[null==ot?void 0:ot.id],tilesUrl:null==lt?void 0:lt.pathTemplate,statsUrl:null==ut?void 0:ut.pathTemplate,metadata:{color:null===(E=null==e?void 0:e.config)||void 0===E?void 0:E.color,group:x.OutlinePolygonsBackground,interactive:!0,legend:{label:null==ot?void 0:ot.name,unit:null==ot?void 0:ot.unit}}});case M.Type.HeatmapAnimated:var st=e.category===y.Environment,ct={},dt=null===(R=e.datasets)||void 0===R?void 0:R.find((function(t){return t.type===v.Fourwings}));if(st){var ht=e.config.datasets||(null===(D=e.datasetsConfig)||void 0===D?void 0:D.map((function(t){return t.datasetId})));ct={sublayers:[{id:Y.id,colorRamp:null===(I=e.config)||void 0===I?void 0:I.colorRamp,colorRampWhiteEnd:!1,visible:null===(j=null===(U=e.config)||void 0===U?void 0:U.visible)||void 0===j||j,breaks:null===(C=e.config)||void 0===C?void 0:C.breaks,datasets:ht,legend:{label:null==dt?void 0:dt.name,unit:null==dt?void 0:dt.unit,color:null==e?void 0:e.config.color}}],maxZoom:8,mode:M.HeatmapAnimatedMode.Single,aggregationOperation:T.Avg,interactive:!0,breaksMultiplier:(null===(H=e.config)||void 0===H?void 0:H.breaksMultiplier)||A,interval:(null===(F=e.config)||void 0===F?void 0:F.interval)||"month"}}var ft=null===(q=(Y=t(t({},Y),ct)).sublayers)||void 0===q?void 0:q.some((function(t){return!0===t.visible})),gt=(O=e.datasets,P=null==O?void 0:O.flatMap((function(t){return(null==t?void 0:t.startDate)?new Date(t.startDate).getTime():[]})),V=null==O?void 0:O.flatMap((function(t){return(null==t?void 0:t.endDate)?new Date(t.endDate).getTime():[]})),{extentStart:(null==P?void 0:P.length)?en(Math.min.apply(Math,P)).toISOString():void 0,extentEnd:(null==V?void 0:V.length)?en(Math.max.apply(Math,V)).toISOString():void 0}),vt=gt.extentStart,pt=gt.extentEnd;return Y=t(t(t(t({},Y),{visible:ft,debug:W,debugLabels:W}),vt&&{datasetsStart:vt}),pt&&{datasetsEnd:pt});case M.Type.Context:case M.Type.UserContext:if(Array.isArray(e.config.layers))return(null===($=e.config.layers)||void 0===$?void 0:$.flatMap((function(t){var r=t.id,i=t.dataset,a=n(e,i),o=a.dataset,l=a.url;return l&&(null==o?void 0:o.status)===c.Done?{id:r,tilesUrl:l,attribution:null==o?void 0:o.source}:[]}))).map((function(n){var r=n.id,i=n.tilesUrl,a=n.attribution;return t(t({},Y),{id:e.id+"__"+r,layer:r,attribution:a,tilesUrl:i})}));Y.id=e.config.layers?e.id+"__"+e.config.layers:e.id,Y.layer=e.config.layers;var mt=n(e,v.Context),yt=(dt=mt.dataset,mt.url);if((null==dt?void 0:dt.status)!==c.Done)return[];if(yt&&(Y.tilesUrl=yt),(null==dt?void 0:dt.source)&&(Y.attribution=dt.source),dt.category===p.Environment){var bt=(null===(z=dt.configuration)||void 0===z?void 0:z.propertyToIncludeRange)||{},wt=bt.min,Mt=bt.max,xt=Qt().range([wt,Mt]).domain([0,1]),kt=N,Nt=a([],Array(kt)).map((function(t,n){var e;return parseFloat(null===(e=n/(kt-1))||void 0===e?void 0:e.toFixed(2))})).map((function(t){var n;return parseFloat(null===(n=xt(t))||void 0===n?void 0:n.toFixed(3))}));Y.steps=Nt}else dt.category===p.Context&&(null===(L=e.config)||void 0===L?void 0:L.type)===M.Type.UserContext&&(Y.disableInteraction=null===(_=dt.configuration)||void 0===_?void 0:_.disableInteraction);return Y.tilesUrl?Y:(console.warn("Missing tiles url for dataview",e),[]);default:return Y}}function an(n,e,r){var i=(e||{}).heatmapAnimatedMode,a=void 0===i?M.HeatmapAnimatedMode.Compare:i,o=[],l=n.filter((function(t){var n,e=(t.category===y.Fishing||t.category===y.Presence)&&(null===(n=t.config)||void 0===n?void 0:n.type)===M.Type.HeatmapAnimated;return e&&o.push(t),!e}));if(o.length){var s=o.flatMap((function(t){var n,e,r,i,a,o=t.config,l=t.datasetsConfig;if(!o||!l||!l.length)return[];var s=o.datasets||l.map((function(t){return t.datasetId})),c=u(null===(n=t.datasets)||void 0===n?void 0:n.map((function(t){return t.unit})));if(1!==c.length)throw new Error("Shouldnt have distinct units for the same heatmap layer");var d=u(null===(e=t.datasets)||void 0===e?void 0:e.map((function(t){var n;return(null===(n=t.configuration)||void 0===n?void 0:n.type)||"fishing-effort"})));if(1!==d.length)throw new Error("Shouldnt have distinct dataset config types for the same heatmap layer: "+d.toString());var h="presence"===d[0]?(null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.presenceInteraction)?"presence-"+(null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.presenceInteraction):"presence":d[0];return{id:t.id,datasets:s,colorRamp:o.colorRamp,colorRampWhiteEnd:!0,filter:o.filter,visible:o.visible,legend:{label:t.name,unit:c[0],color:null===(a=null==t?void 0:t.config)||void 0===a?void 0:a.color},interactionType:h}})),c=function(t){var n=k.find((function(n){return t.every((function(t){var e;return(null===(e=t.configuration)||void 0===e?void 0:e.resolution)===n}))}));return n&&k.slice(k.findIndex((function(t){return t===n})))}(o.flatMap((function(t){return t.datasets||[]})).filter((function(t){var n;return null===(n=null==t?void 0:t.configuration)||void 0===n?void 0:n.resolution}))),d={id:e.mergedActivityGeneratorId||"mergedAnimatedHeatmap",config:t({type:M.Type.HeatmapAnimated,sublayers:s,mode:a},c&&{interval:c})};l.push(d)}return l.flatMap((function(t){return rn(t,e,r)}))}var on=function(t){return t?t.flatMap((function(t){var n,e,r,i;if((null===(n=t.config)||void 0===n?void 0:n.type)!==M.Type.Track||t.deleted)return[];var u=[];if(!0===t.config.visible){var s=t.datasets&&(null===(r=null===(e=t.datasets)||void 0===e?void 0:e[0])||void 0===r?void 0:r.type)===v.UserTracks?v.UserTracks:v.Tracks;i=l(t,s),u=o(t)}var c=l(t,v.Vessels);return a([i,c],u).filter((function(t){return t}))})):[]};export{nn as MERGED_ACTIVITY_ANIMATED_HEATMAP_GENERATOR_ID,tn as MULTILAYER_SEPARATOR,an as getDataviewsGeneratorConfigs,rn as getGeneratorConfig,on as resolveDataviewsResourceQueries};
import{_ as t,r as n,a,b as o,c as l}from"./resources-slice-9aea02d4.js";export{D as default,f as fetchResourceThunk,m as mergeWorkspaceUrlDataviewInstances,r as resolveDataviewDatasetResource,b as resolveDataviewEventsResources,d as resolveDataviews,e as resolveEndpoint,g as resourcesSlice,h as selectResourceByUrl,s as selectResources,i as selectResourcesLoading}from"./resources-slice-9aea02d4.js";import{uniq as u}from"lodash";import{DatasetStatus as c,DatasetTypes as v,DatasetCategory as p,DataviewCategory as y,EndpointId as w}from"@globalfishingwatch/api-types";import{Generators as M,Group as x,DEFAULT_HEATMAP_INTERVALS as k,COLOR_RAMP_DEFAULT_NUM_STEPS as N}from"@globalfishingwatch/layer-composer";import{AggregationOperation as T,VALUE_MULTIPLIER as A}from"@globalfishingwatch/fourwings-aggregate";import"@globalfishingwatch/api-client";import"luxon";import"@globalfishingwatch/data-transforms";import"@reduxjs/toolkit";function S(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function E(t){let n=t,e=t;function r(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const a=r+i>>>1;e(t[a],n)<0?r=a+1:i=a}return r}return 1===t.length&&(n=(n,e)=>t(n)-e,e=function(t){return(n,e)=>S(t(n),e)}(t)),{left:r,center:function(t,e,i,a){null==i&&(i=0),null==a&&(a=t.length);const o=r(t,e,i,a-1);return o>i&&n(t[o-1],e)>-n(t[o],e)?o-1:o},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const a=r+i>>>1;e(t[a],n)>0?i=a:r=a+1}return r}}}const R=E(S).right;E((function(t){return null===t?NaN:+t})).center;var I=R,U=Math.sqrt(50),j=Math.sqrt(10),C=Math.sqrt(2);function H(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=U?10:a>=j?5:a>=C?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=U?10:a>=j?5:a>=C?2:1)}function F(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function q(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function $(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function z(){}var L=1/.7,_="\\s*([+-]?\\d+)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V=/^#([0-9a-f]{3,8})$/,Z=new RegExp("^rgb\\("+[_,_,_]+"\\)$"),B=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),W=new RegExp("^rgba\\("+[_,_,_,O]+"\\)$"),G=new RegExp("^rgba\\("+[P,P,P,O]+"\\)$"),X=new RegExp("^hsl\\("+[O,P,P]+"\\)$"),Y=new RegExp("^hsla\\("+[O,P,P,O]+"\\)$"),J={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function K(){return this.rgb().formatHex()}function Q(){return this.rgb().formatRgb()}function tt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=V.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?nt(n):3===e?new at(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?et(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?et(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Z.exec(t))?new at(n[1],n[2],n[3],1):(n=B.exec(t))?new at(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=W.exec(t))?et(n[1],n[2],n[3],n[4]):(n=G.exec(t))?et(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=X.exec(t))?st(n[1],n[2]/100,n[3]/100,1):(n=Y.exec(t))?st(n[1],n[2]/100,n[3]/100,n[4]):J.hasOwnProperty(t)?nt(J[t]):"transparent"===t?new at(NaN,NaN,NaN,0):null}function nt(t){return new at(t>>16&255,t>>8&255,255&t,1)}function et(t,n,e,r){return r<=0&&(t=n=e=NaN),new at(t,n,e,r)}function rt(t){return t instanceof z||(t=tt(t)),t?new at((t=t.rgb()).r,t.g,t.b,t.opacity):new at}function it(t,n,e,r){return 1===arguments.length?rt(t):new at(t,n,e,null==r?1:r)}function at(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ot(){return"#"+ut(this.r)+ut(this.g)+ut(this.b)}function lt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ut(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function st(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new dt(t,n,e,r)}function ct(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);if(t instanceof z||(t=tt(t)),!t)return new dt;if(t instanceof dt)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),o=NaN,l=a-i,u=(a+i)/2;return l?(o=n===a?(e-r)/l+6*(e<r):e===a?(r-n)/l+2:(n-e)/l+4,l/=u<.5?a+i:2-a-i,o*=60):l=u>0&&u<1?0:o,new dt(o,l,u,t.opacity)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ht(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}q(z,tt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:K,formatHex:K,formatHsl:function(){return ct(this).formatHsl()},formatRgb:Q,toString:Q}),q(at,it,$(z,{brighter:function(t){return t=null==t?L:Math.pow(L,t),new at(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new at(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ot,formatHex:ot,formatRgb:lt,toString:lt})),q(dt,(function(t,n,e,r){return 1===arguments.length?ct(t):new dt(t,n,e,null==r?1:r)}),$(z,{brighter:function(t){return t=null==t?L:Math.pow(L,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new at(ht(t>=240?t-240:t+120,i,r),ht(t,i,r),ht(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ft=t=>()=>t;function gt(t){return 1==(t=+t)?vt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ft(isNaN(n)?e:n)}}function vt(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):ft(isNaN(t)?n:t)}var pt=function t(n){var e=gt(n);function r(t,n){var r=e((t=it(t)).r,(n=it(n)).r),i=e(t.g,n.g),a=e(t.b,n.b),o=vt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=a(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function mt(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(a){for(e=0;e<r;++e)i[e]=t[e]*(1-a)+n[e]*a;return i}}function yt(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(e=0;e<i;++e)a[e]=Tt(t[e],n[e]);for(;e<r;++e)o[e]=n[e];return function(t){for(e=0;e<i;++e)o[e]=a[e](t);return o}}function bt(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function wt(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function Mt(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=Tt(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var xt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kt=new RegExp(xt.source,"g");function Nt(t,n){var e,r,i,a=xt.lastIndex=kt.lastIndex=0,o=-1,l=[],u=[];for(t+="",n+="";(e=xt.exec(t))&&(r=kt.exec(n));)(i=r.index)>a&&(i=n.slice(a,i),l[o]?l[o]+=i:l[++o]=i),(e=e[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:wt(e,r)})),a=kt.lastIndex;return a<n.length&&(i=n.slice(a),l[o]?l[o]+=i:l[++o]=i),l.length<2?u[0]?function(t){return function(n){return t(n)+""}}(u[0].x):function(t){return function(){return t}}(n):(n=u.length,function(t){for(var e,r=0;r<n;++r)l[(e=u[r]).i]=e.x(t);return l.join("")})}function Tt(t,n){var e,r,i=typeof n;return null==n||"boolean"===i?ft(n):("number"===i?wt:"string"===i?(e=tt(n))?(n=e,pt):Nt:n instanceof tt?pt:n instanceof Date?bt:(r=n,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(n)?yt:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?Mt:wt:mt))(t,n)}function At(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}function St(t){return+t}var Et=[0,1];function Rt(t){return t}function Dt(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function It(t,n,e){var r=t[0],i=t[1],a=n[0],o=n[1];return i<r?(r=Dt(i,r),a=e(o,a)):(r=Dt(r,i),a=e(a,o)),function(t){return a(r(t))}}function Ut(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<r;)i[o]=Dt(t[o],t[o+1]),a[o]=e(n[o],n[o+1]);return function(n){var e=I(t,n,1,r)-1;return a[e](i[e](n))}}function jt(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ct(){var t,n,e,r,i,a,o=Et,l=Et,u=Tt,s=Rt;function c(){var t=Math.min(o.length,l.length);return s!==Rt&&(s=function(t,n){var e;return t>n&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(o[0],o[t-1])),r=t>2?Ut:It,i=a=null,d}function d(n){return isNaN(n=+n)?e:(i||(i=r(o.map(t),l,u)))(t(s(n)))}return d.invert=function(e){return s(n((a||(a=r(l,o.map(t),wt)))(e)))},d.domain=function(t){return arguments.length?(o=Array.from(t,St),c()):o.slice()},d.range=function(t){return arguments.length?(l=Array.from(t),c()):l.slice()},d.rangeRound=function(t){return l=Array.from(t),u=At,c()},d.clamp=function(t){return arguments.length?(s=!!t||Rt,c()):s!==Rt},d.interpolate=function(t){return arguments.length?(u=t,c()):u},d.unknown=function(t){return arguments.length?(e=t,d):e},function(e,r){return t=e,n=r,c()}}function Ht(){return Ct()(Rt,Rt)}function Ft(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function qt(t){return(t=Ft(Math.abs(t)))?t[1]:NaN}var $t,zt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lt(t){if(!(n=zt.exec(t)))throw new Error("invalid format: "+t);var n;return new _t({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function _t(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ot(t,n){var e=Ft(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Lt.prototype=_t.prototype,_t.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Pt={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Ot(100*t,n),r:Ot,s:function(t,n){var e=Ft(t,n);if(!e)return t+"";var r=e[0],i=e[1],a=i-($t=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ft(t,Math.max(0,n+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Vt(t){return t}var Zt,Bt,Wt,Gt=Array.prototype.map,Xt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yt(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Vt:(n=Gt.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,l=n[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),a.push(t.substring(i-=l,i+l)),!((u+=l+1)>r));)l=n[o=(o+1)%n.length];return a.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?Vt:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Gt.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function d(t){var n=(t=Lt(t)).fill,e=t.align,d=t.sign,h=t.symbol,f=t.zero,g=t.width,v=t.comma,p=t.precision,m=t.trim,y=t.type;"n"===y?(v=!0,y="g"):Pt[y]||(void 0===p&&(p=12),m=!0,y="g"),(f||"0"===n&&"="===e)&&(f=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===h?a:/[%p]/.test(y)?u:"",M=Pt[y],x=/[defgprs%]/.test(y);function k(t){var i,a,u,h=b,k=w;if("c"===y)k=M(t)+k,t="";else{var N=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:M(Math.abs(t),p),m&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),N&&0==+t&&"+"!==d&&(N=!1),h=(N?"("===d?d:s:"-"===d||"("===d?"":d)+h,k=("s"===y?Xt[8+$t/3]:"")+k+(N&&"("===d?")":""),x)for(i=-1,a=t.length;++i<a;)if(48>(u=t.charCodeAt(i))||u>57){k=(46===u?o+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}v&&!f&&(t=r(t,1/0));var T=h.length+t.length+k.length,A=T<g?new Array(g-T+1).join(n):"";switch(v&&f&&(t=r(A+t,A.length?g-k.length:1/0),A=""),e){case"<":t=h+t+k+A;break;case"=":t=h+A+t+k;break;case"^":t=A.slice(0,T=A.length>>1)+h+t+k+A.slice(T);break;default:t=A+h+t+k}return l(t)}return p=void 0===p?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),k.toString=function(){return t+""},k}return{format:d,formatPrefix:function(t,n){var e=d(((t=Lt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(qt(n)/3))),i=Math.pow(10,-r),a=Xt[8+r/3];return function(t){return e(i*t)+a}}}}function Jt(t,n,e,r){var i,a=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=U?i*=10:a>=j?i*=5:a>=C&&(i*=2),n<t?-i:i}(t,n,e);switch((r=Lt(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(qt(n)/3)))-qt(Math.abs(t)))}(a,o))||(r.precision=i),Wt(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,qt(n)-qt(t))+1}(a,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-qt(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Bt(r)}function Kt(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){var r,i,a,o,l=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(o=H(t,n,e))||!isFinite(o))return[];if(o>0){let e=Math.round(t/o),r=Math.round(n/o);for(e*o<t&&++e,r*o>n&&--r,a=new Array(i=r-e+1);++l<i;)a[l]=(e+l)*o}else{o=-o;let e=Math.round(t*o),r=Math.round(n*o);for(e/o<t&&++e,r/o>n&&--r,a=new Array(i=r-e+1);++l<i;)a[l]=(e+l)/o}return r&&a.reverse(),a}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return Jt(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,a=n(),o=0,l=a.length-1,u=a[o],s=a[l],c=10;for(s<u&&(i=u,u=s,s=i,i=o,o=l,l=i);c-- >0;){if((i=H(u,s,e))===r)return a[o]=u,a[l]=s,n(a);if(i>0)u=Math.floor(u/i)*i,s=Math.ceil(s/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,s=Math.floor(s*i)/i}r=i}return t},t}function Qt(){var t=Ht();return t.copy=function(){return jt(t,Qt())},F.apply(t,arguments),Kt(t)}Zt=Yt({thousands:",",grouping:[3],currency:["$",""]}),Bt=Zt.format,Wt=Zt.formatPrefix;var tn="__",nn="mergedAnimatedHeatmap",en=function(t){var n=new Date(t);return new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes()))};function rn(e,r,i){var l,u,s,d,h,f,g,m,b,k,S,E,R,D,I,U,j,C,H,F,q,$,z,L,_,O,P,V,Z=r||{},B=Z.debug,W=void 0!==B&&B,G=Z.highlightedTime,X=Z.highlightedEvent,Y=t({id:e.id},e.config);switch(null===(l=e.config)||void 0===l?void 0:l.type){case M.Type.TileCluster:var J=n(e,v.Events),K=J.dataset,Q=J.url;return K&&Q?(Y.tilesUrl=Q,t(t({},Y),X&&{currentEventId:X.id})):(console.warn("No dataset config for TileCluster generator",e),[]);case M.Type.Track:G&&(Y.highlightedTime=G);var tt=e.datasets&&(null===(s=null===(u=e.datasets)||void 0===u?void 0:u[0])||void 0===s?void 0:s.type)===v.UserTracks?v.UserTracks:v.Tracks,nt=n(e,tt).url;if(nt&&(null==i?void 0:i[nt])){var et=null==i?void 0:i[nt];Y.data=et.data}var rt=o(e);if((null==rt?void 0:rt.length)&&rt.some((function(t){var n,e=t.url;return null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.data}))){var it=rt.flatMap((function(t){var n,e=t.url;return e?null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.data:[]})),at=t({id:e.id+"__vessel_events",event:null===(d=e.config)||void 0===d?void 0:d.event,pointsToSegmentsSwitchLevel:null===(h=e.config)||void 0===h?void 0:h.pointsToSegmentsSwitchLevel,type:M.Type.VesselEvents,showIcons:null===(f=e.config)||void 0===f?void 0:f.showIcons,showAuthorizationStatus:null===(g=e.config)||void 0===g?void 0:g.showAuthorizationStatus,data:it,color:null===(m=e.config)||void 0===m?void 0:m.color,track:Y.data},X&&{currentEventId:X.id});return[Y,at]}return Y;case M.Type.Heatmap:var ot=null===(b=e.datasets)||void 0===b?void 0:b.find((function(t){return t.type===v.Fourwings})),lt=null===(k=null==ot?void 0:ot.endpoints)||void 0===k?void 0:k.find((function(t){return t.id===w.FourwingsTiles})),ut=null===(S=null==ot?void 0:ot.endpoints)||void 0===S?void 0:S.find((function(t){return t.id===w.FourwingsLegend}));return Y=t(t({},Y),{maxZoom:e.config.maxZoom||8,fetchStats:!e.config.breaks,static:e.config.static||!1,datasets:[null==ot?void 0:ot.id],tilesUrl:null==lt?void 0:lt.pathTemplate,statsUrl:null==ut?void 0:ut.pathTemplate,metadata:{color:null===(E=null==e?void 0:e.config)||void 0===E?void 0:E.color,group:x.OutlinePolygonsBackground,interactive:!0,legend:{label:null==ot?void 0:ot.name,unit:null==ot?void 0:ot.unit}}});case M.Type.HeatmapAnimated:var st=e.category===y.Environment,ct={},dt=null===(R=e.datasets)||void 0===R?void 0:R.find((function(t){return t.type===v.Fourwings}));if(st){var ht=e.config.datasets||(null===(D=e.datasetsConfig)||void 0===D?void 0:D.map((function(t){return t.datasetId})));ct={sublayers:[{id:Y.id,colorRamp:null===(I=e.config)||void 0===I?void 0:I.colorRamp,colorRampWhiteEnd:!1,visible:null===(j=null===(U=e.config)||void 0===U?void 0:U.visible)||void 0===j||j,breaks:null===(C=e.config)||void 0===C?void 0:C.breaks,datasets:ht,legend:{label:null==dt?void 0:dt.name,unit:null==dt?void 0:dt.unit,color:null==e?void 0:e.config.color}}],maxZoom:8,mode:M.HeatmapAnimatedMode.Single,aggregationOperation:T.Avg,interactive:!0,breaksMultiplier:(null===(H=e.config)||void 0===H?void 0:H.breaksMultiplier)||A,interval:(null===(F=e.config)||void 0===F?void 0:F.interval)||"month"}}var ft=null===(q=(Y=t(t({},Y),ct)).sublayers)||void 0===q?void 0:q.some((function(t){return!0===t.visible})),gt=(O=e.datasets,P=null==O?void 0:O.flatMap((function(t){return(null==t?void 0:t.startDate)?new Date(t.startDate).getTime():[]})),V=null==O?void 0:O.flatMap((function(t){return(null==t?void 0:t.endDate)?new Date(t.endDate).getTime():[]})),{extentStart:(null==P?void 0:P.length)?en(Math.min.apply(Math,P)).toISOString():void 0,extentEnd:(null==V?void 0:V.length)?en(Math.max.apply(Math,V)).toISOString():void 0}),vt=gt.extentStart,pt=gt.extentEnd;return Y=t(t(t(t({},Y),{visible:ft,debug:W,debugLabels:W}),vt&&{datasetsStart:vt}),pt&&{datasetsEnd:pt});case M.Type.Context:case M.Type.UserContext:if(Array.isArray(e.config.layers))return(null===($=e.config.layers)||void 0===$?void 0:$.flatMap((function(t){var r=t.id,i=t.dataset,a=n(e,i),o=a.dataset,l=a.url;return l&&(null==o?void 0:o.status)===c.Done?{id:r,tilesUrl:l,attribution:null==o?void 0:o.source}:[]}))).map((function(n){var r=n.id,i=n.tilesUrl,a=n.attribution;return t(t({},Y),{id:e.id+"__"+r,layer:r,attribution:a,tilesUrl:i})}));Y.id=e.config.layers?e.id+"__"+e.config.layers:e.id,Y.layer=e.config.layers;var mt=n(e,v.Context),yt=(dt=mt.dataset,mt.url);if((null==dt?void 0:dt.status)!==c.Done)return[];if(yt&&(Y.tilesUrl=yt),(null==dt?void 0:dt.source)&&(Y.attribution=dt.source),dt.category===p.Environment){var bt=(null===(z=dt.configuration)||void 0===z?void 0:z.propertyToIncludeRange)||{},wt=bt.min,Mt=bt.max,xt=Qt().range([wt,Mt]).domain([0,1]),kt=N,Nt=a([],Array(kt)).map((function(t,n){var e;return parseFloat(null===(e=n/(kt-1))||void 0===e?void 0:e.toFixed(2))})).map((function(t){var n;return parseFloat(null===(n=xt(t))||void 0===n?void 0:n.toFixed(3))}));Y.steps=Nt}else dt.category===p.Context&&(null===(L=e.config)||void 0===L?void 0:L.type)===M.Type.UserContext&&(Y.disableInteraction=null===(_=dt.configuration)||void 0===_?void 0:_.disableInteraction);return Y.tilesUrl?Y:(console.warn("Missing tiles url for dataview",e),[]);default:return Y}}function an(n,e,r){var i=(e||{}).heatmapAnimatedMode,a=void 0===i?M.HeatmapAnimatedMode.Compare:i,o=[],l=n.filter((function(t){var n,e=(t.category===y.Fishing||t.category===y.Presence)&&(null===(n=t.config)||void 0===n?void 0:n.type)===M.Type.HeatmapAnimated;return e&&o.push(t),!e}));if(o.length){var s=o.flatMap((function(t){var n,e,r,i,a,o=t.config,l=t.datasetsConfig;if(!o||!l||!l.length)return[];var s=o.datasets||l.map((function(t){return t.datasetId})),c=u(null===(n=t.datasets)||void 0===n?void 0:n.map((function(t){return t.unit})));if(1!==c.length)throw new Error("Shouldnt have distinct units for the same heatmap layer");var d=u(null===(e=t.datasets)||void 0===e?void 0:e.map((function(t){var n;return(null===(n=t.configuration)||void 0===n?void 0:n.type)||"fishing-effort"})));if(1!==d.length)throw new Error("Shouldnt have distinct dataset config types for the same heatmap layer: "+d.toString());var h="presence"===d[0]?(null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.presenceInteraction)?"presence-"+(null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.presenceInteraction):"presence":d[0];return{id:t.id,datasets:s,colorRamp:o.colorRamp,colorRampWhiteEnd:!0,filter:o.filter,visible:o.visible,legend:{label:t.name,unit:c[0],color:null===(a=null==t?void 0:t.config)||void 0===a?void 0:a.color},interactionType:h}})),c=function(t){var n=k.find((function(n){return t.every((function(t){var e;return(null===(e=t.configuration)||void 0===e?void 0:e.resolution)===n}))}));return n&&k.slice(k.findIndex((function(t){return t===n})))}(o.flatMap((function(t){return t.datasets||[]})).filter((function(t){var n;return null===(n=null==t?void 0:t.configuration)||void 0===n?void 0:n.resolution}))),d={id:e.mergedActivityGeneratorId||"mergedAnimatedHeatmap",config:t({type:M.Type.HeatmapAnimated,sublayers:s,mode:a},c&&{interval:c})};l.push(d)}return l.flatMap((function(t){return rn(t,e,r)}))}var on=function(t){return t?t.flatMap((function(t){var n,e,r,i;if((null===(n=t.config)||void 0===n?void 0:n.type)!==M.Type.Track||t.deleted)return[];var u=[];if(!0===t.config.visible){var s=t.datasets&&(null===(r=null===(e=t.datasets)||void 0===e?void 0:e[0])||void 0===r?void 0:r.type)===v.UserTracks?v.UserTracks:v.Tracks;i=l(t,s),u=o(t)}var c=l(t,v.Vessels);return a([i,c],u).filter((function(t){return t}))})):[]};export{nn as MERGED_ACTIVITY_ANIMATED_HEATMAP_GENERATOR_ID,tn as MULTILAYER_SEPARATOR,an as getDataviewsGeneratorConfigs,rn as getGeneratorConfig,on as resolveDataviewsResourceQueries};
//# sourceMappingURL=index.js.map
import { Resource, ApiEvent } from '@globalfishingwatch/api-types';
import { Generators } from '@globalfishingwatch/layer-composer';
import { GeneratorDataviewConfig, Generators } from '@globalfishingwatch/layer-composer';
import { UrlDataviewInstance } from './resolve-dataviews';

@@ -21,3 +21,14 @@ export declare const MULTILAYER_SEPARATOR = "__";

declare type DataviewsGeneratorResource = Record<string, Resource>;
export declare function getGeneratorConfig(dataview: UrlDataviewInstance, params?: DataviewsGeneratorConfigsParams, resources?: DataviewsGeneratorResource): any;
export declare function getGeneratorConfig(dataview: UrlDataviewInstance, params?: DataviewsGeneratorConfigsParams, resources?: DataviewsGeneratorResource): GeneratorDataviewConfig<Generators.Type> | (GeneratorDataviewConfig<Generators.Type> | {
currentEventId?: string | undefined;
id: string;
event: any;
pointsToSegmentsSwitchLevel: any;
type: Generators.Type;
showIcons: any;
showAuthorizationStatus: any;
data: unknown[];
color: string | undefined;
track: any;
})[];
/**

@@ -24,0 +35,0 @@ * Generates generator configs to be consumed by LayerComposer, based on the list of dataviews provided,

@@ -16,7 +16,7 @@ import { Dataset, DatasetTypes, Dataview, DataviewDatasetConfig, DataviewInstance, Resource } from '@globalfishingwatch/api-types';

export declare const resolveDataviewDatasetResource: (dataview: UrlDataviewInstance, typeOrId: DatasetTypes | DatasetTypes[] | string) => {
dataset?: any;
datasetConfig?: any;
dataset?: Dataset | undefined;
datasetConfig?: DataviewDatasetConfig | undefined;
url?: string | undefined;
};
export declare const resolveDataviewResourceByDatasetType: (dataview: UrlDataviewInstance<Generators.Type>, datasetType: any) => Resource | undefined;
export declare const resolveDataviewResourceByDatasetType: (dataview: UrlDataviewInstance<Generators.Type>, datasetType: DatasetTypes) => Resource | undefined;
export declare const resolveDataviewEventsResources: (dataview: UrlDataviewInstance) => Resource[];

@@ -29,3 +29,3 @@ /**

*/
export default function resolveDataviews(dataviewInstances: UrlDataviewInstance[], dataviews: Dataview[], datasets: Dataset[]): UrlDataviewInstance<any>[];
export default function resolveDataviews(dataviewInstances: UrlDataviewInstance[], dataviews: Dataview[], datasets: Dataset[]): UrlDataviewInstance<Generators.Type>[];
//# sourceMappingURL=resolve-dataviews.d.ts.map

@@ -1,3 +0,4 @@

declare const resolveEndpoint: (dataset: any, datasetConfig: any) => string | null;
import { Dataset, DataviewDatasetConfig } from '@globalfishingwatch/api-types';
declare const resolveEndpoint: (dataset: Dataset, datasetConfig: DataviewDatasetConfig) => string | null;
export default resolveEndpoint;
//# sourceMappingURL=resolve-endpoint.d.ts.map
/// <reference types="lodash" />
import { Resource } from '@globalfishingwatch/api-types';
import { Resource, ResourceStatus } from '@globalfishingwatch/api-types';
export declare type ResourcesState = Record<any, Resource>;

@@ -7,6 +7,15 @@ export interface PartialStoreResources {

}
export declare const fetchResourceThunk: import("@reduxjs/toolkit").AsyncThunk<any, any, {}>;
export declare const fetchResourceThunk: import("@reduxjs/toolkit").AsyncThunk<{
data: unknown;
dataviewId: string | number;
dataset: import("@globalfishingwatch/api-types").Dataset;
datasetConfig: import("@globalfishingwatch/api-types").DataviewDatasetConfig;
url: string;
responseType?: import("@globalfishingwatch/api-types").ResourceResponseType | undefined;
requestType?: import("@globalfishingwatch/api-types").ResourceRequestType | undefined;
status?: ResourceStatus | undefined;
}, Resource<unknown>, {}>;
export declare const resourcesSlice: import("@reduxjs/toolkit").Slice<ResourcesState, {}, "resources">;
export declare const selectResources: (state: PartialStoreResources) => ResourcesState;
export declare const selectResourceByUrl: (<T = any>(url?: string) => import("reselect").OutputSelector<PartialStoreResources, any, (res: ResourcesState) => any>) & import("lodash").MemoizedFunction;
export declare const selectResourceByUrl: (<T = any>(url?: string) => import("reselect").OutputSelector<PartialStoreResources, Resource<T>, (res: ResourcesState) => Resource<T>>) & import("lodash").MemoizedFunction;
export declare const selectResourcesLoading: import("reselect").OutputSelector<PartialStoreResources, boolean, (res: ResourcesState) => boolean>;

@@ -13,0 +22,0 @@ declare const _default: import("redux").Reducer<ResourcesState, import("redux").AnyAction>;

{
"name": "@globalfishingwatch/dataviews-client",
"version": "12.0.1",
"version": "12.1.0",
"description": "",

@@ -59,3 +59,3 @@ "author": "satellitestudio <contact@satellitestud.io>",

},
"gitHead": "3920e886e5f677de21b4528029ba3040e1300d0e"
"gitHead": "d9ac02c075bf0933edb44bf0d1d21a6f6d05ef1c"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc