var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,l){function a(e){try{s(r.next(e))}catch(e){l(e)}}function i(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,i)}s((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}};webmapgl.loadBundle("dsq9dq6t",["exports","./chunk-43bba0ec.js"],function(e,t){window;var n=0,r=function(){function e(){var e=this;this.handlers={click:function(t){return e.handleClick(t)},mouseenter:function(){return e.handleMouseenter()},mouseleave:function(){return e.handleMouseleave()}},this.basemap=!1,this.clickableLayers=[],this.enabled=!0,this.json={}}return e.prototype.componentWillLoad=function(){void 0===this.id&&(this.id="style-"+n.toString(),n+=1),this.url&&this.fetchJSON()},e.prototype.componentDidLoad=function(){this.clickableLayers&&this.updateClickable(this.clickableLayers),this.glStyleElementAdded.emit(this)},e.prototype.componentDidUpdate=function(){this.glStyleElementModified.emit(this)},e.prototype.componentDidUnload=function(){this.glStyleElementRemoved.emit(this)},e.prototype.getMap=function(){return this.el.closest("gl-map").map},e.prototype.fetchJSON=function(){return __awaiter(this,void 0,void 0,function(){var e,t,n,r;return __generator(this,function(o){switch(o.label){case 0:return[4,fetch(this.url)];case 1:return e=o.sent(),t=this,[4,e.json()];case 2:if(t.json=o.sent(),this.token&&this.json.sources)for(n in this.json.sources)(r=this.json.sources[n]).data&&(r.data=r.data.replace(/\$\{TOKEN\}/g,this.token));return[2]}})})},e.prototype.updateClickable=function(e,n){var r=this.getMap();e=t.toArray(e),n=t.toArray(n);for(var o=0,l=e;o<l.length;o++){var a=n.indexOf(c=l[o]);-1===a?(r.on("click",u=this.id+":"+c,this.handlers.click),r.on("mouseenter",u,this.handlers.mouseenter),r.on("mouseleave",u,this.handlers.mouseleave)):n.splice(a,1)}for(var i=0,s=n;i<s.length;i++){var c,u;r.off("click",u=this.id+":"+(c=s[i]),this.handlers.click),r.off("mouseenter",u,this.handlers.mouseenter),r.off("mouseleave",u,this.handlers.mouseleave)}},e.prototype.handleClick=function(e){this.glFeatureClick.emit(e)},e.prototype.handleMouseenter=function(){this.getMap().getCanvas().style.cursor="pointer"},e.prototype.handleMouseleave=function(){this.getMap().getCanvas().style.cursor=""},Object.defineProperty(e,"is",{get:function(){return"gl-style"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{basemap:{type:Boolean,attr:"basemap"},clickableLayers:{type:String,attr:"clickable-layers",watchCallbacks:["updateClickable"]},el:{elementRef:!0},enabled:{type:Boolean,attr:"enabled"},id:{type:String,attr:"id",reflectToAttr:!0,mutable:!0},json:{type:"Any",attr:"json",mutable:!0},name:{type:String,attr:"name"},thumbnail:{type:String,attr:"thumbnail"},token:{type:String,attr:"token"},url:{type:String,attr:"url"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"glFeatureClick",method:"glFeatureClick",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementAdded",method:"glStyleElementAdded",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementModified",method:"glStyleElementModified",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementRemoved",method:"glStyleElementRemoved",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),e}();e.GlStyle=r,Object.defineProperty(e,"__esModule",{value:!0})});