UNPKG

@here/harp-examples

Version:
2 lines 800 kB
/*! For license information please see harp.js.LICENSE.txt */ var harp;harp=(()=>{var e={2519:function(e){e.exports=function(){"use strict";function e(e,r,n,s,o){!function e(i,r,n,s,o){for(;s>n;){if(s-n>600){var a=s-n+1,l=r-n+1,c=Math.log(a),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(a-h)/a)*(l-a/2<0?-1:1);e(i,r,Math.max(n,Math.floor(r-l*h/a+d)),Math.min(s,Math.floor(r+(a-l)*h/a+d)),o)}var u=i[r],m=n,p=s;for(t(i,n,r),o(i[s],u)>0&&t(i,n,s);m<p;){for(t(i,m,p),m++,p--;o(i[m],u)<0;)m++;for(;o(i[p],u)>0;)p--}0===o(i[n],u)?t(i,n,p):t(i,++p,s),p<=r&&(n=p+1),r<=p&&(s=p-1)}}(e,r,n||0,s||e.length-1,o||i)}function t(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function i(e,t){return e<t?-1:e>t?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function s(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,r,n){n||(n=p(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var s=t;s<i;s++){var o=e.children[s];a(n,e.leaf?r(o):o)}return n}function a(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function h(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function u(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(t,i,r,n,s){for(var o=[i,r];o.length;)if(!((r=o.pop())-(i=o.pop())<=n)){var a=i+Math.ceil((r-i)/n/2)*n;e(t,a,i,r,s),o.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,i=[];if(!m(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var s=0;s<t.children.length;s++){var o=t.children[s],a=t.leaf?r(o):o;m(e,a)&&(t.leaf?i.push(o):u(e,a)?this._all(o,i):n.push(o))}t=n.pop()}return i},r.prototype.collides=function(e){var t=this.data;if(!m(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],s=t.leaf?this.toBBox(n):n;if(m(e,s)){if(t.leaf||u(e,s))return!0;i.push(n)}}t=i.pop()}return!1},r.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(e,t){if(!e)return this;for(var i,r,s,o=this.data,a=this.toBBox(e),l=[],c=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],i=c.pop(),s=!0),o.leaf){var h=n(e,o.children,t);if(-1!==h)return o.children.splice(h,1),l.push(o),this._condense(l),this}s||o.leaf||!u(o,a)?r?(i++,o=r.children[i],s=!1):o=null:(l.push(o),c.push(i),i=0,r=o,o=o.children[0])}return this},r.prototype.toBBox=function(e){return e},r.prototype.compareMinX=function(e,t){return e.minX-t.minX},r.prototype.compareMinY=function(e,t){return e.minY-t.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(e){return this.data=e,this},r.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},r.prototype._build=function(e,t,i,r){var n,o=i-t+1,a=this._maxEntries;if(o<=a)return s(n=p(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(n=p([])).leaf=!1,n.height=r;var l=Math.ceil(o/a),c=l*Math.ceil(Math.sqrt(a));f(e,t,i,c,this.compareMinX);for(var h=t;h<=i;h+=c){var d=Math.min(h+c-1,i);f(e,h,d,l,this.compareMinY);for(var u=h;u<=d;u+=l){var m=Math.min(u+l-1,d);n.children.push(this._build(e,u,m,r-1))}}return s(n,this.toBBox),n},r.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,s=1/0,o=void 0,a=0;a<t.children.length;a++){var l=t.children[a],c=h(l),d=(u=e,m=l,(Math.max(m.maxX,u.maxX)-Math.min(m.minX,u.minX))*(Math.max(m.maxY,u.maxY)-Math.min(m.minY,u.minY))-c);d<s?(s=d,n=c<n?c:n,o=l):d===s&&c<n&&(n=c,o=l)}t=o||t.children[0]}var u,m;return t},r.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],s=this._chooseSubtree(r,this.data,t,n);for(s.children.push(e),a(s,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},r.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),a=p(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,i){for(var r,n,s,a,l,c,d,u=1/0,m=1/0,p=t;p<=i-t;p++){var f=o(e,0,p,this.toBBox),g=o(e,p,i,this.toBBox),v=(n=f,s=g,a=Math.max(n.minX,s.minX),l=Math.max(n.minY,s.minY),c=Math.min(n.maxX,s.maxX),d=Math.min(n.maxY,s.maxY),Math.max(0,c-a)*Math.max(0,d-l)),_=h(f)+h(g);v<u?(u=v,r=p,m=_<m?_:m):v===u&&_<m&&(m=_,r=p)}return r||i-t},r.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:l,n=e.leaf?this.compareMinY:c;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},r.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,s=o(e,0,t,n),l=o(e,i-t,i,n),c=d(s)+d(l),h=t;h<i-t;h++){var u=e.children[h];a(s,e.leaf?n(u):u),c+=d(s)}for(var m=i-t-1;m>=t;m--){var p=e.children[m];a(l,e.leaf?n(p):p),c+=d(l)}return c},r.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)a(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():s(e[t],this.toBBox)},r}()},2058:(e,t)=>{var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(e){return(e=Math.round(e))<0?0:e>255?255:e}function n(e){return e<0?0:e>1?1:e}function s(e){return"%"===e[e.length-1]?r(parseFloat(e)/100*255):r(parseInt(e))}function o(e){return"%"===e[e.length-1]?n(parseFloat(e)/100):n(parseFloat(e))}function a(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{t.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=n.indexOf("("),c=n.indexOf(")");if(-1!==l&&c+1===n.length){var h=n.substr(0,l),d=n.substr(l+1,c-(l+1)).split(","),u=1;switch(h){case"rgba":if(4!==d.length)return null;u=o(d.pop());case"rgb":return 3!==d.length?null:[s(d[0]),s(d[1]),s(d[2]),u];case"hsla":if(4!==d.length)return null;u=o(d.pop());case"hsl":if(3!==d.length)return null;var m=(parseFloat(d[0])%360+360)%360/360,p=o(d[1]),f=o(d[2]),g=f<=.5?f*(p+1):f+p-f*p,v=2*f-g;return[r(255*a(v,g,m+1/3)),r(255*a(v,g,m)),r(255*a(v,g,m-1/3)),u];default:return null}}return null}}catch(e){}},5263:function(e,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),n(i(5257),t),n(i(1470),t),n(i(9416),t),n(i(8937),t),n(i(1549),t),n(i(6665),t)},2636:function(e,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),n(i(4482),t),n(i(8937),t),n(i(7828),t),n(i(8212),t),n(i(172),t),n(i(6792),t),n(i(7487),t),n(i(2904),t),n(i(7299),t),n(i(2525),t),n(i(5253),t),n(i(7954),t),n(i(1460),t),n(i(84),t),n(i(7187),t),n(i(6665),t),n(i(8648),t),n(i(8783),t)},4482:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorUtils=void 0;const r=i(1845),n=i(4428),s=i(5795),o=255,a=new n.Color;var l;(l=t.ColorUtils||(t.ColorUtils={})).getHexFromRgba=function(e,t,i,n){return r.assert(n>=0&&n<=1),o-Math.floor(n*o)<<24^e*o<<16^t*o<<8^i*o<<0},l.getHexFromRgb=function(e,t,i){return r.assert(e>=0&&e<=1),r.assert(t>=0&&t<=1),r.assert(i>=0&&i<=1),e*o<<16^t*o<<8^i*o<<0},l.getHexFromHsl=function(e,t,i){return r.assert(e>=0&&e<=1),r.assert(t>=0&&t<=1),r.assert(i>=0&&i<=1),a.setHSL(e,t,i).getHex()},l.getRgbaFromHex=function(e,t=new s.RGBA){return r.assert(0==(0&e),"Wrong hex format"),t.r=(e>>16&o)/o,t.g=(e>>8&o)/o,t.b=(e>>0&o)/o,t.a=(o-(e>>24&o))/o,t},l.hasAlphaInHex=function(e){return r.assert(0==(0&e),"Wrong hex format"),e>>24!=0},l.getAlphaFromHex=function(e){return r.assert(0==(0&e),"Wrong hex format"),(o-(e>>24)&o)/o},l.removeAlphaFromHex=function(e){return r.assert(0==(0&e),"Wrong hex format"),16777215&e}},84:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeatureText=t.getFeatureName=t.getFeatureId=t.getProjectionName=t.getProjection=t.GeometryType=t.getArrayConstructor=void 0;const r=i(8957),n=i(8937),s=i(3024),o=i(7828);function a(e,t,i,r,n){var s;let o;if(void 0===t&&(t="name"),i){const i=e.lookup(`${t}:short`);if("string"==typeof i&&i.length>0)return i}if(r){const t=e.lookup("iso_code");if("string"==typeof t&&t.length>0)return t}if(void 0!==n)for(const i of n)if(o=null!==(s=e.lookup(`${t}:${i}`))&&void 0!==s?s:e.lookup(`${t}_${i}`),"string"==typeof o&&o.length>0)return o;if(o=e.lookup(t),"string"==typeof o)return o}var l;t.getArrayConstructor=function(e){switch(e){case"float":return Float32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array}},(l=t.GeometryType||(t.GeometryType={}))[l.Unspecified=0]="Unspecified",l[l.Point=1]="Point",l[l.Line=2]="Line",l[l.SolidLine=3]="SolidLine",l[l.Text=4]="Text",l[l.TextPath=5]="TextPath",l[l.ExtrudedLine=6]="ExtrudedLine",l[l.Polygon=7]="Polygon",l[l.ExtrudedPolygon=8]="ExtrudedPolygon",l[l.Object3D=9]="Object3D",l[l.Other=1e3]="Other",t.getProjection=function(e){switch(e){case"mercator":return r.mercatorProjection;case"webMercator":return r.webMercatorProjection;case"sphere":return r.sphereProjection;case"normalizedEquirectangular":return r.normalizedEquirectangularProjection;case"equirectangular":return r.equirectangularProjection;default:throw new Error(`Unknown projection ${e}`)}},t.getProjectionName=function(e){if(e===r.mercatorProjection)return"mercator";if(e===r.webMercatorProjection)return"webMercator";if(e===r.sphereProjection)return"sphere";if(e===r.normalizedEquirectangularProjection)return"normalizedEquirectangular";if(e===r.equirectangularProjection)return"equirectangular";throw new Error("Unknown projection")},t.getFeatureId=function(e){return void 0===e?0:"number"==typeof e?e:e.hasOwnProperty("$id")?e.$id:0},t.getFeatureName=a,t.getFeatureText=function(e,t,i){let r,l;const c=e instanceof n.Env?e:e.env;let h="name";if(o.isTextTechnique(t)||o.isPoiTechnique(t)||o.isLineMarkerTechnique(t)){if(void 0!==t.text)return s.evaluateTechniqueAttr(e,t.text);if(void 0!==t.label&&(h=s.evaluateTechniqueAttr(e,t.label),"string"!=typeof h))return;r=t.useAbbreviation,l=t.useIsoCode}return a(c,h,r,l,i)}},9415:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapEnv=t.Env=void 0;class i{static isEnv(e){return e instanceof i}lookup(e){}unmap(){return{}}}t.Env=i,t.MapEnv=class extends i{constructor(e,t){super(),this.entries=e,this.parent=t}lookup(e){if(this.entries.hasOwnProperty(e)){const t=this.entries[e];if(void 0!==t)return t}return this.parent?this.parent.lookup(e):void 0}unmap(){const e=this.parent?this.parent.unmap():{};for(const t in this.entries)this.entries.hasOwnProperty(t)&&(e[t]=this.entries[t]);return e}}},8937:function(e,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.InterpolateExpr=t.StepExpr=t.CaseExpr=t.MatchExpr=t.CallExpr=t.HasAttributeExpr=t.ObjectLiteralExpr=t.StringLiteralExpr=t.NumberLiteralExpr=t.BooleanLiteralExpr=t.NullLiteralExpr=t.LiteralExpr=t.VarExpr=t.Expr=t.ExprScope=t.isJsonExpr=t.ExprDependencies=void 0;const s=i(4428),o=i(2344),a=i(5318),l=i(4973),c=i(2904),h=i(5997),d=i(5795);n(i(9415),t);const u=new o.ExprEvaluator,m=new a.ExprInstantiator;class p{constructor(){this.properties=new Set}}t.ExprDependencies=p;class f{static of(e){const t=new p;return e.accept(this.instance,t),t}visitNullLiteralExpr(e,t){}visitBooleanLiteralExpr(e,t){}visitNumberLiteralExpr(e,t){}visitStringLiteralExpr(e,t){}visitObjectLiteralExpr(e,t){}visitVarExpr(e,t){t.properties.add(e.name)}visitHasAttributeExpr(e,t){t.properties.add(e.name)}visitCallExpr(e,t){switch(e.args.forEach((e=>e.accept(this,t))),e.op){case"dynamic-properties":t.volatile=!0;break;case"feature-state":t.featureState=!0,t.properties.add("$state"),t.properties.add("$id");break;case"id":t.properties.add("$id");break;case"zoom":case"world-ppi-scale":case"world-discrete-ppi-scale":t.properties.add("$zoom");break;case"geometry-type":t.properties.add("$geometryType")}}visitMatchExpr(e,t){e.value.accept(this,t),e.branches.forEach((([e,i])=>i.accept(this,t))),e.fallback.accept(this,t)}visitCaseExpr(e,t){e.branches.forEach((([e,i])=>{e.accept(this,t),i.accept(this,t)})),e.fallback.accept(this,t)}visitStepExpr(e,t){e.input.accept(this,t),e.defaultValue.accept(this,t),e.stops.forEach((([e,i])=>i.accept(this,t)))}visitInterpolateExpr(e,t){e.input.accept(this,t),e.stops.forEach((([e,i])=>i.accept(this,t)))}}function g(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]}var v;f.instance=new f,t.isJsonExpr=g,function(e){e[e.Value=0]="Value",e[e.Condition=1]="Condition",e[e.Dynamic=2]="Dynamic"}(v=t.ExprScope||(t.ExprScope={}));class _{static isExpr(e){return e instanceof _}static parse(e){return new l.ExprParser(e).parse()}static fromJSON(e,t,i){return O(e,void 0!==t?{definitions:t,lockedNames:new Set,cache:null!=i?i:new Map}:void 0)}evaluate(e,t=v.Value,i){return this.accept(u,new o.ExprEvaluatorContext(u,e,t,i))}instantiate(e){return this.accept(m,e)}dependencies(){return this.m_dependencies||(this.m_dependencies=f.of(this)),this.m_dependencies}intern(e){return e.add(this)}toJSON(){return(new D).serialize(this)}isDynamic(){return void 0===this.m_isDynamic&&(this.m_isDynamic=this.exprIsDynamic()),this.m_isDynamic}}t.Expr=_;class y extends _{constructor(e){super(),this.name=e}accept(e,t){return e.visitVarExpr(this,t)}exprIsDynamic(){return!1}}t.VarExpr=y;class x extends _{static fromValue(e){switch(typeof e){case"boolean":return new T(e);case"number":return new w(e);case"string":return new S(e);case"object":return null===e?b.instance:new M(e);default:throw new Error(`failed to create a literal from '${e}'`)}}exprIsDynamic(){return!1}}t.LiteralExpr=x;class b extends x{constructor(){super(),this.value=null}accept(e,t){return e.visitNullLiteralExpr(this,t)}exprIsDynamic(){return!1}}t.NullLiteralExpr=b,b.instance=new b;class T extends x{constructor(e){super(),this.value=e}accept(e,t){return e.visitBooleanLiteralExpr(this,t)}}t.BooleanLiteralExpr=T;class w extends x{constructor(e){super(),this.value=e}accept(e,t){return e.visitNumberLiteralExpr(this,t)}}t.NumberLiteralExpr=w;class S extends x{constructor(e){super(),this.value=e}get promotedValue(){var e,t,i;return void 0===this.m_promotedValue&&(this.m_promotedValue=null!==(t=null!==(e=d.RGBA.parse(this.value))&&void 0!==e?e:h.Pixels.parse(this.value))&&void 0!==t?t:null),null!==(i=this.m_promotedValue)&&void 0!==i?i:void 0}accept(e,t){return e.visitStringLiteralExpr(this,t)}}t.StringLiteralExpr=S;class M extends x{constructor(e){super(),this.value=e}get isArrayLiteral(){return Array.isArray(this.value)}accept(e,t){return e.visitObjectLiteralExpr(this,t)}}t.ObjectLiteralExpr=M;class E extends _{constructor(e){super(),this.name=e}accept(e,t){return e.visitHasAttributeExpr(this,t)}exprIsDynamic(){return!1}}t.HasAttributeExpr=E;class P extends _{constructor(e,t){super(),this.op=e,this.args=t}get children(){return this.args}accept(e,t){return e.visitCallExpr(this,t)}exprIsDynamic(){var e;const t=null!==(e=this.descriptor)&&void 0!==e?e:o.ExprEvaluator.getOperator(this.op);return!!(t&&t.isDynamicOperator&&t.isDynamicOperator(this))||this.args.some((e=>e.isDynamic()))}}t.CallExpr=P;class C extends _{constructor(e,t,i){super(),this.value=e,this.branches=t,this.fallback=i}static isValidMatchLabel(e){switch(typeof e){case"number":case"string":return!0;case"object":if(!Array.isArray(e)||0===e.length)return!1;const t=typeof e[0];return("number"===t||"string"===t)&&e.every((e=>typeof e===t));default:return!1}}accept(e,t){return e.visitMatchExpr(this,t)}exprIsDynamic(){return this.value.isDynamic()||this.branches.some((([e,t])=>t.isDynamic()))||this.fallback.isDynamic()}}t.MatchExpr=C;class A extends _{constructor(e,t){super(),this.branches=e,this.fallback=t}accept(e,t){return e.visitCaseExpr(this,t)}exprIsDynamic(){return this.branches.some((([e,t])=>e.isDynamic()||t.isDynamic()))||this.fallback.isDynamic()}}t.CaseExpr=A;class L extends _{constructor(e,t,i){super(),this.input=e,this.defaultValue=t,this.stops=i}accept(e,t){return e.visitStepExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.defaultValue.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.StepExpr=L;class R extends _{constructor(e,t,i){super(),this.mode=e,this.input=t,this.stops=i}accept(e,t){return e.visitInterpolateExpr(this,t)}exprIsDynamic(){return this.input.isDynamic()||this.stops.some((([e,t])=>t.isDynamic()))}}t.InterpolateExpr=R;class D{serialize(e){return e.accept(this,void 0)}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value instanceof s.Vector2?["make-vector",e.value.x,e.value.y]:e.value instanceof s.Vector3?["make-vector",e.value.x,e.value.y,e.value.z]:e.value instanceof s.Vector4?["make-vector",e.value.x,e.value.y,e.value.z,e.value.w]:["literal",e.value]}visitVarExpr(e,t){return["get",e.name]}visitHasAttributeExpr(e,t){return["has",e.name]}visitCallExpr(e,t){return[e.op,...e.args.map((e=>this.serialize(e)))]}visitMatchExpr(e,t){const i=[];for(const[t,r]of e.branches)i.push(t,this.serialize(r));return["match",this.serialize(e.value),...i,this.serialize(e.fallback)]}visitCaseExpr(e,t){const i=[];for(const[t,r]of e.branches)i.push(this.serialize(t),this.serialize(r));return["case",...i,this.serialize(e.fallback)]}visitStepExpr(e,t){const i=["step"];return i.push(this.serialize(e.input)),i.push(this.serialize(e.defaultValue)),e.stops.forEach((([e,t])=>{i.push(e),i.push(this.serialize(t))})),i}visitInterpolateExpr(e,t){const i=["interpolate",e.mode];return i.push(this.serialize(e.input)),e.stops.forEach((([e,t])=>{i.push(e),i.push(this.serialize(t))})),i}}function O(e,t){if(Array.isArray(e))return F(e,t);if(null===e)return b.instance;if("boolean"==typeof e)return new T(e);if("number"==typeof e)return new w(e);if("string"==typeof e)return new S(e);throw new Error(`failed to create expression from: ${JSON.stringify(e)}`)}function F(e,t){const i=e[0];if("string"!=typeof i)throw new Error("expected a builtin function name");switch(i){case"!has":case"!in":return new P("!",[F([i.slice(1),...e.slice(1)])]);case"ref":return function(e,t){if("string"!=typeof e[1])throw new Error("expected the name of an attribute");if(void 0===t)throw new Error("ref used with no definitions");const i=e[1];if(t.lockedNames.has(i))throw new Error(`circular referene to '${i}'`);if(!(i in t.definitions))throw new Error(`definition '${i}' not found`);const r=t.cache.get(i);if(void 0!==r)return r;let n,s=t.definitions[i];if(c.isInterpolatedPropertyDefinition(s.value))return _.fromJSON(c.interpolatedPropertyDefinitionToJsonExpr(s.value));if(!g(s.value))return _.fromJSON(s.value);if(s=s.value,!g(s))throw new Error(`unsupported definition ${i}`);t.lockedNames.add(i);try{n=O(s,t)}finally{t.lockedNames.delete(i)}return t.cache.set(i,n),n}(e,t);case"get":return function(e,t){if(void 0!==e[2])return I("get",e,t);const i=e[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new y(i)}(e,t);case"has":return function(e,t){if(void 0!==e[2])return I("has",e,t);const i=e[1];if("string"!=typeof i)throw new Error("expected the name of an attribute");return new E(i)}(e,t);case"literal":return function(e){const t=e[1];if(null===t||"object"!=typeof t)throw new Error("expected an object or array literal");return new M(t)}(e);case"match":return function(e,t){if(e.length<4)throw new Error("not enough arguments");if(!(e.length%2))throw new Error("fallback is missing in 'match' expression");const i=O(e[1],t),r=[];for(let i=2;i<e.length-1;i+=2){const n=e[i];if(!C.isValidMatchLabel(n))throw new Error(`'${JSON.stringify(n)}' is not a valid label for 'match'`);const s=O(e[i+1],t);r.push([n,s])}const n=O(e[e.length-1],t);return new C(i,r,n)}(e,t);case"case":return function(e,t){if(e.length<3)throw new Error("not enough arguments");if(e.length%2)throw new Error("fallback is missing in 'case' expression");const i=[];for(let r=1;r<e.length-1;r+=2){const n=O(e[r],t),s=O(e[r+1],t);i.push([n,s])}const r=O(e[e.length-1],t);return new A(i,r)}(e,t);case"interpolate":return function(e,t){const i=e[1];if(!function(e){if(!Array.isArray(e))return!1;switch(e[0]){case"discrete":case"linear":case"cubic":case"exponential":return!0;default:return!1}}(i))throw new Error("expected an interpolation type");if("exponential"===i[0]&&"number"!=typeof i[1])throw new Error("expected the base of the exponential interpolation");const r=void 0!==e[2]?O(e[2],t):void 0;if(!_.isExpr(r))throw new Error("expected the input of the interpolation");if(3===e.length||!(e.length%2))throw new Error("invalid number of samples");const n=[];for(let i=3;i<e.length-1;i+=2){const r=e[i],s=O(e[i+1],t);n.push([r,s])}return new R(i,r,n)}(e,t);case"step":return function(e,t){if(e.length<2)throw new Error("expected the input of the 'step' operator");if(e.length<3||!(e.length%2))throw new Error("not enough arguments");const i=O(e[1],t),r=O(e[2],t),n=[];for(let i=3;i<e.length;i+=2){const r=e[i],s=O(e[i+1],t);n.push([r,s])}return new L(i,r,n)}(e,t);default:return I(i,e,t)}}function I(e,t,i){return new P(e,t.slice(1).map((e=>O(e,i))))}},2344:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprEvaluator=t.ExprEvaluatorContext=void 0;const r=i(4428),n=i(8937),s=i(6075),o=i(2099),a=i(8210),l=i(7922),c=i(7877),h=i(8146),d=i(1139),u=i(1701),m=i(4292),p=i(9156),f=i(9388),g=i(8992),v=i(2273),_=i(5997),y=i(5795),x=new Map;function b(e,t){var i,r,s;if(t instanceof n.StringLiteralExpr)return null!==(i=t.promotedValue)&&void 0!==i?i:t.value;const o=e.evaluate(t);return"string"==typeof o&&null!==(s=null!==(r=y.RGBA.parse(o))&&void 0!==r?r:_.Pixels.parse(o))&&void 0!==s?s:o}t.ExprEvaluatorContext=class{constructor(e,t,i,r){this.evaluator=e,this.env=t,this.scope=i,this.cache=r}evaluate(e){var t,i;if(void 0===e)throw new Error("Failed to evaluate expression");const r=null===(t=this.cache)||void 0===t?void 0:t.get(e);if(void 0!==r)return r;const n=e.accept(this.evaluator,this);return null===(i=this.cache)||void 0===i||i.set(e,n),n}wrapValue(e){return n.Expr.isExpr(e)?e:n.LiteralExpr.fromValue(e)}};class T{static defineOperator(e,t){x.set(e,t)}static defineOperators(e){Object.getOwnPropertyNames(e).forEach((t=>{this.defineOperator(t,e[t])}))}static getOperator(e){return x.get(e)}visitVarExpr(e,t){const i=t.env.lookup(e.name);return void 0!==i?i:null}visitNullLiteralExpr(e,t){return null}visitBooleanLiteralExpr(e,t){return e.value}visitNumberLiteralExpr(e,t){return e.value}visitStringLiteralExpr(e,t){return e.value}visitObjectLiteralExpr(e,t){return e.value}visitHasAttributeExpr(e,t){return void 0!==t.env.lookup(e.name)}visitMatchExpr(e,t){const i=t.evaluate(e.value);for(const[r,n]of e.branches){if(Array.isArray(r)&&r.includes(i))return t.evaluate(n);if(r===i)return t.evaluate(n)}return t.evaluate(e.fallback)}visitCaseExpr(e,t){if(t.scope===n.ExprScope.Value){const i=e.branches.findIndex((([e,t])=>e.isDynamic()));if(-1!==i){let r;for(let s=0;s<e.branches.length;++s){const[o,a]=e.branches[s],l=t.evaluate(o),c=t.evaluate(a);if(s<i&&Boolean(l))return c;if((n.Expr.isExpr(l)||Boolean(l))&&(void 0===r&&(r=[]),null==r||r.push([t.wrapValue(l),t.wrapValue(c)]),!n.Expr.isExpr(l)&&Boolean(l)))return new n.CaseExpr(r,n.LiteralExpr.fromValue(null))}const s=t.evaluate(e.fallback);return void 0===r?s:new n.CaseExpr(r,t.wrapValue(s))}}for(const[i,r]of e.branches)if(t.evaluate(i))return t.evaluate(r);return t.evaluate(e.fallback)}visitCallExpr(e,t){var i;const r=null!==(i=e.descriptor)&&void 0!==i?i:x.get(e.op);if(r){let i;if(e.descriptor=r,t.scope===n.ExprScope.Value&&e.isDynamic()){if(e.descriptor.partialEvaluate)return e.descriptor.partialEvaluate(t,e);const r=e.args.map((e=>t.wrapValue(t.evaluate(e))));if(r.every(((t,i)=>t===e.args[i])))return e;i=new n.CallExpr(e.op,r)}else i=r.call(t,e);return i}throw new Error(`undefined operator '${e.op}'`)}visitStepExpr(e,t){if(t.scope===n.ExprScope.Value){const i=t.evaluate(e.input),r=t.evaluate(e.defaultValue);return new n.StepExpr(t.wrapValue(i),t.wrapValue(r),e.stops.map((([e,i])=>{const r=t.evaluate(i);return[e,t.wrapValue(r)]})))}{const i=t.evaluate(e.input);if("number"!=typeof i)throw new Error(`input '${i}' must be a number`);if(i<e.stops[0][0])return t.evaluate(e.defaultValue);let r=e.stops.findIndex((e=>e[0]>i));return-1===r&&(r=e.stops.length),t.evaluate(e.stops[r-1][1])}}visitInterpolateExpr(e,t){if(t.scope===n.ExprScope.Value){const i=t.evaluate(e.input);return new n.InterpolateExpr(e.mode,t.wrapValue(i),e.stops.map((([e,i])=>{const r=t.evaluate(i);return[e,t.wrapValue(r)]})))}{const i=t.evaluate(e.input);if("number"!=typeof i)throw new Error("input must be a number");if("cubic"===e.mode[0])return function(e,t,i){if(i<t.stops[0][0])return b(e,t.stops[0][1]);if(i>=t.stops[t.stops.length-1][0])return b(e,t.stops[t.stops.length-1][1]);const n=t.stops.findIndex((e=>e[0]>i)),s=Math.max(0,n-1),o=0===s?n:s-1,a=n<t.stops.length-1?n+1:n-1,l=t.stops[o][0],c=t.stops[s][0],h=t.stops[n][0],d=.5*(h-c),u=d/(c-l),m=d/(t.stops[a][0]-h),p=(i-c)/(h-c),f=p*p,g=f*p,v=-u*g+2*u*f-u*p,x=(1+u)*g+(-1.5-2*u)*f+(-.5+u)*p+1,T=(-1-m)*g+(1.5+m)*f+.5*p,w=m*g-m*f,S=b(e,t.stops[o][1]),M=b(e,t.stops[s][1]),E=b(e,t.stops[n][1]),P=b(e,t.stops[a][1]);if("number"==typeof S&&"number"==typeof M&&"number"==typeof E&&"number"==typeof P)return v*S+x*M+T*E+w*P;if(S instanceof y.RGBA&&M instanceof y.RGBA&&E instanceof y.RGBA&&P instanceof y.RGBA)return new y.RGBA(r.MathUtils.clamp(v*S.r+x*M.r+T*E.r+w*P.r,0,1),r.MathUtils.clamp(v*S.g+x*M.g+T*E.g+w*P.g,0,1),r.MathUtils.clamp(v*S.b+x*M.b+T*E.b+w*P.b,0,1),r.MathUtils.clamp(v*S.a+x*M.a+T*E.a+w*P.a,0,1));if(S instanceof _.Pixels&&M instanceof _.Pixels&&E instanceof _.Pixels&&P instanceof _.Pixels)return new _.Pixels(v*S.value+x*M.value+T*E.value+w*P.value);if(S instanceof r.Color&&M instanceof r.Color&&E instanceof r.Color&&P instanceof r.Color)return new r.Color(v*S.r+x*M.r+T*E.r+w*P.r,v*S.g+x*M.g+T*E.g+w*P.g,v*S.b+x*M.b+T*E.b+w*P.b);if(S instanceof r.Vector2&&M instanceof r.Vector2&&E instanceof r.Vector2&&P instanceof r.Vector2)return new r.Vector2(v*S.x+x*M.x+T*E.x+w*P.x,v*S.y+x*M.y+T*E.y+w*P.y);if(S instanceof r.Vector3&&M instanceof r.Vector3&&E instanceof r.Vector3&&P instanceof r.Vector3)return new r.Vector3(v*S.x+x*M.x+T*E.x+w*P.x,v*S.y+x*M.y+T*E.y+w*P.y,v*S.z+x*M.z+T*E.z+w*P.z);if(S instanceof r.Vector4&&M instanceof r.Vector4&&E instanceof r.Vector4&&P instanceof r.Vector4)return new r.Vector4(v*S.x+x*M.x+T*E.x+w*P.x,v*S.y+x*M.y+T*E.y+w*P.y,v*S.z+x*M.z+T*E.z+w*P.z,v*S.w+x*M.w+T*E.w+w*P.w);if(Array.isArray(S)&&Array.isArray(M)&&Array.isArray(E)&&Array.isArray(P)){const e=S.length,t=[];for(let i=0;i<e;++i)t[i]=v*S[i]+x*M[i]+T*E[i]+w*P[i];return t}throw new Error("failed to interpolate values")}(t,e,i);const n=e.stops.findIndex((e=>e[0]>i));if(-1===n)return t.evaluate(e.stops[e.stops.length-1][1]);if(0===n)return t.evaluate(e.stops[0][1]);const[s,o]=e.stops[n],[a,l]=e.stops[n-1],c=b(t,l);let h=0;switch(e.mode[0]){case"discrete":return c;case"linear":h=(i-a)/(s-a);break;case"exponential":{const t=e.mode[1];h=1===t?(i-a)/(s-a):(Math.pow(t,i-a)-1)/(Math.pow(t,s-a)-1);break}default:throw new Error(`interpolation mode ${JSON.stringify(e.mode)} is not supported`)}const d=b(t,o);if("number"==typeof c&&"number"==typeof d)return r.MathUtils.lerp(c,d,h);if(c instanceof y.RGBA&&d instanceof y.RGBA)return c.clone().lerp(d,h);if(c instanceof _.Pixels&&d instanceof _.Pixels)return new _.Pixels(r.MathUtils.lerp(c.value,d.value,h));if(c instanceof r.Color&&d instanceof r.Color)return c.clone().lerp(d,h);if(c instanceof r.Vector2&&d instanceof r.Vector2)return c.clone().lerp(d,h);if(c instanceof r.Vector3&&d instanceof r.Vector3)return c.clone().lerp(d,h);if(c instanceof r.Vector4&&d instanceof r.Vector4)return c.clone().lerp(d,h);if(Array.isArray(c)&&Array.isArray(d)&&c.length===d.length)return c.map(((e,t)=>r.MathUtils.lerp(e,d[t],h)));throw new Error(`todo: mix(${JSON.stringify(c)}, ${JSON.stringify(d)}, ${h})`)}}}t.ExprEvaluator=T,T.defineOperators(o.CastOperators),T.defineOperators(l.ComparisonOperators),T.defineOperators(u.MathOperators),T.defineOperators(f.StringOperators),T.defineOperators(a.ColorOperators),T.defineOperators(g.TypeOperators),T.defineOperators(m.MiscOperators),T.defineOperators(h.FlowOperators),T.defineOperators(s.ArrayOperators),T.defineOperators(p.ObjectOperators),T.defineOperators(c.FeatureOperators),T.defineOperators(d.MapOperators),T.defineOperators(v.VectorOperators)},5318:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprInstantiator=void 0;const r=i(9415),n=i(8937),s=new r.Env;t.ExprInstantiator=class{visitNullLiteralExpr(e,t){return e}visitBooleanLiteralExpr(e,t){return e}visitNumberLiteralExpr(e,t){return e}visitStringLiteralExpr(e,t){return e}visitObjectLiteralExpr(e,t){return e}visitVarExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const i=t.env.lookup(e.name);return n.LiteralExpr.fromValue(void 0!==i?i:null)}visitHasAttributeExpr(e,t){if(t.preserve&&t.preserve.has(e.name))return e;const i=void 0!==t.env.lookup(e.name);return n.LiteralExpr.fromValue(i)}visitCallExpr(e,t){const i=e.args.map((e=>e.accept(this,t)));return i.some(((t,i)=>t!==e.args[i]))?new n.CallExpr(e.op,i):e}visitMatchExpr(e,t){const i=e.value.accept(this,t);if(i instanceof n.LiteralExpr){const r=i.value;for(const[i,n]of e.branches){if(Array.isArray(i)&&i.includes(r))return n.accept(this,t);if(i===r)return n.accept(this,t)}return e.fallback.accept(this,t)}let r=e.value!==i;const s=e.branches.map((([e,i])=>{const n=i.accept(this,t);return n!==i&&(r=!0),[e,n]})),o=e.fallback.accept(this,t);return o!==e.fallback&&(r=!0),r?new n.MatchExpr(i,s,o):e}visitCaseExpr(e,t){const i=[];let r=!1;for(const[o,a]of e.branches){const e=o.accept(this,t),l=e.dependencies();if(o.isDynamic()||0!==l.properties.size)e!==o&&(r=!0),i.push([e,a]);else if(Boolean(e.evaluate(s,n.ExprScope.Condition)))return a.accept(this,t)}if(0===i.length)return e.fallback.accept(this,t);i.length!==e.branches.length&&(r=!0),i.forEach((e=>{const i=e[1].accept(this,t);i!==e[1]&&(r=!0),e[1]=i}));const o=e.fallback.accept(this,t);return o!==e.fallback&&(r=!0),r?new n.CaseExpr(i,o):e}visitStepExpr(e,t){const i=e.input.accept(this,t),r=e.defaultValue.accept(this,t),s=e.stops.map((([e,i])=>[e,i.accept(this,t)]));return new n.StepExpr(i,r,s)}visitInterpolateExpr(e,t){const i=e.input.accept(this,t),r=e.stops.map((([e,i])=>[e,i.accept(this,t)]));return new n.InterpolateExpr(e.mode,i,r)}}},4973:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprParser=void 0;const r=i(8937);var n,s;function o(e){switch(e){case n.Tab:case n.Lf:case n.Cr:case n.Space:return!0;default:return!1}}function a(e){return e>=n._0&&e<=n._9}function l(e){return e>=n.a&&e<=n.z||e>=n.A&&e<=n.Z}function c(e){return function(e){return l(e)||a(e)}(e)||e===n._||e===n.Dollar||e===n.Dot||e===n.LBracket||e===n.RBracket}function h(e){switch(e){case s.Eof:return"eof";case s.Error:return"error";case s.Identifier:return"identifier";case s.Number:return"number";case s.String:return"string";case s.Comma:return",";case s.LParen:return"(";case s.RParen:return")";case s.LBracket:return"[";case s.RBracket:return"]";case s.Exclaim:return"!";case s.TildeEqual:return"~=";case s.CaretEqual:return"^=";case s.DollarEqual:return"$=";case s.EqualEqual:return"==";case s.ExclaimEqual:return"!=";case s.Less:return"<";case s.Greater:return">";case s.LessEqual:return"<=";case s.GreaterEqual:return">=";case s.BarBar:return"||";case s.AmpAmp:return"&&";default:throw new Error(`invalid token ${e}`)}}!function(e){e[e.Tab=9]="Tab",e[e.Lf=10]="Lf",e[e.Cr=13]="Cr",e[e.Space=32]="Space",e[e.LParen=40]="LParen",e[e.RParen=41]="RParen",e[e.Comma=44]="Comma",e[e.Dot=46]="Dot",e[e.LBracket=91]="LBracket",e[e.Backslash=92]="Backslash",e[e.RBracket=93]="RBracket",e[e._0=48]="_0",e[e._9=57]="_9",e[e._=95]="_",e[e.A=64]="A",e[e.Z=90]="Z",e[e.a=97]="a",e[e.z=122]="z",e[e.DoubleQuote=34]="DoubleQuote",e[e.SingleQuote=39]="SingleQuote",e[e.Exclaim=33]="Exclaim",e[e.Equal=61]="Equal",e[e.Caret=94]="Caret",e[e.Tilde=126]="Tilde",e[e.Dollar=36]="Dollar",e[e.Less=60]="Less",e[e.Greater=62]="Greater",e[e.Bar=124]="Bar",e[e.Amp=38]="Amp"}(n||(n={})),function(e){e[e.Eof=0]="Eof",e[e.Error=1]="Error",e[e.Identifier=2]="Identifier",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Comma=5]="Comma",e[e.LParen=6]="LParen",e[e.RParen=7]="RParen",e[e.LBracket=8]="LBracket",e[e.RBracket=9]="RBracket",e[e.Exclaim=10]="Exclaim",e[e.TildeEqual=11]="TildeEqual",e[e.CaretEqual=12]="CaretEqual",e[e.DollarEqual=13]="DollarEqual",e[e.EqualEqual=14]="EqualEqual",e[e.ExclaimEqual=15]="ExclaimEqual",e[e.Less=16]="Less",e[e.Greater=17]="Greater",e[e.LessEqual=18]="LessEqual",e[e.GreaterEqual=19]="GreaterEqual",e[e.BarBar=20]="BarBar",e[e.AmpAmp=21]="AmpAmp"}(s||(s={}));class d{constructor(e){this.code=e,this.m_token=s.Error,this.m_index=0,this.m_char=n.Lf}token(){return this.m_token}text(){var e;return null!==(e=this.m_text)&&void 0!==e?e:""}next(){if(this.m_token=this.yylex(),this.m_token===s.Error)throw new Error(`unexpected character ${this.m_char}`);return this.m_token}yyinp(){var e;this.m_char=null!==(e=this.code.codePointAt(this.m_index++))&&void 0!==e?e:0}yylex(){for(this.m_text=void 0;o(this.m_char);)this.yyinp();if(0===this.m_char)return s.Eof;const e=this.m_char;switch(this.yyinp(),e){case n.LParen:return s.LParen;case n.RParen:return s.RParen;case n.LBracket:return s.LBracket;case n.RBracket:return s.RBracket;case n.Comma:return s.Comma;case n.SingleQuote:case n.DoubleQuote:{const t=this.m_index-1;for(;this.m_char&&this.m_char!==e;)this.yyinp();if(this.m_char!==e)throw new Error("Unfinished string literal");return this.yyinp(),this.m_text=this.code.substring(t,this.m_index-2),s.String}case n.Exclaim:return this.m_char===n.Equal?(this.yyinp(),s.ExclaimEqual):s.Exclaim;case n.Caret:return this.m_char===n.Equal?(this.yyinp(),s.CaretEqual):s.Error;case n.Tilde:return this.m_char===n.Equal?(this.yyinp(),s.TildeEqual):s.Error;case n.Equal:return this.m_char===n.Equal?(this.yyinp(),s.EqualEqual):s.Error;case n.Less:return this.m_char===n.Equal?(this.yyinp(),s.LessEqual):s.Less;case n.Greater:return this.m_char===n.Equal?(this.yyinp(),s.GreaterEqual):s.Greater;case n.Bar:return this.m_char===n.Bar?(this.yyinp(),s.BarBar):s.Error;case n.Amp:return this.m_char===n.Amp?(this.yyinp(),s.AmpAmp):s.Error;default:{const t=this.m_index-2;if(l(e)||e===n._||e===n.Dollar&&c(this.m_char)){for(;c(this.m_char);)this.yyinp();return this.m_text=this.code.substring(t,this.m_index-1),s.Identifier}if(a(e)){for(;a(this.m_char);)this.yyinp();if(this.m_char===n.Dot)for(this.yyinp();a(this.m_char);)this.yyinp();return this.m_text=this.code.substring(t,this.m_index-1),s.Number}if(e===n.Dollar)return this.m_char===n.Equal?(this.yyinp(),s.DollarEqual):s.Error}}return s.Error}}function u(e){switch(e){case s.TildeEqual:return"~=";case s.CaretEqual:return"^=";case s.DollarEqual:return"$=";case s.EqualEqual:return"==";case s.ExclaimEqual:return"!=";default:return}}function m(e){switch(e){case s.Less:return"<";case s.Greater:return">";case s.LessEqual:return"<=";case s.GreaterEqual:return">=";default:return}}t.ExprParser=class{constructor(e){this.lex=new d(e),this.lex.next()}parse(){return this.parseLogicalOr()}yyexpect(e){if(this.lex.token()!==e)throw new Error(`Syntax error: Expected token '${h(e)}' but found '${h(this.lex.token())}'`);this.lex.next()}parsePrimary(){switch(this.lex.token()){case s.Identifier:{const e=this.lex.text();switch(e){case"has":this.lex.next(),this.yyexpect(s.LParen);const t=this.lex.text();return this.yyexpect(s.Identifier),this.yyexpect(s.RParen),new r.HasAttributeExpr(t);case"length":this.lex.next(),this.yyexpect(s.LParen);const i=this.parseLogicalOr();return this.yyexpect(s.RParen),new r.CallExpr("length",[i]);default:const n=new r.VarExpr(e);return this.lex.next(),n}}case s.LParen:{this.lex.next();const e=this.parseLogicalOr();return this.yyexpect(s.RParen),e}default:return this.parseLiteral()}}parseLiteral(){switch(this.lex.token()){case s.Number:{const e=new r.NumberLiteralExpr(parseFloat(this.lex.text()));return this.lex.next(),e}case s.String:{const e=new r.StringLiteralExpr(this.lex.text());return this.lex.next(),e}default:throw new Error("Syntax error")}}parseUnary(){return this.lex.token()===s.Exclaim?(this.lex.next(),new r.CallExpr("!",[this.parseUnary()])):this.parsePrimary()}parseRelational(){let e=this.parseUnary();for(;;)if(this.lex.token()===s.Identifier&&"in"===this.lex.text()){this.lex.next(),this.yyexpect(s.LBracket);const t=[this.parseLiteral()];for(;this.lex.token()===s.Comma;)this.lex.next(),t.push(this.parseLiteral());this.yyexpect(s.RBracket),e=new r.CallExpr("in",[e,r.LiteralExpr.fromValue(t.map((({value:e})=>e)))])}else{const t=m(this.lex.token());if(void 0===t)break;this.lex.next();const i=this.parseUnary();e=new r.CallExpr(t,[e,i])}return e}parseEquality(){let e=this.parseRelational();for(;;){let t=u(this.lex.token());if(void 0===t)break;"~="===t&&(t="in"),this.lex.next();const i=this.parseRelational();e=new r.CallExpr(t,[e,i])}return e}parseLogicalAnd(){const e=this.parseEquality();if(this.lex.token()!==s.AmpAmp)return e;const t=[e];do{this.lex.next(),t.push(this.parseEquality())}while(this.lex.token()===s.AmpAmp);return new r.CallExpr("all",t)}parseLogicalOr(){const e=this.parseLogicalAnd();if(this.lex.token()!==s.BarBar)return e;const t=[e];do{this.lex.next(),t.push(this.parseLogicalAnd())}while(this.lex.token()===s.BarBar);return new r.CallExpr("any",t)}}},2475:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExprPool=void 0;const r=i(8937);t.ExprPool=class{constructor(){this.m_booleanLiterals=new Map,this.m_numberLiterals=new Map,this.m_stringLiterals=new Map,this.m_objectLiterals=new Map,this.m_arrayLiterals=[],this.m_varExprs=new Map,this.m_hasAttributeExprs=new Map,this.m_matchExprs=[],this.m_caseExprs=[],this.m_interpolateExprs=[],this.m_stepExprs=[],this.m_callExprs=new Map}add(e){return e.accept(this,void 0)}visitNullLiteralExpr(e,t){return r.NullLiteralExpr.instance}visitBooleanLiteralExpr(e,t){return this.m_booleanLiterals.get(e.value)||(this.m_booleanLiterals.set(e.value,e),e)}visitNumberLiteralExpr(e,t){return this.m_numberLiterals.get(e.value)||(this.m_numberLiterals.set(e.value,e),e)}visitStringLiteralExpr(e,t){return this.m_stringLiterals.get(e.value)||(this.m_stringLiterals.set(e.value,e),e)}visitObjectLiteralExpr(e,t){const i=this.m_objectLiterals.get(e.value);if(i)return i;if(Array.isArray(e.value)){const t=e.value,i=this.m_arrayLiterals.find((e=>{const i=e.value;return i.length===t.length&&t.every(((e,t)=>e===i[t]))}));if(void 0!==i)return i;this.m_arrayLiterals.push(e)}return this.m_objectLiterals.set(e.value,e),e}visitVarExpr(e,t){return this.m_varExprs.get(e.name)||(this.m_varExprs.set(e.name,e),e)}visitHasAttributeExpr(e,t){return this.m_hasAttributeExprs.get(e.name)||(this.m_hasAttributeExprs.set(e.name,e),e)}visitMatchExpr(e,t){const i=e.value.accept(this,t),n=e.branches.map((([e,i])=>[e,i.accept(this,t)])),s=e.fallback.accept(this,t);for(const e of this.m_matchExprs){if(e.value!==i)continue;if(e.fallback!==s)continue;if(e.branches.length!==n.length)continue;let t=!0;for(let i=0;i<n.length;i++)if(n[i][0]!==e.branches[i][0]||n[i][1]!==e.branches[i][1]){t=!1;break}if(t)return e}const o=new r.MatchExpr(i,n,s);return this.m_matchExprs.push(o),o}visitCaseExpr(e,t){const i=e.branches.map((([e,i])=>[e.accept(this,t),i.accept(this,t)])),n=e.fallback.accept(this,t);for(const e of this.m_caseExprs){if(e.fallback!==n)continue;if(e.branches.length!==i.length)continue;let t=!0;for(let r=0;r<i.length;r++)if(i[r][0]!==e.branches[r][0]||i[r][1]!==e.branches[r][1]){t=!1;break}if(t)return e}const s=new r.CaseExpr(i,n);return this.m_caseExprs.push(s),s}visitCallExpr(e,t){const i=e.args.map((e=>e.accept(this,t)));this.m_callExprs.has(e.op)||this.m_callExprs.set(e.op,[]);const n=this.m_callExprs.get(e.op);for(const e of n){if(e.args.length!==i.length)continue;let t=0;for(;t<e.args.length&&e.args[t]===i[t];++t);if(t===e.args.length)return e}const s=new r.CallExpr(e.op,i);return s.descriptor=e.descriptor,n.push(s),s}visitStepExpr(e,t){if(this.m_stepExprs.includes(e))return e;const i=e.input.accept(this,t),n=e.defaultValue.accept(this,t),s=e.stops.map((e=>{const i=e[0],r=e[1].accept(this,t);return r===e[1]?e:[i,r]}));for(const e of this.m_stepExprs)if(e.input===i&&e.defaultValue===n&&s.length===e.stops.length&&s.every((([t,i],r)=>t===e.stops[r][0]&&i===e.stops[r][1])))return e;const o=new r.StepExpr(i,n,s);return this.m_stepExprs.push(o),o}visitInterpolateExpr(e,t){if(this.m_interpolateExprs.includes(e))return e;const i=e.input.accept(this,t),n=e.stops.map((e=>{const i=e[0],r=e[1].accept(this,t);return r===e[1]?e:[i,r]}));for(const t of this.m_interpolateExprs)if(t.input===i&&t.mode[0]===e.mode[0]&&t.mode[1]===e.mode[1]&&n.length===t.stops.length&&n.every((([e,i],r)=>e===t.stops[r][0]&&i===t.stops[r][1])))return t;const s=new r.InterpolateExpr(e.mode,i,n);return this.m_interpolateExprs.push(s),s}}},6665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1470:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7954:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1460:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2904:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.interpolatedPropertyDefinitionToJsonExpr=t.isInterpolatedPropertyDefinition=t.InterpolationMode=void 0,(i=t.InterpolationMode||(t.InterpolationMode={}))[i.Discrete=0]="Discrete",i[i.Linear=1]="Linear",i[i.Cubic=2]="Cubic",i[i.Exponential=3]="Exponential",t.isInterpolatedPropertyDefinition=function(e){return!!(e&&void 0===e.interpolationMode&&Array.isArray(e.values)&&e.values.length>0&&void 0!==e.values[0]&&Array.isArray(e.zoomLevels)&&e.zoomLevels.length>0&&void 0!==e.zoomLevels[0]&&e.values.length===e.zoomLevels.length)},t.interpolatedPropertyDefinitionToJsonExpr=function(e){if(void 0===e.interpolation||"Discrete"===e.interpolation){const t=["step",["zoom"],e.values[0]];for(let i=1;i<e.zoomLevels.length;++i)t.push(e.zoomLevels[i],e.values[i]);return t}const t=["interpolate"];switch(e.interpolation){case"Linear":t.push(["linear"]);break;case"Cubic":t.push(["cubic"]);break;case"Exponential":t.push(["exponential",void 0!==e.exponent?e.exponent:2]);break;default:throw new Error(`interpolation mode '${e.interpolation}' is not supported`)}t.push(["zoom"]);for(let i=0;i<e.zoomLevels.length;++i)t.push(e.zoomLevels[i],e.values[i]);return t}},9416:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPolygonEdges=void 0;const r=i(4428),n=new r.Vector2,s=new r.Vector2,o=new r.Vector2,a=new r.Vector2;t.addPolygonEdges=function(e,t,i,r,l,c,h,d){for(let u=0;u<l.length;++u)if(l[u])if(!0===c){const c=t+2*u,m=c+1,p=t+(u+1)%l.length*2,f=p+1;!0===h&&e.push(c,p),e.push(m,f);const g=(0===u?l.length:u)-1;if(l[g])if(void 0!==d){const t=r[u*i],h=r[u*i+1],p=r[(u+1)%l.length*i],f=r[(u+1)%l.length*i+1];n.set(t,h),s.set(p,f),o.set(r[g*i],r[g*i+1]),a.set(n.x,n.y),a.sub(o).normalize().dot(s.sub(n).normalize())<=d&&e.push(c,m)}else e.push(c,m)}else{const i=t+u,r=t+(u+1)%l.length;e.push(i,r)}}},5997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Pixels=void 0;const i=/^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/;class r{constructor(e){this.value=e}static parse(e){const t=i.exec(e);if(null!==t)return new r(Number(t[1]))}toJSON(){return`${this.value}px`}}t.Pixels=r},6792:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7487:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyValue=void 0;const r=i(1845),n=i(8937),s=i(5997),o=i(5795),a=i(8783),l=r.LoggerManager.instance