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

@nextgis/paint

Package Overview
Dependencies
Maintainers
3
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextgis/paint - npm Package Compare versions

Comparing version 1.17.0 to 1.18.0

7

lib/index.d.ts

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

import { Expression } from '@nextgis/expression';
import type { Feature } from 'geojson';

@@ -46,4 +47,2 @@ import type { PropertiesFilter } from '@nextgis/properties-filter';

export declare type Expression = [ExpressionName, ...any[]];
export declare function expressionCallback<P extends Record<string, any> = Record<string, any>>(paint: P, defaultPaint?: P, getPaintFunctions?: Record<string, GetPaintFunction>): CirclePaint | PathPaint | PinPaint | {

@@ -54,4 +53,2 @@ (feature: Feature): VectorAdapterLayerPaint;

export declare type ExpressionName = 'get' | 'match';
export declare type GeometryPaint = PathPaint & CirclePaint & PinPaint;

@@ -95,4 +92,2 @@

export declare function isExpression(value: unknown): value is Expression;
export declare function isIcon(paint: IconPaint): paint is IconPaint;

@@ -99,0 +94,0 @@

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

/** Bundle of @nextgis/paint; version: 1.17.0; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.0; author: NextGIS */
'use strict';

@@ -6,10 +6,5 @@

var expression = require('@nextgis/expression');
var propertiesFilter = require('@nextgis/properties-filter');
function isExpression(value) {
if (Array.isArray(value)) {
return true;
}
return false;
}
function isPropertiesPaint(paint) {

@@ -46,37 +41,9 @@ if (Array.isArray(paint)) {

function get(feature, args) {
const field = args[0];
return feature.properties && feature.properties[field];
}
function match(feature, args) {
const [lookup, ...cases] = args;
let property = lookup;
if (Array.isArray(lookup)) {
property = featureExpression(feature, lookup);
}
// remove last odd item from cases array
const defValue = cases.splice(-1, cases.length % 2)[0];
for (let fry = 0; fry < cases.length - 1; fry += 2) {
const key = cases[fry];
if (key === property) {
return cases[fry + 1];
function createPropertyExpressionCb(expression$1) {
return (feature) => {
const properties = feature.properties;
if (properties) {
return expression.evaluate(expression$1, properties);
}
}
return defValue;
}
const expressions = {
get,
match,
};
function featureExpression(feature, expression) {
const [name, ...args] = expression;
const expressionFun = expressions[name];
if (expressionFun) {
return expressionFun(feature, args);
}
return undefined;
}
function createPropertyExpressionCb(expression) {
return (feature) => {
return featureExpression(feature, expression);
return false;
};

@@ -92,3 +59,3 @@ }

const val = paint[p_];
if (isExpression(val)) {
if (expression.isExpression(val)) {
withExpression = true;

@@ -217,3 +184,2 @@ expressions[p_] = createPropertyExpressionCb(val);

exports.isBasePaint = isBasePaint;
exports.isExpression = isExpression;
exports.isIcon = isIcon;

@@ -220,0 +186,0 @@ exports.isPaint = isPaint;

2

lib/paint.cjs.prod.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@nextgis/properties-filter");function r(t){return!!Array.isArray(t)}function o(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return"function"==typeof t}const i={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[o,...n]=r;let e=o;Array.isArray(o)&&(e=s(t,o));const i=n.splice(-1,n.length%2)[0];for(let s=0;s<n.length-1;s+=2){if(n[s]===e)return n[s+1]}return i}};function s(t,r){const[o,...n]=r,e=i[o];if(e)return e(t,n)}function c(t){return r=>s(r,t)}const f=["iconSize","iconAnchor"];function p(t){let o=!1;const n={};for(const e in t)if(-1===f.indexOf(e)){const i=e,s=t[i];r(s)&&(o=!0,n[i]=c(s))}if(o)return r=>{const o={};for(const t in n)o[t]=n[t](r);return{...t,...o}}}function l(t,r,o){const n=p(t);if(n){const e=t=>u(n(t),r,o);return e.paint=t,e}let e={...r};return e={...e,...t},e.fill=void 0===e.fill||e.fill,e.stroke=void 0!==e.stroke?e.stroke:!e.fill||!(!e.strokeColor&&!e.strokeOpacity),e}function u(r,n,i){if(!r)throw new Error("paint is empty");let s={...n};if(e(r)){const t=t=>{const o=u(r(t),n,i);return o.type=r.type,o};return t.type=r.type,t}if(o(r))return o=>u(function(r){let o={};const n=[];for(const t of r)t&&(Array.isArray(t)?n.push(t):o=t);return r=>{const e=n.find((o=>t.featureFilter(r,o[0])));return e?{...o,...e[1]}:o}}(r)(o),n,i);if("get-paint"===r.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(r,i);t&&(s=u(t,n,i))}else{if("icon"===r.type)return r;s=l(r,n,i)}return e(s)||("color"in s&&(s.strokeColor||(s.strokeColor=s.color),s.fillColor||(s.fillColor=s.color)),"opacity"in s&&(void 0===s.strokeOpacity&&(s.strokeOpacity=s.opacity),void 0===s.fillOpacity&&(s.fillOpacity=s.opacity))),s}exports.createExpressionCallback=p,exports.expressionCallback=l,exports.isBasePaint=function(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)},exports.isExpression=r,exports.isIcon=function(t){return"icon"===t.type||"html"in t},exports.isPaint=n,exports.isPaintCallback=e,exports.isPropertiesPaint=o,exports.preparePaint=u;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@nextgis/expression"),r=require("@nextgis/properties-filter");function o(t){return!!Array.isArray(t)}function e(t){return"[object Object]"===Object.prototype.toString.call(t)}function n(t){return"function"==typeof t}function i(r){return o=>{const e=o.properties;return!!e&&t.evaluate(r,e)}}const s=["iconSize","iconAnchor"];function c(r){let o=!1;const e={};for(const n in r)if(-1===s.indexOf(n)){const s=n,c=r[s];t.isExpression(c)&&(o=!0,e[s]=i(c))}if(o)return t=>{const o={};for(const r in e)o[r]=e[r](t);return{...r,...o}}}function p(t,r,o){const e=c(t);if(e){const n=t=>f(e(t),r,o);return n.paint=t,n}let n={...r};return n={...n,...t},n.fill=void 0===n.fill||n.fill,n.stroke=void 0!==n.stroke?n.stroke:!n.fill||!(!n.strokeColor&&!n.strokeOpacity),n}function f(t,e,i){if(!t)throw new Error("paint is empty");let s={...e};if(n(t)){const r=r=>{const o=f(t(r),e,i);return o.type=t.type,o};return r.type=t.type,r}if(o(t))return o=>f(function(t){let o={};const e=[];for(const r of t)r&&(Array.isArray(r)?e.push(r):o=r);return t=>{const n=e.find((o=>r.featureFilter(t,o[0])));return n?{...o,...n[1]}:o}}(t)(o),e,i);if("get-paint"===t.type){const r=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(t,i);r&&(s=f(r,e,i))}else{if("icon"===t.type)return t;s=p(t,e,i)}return n(s)||("color"in s&&(s.strokeColor||(s.strokeColor=s.color),s.fillColor||(s.fillColor=s.color)),"opacity"in s&&(void 0===s.strokeOpacity&&(s.strokeOpacity=s.opacity),void 0===s.fillOpacity&&(s.fillOpacity=s.opacity))),s}exports.createExpressionCallback=c,exports.expressionCallback=p,exports.isBasePaint=function(t){return!!e(t)&&("get-paint"!==t.type&&"icon"!==t.type)},exports.isIcon=function(t){return"icon"===t.type||"html"in t},exports.isPaint=e,exports.isPaintCallback=n,exports.isPropertiesPaint=o,exports.preparePaint=f;
//# sourceMappingURL=paint.cjs.prod.js.map

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

/** Bundle of @nextgis/paint; version: 1.17.0; author: NextGIS */
function isExpression(value) {
if (Array.isArray(value)) {
return true;
}
return false;
}
/** Bundle of @nextgis/paint; version: 1.18.0; author: NextGIS */
function isPropertiesPaint(paint) {

@@ -39,12 +33,216 @@ if (Array.isArray(paint)) {

function get(feature, args) {
const field = args[0];
return feature.properties && feature.properties[field];
const tryConvert = (converter, arg, data) => {
try {
const result = converter(arg, data);
if (result !== undefined) {
return result;
}
}
catch {
// ignore errors
}
return undefined;
};
function fallback(cb) {
return (args, data) => {
for (const arg of args) {
const result = tryConvert(cb, arg, data);
if (result !== undefined) {
return result;
}
}
throw new Error(`Received a mismatched type`);
};
}
function match(feature, args) {
const array = (args) => {
const [firstArg, secondArg, thirdArg] = args;
let requiredType = undefined;
let requiredLength = undefined;
let value;
if (typeof firstArg === 'string' &&
['string', 'number', 'boolean'].includes(firstArg)) {
requiredType = firstArg;
if (typeof secondArg === 'number') {
requiredLength = secondArg;
value = thirdArg;
}
else {
value = secondArg;
}
}
else if (Array.isArray(firstArg)) {
value = firstArg;
}
if (!Array.isArray(value)) {
throw new Error('Expected an array');
}
if (requiredType && !value.every((item) => typeof item === requiredType)) {
throw new Error(`Expected all items in array to be of type ${requiredType}`);
}
if (requiredLength && value.length !== requiredLength) {
throw new Error(`Expected array of length ${requiredLength}`);
}
return value;
};
const typeExpressions = {
array,
boolean: fallback((arg) => (typeof arg === 'boolean' ? arg : undefined)),
literal: ([arg]) => arg,
number: fallback((arg) => (typeof arg === 'number' ? arg : undefined)),
object: fallback((arg) => arg !== null && typeof arg === 'object' && !Array.isArray(arg)
? arg
: undefined),
string: fallback((arg) => (typeof arg === 'string' ? arg : undefined)),
'to-boolean': fallback(Boolean),
'to-number': fallback(Number),
'to-string': fallback(String),
typeof: ([arg]) => typeof arg,
};
const mathExpressions = {
'+': (args) => args.reduce((a, b) => a + b, 0),
'-': (args) => args.reduce((a, b) => a - b),
'*': (args) => args.reduce((a, b) => a * b, 1),
'/': (args) => args.reduce((a, b) => a / b),
'%': (args) => args[0] % args[1],
'^': (args) => Math.pow(args[0], args[1]),
abs: (args) => Math.abs(args[0]),
acos: (args) => Math.acos(args[0]),
asin: (args) => Math.asin(args[0]),
atan: (args) => Math.atan(args[0]),
ceil: (args) => Math.ceil(args[0]),
cos: (args) => Math.cos(args[0]),
e: () => Math.E,
floor: (args) => Math.floor(args[0]),
ln: (args) => Math.log(args[0]),
ln2: () => Math.LN2,
log10: (args) => Math.log10(args[0]),
log2: (args) => Math.log2(args[0]),
max: (args) => Math.max(...args),
min: (args) => Math.min(...args),
pi: () => Math.PI,
round: (args) => Math.round(args[0]),
sin: (args) => Math.sin(args[0]),
sqrt: (args) => Math.sqrt(args[0]),
tan: (args) => Math.tan(args[0]),
};
function get([key, objExp], data) {
const target = objExp || data;
if (target && typeof target === 'object' && key in target) {
return target[key];
}
return null;
}
function has([key, objExp], data) {
const target = objExp || data;
return !!(target && typeof target === 'object' && key in target);
}
function at([index, array]) {
return array[index];
}
function inFunc([keyword, input]) {
if (typeof input === 'string') {
return input.includes(String(keyword));
}
else if (Array.isArray(input)) {
return input.includes(keyword);
}
throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof input}.`);
}
const length = ([item]) => {
if (typeof item === 'string' || Array.isArray(item)) {
return item.length;
}
return undefined;
};
function indexOf([keyword, input, startIndex]) {
if (typeof input === 'string') {
return input.indexOf(String(keyword), startIndex);
}
else if (Array.isArray(input)) {
return input.indexOf(keyword, startIndex);
}
throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof input}.`);
}
function slice(args) {
const [input, startIndex, endIndex] = args;
if (typeof input === 'string') {
return input.slice(startIndex, endIndex);
}
else if (Array.isArray(input)) {
return input.slice(startIndex, endIndex);
}
throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof input}.`);
}
const lookupExpressions = {
get,
length,
at,
has,
in: inFunc,
'index-of': indexOf,
slice,
};
const stringExpressions = {
concat: (args) => args.reduce((a, b) => String(a) + String(b), ''),
downcase: (args) => String(args[0]).toLowerCase(),
upcase: (args) => String(args[0]).toUpperCase(),
};
function not([expr]) {
return !expr;
}
const checkCompareValues = ([a, b]) => {
if (typeof a !== typeof b) {
throw new Error('Values have different types.');
}
};
function notEqual([a, b]) {
checkCompareValues([a, b]);
return a !== b;
}
function lessThan([left, right]) {
checkCompareValues([left, right]);
return left < right;
}
function lessThanOrEqual([left, right]) {
checkCompareValues([left, right]);
return left <= right;
}
function equal([left, right]) {
checkCompareValues([left, right]);
return left === right;
}
function greaterThan([left, right]) {
checkCompareValues([left, right]);
return left > right;
}
function greaterThanOrEqual([left, right]) {
checkCompareValues([left, right]);
return left >= right;
}
function all(args) {
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (!arg) {
return false;
}
}
return true;
}
function any(args) {
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (arg) {
return true;
}
}
return false;
}
function match(args) {
const [lookup, ...cases] = args;
let property = lookup;
if (Array.isArray(lookup)) {
property = featureExpression(feature, lookup);
}
// remove last odd item from cases array

@@ -54,3 +252,3 @@ const defValue = cases.splice(-1, cases.length % 2)[0];

const key = cases[fry];
if (key === property) {
if (key === lookup) {
return cases[fry + 1];

@@ -61,17 +259,394 @@ }

}
const expressions = {
get,
function caseFunc(args) {
if (args.length < 2) {
throw new Error('The "case" function requires at least a condition and a corresponding output.');
}
const fallback = args[args.length - 1];
if (args.length % 2 === 0) {
throw new Error('Missing a fallback value or unmatched condition-output pair.');
}
for (let i = 0; i < args.length - 1; i += 2) {
const condition = args[i];
const value = args[i + 1];
if (condition) {
return value;
}
}
return fallback;
}
const decisionExpressions = {
'!': not,
'!=': notEqual,
'<': lessThan,
'<=': lessThanOrEqual,
'==': equal,
'>': greaterThan,
'>=': greaterThanOrEqual,
all: all,
any: any,
case: caseFunc,
match,
};
function featureExpression(feature, expression) {
function step(args) {
const [input, defaultValue, ...stops] = args;
if (typeof input !== 'number') {
return defaultValue;
}
for (let i = 0; i < stops.length - 2; i += 2) {
const stopInput = stops[i];
const stopOutput = stops[i + 1];
const nextStopInput = stops[i + 2];
if (input >= stopInput && input < nextStopInput) {
return stopOutput;
}
}
if (input >= stops[stops.length - 2]) {
return stops[stops.length - 1];
}
return defaultValue;
}
const COLORS = {
aliceblue: '#f0f8ff',
antiquewhite: '#faebd7',
aqua: '#00ffff',
aquamarine: '#7fffd4',
azure: '#f0ffff',
beige: '#f5f5dc',
bisque: '#ffe4c4',
black: '#000000',
blanchedalmond: '#ffebcd',
blue: '#0000ff',
blueviolet: '#8a2be2',
brown: '#a52a2a',
burlywood: '#deb887',
cadetblue: '#5f9ea0',
chartreuse: '#7fff00',
chocolate: '#d2691e',
coral: '#ff7f50',
cornflowerblue: '#6495ed',
cornsilk: '#fff8dc',
crimson: '#dc143c',
cyan: '#00ffff',
darkblue: '#00008b',
darkcyan: '#008b8b',
darkgoldenrod: '#b8860b',
darkgray: '#a9a9a9',
darkgreen: '#006400',
darkkhaki: '#bdb76b',
darkmagenta: '#8b008b',
darkolivegreen: '#556b2f',
darkorange: '#ff8c00',
darkorchid: '#9932cc',
darkred: '#8b0000',
darksalmon: '#e9967a',
darkseagreen: '#8fbc8f',
darkslateblue: '#483d8b',
darkslategray: '#2f4f4f',
darkturquoise: '#00ced1',
darkviolet: '#9400d3',
deeppink: '#ff1493',
deepskyblue: '#00bfff',
dimgray: '#696969',
dodgerblue: '#1e90ff',
firebrick: '#b22222',
floralwhite: '#fffaf0',
forestgreen: '#228b22',
fuchsia: '#ff00ff',
gainsboro: '#dcdcdc',
ghostwhite: '#f8f8ff',
gold: '#ffd700',
goldenrod: '#daa520',
gray: '#808080',
green: '#008000',
greenyellow: '#adff2f',
honeydew: '#f0fff0',
hotpink: '#ff69b4',
'indianred ': '#cd5c5c',
indigo: '#4b0082',
ivory: '#fffff0',
khaki: '#f0e68c',
lavender: '#e6e6fa',
lavenderblush: '#fff0f5',
lawngreen: '#7cfc00',
lemonchiffon: '#fffacd',
lightblue: '#add8e6',
lightcoral: '#f08080',
lightcyan: '#e0ffff',
lightgoldenrodyellow: '#fafad2',
lightgrey: '#d3d3d3',
lightgreen: '#90ee90',
lightpink: '#ffb6c1',
lightsalmon: '#ffa07a',
lightseagreen: '#20b2aa',
lightskyblue: '#87cefa',
lightslategray: '#778899',
lightsteelblue: '#b0c4de',
lightyellow: '#ffffe0',
lime: '#00ff00',
limegreen: '#32cd32',
linen: '#faf0e6',
magenta: '#ff00ff',
maroon: '#800000',
mediumaquamarine: '#66cdaa',
mediumblue: '#0000cd',
mediumorchid: '#ba55d3',
mediumpurple: '#9370d8',
mediumseagreen: '#3cb371',
mediumslateblue: '#7b68ee',
mediumspringgreen: '#00fa9a',
mediumturquoise: '#48d1cc',
mediumvioletred: '#c71585',
midnightblue: '#191970',
mintcream: '#f5fffa',
mistyrose: '#ffe4e1',
moccasin: '#ffe4b5',
navajowhite: '#ffdead',
navy: '#000080',
oldlace: '#fdf5e6',
olive: '#808000',
olivedrab: '#6b8e23',
orange: '#ffa500',
orangered: '#ff4500',
orchid: '#da70d6',
palegoldenrod: '#eee8aa',
palegreen: '#98fb98',
paleturquoise: '#afeeee',
palevioletred: '#d87093',
papayawhip: '#ffefd5',
peachpuff: '#ffdab9',
peru: '#cd853f',
pink: '#ffc0cb',
plum: '#dda0dd',
powderblue: '#b0e0e6',
purple: '#800080',
rebeccapurple: '#663399',
red: '#ff0000',
rosybrown: '#bc8f8f',
royalblue: '#4169e1',
saddlebrown: '#8b4513',
salmon: '#fa8072',
sandybrown: '#f4a460',
seagreen: '#2e8b57',
seashell: '#fff5ee',
sienna: '#a0522d',
silver: '#c0c0c0',
skyblue: '#87ceeb',
slateblue: '#6a5acd',
slategray: '#708090',
snow: '#fffafa',
springgreen: '#00ff7f',
steelblue: '#4682b4',
tan: '#d2b48c',
teal: '#008080',
thistle: '#d8bfd8',
tomato: '#ff6347',
turquoise: '#40e0d0',
violet: '#ee82ee',
wheat: '#f5deb3',
white: '#ffffff',
whitesmoke: '#f5f5f5',
yellow: '#ffff00',
yellowgreen: '#9acd32',
};
function isHex(hex) {
return typeof hex === 'string' && /^#([A-Fa-f0-9]{3}){1,2}$/.test(hex);
}
function isRgb(hex) {
const r =
// eslint-disable-next-line max-len
/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/;
return typeof hex === 'string' && r.test(hex);
}
function isColorObj(obj) {
if (typeof obj === 'object' && obj !== null) {
const hasRgb = 'r' in obj && 'g' in obj && 'b' in obj;
const hasValidAlpha = !('a' in obj) || (typeof obj.a === 'number' && obj.a >= 0 && obj.a <= 1);
return hasRgb && hasValidAlpha;
}
return false;
}
function isColorName(name) {
if (typeof name === 'string' && name in COLORS) {
return true;
}
return false;
}
function toColor(value) {
if (isHex(value)) {
return hexToColor(value);
}
else if (isColorName(value)) {
return colorNameToColor(value);
}
else if (isRgb(value)) {
return rgbToColor(value);
}
else if (isColorObj(value)) {
return colorObjectToColor(value);
}
throw new Error(`The '${value}' cannot be converted to color`);
}
function colorNameToColor(name) {
return hexToColor(COLORS[name]);
}
function hexToColor(hex) {
const shortRGB = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/;
const shortRGBA = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/;
const longRGB = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/;
const longRGBA = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/;
let result;
if ((result = shortRGB.exec(hex))) {
return [
parseInt(result[1] + result[1], 16),
parseInt(result[2] + result[2], 16),
parseInt(result[3] + result[3], 16),
];
}
else if ((result = shortRGBA.exec(hex))) {
return [
parseInt(result[1] + result[1], 16),
parseInt(result[2] + result[2], 16),
parseInt(result[3] + result[3], 16),
parseInt(result[4] + result[4], 16) / 255,
];
}
else if ((result = longRGB.exec(hex))) {
return [
parseInt(result[1], 16),
parseInt(result[2], 16),
parseInt(result[3], 16),
];
}
else if ((result = longRGBA.exec(hex))) {
return [
parseInt(result[1], 16),
parseInt(result[2], 16),
parseInt(result[3], 16),
parseInt(result[4], 16) / 255,
];
}
throw new Error(`The '${hex}' Is not valid hex`);
}
function rgbToColor(rgb) {
const rgbPattern = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/;
const rgbaPattern = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;
let matches;
if ((matches = rgb.match(rgbPattern))) {
return [
parseInt(matches[1], 10),
parseInt(matches[2], 10),
parseInt(matches[3], 10),
];
}
else if ((matches = rgb.match(rgbaPattern))) {
return [
parseInt(matches[1], 10),
parseInt(matches[2], 10),
parseInt(matches[3], 10),
parseFloat(matches[4]),
];
}
throw new Error(`The '${rgb}' Is not valid rgb`);
}
function colorObjectToColor({ r, g, b, a }) {
return [r, g, b, ...(a !== undefined ? [a] : [])];
}
function colorToRGB(array) {
return `rgb(${array.join(',')})`;
}
function linearInterpolation(input, input1, output1, input2, output2) {
if (typeof output1 === 'number' && typeof output2 === 'number') {
return (output1 + ((input - input1) / (input2 - input1)) * (output2 - output1));
}
try {
const outputColor1 = toColor(output1);
const outputColor2 = toColor(output2);
return colorToRGB(outputColor1.map((val, index) => {
return Math.ceil(linearInterpolation(input, input1, val, input2, outputColor2[index]));
}));
}
catch (er) {
console.log(er);
}
throw new Error('Unsupported output type for linear interpolation.');
}
function interpolate([interpolation, input, ...stops]) {
if (stops.length < 2) {
throw new Error('At least two stops are required');
}
if (typeof input !== 'number') {
throw new Error('Input must be a number.');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
for (let i = 0; i < stops.length - 2; i += 2) {
const stopInput1 = stops[i];
const stopOutput1 = stops[i + 1];
const stopInput2 = stops[i + 2];
const stopOutput2 = stops[i + 3];
if (input >= stopInput1 && input <= stopInput2) {
if (interpolation[0] === 'linear') {
return linearInterpolation(input, stopInput1, stopOutput1, stopInput2, stopOutput2);
}
// else if (interpolation[0] === 'exponential') {
// const base = interpolation[1];
// return exponentialInterpolation(
// input,
// base,
// stopInput1,
// stopOutput1,
// stopInput2,
// stopOutput2,
// );
// }
}
}
throw new Error('Invalid interpolation type.');
}
const interpolationExpressions = {
step,
interpolate,
};
function isExpression(value) {
if (Array.isArray(value)) {
const [lookup, ...cases] = value;
const l = lookup;
return (typeof l === 'string' &&
l !== 'literal' &&
l in expressions &&
cases.length > 0);
}
return false;
}
const expressions = {
...mathExpressions,
...typeExpressions,
...stringExpressions,
...lookupExpressions,
...decisionExpressions,
...interpolationExpressions,
};
function evaluate(expression, data = {}) {
const [name, ...args] = expression;
const expressionFun = expressions[name];
if (expressionFun) {
return expressionFun(feature, args);
return expressionFun(args.map((arg) => (isExpression(arg) ? evaluate(arg, data) : arg)), data);
}
return undefined;
throw new Error(`Expression "${name}" is not supported.`);
}
function createPropertyExpressionCb(expression) {
return (feature) => {
return featureExpression(feature, expression);
const properties = feature.properties;
if (properties) {
return evaluate(expression, properties);
}
return false;
};

@@ -294,3 +869,3 @@ }

export { createExpressionCallback, expressionCallback, isBasePaint, isExpression, isIcon, isPaint, isPaintCallback, isPropertiesPaint, preparePaint };
export { createExpressionCallback, expressionCallback, isBasePaint, isIcon, isPaint, isPaintCallback, isPropertiesPaint, preparePaint };
//# sourceMappingURL=paint.esm-browser.js.map

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

function t(t){return!!Array.isArray(t)}function r(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function o(t){return"function"==typeof t}function i(t){return"icon"===t.type||"html"in t}const c={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[n,...e]=r;let o=n;Array.isArray(n)&&(o=f(t,n));const i=e.splice(-1,e.length%2)[0];for(let c=0;c<e.length-1;c+=2){if(e[c]===o)return e[c+1]}return i}};function f(t,r){const[n,...e]=r,o=c[n];if(o)return o(t,e)}function s(t){return r=>f(r,t)}const l=["iconSize","iconAnchor"];function u(r){let n=!1;const e={};for(const o in r)if(-1===l.indexOf(o)){const i=o,c=r[i];t(c)&&(n=!0,e[i]=s(c))}if(n)return t=>{const n={};for(const r in e)n[r]=e[r](t);return{...r,...n}}}function p(t,r,n){if((r=String(r))===(t=String(t)))return!0;if(n&&r.toUpperCase()===t.toUpperCase())return!0;const e=`^${o=r,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(e,n?"i":"").exec(t)}const y={gt:(t,r)=>t>r,lt:(t,r)=>t<r,ge:(t,r)=>t>=r,le:(t,r)=>t<=r,eq:(t,r)=>t===r,ne:(t,r)=>t!==r,in:(t,r)=>-1!==r.indexOf(t),notin:(t,r)=>-1===r.indexOf(t),like:(t,r)=>p(t,r),ilike:(t,r)=>p(t,r,!0)};function a(t,r){const n={...t.properties};return!!n&&(n.$id=t.id,g(n,r))}function g(t,r){const n="string"==typeof r[0]?r[0]:"all",e=r=>{if(3===(n=r).length&&"string"==typeof n[0]&&"string"==typeof n[1]){const[n,e,o]=r,i=y[e];if(i){if(("like"===e||"ilike"===e)&&"string"==typeof n){let r="";const e=n.replace(/^%?(\w+)%?$/,((e,i)=>(r=t[i],n.replace(i,o))));return i(r,e)}return i(t[n],o)}return!1}return g(t,r);var n},o=r.filter((t=>Array.isArray(t)));return"any"===n?o.some(e):o.every(e)}function k(t,r,n){const e=u(t);if(e){const o=t=>A(e(t),r,n);return o.paint=t,o}let o={...r};return o={...o,...t},o.fill=void 0===o.fill||o.fill,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function A(t,n,e){if(!t)throw new Error("paint is empty");let i={...n};if(o(t)){const r=r=>{const o=A(t(r),n,e);return o.type=t.type,o};return r.type=t.type,r}if(r(t))return r=>A(function(t){let r={};const n=[];for(const e of t)e&&(Array.isArray(e)?n.push(e):r=e);return t=>{const e=n.find((r=>a(t,r[0])));return e?{...r,...e[1]}:r}}(t)(r),n,e);if("get-paint"===t.type){const r=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const n=r[t.from];if(n)return n(t.options)}}(t,e);r&&(i=A(r,n,e))}else{if("icon"===t.type)return t;i=k(t,n,e)}return o(i)||("color"in i&&(i.strokeColor||(i.strokeColor=i.color),i.fillColor||(i.fillColor=i.color)),"opacity"in i&&(void 0===i.strokeOpacity&&(i.strokeOpacity=i.opacity),void 0===i.fillOpacity&&(i.fillOpacity=i.opacity))),i}export{u as createExpressionCallback,k as expressionCallback,e as isBasePaint,t as isExpression,i as isIcon,n as isPaint,o as isPaintCallback,r as isPropertiesPaint,A as preparePaint};
function e(e){return!!Array.isArray(e)}function r(e){return"[object Object]"===Object.prototype.toString.call(e)}function t(e){return!!r(e)&&("get-paint"!==e.type&&"icon"!==e.type)}function n(e){return"function"==typeof e}function o(e){return"icon"===e.type||"html"in e}const f=(e,r,t)=>{try{const n=e(r,t);if(void 0!==n)return n}catch{}};function i(e){return(r,t)=>{for(const n of r){const r=f(e,n,t);if(void 0!==r)return r}throw new Error("Received a mismatched type")}}const a={array:e=>{const[r,t,n]=e;let o,f,i;if("string"==typeof r&&["string","number","boolean"].includes(r)?(o=r,"number"==typeof t?(f=t,i=n):i=t):Array.isArray(r)&&(i=r),!Array.isArray(i))throw new Error("Expected an array");if(o&&!i.every((e=>typeof e===o)))throw new Error(`Expected all items in array to be of type ${o}`);if(f&&i.length!==f)throw new Error(`Expected array of length ${f}`);return i},boolean:i((e=>"boolean"==typeof e?e:void 0)),literal:([e])=>e,number:i((e=>"number"==typeof e?e:void 0)),object:i((e=>null===e||"object"!=typeof e||Array.isArray(e)?void 0:e)),string:i((e=>"string"==typeof e?e:void 0)),"to-boolean":i(Boolean),"to-number":i(Number),"to-string":i(String),typeof:([e])=>typeof e};const c={get:function([e,r],t){const n=r||t;return n&&"object"==typeof n&&e in n?n[e]:null},length:([e])=>{if("string"==typeof e||Array.isArray(e))return e.length},at:function([e,r]){return r[e]},has:function([e,r],t){const n=r||t;return!(!n||"object"!=typeof n||!(e in n))},in:function([e,r]){if("string"==typeof r)return r.includes(String(e));if(Array.isArray(r))return r.includes(e);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof r}.`)},"index-of":function([e,r,t]){if("string"==typeof r)return r.indexOf(String(e),t);if(Array.isArray(r))return r.indexOf(e,t);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof r}.`)},slice:function(e){const[r,t,n]=e;if("string"==typeof r)return r.slice(t,n);if(Array.isArray(r))return r.slice(t,n);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof r}.`)}};const l=([e,r])=>{if(typeof e!=typeof r)throw new Error("Values have different types.")};const u={"!":function([e]){return!e},"!=":function([e,r]){return l([e,r]),e!==r},"<":function([e,r]){return l([e,r]),e<r},"<=":function([e,r]){return l([e,r]),e<=r},"==":function([e,r]){return l([e,r]),e===r},">":function([e,r]){return l([e,r]),e>r},">=":function([e,r]){return l([e,r]),e>=r},all:function(e){for(let r=0;r<e.length;r++){if(!e[r])return!1}return!0},any:function(e){for(let r=0;r<e.length;r++){if(e[r])return!0}return!1},case:function(e){if(e.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');const r=e[e.length-1];if(e.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let t=0;t<e.length-1;t+=2){if(e[t])return e[t+1]}return r},match:function(e){const[r,...t]=e,n=t.splice(-1,t.length%2)[0];for(let o=0;o<t.length-1;o+=2){if(t[o]===r)return t[o+1]}return n}};const s={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function d(e){if("string"==typeof(t=e)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(t))return p(e);if("string"==typeof(r=e)&&r in s)return function(e){return p(s[e])}(e);if(function(e){return"string"==typeof e&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(e)}(e))return function(e){const r=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let t;if(t=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)];if(t=e.match(r))return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4])];throw new Error(`The '${e}' Is not valid rgb`)}(e);if(function(e){if("object"==typeof e&&null!==e)return"r"in e&&"g"in e&&"b"in e&&(!("a"in e)||"number"==typeof e.a&&e.a>=0&&e.a<=1);return!1}(e))return function({r:e,g:r,b:t,a:n}){return[e,r,t,...void 0!==n?[n]:[]]}(e);var r,t;throw new Error(`The '${e}' cannot be converted to color`)}function p(e){let r;if(r=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];if(r=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(e))return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16),parseInt(r[4]+r[4],16)/255];if(r=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];if(r=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e))return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),parseInt(r[4],16)/255];throw new Error(`The '${e}' Is not valid hex`)}function g(e,r,t,n,o){if("number"==typeof t&&"number"==typeof o)return t+(e-r)/(n-r)*(o-t);try{const f=d(t),i=d(o);return function(e){return`rgb(${e.join(",")})`}(f.map(((t,o)=>Math.ceil(g(e,r,t,n,i[o])))))}catch(f){console.log(f)}throw new Error("Unsupported output type for linear interpolation.")}function y(e){if(Array.isArray(e)){const[r,...t]=e;return"string"==typeof r&&"literal"!==r&&r in h&&t.length>0}return!1}const h={...{"+":e=>e.reduce(((e,r)=>e+r),0),"-":e=>e.reduce(((e,r)=>e-r)),"*":e=>e.reduce(((e,r)=>e*r),1),"/":e=>e.reduce(((e,r)=>e/r)),"%":e=>e[0]%e[1],"^":e=>Math.pow(e[0],e[1]),abs:e=>Math.abs(e[0]),acos:e=>Math.acos(e[0]),asin:e=>Math.asin(e[0]),atan:e=>Math.atan(e[0]),ceil:e=>Math.ceil(e[0]),cos:e=>Math.cos(e[0]),e:()=>Math.E,floor:e=>Math.floor(e[0]),ln:e=>Math.log(e[0]),ln2:()=>Math.LN2,log10:e=>Math.log10(e[0]),log2:e=>Math.log2(e[0]),max:e=>Math.max(...e),min:e=>Math.min(...e),pi:()=>Math.PI,round:e=>Math.round(e[0]),sin:e=>Math.sin(e[0]),sqrt:e=>Math.sqrt(e[0]),tan:e=>Math.tan(e[0])},...a,...{concat:e=>e.reduce(((e,r)=>String(e)+String(r)),""),downcase:e=>String(e[0]).toLowerCase(),upcase:e=>String(e[0]).toUpperCase()},...c,...u,...{step:function(e){const[r,t,...n]=e;if("number"!=typeof r)return t;for(let o=0;o<n.length-2;o+=2){if(r>=n[o]&&r<n[o+2])return n[o+1]}return r>=n[n.length-2]?n[n.length-1]:t},interpolate:function([e,r,...t]){if(t.length<2)throw new Error("At least two stops are required");if("number"!=typeof r)throw new Error("Input must be a number.");if(t.length<2||t.length%2!=0)throw new Error("Invalid stops provided.");for(let n=0;n<t.length-2;n+=2){const o=t[n],f=t[n+2];if(r>=o&&r<=f&&"linear"===e[0])return g(r,o,t[n+1],f,t[n+3])}throw new Error("Invalid interpolation type.")}}};function b(e,r={}){const[t,...n]=e,o=h[t];if(o)return o(n.map((e=>y(e)?b(e,r):e)),r);throw new Error(`Expression "${t}" is not supported.`)}function m(e){return r=>{const t=r.properties;return!!t&&b(e,t)}}const w=["iconSize","iconAnchor"];function k(e){let r=!1;const t={};for(const n in e)if(-1===w.indexOf(n)){const o=n,f=e[o];y(f)&&(r=!0,t[o]=m(f))}if(r)return r=>{const n={};for(const e in t)n[e]=t[e](r);return{...e,...n}}}function v(e,r,t){if((r=String(r))===(e=String(e)))return!0;if(t&&r.toUpperCase()===e.toUpperCase())return!0;const n=`^${o=r,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(n,t?"i":"").exec(e)}const A={gt:(e,r)=>e>r,lt:(e,r)=>e<r,ge:(e,r)=>e>=r,le:(e,r)=>e<=r,eq:(e,r)=>e===r,ne:(e,r)=>e!==r,in:(e,r)=>-1!==r.indexOf(e),notin:(e,r)=>-1===r.indexOf(e),like:(e,r)=>v(e,r),ilike:(e,r)=>v(e,r,!0)};function E(e,r){const t={...e.properties};return!!t&&(t.$id=e.id,I(t,r))}function I(e,r){const t="string"==typeof r[0]?r[0]:"all",n=r=>{if(3===(t=r).length&&"string"==typeof t[0]&&"string"==typeof t[1]){const[t,n,o]=r,f=A[n];if(f){if(("like"===n||"ilike"===n)&&"string"==typeof t){let r="";const n=t.replace(/^%?(\w+)%?$/,((n,f)=>(r=e[f],t.replace(f,o))));return f(r,n)}return f(e[t],o)}return!1}return I(e,r);var t},o=r.filter((e=>Array.isArray(e)));return"any"===t?o.some(n):o.every(n)}function x(e,r,t){const n=k(e);if(n){const o=e=>$(n(e),r,t);return o.paint=e,o}let o={...r};return o={...o,...e},o.fill=void 0===o.fill||o.fill,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function $(r,t,o){if(!r)throw new Error("paint is empty");let f={...t};if(n(r)){const e=e=>{const n=$(r(e),t,o);return n.type=r.type,n};return e.type=r.type,e}if(e(r))return e=>$(function(e){let r={};const t=[];for(const n of e)n&&(Array.isArray(n)?t.push(n):r=n);return e=>{const n=t.find((r=>E(e,r[0])));return n?{...r,...n[1]}:r}}(r)(e),t,o);if("get-paint"===r.type){const e=function(e,r){if("function"==typeof e.from)return e.from(e.options);if("string"==typeof e.from&&r){const t=r[e.from];if(t)return t(e.options)}}(r,o);e&&(f=$(e,t,o))}else{if("icon"===r.type)return r;f=x(r,t,o)}return n(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}export{k as createExpressionCallback,x as expressionCallback,t as isBasePaint,o as isIcon,r as isPaint,n as isPaintCallback,e as isPropertiesPaint,$ as preparePaint};
//# sourceMappingURL=paint.esm-browser.prod.js.map

@@ -1,10 +0,5 @@

/** Bundle of @nextgis/paint; version: 1.17.0; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.0; author: NextGIS */
import { isExpression, evaluate } from '@nextgis/expression';
import { featureFilter } from '@nextgis/properties-filter';
function isExpression(value) {
if (Array.isArray(value)) {
return true;
}
return false;
}
function isPropertiesPaint(paint) {

@@ -41,37 +36,9 @@ if (Array.isArray(paint)) {

function get(feature, args) {
const field = args[0];
return feature.properties && feature.properties[field];
}
function match(feature, args) {
const [lookup, ...cases] = args;
let property = lookup;
if (Array.isArray(lookup)) {
property = featureExpression(feature, lookup);
}
// remove last odd item from cases array
const defValue = cases.splice(-1, cases.length % 2)[0];
for (let fry = 0; fry < cases.length - 1; fry += 2) {
const key = cases[fry];
if (key === property) {
return cases[fry + 1];
}
}
return defValue;
}
const expressions = {
get,
match,
};
function featureExpression(feature, expression) {
const [name, ...args] = expression;
const expressionFun = expressions[name];
if (expressionFun) {
return expressionFun(feature, args);
}
return undefined;
}
function createPropertyExpressionCb(expression) {
return (feature) => {
return featureExpression(feature, expression);
const properties = feature.properties;
if (properties) {
return evaluate(expression, properties);
}
return false;
};

@@ -208,3 +175,3 @@ }

export { createExpressionCallback, expressionCallback, isBasePaint, isExpression, isIcon, isPaint, isPaintCallback, isPropertiesPaint, preparePaint };
export { createExpressionCallback, expressionCallback, isBasePaint, isIcon, isPaint, isPaintCallback, isPropertiesPaint, preparePaint };
//# sourceMappingURL=paint.esm-bundler.js.map

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

import{featureFilter as t}from"@nextgis/properties-filter";function r(t){return!!Array.isArray(t)}function n(t){return!!Array.isArray(t)}function o(t){return"[object Object]"===Object.prototype.toString.call(t)}function i(t){return!!o(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function e(t){return"function"==typeof t}function c(t){return"icon"===t.type||"html"in t}const f={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[n,...o]=r;let i=n;Array.isArray(n)&&(i=s(t,n));const e=o.splice(-1,o.length%2)[0];for(let c=0;c<o.length-1;c+=2){if(o[c]===i)return o[c+1]}return e}};function s(t,r){const[n,...o]=r,i=f[n];if(i)return i(t,o)}function u(t){return r=>s(r,t)}const p=["iconSize","iconAnchor"];function l(t){let n=!1;const o={};for(const i in t)if(-1===p.indexOf(i)){const e=i,c=t[e];r(c)&&(n=!0,o[e]=u(c))}if(n)return r=>{const n={};for(const t in o)n[t]=o[t](r);return{...t,...n}}}function y(t,r,n){const o=l(t);if(o){const i=t=>a(o(t),r,n);return i.paint=t,i}let i={...r};return i={...i,...t},i.fill=void 0===i.fill||i.fill,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function a(r,o,i){if(!r)throw new Error("paint is empty");let c={...o};if(e(r)){const t=t=>{const n=a(r(t),o,i);return n.type=r.type,n};return t.type=r.type,t}if(n(r))return n=>a(function(r){let n={};const o=[];for(const t of r)t&&(Array.isArray(t)?o.push(t):n=t);return r=>{const i=o.find((n=>t(r,n[0])));return i?{...n,...i[1]}:n}}(r)(n),o,i);if("get-paint"===r.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const n=r[t.from];if(n)return n(t.options)}}(r,i);t&&(c=a(t,o,i))}else{if("icon"===r.type)return r;c=y(r,o,i)}return e(c)||("color"in c&&(c.strokeColor||(c.strokeColor=c.color),c.fillColor||(c.fillColor=c.color)),"opacity"in c&&(void 0===c.strokeOpacity&&(c.strokeOpacity=c.opacity),void 0===c.fillOpacity&&(c.fillOpacity=c.opacity))),c}export{l as createExpressionCallback,y as expressionCallback,i as isBasePaint,r as isExpression,c as isIcon,o as isPaint,e as isPaintCallback,n as isPropertiesPaint,a as preparePaint};
import{isExpression as t,evaluate as o}from"@nextgis/expression";import{featureFilter as r}from"@nextgis/properties-filter";function n(t){return!!Array.isArray(t)}function i(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return!!i(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function c(t){return"function"==typeof t}function f(t){return"icon"===t.type||"html"in t}function s(t){return r=>{const n=r.properties;return!!n&&o(t,n)}}const p=["iconSize","iconAnchor"];function u(o){let r=!1;const n={};for(const i in o)if(-1===p.indexOf(i)){const e=i,c=o[e];t(c)&&(r=!0,n[e]=s(c))}if(r)return t=>{const r={};for(const o in n)r[o]=n[o](t);return{...o,...r}}}function l(t,o,r){const n=u(t);if(n){const i=t=>y(n(t),o,r);return i.paint=t,i}let i={...o};return i={...i,...t},i.fill=void 0===i.fill||i.fill,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function y(t,o,i){if(!t)throw new Error("paint is empty");let e={...o};if(c(t)){const r=r=>{const n=y(t(r),o,i);return n.type=t.type,n};return r.type=t.type,r}if(n(t))return n=>y(function(t){let o={};const n=[];for(const r of t)r&&(Array.isArray(r)?n.push(r):o=r);return t=>{const i=n.find((o=>r(t,o[0])));return i?{...o,...i[1]}:o}}(t)(n),o,i);if("get-paint"===t.type){const r=function(t,o){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&o){const r=o[t.from];if(r)return r(t.options)}}(t,i);r&&(e=y(r,o,i))}else{if("icon"===t.type)return t;e=l(t,o,i)}return c(e)||("color"in e&&(e.strokeColor||(e.strokeColor=e.color),e.fillColor||(e.fillColor=e.color)),"opacity"in e&&(void 0===e.strokeOpacity&&(e.strokeOpacity=e.opacity),void 0===e.fillOpacity&&(e.fillOpacity=e.opacity))),e}export{u as createExpressionCallback,l as expressionCallback,e as isBasePaint,f as isIcon,i as isPaint,c as isPaintCallback,n as isPropertiesPaint,y as preparePaint};
//# sourceMappingURL=paint.esm-bundler.prod.js.map

@@ -1,11 +0,5 @@

/** Bundle of @nextgis/paint; version: 1.17.0; author: NextGIS */
/** Bundle of @nextgis/paint; version: 1.18.0; author: NextGIS */
var Paint = (function (exports) {
'use strict';
function isExpression(value) {
if (Array.isArray(value)) {
return true;
}
return false;
}
function isPropertiesPaint(paint) {

@@ -68,2 +62,12 @@ if (Array.isArray(paint)) {

function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {

@@ -74,12 +78,239 @@ var e = new Error(message);

function get(feature, args) {
var field = args[0];
return feature.properties && feature.properties[field];
var tryConvert = function (converter, arg, data) {
try {
var result = converter(arg, data);
if (result !== undefined) {
return result;
}
}
catch (_a) {
// ignore errors
}
return undefined;
};
function fallback(cb) {
return function (args, data) {
for (var _i = 0, args_1 = args; _i < args_1.length; _i++) {
var arg = args_1[_i];
var result = tryConvert(cb, arg, data);
if (result !== undefined) {
return result;
}
}
throw new Error("Received a mismatched type");
};
}
function match(feature, args) {
var array = function (args) {
var firstArg = args[0], secondArg = args[1], thirdArg = args[2];
var requiredType = undefined;
var requiredLength = undefined;
var value;
if (typeof firstArg === 'string' &&
['string', 'number', 'boolean'].includes(firstArg)) {
requiredType = firstArg;
if (typeof secondArg === 'number') {
requiredLength = secondArg;
value = thirdArg;
}
else {
value = secondArg;
}
}
else if (Array.isArray(firstArg)) {
value = firstArg;
}
if (!Array.isArray(value)) {
throw new Error('Expected an array');
}
if (requiredType && !value.every(function (item) { return typeof item === requiredType; })) {
throw new Error("Expected all items in array to be of type ".concat(requiredType));
}
if (requiredLength && value.length !== requiredLength) {
throw new Error("Expected array of length ".concat(requiredLength));
}
return value;
};
var typeExpressions = {
array: array,
boolean: fallback(function (arg) { return (typeof arg === 'boolean' ? arg : undefined); }),
literal: function (_a) {
var arg = _a[0];
return arg;
},
number: fallback(function (arg) { return (typeof arg === 'number' ? arg : undefined); }),
object: fallback(function (arg) {
return arg !== null && typeof arg === 'object' && !Array.isArray(arg)
? arg
: undefined;
}),
string: fallback(function (arg) { return (typeof arg === 'string' ? arg : undefined); }),
'to-boolean': fallback(Boolean),
'to-number': fallback(Number),
'to-string': fallback(String),
typeof: function (_a) {
var arg = _a[0];
return typeof arg;
},
};
var mathExpressions = {
'+': function (args) { return args.reduce(function (a, b) { return a + b; }, 0); },
'-': function (args) { return args.reduce(function (a, b) { return a - b; }); },
'*': function (args) { return args.reduce(function (a, b) { return a * b; }, 1); },
'/': function (args) { return args.reduce(function (a, b) { return a / b; }); },
'%': function (args) { return args[0] % args[1]; },
'^': function (args) { return Math.pow(args[0], args[1]); },
abs: function (args) { return Math.abs(args[0]); },
acos: function (args) { return Math.acos(args[0]); },
asin: function (args) { return Math.asin(args[0]); },
atan: function (args) { return Math.atan(args[0]); },
ceil: function (args) { return Math.ceil(args[0]); },
cos: function (args) { return Math.cos(args[0]); },
e: function () { return Math.E; },
floor: function (args) { return Math.floor(args[0]); },
ln: function (args) { return Math.log(args[0]); },
ln2: function () { return Math.LN2; },
log10: function (args) { return Math.log10(args[0]); },
log2: function (args) { return Math.log2(args[0]); },
max: function (args) { return Math.max.apply(Math, args); },
min: function (args) { return Math.min.apply(Math, args); },
pi: function () { return Math.PI; },
round: function (args) { return Math.round(args[0]); },
sin: function (args) { return Math.sin(args[0]); },
sqrt: function (args) { return Math.sqrt(args[0]); },
tan: function (args) { return Math.tan(args[0]); },
};
function get(_a, data) {
var key = _a[0], objExp = _a[1];
var target = objExp || data;
if (target && typeof target === 'object' && key in target) {
return target[key];
}
return null;
}
function has(_a, data) {
var key = _a[0], objExp = _a[1];
var target = objExp || data;
return !!(target && typeof target === 'object' && key in target);
}
function at(_a) {
var index = _a[0], array = _a[1];
return array[index];
}
function inFunc(_a) {
var keyword = _a[0], input = _a[1];
if (typeof input === 'string') {
return input.includes(String(keyword));
}
else if (Array.isArray(input)) {
return input.includes(keyword);
}
throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof input, "."));
}
var length = function (_a) {
var item = _a[0];
if (typeof item === 'string' || Array.isArray(item)) {
return item.length;
}
return undefined;
};
function indexOf(_a) {
var keyword = _a[0], input = _a[1], startIndex = _a[2];
if (typeof input === 'string') {
return input.indexOf(String(keyword), startIndex);
}
else if (Array.isArray(input)) {
return input.indexOf(keyword, startIndex);
}
throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof input, "."));
}
function slice(args) {
var input = args[0], startIndex = args[1], endIndex = args[2];
if (typeof input === 'string') {
return input.slice(startIndex, endIndex);
}
else if (Array.isArray(input)) {
return input.slice(startIndex, endIndex);
}
throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof input, "."));
}
var lookupExpressions = {
get: get,
length: length,
at: at,
has: has,
in: inFunc,
'index-of': indexOf,
slice: slice,
};
var stringExpressions = {
concat: function (args) { return args.reduce(function (a, b) { return String(a) + String(b); }, ''); },
downcase: function (args) { return String(args[0]).toLowerCase(); },
upcase: function (args) { return String(args[0]).toUpperCase(); },
};
function not(_a) {
var expr = _a[0];
return !expr;
}
var checkCompareValues = function (_a) {
var a = _a[0], b = _a[1];
if (typeof a !== typeof b) {
throw new Error('Values have different types.');
}
};
function notEqual(_a) {
var a = _a[0], b = _a[1];
checkCompareValues([a, b]);
return a !== b;
}
function lessThan(_a) {
var left = _a[0], right = _a[1];
checkCompareValues([left, right]);
return left < right;
}
function lessThanOrEqual(_a) {
var left = _a[0], right = _a[1];
checkCompareValues([left, right]);
return left <= right;
}
function equal(_a) {
var left = _a[0], right = _a[1];
checkCompareValues([left, right]);
return left === right;
}
function greaterThan(_a) {
var left = _a[0], right = _a[1];
checkCompareValues([left, right]);
return left > right;
}
function greaterThanOrEqual(_a) {
var left = _a[0], right = _a[1];
checkCompareValues([left, right]);
return left >= right;
}
function all(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (!arg) {
return false;
}
}
return true;
}
function any(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg) {
return true;
}
}
return false;
}
function match(args) {
var lookup = args[0], cases = args.slice(1);
var property = lookup;
if (Array.isArray(lookup)) {
property = featureExpression(feature, lookup);
}
// remove last odd item from cases array

@@ -89,3 +320,3 @@ var defValue = cases.splice(-1, cases.length % 2)[0];

var key = cases[fry];
if (key === property) {
if (key === lookup) {
return cases[fry + 1];

@@ -96,17 +327,390 @@ }

}
var expressions = {
get: get,
function caseFunc(args) {
if (args.length < 2) {
throw new Error('The "case" function requires at least a condition and a corresponding output.');
}
var fallback = args[args.length - 1];
if (args.length % 2 === 0) {
throw new Error('Missing a fallback value or unmatched condition-output pair.');
}
for (var i = 0; i < args.length - 1; i += 2) {
var condition = args[i];
var value = args[i + 1];
if (condition) {
return value;
}
}
return fallback;
}
var decisionExpressions = {
'!': not,
'!=': notEqual,
'<': lessThan,
'<=': lessThanOrEqual,
'==': equal,
'>': greaterThan,
'>=': greaterThanOrEqual,
all: all,
any: any,
case: caseFunc,
match: match,
};
function featureExpression(feature, expression) {
function step(args) {
var input = args[0], defaultValue = args[1], stops = args.slice(2);
if (typeof input !== 'number') {
return defaultValue;
}
for (var i = 0; i < stops.length - 2; i += 2) {
var stopInput = stops[i];
var stopOutput = stops[i + 1];
var nextStopInput = stops[i + 2];
if (input >= stopInput && input < nextStopInput) {
return stopOutput;
}
}
if (input >= stops[stops.length - 2]) {
return stops[stops.length - 1];
}
return defaultValue;
}
var COLORS = {
aliceblue: '#f0f8ff',
antiquewhite: '#faebd7',
aqua: '#00ffff',
aquamarine: '#7fffd4',
azure: '#f0ffff',
beige: '#f5f5dc',
bisque: '#ffe4c4',
black: '#000000',
blanchedalmond: '#ffebcd',
blue: '#0000ff',
blueviolet: '#8a2be2',
brown: '#a52a2a',
burlywood: '#deb887',
cadetblue: '#5f9ea0',
chartreuse: '#7fff00',
chocolate: '#d2691e',
coral: '#ff7f50',
cornflowerblue: '#6495ed',
cornsilk: '#fff8dc',
crimson: '#dc143c',
cyan: '#00ffff',
darkblue: '#00008b',
darkcyan: '#008b8b',
darkgoldenrod: '#b8860b',
darkgray: '#a9a9a9',
darkgreen: '#006400',
darkkhaki: '#bdb76b',
darkmagenta: '#8b008b',
darkolivegreen: '#556b2f',
darkorange: '#ff8c00',
darkorchid: '#9932cc',
darkred: '#8b0000',
darksalmon: '#e9967a',
darkseagreen: '#8fbc8f',
darkslateblue: '#483d8b',
darkslategray: '#2f4f4f',
darkturquoise: '#00ced1',
darkviolet: '#9400d3',
deeppink: '#ff1493',
deepskyblue: '#00bfff',
dimgray: '#696969',
dodgerblue: '#1e90ff',
firebrick: '#b22222',
floralwhite: '#fffaf0',
forestgreen: '#228b22',
fuchsia: '#ff00ff',
gainsboro: '#dcdcdc',
ghostwhite: '#f8f8ff',
gold: '#ffd700',
goldenrod: '#daa520',
gray: '#808080',
green: '#008000',
greenyellow: '#adff2f',
honeydew: '#f0fff0',
hotpink: '#ff69b4',
'indianred ': '#cd5c5c',
indigo: '#4b0082',
ivory: '#fffff0',
khaki: '#f0e68c',
lavender: '#e6e6fa',
lavenderblush: '#fff0f5',
lawngreen: '#7cfc00',
lemonchiffon: '#fffacd',
lightblue: '#add8e6',
lightcoral: '#f08080',
lightcyan: '#e0ffff',
lightgoldenrodyellow: '#fafad2',
lightgrey: '#d3d3d3',
lightgreen: '#90ee90',
lightpink: '#ffb6c1',
lightsalmon: '#ffa07a',
lightseagreen: '#20b2aa',
lightskyblue: '#87cefa',
lightslategray: '#778899',
lightsteelblue: '#b0c4de',
lightyellow: '#ffffe0',
lime: '#00ff00',
limegreen: '#32cd32',
linen: '#faf0e6',
magenta: '#ff00ff',
maroon: '#800000',
mediumaquamarine: '#66cdaa',
mediumblue: '#0000cd',
mediumorchid: '#ba55d3',
mediumpurple: '#9370d8',
mediumseagreen: '#3cb371',
mediumslateblue: '#7b68ee',
mediumspringgreen: '#00fa9a',
mediumturquoise: '#48d1cc',
mediumvioletred: '#c71585',
midnightblue: '#191970',
mintcream: '#f5fffa',
mistyrose: '#ffe4e1',
moccasin: '#ffe4b5',
navajowhite: '#ffdead',
navy: '#000080',
oldlace: '#fdf5e6',
olive: '#808000',
olivedrab: '#6b8e23',
orange: '#ffa500',
orangered: '#ff4500',
orchid: '#da70d6',
palegoldenrod: '#eee8aa',
palegreen: '#98fb98',
paleturquoise: '#afeeee',
palevioletred: '#d87093',
papayawhip: '#ffefd5',
peachpuff: '#ffdab9',
peru: '#cd853f',
pink: '#ffc0cb',
plum: '#dda0dd',
powderblue: '#b0e0e6',
purple: '#800080',
rebeccapurple: '#663399',
red: '#ff0000',
rosybrown: '#bc8f8f',
royalblue: '#4169e1',
saddlebrown: '#8b4513',
salmon: '#fa8072',
sandybrown: '#f4a460',
seagreen: '#2e8b57',
seashell: '#fff5ee',
sienna: '#a0522d',
silver: '#c0c0c0',
skyblue: '#87ceeb',
slateblue: '#6a5acd',
slategray: '#708090',
snow: '#fffafa',
springgreen: '#00ff7f',
steelblue: '#4682b4',
tan: '#d2b48c',
teal: '#008080',
thistle: '#d8bfd8',
tomato: '#ff6347',
turquoise: '#40e0d0',
violet: '#ee82ee',
wheat: '#f5deb3',
white: '#ffffff',
whitesmoke: '#f5f5f5',
yellow: '#ffff00',
yellowgreen: '#9acd32',
};
function isHex(hex) {
return typeof hex === 'string' && /^#([A-Fa-f0-9]{3}){1,2}$/.test(hex);
}
function isRgb(hex) {
var r =
// eslint-disable-next-line max-len
/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/;
return typeof hex === 'string' && r.test(hex);
}
function isColorObj(obj) {
if (typeof obj === 'object' && obj !== null) {
var hasRgb = 'r' in obj && 'g' in obj && 'b' in obj;
var hasValidAlpha = !('a' in obj) || (typeof obj.a === 'number' && obj.a >= 0 && obj.a <= 1);
return hasRgb && hasValidAlpha;
}
return false;
}
function isColorName(name) {
if (typeof name === 'string' && name in COLORS) {
return true;
}
return false;
}
function toColor(value) {
if (isHex(value)) {
return hexToColor(value);
}
else if (isColorName(value)) {
return colorNameToColor(value);
}
else if (isRgb(value)) {
return rgbToColor(value);
}
else if (isColorObj(value)) {
return colorObjectToColor(value);
}
throw new Error("The '".concat(value, "' cannot be converted to color"));
}
function colorNameToColor(name) {
return hexToColor(COLORS[name]);
}
function hexToColor(hex) {
var shortRGB = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/;
var shortRGBA = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/;
var longRGB = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/;
var longRGBA = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/;
var result;
if ((result = shortRGB.exec(hex))) {
return [
parseInt(result[1] + result[1], 16),
parseInt(result[2] + result[2], 16),
parseInt(result[3] + result[3], 16),
];
}
else if ((result = shortRGBA.exec(hex))) {
return [
parseInt(result[1] + result[1], 16),
parseInt(result[2] + result[2], 16),
parseInt(result[3] + result[3], 16),
parseInt(result[4] + result[4], 16) / 255,
];
}
else if ((result = longRGB.exec(hex))) {
return [
parseInt(result[1], 16),
parseInt(result[2], 16),
parseInt(result[3], 16),
];
}
else if ((result = longRGBA.exec(hex))) {
return [
parseInt(result[1], 16),
parseInt(result[2], 16),
parseInt(result[3], 16),
parseInt(result[4], 16) / 255,
];
}
throw new Error("The '".concat(hex, "' Is not valid hex"));
}
function rgbToColor(rgb) {
var rgbPattern = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/;
var rgbaPattern = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;
var matches;
if ((matches = rgb.match(rgbPattern))) {
return [
parseInt(matches[1], 10),
parseInt(matches[2], 10),
parseInt(matches[3], 10),
];
}
else if ((matches = rgb.match(rgbaPattern))) {
return [
parseInt(matches[1], 10),
parseInt(matches[2], 10),
parseInt(matches[3], 10),
parseFloat(matches[4]),
];
}
throw new Error("The '".concat(rgb, "' Is not valid rgb"));
}
function colorObjectToColor(_a) {
var r = _a.r, g = _a.g, b = _a.b, a = _a.a;
return __spreadArray([r, g, b], (a !== undefined ? [a] : []), true);
}
function colorToRGB(array) {
return "rgb(".concat(array.join(','), ")");
}
function linearInterpolation(input, input1, output1, input2, output2) {
if (typeof output1 === 'number' && typeof output2 === 'number') {
return (output1 + ((input - input1) / (input2 - input1)) * (output2 - output1));
}
try {
var outputColor1 = toColor(output1);
var outputColor2_1 = toColor(output2);
return colorToRGB(outputColor1.map(function (val, index) {
return Math.ceil(linearInterpolation(input, input1, val, input2, outputColor2_1[index]));
}));
}
catch (er) {
console.log(er);
}
throw new Error('Unsupported output type for linear interpolation.');
}
function interpolate(_a) {
var interpolation = _a[0], input = _a[1], stops = _a.slice(2);
if (stops.length < 2) {
throw new Error('At least two stops are required');
}
if (typeof input !== 'number') {
throw new Error('Input must be a number.');
}
if (stops.length < 2 || stops.length % 2 !== 0) {
throw new Error('Invalid stops provided.');
}
for (var i = 0; i < stops.length - 2; i += 2) {
var stopInput1 = stops[i];
var stopOutput1 = stops[i + 1];
var stopInput2 = stops[i + 2];
var stopOutput2 = stops[i + 3];
if (input >= stopInput1 && input <= stopInput2) {
if (interpolation[0] === 'linear') {
return linearInterpolation(input, stopInput1, stopOutput1, stopInput2, stopOutput2);
}
// else if (interpolation[0] === 'exponential') {
// const base = interpolation[1];
// return exponentialInterpolation(
// input,
// base,
// stopInput1,
// stopOutput1,
// stopInput2,
// stopOutput2,
// );
// }
}
}
throw new Error('Invalid interpolation type.');
}
var interpolationExpressions = {
step: step,
interpolate: interpolate,
};
function isExpression(value) {
if (Array.isArray(value)) {
var lookup = value[0], cases = value.slice(1);
var l = lookup;
return (typeof l === 'string' &&
l !== 'literal' &&
l in expressions &&
cases.length > 0);
}
return false;
}
var expressions = __assign(__assign(__assign(__assign(__assign(__assign({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
function evaluate(expression, data) {
if (data === void 0) { data = {}; }
var name = expression[0], args = expression.slice(1);
var expressionFun = expressions[name];
if (expressionFun) {
return expressionFun(feature, args);
return expressionFun(args.map(function (arg) { return (isExpression(arg) ? evaluate(arg, data) : arg); }), data);
}
return undefined;
throw new Error("Expression \"".concat(name, "\" is not supported."));
}
function createPropertyExpressionCb(expression) {
return function (feature) {
return featureExpression(feature, expression);
var properties = feature.properties;
if (properties) {
return evaluate(expression, properties);
}
return false;
};

@@ -333,3 +937,2 @@ }

exports.isBasePaint = isBasePaint;
exports.isExpression = isExpression;
exports.isIcon = isIcon;

@@ -336,0 +939,0 @@ exports.isPaint = isPaint;

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

var Paint=function(r){"use strict";function n(r){return!!Array.isArray(r)}function t(r){return!!Array.isArray(r)}function e(r){return"[object Object]"===Object.prototype.toString.call(r)}function i(r){return"function"==typeof r}var o=function(){return o=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r},o.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var u={get:function(r,n){return r.properties&&r.properties[n[0]]},match:function(r,n){var t=n[0],e=n.slice(1),i=t;Array.isArray(t)&&(i=f(r,t));for(var o=e.splice(-1,e.length%2)[0],u=0;u<e.length-1;u+=2){if(e[u]===i)return e[u+1]}return o}};function f(r,n){var t=n[0],e=n.slice(1),i=u[t];if(i)return i(r,e)}function c(r){return function(n){return f(n,r)}}var a=["iconSize","iconAnchor"];function p(r){var t=!1,e={};for(var i in r)if(-1===a.indexOf(i)){var u=i,f=r[u];n(f)&&(t=!0,e[u]=c(f))}if(t)return function(n){var t={};for(var i in e)t[i]=e[i](n);return o(o({},r),t)}}function l(r,n,t){if((n=String(n))===(r=String(r)))return!0;if(t&&n.toUpperCase()===r.toUpperCase())return!0;var e,i="^".concat((e=n,e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,t?"i":"").exec(r)}var s={gt:function(r,n){return r>n},lt:function(r,n){return r<n},ge:function(r,n){return r>=n},le:function(r,n){return r<=n},eq:function(r,n){return r===n},ne:function(r,n){return r!==n},in:function(r,n){return-1!==n.indexOf(r)},notin:function(r,n){return-1===n.indexOf(r)},like:function(r,n){return l(r,n)},ilike:function(r,n){return l(r,n,!0)}};function y(r,n){var t=o({},r.properties);return!!t&&(t.$id=r.id,v(t,n))}function v(r,n){var t="string"==typeof n[0]?n[0]:"all",e=function(n){if(3===(c=n).length&&"string"==typeof c[0]&&"string"==typeof c[1]){var t=n[0],e=n[1],i=n[2],o=s[e];if(o){if(("like"===e||"ilike"===e)&&"string"==typeof t){var u="",f=t.replace(/^%?(\w+)%?$/,(function(n,e){return u=r[e],t.replace(e,i)}));return o(u,f)}return o(r[t],i)}return!1}return v(r,n);var c},i=n.filter((function(r){return Array.isArray(r)}));return"any"===t?i.some(e):i.every(e)}function g(r,n,t){var e=p(r);if(e){var i=function(r){return k(e(r),n,t)};return i.paint=r,i}var u=o({},n);return(u=o(o({},u),r)).fill=void 0===u.fill||u.fill,u.stroke=void 0!==u.stroke?u.stroke:!u.fill||!(!u.strokeColor&&!u.strokeOpacity),u}function k(r,n,e){if(!r)throw new Error("paint is empty");var u=o({},n);if(i(r)){var f=function(t){var i=k(r(t),n,e);return i.type=r.type,i};return f.type=r.type,f}if(t(r))return function(t){return k(function(r){for(var n={},t=[],e=0,i=r;e<i.length;e++){var u=i[e];u&&(Array.isArray(u)?t.push(u):n=u)}return function(r){var e=t.find((function(n){return y(r,n[0])}));return e?o(o({},n),e[1]):n}}(r)(t),n,e)};if("get-paint"===r.type){var c=function(r,n){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&n){var t=n[r.from];if(t)return t(r.options)}}(r,e);c&&(u=k(c,n,e))}else{if("icon"===r.type)return r;u=g(r,n,e)}return i(u)||("color"in u&&(u.strokeColor||(u.strokeColor=u.color),u.fillColor||(u.fillColor=u.color)),"opacity"in u&&(void 0===u.strokeOpacity&&(u.strokeOpacity=u.opacity),void 0===u.fillOpacity&&(u.fillOpacity=u.opacity))),u}return r.createExpressionCallback=p,r.expressionCallback=g,r.isBasePaint=function(r){return!!e(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isExpression=n,r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=e,r.isPaintCallback=i,r.isPropertiesPaint=t,r.preparePaint=k,Object.defineProperty(r,"__esModule",{value:!0}),r}({});
var Paint=function(r){"use strict";function e(r){return!!Array.isArray(r)}function n(r){return"[object Object]"===Object.prototype.toString.call(r)}function t(r){return"function"==typeof r}var o=function(){return o=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},o.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var i=function(r,e,n){try{var t=r(e,n);if(void 0!==t)return t}catch(o){}};function f(r){return function(e,n){for(var t=0,o=e;t<o.length;t++){var f=i(r,o[t],n);if(void 0!==f)return f}throw new Error("Received a mismatched type")}}var a={array:function(r){var e,n=r[0],t=r[1],o=r[2],i=void 0,f=void 0;if("string"==typeof n&&["string","number","boolean"].includes(n)?(i=n,"number"==typeof t?(f=t,e=o):e=t):Array.isArray(n)&&(e=n),!Array.isArray(e))throw new Error("Expected an array");if(i&&!e.every((function(r){return typeof r===i})))throw new Error("Expected all items in array to be of type ".concat(i));if(f&&e.length!==f)throw new Error("Expected array of length ".concat(f));return e},boolean:f((function(r){return"boolean"==typeof r?r:void 0})),literal:function(r){return r[0]},number:f((function(r){return"number"==typeof r?r:void 0})),object:f((function(r){return null===r||"object"!=typeof r||Array.isArray(r)?void 0:r})),string:f((function(r){return"string"==typeof r?r:void 0})),"to-boolean":f(Boolean),"to-number":f(Number),"to-string":f(String),typeof:function(r){return typeof r[0]}};var u={get:function(r,e){var n=r[0],t=r[1]||e;return t&&"object"==typeof t&&n in t?t[n]:null},length:function(r){var e=r[0];if("string"==typeof e||Array.isArray(e))return e.length},at:function(r){return r[1][r[0]]},has:function(r,e){var n=r[1]||e;return!(!n||"object"!=typeof n||!(r[0]in n))},in:function(r){var e=r[0],n=r[1];if("string"==typeof n)return n.includes(String(e));if(Array.isArray(n))return n.includes(e);throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof n,"."))},"index-of":function(r){var e=r[0],n=r[1],t=r[2];if("string"==typeof n)return n.indexOf(String(e),t);if(Array.isArray(n))return n.indexOf(e,t);throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof n,"."))},slice:function(r){var e=r[0],n=r[1],t=r[2];if("string"==typeof e)return e.slice(n,t);if(Array.isArray(e))return e.slice(n,t);throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof e,"."))}},c={concat:function(r){return r.reduce((function(r,e){return String(r)+String(e)}),"")},downcase:function(r){return String(r[0]).toLowerCase()},upcase:function(r){return String(r[0]).toUpperCase()}};var l=function(r){if(typeof r[0]!=typeof r[1])throw new Error("Values have different types.")};var s={"!":function(r){return!r[0]},"!=":function(r){var e=r[0],n=r[1];return l([e,n]),e!==n},"<":function(r){var e=r[0],n=r[1];return l([e,n]),e<n},"<=":function(r){var e=r[0],n=r[1];return l([e,n]),e<=n},"==":function(r){var e=r[0],n=r[1];return l([e,n]),e===n},">":function(r){var e=r[0],n=r[1];return l([e,n]),e>n},">=":function(r){var e=r[0],n=r[1];return l([e,n]),e>=n},all:function(r){for(var e=0;e<r.length;e++){if(!r[e])return!1}return!0},any:function(r){for(var e=0;e<r.length;e++){if(r[e])return!0}return!1},case:function(r){if(r.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');var e=r[r.length-1];if(r.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(var n=0;n<r.length-1;n+=2){if(r[n])return r[n+1]}return e},match:function(r){for(var e=r[0],n=r.slice(1),t=n.splice(-1,n.length%2)[0],o=0;o<n.length-1;o+=2){if(n[o]===e)return n[o+1]}return t}};var d={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function p(r){if("string"==typeof(i=r)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return g(r);if("string"==typeof(o=r)&&o in d)return function(r){return g(d[r])}(r);if(function(r){return"string"==typeof r&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(r)}(r))return function(r){var e,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(e=r.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)];if(e=r.match(n))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])];throw new Error("The '".concat(r,"' Is not valid rgb"))}(r);if("object"==typeof(t=r)&&null!==t&&"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1))return function(r,e,n){if(n||2===arguments.length)for(var t,o=0,i=e.length;o<i;o++)!t&&o in e||(t||(t=Array.prototype.slice.call(e,0,o)),t[o]=e[o]);return r.concat(t||Array.prototype.slice.call(e))}([(e=r).r,e.g,e.b],void 0!==(n=e.a)?[n]:[],!0);var e,n,t,o,i;throw new Error("The '".concat(r,"' cannot be converted to color"))}function g(r){var e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(r))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(r))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error("The '".concat(r,"' Is not valid hex"))}function y(r,e,n,t,o){if("number"==typeof n&&"number"==typeof o)return n+(r-e)/(t-e)*(o-n);try{var i=p(n),f=p(o);return function(r){return"rgb(".concat(r.join(","),")")}(i.map((function(n,o){return Math.ceil(y(r,e,n,t,f[o]))})))}catch(a){console.log(a)}throw new Error("Unsupported output type for linear interpolation.")}var h={step:function(r){var e=r[0],n=r[1],t=r.slice(2);if("number"!=typeof e)return n;for(var o=0;o<t.length-2;o+=2){if(e>=t[o]&&e<t[o+2])return t[o+1]}return e>=t[t.length-2]?t[t.length-1]:n},interpolate:function(r){var e=r[0],n=r[1],t=r.slice(2);if(t.length<2)throw new Error("At least two stops are required");if("number"!=typeof n)throw new Error("Input must be a number.");if(t.length<2||t.length%2!=0)throw new Error("Invalid stops provided.");for(var o=0;o<t.length-2;o+=2){var i=t[o],f=t[o+2];if(n>=i&&n<=f&&"linear"===e[0])return y(n,i,t[o+1],f,t[o+3])}throw new Error("Invalid interpolation type.")}};function b(r){if(Array.isArray(r)){var e=r[0],n=r.slice(1);return"string"==typeof e&&"literal"!==e&&e in v&&n.length>0}return!1}var v=o(o(o(o(o(o({},{"+":function(r){return r.reduce((function(r,e){return r+e}),0)},"-":function(r){return r.reduce((function(r,e){return r-e}))},"*":function(r){return r.reduce((function(r,e){return r*e}),1)},"/":function(r){return r.reduce((function(r,e){return r/e}))},"%":function(r){return r[0]%r[1]},"^":function(r){return Math.pow(r[0],r[1])},abs:function(r){return Math.abs(r[0])},acos:function(r){return Math.acos(r[0])},asin:function(r){return Math.asin(r[0])},atan:function(r){return Math.atan(r[0])},ceil:function(r){return Math.ceil(r[0])},cos:function(r){return Math.cos(r[0])},e:function(){return Math.E},floor:function(r){return Math.floor(r[0])},ln:function(r){return Math.log(r[0])},ln2:function(){return Math.LN2},log10:function(r){return Math.log10(r[0])},log2:function(r){return Math.log2(r[0])},max:function(r){return Math.max.apply(Math,r)},min:function(r){return Math.min.apply(Math,r)},pi:function(){return Math.PI},round:function(r){return Math.round(r[0])},sin:function(r){return Math.sin(r[0])},sqrt:function(r){return Math.sqrt(r[0])},tan:function(r){return Math.tan(r[0])}}),a),c),u),s),h);function m(r,e){void 0===e&&(e={});var n=r[0],t=r.slice(1),o=v[n];if(o)return o(t.map((function(r){return b(r)?m(r,e):r})),e);throw new Error('Expression "'.concat(n,'" is not supported.'))}function w(r){return function(e){var n=e.properties;return!!n&&m(r,n)}}var k=["iconSize","iconAnchor"];function A(r){var e=!1,n={};for(var t in r)if(-1===k.indexOf(t)){var i=t,f=r[i];b(f)&&(e=!0,n[i]=w(f))}if(e)return function(e){var t={};for(var i in n)t[i]=n[i](e);return o(o({},r),t)}}function E(r,e,n){if((e=String(e))===(r=String(r)))return!0;if(n&&e.toUpperCase()===r.toUpperCase())return!0;var t,o="^".concat((t=e,t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(o,n?"i":"").exec(r)}var I={gt:function(r,e){return r>e},lt:function(r,e){return r<e},ge:function(r,e){return r>=e},le:function(r,e){return r<=e},eq:function(r,e){return r===e},ne:function(r,e){return r!==e},in:function(r,e){return-1!==e.indexOf(r)},notin:function(r,e){return-1===e.indexOf(r)},like:function(r,e){return E(r,e)},ilike:function(r,e){return E(r,e,!0)}};function x(r,e){var n=o({},r.properties);return!!n&&(n.$id=r.id,M(n,e))}function M(r,e){var n="string"==typeof e[0]?e[0]:"all",t=function(e){if(3===(u=e).length&&"string"==typeof u[0]&&"string"==typeof u[1]){var n=e[0],t=e[1],o=e[2],i=I[t];if(i){if(("like"===t||"ilike"===t)&&"string"==typeof n){var f="",a=n.replace(/^%?(\w+)%?$/,(function(e,t){return f=r[t],n.replace(t,o)}));return i(f,a)}return i(r[n],o)}return!1}return M(r,e);var u},o=e.filter((function(r){return Array.isArray(r)}));return"any"===n?o.some(t):o.every(t)}function F(r,e,n){var t=A(r);if(t){var i=function(r){return O(t(r),e,n)};return i.paint=r,i}var f=o({},e);return(f=o(o({},f),r)).fill=void 0===f.fill||f.fill,f.stroke=void 0!==f.stroke?f.stroke:!f.fill||!(!f.strokeColor&&!f.strokeOpacity),f}function O(r,n,i){if(!r)throw new Error("paint is empty");var f=o({},n);if(t(r)){var a=function(e){var t=O(r(e),n,i);return t.type=r.type,t};return a.type=r.type,a}if(e(r))return function(e){return O(function(r){for(var e={},n=[],t=0,i=r;t<i.length;t++){var f=i[t];f&&(Array.isArray(f)?n.push(f):e=f)}return function(r){var t=n.find((function(e){return x(r,e[0])}));return t?o(o({},e),t[1]):e}}(r)(e),n,i)};if("get-paint"===r.type){var u=function(r,e){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&e){var n=e[r.from];if(n)return n(r.options)}}(r,i);u&&(f=O(u,n,i))}else{if("icon"===r.type)return r;f=F(r,n,i)}return t(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f}return r.createExpressionCallback=A,r.expressionCallback=F,r.isBasePaint=function(r){return!!n(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=n,r.isPaintCallback=t,r.isPropertiesPaint=e,r.preparePaint=O,Object.defineProperty(r,"__esModule",{value:!0}),r}({});
//# sourceMappingURL=paint.global.prod.js.map
{
"name": "@nextgis/paint",
"version": "1.17.0",
"version": "1.18.0",
"description": "Create style for vector layer",

@@ -11,4 +11,5 @@ "main": "index.js",

"dependencies": {
"@nextgis/properties-filter": "^1.17.0",
"geojson": "^0.5.0"
"@nextgis/expression": "^1.18.0",
"@nextgis/properties-filter": "^1.18.0",
"@types/geojson": "^7946.0.8"
},

@@ -52,3 +53,3 @@ "devDependencies": {

},
"gitHead": "c3162aae53c381cd6a581a2a67173fb1bf6de87e"
"gitHead": "ef39a9a482330e117d0410d5b19cfb3337669f17"
}

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

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