From c6994236cc65df666f7298cf819a281947beca51 Mon Sep 17 00:00:00 2001
From: 92homa1mst <92homa1mst@hft-stuttgart.de>
Date: Thu, 3 Sep 2020 00:14:36 +0200
Subject: [PATCH] Commit for removing deprecated functions

---
 vcm/lib/vcm-compiled_api.js |  2 +-
 vcm/templates/newDevBahn.js | 56 ++++++++++++++++++-------------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/vcm/lib/vcm-compiled_api.js b/vcm/lib/vcm-compiled_api.js
index b3dceb2e1..7e9947090 100644
--- a/vcm/lib/vcm-compiled_api.js
+++ b/vcm/lib/vcm-compiled_api.js
@@ -11,4 +11,4 @@
  * @author   Feross Aboukhadijeh <https://feross.org>
  * @license  MIT
  */
-e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,i){"use strict";var n=i(152),r=i(33),a=i(629),s=i(630);function o(e){this.defaults=e,this.interceptors={request:new a,response:new a}}o.prototype.request=function(e){"string"===typeof e&&(e=r.merge({url:arguments[0]},arguments[1])),e=r.merge(n,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[s,void 0],i=Promise.resolve(e);this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});while(t.length)i=i.then(t.shift(),t.shift());return i},r.forEach(["delete","get","head","options"],function(e){o.prototype[e]=function(t,i){return this.request(r.merge(i||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){o.prototype[e]=function(t,i,n){return this.request(r.merge(n||{},{method:e,url:t,data:i}))}}),e.exports=o},function(e,t){var i,n,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function l(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(function(){try{i="function"===typeof setTimeout?setTimeout:a}catch(e){i=a}try{n="function"===typeof clearTimeout?clearTimeout:s}catch(e){n=s}})();var c,u=[],h=!1,d=-1;function m(){h&&c&&(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var e=o(m);h=!0;var t=u.length;while(t){c=u,u=[];while(++d<t)c&&c[d].run();d=-1,t=u.length}c=null,h=!1,l(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];u.push(new y(e,t)),1!==u.length||h||o(f)},y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,i){"use strict";var n=i(33);e.exports=function(e,t){n.forEach(e,function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])})}},function(e,t,i){"use strict";var n=i(209);e.exports=function(e,t,i){var r=i.config.validateStatus;i.status&&r&&!r(i.status)?t(n("Request failed with status code "+i.status,i.config,null,i.request,i)):e(i)}},function(e,t,i){"use strict";e.exports=function(e,t,i,n,r){return e.config=t,i&&(e.code=i),e.request=n,e.response=r,e}},function(e,t,i){"use strict";var n=i(33);function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var a;if(i)a=i(t);else if(n.isURLSearchParams(t))a=t.toString();else{var s=[];n.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),a=s.join("&")}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e}},function(e,t,i){"use strict";var n=i(33),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,a,s={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),i=n.trim(e.substr(a+1)),t){if(s[t]&&r.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([i]):s[t]?s[t]+", "+i:i}}),s):s}},function(e,t,i){"use strict";var n=i(33);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function r(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=r(window.location.href),function(t){var i=n.isString(t)?r(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return function(){return!0}}()},function(e,t,i){"use strict";var n=i(33);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,i,r,a,s){var o=[];o.push(e+"="+encodeURIComponent(t)),n.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),n.isString(r)&&o.push("path="+r),n.isString(a)&&o.push("domain="+a),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,i){"use strict";var n=i(33);function r(){this.handlers=[]}r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,i){"use strict";var n=i(33),r=i(631),a=i(210),s=i(152),o=i(632),l=i(633);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){c(e),e.baseURL&&!o(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||s.adapter;return t(e).then(function(t){return c(e),t.data=r(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(c(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,i){"use strict";var n=i(33);e.exports=function(e,t,i){return n.forEach(i,function(i){e=i(e,t)}),e}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var n=i(211);function r(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var i=this;e(function(e){i.reason||(i.reason=new n(e),t(i.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t,i){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,i){i(118),i(93),e.exports=i(637)},function(e,t,i){var n=i(48),r=i(162);e.exports=i(19).getIterator=function(e){var t=r(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){var n={"./af":213,"./af.js":213,"./ar":214,"./ar-dz":215,"./ar-dz.js":215,"./ar-kw":216,"./ar-kw.js":216,"./ar-ly":217,"./ar-ly.js":217,"./ar-ma":218,"./ar-ma.js":218,"./ar-sa":219,"./ar-sa.js":219,"./ar-tn":220,"./ar-tn.js":220,"./ar.js":214,"./az":221,"./az.js":221,"./be":222,"./be.js":222,"./bg":223,"./bg.js":223,"./bm":224,"./bm.js":224,"./bn":225,"./bn.js":225,"./bo":226,"./bo.js":226,"./br":227,"./br.js":227,"./bs":228,"./bs.js":228,"./ca":229,"./ca.js":229,"./cs":230,"./cs.js":230,"./cv":231,"./cv.js":231,"./cy":232,"./cy.js":232,"./da":233,"./da.js":233,"./de":234,"./de-at":235,"./de-at.js":235,"./de-ch":236,"./de-ch.js":236,"./de.js":234,"./dv":237,"./dv.js":237,"./el":238,"./el.js":238,"./en-SG":239,"./en-SG.js":239,"./en-au":240,"./en-au.js":240,"./en-ca":241,"./en-ca.js":241,"./en-gb":242,"./en-gb.js":242,"./en-ie":243,"./en-ie.js":243,"./en-il":244,"./en-il.js":244,"./en-nz":245,"./en-nz.js":245,"./eo":246,"./eo.js":246,"./es":247,"./es-do":248,"./es-do.js":248,"./es-us":249,"./es-us.js":249,"./es.js":247,"./et":250,"./et.js":250,"./eu":251,"./eu.js":251,"./fa":252,"./fa.js":252,"./fi":253,"./fi.js":253,"./fo":254,"./fo.js":254,"./fr":255,"./fr-ca":256,"./fr-ca.js":256,"./fr-ch":257,"./fr-ch.js":257,"./fr.js":255,"./fy":258,"./fy.js":258,"./ga":259,"./ga.js":259,"./gd":260,"./gd.js":260,"./gl":261,"./gl.js":261,"./gom-latn":262,"./gom-latn.js":262,"./gu":263,"./gu.js":263,"./he":264,"./he.js":264,"./hi":265,"./hi.js":265,"./hr":266,"./hr.js":266,"./hu":267,"./hu.js":267,"./hy-am":268,"./hy-am.js":268,"./id":269,"./id.js":269,"./is":270,"./is.js":270,"./it":271,"./it-ch":272,"./it-ch.js":272,"./it.js":271,"./ja":273,"./ja.js":273,"./jv":274,"./jv.js":274,"./ka":275,"./ka.js":275,"./kk":276,"./kk.js":276,"./km":277,"./km.js":277,"./kn":278,"./kn.js":278,"./ko":279,"./ko.js":279,"./ku":280,"./ku.js":280,"./ky":281,"./ky.js":281,"./lb":282,"./lb.js":282,"./lo":283,"./lo.js":283,"./lt":284,"./lt.js":284,"./lv":285,"./lv.js":285,"./me":286,"./me.js":286,"./mi":287,"./mi.js":287,"./mk":288,"./mk.js":288,"./ml":289,"./ml.js":289,"./mn":290,"./mn.js":290,"./mr":291,"./mr.js":291,"./ms":292,"./ms-my":293,"./ms-my.js":293,"./ms.js":292,"./mt":294,"./mt.js":294,"./my":295,"./my.js":295,"./nb":296,"./nb.js":296,"./ne":297,"./ne.js":297,"./nl":298,"./nl-be":299,"./nl-be.js":299,"./nl.js":298,"./nn":300,"./nn.js":300,"./pa-in":301,"./pa-in.js":301,"./pl":302,"./pl.js":302,"./pt":303,"./pt-br":304,"./pt-br.js":304,"./pt.js":303,"./ro":305,"./ro.js":305,"./ru":306,"./ru.js":306,"./sd":307,"./sd.js":307,"./se":308,"./se.js":308,"./si":309,"./si.js":309,"./sk":310,"./sk.js":310,"./sl":311,"./sl.js":311,"./sq":312,"./sq.js":312,"./sr":313,"./sr-cyrl":314,"./sr-cyrl.js":314,"./sr.js":313,"./ss":315,"./ss.js":315,"./sv":316,"./sv.js":316,"./sw":317,"./sw.js":317,"./ta":318,"./ta.js":318,"./te":319,"./te.js":319,"./tet":320,"./tet.js":320,"./tg":321,"./tg.js":321,"./th":322,"./th.js":322,"./tl-ph":323,"./tl-ph.js":323,"./tlh":324,"./tlh.js":324,"./tr":325,"./tr.js":325,"./tzl":326,"./tzl.js":326,"./tzm":327,"./tzm-latn":328,"./tzm-latn.js":328,"./tzm.js":327,"./ug-cn":329,"./ug-cn.js":329,"./uk":330,"./uk.js":330,"./ur":331,"./ur.js":331,"./uz":332,"./uz-latn":333,"./uz-latn.js":333,"./uz.js":332,"./vi":334,"./vi.js":334,"./x-pseudo":335,"./x-pseudo.js":335,"./yo":336,"./yo.js":336,"./zh-cn":337,"./zh-cn.js":337,"./zh-hk":338,"./zh-hk.js":338,"./zh-tw":339,"./zh-tw.js":339};function r(e){var t=a(e);return i(t)}function a(e){var t=n[e];if(!(t+1)){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}return t}r.keys=function(){return Object.keys(n)},r.resolve=a,e.exports=r,r.id=639},function(e,t,i){"use strict";var n=i(115);function r(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){var n=i(15);n(n.P,"String",{repeat:i(642)})},function(e,t,i){"use strict";var n=i(78),r=i(57);e.exports=function(e){var t=String(r(this)),i="",a=n(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(i+=t);return i}},function(e,t,i){e.exports=i(678)},function(e,t,i){e.exports=i(687)},function(e,t,i){"use strict";(function(e){i(13),i(88),i(26),i(11),i(7);var n=i(646),r=i(10),a=(i(12),i(22),i(4),i(654),i(1)),s=i(0),o=i(539),l=i.n(o),c=i(9),u=i.n(c),h=i(662),d=i(540),m=i(541),f=i(663),y=i(5),g=i(114),v=function(){function t(e){Object(a["a"])(this,t),this.terrainProvider=e.terrainProvider||null,this.projection=e.projection||null,this.directions={},this.options=e,this.meta=[],this.extent=ol.extent.createEmpty(),this.minZoom=Object(y["h"])(e.minZoom,0),this.maxZoom=Object(y["h"])(e.maxZoom,0),this.hideLevels=Object(y["h"])(e.hideLevels,0)}return Object(s["a"])(t,[{key:"loadData",value:function(e){var t=this,i=[],n=Array.isArray(e)?e:[e],r=u.a.create();return r.interceptors.response.use(function(e){return e},function(e){return String(e.response.status).startsWith("4")&&e.config&&!e.config.retriedWithNewURL?(e.config.retriedWithNewURL=!0,e.config.url="".concat(e.config.url,"/image.json"),r.request(e.config)):Promise.reject(e)}),n.forEach(function(e){i.push(r.get(e).then(function(e){var i=e.data,n=e.config,r=n.url.substring(0,n.url.lastIndexOf("/"));t.handleMetadataResponse(i,r)}).catch(function(t){console.log("Invalid image.json data. Please correct, File: ".concat(e,", Error ").concat(t.message))}))}),Promise.all(i)}},{key:"handleMetadataResponse",value:function(e,i){var n=t.getVersion(e);n.version>=3.5||3.4===n.version&&n.buildNumber>=36?this.handleMetadataResponseV35(e,i,n):console.log("Could not load Meta Data, only meta data version 3.5 and higher are supported")}},{key:"getImageMeta",value:function(e,t,i,n,r){var a=this.hideLevels?i.slice(0,i.length-this.hideLevels):i,s=this.meta.find(function(i){return i.isEqual(e,t,a)});if(s)return s;var o=new f["a"]({url:e,size:t,tileSize:n,tileResolution:a,minZoom:this.minZoom,maxZoom:this.maxZoom}),l=new h["a"]({size:t,view:o,version:r.version,buildNumber:r.buildNumber});return this.meta.push(l),l}},{key:"handleMetadataResponseV35",value:function(t,i,a){var s=this,o=[t.generalImageInfo.width,t.generalImageInfo.height],c=t.generalImageInfo["tile-resolution"],u=[t.generalImageInfo["tile-width"],t.generalImageInfo["tile-width"]];t.generalImageInfo.width&&t.generalImageInfo.height&&t.generalImageInfo["tile-resolution"]&&this.getImageMeta(i,o,c,u,a);var h=[];t.generalImageInfo.cameraParameter&&Array.isArray(t.generalImageInfo.cameraParameter)&&t.generalImageInfo.cameraParameter.forEach(function(e){h.push(new m["a"](e))});var f=null;if(t.generalImageInfo.crs){var y=l()();e.proj4.defs(y,t.generalImageInfo.crs),f=ol.proj.get(y)}var g=t.images.shift(),v={name:g.indexOf("name"),width:g.indexOf("width"),height:g.indexOf("height"),tileResolution:g.indexOf("tile-resolution"),viewDirection:g.indexOf("view-direction"),viewDirectionAngle:g.indexOf("view-direction-angle"),groundCoordinates:g.indexOf("groundCoordinates"),centerPointOnGround:g.indexOf("centerPointOnGround"),cameraIndex:g.indexOf("camera-index"),projectionCenter:g.indexOf("projection-center"),pToRealworld:g.indexOf("p-to-realworld"),pToImage:g.indexOf("p-to-image")},p={};t.images.forEach(function(e){var t=[];e[v.pToRealworld]&&e[v.pToRealworld].forEach(function(e){t.push.apply(t,Object(r["a"])(e))});var l=e[v.pToRealworld]?Object(n["a"])(Cesium.Matrix3,t):null,m=[];e[v.pToImage]&&(e[v.pToImage].forEach(function(e){m.push.apply(m,Object(r["a"])(e))}),m.push(0,0,0,1));var y=e[v.projectionCenter]?Cesium.Cartesian3.fromArray(e[v.projectionCenter]):null,g=e[v.pToImage]?Object(n["a"])(Cesium.Matrix4,m):null,_=e[v.width]&&e[v.height]?[e[v.width],e[v.height]]:o,b=e[v.tileResolution]?e[v.tileResolution]:c,L=s.getImageMeta(i,_,b,u,a),M={name:e[v.name],viewDirection:e[v.viewDirection],viewDirectionAngle:e[v.viewDirectionAngle],groundCoordinates:e[v.groundCoordinates],centerPointOnGround:e[v.centerPointOnGround],meta:L,camera:h[e[v.cameraIndex]],projectionCenter:y,pToRealworld:l,pToImage:g,projection:s.projection||f,terrainProvider:s.terrainProvider},k=new d["a"](M);p[k.viewDirection]||(p[k.viewDirection]={direction:k.viewDirection,images:{},rTreeItems:[],footPrintFeatures:[],projection:s.projection||f,terrainProvider:s.terrainProvider}),p[k.viewDirection].images[k.name]=k,p[k.viewDirection].rTreeItems.push({minX:k.centerPointOnGround[0],minY:k.centerPointOnGround[1],maxX:k.centerPointOnGround[0],maxY:k.centerPointOnGround[1],name:k.name});var w=new ol.geom.Polygon([k.groundCoordinates.concat([k.groundCoordinates[0]])]);w.transform(s.projection||f,ol.proj.get("EPSG:3857"));var T=new ol.Feature({geometry:w});T.setId(k.name),p[k.viewDirection].footPrintFeatures.push(T)}),Object.keys(p).forEach(function(e){s.directions[e]?s.directions[e].addOptions(p[e]):s.directions[e]=s.createDirection(p[e]),s.extent=ol.extent.extend(s.extent,s.directions[e].footPrintsLayer.getSource().getExtent())})}},{key:"createDirection",value:function(e){return new g["a"](e)}},{key:"getImageByName",value:function(e){for(var t=Object.values(this.directions),i=0;i<t.length;i++){var n=t[i];if(n.images[e])return n.images[e]}return null}}],[{key:"getVersion",value:function(e){var t={version:null,buildNumber:null};if(e.version){var i=e.version.match(/\d+\.\d+/);i&&(t.version=Number(i[0]));var n=e.version.match(/-\d+-/);n&&(t.buildNumber=Number(n[0].match(/\d+/)[0]))}return t}}]),t}();t["a"]=v}).call(this,i(212))},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(345),r=i.n(n),a=i(538);function s(){if("undefined"===typeof Reflect||!r.a)return!1;if(r.a.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(r()(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,i){return o=s()?r.a:function(e,t,i){var n=[null];n.push.apply(n,t);var r=Function.bind.apply(e,n),s=new r;return i&&Object(a["a"])(s,i.prototype),s},o.apply(null,arguments)}},function(e,t,i){"use strict";var n=i(695);function r(e,t,i,r,o,l){var c,u,h,d,m=e.data,f=[],y=e.toBBox,g=new n(null,a);while(m){for(c=0;c<m.children.length;c++)u=m.children[c],h=s(t,i,m.leaf?y(u):u),(!l||h<=l)&&g.push({node:u,isItem:m.leaf,dist:h});while(g.length&&g.peek().isItem)if(d=g.pop().node,o&&!o(d)||f.push(d),r&&f.length===r)return f;m=g.pop(),m&&(m=m.node)}return f}function a(e,t){return e.dist-t.dist}function s(e,t,i){var n=o(e,i.minX,i.maxX),r=o(t,i.minY,i.maxY);return n*n+r*r}function o(e,t,i){return e<t?t-e:e<=i?0:e-i}e.exports=r,e.exports.default=r},function(e,t,i){e.exports=i(702)},function(e,t,i){e.exports=i(704)},function(e,t,i){"use strict";e.exports={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]}},,function(e,t,i){var n=i(47),r=i(19),a=i(86);e.exports=function(e,t){var i=(r.Object||{})[e]||Object[e],s={};s[e]=t(i),n(n.S+n.F*a(function(){i(1)}),"Object",s)}},function(e,t){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){"use strict";var n=i(15),r=i(59),a=i(191),s="startsWith",o=""[s];n(n.P+n.F*i(192)(s),"String",{startsWith:function(e){var t=a(this,e,s),i=r(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return o?o.call(t,n,i):t.slice(i,i+n.length)===n}})},function(e,t,i){var n,r=i(17),a=i(45),s=i(68),o=s("typed_array"),l=s("view"),c=!(!r.ArrayBuffer||!r.DataView),u=c,h=0,d=9,m="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");while(h<d)(n=r[m[h++]])?(a(n.prototype,o,!0),a(n.prototype,l,!0)):u=!1;e.exports={ABV:c,CONSTR:u,TYPED:o,VIEW:l}},function(e,t,i){var n=i(78),r=i(59);e.exports=function(e){if(void 0===e)return 0;var t=n(e),i=r(t);if(t!==i)throw RangeError("Wrong length!");return i}},function(e,t,i){var n=i(48),r=i(115),a=i(28)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[a])?t:r(i)}},function(e,t,i){var n,r,a,s=i(108),o=i(653),l=i(346),c=i(159),u=i(36),h=u.process,d=u.setImmediate,m=u.clearImmediate,f=u.MessageChannel,y=u.Dispatch,g=0,v={},p="onreadystatechange",_=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},b=function(e){_.call(e.data)};d&&m||(d=function(e){var t=[],i=1;while(arguments.length>i)t.push(arguments[i++]);return v[++g]=function(){o("function"==typeof e?e:Function(e),t)},n(g),g},m=function(e){delete v[e]},"process"==i(109)(h)?n=function(e){h.nextTick(s(_,e,1))}:y&&y.now?n=function(e){y.now(s(_,e,1))}:f?(r=new f,a=r.port2,r.port1.onmessage=b,n=s(a.postMessage,a,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",b,!1)):n=p in c("script")?function(e){l.appendChild(c("script"))[p]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(s(_,e,1),0)}),e.exports={set:d,clear:m}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,i){var n=i(48),r=i(51),a=i(640);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=a.f(e),s=i.resolve;return s(t),i.promise}},function(e,t,i){e.exports=i(683)},function(e,t,i){"use strict";i(26),i(4),i(22),i(96);var n=i(1),r=i(0),a=i(27),s=function(){function e(t){var i=this;Object(n["a"])(this,e),this.size=t.size,this.views=new Map,t.view&&Object.values(a["a"]).forEach(function(e){i.views.set(e,t.view.clone())}),this.version=t.version||3.1,this.buildNumber=t.buildNumber||0}return Object(r["a"])(e,[{key:"getView",value:function(e){return this.views.get(e)}},{key:"isEqual",value:function(e,t,i){return this.size[0]===t[0]&&this.size[1]===t[1]&&(this.views.values().next().value.tileResolution.length===i.length&&this.views.values().next().value.url===e)}}]),e}();t["a"]=s},function(e,t,i){"use strict";var n=i(14),r=i(10),a=i(1),s=i(0),o=i(34),l=0,c=function(){function e(t){Object(a["a"])(this,e),this.id=l,l+=1,this.size=t.size,this.url=t.url,this.tileSize=t.tileSize,this.tileResolution=t.tileResolution,this.format=t.format||"jpg",this.minZoom=t.minZoom,this.maxZoom=t.maxZoom,this._createViewAndLayer()}return Object(s["a"])(e,[{key:"_createViewAndLayer",value:function(){var e=[0,0].concat(Object(r["a"])(this.size)),t=new ol.proj.Projection({code:"ZOOMIFY",units:"pixels",extent:e});this.view=new ol.View({projection:t,center:[this.size[0]/2,this.size[1]/2],minZoom:this.minZoom,maxZoom:this.maxZoom>0?this.maxZoom:this.tileResolution.length+4,extent:[-2e3,-2e3,this.size[0]+2e3,this.size[1]+2e3],zoom:this.minZoom});var i={projection:t,tileGrid:new ol.tilegrid.TileGrid({origin:[0,0],extent:e,resolutions:this.tileResolution,tileSize:this.tileSize})};o["a"].hasSameOrigin(this.url)||(i.crossOrigin="anonymous"),this.tileImageSource=new ol.source.TileImage(i),this.layer=new ol.layer.Tile({source:this.tileImageSource,extent:e})}},{key:"clone",value:function(){return new e({size:this.size,url:this.url,tileSize:this.tileSize,tileResolution:this.tileResolution,minZoom:this.minZoom,maxZoom:this.maxZoom})}},{key:"setSize",value:function(e){this.size=e,this._createViewAndLayer()}},{key:"setImageName",value:function(e){var t=this;this.tileImageSource.setTileUrlFunction(function(i){var r=Object(n["a"])(i,3),a=r[0],s=r[1],o=r[2];return"".concat(t.url,"/").concat(e,"/").concat(a,"/").concat(s,"/").concat(o,".").concat(t.format)}),this.tileImageSource.refresh()}}]),e}();t["a"]=c},function(e,t,i){"use strict";e.exports=r,e.exports.default=r;var n=i(694);function r(e,t){if(!(this instanceof r))return new r(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function a(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function s(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,n,r){r||(r=v(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var a,s=t;s<i;s++)a=e.children[s],l(r,e.leaf?n(a):a);return r}function l(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 c(e,t){return e.minX-t.minX}function u(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 m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){var i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,a-n)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(e,t,i,r,a){var s,o=[t,i];while(o.length)i=o.pop(),t=o.pop(),i-t<=r||(s=t+Math.ceil((i-t)/r/2)*r,n(e,s,t,i,a),o.push(t,s,s,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],n=this.toBBox;if(!g(e,t))return i;var r,a,s,o,l=[];while(t){for(r=0,a=t.children.length;r<a;r++)s=t.children[r],o=t.leaf?n(s):s,g(e,o)&&(t.leaf?i.push(s):y(e,o)?this._all(s,i):l.push(s));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!g(e,t))return!1;var n,r,a,s,o=[];while(t){for(n=0,r=t.children.length;n<r;n++)if(a=t.children[n],s=t.leaf?i(a):a,g(e,s)){if(t.leaf||y(e,s))return!0;o.push(a)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(e,t){if(!e)return this;var i,n,r,s,o=this.data,l=this.toBBox(e),c=[],u=[];while(o||c.length){if(o||(o=c.pop(),n=c[c.length-1],i=u.pop(),s=!0),o.leaf&&(r=a(e,o.children,t),-1!==r))return o.children.splice(r,1),c.push(o),this._condense(c),this;s||o.leaf||!y(o,l)?n?(i++,o=n.children[i],s=!1):o=null:(c.push(o),u.push(i),i=0,n=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){var i=[];while(e)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,n){var r,a=i-t+1,o=this._maxEntries;if(a<=o)return r=v(e.slice(t,i+1)),s(r,this.toBBox),r;n||(n=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,n-1))),r=v([]),r.leaf=!1,r.height=n;var l,c,u,h,d=Math.ceil(a/o),m=d*Math.ceil(Math.sqrt(o));for(p(e,t,i,m,this.compareMinX),l=t;l<=i;l+=m)for(u=Math.min(l+m-1,i),p(e,l,u,d,this.compareMinY),c=l;c<=u;c+=d)h=Math.min(c+d-1,u),r.children.push(this._build(e,c,h,n-1));return s(r,this.toBBox),r},_chooseSubtree:function(e,t,i,n){var r,a,s,o,l,c,u,d;while(1){if(n.push(t),t.leaf||n.length-1===i)break;for(u=d=1/0,r=0,a=t.children.length;r<a;r++)s=t.children[r],l=h(s),c=m(e,s)-l,c<d?(d=c,u=l<u?l:u,o=s):c===d&&l<u&&(u=l,o=s);t=o||t.children[0]}return t},_insert:function(e,t,i){var n=this.toBBox,r=i?e:n(e),a=[],s=this._chooseSubtree(r,this.data,t,a);s.children.push(e),l(s,r);while(t>=0){if(!(a[t].children.length>this._maxEntries))break;this._split(a,t),t--}this._adjustParentBBoxes(r,a,t)},_split:function(e,t){var i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var a=this._chooseSplitIndex(i,r,n),o=v(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,s(i,this.toBBox),s(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=v([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var n,r,a,s,l,c,u,d;for(c=u=1/0,n=t;n<=i-t;n++)r=o(e,0,n,this.toBBox),a=o(e,n,i,this.toBBox),s=f(r,a),l=h(r)+h(a),s<c?(c=s,d=n,u=l<u?l:u):s===c&&l<u&&(u=l,d=n);return d},_chooseSplitAxis:function(e,t,i){var n=e.leaf?this.compareMinX:c,r=e.leaf?this.compareMinY:u,a=this._allDistMargin(e,t,i,n),s=this._allDistMargin(e,t,i,r);a<s&&e.children.sort(n)},_allDistMargin:function(e,t,i,n){e.children.sort(n);var r,a,s=this.toBBox,c=o(e,0,t,s),u=o(e,i-t,i,s),h=d(c)+d(u);for(r=t;r<i-t;r++)a=e.children[r],l(c,e.leaf?s(a):a),h+=d(c);for(r=i-t-1;r>=t;r--)a=e.children[r],l(u,e.leaf?s(a):a),h+=d(u);return h},_adjustParentBBoxes:function(e,t,i){for(var n=i;n>=0;n--)l(t[n],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children,t.splice(t.indexOf(e[i]),1)):this.clear():s(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},function(e,t,i){"use strict";var n=Array.isArray,r=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){var s,o,l,c=n(t),u=n(i);if(c&&u){if(o=t.length,o!=i.length)return!1;for(s=o;0!==s--;)if(!e(t[s],i[s]))return!1;return!0}if(c!=u)return!1;var h=t instanceof Date,d=i instanceof Date;if(h!=d)return!1;if(h&&d)return t.getTime()==i.getTime();var m=t instanceof RegExp,f=i instanceof RegExp;if(m!=f)return!1;if(m&&f)return t.toString()==i.toString();var y=r(t);if(o=y.length,o!==r(i).length)return!1;for(s=o;0!==s--;)if(!a.call(i,y[s]))return!1;for(s=o;0!==s--;)if(l=y[s],!e(t[l],i[l]))return!1;return!0}return t!==t&&i!==i}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJhSURBVFiF7ZW/a1pRFMc/70XFYqVFUCq1hSClvCIShw6FItQ9U8EtHVySuYvg0C2BLB0KDeQf6NLFxU0KLRSKGMmDtKldqg3FEKVNaoqa6Hsd9JXrxR9tYsziF85wzzucz/fd++55cHYtAt97sXiOPmdSEPgFmL04Bu5OC24DPghwK/KAYxoGVgfArVi9aPhDoD3CQAd4dFHw60BJBPp8vhOfz3cimSj1aieuVyJIVVUznU4XM5lMUVVVQzLxetLwJxLAXFlZqZimmTdNM7+8vLwvPweWJgWfB47E5pqm/W42m1uWgVartRUKhY4lA3XgznnhNuC92NjhcHRyudxHC25FoVDYcTqdHclEDrCPAsyNMfAMaSvX1tb24vH4kVzo9/vbdru9k81mrwnpm3RvxtsxnIG6D/R94dFo9NAwjLz89mLEYrGf9O/CKfBgGEQZkr8KFBDO0OPxtHVd/xQIBE5Hua5UKrZwOHyvVquJW/8VWKA7vvukDunzUoQrisLGxkZpHBy6R7G5uVlSlL53mwdeDKof9A08RhqpiUTiIJVKHYyDW9I0rVUul23b29suIb0AfAF2xFr5CAKADnisRDAYbOi6/tnlchn/agCg0WgokUhEKxaLV4T0Yc9IeZCBOeANELUSqqqyvr7+TdO0pgzwer1tt9ttANTrdbVardrkmt3dXWcymbxtGH3e3wExurejT0mG/2QmHUkZDlCbooGaBRVvwY9Bri5If1niuS0Bz4EbUvEtaT1ytNIdPKL2pPU+8NRaDBtEo2SOef5fPYcNoqlpZmBmYGZgZuDSDfwBYHFBvEfx+bgAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABOSURBVFiF7dexDQAgCETRO+My7r+GveNga7AmNP86aHihAkvaaszoHA5AkmZuRMSpHGh7vXX7BgAAAAAAAAAAAAAAAPD9Bflur077BgBceZ8FPDUm8YQAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPnSURBVFiFtZdNTGNVFMd/fZ1SCjPFxohtnyGY8SMhMaRm2LkRmrqYgG2gJCbETBcTNEZXysLERU10oTvjAhIIloWbBpuujE1oWKgLP1IYYWF00uQlfbwymRJgmBHKe3XxaH1zbUvLlP/ynHPv+d97zr3nHButoxd4DRgBXgJ8wLUz3SGwA/wJ/Ar8CDxsZVNbCzYDwC0gBHS3SPYf4AcgASgXJeAE3gXeAuwtOhZxCnwLzAMn7RAYAL4Erl/QsYg/gA+B+60QeBn4GvCIClmWTyKRyOHo6OhRIBA49vv9OoCqqvZcLufMZrO9qVTKXSgUHHX23QU+AP5uRmAAWBKdy7Jcjsfju7FY7ECSpIbHBDAMg8XFxb54PP6MqqoikSLwNpabsBLoAr7BzPAawuHwfiKR0Nxut9HUs4C9vT17NBr1ra2tXRNUd4B3OMsJa3K9D7xutZydnS2trKxo3d3dlXacA7hcrsrMzMyBoij2jY0Nl0X1LGAAv8N/NzAAJK2EwuHw/urqqnrelZ8HwzAIhULPCTfxEIgA96u737I6l2W5nEgktCd1DiBJEslkcqe/v//UIu4BbgNImD9cyLooHo/vthvzZvB4PPrc3Nw9QXwT6LEBbwCfVaWyLJ8oinK3E6e3olwu2wYHB68LL+NjCfNvryESiRx22jmAw+GojI+PHwjiGxLCswsGg0cd936GUCgk7v2iBPitkuHh4ePLIhAIBMR6IFeTsAav16tfFgGv13sqiK52PthtQgIei4umaRctvedC07QrguiBBKhWSS6Xc14WgVwu1yWIChJmG1VDNpvt5ZKQyWSuCqK/JMweroZUKuXWdb2VVq0t6LpuS6fTYmX8RUJoIAuFgmNpacndaQILCwtuTdOsv+Aj4OfqST8B3qxq/H5/eWtrK+/xeDryJEulkn1oaOj5YrFoJfAd8Hn1GSYwG0gAVFV1RKNRn2E8eT0yDIOpqSm/4Lx85rNWgvcxS+Rw1SKfzzsVRbFPTEwc2WwXSwnDMIjFYt50Ot0nqFaANfh/S7YAvGK1HBsbO0wmkzvthqNUKtknJyf96+vrYuY3bMl0zIQMAbVF+Xzeuby83CdJkjEyMnJstzf/p3Rdt83Pz/dNT0/L29vbLkF9D3gPc5IC6rflLwBfAf2iwuv1liORyEEwGDwKBAInPp/vtFKpoKrqlc3Nza5MJtObTqfFbK+iiNmW37UKGwX3KeAL4NVGJ20Td4CPqDOYNLrP6mxnAENAvRO1gjJmwn0KPKhn0Ep6P43ZQN4ExJg2wiPge8w5Q21m2M776sEcz29gdlF+Hh/PVcy68hvwEy2O5/8CzKw/sVG0Ap4AAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAABDCAYAAADHyrhzAAAL9UlEQVR4Xs1bfVRU1RY/5zLO4KxRTDEx/EzRhFTmzuAiwq+MUktLW1jqk3LBCpHUQFEqLc0n8RRZIGJi44NXmolpJj5NS40kBBlmBAN8wnsaysPvEHB883HPeevwGtYIM3PPvXOn9e5fwPnt3973x7n3nn32PhD8QVdVVdUgAMDjVqvVn2GYfhjjXgzD9OQ4TgkhVDAM8wAh9BAA8AAA0AIAuIMxvm2xWG5FRETc+yPChN5yotfrB0IIx0AIh2OMB3viB0LYBiFsRAj9SyaTXRo/fjwRTPJLUjHIf99ms4UwDDMGIdRH8mj/R4gZhvnVZrPVyuXyGimFkUQMvV5PpvpEAIAWANDDSyJ0o4UQ3kUI/ajRaH6BEGJP/XosRmVlpQZCGIUx9hUbzPXr11WDBg1qF2sPAPi3TCY7PH78+FsecADRYpSWlvZVKBSvAACGehLAjRs3lDk5ObM3bdr0lSc8EELOZrOVhoWF/Uh+FsMlSgyDwfAMAGAaxlgmxqmjTV5e3rMlJSXPb9myZUtAQIDJUz6GYW5brdaDEyZMuCGUS5AYer3eD0I4BwAwTKgjV/j4+PgVJpOpT2Rk5A/x8fE/S8FLZgbG+EeWZX+GECJaTmoxyEsSAPAmhHAALTkfrri4eIhOp1tMcEqlsiUvLy+bz0bIOEKoJCws7AdaGyox6uvre7e1tb2JMe5HS0yD27hx4yuXL18OtWPffvvt/IkTJzbS2NJiMMYVWq327zR4XjFqampUFoslFiH0GA0hLeb+/fvy5cuXpyCEOt87o0aNurBu3bpvaTkE4PQajeYoH96tGFeuXPFtaWkhQvTnIxI6vmfPHvbEiROzHO0YhrFt27Zti5+fn0UoHx8eQljCsqzbR8atGAaDYRHGeASfIzHjSUlJsXfu3CH5yiNXVFTU0ZiYmEoxnHw2CKGvw8LCfnGFcylGZWVlOABgOp8DMeO1tbX9Pvnkk3ec2fbt27cpOztbJ4aXzwZC+FChUOSGhIQ4XeA5FaOqqupxjuPiMcY+fA7EjGdkZLxQVVVF1ipOr/fee297cHDwXTHcFDYNGo1mjzOcUzGMRuObCKHhFMSiILGxsSkWi4V8qp1eY8eOLVu9evUJUeQURgzDHFar1Re6QruJYTQaQxFCr1JwioIcPnw4+ODBg9HujGUymTk/Pz9dlAM6I5Ovr29WSEjIIy/qR8S4du1az1u3bi0jayA6TuGo1NTUhU1NTSP5LOfMmXNg7ty5tXw4D8bLNBrNd472j4hRUVExhWGYKR44cGva2NjY64MPPkim4Q8MDGxIT0/fS4MVg8EYI7lcnjNu3Ljf7PadYtTX1yva2tqSPEnF+YLKzc2dVFZWNpUPZx/ftGlT5pAhQ9po8UJxDMNcUKvVh7uJ4e1ZQRzakzLaoMPDw88kJib+RIsXius6OzpnhsFgWIIxDhBKSIs/derU8IKCghhaPMF5I3lz4v87jUZTRv7eIYZer/eHEDpdBAkJ3h12w4YNcxsaGsYK5YuJifk8KirqilA7WjzDMNfVanXHIq9DDG8/Infv3vVNTk5e6ZiU0QY7YsSIi+vXrz9EixeKYxiGbDBnkI3lDjGMRmMcQqhbniCU2BU+Pz8/7PTp0zPF8mVlZf2lX79+/xFrz2dnX4RB8hVpb29PRQjxpvN8pK7Gly1btqSlpUX0ptBzzz13fPHixefF+uezgxD+wrLs17C8vHyUTCZbwGcgdryysjIgKysrXqw9sevTp8/NnJycnZ5w8NiaNBrNZqjX6yMhhM97y1F6evqMmpqaCZ7yL1++fFdYWFizpzyu7FtbW/8MjUbjqwihzq03KZ2ZTCZZYmLiKpvNpvCUNyQkpCI1NfWYpzyu7E0mUzYR4y2EkGS73Y7OCgsLxxYVFc2V4gZI8pabm5uhVCptUvB15ZDL5bthZWUlWV/4e8PB6tWrY5qbmyXbCpg1a9ahefPmXfRGrFardS+ZGasQQiqpHdTX1/f5+OOPV0jJO3DgwCubN2/+XEpOB6790GAwrJWiMtY1wOzs7Kl6vX6S1IF/+OGH2UFBQaR/Q+rrEHlM1kvNSvji4uJWms1myWecVqv9acWKFWe8EHMRmRmpUqftx48fH/nll18u9ELAQKFQtOt0uq1e4N7vlXfGunXroq9evRrshYA7KBcsWLB3xowZDVLyI4T2kcckEQAgWZGItBikpKSkSBloV65hw4bVbty48YCUPjDGXxAx/gQA4N2TpHWs0+nCi4uLX6TFi8VJ1cJg989x3E4iBikUkYKRJFdCQsI77e3tkhaonQU2efLkk3FxceckCRoA0NramkFeoFqM8ctSkJ47dy5wx44dcVJw8XGoVKq7n3766XY+HOU41mg0G+D58+cDfHx8llAauYWlpaW9XFdXp5GCi4YjISFhd0RExHUarDsMhPAGy7I7O/YwDAbDGoxxT09ISVK2dOnSFI7j5EJ4fHx8bAEBAVeampqChNgR7OjRow1r164tEmrnBN9RQ7GL8QbG+ClPSPft2xd67Ngx0vBGfZF9iqVLlxaOGTPm3t69e0O///77mRzHUbdO+vj4WHfs2LHZ0+QNY/yVVqu9ZBfD4/dGcnLy4tu3bw+hVeLpp58+v2bNmuOO+IsXL/rv3LlzXmtrK/Wnfvr06d8uXLiwW92UNg6GYSwqlWprUFCQ2b47rmQYZqXYqruQpIyk4tHR0Ydmzpx52VXAaWlpL9XV1ZEGW96rf//+jZmZmfm8QBcAx0KSY91E9KOSmZn5vNFofJYvIH9//+uJiYlfjxw58j4f9siRI0998803r9JsDHnSwsAwTIFarb5K4nEUYyjGuKPzTujF12JA+FiWPZuUlHRaCHdDQ4NfTk7O6/fu3Rvozi40NPTnlStXUnf12bkghPdYlt3W+bujEzG7XkVFRaMLCwvfcBWsQqF4MH/+/IPTpk0TXQjKyMiIqqqqinDlQy6Xm3bv3r1FiNAE27VP45HygNFoHIYQeksI6fvvv//GtWvXRjuzGTBgwNVVq1YdkKLz9+TJkyP2798/11WTS3R09P7Zs2dfoo2drC3UanWeYwN+t1qJwWCgfne4S8oiIiJOJSQklNAGR4MjDfeZmZnRzr5agwcPvpyWlraPhodg7J9TR3w3McrKynorFIpEhBDvjra979uRUKlUti5atOhAZGSkxytDVze2ffv2yeXl5d36SGiTNwjhJZZluzXuO62ikUZ5jDFv5tm1xSAwMLA+JSXlkDdLgXaBSkpKBhUUFLzuuJtGORutvXv3zgkKCmrtKrbLkqLBYIh1d5zq7NmzQ3bt2tX59fF2CdDZLLl582bPrVu3vtbc3NzRq0rTwgAhPMqyrN4Zn0sxqqurH+M4LgEh5DTXsPd9q1Sq35YsWfKVpwdfaJ91ZzidTvdMcXHxC2QsNja2YMqUKb86vVkI/8my7BeufLktNldXV4+1Wq2vdTW2930PHTr0HykpKd/26tXL6snNSGGr1+sDPvvss9efeOKJXz/66KPO1iQ7N8MwLXK5XOeqIZbgeCvvFRUVzzIME+UYcGFh4TiO45j58+eLzgmkEMDZPykrK2vmu+++e8yx//z304+71Wq12xIDrxjE4YULFyI5jvNacVpqYcjMdRDDhDH+q1arvcPnh0oMQkJyD4TQIzOEj/z/YPyB2WwmG0BUh4SpxSA3RrYIIYQvebOxRUIB75vN5r/RCkH1zugaXHl5+fAePXrMwRj3ljBwqalqMcZHtVqtoAOAgmaGPeIzZ874qlSqFxmGUUt9F57wQQhJ39cRlmVFtVmLEsMecHV19ZMcx8324lFvIdpU+/r6nnT36eQj80gMQq7X63sghCbJZDKyhPf4nCtfwF3HyTlWAMBJtVpdL9S2K95jMeyE5GCfyWSa5OPjoxG7fSjkZsjGzO9nVy9KcQ5e1AuUL2DSStnS0hIsk8mCMcZPSikMhJAkV3UAgFq1Wt0olQj2e5JsZjgTqaamRm42m0kddwwAIEhk68MdknJbLJZL4eHhXtsW8MrMcDdzSktLe/r5+fW02WxKUnRyhlUoFNhms5kRQqaHDx+apk6d6pWGNme+/wtn7dJLR+980QAAAABJRU5ErkJggg=="},function(e,t,i){e.exports=i.p+"img/dirt_0.eb1569b0.png"},,,,,function(e,t,i){"use strict";var n=i(15),r=i(59),a=i(191),s="endsWith",o=""[s];n(n.P+n.F*i(192)(s),"String",{endsWith:function(e){var t=a(this,e,s),i=arguments.length>1?arguments[1]:void 0,n=r(t.length),l=void 0===i?n:Math.min(r(i),n),c=String(e);return o?o.call(t,c,l):t.slice(l-c.length,l)===c}})},function(e,t,i){var n=i(15),r=i(677);n(n.S+n.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(e,t,i){var n=i(17).parseInt,r=i(157).trim,a=i(158),s=/^[-+]?0[xX]/;e.exports=8!==n(a+"08")||22!==n(a+"0x16")?function(e,t){var i=r(String(e),3);return n(i,t>>>0||(s.test(i)?16:10))}:n},function(e,t,i){i(679),e.exports=i(19).Object.getPrototypeOf},function(e,t,i){var n=i(117),r=i(161);i(652)("getPrototypeOf",function(){return function(e){return r(n(e))}})},function(e,t,i){i(681),e.exports=i(19).Object.setPrototypeOf},function(e,t,i){var n=i(47);n(n.S,"Object",{setPrototypeOf:i(682).set})},function(e,t,i){var n=i(51),r=i(48),a=function(e,t){if(r(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=i(108)(Function.call,i(146).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(r){t=!0}return function(e,i){return a(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:a}},function(e,t,i){i(684);var n=i(19).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,i){var n=i(47);n(n.S,"Object",{create:i(138)})},function(e,t,i){i(686);var n=i(19).Object;e.exports=function(e,t){return n.getOwnPropertyDescriptor(e,t)}},function(e,t,i){var n=i(63),r=i(146).f;i(652)("getOwnPropertyDescriptor",function(){return function(e,t){return r(n(e),t)}})},function(e,t,i){i(688),e.exports=i(19).Reflect.get},function(e,t,i){var n=i(146),r=i(161),a=i(53),s=i(47),o=i(51),l=i(48);function c(e,t){var i,s,u=arguments.length<3?e:arguments[2];return l(e)===u?e[t]:(i=n.f(e,t))?a(i,"value")?i.value:void 0!==i.get?i.get.call(u):void 0:o(s=r(e))?c(s,t,u):void 0}s(s.S,"Reflect",{get:c})},function(e,t,i){i(690),e.exports=i(19).Reflect.construct},function(e,t,i){var n=i(47),r=i(138),a=i(115),s=i(48),o=i(51),l=i(86),c=i(691),u=(i(36).Reflect||{}).construct,h=l(function(){function e(){}return!(u(function(){},[],e)instanceof e)}),d=!l(function(){u(function(){})});n(n.S+n.F*(h||d),"Reflect",{construct:function(e,t){a(e),s(t);var i=arguments.length<3?e:a(arguments[2]);if(d&&!h)return u(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(c.apply(e,n))}var l=i.prototype,m=r(o(l)?l:Object.prototype),f=Function.apply.call(e,m,t);return o(f)?f:m}})},function(e,t,i){"use strict";var n=i(115),r=i(51),a=i(653),s=[].slice,o={},l=function(e,t,i){if(!(t in o)){for(var n=[],r=0;r<t;r++)n[r]="a["+r+"]";o[t]=Function("F,a","return new F("+n.join(",")+")")}return o[t](e,i)};e.exports=Function.bind||function(e){var t=n(this),i=s.call(arguments,1),o=function(){var n=i.concat(s.call(arguments));return this instanceof o?l(t,n.length,n):a(t,n,e)};return r(t.prototype)&&(o.prototype=t.prototype),o}},function(e,t){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);e.exports=function(){return i(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},function(e,t){for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);function r(e,t){var n=t||0,r=i;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}e.exports=r},function(e,t,i){"use strict";function n(e,t,i,n,a){r(e,t,i||0,n||e.length-1,a||s)}function r(e,t,i,n,s){while(n>i){if(n-i>600){var o=n-i+1,l=t-i+1,c=Math.log(o),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(o-u)/o)*(l-o/2<0?-1:1),d=Math.max(i,Math.floor(t-l*u/o+h)),m=Math.min(n,Math.floor(t+(o-l)*u/o+h));r(e,t,d,m,s)}var f=e[t],y=i,g=n;a(e,i,t),s(e[n],f)>0&&a(e,i,n);while(y<g){a(e,y,g),y++,g--;while(s(e[y],f)<0)y++;while(s(e[g],f)>0)g--}0===s(e[i],f)?a(e,i,g):(g++,a(e,g,n)),g<=t&&(i=g+1),t<=g&&(n=g-1)}}function a(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function s(e,t){return e<t?-1:e>t?1:0}e.exports=n,e.exports.default=n},function(e,t,i){"use strict";function n(e,t){if(!(this instanceof n))return new n(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function r(e,t){return e<t?-1:e>t?1:0}e.exports=n,e.exports.default=n,n.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){var t=this.data,i=this.compare,n=t[e];while(e>0){var r=e-1>>1,a=t[r];if(i(n,a)>=0)break;t[e]=a,e=r}t[e]=n},_down:function(e){var t=this.data,i=this.compare,n=this.length>>1,r=t[e];while(e<n){var a=1+(e<<1),s=a+1,o=t[a];if(s<this.length&&i(t[s],o)<0&&(a=s,o=t[s]),i(o,r)>=0)break;t[e]=o,e=a}t[e]=r}}},function(e,t,i){i(697)("Uint8",1,function(e){return function(t,i,n){return e(this,t,i,n)}})},function(e,t,i){"use strict";if(i(20)){var n=i(111),r=i(17),a=i(21),s=i(15),o=i(655),l=i(698),c=i(76),u=i(151),h=i(81),d=i(45),m=i(150),f=i(78),y=i(59),g=i(656),v=i(131),p=i(91),_=i(46),b=i(357),L=i(35),M=i(73),k=i(355),w=i(92),T=i(352),S=i(77).f,O=i(356),C=i(68),E=i(16),I=i(164),D=i(156),j=i(699),P=i(351),Y=i(80),x=i(359),A=i(169),F=i(206),N=i(700),H=i(24),R=i(106),z=H.f,G=R.f,V=r.RangeError,B=r.TypeError,U=r.Uint8Array,W="ArrayBuffer",q="Shared"+W,J="BYTES_PER_ELEMENT",K="prototype",Z=Array[K],Q=l.ArrayBuffer,X=l.DataView,$=I(0),ee=I(2),te=I(3),ie=I(4),ne=I(5),re=I(6),ae=D(!0),se=D(!1),oe=P.values,le=P.keys,ce=P.entries,ue=Z.lastIndexOf,he=Z.reduce,de=Z.reduceRight,me=Z.join,fe=Z.sort,ye=Z.slice,ge=Z.toString,ve=Z.toLocaleString,pe=E("iterator"),_e=E("toStringTag"),be=C("typed_constructor"),Le=C("def_constructor"),Me=o.CONSTR,ke=o.TYPED,we=o.VIEW,Te="Wrong length!",Se=I(1,function(e,t){return De(j(e,e[Le]),t)}),Oe=a(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Ce=!!U&&!!U[K].set&&a(function(){new U(1).set({})}),Ee=function(e,t){var i=f(e);if(i<0||i%t)throw V("Wrong offset!");return i},Ie=function(e){if(L(e)&&ke in e)return e;throw B(e+" is not a typed array!")},De=function(e,t){if(!(L(e)&&be in e))throw B("It is not a typed array constructor!");return new e(t)},je=function(e,t){return Pe(j(e,e[Le]),t)},Pe=function(e,t){var i=0,n=t.length,r=De(e,n);while(n>i)r[i]=t[i++];return r},Ye=function(e,t,i){z(e,t,{get:function(){return this._d[i]}})},xe=function(e){var t,i,n,r,a,s,o=M(e),l=arguments.length,u=l>1?arguments[1]:void 0,h=void 0!==u,d=O(o);if(void 0!=d&&!k(d)){for(s=d.call(o),n=[],t=0;!(a=s.next()).done;t++)n.push(a.value);o=n}for(h&&l>2&&(u=c(u,arguments[2],2)),t=0,i=y(o.length),r=De(this,i);i>t;t++)r[t]=h?u(o[t],t):o[t];return r},Ae=function(){var e=0,t=arguments.length,i=De(this,t);while(t>e)i[e]=arguments[e++];return i},Fe=!!U&&a(function(){ve.call(new U(1))}),Ne=function(){return ve.apply(Fe?ye.call(Ie(this)):Ie(this),arguments)},He={copyWithin:function(e,t){return N.call(Ie(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return ie(Ie(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return F.apply(Ie(this),arguments)},filter:function(e){return je(this,ee(Ie(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(Ie(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return re(Ie(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){$(Ie(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return se(Ie(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ae(Ie(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return me.apply(Ie(this),arguments)},lastIndexOf:function(e){return ue.apply(Ie(this),arguments)},map:function(e){return Se(Ie(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return he.apply(Ie(this),arguments)},reduceRight:function(e){return de.apply(Ie(this),arguments)},reverse:function(){var e,t=this,i=Ie(t).length,n=Math.floor(i/2),r=0;while(r<n)e=t[r],t[r++]=t[--i],t[i]=e;return t},some:function(e){return te(Ie(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return fe.call(Ie(this),e)},subarray:function(e,t){var i=Ie(this),n=i.length,r=v(e,n);return new(j(i,i[Le]))(i.buffer,i.byteOffset+r*i.BYTES_PER_ELEMENT,y((void 0===t?n:v(t,n))-r))}},Re=function(e,t){return je(this,ye.call(Ie(this),e,t))},ze=function(e){Ie(this);var t=Ee(arguments[1],1),i=this.length,n=M(e),r=y(n.length),a=0;if(r+t>i)throw V(Te);while(a<r)this[t+a]=n[a++]},Ge={entries:function(){return ce.call(Ie(this))},keys:function(){return le.call(Ie(this))},values:function(){return oe.call(Ie(this))}},Ve=function(e,t){return L(e)&&e[ke]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Be=function(e,t){return Ve(e,t=p(t,!0))?h(2,e[t]):G(e,t)},Ue=function(e,t,i){return!(Ve(e,t=p(t,!0))&&L(i)&&_(i,"value"))||_(i,"get")||_(i,"set")||i.configurable||_(i,"writable")&&!i.writable||_(i,"enumerable")&&!i.enumerable?z(e,t,i):(e[t]=i.value,e)};Me||(R.f=Be,H.f=Ue),s(s.S+s.F*!Me,"Object",{getOwnPropertyDescriptor:Be,defineProperty:Ue}),a(function(){ge.call({})})&&(ge=ve=function(){return me.call(this)});var We=m({},He);m(We,Ge),d(We,pe,Ge.values),m(We,{slice:Re,set:ze,constructor:function(){},toString:ge,toLocaleString:Ne}),Ye(We,"buffer","b"),Ye(We,"byteOffset","o"),Ye(We,"byteLength","l"),Ye(We,"length","e"),z(We,_e,{get:function(){return this[ke]}}),e.exports=function(e,t,i,l){l=!!l;var c=e+(l?"Clamped":"")+"Array",h="get"+e,m="set"+e,f=r[c],v=f||{},p=f&&T(f),_=!f||!o.ABV,M={},k=f&&f[K],O=function(e,i){var n=e._d;return n.v[h](i*t+n.o,Oe)},C=function(e,i,n){var r=e._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),r.v[m](i*t+r.o,n,Oe)},E=function(e,t){z(e,t,{get:function(){return O(this,t)},set:function(e){return C(this,t,e)},enumerable:!0})};_?(f=i(function(e,i,n,r){u(e,f,c,"_d");var a,s,o,l,h=0,m=0;if(L(i)){if(!(i instanceof Q||(l=b(i))==W||l==q))return ke in i?Pe(f,i):xe.call(f,i);a=i,m=Ee(n,t);var v=i.byteLength;if(void 0===r){if(v%t)throw V(Te);if(s=v-m,s<0)throw V(Te)}else if(s=y(r)*t,s+m>v)throw V(Te);o=s/t}else o=g(i),s=o*t,a=new Q(s);d(e,"_d",{b:a,o:m,l:s,e:o,v:new X(a)});while(h<o)E(e,h++)}),k=f[K]=w(We),d(k,"constructor",f)):a(function(){f(1)})&&a(function(){new f(-1)})&&x(function(e){new f,new f(null),new f(1.5),new f(e)},!0)||(f=i(function(e,i,n,r){var a;return u(e,f,c),L(i)?i instanceof Q||(a=b(i))==W||a==q?void 0!==r?new v(i,Ee(n,t),r):void 0!==n?new v(i,Ee(n,t)):new v(i):ke in i?Pe(f,i):xe.call(f,i):new v(g(i))}),$(p!==Function.prototype?S(v).concat(S(p)):S(v),function(e){e in f||d(f,e,v[e])}),f[K]=k,n||(k.constructor=f));var I=k[pe],D=!!I&&("values"==I.name||void 0==I.name),j=Ge.values;d(f,be,!0),d(k,ke,c),d(k,we,!0),d(k,Le,f),(l?new f(1)[_e]==c:_e in k)||z(k,_e,{get:function(){return c}}),M[c]=f,s(s.G+s.W+s.F*(f!=v),M),s(s.S,c,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*a(function(){v.of.call(f,1)}),c,{from:xe,of:Ae}),J in k||d(k,J,t),s(s.P,c,He),A(c),s(s.P+s.F*Ce,c,{set:ze}),s(s.P+s.F*!D,c,Ge),n||k.toString==ge||(k.toString=ge),s(s.P+s.F*a(function(){new f(1).slice()}),c,{slice:Re}),s(s.P+s.F*(a(function(){return[1,2].toLocaleString()!=new f([1,2]).toLocaleString()})||!a(function(){k.toLocaleString.call([1,2])})),c,{toLocaleString:Ne}),Y[c]=D?I:j,n||D||d(k,pe,j)}}else e.exports=function(){}},function(e,t,i){"use strict";var n=i(17),r=i(20),a=i(111),s=i(655),o=i(45),l=i(150),c=i(21),u=i(151),h=i(78),d=i(59),m=i(656),f=i(77).f,y=i(24).f,g=i(206),v=i(95),p="ArrayBuffer",_="DataView",b="prototype",L="Wrong length!",M="Wrong index!",k=n[p],w=n[_],T=n.Math,S=n.RangeError,O=n.Infinity,C=k,E=T.abs,I=T.pow,D=T.floor,j=T.log,P=T.LN2,Y="buffer",x="byteLength",A="byteOffset",F=r?"_b":Y,N=r?"_l":x,H=r?"_o":A;function R(e,t,i){var n,r,a,s=new Array(i),o=8*i-t-1,l=(1<<o)-1,c=l>>1,u=23===t?I(2,-24)-I(2,-77):0,h=0,d=e<0||0===e&&1/e<0?1:0;for(e=E(e),e!=e||e===O?(r=e!=e?1:0,n=l):(n=D(j(e)/P),e*(a=I(2,-n))<1&&(n--,a*=2),e+=n+c>=1?u/a:u*I(2,1-c),e*a>=2&&(n++,a/=2),n+c>=l?(r=0,n=l):n+c>=1?(r=(e*a-1)*I(2,t),n+=c):(r=e*I(2,c-1)*I(2,t),n=0));t>=8;s[h++]=255&r,r/=256,t-=8);for(n=n<<t|r,o+=t;o>0;s[h++]=255&n,n/=256,o-=8);return s[--h]|=128*d,s}function z(e,t,i){var n,r=8*i-t-1,a=(1<<r)-1,s=a>>1,o=r-7,l=i-1,c=e[l--],u=127&c;for(c>>=7;o>0;u=256*u+e[l],l--,o-=8);for(n=u&(1<<-o)-1,u>>=-o,o+=t;o>0;n=256*n+e[l],l--,o-=8);if(0===u)u=1-s;else{if(u===a)return n?NaN:c?-O:O;n+=I(2,t),u-=s}return(c?-1:1)*n*I(2,u-t)}function G(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function V(e){return[255&e]}function B(e){return[255&e,e>>8&255]}function U(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return R(e,52,8)}function q(e){return R(e,23,4)}function J(e,t,i){y(e[b],t,{get:function(){return this[i]}})}function K(e,t,i,n){var r=+i,a=m(r);if(a+t>e[N])throw S(M);var s=e[F]._b,o=a+e[H],l=s.slice(o,o+t);return n?l:l.reverse()}function Z(e,t,i,n,r,a){var s=+i,o=m(s);if(o+t>e[N])throw S(M);for(var l=e[F]._b,c=o+e[H],u=n(+r),h=0;h<t;h++)l[c+h]=u[a?h:t-h-1]}if(s.ABV){if(!c(function(){k(1)})||!c(function(){new k(-1)})||c(function(){return new k,new k(1.5),new k(NaN),k.name!=p})){k=function(e){return u(this,k),new C(m(e))};for(var Q,X=k[b]=C[b],$=f(C),ee=0;$.length>ee;)(Q=$[ee++])in k||o(k,Q,C[Q]);a||(X.constructor=k)}var te=new w(new k(2)),ie=w[b].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||l(w[b],{setInt8:function(e,t){ie.call(this,e,t<<24>>24)},setUint8:function(e,t){ie.call(this,e,t<<24>>24)}},!0)}else k=function(e){u(this,k,p);var t=m(e);this._b=g.call(new Array(t),0),this[N]=t},w=function(e,t,i){u(this,w,_),u(e,k,_);var n=e[N],r=h(t);if(r<0||r>n)throw S("Wrong offset!");if(i=void 0===i?n-r:d(i),r+i>n)throw S(L);this[F]=e,this[H]=r,this[N]=i},r&&(J(k,x,"_l"),J(w,Y,"_b"),J(w,x,"_l"),J(w,A,"_o")),l(w[b],{getInt8:function(e){return K(this,1,e)[0]<<24>>24},getUint8:function(e){return K(this,1,e)[0]},getInt16:function(e){var t=K(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=K(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return G(K(this,4,e,arguments[1]))},getUint32:function(e){return G(K(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return z(K(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return z(K(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){Z(this,1,e,V,t)},setUint8:function(e,t){Z(this,1,e,V,t)},setInt16:function(e,t){Z(this,2,e,B,t,arguments[2])},setUint16:function(e,t){Z(this,2,e,B,t,arguments[2])},setInt32:function(e,t){Z(this,4,e,U,t,arguments[2])},setUint32:function(e,t){Z(this,4,e,U,t,arguments[2])},setFloat32:function(e,t){Z(this,4,e,q,t,arguments[2])},setFloat64:function(e,t){Z(this,8,e,W,t,arguments[2])}});v(k,p),v(w,_),o(w[b],s.VIEW,!0),t[p]=k,t[_]=w},function(e,t,i){var n=i(42),r=i(155),a=i(16)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[a])?t:r(i)}},function(e,t,i){"use strict";var n=i(73),r=i(131),a=i(59);e.exports=[].copyWithin||function(e,t){var i=n(this),s=a(i.length),o=r(e,s),l=r(t,s),c=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===c?s:r(c,s))-l,s-o),h=1;l<o&&o<l+u&&(h=-1,l+=u-1,o+=u-1);while(u-- >0)l in i?i[o]=i[l]:delete i[o],o+=h,l+=h;return i}},function(e,t,i){"use strict";var n={},r=Array.prototype,a=Object.prototype,s=r.slice,o=a.toString,l=a.hasOwnProperty,c=r.forEach,u=Object.keys,h=Array.isArray,d=function(){},m=d.each=d.forEach=function(e,t,i){if(null!=e)if(c&&e.forEach===c)e.forEach(t,i);else if(e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(t.call(i,e[r],r,e)===n)return}else{var s=d.keys(e);for(r=0,a=s.length;r<a;r++)if(t.call(i,e[s[r]],s[r],e)===n)return}};d.keys=u||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var i in e)d.has(e,i)&&t.push(i);return t},d.defaults=function(e){return m(s.call(arguments,1),function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])}),e},d.isArray=h||function(e){return"[object Array]"===o.call(e)},d.has=function(e,t){if(!d.isArray(t))return null!=e&&l.call(e,t);for(var i=t.length,n=0;n<i;n++){var r=t[n];if(null==e||!l.call(e,r))return!1;e=e[r]}return!!i};var f={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}},y={escape:new RegExp("["+d.keys(f.escape).join("")+"]","g")};d.each(["escape"],function(e){d[e]=function(t){return null==t?"":(""+t).replace(y[e],function(t){return f[e][t]})}}),d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,v={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},p=/\\|'|\r|\n|\t|\u2028|\u2029/g;d.template=function(e,t,i){var n;i=d.defaults({},i,d.templateSettings);var r=new RegExp([(i.escape||g).source,(i.interpolate||g).source,(i.evaluate||g).source].join("|")+"|$","g"),a=0,s="__p+='";e.replace(r,function(t,i,n,r,o){return s+=e.slice(a,o).replace(p,function(e){return"\\"+v[e]}),i&&(s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),n&&(s+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),r&&(s+="';\n"+r+"\n__p+='"),a=o+t.length,t}),s+="';\n",i.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(i.variable||"obj","_",s)}catch(l){throw l.source=s,l}if(t)return n(t,d);var o=function(e){return n.call(this,e,d)};return o.source="function("+(i.variable||"obj")+"){\n"+s+"}",o},e.exports=d},function(e,t,i){i(703),e.exports=i(19).Reflect.set},function(e,t,i){var n=i(49),r=i(146),a=i(161),s=i(53),o=i(47),l=i(79),c=i(48),u=i(51);function h(e,t,i){var o,d,m=arguments.length<4?e:arguments[3],f=r.f(c(e),t);if(!f){if(u(d=a(e)))return h(d,t,i,m);f=l(0)}if(s(f,"value")){if(!1===f.writable||!u(m))return!1;if(o=r.f(m,t)){if(o.get||o.set||!1===o.writable)return!1;o.value=i,n.f(m,t,o)}else n.f(m,t,l(0,i));return!0}return void 0!==f.set&&(f.set.call(m,i),!0)}o(o.S,"Reflect",{set:h})},function(e,t,i){i(347),i(93),i(118),i(705),i(712),i(713),e.exports=i(19).Promise},function(e,t,i){"use strict";var n,r,a,s,o=i(94),l=i(36),c=i(108),u=i(163),h=i(47),d=i(51),m=i(115),f=i(706),y=i(707),g=i(657),v=i(658).set,p=i(708)(),_=i(640),b=i(659),L=i(709),M=i(660),k="Promise",w=l.TypeError,T=l.process,S=T&&T.versions,O=S&&S.v8||"",C=l[k],E="process"==u(T),I=function(){},D=r=_.f,j=!!function(){try{var e=C.resolve(1),t=(e.constructor={})[i(28)("species")]=function(e){e(I,I)};return(E||"function"==typeof PromiseRejectionEvent)&&e.then(I)instanceof t&&0!==O.indexOf("6.6")&&-1===L.indexOf("Chrome/66")}catch(n){}}(),P=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},Y=function(e,t){if(!e._n){e._n=!0;var i=e._c;p(function(){var n=e._v,r=1==e._s,a=0,s=function(t){var i,a,s,o=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{o?(r||(2==e._h&&F(e),e._h=1),!0===o?i=n:(u&&u.enter(),i=o(n),u&&(u.exit(),s=!0)),i===t.promise?c(w("Promise-chain cycle")):(a=P(i))?a.call(i,l,c):l(i)):c(n)}catch(h){u&&!s&&u.exit(),c(h)}};while(i.length>a)s(i[a++]);e._c=[],e._n=!1,t&&!e._h&&x(e)})}},x=function(e){v.call(l,function(){var t,i,n,r=e._v,a=A(e);if(a&&(t=b(function(){E?T.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)}),e._h=E||A(e)?2:1),e._a=void 0,a&&t.e)throw t.v})},A=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){v.call(l,function(){var t;E?T.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),Y(t,!0))},H=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw w("Promise can't be resolved itself");(t=P(e))?p(function(){var n={_w:i,_d:!1};try{t.call(e,c(H,n,1),c(N,n,1))}catch(r){N.call(n,r)}}):(i._v=e,i._s=1,Y(i,!1))}catch(n){N.call({_w:i,_d:!1},n)}}};j||(C=function(e){f(this,C,k,"_h"),m(e),n.call(this);try{e(c(H,this,1),c(N,this,1))}catch(t){N.call(this,t)}},n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=i(710)(C.prototype,{then:function(e,t){var i=D(g(this,C));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=E?T.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&Y(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n;this.promise=e,this.resolve=c(H,e,1),this.reject=c(N,e,1)},_.f=D=function(e){return e===C||e===s?new a(e):r(e)}),h(h.G+h.W+h.F*!j,{Promise:C}),i(116)(C,k),i(711)(k),s=i(19)[k],h(h.S+h.F*!j,k,{reject:function(e){var t=D(this),i=t.reject;return i(e),t.promise}}),h(h.S+h.F*(o||!j),k,{resolve:function(e){return M(o&&this===s?C:this,e)}}),h(h.S+h.F*!(j&&i(350)(function(e){C.all(e)["catch"](I)})),k,{all:function(e){var t=this,i=D(t),n=i.resolve,r=i.reject,a=b(function(){var i=[],a=0,s=1;y(e,!1,function(e){var o=a++,l=!1;i.push(void 0),s++,t.resolve(e).then(function(e){l||(l=!0,i[o]=e,--s||n(i))},r)}),--s||n(i)});return a.e&&r(a.v),i.promise},race:function(e){var t=this,i=D(t),n=i.reject,r=b(function(){y(e,!1,function(e){t.resolve(e).then(i.resolve,n)})});return r.e&&n(r.v),i.promise}})},function(e,t){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(108),r=i(348),a=i(349),s=i(48),o=i(160),l=i(162),c={},u={};t=e.exports=function(e,t,i,h,d){var m,f,y,g,v=d?function(){return e}:l(e),p=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(a(v)){for(m=o(e.length);m>_;_++)if(g=t?p(s(f=e[_])[0],f[1]):p(e[_]),g===c||g===u)return g}else for(y=v.call(e);!(f=y.next()).done;)if(g=r(y,p,f.value,t),g===c||g===u)return g};t.BREAK=c,t.RETURN=u},function(e,t,i){var n=i(36),r=i(658).set,a=n.MutationObserver||n.WebKitMutationObserver,s=n.process,o=n.Promise,l="process"==i(109)(s);e.exports=function(){var e,t,i,c=function(){var n,r;l&&(n=s.domain)&&n.exit();while(e){r=e.fn,e=e.next;try{r()}catch(a){throw e?i():t=void 0,a}}t=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(c)};else if(!a||n.navigator&&n.navigator.standalone)if(o&&o.resolve){var u=o.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new a(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){var n=i(36),r=n.navigator;e.exports=r&&r.userAgent||""},function(e,t,i){var n=i(62);e.exports=function(e,t,i){for(var r in t)i&&e[r]?e[r]=t[r]:n(e,r,t[r]);return e}},function(e,t,i){"use strict";var n=i(36),r=i(19),a=i(49),s=i(56),o=i(28)("species");e.exports=function(e){var t="function"==typeof r[e]?r[e]:n[e];s&&t&&!t[o]&&a.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,i){"use strict";var n=i(47),r=i(19),a=i(36),s=i(657),o=i(660);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,r.Promise||a.Promise),i="function"==typeof e;return this.then(i?function(i){return o(t,e()).then(function(){return i})}:e,i?function(i){return o(t,e()).then(function(){throw i})}:e)}})},function(e,t,i){"use strict";var n=i(47),r=i(640),a=i(659);n(n.S,"Promise",{try:function(e){var t=r.f(this),i=a(e);return(i.e?t.reject:t.resolve)(i.v),t.promise}})},function(e,t){ol.Feature.prototype.getProperty=function(e){if("attributes"===e){var t=this.getProperties();return this.getGeometryName()&&delete t[this.getGeometryName()],t}if("olcs_geometryType"===e){var i=this.getGeometry().getType();return"Polygon"===i?1:"LineString"===i?2:"Point"===i?3:"Circle"===i?1:"MultiPolygon"===i?1:"MultiLineString"===i?2:"MultiPoint"===i?3:void 0}return this.get(e)}},function(e,t){Cesium.Material._materialCache.addMaterial("Wallpaper",{fabric:{type:"Wallpaper",uniforms:{image:Cesium.Material.DefaultImageId,anchor:new Cesium.Cartesian2(0,0)},components:{diffuse:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).rgb",alpha:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).a"}},translucent:!1})},function(e,t){Cesium.Cesium3DTilePointFeature.prototype.getId=function(){return this.getProperty("id")||"".concat(this.content.url).concat(this._batchId)}},function(e,t){Cesium.Cesium3DTileFeature.prototype.getId=function(){return this.getProperty("id")||"".concat(this.content.url).concat(this._batchId)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";i.r(t);var n={};i.r(n),i.d(n,"Buildings",function(){return Vn}),i.d(n,"CesiumTilesetLayer",function(){return zn}),i.d(n,"Czml",function(){return qn}),i.d(n,"Gltf",function(){return Kn}),i.d(n,"PointCloud",function(){return Xn}),i.d(n,"Terrain",function(){return zt}),i.d(n,"ObliqueLayer",function(){return Di}),i.d(n,"GeoJSON",function(){return pr}),i.d(n,"SingleImage",function(){return Mr}),i.d(n,"OpenStreetMap",function(){return wr}),i.d(n,"TMSBase",function(){return Sr}),i.d(n,"Vector",function(){return _n}),i.d(n,"TiledLayer",function(){return Er}),i.d(n,"VectorCluster",function(){return Pr}),i.d(n,"WFS",function(){return xr}),i.d(n,"WMS",function(){return Fr}),i.d(n,"WMTS",function(){return Hr}),i.d(n,"Wsv",function(){return Br}),i.d(n,"FeatureStore",function(){return ta});var r={};i.r(r),i.d(r,"Legend",function(){return Fa}),i.d(r,"Planning",function(){return xl}),i.d(r,"Query",function(){return Tu}),i.d(r,"Search",function(){return uh}),i.d(r,"AdvancedWalkMode",function(){return fh}),i.d(r,"BalloonInfo",function(){return gh}),i.d(r,"Copyright",function(){return ph}),i.d(r,"CreateLink",function(){return bh}),i.d(r,"DisplayQuality",function(){return Uh}),i.d(r,"Drawing",function(){return Jh}),i.d(r,"Export",function(){return Zh}),i.d(r,"FeatureList",function(){return Xh}),i.d(r,"Locator",function(){return Vu}),i.d(r,"Measurement",function(){return Dd}),i.d(r,"SingleMeasurement",function(){return Pd}),i.d(r,"NavigationControls",function(){return Ad}),i.d(r,"OverviewMap",function(){return Nd}),i.d(r,"PDFCreator",function(){return rm}),i.d(r,"PositionDisplay",function(){return lm}),i.d(r,"Shadow",function(){return um}),i.d(r,"TransparentTerrainMode",function(){return vm}),i.d(r,"Flight",function(){return _m}),i.d(r,"HeightProfile",function(){return Dm});i(67),i(547),i(561),i(574),i(578);var a=i(34),s=(i(25),i(40),i(64),i(11),i(88),i(32),i(12),i(13),i(4),i(18));function o(e,t,i){var n,r=function(e,t){if(null===t)return null!==e&&"Expected ".concat(c.getErrorValue(e)," to be null");var n=c.atomic(e,t);if(null!==n)return n;var r=c.value(e,t);if(null!==r)return r;if(Array.isArray(t))return c.array(e,t,i);if(t instanceof Function)return!(e instanceof t)&&"Expected ".concat(c.getErrorValue(e,!0)," to be of Type ").concat(c.getConstructorString(t));if(t===Object)return c.object(e,{});if("object"!==Object(s["a"])(t)||"object"!==Object(s["a"])(e))throw new Error("Cannot handler pattern ".concat(t));var a=c.object(e,t);return a||!!i&&c.requireKeys(e,t)};if(Array.isArray(t)&&t.length>1){var a=t.every(function(t){var i=r(e,t);return i});a&&(n="Expected ".concat(c.getErrorValue(e)," to be a ").concat(t.map(function(e){return c.getConstructorString(e)}).join(" or ")))}else n=r(e,t);if(n)throw new Error("Match failed: ".concat(n));return!1}function l(e,t,i){var n=[null,void 0];return Array.isArray(t)&&t.length>1?t.forEach(function(e){n.push(e)}):n.push(t),o(e,n.reverse(),i)}var c={};c.patterns=[[String,"string"],[Number,"number"],[Boolean,"boolean"],[Function,"function"],[void 0,"undefined"]],c.getErrorValue=function(e,t){if(null===e)return"null";if("undefined"===typeof e)return"undefined";if(t)return Object(s["a"])(e);var i;try{i=JSON.stringify(e)}catch(n){i=Object(s["a"])(e)}return i.length>20?"".concat(i.substr(0,20),"..."):i},c.getConstructorString=function(e){if(null===e)return"null";var t=c.patterns.find(function(t){return t[0]===e});if(t)return t[1];var i=e.toString();if(e.className)return e.className;var n=i.match(/function (.*)\(/);if(n&&n.length>1)return n[1];if(c.isPlainObject(e)){var r={};Object.keys(e).forEach(function(t){r[t]=c.getConstructorString(e[t])});try{i="Object of ".concat(JSON.stringify(r))}catch(a){i="Object"}}return i},c.atomic=function(e,t){if(t===Number)return!Number.isFinite(e)&&"expected ".concat(c.getErrorValue(e)," to be a number, excluding NaN");for(var i=c.patterns.length;i--;)if(t===c.patterns[i][0])return Object(s["a"])(e)!==c.patterns[i][1]&&"expected ".concat(c.getErrorValue(e)," to be a ").concat(c.patterns[i][1]);return null},c.value=function(e,t){return"string"===typeof t||"number"===typeof t||"boolean"===typeof t?e!==t&&"Expected ".concat(c.getErrorValue(e)," to equal ").concat(t):null},c.array=function(e,t,i){if(Array.isArray(t)){if(1!==t.length)throw new Error("Array patterns may only have on type");if(Array.isArray(e)){var n=!1,r=e.findIndex(function(e){try{o(e,t[0],i)}catch(r){n=r.message.replace(/Match failed:\s/,"")}return n});return r>-1&&"".concat(n," in ").concat(c.getErrorValue(e))}return"Expected ".concat(c.getErrorValue(e)," to be an Array")}return null},c.object=function(e,t,i){var n=i?"".concat(i,"."):"",r=c.isPlainObject(e);if(!r)return"Expected ".concat(c.getErrorValue(e)," to be a plain Object");var a=!1,s=Object.keys(t).find(function(i){var r=e[i];if(c.isPlainObject(t[i]))a=c.object(r,t[i],n+i);else if("undefined"===typeof r&&void 0!==t[i])a="Missing key ".concat(n).concat(i," in ").concat(c.getErrorValue(e));else try{o(r,t[i])}catch(s){a=s.message.replace(/Match failed:\s/,"")}return a});return!!s&&"".concat(a," in object.").concat(n).concat(s)},c.isPlainObject=function(e){var t={};if(!e||"[object Object]"!==t.toString(e))return!1;var i=Object.getPrototypeOf(e);if(!i)return!0;var n=t.hasOwnProperty,r=n.call(i,"constructor")&&i.constructor;return"function"===typeof r&&n.toString.call(r)===n.toString.call(Object)},c.requireKeys=function(e,t,i){var n=i?"".concat(i,"."):"",r=!1,a=Object.keys(e).find(function(i){if(c.isPlainObject(t[i])){var a=e[i];r=c.requireKeys(a,t[i],n+i)}else t[i]||(r="Found additional key ".concat(n).concat(i));return r=!!r&&r.replace(/\sin.*/,""),r});return!!a&&"".concat(r," in ").concat(c.getErrorValue(e))};var u=i(5),h=i(27),d=(i(29),i(37),i(1)),m=i(0);i(26),i(7),i(44),i(22),i(74),i(75);function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return!t||"object"!==Object(s["a"])(t)&&"function"!==typeof t?f(e):t}var g=i(643),v=i.n(g),p=i(537),_=i.n(p);function b(e){return b=_.a?v.a:function(e){return e.__proto__||v()(e)},b(e)}var L=i(661),M=i.n(L),k=i(538);function w(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=M()(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(k["a"])(e,t)}var T=i(10),S=(i(168),i(96),{OFF:1,ERROR:2,WARN:4,INFO:8,DEBUG:16}),O={ERROR:0,WARN:0,INFO:0,DEBUG:0};O.ERROR=S.ERROR|S.WARN|S.INFO|S.DEBUG,O.WARN=S.WARN|S.INFO|S.DEBUG,O.INFO=S.INFO|S.DEBUG,O.DEBUG=S.DEBUG;var C,E=S.INFO,I=!1,D={},j=new Map;j.set(S.ERROR,"error"),j.set(S.WARN,"warn"),j.set(S.INFO,"info"),j.set(S.DEBUG,"log");var P=function(){function e(t){Object(d["a"])(this,e),this.className=t,this.deprecations=new Set}return Object(m["a"])(e,null,[{key:"loggers",get:function(){return D}},{key:"enabled",get:function(){return Object.keys(S).find(function(e){return S[e]===E})||"OFF"},set:function(e){if(e){var t="string"===typeof e?e.toUpperCase():"INFO";E=S[t]||S.INFO}else E=S.OFF}},{key:"timestamp",get:function(){return I},set:function(e){I=e}}]),Object(m["a"])(e,[{key:"error",value:function(e){if(o(e,String),E&O.ERROR){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.ERROR,i)}}},{key:"warning",value:function(e){if(o(e,String),E&O.WARN){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.WARN,i)}}},{key:"deprecate",value:function(e,t){if(o(e,String),l(t,String),!this.deprecations.has(e)){this.deprecations.add(e);var i="".concat(e," has been deprecated and will be removed");t&&(i="".concat(i,". ").concat(t)),this.warning(i)}}},{key:"info",value:function(e){if(o(e,String),E&O.INFO){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.INFO,i)}}},{key:"debug",value:function(e){if(o(e,String),E&O.DEBUG){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.DEBUG,i)}}},{key:"log",value:function(e){if(o(e,String),E&O.DEBUG){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.DEBUG,i)}}},{key:"_log",value:function(e,t,i){var n,r=e;if(this.className&&(r="[".concat(this.className,"] ").concat(r)),I){var a=new Date(Date.now());r="".concat(a.toLocaleDateString()," ").concat(a.toLocaleTimeString()," ").concat(r)}(n=console)[j.get(t)].apply(n,[r].concat(Object(T["a"])(i))),t&S.ERROR&&(console.group(),console.trace(),console.groupEnd())}}],[{key:"getLogger",value:function(t){return t?e.loggers[t]||e.createLogger(t):C}},{key:"createLogger",value:function(t){var i=new e(t);return e.loggers[t]=i,i}}]),e}();C=new P;var Y=P,x=function(){function e(t){Object(d["a"])(this,e),this.className=t.className?t.className:"vcs.vcm.Framework",this.id=Object(u["c"])(),this.framework=ne.getInstance(),this.options=t,this.logger=Y.getLogger(this.className),this.name=t.name||Object(u["c"])()}return Object(m["a"])(e,[{key:"getClassName",value:function(){return this.logger.deprecate("getClassName","Access the property className directly"),this.className}},{key:"getName",value:function(){return this.logger.deprecate("getName","Access the property name directly"),this.name}},{key:"getId",value:function(){return this.logger.deprecate("getId","Use name property as a unique identifier"),this.id}},{key:"getConfigObject",value:function(){return{type:this.className,name:this.name}}}]),e}(),A=x,F=ol.proj.getTransform("EPSG:4326","EPSG:3857"),N=ol.proj.getTransform("EPSG:3857","EPSG:4326"),H=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d["a"])(this,t),i.className=t.className,e=y(this,b(t).call(this,i)),e.proj=null,e.proj4=null,e.epsg=null;var n=i.epsg,r=i.proj4;if("string"===typeof n&&""===n.trim()&&(n=null),n){if("string"===typeof n&&0!==n.indexOf("EPSG:")&&(n="EPSG:".concat(n)),Number.isFinite(n)&&(n="EPSG:".concat(n)),"string"===typeof r&&""===r.trim()&&(r=null),r&&(e.proj4=r,window.proj4.defs(n,r)),i.alias){var a=i.alias;a.forEach(function(e){window.proj4.defs(e,window.proj4.defs(n))},f(e))}e.epsg=n,e.proj=ol.proj.get(n)}return e.proj||(e.framework.getProjection()?e.epsg=e.framework.getProjection().getEPSG():e.epsg="EPSG:4326",e.proj=ol.proj.get(e.epsg)),e}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.Projection"}}]),Object(m["a"])(t,[{key:"getProjection",value:function(){return this.proj}},{key:"getEPSG",value:function(){return this.epsg}},{key:"getPROJ4",value:function(){return this.proj4}},{key:"transformTo",value:function(e,i){return t.transform(e,this,i)}},{key:"transformFrom",value:function(e,i){return t.transform(this,e,i)}},{key:"getConfigObject",value:function(){var e={epsg:this.epsg};return this.proj4&&(e.proj4=this.proj4),e}}],[{key:"transform",value:function(e,t,i){var n=ol.proj.getTransform(t.getProjection(),e.getProjection()),r=new Array(2);return n([i[0],i[1]],r,2),i.length>2&&r.push(i[2]),r}},{key:"transformCoordinates",value:function(e,i,n){for(var r=[],a=0;a<n.length;a++)r.push(t.transform(e,i,n[a]));return r}},{key:"getTransformer",value:function(e,t){return ol.proj.getTransform(t.getProjection(),e.getProjection())}},{key:"createGeographicProjection",value:function(){return new t({epsg:4326})}},{key:"createMercatorProjection",value:function(){return new t({epsg:3857})}},{key:"parseUrlParameter",value:function(e){var i=e.epsg,n=e.proj4;return new t({epsg:i,proj4:n})}},{key:"mercatorToWgs84",value:function(e,t){return N(e,t?e:void 0,e.length)}},{key:"wgs84ToMercator",value:function(e,t){return F(e,t?e:void 0,e.length)}}]),t}(A),R=H,z=Y.getLogger("vcs.vcm.util.ViewPoint"),G=function(){function e(t){if(Object(d["a"])(this,e),this.name=t.name?t.name:Object(u["c"])(),this.cameraPosition=t.cameraPosition?t.cameraPosition:null,Array.isArray(this.cameraPosition)&&3===this.cameraPosition.length)for(var i=0;i<this.cameraPosition.length;i++){var n=this.cameraPosition[i];"string"===typeof n&&(this.cameraPosition[i]=Number(n))}else this.cameraPosition=null;if(this.groundPosition=t.groundPosition?t.groundPosition:null,Array.isArray(this.groundPosition))for(i=0;i<this.groundPosition.length;i++){n=this.groundPosition[i];"string"===typeof n&&(this.groundPosition[i]=Number(n))}this.distance=null!=t.distance?t.distance:null,"string"===typeof this.distance&&(this.distance=Number(this.distance)),this.heading=t.heading?t.heading:0,"string"===typeof this.heading&&(this.heading=Number(this.heading)),this.pitch=t.pitch?t.pitch:-90,"string"===typeof this.pitch&&(this.pitch=Number(this.pitch)),this.roll=t.roll?t.roll:0,"string"===typeof this.roll&&(this.roll=Number(this.roll)),this.animate=!!t.animate&&t.animate,this.proj=t.proj?t.proj:null}return Object(m["a"])(e,[{key:"getConfigObject",value:function(){return{name:this.name,distance:this.distance,cameraPosition:this.cameraPosition,groundPosition:this.groundPosition,heading:this.heading,pitch:this.pitch,roll:this.roll,animate:this.animate}}},{key:"clone",value:function(){return new e({cameraPosition:this.cameraPosition?this.cameraPosition.slice():null,groundPosition:this.groundPosition?this.groundPosition.slice():null,distance:this.distance,heading:this.heading,pitch:this.pitch,roll:this.roll,animate:this.animate,proj:this.proj})}},{key:"getName",value:function(){return z.deprecate("getName","Access the property name directly"),this.name}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"setCameraPosition",value:function(e){this.cameraPosition=e}},{key:"getAnimate",value:function(){return this.animate}},{key:"setAnimate",value:function(e){this.animate=e}},{key:"getGroundPosition",value:function(){return this.groundPosition}},{key:"setGroundPosition",value:function(e){this.groundPosition=e}},{key:"getDistance",value:function(){return this.distance}},{key:"setDistance",value:function(e){this.distance=e}},{key:"getHeading",value:function(){return this.heading}},{key:"setHeading",value:function(e){this.heading=e}},{key:"getPitch",value:function(){return this.pitch}},{key:"setPitch",value:function(e){this.pitch=e}},{key:"getRoll",value:function(){return this.roll}},{key:"setRoll",value:function(e){this.roll=e}},{key:"getProjection",value:function(){return this.proj}},{key:"setProjection",value:function(e){this.proj=e}},{key:"toString",value:function(){var e="ViewPoint: [Ground:".concat(String(this.groundPosition?this.groundPosition:null),"]")+"[Camera:".concat(String(this.cameraPosition?this.cameraPosition:null),"]")+"[Distance:".concat(this.distance,"]")+"[heading:".concat(this.distance,"]")+"[pitch:".concat(this.distance,"]")+"[roll:".concat(this.distance,"]");return e}},{key:"getLink",value:function(e){var t={},i="",n=this.groundPosition,r=this.cameraPosition;if(null!=e.queryParams.epsg){var a=R.createGeographicProjection(),s=new R({epsg:e.queryParams.epsg});n&&(n=R.transform(s,a,this.groundPosition)),r&&(r=R.transform(s,a,this.cameraPosition))}r&&(r.forEach(function(e){i+="".concat(e.toFixed(5),",")}),i=i.slice(0,-1),t.cameraPosition=i),i="",n&&(n.forEach(function(e){i+="".concat(e.toFixed(5),",")}),i=i.slice(0,-1),t.groundPosition=i),null!=this.distance&&(t.distance=this.distance.toFixed(2)),null!=this.pitch&&(t.pitch=this.pitch.toFixed(2)),null!=this.heading&&(t.heading=this.heading.toFixed(2)),null!=this.roll&&(t.roll=this.roll.toFixed(2)),e.addQueryParams(t)}},{key:"isValid",value:function(){try{var e=!1,t=!1;try{e=!o(this.cameraPosition,[Number])&&3===this.cameraPosition.length}catch(i){t=!o(this.groundPosition,[Number])&&this.groundPosition.length>1&&this.groundPosition.length<4}if(!e&&!t)throw new Error("Viewpoint is missing position");return t&&o(this.distance,Number),o(this.heading,Number),o(this.pitch,Number),o(this.roll,Number),!0}catch(i){return!1}}}],[{key:"createViewPointFromExtent",value:function(t){if(t&&4===t.length){var i=t[0],n=t[1],r=t[2],a=t[3],s=[(r-i)/2+i,(a-n)/2+n],o=0,l=Math.max(r-i,a-n);return o=l<.001?400:3e5*l,new e({name:"viewpointFromExtend",distance:o,groundPosition:s,heading:360,pitch:-90,roll:0,animate:!0})}return null}},{key:"parseURLparameter",value:function(t){var i=t.cameraPosition;if(null!=i){i=i.split(",");for(var n=0;n<i.length;n++)i[n]=Number(i[n])}var r=t.groundPosition;if(null!=r){r=r.split(",");for(n=0;n<r.length;n++)r[n]=Number(r[n])}if(null!=t.epsg){var a=R.parseUrlParameter(t),s=R.createGeographicProjection();r&&(r=R.transform(s,a,r)),i&&(i=R.transform(s,a,i))}var o={cameraPosition:i,groundPosition:r,distance:Number(t.distance),pitch:Number(t.pitch),heading:Number(t.heading),roll:Number(t.roll)};return new e(o)}}]),e}(),V=G,B=(i(97),{LOCALE_CHANGED:"LOCALE_CHANGED"}),U=null,W=function(){function e(){Object(d["a"])(this,e),this.languages=[{token:"de",language:"Deutsch",data:{}},{token:"en",language:"English",data:{}}],this.currentlocale="",this.defaultLocale="de",this.availableLocales=[],this.logger=Y.getLogger("vcs.vcm.i18n"),this.i18nNumber=0}return Object(m["a"])(e,[{key:"detectBrowserLocale",value:function(){if(navigator.language){var e=navigator.language;return e.substring(0,2)}return null}},{key:"initialize",value:function(e){e.i18n&&this.setConfig(e.i18n);var t=e.availableLocales;if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=t[i];if(null!==n&&"object"===Object(s["a"])(n)){var r=n.locale;r&&(this.isLanguageAvailable(r)||this.registerLanguage(r,r,{}),this.availableLocales.push(r))}else this.isLanguageAvailable(t[i])&&this.availableLocales.push(t[i])}this.setDefaultLocale(e.locale),e.locale&&(this.defaultLocale=e.locale);var a=this.detectBrowserLocale();a&&this.availableLocales.indexOf(a)>=0&&(this.defaultLocale=a)}},{key:"setDefaultLocale",value:function(e){this.defaultLocale=this.availableLocales[0],e&&this.isLanguageAvailable(e)&&(this.defaultLocale=e);var t=this.detectBrowserLocale();t&&this.isLanguageAvailable(t)&&(this.defaultLocale=t)}},{key:"setConfig",value:function(e){for(var t in e)if(this.isLanguageAvailable(t)){for(var i=0;i<this.languages.length;i++)if(this.languages[i].token===t)for(var n in e[t])this.languages[i].data[n]=e[t][n]}else this.registerLanguage(t,t,e[t])}},{key:"getLocaleAwareString",value:function(e){return"string"===typeof e?e.replace("$locale$",this.currentlocale):e}},{key:"registerLanguage",value:function(e,t,i){for(var n={token:e,language:t,data:i},r=0;r<this.languages.length;r++)if(this.languages[r].token==e)return void this.logger.info("Language ".concat(t," already registered"));this.languages.push(n)}},{key:"isLanguageAvailable",value:function(e){for(var t=0;t<this.languages.length;t++)if(this.languages[t].token==e)return!0;return!1}},{key:"handleURLParameter",value:function(e){e.lang&&this.isLanguageAvailable(e.lang)&&(this.defaultLocale=e.lang)}},{key:"getSingleMessage",value:function(e){var t=this.getLanguageData(this.currentlocale),i=this.getLanguageData("en"),n=Object.assign({},i,t);return n&&n.hasOwnProperty(e)?n[e]:e}},{key:"getLanguageData",value:function(e){for(var t=0;t<this.languages.length;t++)if(this.languages[t].token==e)return this.languages[t].data;return this.languages.length>0?this.languages[0].data:null}},{key:"getLocale",value:function(){return this.currentlocale?this.currentlocale:this.defaultLocale}},{key:"setLocale",value:function(e){e||(e=this.defaultLocale),this.currentlocale!=e&&(this.currentlocale=e,this.translateAll(),ne.getInstance().publish(B.LOCALE_CHANGED,this.currentlocale))}},{key:"getRegisteredLanguages",value:function(){for(var e=[],t=0;t<this.languages.length;t++)e.push(this.languages[t].token);return e}},{key:"translateAll",value:function(e){var t=this.getLanguageData(this.currentlocale),i=this.getLanguageData("en"),n=Object.assign({},i,t),r=[],a=e||document.getElementById("balloonContainer")||document;for(var s in n){r=a.querySelectorAll(".".concat(s));for(var o=n[s],l=0;l<r.length;l++){var c=r[l];o=this.setParamValuesInTranslation(o,c),s.indexOf("tooltip")===s.length-"tooltip".length?c.title=o:"input"==c.nodeName.toLowerCase()?"submit"===c.attributes.type.value||"button"===c.attributes.type.value?c.value=o:c.placeholder=o:c.innerHTML=o}}}},{key:"setParamValuesInTranslation",value:function(e,t){var i=new RegExp("{[0-9]}","g"),n=e.match(i);if(n)for(var r=0;r<n.length;r++){var a=n[r].match(/{(.*)}/)[1],s=new RegExp("{[".concat(r,"]}"),"g"),o=t.getAttribute("data-".concat(a));o?e=e.replace(s,o):(e=e.replace(s,""),this.logger.warning("No attribute found to replace the placeholder at element: ".concat(t)))}return e}},{key:"replaceParamsInTranslation",value:function(e,t){var i=new RegExp("{[0-9]}","g"),n=e.match(i);if(n)for(var r=0;r<n.length;r++){n[r].match(/{(.*)}/)[1];var a=new RegExp("{[".concat(r,"]}"),"g"),s=t[r];e=s?e.replace(a,s):e.replace(a,"")}return e}}],[{key:"getInstance",value:function(){return U||(U=new e),U}},{key:"registerLanguage",value:function(t,i,n){e.getInstance().registerLanguage(t,i,n)}},{key:"getNextI18nNumber",value:function(){var t=e.getInstance();return t.i18nNumber++,t.i18nNumber}},{key:"getMessage",value:function(t){return e.getInstance().getSingleMessage(t)}},{key:"setMessage",value:function(t,i,n){var r={};r[i]=n;var a=e.getInstance(),s=a.getLanguageData(t);s&&(s[i]=n)}},{key:"setDataForElement",value:function(t,i){var n={};Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++)n["data-".concat(String(r))]=i[r];if(t)for(var a in n)t.setAttribute(a,n[a]);e.updateElement(t)}},{key:"updateElement",value:function(t){for(var i=e.getInstance(),n=t.classList,r=0;r<n.length;r++){var a=n[r];if(-1!==a.indexOf("i18n")){var s=i.getSingleMessage(a);s=i.setParamValuesInTranslation(s,t),t.textContent=s}}}}]),e}(),q=W;i(60);B.SELECTED_ITEM_CHANGED="SELECTED_ITEM_CHANGED",B.SELECTIONSET_CHANGED="SELECTIONSET_CHANGED";var J,K=null,Z=function(){function e(t){Object(d["a"])(this,e),this.className="vcs.vcm.SelectBehavior",this.logger=Y.getLogger(this.className);var i,n,r={invertClickBehaviorForCesiumMap:!(!t||!t.invertClickBehaviorForCesiumMap)&&t.invertClickBehaviorForCesiumMap,highlightStyle:{selectionset:{color:t&&t.highlightStyle&&t.highlightStyle.selectionset&&t.highlightStyle.selectionset.color?t.highlightStyle.selectionset.color:"#3F51B5"},currentItem:{color:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.color?t.highlightStyle.currentItem.color:"#F44336",pointStyle:{},lineStyle:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.lineStyle?t.highlightStyle.currentItem.lineStyle:{color:"#83f52c",width:1.25},polygonStyle:{fill:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.polygonStyle&&t.highlightStyle.currentItem.polygonStyle.fill?t.highlightStyle.currentItem.polygonStyle.fill:{color:"rgba(255,255,255,0.4)"},stroke:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.polygonStyle&&t.highlightStyle.currentItem.polygonStyle.stroke?t.highlightStyle.currentItem.polygonStyle.stroke:{color:"#83f52c",width:1}}}}};if(t&&t.highlightStyle&&t.highlightStyle.currentItem?t.highlightStyle.currentItem.pointStyle.icon?r.highlightStyle.currentItem.pointStyle.icon=t.highlightStyle.currentItem.pointStyle.icon:t.highlightStyle.currentItem.pointStyle.circle?r.highlightStyle.currentItem.pointStyle.circle=t.highlightStyle.currentItem.pointStyle.circle:r.highlightStyle.currentItem.pointStyle={icon:{scale:1,src:"{layerIcon}"}}:r.highlightStyle.currentItem.pointStyle={icon:{scale:1,src:"{layerIcon}"}},n=r.highlightStyle.selectionset.color,i=olcs.core.convertColorToCesium(n),this._selectionsetHighlightColor=i,n=r.highlightStyle.currentItem.color,i=olcs.core.convertColorToCesium(n),this._currentItemHighlightColor=i,r.highlightStyle.currentItem.pointStyle.icon)this._currentItemHighlightPointStyle=new ol.style.Style({image:new ol.style.Icon(r.highlightStyle.currentItem.pointStyle.icon)});else{var a=r.highlightStyle.currentItem.pointStyle.circle.stroke?new ol.style.Stroke(r.highlightStyle.currentItem.pointStyle.circle.stroke):void 0,s=new ol.style.Fill(r.highlightStyle.currentItem.pointStyle.circle.fill),o=r.highlightStyle.currentItem.pointStyle.circle.radius?r.highlightStyle.currentItem.pointStyle.circle.radius:5,l=new ol.style.Circle({fill:s,radius:o,stroke:a});this._currentItemHighlightPointStyle=new ol.style.Style({image:l})}this._currentItemHighlightLineStyle=new ol.style.Style({stroke:new ol.style.Stroke(r.highlightStyle.currentItem.lineStyle)});var c={};c.stroke=new ol.style.Stroke(r.highlightStyle.currentItem.polygonStyle.stroke),c.fill=new ol.style.Fill(r.highlightStyle.currentItem.polygonStyle.fill),this._currentItemHighlightPolygonStyle=new ol.style.Style(c),this._invertClickBehaviorForCesiumMap=!!r.invertClickBehaviorForCesiumMap,this._selectionset=[],this.selectMode="toplevelfeature",this._currentItem={},this._currentItemHighlightedUnderneath=!1,this.framework=ne.getInstance(),this.active=!1,this.options=r,this.activateClickBehavior(),this.framework.subscribe(B.LAYER_DEACTIVATED,this.layerDeactivatedListener.bind(this)),this.framework.subscribe(B.FEATURE_REMOVED,this.featureRemovedListener.bind(this)),this.framework.subscribe(B.MAP_ACTIVATED,this.mapActivatedListener.bind(this));var u=this.framework.getLayers();this.selectionSetLayers=[],u.forEach(function(e){"vcs.vcm.layer.cesium.Buildings"!==e.className&&"vcs.vcm.layer.cesium.CesiumTilesetLayer"!==e.className&&"vcs.vcm.layer.TiledLayer"!==e.className&&"vcs.vcm.layer.FeatureStore"!==e.className||this.selectionSetLayers.push(e)},this),this.framework.subscribe(B.LAYER_ACTIVATED,this.synchronizeSelectionSet.bind(this)),this.transformGeometryOnMove=!this.framework.isIE11}return Object(m["a"])(e,[{key:"activateClickBehavior",value:function(){this.active||(this.active=!0,this._invertClickBehaviorForCesiumMap?(this.featureClickedKey=this.framework.subscribe(B.FEATURE_CLICKED,this.handleFeatureCTRLClickedEvent.bind(this)),this.featureCtrlClickedKey=this.framework.subscribe(B.FEATURE_CTRL_CLICKED,this.handleFeatureClickedEvent.bind(this))):(this.featureClickedKey=this.framework.subscribe(B.FEATURE_CLICKED,this.handleFeatureClickedEvent.bind(this)),this.featureCtrlClickedKey=this.framework.subscribe(B.FEATURE_CTRL_CLICKED,this.handleFeatureCTRLClickedEvent.bind(this))),this.mapClickedKey=this.framework.subscribe(B.MAP_CLICKED,this.handleMapClickedEvent.bind(this)))}},{key:"deactivateClickBehavior",value:function(){this.active&&(this.active=!1,this.framework.unsubscribeByKey(this.featureClickedKey),this.framework.unsubscribeByKey(this.featureCtrlClickedKey),this.framework.unsubscribeByKey(this.mapClickedKey),this.clearCurrentItem())}},{key:"isClickBehaviorActivated",value:function(){return this.logger.deprecate("isClickBehaviorActivated","check the .active property"),this.active}},{key:"getInvertClickBehaviorForCesiumMap",value:function(){return this._invertClickBehaviorForCesiumMap}},{key:"setInvertClickBehaviorForCesiumMap",value:function(e){this._invertClickBehaviorForCesiumMap=e,this.deactivateClickBehavior(),this.activateClickBehavior()}},{key:"addToSelectionSet",value:function(e){var t=!1;e.forEach(function(e){if(-1===this._selectionset.indexOf(e))if(t=!0,this._selectionset.push(e),this._currentItem&&this._currentItem.id===e)this._currentItemHighlightedUnderneath=!0;else{var i={};i[e]=this._selectionsetHighlightColor,this.selectionSetLayers.forEach(function(e){e.initialized&&e.highlight(i)})}},this),t&&this.framework.publish(B.SELECTIONSET_CHANGED)}},{key:"removeFromSelectionSet",value:function(e){var t=!1;e.forEach(function(e){var i=this._selectionset.indexOf(e);-1!==i&&(t=!0,this._currentItem&&this._currentItem.id&&this._currentItem.object?this._currentItem.id!==this._selectionset[i]?this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[i]])},this):this._currentItemHighlightedUnderneath=null:this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[i]])},this),this._selectionset.splice(i,1))},this),t&&this.framework.publish(B.SELECTIONSET_CHANGED)}},{key:"synchronizeSelectionSet",value:function(){var e=this._selectionset.splice(0);this.clearSelectionSet(),this.addToSelectionSet(e)}},{key:"getSizeOfSelectionSet",value:function(){return this._selectionset.length}},{key:"getSelectionSet",value:function(){return this._selectionset}},{key:"clearSelectionSet",value:function(){this.removeFromSelectionSet(this._selectionset.slice(0))}},{key:"setCurrentItem",value:function(e,t,i){if(o(e,String),l(t,Object),i&&!/^vcs\.vcm\.layer/.test(i.className))throw new Error("Match failed: expected ".concat(i," to be an instanceof vcs.vcm.layer.Layer"));this.framework.publish(B.SELECTED_ITEM_CHANGED,e,t,i),this.clearCurrentItem();for(var n=0;n<this._selectionset.length;n++)this._selectionset[n]===e&&(this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[n]])},this),this._currentItemHighlightedUnderneath=!0);if(i){var r={};r[e]=i.determineHighlightStyle(e,t),i.highlight(r),this._currentItem={id:e,object:t,layer:i}}else this.selectionSetLayers.forEach(function(i){var n={};n[e]=i.determineHighlightStyle(e,t),i.highlight(n)}),this._currentItem={id:e,object:t,layer:this.selectionSetLayers};t&&i&&this.passToBalloonInfo(t,i)}},{key:"determineDefaultVectorHighlightStyle",value:function(e,t,i){var n=t.getGeometry(),r=t.get("olcs_extrudedHeight")||t.get("olcs_storeyNumber")&&t.get("olcs_storeyHeight");if(n instanceof ol.geom.Point||n instanceof ol.geom.MultiPoint){var a,s=t.getStyle()?t.getStyle():i.getStyle().style,o=!1;if(s instanceof Function&&(s=s(t),o=!0),s.getImage())if(this._currentItemHighlightPointStyle.getImage()instanceof ol.style.Icon)if(s.getImage()instanceof ol.style.Icon){if(!o)if("{layerIcon}"===this._currentItemHighlightPointStyle.getImage().getSrc())s=i.getStyle().style;else if("{featureIcon}"===this._currentItemHighlightPointStyle.getImage().getSrc()){var l=i.getFeatureById(e);s=l.getStyle()}var c,u=s.getImage().getImage();if("canvas"===u.nodeName.toLowerCase()){var h=s.getImage().getSize();c={img:u,imgSize:[h[0],h[1]],scale:this.options.highlightStyle.currentItem.pointStyle.icon.scale?this.options.highlightStyle.currentItem.pointStyle.icon.scale:1}}else{var d=s.getImage().getSrc();c=Object.assign({},this.options.highlightStyle.currentItem.pointStyle.icon,{src:d})}a=new ol.style.Style({image:new ol.style.Icon(c)})}else{var m=s.getImage().clone(),f=this.options.highlightStyle.currentItem.pointStyle.icon.scale?m.getScale()*this.options.highlightStyle.currentItem.pointStyle.icon.scale:2*m.getScale();m.setScale(f),a=new ol.style.Style({image:m})}else this._currentItemHighlightPointStyle.getImage()instanceof ol.style.Circle&&(a=new ol.style.Style({image:this._currentItemHighlightPointStyle.getImage()}));else a=new ol.style.Style({});if(s.getText()){var y=s.getText().clone(),g=y.getScale()||1,v=this.options.highlightStyle.currentItem.pointStyle.icon.scale?g*this.options.highlightStyle.currentItem.pointStyle.icon.scale:2*g;y.setScale(v),y.setFill(this._currentItemHighlightPolygonStyle.getFill()),a.setText(y)}return r&&a.setStroke(this._currentItemHighlightLineStyle.getStroke()),a}return n instanceof ol.geom.LineString||n instanceof ol.geom.MultiLineString?r?this._currentItemHighlightPolygonStyle:this._currentItemHighlightLineStyle:n instanceof ol.geom.Polygon||n instanceof ol.geom.Circle||n instanceof ol.geom.MultiPolygon?this._currentItemHighlightPolygonStyle:void 0}},{key:"passToBalloonInfo",value:function(e,t){var i=this.getBalloonInfoWidget();if(i){var n=t.getGenericFeatureFromClickedObject(e);n?i.createBalloonForGenericFeature(n):this.logger.warning("Could not create generic feature to pass to balloonInfo")}}},{key:"getBalloonInfoWidget",value:function(){return this.balloonWidget||(this.balloonWidget=this.framework.getWidgetByType("vcs.vcm.widgets.BalloonInfo")),this.balloonWidget}},{key:"clearCurrentItem",value:function(e){function t(e,t,n){e.unHighlight([t]),n&&(i={},i[t]=n,e.highlight(i))}var i;if(this._currentItem&&this._currentItem.id&&this._currentItem.layer){var n=this._currentItem.layer,r=this._currentItem.id;if(this._currentItem={},Array.isArray(n))n.forEach(function(e){var i=!!this._currentItemHighlightedUnderneath&&this._selectionsetHighlightColor;t(e,r,i)},this);else{var a=!!this._currentItemHighlightedUnderneath&&this._selectionsetHighlightColor;t(n,r,a)}}this._currentItemHighlightedUnderneath=!1;var s=this.getBalloonInfoWidget();s&&s.clearBalloon(),e||this.framework.publish(B.SELECTED_ITEM_CHANGED,null)}},{key:"getCurrentItem",value:function(){return this._currentItem}},{key:"handleFeatureClickedEvent",value:function(e,t,i){this.setCurrentItem(e,t,i)}},{key:"handleFeatureCTRLClickedEvent",value:function(e,t,i){-1!==this._selectionset.indexOf(e)?this.removeFromSelectionSet([e]):this.addToSelectionSet([e])}},{key:"getLink",value:function(e){if(null!=this._currentItem.id&&null!=this._currentItem.layer){var t={};if(t.slLayer=this._currentItem.layer.name,t.slId=this._currentItem.id,this._currentItem.object instanceof ol.Feature){var i=this._currentItem.object.getGeometry();t.slOlT=i.getType()}e.addQueryParams(t)}}},{key:"handleMapClickedEvent",value:function(){this.clearCurrentItem()}},{key:"layerDeactivatedListener",value:function(e){this._currentItem.layer===e&&this.clearCurrentItem()}},{key:"featureRemovedListener",value:function(e){this.removeFromSelectionSet([e.id]),this._currentItem.id===e.id&&this.clearCurrentItem()}},{key:"mapActivatedListener",value:function(e){this._currentItem.layer&&this._currentItem.object&&(this._currentItem.layer.isSupported(e)?this.passToBalloonInfo(this._currentItem.object,this._currentItem.layer):this.clearCurrentItem())}}],[{key:"getInstance",value:function(t){return K||(K=new e(t)),K}},{key:"dispose",value:function(){K=null}}]),e}(),Q=Z,X=function(){function e(){Object(d["a"])(this,e),this.key_=1,this.pendingKeys_=[],this.publishDepth_=0,this.subscriptions_=[],this.topics_={}}return Object(m["a"])(e,[{key:"subscribe",value:function(e,t,i){o(e,String),o(t,Function);var n=this.topics_[e];n||(n=this.topics_[e]=[]);var r=this.key_;return this.subscriptions_[r]=e,this.subscriptions_[r+1]=t,this.subscriptions_[r+2]=i,this.key_=r+3,n.push(r),r}},{key:"subscribeOnce",value:function(e,t,i){var n=!1,r=this.subscribe(e,function(e){n||(n=!0,this.unsubscribeByKey(r),t.apply(i,arguments))},this);return r}},{key:"unsubscribe",value:function(e,t,i){var n=this.topics_[e];if(n){var r=this.subscriptions_,a=n.find(function(e){return r[e+1]==t&&r[e+2]==i});if(a)return this.unsubscribeByKey(a)}return!1}},{key:"unsubscribeByKey",value:function(e){var t=this.subscriptions_[e];if(t){var i=this.topics_[t];if(0!=this.publishDepth_)this.pendingKeys_.push(e),this.subscriptions_[e+1]=function(){};else{if(i){var n=i.indexOf(e);i.splice(n,1)}delete this.subscriptions_[e],delete this.subscriptions_[e+1],delete this.subscriptions_[e+2]}}return!!t}},{key:"publish",value:function(t,i){var n=this.topics_[t];if(n){for(var r=new Array(arguments.length-1),a=1,s=arguments.length;a<s;a++)r[a-1]=arguments[a];if(this.async_)for(a=0;a<n.length;a++){var o=n[a];e.runAsync_(this.subscriptions_[o+1],this.subscriptions_[o+2],r)}else{this.publishDepth_++;try{for(a=0,s=n.length;a<s;a++){o=n[a];this.subscriptions_[o+1].apply(this.subscriptions_[o+2],r)}}finally{var l;if(this.publishDepth_--,this.pendingKeys_.length>0&&0==this.publishDepth_)while(l=this.pendingKeys_.pop())this.unsubscribeByKey(l)}}return 0!=a}return!1}},{key:"clear",value:function(e){if(e){var t=this.topics_[e];t&&(t.forEach(this.unsubscribeByKey,this),delete this.topics_[e])}else this.subscriptions_.length=0,this.topics_={}}},{key:"getCount",value:function(e){if(e){var t=this.topics_[e];return t?t.length:0}var i=0;for(var n in this.topics_)i+=this.getCount(n);return i}},{key:"disposeInternal",value:function(){this.clear(),this.pendingKeys_.length=0}}]),e}(),$=X,ee=0,te=Symbol("VcsConfigStyle"),ie=function(){function e(){Object(d["a"])(this,e),this.widgets={},this.maps={},this.layers={},this.viewpoints={},this.styles={},this.flights={},this.activemap=null,this.lastactivemap=null,this.startingmap="",this.startViewPoint=null,this.mapcontainer=null,this.urlParameter=null,this.pubsub=new $,this.projection=null,this.logger=Y.getLogger("vcs.vcm.Framework"),this.layerIndexCounter=0,this.numberOfLocales=0,this.initialized=!1,this.exclusiveListener={id:null,listeners:[],removedCallback:null},this.config={},this.currentLocale=null,this.libraryBasePath="",this.baseUrl="",this.isIE11=!!window.MSInputMethodContext&&!!document.documentMode}return Object(m["a"])(e,[{key:"setInitialized",value:function(e){this.initialized=e}},{key:"isInitialized",value:function(){return this.initialized}},{key:"loadLibraries",value:function(e,t,i){this.libs||(this.libs={});for(var n=[],r=0;r<e.length;r++){var a=e[r];""===this.libraryBasePath||t||(a=this.libraryBasePath+a),this.libs[a]?n.push(this.libs[a]):(this.libs[a]=new Promise(function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=a,n.defer=!1,n.async=!1,n.onload=e,n.onerror=t,i&&(/\.es6\.js$/.test(a)?n.type="module":n.noModule=!0),document.head.appendChild(n)}),n.push(this.libs[a]))}return Promise.all(n)}},{key:"addElementsToMapContainer",value:function(){var e=document.createElement("div");e.setAttribute("id","balloonContainer"),e.classList.add("mapElement"),e.classList.add("vcm-map-top");var t=document.createElement("div");t.setAttribute("id","vcmui"),this.mapcontainer.appendChild(e),this.mapcontainer.appendChild(t),this.mapcontainer.classList.add("vcs_map_container"),this.mapcontainer.classList.add("vcm-font-default")}},{key:"getConfig",value:function(e){var t=this.config;if(e)for(var i=e.split("."),n=0;n<i.length;n+=1){var r=i[n];if("undefined"===typeof t[r])return{};t=t[r]}return t}},{key:"handleUiPlugins",value:function(e){e&&e.plugins&&Object.keys(e.plugins).forEach(function(t){var i=this,n=e.plugins[t],r=n._entry||"plugins/".concat(t,"/").concat(t,".js");if("_dev"!==r){var a=[r],s=n._esmodule;s&&a.unshift(r.replace(/\.js$/,".es6.js")),this.loadLibraries(a,null,s).then(function(){i.logger.info("Loaded Plugin: ".concat(t))}).catch(function(){i.logger.warning("Could not find JS file for ui plugin ".concat(t)),delete e.plugins[t]})}},this)}},{key:"getI18nConfig",value:function(){return{availableLocales:this.config.availableLocales,locale:this.config.locale,i18n:this.config.i18n}}},{key:"addStyle",value:function(e){this.styles[e.name]=e}},{key:"getStyleByName",value:function(e){return o(e,String),this.styles[e]}},{key:"getStyles",value:function(){return this.styles}},{key:"addFlight",value:function(e){o(e.name,String),this.flights[e.name]=e}},{key:"getFlightByName",value:function(e){return o(e,String),this.flights[e]}},{key:"getFlights",value:function(){return Object.values(this.flights)}},{key:"getLogger",value:function(){return this.logger}},{key:"getActiveMap",value:function(){return this.activemap}},{key:"addMap",value:function(e){return this.maps[e.name]?(this.logger.warning("The map ".concat(e.name," already exist.")),!1):(this.maps[e.name]=e,!0)}},{key:"getMapByName",value:function(e){return this.maps[e]||null}},{key:"getMapByType",value:function(e){return Object.values(this.maps).find(function(t){return t.className===e})}},{key:"activateMap",value:function(e,t){var i=this,n=this.getMapByType(e);n||(n=this.getMapByName(e));var r=this.activemap?this.activemap.className:null,a=n?n.className:null;if("vcs.vcm.maps.Cesium"===r&&"vcs.vcm.maps.Openlayers"===a){var s=this.activemap.getViewPoint();s&&(n.fixedNorthOrientation&&s.setHeading(0),s.setPitch(-90),s.setAnimate(!0),s.getGroundPosition()&&s.setCameraPosition(null),this.activemap.gotoViewPoint(s,1,null,function(){var e={listener:null};e.listener=i.activemap.getScene().postRender.addEventListener(function(){e.listener&&e.listener(),i._activateMapHandler(n,t)})}))}else this._activateMapHandler(n,t)}},{key:"_synchronizeLayers",value:function(){var e=this;Object.values(this.layers).forEach(function(t){t.isSupported()&&(t.isInitialized()||!t.isActiveOnStartup()||t.isCommonLayer()||"vcs.vcm.layer.oblique.ObliqueLayer"===t.className?t.isCommonLayer()&&t.synchronizeImplementations(e.lastactivemap,e.activemap).then(function(){return t.activate(t.isActive())}):t.activate(!0))})}},{key:"_activateMapHandler",value:function(e,t){var i=this,n=e.name;if(e){var r=!1,a=t;if(a)if(this.activemap){if(this.activemap.name===n)return void this.activemap.gotoViewPoint(a);r=this.activemap.deactivate().then(function(){return i.lastactivemap=i.activemap,i.activemap=e,i.activemap.activate()})}else this.activemap=e,r=this.activemap.activate();else if(this.activemap){if(this.activemap.name===n)return;r=this.activemap.deactivate().then(function(t){return i.lastactivemap=i.activemap,i.activemap=e,a=t,i.activemap.activate()})}else this.activemap=e,r=this.activemap.activate();r?r.then(function(){e.active&&(i._synchronizeLayers(),a&&i.activemap.gotoViewPoint(a),i.publish(B.MAP_ACTIVATED,e))}).catch(function(e){i.logger.error(e.message)}):this.logger.error("could not activate map")}}},{key:"getMaps",value:function(){return Object.values(this.maps)}},{key:"createViewPointObject",value:function(e){var t=new V(e);this.addViewPoint(t)}},{key:"addViewPoint",value:function(e){this.viewpoints[e.name]=e}},{key:"getViewPointByName",value:function(e){for(var t in this.viewpoints)if(this.viewpoints.hasOwnProperty(t)&&this.viewpoints[t].name==e)return this.viewpoints[t];return null}},{key:"getViewPoints",value:function(){var e=[];for(var t in this.viewpoints)this.viewpoints.hasOwnProperty(t)&&e.push(this.viewpoints[t]);return e}},{key:"getStartViewPoint",value:function(){return this.startViewPoint}},{key:"addLayer",value:function(e){return this.layers[e.name]?(this.logger.warning("Could not add Layer with same name twice, make sure the LayerName is unique"),!1):(this.layers[e.name]=e,e.index=this.layerIndexCounter,this.layerIndexCounter+=1,this.getActiveMap()&&!e.isInitialized()&&e.isActiveOnStartup()&&e.activate(!0),!0)}},{key:"removeLayerByName",value:function(e){var t=this.getLayerByName(e);t&&(t.dispose(),this.removeLayer(t))}},{key:"removeLayer",value:function(e){this.layers[e.name]&&delete this.layers[e.name]}},{key:"getLayerByName",value:function(e){return this.layers[e]||null}},{key:"getLayers",value:function(){return Object.values(this.layers)}},{key:"addWidget",value:function(e){return this.widgets[e.name]?(this.logger.warning("Could not add Widget with same name twice, make sure the widgetname is unique"),!1):(this.widgets[e.name]=e,!0)}},{key:"getWidgetByName",value:function(e){return this.widgets[e]||null}},{key:"getWidgetsByType",value:function(e){return Object.values(this.widgets).filter(function(t){return t.className===e})}},{key:"getWidgets",value:function(){return Object.values(this.widgets)}},{key:"setStartViewPoint",value:function(e){this.startViewPoint=e}},{key:"getMapContainer",value:function(){return this.mapcontainer}},{key:"getWidgetByType",value:function(e){return Object.values(this.widgets).find(function(t){return t.className===e})}},{key:"subscribe",value:function(e,t,i){return this.pubsub.subscribe(e,t,i)}},{key:"subscribeOnce",value:function(e,t,i){return e?this.pubsub.subscribeOnce(e,t,i):null}},{key:"subscribeExclusive",value:function(e,t,i,n,r){o(e,[String,B]),o(t,Function),o(i,String),l(n,Function),this.setExclusive(i,n);var a=this.pubsub.subscribe(e,t,r);return this.exclusiveListener.listeners.push(a),a}},{key:"subscribeOnceExclusive",value:function(e,t,i,n,r){var a;o(e,[String,B]),o(t,Function),o(i,String),l(n,Function),this.setExclusive(i,n);var s=function(){this.exclusiveListener.listeners=this.exclusiveListener.listeners.filter(function(e){return e!==a}),0===this.exclusiveListener.listeners.length&&this.clearExclusive(),t.call.apply(t,[r].concat(Array.prototype.slice.call(arguments)))};return a=this.pubsub.subscribeOnce(e,s,this),this.exclusiveListener.listeners.push(a),a}},{key:"setExclusive",value:function(e,t){if(null!==this.exclusiveListener.id&&this.exclusiveListener.id!==e){this.exclusiveListener.removedCallback&&this.exclusiveListener.removedCallback();while(this.exclusiveListener.listeners.length>0)this.unsubscribeByKey(this.exclusiveListener.listeners.shift())}Q.getInstance().deactivateClickBehavior(),this.exclusiveListener.id=e,this.exclusiveListener.removedCallback=t}},{key:"clearExclusive",value:function(){Q.getInstance().activateClickBehavior(),this.exclusiveListener.id=null,this.exclusiveListener.removedCallback=null}},{key:"unsubscribe",value:function(e,t,i){this.pubsub.unsubscribe(e,t,i)}},{key:"unsubscribeByKey",value:function(e){var t=this.exclusiveListener.listeners.indexOf(e);t>-1&&(this.exclusiveListener.listeners.splice(t,1),0===this.exclusiveListener.listeners.length&&this.clearExclusive()),this.pubsub.unsubscribeByKey(e)}},{key:"publish",value:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.logger).debug.apply(t,["Published: ".concat(e)].concat(n)),this.pubsub.publish.apply(this.pubsub,arguments)}},{key:"getLocale",value:function(){return this.currentLocale}},{key:"getLocales",value:function(){return q.getInstance().getRegisteredLanguages()}},{key:"setLocale",value:function(e){this.currentLocale!==e&&(this.currentLocale=e,q.getInstance().setLocale(this.currentLocale))}},{key:"setProjection",value:function(e){this.projection=e}},{key:"getProjection",value:function(){return this.projection}},{key:"getSelectBehavior",value:function(){return Q.getInstance()}},{key:"getNextUniqueId",value:function(){return":".concat((ee++).toString(36))}},{key:"isMobile",value:function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}},{key:"dispose",value:function(){if(J){var t=e.getInstance();t.isInitialized()&&(Object.values(this.layers).forEach(function(e){return e.dispose()}),Object.values(this.maps).forEach(function(e){return e.dispose()}),Object.values(this.widgets).forEach(function(e){return e.dispose()}),this.widgets={},this.maps={},this.layers={},this.viewpoints={},this.startViewPoint=null,this.activemap=null,this.startingmap="",this.pubsub=new $,this.mapcontainer=null),J=void 0}}}],[{key:"activateLogging",value:function(){Y.enabled="info"}},{key:"getVersion",value:function(){return/VCM_VERSION/.test(e.VCM_VERSION)?"3.6.000-devel #12345":e.VCM_VERSION}},{key:"getInstance",value:function(){return J||(J=new e),J}},{key:"VCM_VERSION",get:function(){return"3.6.339-stable #217f884"}},{key:"configContentSymbol",get:function(){return te}}]),e}(),ne=ie,re=null,ae=function(){function e(){Object(d["a"])(this,e),this.layers={},this.framework=ne.getInstance(),this.framework.subscribe(B.LAYER_ACTIVATED,this.handleLayerActivated,this)}return Object(m["a"])(e,[{key:"handleLayerActivated",value:function(e){if(e.isExclusive()){var t=null;for(var i in this.layers)if(this.layers.hasOwnProperty(i))for(var n=0;n<this.layers[i].length;n++)this.layers[i][n]==e&&(t=i);if(t)for(n=0;n<this.layers[t].length;n++)this.layers[t][n]!=e&&this.layers[t][n].isActive()&&this.layers[t][n].activate(!1)}}}],[{key:"getInstance",value:function(){return re||(re=new e),re}},{key:"registerLayer",value:function(t){if(t.isExclusive()){var i=e.getInstance(),n=t.getExclusiveGroup();n&&(i.layers[n]||(i.layers[n]=[]),i.layers[n].includes(t)||i.layers[n].push(t))}}}]),e}(),se=ae,oe=(i(112),i(6)),le=i(9),ce=i.n(le),ue=1,he=function(){function e(){Object(d["a"])(this,e)}return Object(m["a"])(e,null,[{key:"getNextBit",value:function(e){return e<<1}},{key:"interactionTypeCounter",get:function(){return ue}}]),e}(),de={NONE:ue=he.getNextBit(ue),ALT:ue=he.getNextBit(ue),CTRL:ue=he.getNextBit(ue),SHIFT:ue=he.getNextBit(ue),ALL:0};de.ALL=de.NONE|de.ALT|de.CTRL|de.SHIFT;var me={NONE:0,CLICK:ue=he.getNextBit(ue),DBLCLICK:ue=he.getNextBit(ue),DRAG:ue=he.getNextBit(ue),DRAGSTART:ue=he.getNextBit(ue),DRAGEND:ue=he.getNextBit(ue),MOVE:ue=he.getNextBit(ue),DRAGEVENTS:0,CLICKMOVE:0,ALL:0};me.DRAGEVENTS=me.DRAG|me.DRAGEND|me.DRAGSTART,me.CLICKMOVE=me.CLICK|me.MOVE,me.ALL=Object.values(me).reduce(function(e,t){return e|t},0);var fe={LEFT:ue=he.getNextBit(ue),RIGHT:ue=he.getNextBit(ue),MIDDLE:ue=he.getNextBit(ue),ALL:0};fe.ALL=fe.LEFT|fe.RIGHT|fe.CENTER;var ye=0;function ge(){return ye+=1,ye}var ve=function(){function e(){Object(d["a"])(this,e),this.id=ge(),this._defaultActive=me.NONE,this.active=this._defaultActive,this._defaultModificationKey=de.NONE,this.modificationKey=this._defaultModificationKey,this._defaultPointerKey=fe.LEFT,this.pointerKey=this._defaultPointerKey}return Object(m["a"])(e,[{key:"initialize",value:function(){this.handleMapChange(ne.getInstance().getActiveMap())}},{key:"handleMapChange",value:function(e){}},{key:"pipe",value:function(e){return this.pipeThrough(e)}},{key:"pipeThrough",value:function(e){return Promise.resolve(e)}},{key:"setActive",value:function(e){"undefined"===typeof e?(this.active=this._defaultActive,this.modificationKey=this._defaultModificationKey,this.pointerKey=this._defaultPointerKey):this.active="boolean"===typeof e?e?this._defaultActive:me.NONE:e}},{key:"setModification",value:function(e){this.modificationKey=e||this._defaultModificationKey}},{key:"setPointer",value:function(e){this.pointerKey=e||this._defaultPointerKey}}]),e}(),pe=ve,_e=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.chain=e||[],i._defaultActive=me.ALL,i._defaultModificationKey=de.ALL,i._defaultPointerKey=fe.ALL,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"addInteraction",value:function(e,t){null!=t?this.chain.splice(t,0,e):this.chain.push(e)}},{key:"removeInteraction",value:function(e){var t=this.chain.findIndex(function(t){return t.id===e.id});return t>-1&&this.chain.splice(t,1),t}},{key:"initialize",value:function(){this.chain.forEach(function(e){e.initialize()})}},{key:"handleMapChange",value:function(e){this.chain.forEach(function(t){t.handleMapChange(e)})}},{key:"pipe",value:function(e){for(var t=Promise.resolve(e),i=this.chain.length,n=0;n<i;n++){var r=this.chain[n];r.active&e.type&&r.modificationKey&e.key&&r.pointerKey&e.pointer&&(t=t.then(function(e){return e.stopPropagation?Promise.resolve(e):this.pipe(e)}.bind(r)))}return t}},{key:"setModification",value:function(){this.modificationKey=this._defaultModificationKey}},{key:"setPointer",value:function(){this.pointerKey=this._defaultPointerKey}}]),t}(pe),be=_e,Le=i(344),Me=i.n(Le),ke=i(644),we=i.n(ke);function Te(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=b(e),null===e)break;return e}function Se(e,t,i){return Se="undefined"!==typeof Reflect&&we.a?we.a:function(e,t,i){var n=Te(e,t);if(n){var r=Me()(n,t);return r.get?r.get.call(i):r.value}},Se(e,t,i||e)}B.MAP_ACTIVATED="MAP_ACTIVATED",B.MAP_CLICKED="MAP_CLICKED",B.CLICKED="CLICKED",B.CLICKED_FIRST_HIT="CLICKED_FIRST_HIT",B.FEATURE_CLICKED="FEATURE_CLICKED",B.FEATURE_CTRL_CLICKED="FEATURE_CTRL_CLICKED",B.CLUSTER_CLICKED="CLUSTER_CLICKED";var Oe={},Ce=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.mapElement=document.createElement("div"),i.mapElement.setAttribute("id",Object(u["c"])()),i.framework.getMapContainer().appendChild(i.mapElement),i.mapElement.classList.add("mapElement"),i.mapElement.classList.add("vcm-map-top"),i.hide(),i.supportedlayers=[],i.active=!1,i.initialized=!1,i.layerState={},i.layerStateObject={state:!1},i.class_map_loading="vcm_map_loading",i.movementDisabled=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"specificLayerImpl",get:function(){return Oe}}]),Object(m["a"])(t,[{key:"isSupported",value:function(){return!0}},{key:"isInitialized",value:function(){return this.initialized}},{key:"raiseClickEvent",value:function(e,t,i,n,r){if(t&&i&&null!=n){var a={longitude:t,latitude:i,height:n};r&&(a.obliqueParameters=r),this.framework.publish(e,a)}}},{key:"raiseClickedFirstHitEvent",value:function(e){e.latitude&&e.longitude&&e.height&&this.framework.publish(B.CLICKED_FIRST_HIT,e)}},{key:"isActive",value:function(){return this.active}},{key:"setLayerLoading",value:function(e,t){this.layerState[e.name]=t,this.layerStateObject.state=Object.values(this.layerState).some(function(e){return e})}},{key:"activate",value:function(e){return Promise.resolve()}},{key:"deactivate",value:function(){this.active=!1;var e=this.getViewPoint();return this.hide(),Promise.resolve(e)}},{key:"show",value:function(){if(null!==this.mapElement){this.mapElement.style.display="";var e=this.className.substr(this.className.lastIndexOf(".")+1,this.className.length);this.framework.getMapContainer().classList.add(e)}}},{key:"hide",value:function(){if(null!==this.mapElement){this.mapElement.style.display="none";var e=this.className.substr(this.className.lastIndexOf(".")+1,this.className.length);this.framework.getMapContainer().classList.remove(e)}}},{key:"supportsLayer",value:function(e){if(null!=e)for(var t=e.getType(),i=0;i<this.supportedlayers.length;i++)if(this.supportedlayers[i]==t)return!0;return!1}},{key:"disableMovement",value:function(e){this.movementDisabled=e}},{key:"gotoViewPoint",value:function(e,t,i,n){}},{key:"getViewPoint",value:function(e,t){throw new Error}},{key:"dispose",value:function(){this.mapElement.parentElement.removeChild(this.mapElement),this.mapElement=null}},{key:"pointIsVisible",value:function(e){throw new Error}},{key:"handleURLParameter",value:function(e){}},{key:"requestRender",value:function(){}},{key:"activateMouseClickEvents",value:function(e){return e}},{key:"getActiveMouseClickEvents",value:function(){return!1}}],[{key:"registerSpecificLayerImpl",value:function(e,i,n){t.specificLayerImpl[e]||(t.specificLayerImpl[e]={}),t.specificLayerImpl[e][i]=n}},{key:"createSpecificLayerImpl",value:function(e,i){return t.specificLayerImpl[e.className][i.className]?new t.specificLayerImpl[e.className][i.className](i.options):null}}]),t}(A),Ee=Ce,Ie=(i(166),i(165),i(353),i(14)),De=(i(153),null),je=function(){function e(){Object(d["a"])(this,e),this.className="vcs.vcm.NavigationMode",this.logger=Y.getLogger(this.className),this.timeLastTick=null,this.lookFactor=.05,this.moveFactor=1,this.framework=ne.getInstance(),this.allowHeightChanges=!1,this.useAbsoluteHeight=!1,this.referenceHeight=1.6,this.navActive=!1,this.initialized=!1,this.clockListenerRemover=null,this.boundClockTickHandler=this.clockOnTickHandler.bind(this),this.values={referenceHeight:this.referenceHeight,active:!1,walkmode:!1},this.flags={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1,increaseFOV:!1,decreaseFOV:!1,rotation:!1,tiltUp:!1,tiltDown:!1,rotateEast:!1,rotateWest:!1},this.heading=null,this.defaultFOV=null}return Object(m["a"])(e,[{key:"setOptions",value:function(e){this.referenceHeight=e.referenceHeight||this.referenceHeight,this.moveFactor=e.moveFactor||this.moveFactor}},{key:"getLink",value:function(e){var t=this.framework.getActiveMap();this.navActive&&"vcs.vcm.maps.Cesium"===t.className&&e.addQueryParams({nav_uah:this.useAbsoluteHeight,nav_ahc:this.allowHeightChanges,nav_rh:this.referenceHeight})}},{key:"handleURLParameter",value:function(e){e.nav_rh&&(this.referenceHeight=e.nav_rh,this.values.referenceHeight=this.referenceHeight,this.activateFirstPersonMode(null,null,null,e.nav_ahc,e.nav_uah))}},{key:"isActive",value:function(){return this.logger.deprecate("isActive","access the navActive property directly"),this.navActive}},{key:"setFlags",value:function(e){var t=this;Object.entries(e).forEach(function(e){var i=Object(Ie["a"])(e,2),n=i[0],r=i[1];null!=t.flags[n]&&(t.flags[n]=r)})}},{key:"setFlag",value:function(e,t){this.flags[e]=t}},{key:"activateFirstPersonMode",value:function(e,t,i,n,r){var a=this,s=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===s.className){if(this.activateOverviewControls(!1),this.useAbsoluteHeight=r||!1,this.allowHeightChanges="boolean"===typeof n?n:this.allowHeightChanges,e){e.animate=!0;var o=t||null,l=i||null;this.navActive=!1,s.gotoViewPoint(e,o,l,function(){a.navActive=!0,a.activateFirstPersonControls(!0)})}else this.navActive=!0,this.activateFirstPersonControls(!0);Object.keys(this.flags).forEach(function(e){a.flags[e]=!1}),this.values.walkmode=!0}else this.logger.warning("First person mode only available on Cesium (3D) map")}},{key:"activateOverviewMode",value:function(e,t,i){var n=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===n.className)if(this.useAbsoluteHeight=!1,this.values.referenceHeight=1.6,this.navActive=!1,this.values.walkmode=!1,this.activateFirstPersonControls(!1),e){var r=t||null,a=i||null;n.gotoViewPoint(e,r,a,this.activateOverviewControls.bind(this,!0))}else this.activateOverviewControls(!0);else this.logger.warning("First person mode only available on Cesium (3D) map")}},{key:"activateFirstPersonControls",value:function(e){var t=this;if(e&&this.navActive)if(this.initializeCesium()){var i=this.cesiumMap.getViewPoint(!1),n=this.cesiumScene.globe.getHeight(Cesium.Cartographic.fromDegrees(i.cameraPosition[0],i.cameraPosition[1]));this.useAbsoluteHeight&&(this.values.referenceHeight=i.getCameraPosition()[2]-n),this.correctCurrentHeight(n),this.cesiumHandler.setInputAction(function(e){t.flags.looking=!0,t.startMousePosition=Cesium.Cartesian3.clone(e.position),t.mousePosition=t.startMousePosition},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.cesiumHandler.setInputAction(function(e){t.mousePosition=e.endPosition},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.cesiumHandler.setInputAction(function(){t.flags.looking=!1},Cesium.ScreenSpaceEventType.LEFT_UP),this.clockListenerRemover&&this.clockListenerRemover(),this.clockListenerRemover=this.cesiumViewer.clock.onTick.addEventListener(this.boundClockTickHandler)}else this.logger.warning("Could not initialize, is Cesium active");else this.initialized&&(null!==this.defaultFOV&&(this.cesiumViewer.camera.frustum.fov=this.defaultFOV),this.clockListenerRemover&&this.clockListenerRemover(),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE))}},{key:"initializeCesium",value:function(){return!!this.initialized||(this.cesiumMap=this.framework.getMapByType("vcs.vcm.maps.Cesium"),this.cesiumMap&&(this.cesiumViewer=this.cesiumMap.viewer,this.defaultFOV=this.cesiumViewer.camera.frustum.fov,this.cesiumScene=this.cesiumMap.getScene(),this.cesiumCanvas=this.cesiumScene.canvas,this.cesiumCanvas.setAttribute("tabindex","0"),this.cesiumCanvas.onclick=function(){this.cesiumCanvas.focus()}.bind(this),this.cesiumHandler=new Cesium.ScreenSpaceEventHandler(this.cesiumCanvas),this.cesiumEllipsoid=this.cesiumScene.globe.ellipsoid,this.initialized=!0),!0)}},{key:"activateOverviewControls",value:function(e){this.initializeCesium()?(this.cesiumScene.screenSpaceCameraController.enableRotate=e,this.cesiumScene.screenSpaceCameraController.enableTranslate=e,this.cesiumScene.screenSpaceCameraController.enableZoom=e,this.cesiumScene.screenSpaceCameraController.enableTilt=e,this.cesiumScene.screenSpaceCameraController.enableLook=e):this.logger.warning("Could not initialize, is Cesium active")}},{key:"clockOnTickHandler",value:function(e){if(!this.cesiumMap.movementDisabled){var t=this.timeLastTick?e.currentTime.secondsOfDay-this.timeLastTick.secondsOfDay:1/60;(t<=0||t>1)&&(t=1/60);var i=t/(1/60);this.timeLastTick=e.currentTime;var n=this.cesiumViewer.camera,r=this.lookFactor*i;if(this.flags.increaseFOV&&(n.frustum.fov=n.frustum.fov+.01>=5*Math.PI/8?n.frustum.fov:n.frustum.fov+.01),this.flags.decreaseFOV&&(n.frustum.fov=n.frustum.fov-.01<=Math.PI/10?Math.PI/10:n.frustum.fov-.01),this.flags.looking){var a=this.cesiumCanvas.clientWidth,s=this.cesiumCanvas.clientHeight,o=(this.mousePosition.x-this.startMousePosition.x)/a,l=-(this.mousePosition.y-this.startMousePosition.y)/s;n.look(n.position,r*o),n.lookUp(l*r)}if(this.flags.rotation&&n.look(n.position,r/10),this.flags.tiltUp&&n.lookUp(r/10),this.flags.tiltDown&&n.lookUp(-r/10),this.flags.rotateEast&&n.look(n.position,r/10),this.flags.rotateWest&&n.look(n.position,-r/10),null!==this.heading){var c=Cesium.Math.toRadians(this.heading)-n.heading;n.look(n.position,c),this.heading=null}var u=this.cesiumEllipsoid.cartesianToCartographic(n.position).height,h=this.cesiumScene.globe.getHeight(this.cesiumEllipsoid.cartesianToCartographic(n.position));h&&!this.useAbsoluteHeight||(h=u-this.referenceHeight);var d=(u-h)/30*i*this.moveFactor,m={heading:n.heading,pitch:n.pitch,roll:0},f=Cesium.Math.PI/2-.1;m.pitch>f&&(m.pitch=f),n.setView({orientation:{heading:n.heading,pitch:0,roll:0}}),this.flags.moveForward&&n.moveForward(d),this.flags.moveBackward&&n.moveBackward(d),this.flags.moveUp&&(this.referenceHeight+=d/2,this.values.referenceHeight=Number(this.referenceHeight.toFixed(2))),this.flags.moveDown&&(this.referenceHeight-=d/2,this.referenceHeight<1&&(this.referenceHeight=1),this.values.referenceHeight=Number(this.referenceHeight.toFixed(2))),this.flags.moveLeft&&n.moveLeft(d),this.flags.moveRight&&n.moveRight(d),this.correctCurrentHeight(h,m)}}},{key:"correctCurrentHeight",value:function(e,t){var i,n=this.cesiumViewer.camera,r=t||{heading:n.heading,pitch:n.pitch,roll:0};if(null==e||this.allowHeightChanges)n.setView({orientation:r});else{var a=n.positionCartographic,s=Number.parseFloat(this.values.referenceHeight.toString());Number.isNaN(s)||s.toFixed(2)===this.referenceHeight.toFixed(2)||(this.referenceHeight=s),this.values.referenceHeight=Number(this.referenceHeight.toFixed(2)),a.height=e+this.referenceHeight,i=Cesium.Cartesian3.fromRadians(a.longitude,a.latitude,a.height),n.setView({destination:i,orientation:r})}}},{key:"setValues",value:function(e){o(e,{referenceHeight:Number,active:Boolean,walkmode:Boolean},!1),this.values=e}},{key:"setHeading",value:function(e){this.logger.deprecate("setHeading","set the heading property instead"),this.heading=e}}],[{key:"getInstance",value:function(){return De||(De=new e),De}},{key:"dispose",value:function(){De=null}}]),e}(),Pe=je,Ye=Y.getLogger("vcs.vcm.util.Extent"),xe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d["a"])(this,e),this.projection=new R(t),this.extent=t.coordinates||this.projection.getProjection().getExtent()}return Object(m["a"])(e,[{key:"getInputCoordinates",value:function(){return Ye.deprecate("getInputCoordinates","access the .extent property directly"),this.extent}},{key:"getProjection",value:function(){return Ye.deprecate("getProjection","access the .projection property directly"),this.projection}},{key:"getCoordinatesInProjection",value:function(e,t){if(e.epsg===this.projection.epsg){var i=t?t.splice.apply(t,[0,4].concat(Object(T["a"])(this.extent))):this.extent.slice();return i}var n=R.getTransformer(e,this.projection),r=t||[];return n(this.extent,r,2),r}},{key:"isValid",value:function(){return!(!this.extent||!Array.isArray(this.extent)||4!==this.extent.length)&&(!!(Number.isFinite(this.extent[0])&&Number.isFinite(this.extent[1])&&Number.isFinite(this.extent[2])&&Number.isFinite(this.extent[3]))&&(this.extent[0]<=this.extent[2]&&this.extent[1]<=this.extent[3]))}},{key:"getConfigObject",value:function(){return Object.assign({coordinates:this.extent.slice()},this.projection.getConfigObject())}},{key:"inputCoordinates",get:function(){return Ye.deprecate("inputCoordinates","use .extent instead"),this.extent},set:function(e){Ye.deprecate("inputCoordinates","use .extent instead"),this.extent=e}}],[{key:"WGS_84_EXTENT",get:function(){return[-180,-90,180,90]}}]),e}(),Ae=xe,Fe={VECTOR:"vector",DECLARATIVE:"declarative",REFERENCE:"reference"},Ne=function(){function e(t){Object(d["a"])(this,e),this.className=t.className||"vcs.vcm.util.style.StyleItem",this.name=t.name||t.id||Object(u["c"])(),this.title=t.title||{en:this.name},this.legend=t.legend||[],this.supportedLayers=[],this.cesiumStyle=new Cesium.Cesium3DTileStyle({show:!0}),this.styleChanged=new Cesium.Event,this.colorBlendMode=Object(u["f"])(t.colorBlendMode,Cesium.Cesium3DTileColorBlendMode,Cesium.Cesium3DTileColorBlendMode.HIGHLIGHT),this.style=null}return Object(m["a"])(e,[{key:"isSupported",value:function(e){return 0===this.supportedLayers.length||this.supportedLayers.indexOf(e)>-1}},{key:"getOptions",value:function(e){return e&&e.meta?{name:this.name.toString(),title:this.title,legend:this.legend.length?this.legend:void 0}:{}}},{key:"clone",value:function(e){return e}},{key:"assign",value:function(e){return e}},{key:"getReference",value:function(){return{type:Fe.REFERENCE,name:this.name}}},{key:"_styleChanged",value:function(){this.styleChanged.raiseEvent()}}]),e}(),He=Ne,Re=Y.getLogger("vcs.vcm.util.style.StyleHelpers"),ze={NWSE:1,SWNE:2,DIAGONALCROSS:3,NS:4,WE:5,CROSS:6};function Ge(e,t){var i=e.substring(1);return 3===i.length&&(i=i.replace(/([\w\d])/g,"$1$1")),[parseInt(i.substring(0,2),16),parseInt(i.substring(2,4),16),parseInt(i.substring(4,6),16),null!=t?t:1]}function Ve(e){var t=e.toBytes();return t[3]/=255,t}function Be(e){if(Array.isArray(e))return 3===e.length&&e.push(1),e;if("string"===typeof e){if(/^#/.test(e))return Ge(e);if(/^rgba?\((\d+(,\s?)?){3}((0|1)(\.\d+)?)?\)/.test(e)){var t=e.replace(/^rgba?\(([\s\S]+?)\)/,"$1").replace(/\s/,"").split(",").map(function(e){return Number(e)});return 3===t.length&&t.push(1),t}}if(e instanceof CanvasPattern)return[255,255,255,.4];throw new Error("Cannot parse color ".concat(e))}function Ue(e){return"rgba(".concat(Be(e).join(","),")")}function We(e,t){var i=ol.has.DEVICE_PIXEL_RATIO,n=t||document.createElement("canvas");t&&n.width||(n.width=(e.pattern.size||10)*i,n.height=(e.pattern.size||10)*i);var r=n.getContext("2d"),a=n.width;function s(t,i){r.strokeStyle=Ue(e.pattern.color),r.lineWidth=e.pattern.width,r.lineCap="square",r.beginPath(),r.moveTo(t[0],t[1]),r.lineTo(i[0],i[1]),r.stroke()}switch(r.fillStyle=Ue(e.color),r.fillRect(0,0,a,a),e.pattern.type){case 1:s([a/2,a],[a,a/2]),s([0,a/2],[a/2,0]);break;case 2:s([a/2,a],[0,a/2]),s([a,a/2],[a/2,0]);break;case 3:s([a/2,a],[a,a/2]),s([0,a/2],[a/2,0]),s([a/2,a],[0,a/2]),s([a,a/2],[a/2,0]);break;case 4:s([a/2,0],[a/2,a]);break;case 5:s([0,a/2],[a,a/2]);break;case 6:s([a/2,0],[a/2,a]),s([0,a/2],[a,a/2]);break;default:return null}return r.createPattern(n,"repeat")}function qe(e){function t(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t}return e.slice(0,3).reduce(function(e,i){return"".concat(e).concat(t(i))},"#")}function Je(e){return/^#[0-9a-f]{6}$/.test(e)}function Ke(e){if("string"!==typeof e)return e;var t=null,i=null,n="normal",r="normal",a="normal",s="normal";return e.split(/\s+/).forEach(function(e){switch(e){case"normal":break;case"italic":case"oblique":n=e;break;case"small-caps":a=e;break;case"bold":case"bolder":case"lighter":case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":r=e;break;default:if(!i){var o=e.split("/");i=o[0],o.length>1&&(s=o[1]);break}t=t?"".concat(t," ").concat(e):e;break}}),{fontStyle:n,fontVariant:a,fontWeight:r,fontSize:i,lineHeight:s,fontFamily:t}}function Ze(e){var t=["fontStyle","fontVariant","fontWeight","fontSize","fontFamily"],i=null;return Object.entries(e).filter(function(e){return"normal"!==e[1]&&"lineWeight"!==e[0]}).sort(function(e,i){var n=t.indexOf(e[0]),r=t.indexOf(i[0]);return n<r?-1:n>r?1:0}).forEach(function(e){i=i?"".concat(i," ").concat(e[1]):e[1]}),i||""}function Qe(e,t,i,n){for(var r=n||[0,0],a=e.getImageData(r[0],r[1],i[0],i[1]),s=a.data,o=Object(Ie["a"])(t,3),l=o[0],c=o[1],u=o[2],h=s.length,d=0;d<h;d+=4)s[d]=l,s[d+1]=c,s[d+2]=u;e.putImageData(a,r[0],r[1])}function Xe(e){if(e.getFill()){var t=e.getFill().getColor();try{t=Be(t).slice()}catch(i){Re.warning(i.message)}return{color:t}}}function $e(e){var t=e.getColor();if(t)try{t=Be(t).slice()}catch(i){Re.warning(i.message)}return{color:t,width:e.getWidth(),lineDash:e.getLineDash()}}function et(e){return{font:e.getFont(),fill:Xe(e),stroke:e.getStroke()?$e(e.getStroke()):void 0,textBaseline:e.getTextBaseline(),offsetY:e.getOffsetY(),offsetX:e.getOffsetX()}}function tt(e){var t=Object.assign({},e);return!t.fill||t.fill instanceof ol.style.Fill||(t.fill=new ol.style.Fill(t.fill)),!t.stroke||t.stroke instanceof ol.style.Stroke||(t.stroke=new ol.style.Stroke(t.stroke)),t.font&&"string"!==typeof t.font&&(t.font=Ze(t.font)),new ol.style.Text(t)}var it=new ol.style.Style({}),nt=[255,255,255,1],rt=[0,0,0,1],at={image:{fill:{color:[255,255,255,.4]},stroke:{color:rt,width:1},radius:5},stroke:{color:[51,153,204,1],width:1.25},fill:{color:[255,255,255,.4]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0}},st={olcs_color:Ue(nt),olcs_scale:"1.0",olcs_outlineWidth:"0.0",olcs_outlineColor:Ue(rt),olcs_pointSize:"8.0",olcs_image:void 0,olcs_font:"'".concat(at.text.font,"'"),olcs_fontColor:Ue(rt),olcs_fontOutlineWidth:"1.0",olcs_fontOutlineColor:Ue(nt),olcs_labelText:void 0,olcs_anchorLineColor:Ue(nt)};function ot(e,t){var i="Boolean(${".concat(e,"})===true"),n=t?"color(${".concat(e,"})"):"${".concat(e,"}");return[[i,n],["true",st[e]]]}function lt(e){return!e.fill||e.fill instanceof ol.style.Fill||(e.fill=new ol.style.Fill(e.fill)),!e.stroke||e.stroke instanceof ol.style.Stroke||(e.stroke=new ol.style.Stroke(e.stroke)),e.points?new ol.style.RegularShape(e):new ol.style.Circle(e)}var ct=function(){function e(){Object(d["a"])(this,e),this.shapes=[]}return Object(m["a"])(e,[{key:"addImage",value:function(e){var t=lt(Object.assign({},e)),i=t.getImage(1);e.src=i.toDataURL(),this.shapes.push(e)}}]),e}(),ut=new ct,ht={fill:new ol.style.Fill({color:[255,255,255,1]}),stroke:new ol.style.Stroke({color:[0,0,0,1],width:1}),radius:16};[null,{points:3},{points:3,angle:Math.PI},{points:4,angle:Math.PI/4},{points:6}].forEach(function(e){var t=e?Object.assign(e,ht):ht;ut.addImage(t)});var dt={POLYGON:1,POLYLINE:2,POINT:3},mt=Y.getLogger("vcs.vcm.util.style.StyleItem"),ft=Symbol("VcsVectorStyleItem"),yt=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),t.validateOptions(e),i.exclude={fill:!1===e.fill,stroke:!1===e.stroke,image:!1===e.image},i._fillOptions=null,i._fill=void 0,i._stroke=e.stroke?new ol.style.Stroke(e.stroke):void 0,i._text=void 0,e.text&&(i._text=tt(e.text)),i._label=e.label,i._cesiumColor=new Cesium.Color,i._image=void 0,e.image&&(i._image=e.image.radius?lt(Object.assign({},e.image)):new ol.style.Icon(e.image)),i._style=new ol.style.Style({image:i._image,stroke:i._stroke,text:i._text}),e.fill?(i._fillOptions=e.fill,i._setFill()):i.updateCesiumStyle(),i}return w(t,e),Object(m["a"])(t,[{key:"_setFill",value:function(){if(this._style instanceof ol.style.Style){var e=this._fillOptions.pattern?We(this._fillOptions):this._fillOptions.color;this._fill?this._fill.setColor(e):(this._fill=new ol.style.Fill({color:e}),this._style.setFill(this._fill)),this._fillOptions.pattern&&(this._fill.fallBackColor=this._fillOptions.color),this.updateCesiumStyle()}}},{key:"updateCesiumStyle",value:function(){this.updateCesiumStyleColor(!0),this.updateCesiumStyleImage(!0),this.updateCesiumStyleText(!0),this._styleChanged()}},{key:"updateCesiumStyleColor",value:function(e){var t=ot("olcs_color",!0);this.stroke&&this.stroke.getColor()&&t.splice(1,0,["${olcs_geometryType}===".concat(dt.POLYLINE),Ue(this.stroke.getColor())]),this._image instanceof ol.style.Circle&&this._image.getFill()&&t.splice(1,0,["${olcs_geometryType}===".concat(dt.POINT),Ue(this._image.getFill().getColor())]),this.fillColor&&t.splice(-1,1,["true",Ue(this.fillColor)]),this.cesiumStyle.color={conditions:t},e||this._styleChanged()}},{key:"updateCesiumStyleImage",value:function(e){var t=ot("olcs_scale"),i=ot("olcs_outlineWidth"),n=ot("olcs_outlineColor",!0),r=ot("olcs_pointSize"),a=ot("olcs_image");if(this._image)if(null!=this._image.getScale()&&t.splice(1,1,["true","".concat(this._image.getScale())]),this._image instanceof ol.style.Circle){var s=this._image.getStroke(),o=2*this._image.getRadius();if(s){this._image.getStroke().getColor()&&n.splice(1,1,["true",Ue(this._image.getStroke().getColor())]);var l=this._image.getStroke().getWidth();i.splice(1,1,["true","".concat(l)]),o-=l}r.splice(1,1,["true","".concat(o)])}else if(this._image instanceof ol.style.RegularShape){var c=this._image.getImage(1).toDataURL();a.splice(1,1,["true",'"'.concat(c,'"')])}else this._image instanceof ol.style.Icon&&a.splice(1,1,["true",'"'.concat(this._image.getSrc(),'"')]);this.cesiumStyle.scale={conditions:t},this.cesiumStyle.pointOutlineWidth={conditions:i},this.cesiumStyle.pointOutlineColor={conditions:n},this.cesiumStyle.pointSize={conditions:r},this.cesiumStyle.image={conditions:a},this.cesiumStyle.verticalOrigin="1",this.cesiumStyle.horizontalOrigin="0",e||this._styleChanged()}},{key:"updateCesiumStyleText",value:function(e){var t=ot("olcs_font"),i=ot("olcs_labelText"),n=ot("olcs_fontColor",!0),r=ot("olcs_fontOutlineWidth"),a=ot("olcs_fontOutlineColor",!0);this._text&&(this._text.getFont()&&t.splice(1,1,["true","'".concat(this._text.getFont(),"'")]),this._text.getText()&&i.splice(1,1,["true","'".concat(this._text.getText(),"'")]),this._text.getFill()&&this._text.getFill().getColor()&&n.splice(1,1,["true",Ue(this._text.getFill().getColor())]),this._text.getStroke()&&this._text.getStroke().getColor()&&(a.splice(1,1,["true",Ue(this._text.getStroke().getColor())]),r.splice(1,1,["true","".concat(this._text.getStroke().getWidth()||1.25)]))),this.cesiumStyle.font={conditions:t},this.cesiumStyle.labelText={conditions:i},this.cesiumStyle.labelColor={conditions:n},this.cesiumStyle.labelOutlineWidth={conditions:r},this.cesiumStyle.labelOutlineColor={conditions:a},this.cesiumStyle.labelStyle="Boolean(${olcs_fontOutlineWidth}) === true ? 2 : 0",this.cesiumStyle.labelHorizontalOrigin="0",this.cesiumStyle.labelVerticalOrigin="1",e||this._styleChanged()}},{key:"clone",value:function(e){var i=this;return e?(e.style=this._style instanceof ol.style.Style?this._style.clone():this._style,this._fillOptions&&this._fillOptions.color&&(e.fillColor=this._fillOptions.color.slice(),this._fillOptions.pattern&&(e.pattern=Object.assign({},this._fillOptions.pattern))),Object.keys(this.exclude).forEach(function(t){i.exclude[t]&&e.unset(t)}),e):new t(this.getOptions())}},{key:"assign",value:function(e){var t=this;return e.fillColor&&(this.fillColor=e.fillColor.slice()),e.pattern?this.pattern=Object.assign({},e.pattern):this.pattern=void 0,e.stroke&&(this.stroke=e.stroke.clone()),e.image&&(this.image=e.image.clone()),e.text&&(this.text=e.text.clone()),e.label&&(this.label=e.label),Object.keys(e.exclude).forEach(function(i){e.exclude[i]&&t.unset(i)}),this}},{key:"getOptions",value:function(e){var i=Se(b(t.prototype),"getOptions",this).call(this,e);i.type=Fe.VECTOR;var n=e||{fill:!0,stroke:!0,text:!0,image:!0};return n.fill&&(this._fillOptions?(i.fill={color:Be(this._fillOptions.color).slice()},this._fillOptions.pattern&&(i.fill.pattern=Object.assign({},this._fillOptions.pattern))):this.exclude.fill&&(i.fill=!1)),n.stroke&&(this._stroke?i.stroke=$e(this._stroke):this.exclude.stroke&&(i.stroke=!1)),n.text&&this._text&&(i.text=et(this._text)),n.label&&(i.label=this._label),n.image&&(this._image instanceof ol.style.Icon?i.image={src:this._image.getSrc(),scale:this._image.getScale(),opacity:this._image.getOpacity()}:this._image instanceof ol.style.Circle?i.image={scale:this._image.getScale(),fill:Xe(this._image),radius:this._image.getRadius(),stroke:this._image.getStroke()?$e(this._image.getStroke()):void 0}:this._image instanceof ol.style.RegularShape?i.image={scale:this._image.getScale(),fill:Xe(this._image),points:this._image.getPoints(),angle:this._image.getAngle(),radius:this._image.getRadius(),stroke:this._image.getStroke()?$e(this._image.getStroke()):void 0}:this.exclude.image&&(i.image=!1)),i}},{key:"getOptionsForFeature",value:function(e){var t=e.getGeometry().getType(),i=e.get("olcs_extrudedHeight")||e.get("olcs_storeyHeight")&&e.get("olcs_storeyNumber"),n={};return"Point"===t||"MultiPoint"===t?(null!=e[ft].label&&(n.text=!0,n.label=!0),n.image=!0,i&&(n.stroke=!0)):"LineString"===t||"MultiLineString"===t?(n.stroke=!0,i&&(n.fill=!0)):"Polygon"===t||"MultiPolygon"===t||"Circle"===t?(n.stroke=!0,n.fill=!0):"GeometryCollection"===t&&(n.stroke=!0,n.fill=!0,n.image=!0,n.text=!0),this.getOptions(n)}},{key:"unset",value:function(e){o(e,Object.keys(this.exclude)),"fill"===e?this.fillColor=void 0:this[e]=void 0,this.exclude[e]=!0}},{key:"fillColor",get:function(){return this._fillOptions?this._fillOptions.color:null},set:function(e){this.exclude.fill=!1,this._style instanceof ol.style.Style?e?(this._fillOptions?this._fillOptions.color=Be(e):this._fillOptions={color:Be(e)},this._setFill()):(this._fillOptions=null,this._fill=void 0,this._style.setFill(this._fill),this.updateCesiumStyleColor(!0)):mt.info("trying to set fill on a style function")}},{key:"cesiumFillColor",get:function(){var e,t=this.fillColor?this.fillColor.slice():null;return t?(t[3]=t[3]||1,t[3]*=255,(e=Cesium.Color).fromBytes.apply(e,Object(T["a"])(t).concat([this._cesiumColor]))):Cesium.Color.RED.clone(this._cesiumColor)}},{key:"pattern",get:function(){return this._fillOptions&&this._fillOptions.pattern?this._fillOptions.pattern:null},set:function(e){this._fillOptions?(e?(l(e,{color:[String,[Number]],width:Number,type:Number,size:[Number,void 0,null]},!0),this._fillOptions.pattern=e):this._fillOptions.pattern=void 0,this._setFill()):mt.error("Missing fill color")}},{key:"stroke",get:function(){return this._stroke},set:function(e){this.exclude.stroke=!1,this._style instanceof ol.style.Style?(l(e,ol.style.Stroke),this._style.setStroke(e),this._stroke=e,this.updateCesiumStyleColor(!0)):mt.info("trying to set stroke on a style function")}},{key:"label",get:function(){return this._label},set:function(e){l(e,String),e.length?this._label=e:this._label=void 0,this._text&&this._text.setText(e)}},{key:"text",get:function(){return this._text},set:function(e){this._style instanceof ol.style.Style?(l(e,ol.style.Text),this._text=e,this._text.setText(this._label),this._style.setText(this._text)):mt.info("trying to set text on a style function")}},{key:"image",get:function(){return this._image},set:function(e){this.exclude.image=!1,this._style instanceof ol.style.Style?(l(e,ol.style.Image),this._image=e,this._style.setImage(this._image),this.updateCesiumStyle()):mt.info("trying to set text on a style function")}},{key:"style",get:function(){return this._style},set:function(e){l(e,[ol.style.Style,Function]),e instanceof ol.style.Style?(this._stroke=e.getStroke(),this._fill=e.getFill(),this._text=e.getText(),this._image=e.getImage()):(this._stroke=void 0,this._fill=void 0,this._text=void 0,this._image=void 0),this._style=e,this._fill&&this._fill.getColor()&&(this._fillOptions={color:Be(this._fill.getColor())}),this._text&&this._text.setText(this._label),this.updateCesiumStyle()}}],[{key:"validateOptions",value:function(e){function t(e){try{e.color=Be(e.color),o(e.color,[Number]),o(e.color.length,[3,4])}catch(t){mt.error(t.message),e.color=[255,255,255,.4]}}function i(e){t(e),e.width||(mt.error("missing width for stroke, setting to 1.5"),e.width=1.5)}e.fill&&(t(e.fill),e.fill.pattern&&(i(e.fill.pattern),e.fill.pattern.type&&Object.values(ze).includes(e.fill.pattern.type)||(mt.error("Cannot find pattern ".concat(e.fill.pattern.type)),e.fill.pattern.type=ze.NWSE))),e.stroke&&i(e.stroke),e.image&&(e.image.icon?e.image=e.image.icon:e.image.circle&&(e.image=e.image.circle),e.image.src||e.image.radius||(mt.error("missing source or label in style, setting default circle"),e.image={fill:{color:"rgba(255,255,255,0.4)"},stroke:{color:"#3399CC",width:1},radius:5}),e.image.radius&&(e.image.radius=Number(e.image.radius),Number.isFinite(e.image.radius)||(mt.error("radius must be a number"),e.image.radius=5),e.image.fill&&t(e.image.fill),e.image.stroke&&i(e.image.stroke)))}}]),t}(He),gt=yt,vt=new yt(at);function pt(e){var t=e.toBytes();return t[3]/=255,new yt({fill:{color:t},stroke:{color:t,width:vt.stroke.getWidth()}})}var _t=new Cesium.Color,bt=Y.getLogger("vcs.vcm.util.style.DeclarativeStyleItem"),Lt=new ol.style.Text({font:"30px sans-serif",fill:new ol.style.Fill({color:nt}),textAlign:"left",offsetY:-15});function Mt(e,t,i){i[t].conditions?e[t]=new Cesium.ConditionsExpression(i[t],i.defines):e[t]=new Cesium.Expression(i[t],i.defines)}var kt,wt=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e));var n=e.declarativeStyle||{};return n.show=null==n.show||n.show,i.cesiumStyle=new Cesium.Cesium3DTileStyle(n),i.style=i._styleFunction.bind(f(i)),n.strokeColor&&Mt(i.cesiumStyle,"strokeColor",n),n.strokeWidth&&Mt(i.cesiumStyle,"strokeWidth",n),i._styleOptions=n,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.style.DeclarativeStyleItem"}}]),Object(m["a"])(t,[{key:"getOptions",value:function(e){var i=Se(b(t.prototype),"getOptions",this).call(this,e);i.type=Fe.DECLARATIVE;var n=e||{declarativeStyle:!0,defaults:!0};return n.declarativeStyle&&(i.declarativeStyle=this.cesiumStyle.style),i}},{key:"clone",value:function(e){return e?e.assign(this):new t(this.getOptions())}},{key:"assign",value:function(e){return this.cesiumStyle=e.cesiumStyle,this._styleOptions=this.cesiumStyle.style,this}},{key:"_styleFunction",value:function(e){if(!this.cesiumStyle.show.evaluate(e))return it;var t=e.getGeometry().getType();return"Point"===t?this._stylePoint(e):"Polygon"===t?this._stylePolygon(e):"LineString"===t?this._styleLineString(e):"Circle"===t?this._stylePolygon(e):"MultiPoint"===t?this._stylePoint(e):"MultiPolygon"===t?this._stylePolygon(e):"MultiLineString"===t?this._styleLineString(e):(bt.warning("could not style geometry type: ".concat(t)),it)}},{key:"_stylePolygon",value:function(e){var t=new ol.style.Style({}),i=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;return i&&t.setFill(new ol.style.Fill({color:Ve(i)})),this._evaluateStroke(e,t),t}},{key:"_styleLineString",value:function(e){var t=new ol.style.Style({}),i=e.get("olcs_extrudedHeight")||e.get("olcs_storeyHeight")&&e.get("olcs_storeyNumber"),n=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;if(n)if(i)t.setFill(new ol.style.Fill({color:Ve(n)}));else{var r=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(e):1;t.setStroke(new ol.style.Stroke({width:Number.isFinite(r)?r:1,color:Ve(n)}))}return i&&this._evaluateStroke(e,t),t}},{key:"_stylePoint",value:function(e){var t=new ol.style.Style({});if(this.cesiumStyle.labelText){var i=this.cesiumStyle.labelText.evaluate(e);if(i){var n=Lt.clone();if(n.setText(i.toString()),this.cesiumStyle.font){var r=this.cesiumStyle.font.evaluate(e);r&&n.setFont(r)}if(this.cesiumStyle.labelColor){var a=this.cesiumStyle.labelColor.evaluateColor(e,_t);a&&n.getFill().setColor(Ve(a))}if(this.cesiumStyle.labelOutlineColor){var s=this.cesiumStyle.labelOutlineColor.evaluate(e,_t);if(s){var o=this.cesiumStyle.labelOutlineWidth?this.cesiumStyle.labelOutlineWidth.evaluate(e):1;n.setStroke(new ol.style.Stroke({color:Ve(s),width:o}))}}t.setText(n)}}if(this.cesiumStyle.image){var l=this.cesiumStyle.image.evaluate(e);l&&t.setImage(new ol.style.Icon({src:l}))}else{var c={radius:4},u=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;if(c.fill=new ol.style.Fill({color:Ve(u)}),this.cesiumStyle.pointSize){var h=this.cesiumStyle.pointSize.evaluate(e);c.radius=h/2}var d=this.cesiumStyle.pointOutlineWidth?this.cesiumStyle.pointOutlineWidth.evaluate(e):0;if(d){var m=this.cesiumStyle.pointOutlineColor?this.cesiumStyle.pointOutlineColor.evaluateColor(e,_t):Cesium.Color.BLACK;c.stroke=new ol.style.Stroke({color:Ve(m),width:d}),c.radius+=d/2}t.setImage(new ol.style.Circle(c))}if(this.cesiumStyle.scale&&t.getImage()){var f=this.cesiumStyle.scale.evaluate(e);Number.isFinite(f)&&t.getImage().setScale(f)}return this._evaluateStroke(e,t),t}},{key:"_evaluateStroke",value:function(e,t){if(this.cesiumStyle.strokeColor){var i=this.cesiumStyle.strokeColor.evaluateColor(e,_t);if(i){var n=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(e):1;t.setStroke(new ol.style.Stroke({width:Number.isFinite(n)?n:1,color:Ve(i)}))}}}},{key:"show",get:function(){return this._styleOptions.show},set:function(e){this._styleOptions.show=e,this.cesiumStyle.show=e,this._styleChanged()}},{key:"color",get:function(){return this._styleOptions.color},set:function(e){this._styleOptions.color=e,this.cesiumStyle.color=e,this._styleChanged()}},{key:"strokeColor",get:function(){return this._styleOptions.strokeColor},set:function(e){this._styleOptions.strokeColor=e,this.cesiumStyle.strokeColor=e,this._styleChanged()}},{key:"strokeWidth",get:function(){return this._styleOptions.strokeWidth},set:function(e){this._styleOptions.strokeWidth=e,this.cesiumStyle.strokeWidth=e,this._styleChanged()}},{key:"image",get:function(){return this._styleOptions.image},set:function(e){this._styleOptions.image=e,this.cesiumStyle.image=e,this._styleChanged()}},{key:"labelText",get:function(){return this._styleOptions.labelText},set:function(e){this._styleOptions.labelText=e,this.cesiumStyle.labelText=e,this._styleChanged()}},{key:"labelColor",get:function(){return this._styleOptions.labelColor},set:function(e){this._styleOptions.labelColor=e,this.cesiumStyle.labelColor=e,this._styleChanged()}},{key:"font",get:function(){return this._styleOptions.font},set:function(e){this._styleOptions.font=e,this.cesiumStyle.font=e,this._styleChanged()}},{key:"pointSize",get:function(){return this._styleOptions.pointSize},set:function(e){this._styleOptions.pointSize=e,this.cesiumStyle.pointSize=e,this._styleChanged()}}]),t}(He),Tt=wt,St=new wt({declarativeStyle:{show:!0,color:{conditions:ot("olcs_color",!0)},scale:{conditions:ot("olcs_scale")},pointOutlineWidth:{conditions:ot("olcs_outlineWidth")},pointOutlineColor:{conditions:ot("olcs_outlineColor",!0)},pointSize:{conditions:ot("olcs_pointSize")},image:{conditions:ot("olcs_image")},font:{conditions:ot("olcs_font")},labelStyle:"2",labelText:{conditions:ot("olcs_labelText")},labelColor:{conditions:ot("olcs_fontColor",!0)},labelOutlineWidth:{conditions:ot("olcs_fontOutlineWidth")},labelOutlineColor:{conditions:ot("olcs_fontOutlineColor",!0)},verticalOrigin:"1",horizontalOrigin:"0",labelHorizontalOrigin:"0",labelVerticalOrigin:"1"}}),Ot=function(){function e(){Object(d["a"])(this,e),this.hiddenObjects={},this.highlightedObjects={},this.lastUpdated=Date.now()}return Object(m["a"])(e,[{key:"highlight",value:function(e){var t=this,i=!1;Object.entries(e).forEach(function(e){var n=Object(Ie["a"])(e,2),r=n[0],a=n[1],s=a;a instanceof Cesium.Color?s=pt(a):a instanceof ol.style.Style&&(s=new gt({}),a.getText()&&a.getText().getText()&&(s.label=a.getText().getText()),s.style=a),s=s,t.highlightedObjects[r]?t.highlightedObjects[r].style.fillColor.some(function(e,t){return e!==s.fillColor[t]})&&(t.highlightedObjects[r].style=s,i=!0):(t.highlightedObjects[r]={style:s,features:new Map},i=!0)}),i&&(this.lastUpdated=Date.now())}},{key:"unHighlight",value:function(t){var i=this;t.forEach(function(t){i.highlightedObjects[t]&&(i.highlightedObjects[t].features.forEach(function(n,r){r instanceof Cesium.Cesium3DTileFeature||r instanceof Cesium.Cesium3DTilePointFeature?e.featureExists(r)&&(r.color=n):r instanceof ol.Feature&&(i.hiddenObjects[t]||r.setStyle(n))}),delete i.highlightedObjects[t])})}},{key:"clearHighlighting",value:function(){this.unHighlight(Object.keys(this.highlightedObjects))}},{key:"hideObjects",value:function(e){var t=this,i=!1;e.forEach(function(e){t.hiddenObjects[e]||(t.hiddenObjects[e]=new Set,i=!0)}),i&&this._update()}},{key:"showObjects",value:function(t){var i=this,n=!1;t.forEach(function(t){i.hiddenObjects[t]&&(n=!0,i.hiddenObjects[t].forEach(function(n){if(n instanceof Cesium.Cesium3DTileFeature||n instanceof Cesium.Cesium3DTilePointFeature)e.featureExists(n)&&(n.show=!0);else if(n instanceof ol.Feature)if(i.highlightedObjects[t]){if(!i.highlightedObjects[t].features.has(n)){var r=n[ft]?n[ft].style:void 0;i.highlightedObjects[t].features.set(n,r)}n.setStyle(i.highlightedObjects[t].style.style)}else n.setStyle(n[ft]?n[ft].style:void 0)}),delete i.hiddenObjects[t])}),n&&this._update()}},{key:"clearHiddenObjects",value:function(){this.showObjects(Object.keys(this.hiddenObjects))}},{key:"_update",value:function(){this.lastUpdated=Date.now();var e=ne.getInstance().getActiveMap();e&&e.requestRender()}}],[{key:"featureExists",value:function(e){return e&&e.content&&!e.content.isDestroyed()&&!e.content.batchTable.isDestroyed()}}]),e}(),Ct=Ot,Et=function(){function e(){Object(d["a"])(this,e),this.hiddenObjects={},this._hiddenObjectFeatures={},this.lastUpdated=Date.now()}return Object(m["a"])(e,[{key:"hideObjects",value:function(e){var t=this;o(e,[String]);var i=!1;e.forEach(function(e){t.hiddenObjects[e]||(i=!0,t.hiddenObjects[e]=0),t.hiddenObjects[e]+=1}),i&&this._update()}},{key:"showObjects",value:function(e){var t=this;o(e,[String]);var i=!1;e.forEach(function(e){t.hiddenObjects[e]&&(t.hiddenObjects[e]-=1,0===t.hiddenObjects[e]&&(i=!0,t._hiddenObjectFeatures[e]&&(t._hiddenObjectFeatures[e].forEach(function(e){e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature?Ct.featureExists(e)&&(e.show=!0):e instanceof ol.Feature&&e.setStyle(e[ft]?e[ft].style:void 0)}),t._hiddenObjectFeatures[e].clear()),delete t.hiddenObjects[e]))}),i&&this._update()}},{key:"addFeature",value:function(e,t){this._hiddenObjectFeatures[e]||(this._hiddenObjectFeatures[e]=new Set),this._hiddenObjectFeatures[e].add(t)}},{key:"hasFeature",value:function(e,t){return!!this._hiddenObjectFeatures[e]&&this._hiddenObjectFeatures[e].has(t)}},{key:"_update",value:function(){this.lastUpdated=Date.now();var e=ne.getInstance().getActiveMap();e&&e.requestRender()}}]),e}();function It(){return kt||(kt=new Et),kt}B.LAYER_CHANGED="LAYER_CHANGED",B.LAYER_ACTIVATED="LAYER_ACTIVATED",B.LAYER_DEACTIVATED="LAYER_DEACTIVATED";var Dt={lastLayerId:0},jt=Dt.lastLayerId++,Pt=Symbol("vcsLayerName"),Yt="1.0",xt=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.extent=new Ae(e.extent),i.activeOnStartup=!!e.activeOnStartup,i.active=!1,i.loading=!1,i.enabled=!0,i.initialized=!1,i.type=null!=e.layertype?e.layertype:Dt.UNDEFINED,i.data={},i.mapNames=e.mapNames||[],i.exclusive=!1,i.exclusiveGroup="",i.url=e.url,i.index=null,i.hiddenObjectIds=Array.isArray(e.hiddenObjectIds)?e.hiddenObjectIds:[],i.iconManagerInUse=!1,i.groupedWith=[];var n=e.exclusive||"false";return"true"===n||!0===n?(i.exclusive=!0,i.exclusiveGroup="default"):"false"===n||!1===n?(i.exclusive=!1,i.exclusiveGroup="default"):(i.exclusive=!0,i.exclusiveGroup=String(n)),i.exclusive&&se.registerLayer(f(i)),i.allowPicking=null==e.allowPicking||e.allowPicking,i.style=i.getStyleOrDefaultStyle(e.activeStyleName||e.style),i.defaultStyle=i.style,i.featureVisibility=null,i.globalHider=It(),i._genericFeatureProperties=e.genericFeatureProperties||{},i}return w(t,e),Object(m["a"])(t,null,[{key:"UNDEFINED",get:function(){return jt}},{key:"className",get:function(){return"vcs.vcm.layer.Layer"}},{key:"vcsLayerNameSymbol",get:function(){return Pt}}]),Object(m["a"])(t,[{key:"raiseFeatureEvent",value:function(e,t,i,n){this.framework.publish(e,t,i,n)}},{key:"objectClickedHandler",value:function(e,t,i){return!1}},{key:"getExtent",value:function(){return this.extent}},{key:"initialize",value:function(){throw new Error}},{key:"isExclusive",value:function(){return this.exclusive}},{key:"isIconManagerInUse",value:function(){return this.iconManagerInUse}},{key:"getExclusiveGroup",value:function(){return this.exclusiveGroup}},{key:"isInitialized",value:function(){return this.initialized}},{key:"getType",value:function(){return this.type}},{key:"isActiveOnStartup",value:function(){return this.activeOnStartup}},{key:"isSupported",value:function(e){var t=e||this.framework.getActiveMap();return!(!t||!(0===this.mapNames.length||this.mapNames.indexOf(t.name)>=0))&&t.supportsLayer(this)}},{key:"isActive",value:function(){return this.active}},{key:"activate",value:function(e){var t=function(){return this.show(),this.active=e,this.framework.publish(B.LAYER_ACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this),this.globalHider.hideObjects(this.hiddenObjectIds),Promise.resolve()}.bind(this),i=function(){return this.hide(),this.active=e,this.framework.publish(B.LAYER_DEACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this),this.globalHider.showObjects(this.hiddenObjectIds),Promise.resolve()}.bind(this);if(e!=this.isActive()){if(!e)return this.isInitialized()?i():Promise.reject();if(this.isSupported()){var n=this.initialize();return n?n.then(t,function(){return Promise.reject()}):t()}}return Promise.resolve()}},{key:"dispose",value:function(){}},{key:"show",value:function(){}},{key:"hide",value:function(){}},{key:"getGenericFeatureFromClickedObject",value:function(e){return this.logger.warning("This method should be implemented by any specific layers"),null}},{key:"addGenericFeatureProperties",value:function(e){o(e,Object),Object.assign(this._genericFeatureProperties,e)}},{key:"isCommonLayer",value:function(){return!1}},{key:"handleURLParameter",value:function(e){}},{key:"highlight",value:function(e){this.featureVisibility&&this.featureVisibility.highlight(e)}},{key:"unHighlight",value:function(e){this.featureVisibility&&this.featureVisibility.unHighlight(e)}},{key:"clearHighlighting",value:function(){this.featureVisibility&&this.featureVisibility.clearHighlighting()}},{key:"hideObjects",value:function(e){this.featureVisibility&&this.featureVisibility.hideObjects(e)}},{key:"showObjects",value:function(e){this.featureVisibility&&this.featureVisibility.showObjects(e)}},{key:"clearHiddenObjects",value:function(){this.featureVisibility&&this.featureVisibility.clearHiddenObjects()}},{key:"determineHighlightStyle",value:function(e,t){return null}},{key:"isPartOfAGroupLayer",value:function(){return this.groupedWith.length>0}},{key:"getStyleOrDefaultStyle",value:function(e,t){if("string"===typeof e){var i=this.framework.getStyleByName(e);if(i)return i;this.logger.warning("could not find style with name ".concat(e))}else{if(e&&e instanceof He)return e;if(e){if(e.type===Fe.DECLARATIVE||e.declarativeStyle)return new Tt(e);if(e.type!==Fe.REFERENCE){var n=new gt(e);return t?t.assign(n):n}var r=this.framework.getStyleByName(e.name);if(r)return r;this.logger.warning("could not find style with name ".concat(e.name))}}return t||St.clone()}},{key:"setStyle",value:function(e,t){if(o(e,[ol.style.Style,He,Function,String]),"string"===typeof e){var i=this.framework.getStyleByName(e);if(!i)return void this.logger.warning("could not find style with name ".concat(e));this.style=i}else e instanceof He?this.style=e:(this.style=new gt({}),this.style.style=e)}},{key:"clearStyle",value:function(){this.setStyle(this.defaultStyle)}}]),t}(A),At=xt,Ft={};function Nt(e){if(!Ft[e.url])return Ft[e.url]=new Cesium.CesiumTerrainProvider(e),Ft[e.url];var t=Ft[e.url];return!t.requestVertexNormals&&e.requestVertexNormals&&(Ft[e.url]=new Cesium.CesiumTerrainProvider(e),t=Ft[e.url]),t}function Ht(e,t,i){var n=i?R.getTransformer(R.createGeographicProjection(),i):null,r=t.map(function(e){var t=n?n(e,e.slice(),e.length):e;return Cesium.Cartographic.fromDegrees(t[0],t[1])});return new Promise(function(i,n){Cesium.sampleTerrainMostDetailed(e,r).then(function(e){e.forEach(function(e,i){t[i][2]=e.height||0}),i(t)},n)})}Dt.CESIUM_TERRAIN=Dt.lastLayerId,Dt.lastLayerId+=1;var Rt=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_TERRAIN,e.className=t.className,i=y(this,b(t).call(this,e)),i.requestVertexNormals=null==e.requestVertexNormals||e.requestVertexNormals,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Terrain"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.cesiumTerrainProvider=Nt({url:this.url,requestVertexNormals:this.requestVertexNormals}),this.initialized=!0)}},{key:"show",value:function(){var e=this.framework.getActiveMap();if(e&&e.isInitialized()){this.framework.getLayers().filter(function(e){return e instanceof t}).forEach(function(e){e.activate(!1)});var i=e.getScene(),n=i.globe;n.depthTestAgainstTerrain=!0,n.terrainProvider=this.cesiumTerrainProvider}}},{key:"hide",value:function(){var e=this.framework.getActiveMap();if(e){this.ellipsoidProvider||(this.ellipsoidProvider=new Cesium.EllipsoidTerrainProvider({}));var t=e.getScene(),i=t.globe;i.depthTestAgainstTerrain=!1,i.terrainProvider=this.ellipsoidProvider}}},{key:"dispose",value:function(){var e=this.framework.getActiveMap();e&&(e.getCesiumWidget().terrainProvider=new Cesium.EllipsoidTerrainProvider({})),this.ellipsoidProvider=null,this.cesiumTerrainProvider=null,this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"getHeightForWGS84Coordinates",value:function(e){return Ht(this.cesiumTerrainProvider,e)}}]),t}(At),zt=Rt,Gt=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.viewer=null,i.debugMode=!1,i.enableLightning=Object(u["e"])(e.enableLightning,!0),i.tileCacheSize=Object(u["h"])(e.tileCacheSize,1),i.eventHandler=null,i.invertClickBehavior=!1,i.defaultJDate=Cesium.JulianDate.fromDate(new Date(2014,6,20,13,0,0,0)),i.supportedlayers=[Dt.CESIUM_BUILDINGSLAYER,Dt.CESIUM_TERRAIN,Dt.CESIUM_POINTCLOUDLAYER,Dt.CESIUM_GLTFLAYER,Dt.CESIUM_ENTITIESLAYER,Dt.CESIUM_CZMLLAYER,Dt.CESIUM_TILESET_LAYER,Dt.TMSBase,Dt.VECTOR,Dt.FEATURESTORE,Dt.CLUSTER,Dt.WMS,Dt.WMTS,Dt.WSV,Dt.GEOJSON,Dt.IMAGE,Dt.OPENSTREETMAP,Dt.TILED_LAYER],i.urlParameter=null,i.webGLaa=Object(u["e"])(e.webGLaa,!1),i.enableTerrainAdjustmentWhenLoading=Object(u["e"])(e.enableTerrainAdjustmentWhenLoading,!0),i.limitCameraHeight=null!=e.limitCameraHeight?Object(u["g"])(e.limitCameraHeight,0):null,i.globeColor=e.globeColor?Cesium.Color.fromCssColorString(e.globeColor):Cesium.Color.fromBytes(63,71,204),i._clusterDataSourceDisplay=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Cesium"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){try{this.viewer=new Cesium.CesiumWidget(this.mapElement.getAttribute("id"),{requestRenderMode:!1,scene3DOnly:!0,imageryProvider:!1,shadows:!1,terrainShadows:Cesium.ShadowMode.ENABLED,contextOptions:{webgl:{failIfMajorPerformanceCaveat:!1,antialias:this.webGLaa}}})}catch(s){return this.hide(),document.getElementById("error-message").classList.remove("vcm_ui_hidden"),this.initialized=!1,!1}this.viewer.scene.globe.tileCacheSize=this.tileCacheSize,this.viewer.scene.globe.baseColor=this.globeColor,this.dataSourceDisplay=new Cesium.DataSourceDisplay({scene:this.viewer.scene,dataSourceCollection:new Cesium.DataSourceCollection}),this.viewer.scene.frameState.creditDisplay.update=function(){},this.viewer.scene.frameState.creditDisplay.beginFrame=function(){},this.viewer.scene.frameState.creditDisplay.endFrame=function(){};var t=this.viewer.clock;t.shouldAnimate=!0,t.onTick.addEventListener(function(){var i=t.currentTime;e.dataSourceDisplay.update(i)}),this.viewer.scene.shadowMap.maximumDistance=5e3,this.viewer.scene.shadowMap.darkness=.6,this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.viewer.scene.highDynamicRange=!1,this.viewer.scene.globe.enableLighting=this.enableLightning,this.viewer.scene.camera.enableTerrainAdjustmentWhenLoading=this.enableTerrainAdjustmentWhenLoading,this.setDay(this.defaultJDate);var i=document.getElementsByClassName("cesium-widget-credits");if(i)for(var n=0;n<i.length;n++){var r=i[n];r.style.display="none"}var a=new Cesium.Cartographic;this.viewer.scene.preUpdate.addEventListener(function(){null!==e.limitCameraHeight&&(Cesium.Cartographic.fromCartesian(e.viewer.scene.camera.position,Cesium.Ellipsoid.WGS84,a),a&&a.height<e.limitCameraHeight&&(a.height=e.limitCameraHeight,Cesium.Cartographic.toCartesian(a,Cesium.Ellipsoid.WGS84,e.viewer.scene.camera.position)))}),this.eventHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.ol3map=new ol.Map({view:new ol.View({resolutions:[1],resolution:1})}),this.clusterConverter=new olcs.ClusterConverter(this.viewer.scene),this.synchronizer=new olcs.VectorSynchronizer(this.ol3map,this.viewer.scene),this.clusterSynchronizer=new olcs.VectorSynchronizer(this.ol3map,this.viewer.scene,this.clusterConverter),this.initialized=!0,this.urlParameter&&this.handleURLParameter(this.urlParameter)}return!0}},{key:"activate",value:function(e){return this.active=!0,this.show(),this.initialize()?(this.viewer.resize(),e&&this.gotoViewPoint(e),Promise.resolve()):Promise.resolve()}},{key:"show",value:function(){this.viewer&&(this.viewer.container.style.display="",this.viewer.useDefaultRenderLoop=!0,this.cesiumInspectorContainer&&(this.cesiumInspectorContainer.style.display="")),Se(b(t.prototype),"show",this).call(this)}},{key:"hide",value:function(){this.viewer&&(this.viewer.useDefaultRenderLoop=!1,this.viewer.container.style.display="none",this.cesiumInspectorContainer&&(this.cesiumInspectorContainer.style.display="none")),Se(b(t.prototype),"hide",this).call(this)}},{key:"getOL3Map",value:function(){return this.logger.deprecate("getOL3Map","is deprecated in v3.6, use the property ol3map directly"),this.ol3map}},{key:"getSynchronizer",value:function(e){return"vcs.vcm.layer.cesium.VectorCluster"===e.className?this.clusterSynchronizer:this.synchronizer}},{key:"getClusterConverter",value:function(){return this.clusterConverter}},{key:"getHeightFromTerrain",value:function(e){var t=this.viewer.scene.terrainProvider;return t.availability?Ht(t,e,R.createMercatorProjection()):Promise.resolve(e)}},{key:"getPositionOnGround",value:function(e,t){var i=Cesium.Cartesian3.fromDegreesArrayHeights(e)[0],n=Cesium.Cartesian3.fromDegreesArrayHeights(t)[0],r=new Cesium.Ray(i,n),a=this.viewer.scene.globe.pick(r,this.viewer.scene);if(a){var s=Cesium.Ellipsoid.WGS84.cartesianToCartographic(a),o=[Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),s.height];return o}return null}},{key:"getViewPoint",value:function(e,t){if(!this.viewer||!this.viewer.scene)return null;var i=null==e||e,n=this.viewer.scene.camera,r=n.position,a=null,s=null;if(i){var o=new Cesium.Ray(n.position,n.direction),l=this.viewer.scene.globe.pick(o,this.viewer.scene);if(l){s=Cesium.Cartesian3.distance(l,r);var c=Cesium.Ellipsoid.WGS84.cartesianToCartographic(l);a=[Cesium.Math.toDegrees(c.longitude),Cesium.Math.toDegrees(c.latitude),c.height]}}var u=n.positionCartographic,h=[Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude),u.height],d=new V({groundPosition:i?a:[],cameraPosition:h,distance:s,heading:Cesium.Math.toDegrees(n.heading),pitch:Cesium.Math.toDegrees(n.pitch),roll:Cesium.Math.toDegrees(n.roll)});return t?Promise.resolve(d):d}},{key:"gotoViewPoint",value:function(e,t,i,n){var r=this;if(!this.movementDisabled){var a=null!==t?t:void 0,s=null!==i?i:void 0;if(Pe.getInstance().navActive&&Pe.getInstance().activateOverviewMode(),e.isValid()){var o=null,l=e.getDistance(),c=0,u=Cesium.Math.toRadians(e.getHeading()),h=Cesium.Math.toRadians(e.getPitch()),d=Cesium.Math.toRadians(e.getRoll());if(e.getCameraPosition()){var m=e.getCameraPosition();o=Cesium.Cartesian3.fromDegrees(m[0],m[1],m[2])}else{if(!e.getGroundPosition())return;var f=e.getGroundPosition(),y=Cesium.Cartesian3.fromDegrees(f[0],f[1],f[2]),g=new Cesium.Camera(this.viewer.scene),v={destination:y,orientation:{heading:u,pitch:h,roll:d}};if(g.setView(v),!f[2]){var p=this.framework.getLayers(),_=p.filter(function(e){return e.active}).find(function(e){return e instanceof zt});_&&_.getHeightForWGS84Coordinates([[f[0],f[1]]]).then(function(e){var t=e[0][2];if(t>0){var i=r.viewer.scene.camera.positionCartographic.height,n=t+c-i;r.viewer.scene.camera.moveBackward(n)}});var b=Cesium.Cartographic.fromDegrees(f[0],f[1]),L=this.viewer.scene.globe.getHeight(b);if(L&&L>0){var M=Cesium.Cartesian3.fromDegrees(f[0],f[1],L);v.destination=M,g.setView(v)}}null===l||void 0===l?l=2e3:l>0&&g.moveBackward(l),o=g.position}var k=this.viewer.scene.camera,w={heading:u,pitch:h,roll:d};o=o||null,e.getAnimate()?k.flyTo({destination:o,orientation:w,duration:a,maximumHeight:s,complete:n}):(k.setView({destination:o,orientation:w}),n&&n()),c=k.positionCartographic.height}}}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),e?(this.originalState={enableRotate:this.viewer.scene.screenSpaceCameraController.enableRotate,enableTranslate:this.viewer.scene.screenSpaceCameraController.enableTranslate,enableZoom:this.viewer.scene.screenSpaceCameraController.enableZoom,enableTilt:this.viewer.scene.screenSpaceCameraController.enableTilt,enableLook:this.viewer.scene.screenSpaceCameraController.enableLook},this.viewer.scene.screenSpaceCameraController.enableRotate=!1,this.viewer.scene.screenSpaceCameraController.enableTranslate=!1,this.viewer.scene.screenSpaceCameraController.enableZoom=!1,this.viewer.scene.screenSpaceCameraController.enableTilt=!1,this.viewer.scene.screenSpaceCameraController.enableLook=!1):!e&&this.originalState&&(this.viewer.scene.screenSpaceCameraController.enableRotate=this.originalState.enableRotate,this.viewer.scene.screenSpaceCameraController.enableTranslate=this.originalState.enableTranslate,this.viewer.scene.screenSpaceCameraController.enableZoom=this.originalState.enableZoom,this.viewer.scene.screenSpaceCameraController.enableTilt=this.originalState.enableTilt,this.viewer.scene.screenSpaceCameraController.enableLook=this.originalState.enableLook,this.originalState=null)}},{key:"setDay",value:function(e){this.viewer.clock.currentTime=e,this.viewer.clock.multiplier=1}},{key:"setLightning",value:function(e){this.enableLightning=e,this.viewer.scene.globe.enableLighting=e}},{key:"getCesiumWidget",value:function(){return this.viewer}},{key:"getEntities",value:function(){return this.dataSourceDisplay.defaultDataSource.entities}},{key:"getDatasources",value:function(){return this.dataSourceDisplay.dataSources}},{key:"getClusterDatasources",value:function(){var e=this;if(this._clusterDataSourceDisplay)return this._clusterDataSourceDisplay.dataSources;var t=new Cesium.DataSourceCollection;function i(e,t,i){var n=i.entities;return[new Cesium.BillboardVisualizer(t,n),new Cesium.LabelVisualizer(t,n),new Cesium.PointVisualizer(t,n)]}return this._clusterDataSourceDisplay=new Cesium.DataSourceDisplay({scene:this.viewer.scene,dataSourceCollection:t,visualizersCallback:i}),this.viewer.clock.onTick.addEventListener(function(t){e._clusterDataSourceDisplay.update(t.currentTime)}),t}},{key:"getDataSourceDisplay",value:function(){return this.dataSourceDisplay}},{key:"getScene",value:function(){return this.viewer.scene}},{key:"getViewer",value:function(){return this.viewer}},{key:"pointIsVisible",value:function(e){var t=this.viewer.scene.camera,i=Cesium.Cartesian3.fromDegrees(e[0],e[1],0),n=t.frustum.computeCullingVolume(t.positionWC,t.directionWC,t.upWC);return n.computeVisibility(new Cesium.BoundingSphere(i))===Cesium.Intersect.INSIDE}},{key:"handleURLParameter",value:function(e){e.debug&&(this.initialized?this.setDebugMode():this.urlParameter=e)}},{key:"setDebugMode",value:function(){this.debugMode||(this.debugMode=!0,this.cesiumInspectorContainer=document.createElement("div"),this.cesiumInspectorContainer.className="cesium-viewer-cesiumInspectorContainer",this.framework.getMapContainer().appendChild(this.cesiumInspectorContainer),this.cesiumInspector=new Cesium.CesiumInspector(this.cesiumInspectorContainer,this.getScene()))}},{key:"pickPositionSupported",value:function(){return!!this.initialized&&this.viewer.scene.pickPositionSupported}},{key:"isGroundPrimitiveSupported",value:function(){return!!this.initialized&&this.viewer.scene.context.fragmentDepth}}]),t}(Ee),Vt=Gt,Bt=i(30);function Ut(e,t,i){var n=6371e3,r=Cesium.Math.toRadians(i),a=Cesium.Math.toRadians(e[1]),s=Cesium.Math.toRadians(e[0]),o=Math.asin(Math.sin(a)*Math.cos(t/n)+Math.cos(a)*Math.sin(t/n)*Math.cos(r)),l=s+Math.atan2(Math.sin(r)*Math.sin(t/n)*Math.cos(a),Math.cos(t/n)-Math.sin(a)*Math.sin(o));return[parseFloat(Cesium.Math.toDegrees(l).toFixed(5)),parseFloat(Cesium.Math.toDegrees(o).toFixed(5))]}function Wt(e,t){var i=Cesium.Math.toRadians(e[0]),n=Cesium.Math.toRadians(e[1]),r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),s=Math.sin(r-i)*Math.cos(a),o=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(r-i),l=Cesium.Math.toDegrees(Math.atan2(s,o));return l=(l+360)%360,l}function qt(e,t){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)}var Jt=new ol.Sphere(6378137);function Kt(e,t){if(e instanceof ol.geom.Polygon)return null!=t?e.getLinearRing(t):e.getLinearRings();if(e instanceof ol.geom.MultiLineString)return null!=t?e.getLineString(t):e.getLineStrings();if(e instanceof ol.geom.MultiPoint)return null!=t?e.getPoint(t):e.getPoints();if(e instanceof ol.geom.MultiPolygon)return null!=t?e.getPolygon(t):e.getPolygons();if(e instanceof ol.geom.GeometryCollection)return null!=t?e.getGeometries()[t]:e.getGeometries();throw new Error("Geometry is not a MultiGeometry")}function Zt(e,t){if(e instanceof ol.geom.Polygon&&t instanceof ol.geom.LinearRing)e.appendLinearRing(t);else if(e instanceof ol.geom.MultiLineString&&t instanceof ol.geom.LineString)e.appendLineString(t);else if(e instanceof ol.geom.MultiPoint&&t instanceof ol.geom.Point)e.appendPoint(t);else{if(!(e instanceof ol.geom.MultiPolygon&&t instanceof ol.geom.Polygon))throw new Error("Geometry is not a MultiGeometry");e.appendPolygon(t)}}var Qt=new Cesium.Cartesian2,Xt=new Cesium.Cartesian2,$t=new Cesium.Cartesian2,ei=new Cesium.Cartesian3,ti=new Cesium.Cartesian3,ii=new Cesium.Cartesian3;function ni(e,t,i){ei=Cesium.Cartesian3.fromElements(t[0]-e[0],t[1]-e[1],t[2]-e[2],ei),ei.equals(Cesium.Cartesian3.ZERO)&&(ei=Cesium.Cartesian3.fromElements(1,1,1,ei)),ei=Cesium.Cartesian3.normalize(ei,ei),ti=Cesium.Cartesian3.fromElements(i[0]-e[0],i[1]-e[1],i[2]-e[2],ti);var n=Cesium.Cartesian3.dot(ei,ti);return ei=Cesium.Cartesian3.multiplyByScalar(ei,n,ei),[ei.x+e[0],ei.y+e[1],ei.z+e[2]]}function ri(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function ai(e,t){return ei=Cesium.Cartesian3.fromElements(e[0],e[1],e[2],ei),ti=Cesium.Cartesian3.fromElements(t[0],t[1],t[2],ti),Cesium.Cartesian3.distance(ei,ti)}function si(e,t,i,n){ei=Cesium.Cartesian3.fromElements(t[0]-e[0],t[1]-e[1],t[2]-e[2],ei),ti=Cesium.Cartesian3.fromElements(i[0]-e[0],i[1]-e[1],i[2]-e[2],ti),ii=Cesium.Cartesian3.fromElements(i[0]-t[0],i[1]-t[1],i[2]-i[2],ii);var r=Cesium.Cartesian3.magnitude(ei);return!(r<Cesium.Cartesian3.magnitude(ti)||r<Cesium.Cartesian3.magnitude(ii))&&(ei=Cesium.Cartesian3.normalize(ei,ei),ti=Cesium.Cartesian3.normalize(ti,ti),ei.equalsEpsilon(ti,n||Cesium.Math.EPSILON5))}function oi(e,t,i,n){Qt=Cesium.Cartesian2.fromElements(t[0]-e[0],t[1]-e[1],Qt),Xt=Cesium.Cartesian2.fromElements(i[0]-e[0],i[1]-e[1],Xt),$t=Cesium.Cartesian2.fromElements(i[0]-t[0],i[1]-t[1],$t);var r=Cesium.Cartesian2.magnitude(Qt);return!(r<Cesium.Cartesian2.magnitude(Xt)||r<Cesium.Cartesian2.magnitude($t))&&(Qt=Cesium.Cartesian2.normalize(Qt,Qt),Xt=Cesium.Cartesian2.normalize(Xt,Xt),Qt.equalsEpsilon(Xt,n||Cesium.Math.EPSILON5))}function li(e,t){var i=R.mercatorToWgs84(e);return ei=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),ti=t.globe.ellipsoid.geodeticSurfaceNormal(ei,ti),ti=Cesium.Cartesian3.cross(t.camera.rightWC,ti,ti),ti=Cesium.Cartesian3.normalize(ti,ti),Cesium.Plane.fromPointNormal(ei,ti)}function ci(e,t){var i=R.mercatorToWgs84(e);return ei=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),ti=t.globe.ellipsoid.geodeticSurfaceNormal(ei,ti),Cesium.Plane.fromPointNormal(ei,ti)}function ui(e,t){var i=t||e.getCoordinates(),n=null;return e instanceof ol.geom.Point?n=[i]:e instanceof ol.geom.LineString?n=i:e instanceof ol.geom.Polygon?n=i.reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.MultiPoint?n=i:e instanceof ol.geom.MultiLineString?n=i.reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.MultiPolygon?n=i.reduce(function(e,t){return e.concat(t)}).reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.Circle?n=i:e instanceof ol.geom.GeometryCollection&&(n=e.getGeometries().map(function(e,t){return ui(e,i[t])}).reduce(function(e,t){return e.concat(t)})),n}function hi(e,t,i){var n=-1/0,r=1/0,a=e.getGeometry();if(a){var s=ui(a),o=s.length;while(o--)3===s[o].length&&(n=s[o][2]>n?s[o][2]:n,r=s[o][2]<r?s[o][2]:r);if(!i&&"sphere"===e.get("olcs.circle_type")&&a instanceof ol.geom.Circle){var l=a.getCoordinates();R.mercatorToWgs84(l[0],!0),R.mercatorToWgs84(l[1],!0);var c=Jt.haversineDistance(l[0],l[1]),u=l[0][2]||0;n=u+c>n?u+c:n,r=u-c<r?u-c:r}}if(r=r===1/0?0:r,!i){var h=e.get("olcs_extrudedHeight");if(!h){var d=e.get("olcs_storeyHeight")||t,m=e.get("olcs_storeyNumber");d&&m&&(h=m*d)}var f=e.get("olcs_groundLevel");h&&(r=f||r),Array.isArray(h)||h&&(h>0?(n=f||n,n=r+h>n?r+h:n):(n=r>n?r:n,r=r+h<r?r+h:r))}return{max:r>n?r:n,min:r}}function di(e,t,i,n){function r(e){var r=e.length;while(r--)null==e[r][2]||n?e[r][2]=i:e[r][2]+=t;return e}var a=e.getCoordinates(),s=ui(e,a);r(s),e.setCoordinates(a)}function mi(e){e.unset("olcs_groundLevel",!0);var t=ne.getInstance().getActiveMap();if(t instanceof Vt){var i=e.getGeometry();if(i){var n=i.getCoordinates(),r=ui(i,n);return t.getHeightFromTerrain(r).then(function(){i.setCoordinates(n)})}}return Promise.resolve()}function fi(e){e.set("olcs_altitudeMode","clampToGround")}function yi(e){return e instanceof ol.geom.Circle?ol.geom.Polygon.fromCircle(e):(e instanceof ol.geom.Polygon&&e.unset("_vcsGeomType"),e)}function gi(e,t){var i=Jt.offset(R.mercatorToWgs84(e),t,Math.PI/2),n=R.wgs84ToMercator(i),r=e[0]-n[0],a=e[1]-n[1],s=r*r,o=a*a,l=Math.sqrt(s+o);return new ol.geom.Circle(e,l,"XYZ")}function vi(e){for(var t=0,i=0;i<e.length;i++){var n=i+1;n>=e.length&&(n=0);var r=e[i],a=e[n],s=qt(r,a);s>t&&(t=s)}return t}function pi(e,t){var i=vi(t.groundCoordinates),n=Math.PI/3,r=e.getViewport(),a={height:r.offsetHeight,width:r.offsetWidth},s=a.width/a.height,o=2*Math.atan(Math.tan(.5*n)/s),l=i/t.size[0];return{size:a,fovy:o,metersPerUnit:l}}function _i(e,t,i){var n=e instanceof ol.geom.Circle?ol.geom.Polygon.fromCircle(e):e,r=n.getCoordinates(),a=ui(n,r),s=ol.proj.getTransform(ol.proj.get("EPSG:4326"),i.projection),o=a.map(function(e){return R.mercatorToWgs84(e,!0),Cesium.Cartographic.fromDegrees(e[0],e[1])});return Cesium.sampleTerrainMostDetailed(i.terrainProvider,o).then(function(e){return a.forEach(function(e){return s(e,e,3)}),e.forEach(function(e,t){var n=i.transformRealWorld2Image(a[t],e.height);a[t][0]=n[0],a[t][1]=n[1]}),t.setCoordinates(r),t})}function bi(e,t,i){var n=e.getCoordinates(),r=ol.proj.get("EPSG:3857"),a=ui(e,n),s=a.map(function(e){return Object(Bt["e"])(i,e,{dataProjection:r}).then(function(t){e[0]=t.coords[0],e[1]=t.coords[1],e[2]=t.coords[2]})});return Promise.all(s).then(function(){return t.setCoordinates(n),t})}var Li=i(645),Mi=i(540),ki=i(541),wi=i(114),Ti=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.layer=e.layer||null,i.suppressPublish=!1,i}return w(t,e),Object(m["a"])(t,[{key:"activateWithViewPoint",value:function(e,t){var i=this;return this.state===wi["a"].STATE.INACTIVE&&(this.state=wi["a"].STATE.LOADING,this.olMap=e,t)?this.setViewPoint(t).then(function(){i.state=wi["a"].STATE.ACTIVE}):Promise.resolve(this.state)}},{key:"setImageOnMap",value:function(e,i){var n=this,r=!this.suppressPublish&&(!this.currentImage||this.currentImage.name!==e);return Se(b(t.prototype),"setImageOnMap",this).call(this,e,i).then(function(){r&&ne.getInstance().publish(B.OBLIQUE_IMAGE_CHANGED,n.layer,n.currentImage)})}},{key:"setViewPoint",value:function(e){var t=this,i=e.getGroundPosition();i||(i=e.getCameraPosition());var n=ol.proj.transform(i,R.createGeographicProjection().getProjection(),this.projection),r=this.getImageNameForCoordinates(n);if(null!=r){var a=i[2]||!this.terrainProvider?Promise.resolve([n]):Object(Bt["c"])(this.terrainProvider,[n],this.projection);return a.then(function(e){var i=Object(Ie["a"])(e,1),n=i[0];return t.setImageOnMap(r,n)}).catch(function(){return t.setImageOnMap(r,n)}).then(function(){var i=e.getDistance();i||(i=e.getCameraPosition()?e.getCameraPosition()[2]:1e3);var n=pi(t.olMap,t.currentImage),r=n.size,a=n.fovy,s=n.metersPerUnit,o=2*i*Math.tan(a/2),l=o/s,c=l/r.height,u=t.currentView.view;u.setResolution(u.constrainResolution(c))})}return Promise.reject(new Error("could not find an image in this direction"))}},{key:"canShowViewpoint",value:function(e){var t=e.getGroundPosition();t||(t=e.getCameraPosition());var i=ol.proj.transform(t,R.createGeographicProjection().getProjection(),this.projection),n=this.getImageNameForCoordinates(i);if(null!=n){var r=this.images[n],a=ol.extent.boundingExtent(r.groundCoordinates);return ol.extent.containsCoordinate(a,i)}return!1}}]),t}(wi["a"]),Si=Ti,Oi=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.layer=e.layer,i.directions={},i}return w(t,e),Object(m["a"])(t,[{key:"handleMetadataResponse",value:function(e,t){var i=Li["a"].getVersion(e);i.version>=3.5||3.4===i.version&&i.buildNumber>=36?this.handleMetadataResponseV35(e,t,i):i.version>=3.1||null===i.version?this.handleMetadataResponseV34(e,t,i):console.log("Could not load Meta Data, only meta data version 3.4 and higher are supported")}},{key:"createDirection",value:function(e){return new Si(Object.assign({layer:this.layer},e))}},{key:"handleMetadataResponseV34",value:function(e,i,n){var r=this,a=[e.generalImageInfo.width,e.generalImageInfo.height],s=e.generalImageInfo["tile-resolution"],o=[e.generalImageInfo["tile-width"],e.generalImageInfo["tile-width"]];e.generalImageInfo.width&&e.generalImageInfo.height&&e.generalImageInfo["tile-resolution"]&&this.getImageMeta(i,a,s,o,n);var l=[],c=e.generalImageInfo.cameraParameter;c&&Object.keys(c).forEach(function(e){var t=new ki["a"](Object.assign({name:e},c[e]));l.push(t)});var u={};e.images&&Array.isArray(e.images)&&(e.images.forEach(function(e){var h=t.getImageOptionsFromJSON(e,l,c),d=e.width&&e.height?[e.width,e.height]:a,m=e["tile-resolution"]?e["tile-resolution"]:s,f=r.getImageMeta(i,d,m,o,n),y=new Mi["a"](Object.assign({terrainProvider:r.terrainProvider,projection:r.projection,meta:f},h));u[y.viewDirection]||(u[y.viewDirection]={direction:y.viewDirection,images:{},rTreeItems:[],footPrintFeatures:[],projection:r.projection,terrainProvider:r.terrainProvider}),u[y.viewDirection].images[y.name]=y,u[y.viewDirection].rTreeItems.push({minX:y.centerPointOnGround[0],minY:y.centerPointOnGround[1],maxX:y.centerPointOnGround[0],maxY:y.centerPointOnGround[1],name:y.name});var g=new ol.geom.Polygon([y.groundCoordinates.concat([y.groundCoordinates[0]])]);g.transform(r.projection,ol.proj.get("EPSG:3857"));var v=new ol.Feature({geometry:g});v.setId(y.name),u[y.viewDirection].footPrintFeatures.push(v)}),Object.keys(u).forEach(function(e){r.directions[e]?r.directions[e].addOptions(u[e]):r.directions[e]=r.createDirection(u[e]),r.extent=ol.extent.extend(r.extent,r.directions[e].footPrintsLayer.getSource().getExtent())}))}}],[{key:"getImageOptionsFromJSON",value:function(e,t,i){var n=h["c"][e["view-direction"]],r=e["view-directionAngle"],a=e["projection-center"],s=e.name,o=e.groundCoordinates,l=e.centerPointOnGround,c=e["camera-name"],u=t.find(function(e){return e.name===c}),d={name:s,viewDirection:n,viewDirectionAngle:r,groundCoordinates:o,centerPointOnGround:l};if(u){var m,f,y=i[c],g=Cesium.Matrix3.fromRowMajorArray((m=[]).concat.apply(m,Object(T["a"])(y["camera-matrix"]))),v=Cesium.Matrix3.inverse(g,new Cesium.Matrix3),p=Cesium.Matrix3.fromRowMajorArray((f=[]).concat.apply(f,Object(T["a"])(e["rotation-matrix"]))),_=Cesium.Matrix3.transpose(p,new Cesium.Matrix3),b=-1*y["focal-length"];Cesium.Matrix3.multiplyByScalar(v,b,v);var L=Cesium.Matrix3.multiply(_,v,new Cesium.Matrix3),M=Cesium.Matrix4.fromRotationTranslation(g,Cesium.Cartesian3.ZERO,new Cesium.Matrix4),k=Cesium.Cartesian3.fromArray(a),w=Cesium.Matrix4.fromTranslation(Cesium.Cartesian3.multiplyByScalar(k,-1,new Cesium.Cartesian3),new Cesium.Matrix4),S=Cesium.Matrix4.fromRotationTranslation(p,Cesium.Cartesian3.ZERO,new Cesium.Matrix4),O=Cesium.Matrix4.multiply(M,Cesium.Matrix4.multiply(S,w,new Cesium.Matrix4),new Cesium.Matrix4);d.projectionCenter=k,d.camera=u,d.pToRealworld=L,d.pToImage=O}return d}}]),t}(Li["a"]),Ci=Oi;function Ei(e){var t=e.getHeading(),i=h["a"].NORTH;return t>=45&&t<135?i=h["a"].EAST:t>=135&&t<225?i=h["a"].SOUTH:t>=225&&t<315&&(i=h["a"].WEST),i}Dt.OBLIQUE_OBLIQUELAYER=Dt.lastLayerId,Dt.lastLayerId+=1,B.OBLIQUE_IMAGE_CHANGED="OBLIQUE_IMAGE_CHANGED",B.OBLIQUE_DIRECTION_CHANGED="OBLIQUE_DIRECTION_CHANGED";var Ii=function(e){function t(e){var i;Object(d["a"])(this,t),e.layertype=Dt.OBLIQUE_OBLIQUELAYER,e.className=t.className,i=y(this,b(t).call(this,e));var n=e.terrain?e.terrain.url:e.terrainUrl;return i.terrainProvider=n?Nt({url:n}):null,i.sourceProjection=e.projection?new R(e.projection):new R({epsg:e.epsg,proj4:e.proj4}),i.terrainErrorThreshold=Object(u["g"])(e.terrainErrorThreshold,1),i.terrainErrorCountThreshold=Object(u["h"])(e.terrainErrorCountThreshold,3),i.obliqueCollection=new Ci({terrainProvider:i.terrainProvider,projection:i.sourceProjection.getProjection(),minZoom:e.minZoom,maxZoom:e.maxZoom,hideLevels:e.hideLevels,layer:f(i)}),i.obliqueMap=null,i.currentDirection=null,i.isDefaultObliqueLayer=i.activeOnStartup,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.ObliqueLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return this.initialized?Promise.resolve():(this.obliqueMap||(this.obliqueMap=this.framework.getMapByType("vcs.vcm.maps.Oblique"),this.obliqueMap||this.logger.warning("Oblique layer is not loading on top of an oblique map, please check: ".concat(this.name)),this.olMap=this.obliqueMap.getolMap()),this.obliqueCollection.loadData(this.url).then(function(){e.initialized=!0,e.currentDirection=e.obliqueCollection.directions[h["a"].NORTH]}))}},{key:"activate",value:function(e){if(e&&e!==this.active&&this.isSupported()){var t=this.framework.getActiveMap();return this.olMap=t.olMap,t.setObliqueLayer(this)}return Promise.resolve()}},{key:"show",value:function(e){var t=this;return this.active=!0,this.initialize().then(function(){return e?t.setViewPoint(e):t.currentDirection.activate(t.olMap,[0,0],t.obliqueCollection.options.minZoom)})}},{key:"canShowViewpoint",value:function(e){var t=this;return this.initialize().then(function(){var i=Ei(e);return!!t.obliqueCollection.directions[i]&&t.obliqueCollection.directions[i].canShowViewpoint(e)})}},{key:"hide",value:function(){this.active=!1,this.currentDirection&&this.currentDirection.deactivate()}},{key:"getExtent",value:function(){return this.extent}},{key:"getExtentOfCurrentImage",value:function(){return this.currentImage&&this.currentImage.groundCoordinates?new Ae({coordinates:ol.extent.boundingExtent(this.currentImage.groundCoordinates),epsg:this.sourceProjection.getEPSG()}):(this.logger.warning("No currentImage, cannot compute extent"),null)}},{key:"computeViewpoint",value:function(e){var t=this;if(!this.currentImage)return e?Promise.resolve(null):null;if(e)return Object(Bt["e"])(this.currentImage,this.olMap.getView().getCenter(),{dataProjection:ol.proj.get("EPSG:4326")}).then(function(e){var i=e.coords;return t._computeViewpointInternal(i)});var i=this.olMap.getView().getCenter(),n=this.currentImage.transformImage2RealWorld(i,this.currentImage.averageHeight),r=this.sourceProjection.transformTo(R.createGeographicProjection(),n);return this._computeViewpointInternal(r)}},{key:"_computeViewpointInternal",value:function(e){var t,i=(t={},Object(oe["a"])(t,h["a"].NORTH,0),Object(oe["a"])(t,h["a"].EAST,90),Object(oe["a"])(t,h["a"].SOUTH,180),Object(oe["a"])(t,h["a"].WEST,270),t),n=pi(this.olMap,this.currentImage),r=n.size,a=n.fovy,s=n.metersPerUnit,o=this.olMap.getView(),l=o.getResolution(),c=l*r.height,u=c*s,d=Math.abs(u/2/Math.tan(a/2)),m=e[2]||this.currentImage.averageHeight,f=d+m;return new V({cameraPosition:[e[0],e[1],f],groundPosition:e,heading:i[this.currentImage.viewDirection],pitch:0,roll:0,distance:d})}},{key:"setViewPoint",value:function(e){var t=this,i=Ei(e);if(this.currentDirection){if(this.currentDirection.direction===i)return this.currentDirection.state===wi["a"].STATE.ACTIVE?this.currentDirection.setViewPoint(e):this.currentDirection.activateWithViewPoint(this.olMap,e);this.currentDirection.deactivate()}return this.obliqueCollection.directions[i]&&(this.currentDirection=this.obliqueCollection.directions[i]),this.currentDirection.suppressPublish=!0,this.currentDirection.activateWithViewPoint(this.olMap,e).then(function(){t.framework.publish(B.OBLIQUE_DIRECTION_CHANGED,t,t.currentDirection),t.framework.publish(B.OBLIQUE_IMAGE_CHANGED,t,t.currentImage),t.currentDirection.suppressPublish=!1}).catch(function(e){t.logger.error(e.message),t.currentDirection.suppressPublish=!1})}},{key:"getCurrentImage",value:function(){return this.currentImage}},{key:"existsImageForViewDirection",value:function(e){var t=this.currentImage.transformRealWorld2Image(e);return!(t[0]<0||t[0]>this.currentImage.size[0]||t[1]<0||t[1]>this.currentImage.size[1])}},{key:"currentImage",get:function(){return this.currentDirection?this.currentDirection.currentImage:null}}]),t}(At),Di=Ii;B.OBLIQUE_FALLBACK_ACTIVATED="OBLIQUE_FALLBACK_ACTIVATED";var ji=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.mouseClickEvents=!1,i.activeLayer=null,i.listenerKey=null,i.mapChangeEvent=e.changeOnMoveEnd?"moveend":"postrender",i.switchThreshold=Object(u["g"])(e.switchThreshold,0),i.switchThreshold>1&&(i.switchThreshold=.2),i._switchOnEdge=null==e.switchOnEdge||e.switchOnEdge,i.switchEnabled=!0,i.supportedlayers=[Dt.OBLIQUE_OBLIQUELAYER,Dt.VECTOR,Dt.GEOJSON,Dt.WSV,Dt.CLUSTER],i.interactionsDefaultsObject={altShiftDragRotate:!1,pinchRotate:!1,shiftDragZoom:!1,doubleClickZoom:!1},i._initialViewpoint=null,i.fallbackMap=e.fallbackMap,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Oblique"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){this.olMap||(this.olMap=new ol.Map({layers:[],logo:!1,controls:[],loadTilesWhileInteracting:!0,interactions:this.getMapInteractions(),target:this.mapElement}));var t=Object.values(this.framework.getLayers()).filter(function(e){return e instanceof Di}),i=t.find(function(e){return e.isDefaultObliqueLayer})||t[0];if(!i)return Promise.reject(new Error("Could not find an oblique layer for configured oblique map"));this.setLayerLoading(i,!0);var n=Promise.resolve(!0);if(this.fallbackMap&&this._initialViewpoint){var r=this.framework.getMapByName(this.fallbackMap);r?n=i.canShowViewpoint(this._initialViewpoint):(this.logger.warning("cannot use ".concat(this.fallbackMap," as a fallback, it does not exist")),this.fallbackMap=void 0)}this.inializedPromise=n.then(function(e){return!1===e?e:i.activate(!0)}).then(function(t){return!1!==t&&(e._initialViewpoint=null,e.initialized=!0,e.olMap.on(e.mapChangeEvent,e._postRenderHandler.bind(e))),t})}return this.inializedPromise}},{key:"getOl3Map",value:function(){return this.olMap}},{key:"setObliqueLayer",value:function(e){var t=this;this.switchEnabled=!1;var i=Promise.resolve(null);if(this.activeLayer){var n=this.activeLayer;i=n.computeViewpoint(!0).then(function(e){return n.hide(),t.framework.publish(B.LAYER_CHANGED,n),t.framework.publish(B.LAYER_DEACTIVATED,n),e})}else this._initialViewpoint&&(this.olMap.updateSize(),i=Promise.resolve(this._initialViewpoint));return this.setLayerLoading(e,!0),this.activeLayer=e,i.then(function(e){return t.activeLayer.show(e)}).then(function(){t.framework.getActiveMap().setLayerLoading(e,!1),t.switchEnabled=!0,t.framework.publish(B.LAYER_CHANGED,t.activeLayer),t.framework.publish(B.LAYER_ACTIVATED,t.activeLayer)}).catch(function(i){t.activeLayer=null,t.logger.warning("could not show oblique layer ".concat(e.name)),t.logger.warning("".concat(i.message))})}},{key:"_postRenderHandler",value:function(){if(this.active&&this._switchOnEdge&&this.switchEnabled){var e=this.olMap.getView().getCenter(),t=this.activeLayer,i=t.currentImage,n=t.currentDirection,r=this.switchThreshold,a=1-r;if(!i||e[0]/i.size[0]>r&&e[0]/i.size[0]<a&&e[1]/i.size[1]>r&&e[1]/i.size[1]<a)return;if(null===i.averageHeight)return;n.postRenderHandler(e)}}},{key:"activate",value:function(e){var t,i=this;return this.show(),this.switchEnabled=!0,this.initialized?t=e?this.gotoViewPoint(e):Promise.resolve():(this._initialViewpoint=e,t=this.initialize().then(function(e){return!1!==e&&(i.show(),i.olMap.updateSize()),e})),t.then(function(t){!1===t?(i.framework.publish("OBLIQUE_FALLBACK_ACTIVATED",!0),i.framework.activateMap(i.fallbackMap,e)):i.active=!0}).catch(function(e){i.logger.warning("could not activate oblique map"),i.logger.warning("".concat(e.message))})}},{key:"getExtentOfCurrentImage",value:function(){return this.activeLayer?this.activeLayer.getExtentOfCurrentImage():(this.logger.warning("Could not compute extent, because no oblique layer is active in the map"),new Ae({coordinates:[-18924313.4349,-15538711.0963,18924313.4349,15538711.0963],epsg:"EPSG:3857"}))}},{key:"getExtent",value:function(){return this.activeLayer?this.activeLayer.getExtent():(this.logger.warning("Could not compute extent, because no oblique layer is active in the map"),new Ae({coordinates:[-18924313.4349,-15538711.0963,18924313.4349,15538711.0963],epsg:"EPSG:3857"}))}},{key:"getCurrentImage",value:function(){return this.activeLayer?this.activeLayer.currentImage:(this.logger.warning("Could not obtain currentImage, because no oblique layer is active in the map"),null)}},{key:"deactivate",value:function(){var e=this;return this.inializedPromise.then(function(){return e.active=!1,e.getViewPoint(!1,!0).then(function(t){return e.hide(),t})})}},{key:"getViewPoint",value:function(e,t){return this.activeLayer?this.activeLayer.computeViewpoint(t):this._initialViewpoint?t?Promise.resolve(this._initialViewpoint):this._initialViewpoint:t?Promise.reject(new Error("no active layer or cachedViewpoint")):null}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),this.olMap.getInteractions().forEach(function(t){t.setActive(!e)})}},{key:"gotoViewPoint",value:function(e){var t=this;return this.movementDisabled?Promise.resolve():this.activeLayer?this.fallbackMap?this.activeLayer.canShowViewpoint(e).then(function(i){return i?t.activeLayer.setViewPoint(e):Promise.resolve(!1)}):this.activeLayer.setViewPoint(e):(this.logger.warning("Can't go to viewpoint, no active oblique layer."),Promise.resolve())}},{key:"getMapInteractions",value:function(){return ol.interaction.defaults(this.interactionsDefaultsObject)}},{key:"getolMap",value:function(){return this.olMap}},{key:"pointIsVisible",value:function(e){var t=this.olMap.getView(),i=t.calculateExtent(this.olMap.getSize()),n=[i[0],i[3]];n=this.activeLayer.currentImage.transformImage2RealWorld(n);var r=[i[2],i[1]];r=this.activeLayer.currentImage.transformImage2RealWorld(r);var a=[n,r],s=R.transformCoordinates(R.createGeographicProjection(),this.activeLayer.sourceProjection,a);return ol.extent.containsXY(ol.extent.boundingExtent(s),e[0],e[1])}},{key:"requestRender",value:function(){this.initialized&&this.olMap.render()}},{key:"switchOnEdge",get:function(){return this._switchOnEdge},set:function(e){this.logger.warning("switchOnEdge is deprecated, use switchEnabled instead"),this._switchOnEdge=e}}]),t}(Ee),Pi=ji,Yi=new Cesium.Cartographic,xi=new Cesium.Cartesian3,Ai=function(e){function t(){var e;return Object(d["a"])(this,t),e=y(this,b(t).call(this)),e.activeMapHandler=e.pipeThrough,e._defaultActive=me.ALL,e._defaultModificationKey=de.ALL,e.setActive(),e}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.activeMapHandler(e)}},{key:"handleMapChange",value:function(e){this.activeMapHandler=e instanceof Vt?t.cesiumHandler.bind(null,e):e instanceof Pi?t.obliqueHandler.bind(null,e):this.pipeThrough}}],[{key:"cesiumHandler",value:function(e,t){var i=e.getScene();return t.ray=i.camera.getPickRay(t.windowPosition),xi=i.globe.pick(t.ray,i,xi),xi?(Yi=Cesium.Cartographic.fromCartesian(xi,i.globe.ellipsoid,Yi),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Yi.longitude),Cesium.Math.toDegrees(Yi.latitude),Yi.height],!0)):(xi=new Cesium.Cartesian3,t.position=[0,0,0]),t.positionOrPixel=t.position,Promise.resolve(t)}},{key:"obliqueHandler",value:function(e,t){if(e.activeLayer&&e.activeLayer.currentImage){var i=t.type&(me.MOVE^me.DRAGEVENTS),n=t.position.slice(0,2);return Object(Bt["e"])(e.activeLayer.currentImage,n,{dontUseTerrain:!!i,dataProjection:R.createMercatorProjection().getProjection()}).then(function(e){return t.obliqueParameters={pixel:n},t.position=e.coords,t.obliqueParameters.estimate=e.estimate,t})}return t.stopPropagation=!0,Promise.resolve(t)}}]),t}(pe),Fi=Ai,Ni=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.ol3map=null,i.listenerKey=null,i.fixedNorthOrientation=null==e.fixedNorthOrientation||e.fixedNorthOrientation,i.supportedlayers=[Dt.TMSBase,Dt.VECTOR,Dt.CLUSTER,Dt.WSV,Dt.WMS,Dt.WMTS,Dt.GEOJSON,Dt.IMAGE,Dt.OPENSTREETMAP,Dt.TILED_LAYER],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Openlayers"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=[];this.ol3map=new ol.Map({layers:e,logo:!1,controls:[],interactions:ol.interaction.defaults({altShiftDragRotate:!1,pinchRotate:!1,shiftDragZoom:!1,doubleClickZoom:!1}),loadTilesWhileInteracting:!0,target:this.mapElement,view:new ol.View({center:[1230922.6203948376,6350766.117974091],zoom:13})}),this.initialized=!0}}},{key:"activate",value:function(e){return this.active=!0,this.show(),this.initialize(),e&&(this.fixedNorthOrientation&&e.setHeading(0),this.gotoViewPoint(e)),this.ol3map.updateSize(),Promise.resolve()}},{key:"getViewPoint",value:function(e,t){var i=this.ol3map.getView(),n=i.getCenter(),r=ol.proj.getTransform(i.getProjection(),"EPSG:4326"),a=Math.PI/3,s=this.ol3map.getViewport(),o={};o.height=s.offsetHeight,o.width=s.offsetWidth;var l=o.width/o.height,c=2*Math.atan(Math.tan(.5*a)/l),u=r(n.slice(0,2)),h=i.getProjection().getMetersPerUnit(),d=i.getResolution(),m=d*o.height,f=Math.cos(Math.abs(Cesium.Math.toRadians(u[1]))),y=m*h*f,g=Math.abs(y/2/Math.tan(c/2)),v=-Cesium.Math.toDegrees(i.getRotation()),p=u,_=-90,b=new V({groundPosition:p,pitch:_,heading:v,distance:g});return t?Promise.resolve(b):b}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),this.ol3map.getInteractions().forEach(function(t){t.setActive(!e)})}},{key:"gotoViewPoint",value:function(e){if(!this.movementDisabled){var t=this.ol3map.getView(),i=ol.proj.getTransform("EPSG:4326",t.getProjection()),n=[];n=e.getGroundPosition()?e.getGroundPosition().slice(0,2):e.getCameraPosition().slice(0,2);var r=e.getDistance();null==r&&(r=e.getCameraPosition()[2]);var a=i(n),s=Math.PI/3,o=this.ol3map.getViewport(),l={};l.height=o.offsetHeight?o.offsetHeight:1,l.width=o.offsetWidth?o.offsetWidth:1;var c=l.width/l.height,u=2*Math.atan(Math.tan(.5*s)/c),h=2*r*Math.tan(u/2),d=t.getProjection().getMetersPerUnit(),m=Math.cos(Math.abs(Cesium.Math.toRadians(n[1]))),f=h/d/m,y=f/l.height;if(e.getAnimate()){var g=0;this.fixedNorthOrientation||null==e.getHeading()||(g=-Cesium.Math.toRadians(e.getHeading())),t.animate({duration:100,center:a,source:t.getCenter(),easing:ol.easing.inAndOut,resolution:y,rotation:g})}else t.setCenter(a),t.setResolution(y),this.fixedNorthOrientation||null==e.getHeading()||t.setRotation(-Cesium.Math.toRadians(e.getHeading()))}}},{key:"getolMap",value:function(){return this.ol3map}},{key:"getOl3Map",value:function(){return this.ol3map}},{key:"pointIsVisible",value:function(e){var t=this.ol3map.getView(),i=t.calculateExtent(this.ol3map.getSize()),n=ol.proj.getTransform(t.getProjection(),"EPSG:4326"),r=[i[0],i[3]],a=[i[2],i[1]],s=[n(r),n(a)];return ol.extent.containsXY(ol.extent.boundingExtent(s),e[0],e[1])}},{key:"requestRender",value:function(){this.initialized&&this.ol3map.render()}}]),t}(Ee),Hi=Ni;i(696);function Ri(e,t,i,n){var r=1e-6,a=[0,0,0],s=[0,0,0],o=[0,0,0],l=[0,0,0],c=[0,0,0];function u(e,t,i){var n=t[0],r=t[1],a=t[2],s=i[0],o=i[1],l=i[2];return e[0]=r*l-a*o,e[1]=a*s-n*l,e[2]=n*o-r*s,e}function h(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}h(a,n[1],n[0]),h(s,n[2],n[0]),u(l,i,s);var m=d(a,l);if(m<r)return null;h(o,t,n[0]);var f=d(o,l);if(f<0||f>m)return null;u(c,o,a);var y=d(i,c);if(y<0||f+y>m)return null;var g=d(s,c)/m;return e[0]=t[0]+g*i[0],e[1]=t[1]+g*i[1],e[2]=t[2]+g*i[2],e}function zi(e){var t=4;e||console.error("b3dmBuffer is not defined.");var i=new Uint8Array(e),n=Cesium.getStringFromTypedArray(i,0,4);"b3dm"!==n&&console.error('Invalid magic, expected "b3dm", got: "'.concat(n,'".'));var r=new DataView(e),a=4,s=r.getUint32(a,!0);1!==s&&console.error('Invalid version, only "1" is valid, got: "'.concat(s,'".')),a+=t;var o=r.getUint32(a,!0);a+=t;var l=r.getUint32(a,!0);a+=t;var c=r.getUint32(a,!0);a+=t;var u=r.getUint32(a,!0);a+=t;var h,d=r.getUint32(a,!0);a+=t,u>=570425344?(a-=2*t,h=l,u=c,d=0,l=0,c=0):d>=570425344&&(a-=t,h=u,u=l,d=c,l=0,c=0),a+=u,a+=d,a+=l,a+=c,0!==d&&console.error("The length of the binary BatchTable is not zero, currently only JSON based BatchTables are supported");var m=new Uint8Array(e,a,o-a);return{header:{magic:n,version:s,batchLength:h},batchTable:null,binaryGLTF:m}}function Gi(e){var t=4;function i(e){var t=Cesium.getMagic(e);return"glTF"===t}i(e)||console.error("bgltf is not a valid Binary glTF file.");var n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t,a=n.getUint32(r,!0);if(1!==a&&2!==a&&console.error("Only Binary glTF version 1 is supported.  Version ".concat(a," is not.")),1===a){r+=t;var s=n.getUint32(r,!0);console.log("len",s),r+=t;var o=n.getUint32(r,!0);r+=t;var l=n.getUint32(r,!0);0!==l&&console.error("content format should be 0 (-> JSON)");var c=20+o;r+=t;var u=r,h=u+o,d=Cesium.getStringFromTypedArray(e,u,o),m=e.subarray(c,s);return{glTF:JSON.parse(d),binaryOffset:h,binaryData:m,version:a,contentLength:o}}var f=null;r+=t;var y,g=n.getUint32(r,!0),v=12;while(v<g){var p=new DataView(e.buffer,e.byteOffset+v,8),_=p.getInt32(0,!0),b=p.getInt32(4,!0);v+=8;var L=e.subarray(v,v+_);if(v+=_,1313821514===b){var M=Cesium.getStringFromTypedArray(L);f=JSON.parse(M)}else 5130562===b&&(y=L)}return{glTF:f,version:a,binaryData:y}}function Vi(e){var t=[],i=e.meshes;for(var n in i)if(i.hasOwnProperty(n))for(var r=i[n].primitives,a=0;a<r.length;a++){var s=r[a].mode;if(4==s){var o=r[a].attributes.POSITION,l=e.accessors[o],c=l.bufferView,u=void 0!==r[a].attributes.BATCHID&&null!==r[a].attributes.BATCHID?r[a].attributes.BATCHID:r[a].attributes._BATCHID,h=e.accessors[u],d=h.bufferView,m={positionAccessor:l,positionBufferView:e.bufferViews[c],batchIdAccessor:h,batchIdBufferView:e.bufferViews[d]};t.push(m)}else console.log("Unknown mode: ".concat(s))}return t}function Bi(e){for(var t=[],i=0;i<e.length;i+=3){var n=[];n.push(e[i]),n.push(e[i+1]),n.push(e[i+2]),t.push(n)}return t}function Ui(e,t,i,n,r,a){var s=new Array(3),o=new Cesium.Matrix4,l=(new Cesium.Matrix4,Object.keys(a.glTF.nodes));o=Cesium.Matrix4.fromArray(a.glTF.nodes[l[0]].matrix,0,o);for(var c=0;c<3;c++)s[c]=e.getFloat32(t+i*c,!0);var u=new Cesium.Cartesian3;u=Cesium.Matrix4.multiplyByPoint(o,new Cesium.Cartesian3(s[0],s[1],s[2]),u);var h=Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationX(Cesium.Math.PI_OVER_TWO)),d=new Cesium.Cartesian3;d=Cesium.Matrix4.multiplyByPoint(h,u,d);var m=Cesium.Cartesian3.fromArray(r.center,0),f=new Cesium.Cartesian3;return f=Cesium.Cartesian3.add(m,d,f),[f.x,f.y,f.z]}function Wi(e,t,i,n){function r(e){var t=e.componentType;switch(t){case 5120:case 5121:return 1;case 5122:case 5123:return 2;case 5126:return 4}}for(var a=i.glTF.extensions.CESIUM_RTC,s=(Cesium.Cartographic.fromCartesian(new Cesium.Cartesian3(a.center[0],a.center[1],a.center[2])),i.contentLength,[]),o=0;o<t.length;o++){var l=t[o];if(l.batchIdAccessor.min[0]<=n&&l.batchIdAccessor.max[0]>=n){var c=r(l.positionAccessor),u=r(l.batchIdAccessor),h=void 0,d=void 0;1===i.version?(h=null!=l.positionAccessor.byteStride?l.positionAccessor.byteStride:c,d=null!=l.batchIdAccessor.byteStride?l.batchIdAccessor.byteStride:u):(h=null!=l.positionBufferView.byteStride?l.positionBufferView.byteStride:c,d=null!=l.batchIdBufferView.byteStride?l.batchIdBufferView.byteStride:u);for(var m=l.positionBufferView,f=l.batchIdBufferView,y=new DataView(i.binaryData.buffer,i.binaryData.byteOffset+f.byteOffset,f.byteLength),g=new DataView(i.binaryData.buffer,i.binaryData.byteOffset+m.byteOffset,m.byteLength),v=null!=l.positionAccessor.byteOffset?l.positionAccessor.byteOffset:0,p=0,_=l.batchIdAccessor.byteOffset;p<l.batchIdAccessor.count;p++,_+=d){var b=y.getUint16(_,!0);if(b===n){var L=Ui(g,v+p*h,c,h,a,i);s.push(L)}}}}return s}function qi(e,t){function i(e,t){var i,n=0;for(i=0;i<e.length;i++)n+=Math.pow(e[i]-t[i],2);return n}for(var n,r=99999999999,a=0;a<t.length;a++){var s=Ri([],e.origin,e.direction,t[a]);if(null!=s){var o=i(e.origin,s);r>=o&&(r=o,n=s)}}return null==n?(console.error("No intersection found!"),null):n}function Ji(e,t,i,n){return Cesium.Resource.fetchArrayBuffer({url:e}).then(function(e){var r=zi(e),a=r.binaryGLTF,s=Gi(a),o=Vi(s.glTF),l=Wi(a,o,s,t),c=Bi(l),u={origin:[i.origin.x,i.origin.y,i.origin.z],direction:[i.direction.x,i.direction.y,i.direction.z]},h=qi(u,c);if(h)return Cesium.Cartesian3.fromElements(h[0],h[1],h[2],n)}).otherwise(function(e){console.error(e)})}var Ki,Zi=i(665),Qi=i.n(Zi),Xi=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.specificImpl={},i.active=i.activeOnStartup,i.options.commonLayer=f(i),i}return w(t,e),Object(m["a"])(t,[{key:"getImplementation",value:function(e){var t=e.id;return this.specificImpl[t]||(this.specificImpl[t]=this.getImplementationObject(e.className)),this.specificImpl[t]}},{key:"getImplementationObject",value:function(e){return Ee.specificLayerImpl[e]&&Ee.specificLayerImpl[e][this.className]?new Ee.specificLayerImpl[e][this.className](this.options):null}},{key:"isCommonLayer",value:function(){return!0}},{key:"initialize",value:function(){this.initialized=!0}},{key:"synchronizeImplementations",value:function(e,t){var i=Promise.resolve();if(e){var n=this.getImplementation(e);n&&(i=i.then(function(){return n.mapDeactivated(e)}))}if(t){var r=this.getImplementation(t);r&&(i=i.then(function(){return r.mapActivated(t)}))}return i}},{key:"activate",value:function(e){var t=this;return new Promise(function(i){var n=t.framework.getActiveMap(),r=t.getImplementation(n);if(r&&t.isSupported(n)){var a=r.initialized;if(e!==r.isActive())if(e){var s=r.initialize();if(s){var o=function(){this.initialize(),r.show(),this.sendLayerEvents(e,a),i()}.bind(t);s.then(o).catch(o)}else t.initialize(),r.show(),t.sendLayerEvents(e,a),i()}else{for(var l in t.specificImpl)t.specificImpl[l]&&t.specificImpl[l].initialized&&t.specificImpl[l].hide();t.sendLayerEvents(e,a),i()}else i()}else if(e)i();else{for(var l in t.specificImpl)t.specificImpl[l]&&t.specificImpl[l].initialized&&t.specificImpl[l].hide();t.sendLayerEvents(e,a),i()}})}},{key:"setStyle",value:function(e,i){Se(b(t.prototype),"setStyle",this).call(this,e,i),Object.values(this.specificImpl).forEach(function(e){e&&e.updateStyle(i)})}},{key:"sendLayerEvents",value:function(e,t){(e!==this.active||!t&&e)&&(this.active=e,e?this.framework.publish(B.LAYER_ACTIVATED,this):this.framework.publish(B.LAYER_DEACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this))}},{key:"dispose",value:function(){for(var e in this.specificImpl)this.specificImpl[e]&&this.specificImpl[e].dispose();this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}}]),t}(At),$i=Xi,en=he.interactionTypeCounter,tn={NONE:en=he.getNextBit(en),SELECT:en=he.getNextBit(en),TRANSLATE:en=he.getNextBit(en),ROTATE:en=he.getNextBit(en),SCALE:en=he.getNextBit(en),CREATE:en=he.getNextBit(en),EDIT:en=he.getNextBit(en),REMOVEVERTEX:en=he.getNextBit(en),TRANSLATEVERTEX:en=he.getNextBit(en),PAINTBUCKET:en=he.getNextBit(en),PIPETTE:en=he.getNextBit(en),FEATUREMODES:0,GEOMETRYMODES:0,PROPAGATEONSELECT:0};tn.FEATUREMODES=tn.SELECT|tn.TRANSLATE|tn.ROTATE|tn.SCALE|tn.PAINTBUCKET|tn.PIPETTE,tn.GEOMETRYMODES=tn.CREATE|tn.EDIT|tn.REMOVEVERTEX|tn.TRANSLATEVERTEX,tn.PROPAGATEONSELECT=tn.TRANSLATE|tn.PAINTBUCKET|tn.PIPETTE;var nn={EDITING:en=he.getNextBit(en),EDITABLE:en=he.getNextBit(en),VERTEX:en=he.getNextBit(en),HEIGHTVERTEX:en=he.getNextBit(en)},rn={none:tn.NONE,select:tn.SELECT,translate:tn.TRANSLATE,rotate:tn.ROTATE,scale:tn.SCALE,create:tn.CREATE,edit:tn.EDIT,removeVertex:tn.REMOVEVERTEX,translateVertex:tn.TRANSLATEVERTEX,paintBucket:tn.PAINTBUCKET,pipette:tn.PIPETTE,geometryModes:tn.GEOMETRYMODES,featureModes:tn.FEATUREMODES},an={CLAMP:1,ABSOLUTE:2,ZPLANE:4},sn={clampToGround:an.CLAMP,absolute:an.ABSOLUTE,zPlane:an.ZPLANE},on={both:Cesium.ClassificationType.BOTH,terrain:Cesium.ClassificationType.TERRAIN,cesium3DTile:Cesium.ClassificationType.CESIUM_3D_TILE},ln=(Ki={},Object(oe["a"])(Ki,on.both,"both"),Object(oe["a"])(Ki,on.terrain,"terrain"),Object(oe["a"])(Ki,on.cesium3DTile,"cesium3DTile"),Ki);function cn(e,t){if(e.image&&e.image.src&&/^data:/.test(e.image.src))if(t){var i=t.indexOf(e.image.src);-1===i&&(t.push(e.image.src),i=t.length-1),e.image.src=":".concat(i)}else e.image={radius:5};return e}function un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e[ne.configContentSymbol]?t.style=e.getReference():e instanceof gt?t.style=cn(e.getOptions(),t.embeddedIcons):e instanceof Tt&&(t.style=e.getOptions()),t}var hn=un;Dt.VECTOR=Dt.lastLayerId++,B.FEATURE_REMOVED="FEATURE_REMOVED";var dn=Symbol("alreadyTransformedToMercator"),mn=Symbol("alreadyTransformedToImage"),fn=Symbol("imageGeometryChanged"),yn=Symbol("obliqueGeometry"),gn=Symbol("doNotTransform"),vn=Symbol("OriginalFeature"),pn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype?e.layertype:Dt.VECTOR,e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.source=new ol.source.Vector({}),i.projection=new R(e.projection),i.maxResolution=null!=e.maxResolution?e.maxResolution:null,i.minResolution=null!=e.minResolution?e.minResolution:null,i.dontUseTerrainForOblique=!!e.dontUseTerrainForOblique,i.sourceProjection=i.projection.getProjection(),i._altitudeMode=e.altitudeMode||"relativeToGround",i._skirt=Object(u["g"])(e.skirt,null),i._storeyHeight=Object(u["g"])(e.storeyHeight,null),i._classificationType=e.classificationType,i.balloonHeightOffset=Object(u["h"])(e.balloonHeightOffset,10),i.zIndex=Object(u["h"])(e.zIndex,50),i.zCoordinateEyeOffset=Object(u["h"])(e.zCoordinateEyeOffset,0),i.heightAboveGround=null!=e.heightAboveGround?e.heightAboveGround:null,i.scaleByDistance=e.scaleByDistance||null,i.internalProjection=R.createMercatorProjection(),i.destinationProjection=i.internalProjection.getProjection(),i.highlightStyle=e.highlightStyle?new gt(e.highlightStyle):null,i.featureVisibility=e.featureVisibility||new Ct,i.hasFeatureUUID=!1,i.visibility=!0,i.isDynamic=e.isDynamic,i.FVlastUpdated=0,i._onStyleChangeRemover=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Vector"}},{key:"alreadyTransformedToMercator",get:function(){return dn}},{key:"alreadyTransformedToImage",get:function(){return mn}},{key:"imageGeometryChanged",get:function(){return fn}},{key:"obliqueGeometry",get:function(){return yn}},{key:"doNotTransform",get:function(){return gn}},{key:"originalFeatureSymbol",get:function(){return vn}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._trackStyleChanges()}},{key:"getVcsMeta",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={version:Yt};if(this.skirt&&(t.skirt=this.skirt),this.storeyHeight&&(t.storeyHeight=this.storeyHeight),this.classificationType&&(t.classificationType=this.classificationType),this.altitudeMode&&(t.altitudeMode=this.altitudeMode),e.embedIcons&&(t.embeddedIcons=[]),e.writeStyle){var i=this.getStyleOrDefaultStyle(this.options.activeStyleName||this.options.style);!e.writeDefaultStyle&&Qi()(i.getOptions(),this.style.getOptions())||hn(this.style,t)}return t}},{key:"setVcsMeta",value:function(e){e.skirt!==this.skirt&&(this.skirt=e.skirt),e.storeyHeight!==this.storeyHeight&&(this.storeyHeight=e.storeyHeight),e.altitudeMode&&e.altitudeMode!==this.altitudeMode&&(this.altitudeMode=e.altitudeMode),e.classificationType!==this.classificationType&&(this.classificationType=e.classificationType)}},{key:"getStyleOrDefaultStyle",value:function(e,i){return Se(b(t.prototype),"getStyleOrDefaultStyle",this).call(this,e,i||vt.clone())}},{key:"setStyle",value:function(e,i){var n=this;Se(b(t.prototype),"setStyle",this).call(this,e,i),this._trackStyleChanges();var r=e instanceof Tt;this.getFeatures().forEach(function(e){e[ft]&&(r?n.featureVisibility.highlightedObjects[e.getId()]&&n.featureVisibility.highlightedObjects[e.getId()].features.has(e)?n.featureVisibility.highlightedObjects[e.getId()].features.set(e,void 0):e.setStyle(void 0):e.getStyle()?n.featureVisibility.highlightedObjects[e.getId()]&&n.featureVisibility.highlightedObjects[e.getId()].features.has(e)&&n.featureVisibility.highlightedObjects[e.getId()].features.set(e,e[ft].style):e.setStyle(e[ft].style))})}},{key:"_trackStyleChanges",value:function(){var e=this;this._onStyleChangeRemover&&(this._onStyleChangeRemover(),this._onStyleChangeRemover=null);var t=this.style instanceof Tt;this._onStyleChangeRemover=this.style.styleChanged.addEventListener(function(){e.getFeatures().forEach(function(e){!t&&e[ft]||e.changed()})})}},{key:"setHighlightStyle",value:function(e){o(e,[ol.style.Style,gt,Function]),e instanceof gt?this.highlightStyle=e:(this.highlightStyle||(this.highlightStyle=new gt({})),this.highlightStyle.style=e)}},{key:"postRenderStyling",value:function(){if(this.FVlastUpdated<this.featureVisibility.lastUpdated||this.FVlastUpdated<this.globalHider.lastUpdated){if(this.visibility){for(var e=Object.keys(this.featureVisibility.highlightedObjects),t=e.length,i=0;i<t;i++){var n=e[i];if(!this.featureVisibility.hiddenObjects[n]){var r=this.getFeatureById(n);r&&(this.featureVisibility.highlightedObjects[n].features.has(r)||this.featureVisibility.highlightedObjects[n].features.set(r,r.getStyle()),r.getStyle()!==this.featureVisibility.highlightedObjects[n].style.style&&r.setStyle(this.featureVisibility.highlightedObjects[n].style.style))}}for(var a=Object.keys(this.featureVisibility.hiddenObjects),s=a.length,o=0;o<s;o++){var l=a[o],c=this.getFeatureById(l);c&&!this.featureVisibility.hiddenObjects[l].has(c)&&(c.setStyle(it.clone()),this.featureVisibility.hiddenObjects[l].add(c))}if(this.hasFeatureUUID)for(var u=Object.keys(this.globalHider.hiddenObjects),h=u.length,d=0;d<h;d++){var m=u[d],f=this.getFeatureById(m);f&&!this.globalHider.hasFeature(m,f)&&(f.setStyle(it.clone()),this.globalHider.addFeature(m,f))}}this.FVlastUpdated=Date.now()}}},{key:"getSource",value:function(){return this.source}},{key:"updateGeometryOfFeature",value:function(e,t){t=t.transform(this.sourceProjection,this.destinationProjection);var i=this.source.getFeatureById(e);i&&i.setGeometry(t)}},{key:"addFeatures",value:function(e){for(var i=[],n=null,r=this.style instanceof Tt,a=0;a<e.length;a++){if(n=e[a],null==n.getId())n.setId(Object(u["c"])());else{this.hasFeatureUUID=!0;var s=n.getId();if(s&&this.getFeatureById(s.toString())){i.push(s.toString());continue}}if(this.projection.getEPSG()!==this.internalProjection.getEPSG()){var o=n.getGeometry();o&&(o[t.alreadyTransformedToMercator]||(o.transform(this.sourceProjection,this.destinationProjection),o[t.alreadyTransformedToMercator]=!0))}this.zCoordinateEyeOffset&&!n.get("olcs_zCoordinateEyeOffset")&&n.set("olcs_zCoordinateEyeOffset",this.zCoordinateEyeOffset,!1),this.heightAboveGround&&!n.get("olcs_heightAboveGround")&&n.set("olcs_heightAboveGround",this.heightAboveGround,!1),this.scaleByDistance&&!n.get("olcs_scaleByDistance")&&n.set("olcs_scaleByDistance",this.scaleByDistance,!1),n[At.vcsLayerNameSymbol]=this.name,r&&n[ft]&&n.setStyle(),this.source.addFeature(n),i.push(n.getId())}return this.FVlastUpdated=0,i}},{key:"removeFeaturesById",value:function(e){for(var t=this.getFeaturesById(e),i=0;i<t.length;i++)this.source.removeFeature(t[i]),delete t[At.vcsLayerNameSymbol]}},{key:"removeAllFeatures",value:function(){this.source.clear()}},{key:"getFeaturesById",value:function(e){for(var t,i=[],n=null,r=0;r<e.length;r++)t=e[r],n=this.getFeatureById(t),n&&i.push(n);return i}},{key:"getFeatureById",value:function(e){-1!==String(e).indexOf("_OBLIQUE")&&(e=String(e).split("_OBLIQUE")[0]);var t=this.source.getFeatureById(e);return t}},{key:"getFeatures",value:function(){return this.source.getFeatures()}},{key:"setVisibility",value:function(e){var t=this.getImplementation(this.framework.getActiveMap());t&&t.setVisibility(e),this.visibility=e}},{key:"determineHighlightStyle",value:function(e,t){var i=t||this.source.getFeatureById(e);return i?this.highlightStyle?this.highlightStyle:this.framework.getSelectBehavior().determineDefaultVectorHighlightStyle(e,i,this):(this.logger.warning("No object found to highlight."),null)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){e=this.getFeatureById(e.getId());var n=e.getId();return this.raiseFeatureEvent(t,n,e,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){if(!(e instanceof ol.Feature))return null;var t=e.getProperties();delete t[e.getGeometryName()];var i=e.clickedPosition,n=e.getGeometry();if(n&&("Point"===n.getType()||i&&!i.exactPosition||!i&&n)){var r=ol.extent.getCenter(n.getExtent());r&&(R.mercatorToWgs84(r,!0),i={longitude:r[0],latitude:r[1]})}var a=hi(e,this.storeyHeight).max,s=!1,o=e.get("olcs_altitudeMode")||this.altitudeMode;return a&&(sn[o]===an.ABSOLUTE||e.get("olcs_extrudedHeight")||e.get("olcs_storeyNumber"))||(a=this.heightAboveGround,s=!0),a+=this.balloonHeightOffset,delete t.clickedPosition,{layerName:this.name,layerClass:this.className,attributes:Object.assign({},this._genericFeatureProperties,t),longitude:i.longitude,latitude:i.latitude,height:a,relativeToGround:s}}},{key:"isVisible",value:function(){return this.logger.deprecate("isVisible","Access the property visibility directly"),this.visibility}},{key:"getZCoordinateEyeOffset",value:function(){return this.logger.deprecate("zCoordinateEyeOffset","Access the property zCoordinateEyeOffset directly"),this.zCoordinateEyeOffset}},{key:"getHeightAboveGround",value:function(){return this.logger.deprecate("getHeightAboveGround","Access the property heightAboveGround directly"),this.heightAboveGround}},{key:"getZIndex",value:function(){return this.zIndex}},{key:"getAltitudeMode",value:function(){return this.logger.deprecate("altitudeMode","Access the property altitudeMode directly"),this.altitudeMode}},{key:"getScaleByDistance",value:function(){return this.logger.deprecate("scaleByDistance","Access the property scaleByDistance directly"),this.scaleByDistance}},{key:"getProjection",value:function(){return this.projection}},{key:"setProjection",value:function(e){this.projection=e}},{key:"getStyle",value:function(){return this.style}},{key:"getMaxResolution",value:function(){return this.maxResolution}},{key:"getMinResolution",value:function(){return this.minResolution}},{key:"altitudeMode",get:function(){return this._altitudeMode},set:function(e){this._altitudeMode=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_altitudeMode",e)})}},{key:"skirt",get:function(){return this._skirt},set:function(e){this._skirt=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_skirt",e)})}},{key:"storeyHeight",get:function(){return this._storeyHeight},set:function(e){this._storeyHeight=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_storeyHeight",e)})}},{key:"classificationType",get:function(){return this._classificationType},set:function(e){this._classificationType=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_classificationType",e)})}}]),t}($i),_n=pn,bn=null,Ln=new Cesium.Cartographic,Mn=new Cesium.Cartesian3,kn=new Cesium.Cartesian3,wn=function(e){function t(){var e;return Object(d["a"])(this,t),e=y(this,b(t).call(this)),e.activeMapHandler=e.pipeThrough,e._pickPosition=me.CLICK,e._pickPositionMask=-1,e.pickTranslucent=!0,e.pullPickedPosition=0,e.hitTolerance=10,e._defaultModificationKey=de.ALL,e._defaultActive=me.ALL^me.MOVE,e.setActive(),e}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.DRAG&&!(this._pickPosition&me.DRAG)?(bn&&(e.feature=bn),Promise.resolve(e)):(e.type&me.DRAGEND&&(bn=null),this.activeMapHandler(e).then(function(t){return e.type&me.DRAGSTART&&t.feature&&(bn=t.feature),e.type&me.DRAG&&bn&&(e.feature=bn),Promise.resolve(e)}))}},{key:"handleMapChange",value:function(e){this.activeMapHandler=e instanceof Hi?this._openlayersHandler.bind(this,e):e instanceof Pi?this._obliqueHandler.bind(this,e):e instanceof Vt?this._cesiumHandler.bind(this,e):this.pipeThrough}},{key:"setActive",value:function(e){"undefined"===typeof e&&(this.pickPosition=me.CLICK,this.pullPickedPosition=0),Se(b(t.prototype),"setActive",this).call(this,e)}},{key:"_openlayersHandler",value:function(e,t){var i=null,n=null;return e.ol3map.forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],function(e,t){return!e||null!=e.get("olcs_allowPicking")&&!0!==e.get("olcs_allowPicking")||(i=e,n=t),!0},{hitTolerance:this.hitTolerance}),i&&n&&(t.feature=i,i.get("features")&&(t.feature[At.vcsLayerNameSymbol]=n.get("name")),t.exactPosition=!0),Promise.resolve(t)}},{key:"_obliqueHandler",value:function(e,t){var i=null,n=null;return e.getOl3Map().forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],function(e,t){return e&&(i=e.get("features")&&!e[_n.originalFeatureSymbol]?e:e[_n.originalFeatureSymbol]),n=t,!0},{hitTolerance:this.hitTolerance}),i&&n&&(t.feature=i,i.get("features")&&(t.feature[At.vcsLayerNameSymbol]=n.get("name")),t.exactPosition=!0),Promise.resolve(t)}},{key:"_cesiumHandler",value:function(e,t){var i=this,n=e.getScene(),r=n.pick(t.windowPosition,this.hitTolerance,this.hitTolerance),a=function(){return Mn?(i.pullPickedPosition&&t.ray&&(kn=Cesium.Cartesian3.multiplyByScalar(t.ray.direction,i.pullPickedPosition,kn),Mn=Cesium.Cartesian3.subtract(Mn,kn,Mn)),Ln=Cesium.Cartographic.fromCartesian(Mn,n.globe.ellipsoid,Ln),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Ln.longitude),Cesium.Math.toDegrees(Ln.latitude),Ln.height],!0),t.positionOrPixel=t.position,n.pickTranslucentDepth=!1,Promise.resolve(t)):(Mn=new Cesium.Cartesian3,Promise.resolve(t))};if(r){if(r.primitive&&r.primitive.olFeature)t.feature=r.primitive.olFeature;else if(r.primitive&&r.primitive[At.vcsLayerNameSymbol]&&(r instanceof Cesium.Cesium3DTileFeature||r instanceof Cesium.Cesium3DTilePointFeature)){t.feature=r;for(var s=Object.getOwnPropertySymbols(r.primitive),o=s.length,l=0;l<o;l++)t.feature[s[l]]=r.primitive[s[l]]}else if(r.id&&r.id.olFeature)t.feature=r.id.olFeature;else if(r.id&&r.id[At.vcsLayerNameSymbol])t.feature=r,t.feature[At.vcsLayerNameSymbol]=r.id[At.vcsLayerNameSymbol];else if(Array.isArray(r.id)){if(1!==r.id.length)return Ln=Cesium.Cartographic.fromCartesian(r.primitive.position,null,Ln),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Ln.longitude),Cesium.Math.toDegrees(Ln.latitude),Ln.height],!0),t.positionOrPixel=t.position,t.feature=new ol.Feature({geometry:new ol.geom.Point(t.position),features:r.id.map(function(e){return e.olFeature})}),t.feature[At.vcsLayerNameSymbol]=r.id[0].olLayer.get("layerName"),Promise.resolve(t);t.feature=r.id[0].olFeature}else t.feature=r;if(!(t.type&this.pickPosition))return Promise.resolve(t);if(n.pickPositionSupported)return r.primitive&&this.pickTranslucent&&(n.pickTranslucentDepth=!0,n.render(e.getViewer().clock.currentTime),t.exactPosition=!0),Mn=n.pickPosition(t.windowPosition,Mn),a();if(r.content&&r.content.url&&null!=r._batchId){var c=t.ray||n.camera.getPickRay(t.windowPosition);return Ji(r.content.url,r._batchId,c,Mn).then(function(e){return e?a():Promise.resolve(t)})}}return Promise.resolve(t)}},{key:"pickPosition",get:function(){return this._pickPosition},set:function(e){this._pickPosition=e&this._pickPositionMask}},{key:"excludedPickPositionEvents",get:function(){return~this._pickPositionMask},set:function(e){this._pickPositionMask=~e}}]),t}(pe),Tn=wn,Sn=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.events=Object.assign({},e||B),i._defaultActive=me.CLICK,i._defaultModificationKey=de.NONE|de.CTRL,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(e.key&de.CTRL){if(e.feature&&e.feature[At.vcsLayerNameSymbol]){var t=ne.getInstance().getLayerByName(e.feature[At.vcsLayerNameSymbol]);t.objectClickedHandler(e.feature,B.FEATURE_CTRL_CLICKED)}return Promise.resolve(e)}if(!e.position.every(function(e){return 0===e})){var i=R.mercatorToWgs84(e.position),n=Object(Ie["a"])(i,3),r=n[0],a=n[1],s=n[2],o={latitude:a,longitude:r,height:s||0};if(e.obliqueParameters&&(o.obliqueParameters=e.obliqueParameters),this.raise(B.CLICKED,o),e.feature&&e.feature[At.vcsLayerNameSymbol]){o.exactPosition=e.exactPosition,e.feature.clickedPosition=o;var l=ne.getInstance().getLayerByName(e.feature[At.vcsLayerNameSymbol]);l.objectClickedHandler(e.feature,B.FEATURE_CLICKED)}else this.raise(B.MAP_CLICKED,o)}return Promise.resolve(e)}},{key:"raise",value:function(e){if(this.events[e]){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=ne.getInstance()).publish.apply(t,[e].concat(n))}}}]),t}(pe),On=Sn,Cn=new Fi,En=new Tn,In=new On,Dn=new be([Cn,En,In]),jn=null,Pn=function(){function e(){var t=this;Object(d["a"])(this,e),this.listeners=[],this.clickDuration=400,this.dragDuration=100,this._lastDown=null,this._lastClick={time:null,windowPosition:new Cesium.Cartesian2},this._dragging=null,this._running=!1,this._eventQueue=[];var i=ne.getInstance();i.subscribe("MAP_ACTIVATED",this.handleMapChange,this),this.handleMapChange(ne.getInstance().getActiveMap()),Dn.initialize();var n=function(){t._dragging=null,t._lastClick.time=null,t._lastDown=null,t._multiples=!1};i.getMapContainer().addEventListener("mouseout",n),this.removeMapContainerEventListener=function(){i.getMapContainer().removeEventListener("mouseout",n)},this._exclusiveInteraction=null,this._exclusiveFrameworkKey=null,this._multiples=!1}return Object(m["a"])(e,[{key:"addExclusiveInteraction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0;return o(e,pe),o(t,Function),o(i,Number),l(n,String),this._exclusiveInteraction&&this._exclusiveInteraction.id!==n&&this._removeExclusive(),e.handleMapChange(ne.getInstance().getActiveMap()),Dn.addInteraction(e,i),this._exclusiveInteraction?(this._exclusiveInteraction.interactions.push(e),this._exclusiveInteraction.cb.push(t)):this._exclusiveInteraction={id:n||Object(u["c"])(),cb:[t],interactions:[e]},null===this._exclusiveFrameworkKey&&(this._exclusiveFrameworkKey=ne.getInstance().subscribeExclusive(B.CLICKED,function(){},"vcs:EventHandler",this._removeExclusive.bind(this))),this._exclusiveUnListen.bind(this,e,this._exclusiveInteraction.id)}},{key:"_removeExclusive",value:function(){this._exclusiveInteraction&&(this._exclusiveInteraction.interactions.filter(function(e){return e}).forEach(function(e){Dn.removeInteraction(e)}),this._exclusiveInteraction.cb.filter(function(e){return e}).forEach(function(e){e()}),this._exclusiveInteraction=null)}},{key:"_exclusiveUnListen",value:function(e,t){if(!this._exclusiveInteraction||this._exclusiveInteraction&&this._exclusiveInteraction.id!==t)return 0;var i=Dn.removeInteraction(e),n=this._exclusiveInteraction.interactions.findIndex(function(t){return t&&t.id===e.id});return n>-1&&(this._exclusiveInteraction.interactions.splice(n,1,void 0),this._exclusiveInteraction.cb.splice(n,1,void 0)),this._exclusiveInteraction.interactions.every(function(e){return void 0===e})&&(this._exclusiveInteraction=null,ne.getInstance().unsubscribeByKey(this._exclusiveFrameworkKey),this._exclusiveFrameworkKey=null),-1!==i?1:0}},{key:"addPersistentInteraction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return o(e,pe),o(t,Number),e.handleMapChange(ne.getInstance().getActiveMap()),Dn.addInteraction(e,t),function(){return-1!==Dn.removeInteraction(e)?1:0}}},{key:"handleMapChange",value:function(e){this.listeners.forEach(function(e){e()}),this.listeners.splice(0),e instanceof Hi||e instanceof Pi?this._setupOpenlayersHandlers(e):e instanceof Vt&&this._setupCesiumHandlers(e),Dn.handleMapChange(e)}},{key:"_mouseDown",value:function(e,t,i){if(this._lastDown)this._multiples=!0;else{var n=e(t,i);0===n.windowPosition.x&&0===n.windowPosition.y||(this._lastDown=n,this._lastDown.time=Date.now())}}},{key:"_mouseUp",value:function(e,t,i){var n=e(t,i);return n.multipleTouch?(this._multiples=!0,void(this._lastDown=null)):this._multiples?(this._lastDown=null,void(this._multiples=!1)):(this._dragging?(n.type=me.DRAGEND,n.key=this._dragging.key,n.pointer=this._dragging.pointer,this._startChain(n)):this._lastDown&&(this._lastClick.time&&Date.now()-this._lastClick.time<this.clickDuration&&Cesium.Cartesian2.distanceSquared(this._lastClick.windowPosition,n.windowPosition)<12?(this._lastClick.time=null,n.type=me.DBLCLICK):(this._lastClick.time=Date.now(),Cesium.Cartesian2.clone(n.windowPosition,this._lastClick.windowPosition),n.type=me.CLICK),this._startChain(n)),this._dragging=null,void(this._lastDown=null))}},{key:"_mouseMove",value:function(e,t,i){var n=e(t,i);this._lastDown?this._dragging?(n.type=me.DRAG,n.key=this._dragging.key,n.pointer=this._dragging.pointer,this._startChain(n,!0)):!this._dragging&&Date.now()-this._lastDown.time>this.dragDuration&&(n=Object.assign({type:me.DRAGSTART},this._lastDown),this._dragging=n,this._startChain(n,!0)):(n.type=me.MOVE,this._startChain(n,!0))}},{key:"_startChain",value:function(e,t){this._running&&t||(this._running?this._eventQueue.push(e):(this._running=!0,Dn.pipe(e).then(this._endChain.bind(this)).catch(this._endChain.bind(this))))}},{key:"_endChain",value:function(){this._running=!1,this._eventQueue.length>0&&this._startChain(this._eventQueue.shift())}},{key:"_setupOpenlayersHandlers",value:function(e){var t=function(e,t){var i={"-1":fe.ALL,0:fe.LEFT,1:fe.MIDDLE,2:fe.RIGHT},n=t.originalEvent.shiftKey?de.SHIFT:de.NONE;n=t.originalEvent.ctrlKey?de.CTRL:n,n=t.originalEvent.altKey?de.ALT:n,n!==de.NONE&&t.preventDefault(),t.originalEvent.preventDefault();var r=[t.coordinate[0],t.coordinate[1],0];return{position:r,positionOrPixel:r,windowPosition:Cesium.Cartesian2.fromArray(t.pixel,0,new Cesium.Cartesian2),key:n,pointer:i[t.originalEvent.button||0]}},i=e.getOl3Map(),n=[];n.push(i.on("pointerdown",this._mouseDown.bind(this,t,null))),n.push(i.on("pointerup",this._mouseUp.bind(this,t,null))),n.push(i.on("pointermove",this._mouseMove.bind(this,t,null))),this.listeners=n.map(function(e){return function(){ol.Observable.unByKey(e)}})}},{key:"_setupCesiumHandlers",value:function(e){var t,i,n=this,r=(t={},Object(oe["a"])(t,Cesium.KeyboardEventModifier.ALT,de.ALT),Object(oe["a"])(t,Cesium.KeyboardEventModifier.CTRL,de.CTRL),Object(oe["a"])(t,Cesium.KeyboardEventModifier.SHIFT,de.SHIFT),t),a=function(t,i){var n=t.mod,a=t.pointer,s=e.eventHandler._positions.length>1;return{windowPosition:i.position||i.endPosition,key:r[n]||de.NONE,pointer:a,multipleTouch:s}},s=(i={},Object(oe["a"])(i,Cesium.ScreenSpaceEventType.LEFT_DOWN,{handler:this._mouseDown,pointer:fe.LEFT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.LEFT_UP,{handler:this._mouseUp,pointer:fe.LEFT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.RIGHT_DOWN,{handler:this._mouseDown,pointer:fe.RIGHT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.RIGHT_UP,{handler:this._mouseUp,pointer:fe.RIGHT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MIDDLE_DOWN,{handler:this._mouseDown,pointer:fe.MIDDLE}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MIDDLE_UP,{handler:this._mouseUp,pointer:fe.MIDDLE}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MOUSE_MOVE,{handler:this._mouseMove,pointer:fe.ALL}),i);Object.keys(s).forEach(function(t){var i=Object.keys(r);i.push(void 0),i.forEach(function(i){var r=s[t],o=r.handler,l=r.pointer;null!=i?(e.eventHandler.setInputAction(o.bind(n,a,{mod:i,pointer:l}),t,i),n.listeners.push(function(){e.eventHandler.removeInputAction(t,i)})):(e.eventHandler.setInputAction(o.bind(n,a,{mod:i,pointer:l}),t),n.listeners.push(function(){e.eventHandler.removeInputAction(t)}))})})}},{key:"positionInteraction",get:function(){return Cn}},{key:"featureInteraction",get:function(){return En}},{key:"eventEmitter",get:function(){return In}},{key:"interactions",get:function(){return Dn.chain.slice()}}],[{key:"destroy",value:function(){jn&&(jn._removeExclusive(),jn.listeners.forEach(function(e){e()}),jn.removeMapContainerEventListener()),jn=null}}]),e}(),Yn=Pn;function xn(){return null===jn&&(jn=new Pn),jn}function An(e){for(var t=e.getPropertyNames(),i={},n=0;n<t.length;n++)i[t[n]]=e.getProperty(t[n]);return null==i.id&&(i.id="".concat(e.content.url).concat(e._batchId)),i.attributes?i.attributes.gmlId=i.id:null==i.gmlId&&(i.gmlId=i.id),i.clickedPosition=e.clickedPosition?e.clickedPosition:{},i}var Fn=Symbol("_lastUpdated"),Nn=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.url&&!/\.json$/.test(i.url)&&(i.url="".concat(i.url.replace(/\/$/,""),"/tileset.json")),i.featureVisibility=e.featureVisibility||new Ct,i.highlightStyle=e.highlightStyle?new gt(e.highlightStyle):null,i.jumpToLocation=!!e.jumpToLocation,i.screenSpaceError=Object(u["h"])(e.screenSpaceError,16),i.screenSpaceErrorMobile=Object(u["h"])(e.screenSpaceErrorMobile,32),i.maximumMemoryUsage=Object(u["h"])(e.maximumMemoryUsage,16);var n=e.tilesetOptions||{};return i.tilesetOptions=Object.assign({url:i.url,maximumScreenSpaceError:i.framework.isMobile()?i.screenSpaceErrorMobile:i.screenSpaceError,maximumMemoryUsage:i.maximumMemoryUsage},n),i._styleLastUpdated=Date.now(),i._loadProgressListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.AbstractCesiumTilesetLayer"}},{key:"lastUpdated",get:function(){return Fn}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;this.initialized||(this.cesium3DTileset=new Cesium.Cesium3DTileset(this.tilesetOptions),this.cesium3DTileset[At.vcsLayerNameSymbol]=this.name,this.cesium3DTileset.tileVisible.addEventListener(this.applyStyle.bind(this)),this.cesium3DTileset.tileUnload.addEventListener(function(e){delete e[t.lastUpdated]}),this.layerLoadingEventListener=function(e,t){0===e&&0===t?this.framework.getActiveMap().setLayerLoading(this,!1):this.framework.getActiveMap().setLayerLoading(this,!0)}.bind(this),this.jumpToLocation&&this.cesium3DTileset.readyPromise.then(function(t){var i=e.framework.getActiveMap();i.getCesiumWidget().camera.viewBoundingSphere(t.boundingSphere,new Cesium.HeadingPitchRange(0,-2,0)),i.getCesiumWidget().camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}),this.initialized=!0,this.setStyle(this.style))}},{key:"show",value:function(){var e=this.framework.getActiveMap();e&&"vcs.vcm.maps.Cesium"===e.className&&(e.getScene().primitives.contains(this.cesium3DTileset)||e.getScene().primitives.add(this.cesium3DTileset)),this._loadProgressListener||(this._loadProgressListener=this.cesium3DTileset.loadProgress.addEventListener(this.layerLoadingEventListener)),this.cesium3DTileset.show=!0}},{key:"hide",value:function(){this._loadProgressListener&&(this._loadProgressListener(),this._loadProgressListener=null),this.cesium3DTileset.show=!1,this.framework.getActiveMap().setLayerLoading(this,!1)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){var n=An(e);if(n)return this.raiseFeatureEvent(t,n.id,n,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=Object.assign({},this._genericFeatureProperties,e.attributes||e);return{layerName:this.name,layerClass:this.className,attributes:t,longitude:e.clickedPosition.longitude,latitude:e.clickedPosition.latitude,height:e.clickedPosition.height,relativeToGround:!1}}},{key:"getCesium3DTileset",value:function(){return this.logger.warning("Function getCesium3DTileset is deprecated and will be removed in the next release. Access the property cesium3DTileset directly instead"),this.cesium3DTileset}},{key:"setStyle",value:function(e,i){var n=this;Se(b(t.prototype),"setStyle",this).call(this,e,i),this.initialized&&(this.cesium3DTileset.style=this.style.cesiumStyle,this._onStyleChangeRemover&&this._onStyleChangeRemover(),this._onStyleChangeRemover=this.style.styleChanged.addEventListener(function(){n.cesium3DTileset.makeStyleDirty(),n._styleLastUpdated=Date.now(),n._lastUpdated=Date.now()}),this._styleLastUpdated=Date.now(),this.featureVisibility.lastUpdated=Date.now(),this.cesium3DTileset.readyPromise.then(function(){n.cesium3DTileset.colorBlendMode!==n.style.colorBlendMode&&(n.style.colorBlendMode!==Cesium.Cesium3DTileColorBlendMode.HIGHLIGHT?n.cesium3DTileset.extras&&n.cesium3DTileset.extras._3DTILESDIFFUSE&&(n.cesium3DTileset.colorBlendMode=n.style.colorBlendMode):n.cesium3DTileset.colorBlendMode=n.style.colorBlendMode)}))}},{key:"applyStyle",value:function(e){if(e.content instanceof Cesium.Composite3DTileContent)for(var t=0;t<e.content.innerContents.length;t++)this.styleContent(e.content.innerContents[t]);else this.styleContent(e.content)}},{key:"styleContent",value:function(e){if(!e[t.lastUpdated]||e[t.lastUpdated]<this.featureVisibility.lastUpdated||e[t.lastUpdated]<this.globalHider.lastUpdated||e[t.lastUpdated]<this._styleLastUpdated){for(var i=e.featuresLength,n=0;n<i;n++){var r=e.getFeature(n);if(r){var a=r.getProperty("id");a||(a="".concat(e.url).concat(n)),this.featureVisibility.highlightedObjects[a]&&((!this.featureVisibility.highlightedObjects[a].features.has(r)||this._styleLastUpdated>e[t.lastUpdated])&&this.featureVisibility.highlightedObjects[a].features.set(r,r.color.clone()),r.color=this.featureVisibility.highlightedObjects[a].style.cesiumFillColor),this.featureVisibility.hiddenObjects[a]?(this.featureVisibility.hiddenObjects[a].add(r),r.show=!1):this.globalHider.hiddenObjects[a]&&(this.globalHider.addFeature(a,r),r.show=!1)}}e[t.lastUpdated]=Date.now()}}},{key:"determineHighlightStyle",value:function(){return this.highlightStyle?this.highlightStyle:Q.getInstance()._currentItemHighlightColor}},{key:"setMaximumScreenSpaceError",value:function(e){this.cesium3DTileset&&(this.cesium3DTileset.maximumScreenSpaceError=e)}},{key:"dispose",value:function(){if(this.cesium3DTileset){this.hide();var e=this.framework.getMapByType("vcs.vcm.maps.CesiumMap"),t=!1;e&&e.initialized&&(t=e.getScene().primitives.remove(this.cesium3DTileset)),t||this.cesium3DTileset.destroy(),this.cesium3DTileset=null}this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"handleURLParameter",value:function(e){e.debug&&(this.cesium3DTileset?(this.cesium3DTileset.debugShowRenderingStatistics=!0,this.cesium3DTileset.debugShowBoundingVolume=!0,this.cesium3DTileset.debugShowContentBoundingVolume=!0):(this.tilesetOptions.debugShowRenderingStatistics=!0,this.tilesetOptions.debugShowBoundingVolume=!0,this.tilesetOptions.debugShowContentBoundingVolume=!0))}}]),t}(At),Hn=Nn;Dt.CESIUM_TILESET_LAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Rn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype||Dt.CESIUM_TILESET_LAYER,e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.pickMode=e.pickMode||"topLevelFeature",i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.CesiumTilesetLayer"}}]),t}(Hn),zn=Rn;Dt.CESIUM_BUILDINGSLAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Gn=function(e){function t(e){return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_BUILDINGSLAYER,e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Buildings"}}]),t}(zn),Vn=Gn;Dt.CESIUM_ENTITIESLAYER=Dt.lastLayerId++;var Bn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_ENTITIESLAYER,e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.dataSource=e.dataSource||new Cesium.CustomDataSource(i.name),i.entities=i.dataSource.entities,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Entities"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=this.framework.getActiveMap();e.getDatasources().add(this.dataSource),this.initialized=!0}}},{key:"getEntities",value:function(){return this.logger.deprecate("getEntities","access the entities property directly"),this.entities}},{key:"getDataSource",value:function(){return this.logger.deprecate("getEntities","access the dataSource property directly"),this.dataSource}},{key:"show",value:function(){this.dataSource.show=!0}},{key:"hide",value:function(){this.dataSource.show=!1}},{key:"dispose",value:function(){if(this.entities.removeAll(),this.initialized){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");e&&e.getDatasources().contains(this.dataSource)&&e.getDatasources().remove(this.dataSource)}this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"hideObjects",value:function(e){e.forEach(function(e){var t=this.entities.getById(e);t&&(t.show=!1)},this)}},{key:"showObjects",value:function(e){e.forEach(function(e){var t=this.entities.getById(e);t&&(t.show=!0)},this)}},{key:"addEntity",value:function(e,t,i){var n=this.entities.add(e);return n[At.vcsLayerNameSymbol]=this.name,n.attributes=t||null,n.allowPicking=null!=i?i:this.allowPicking,n.id}},{key:"flyToEntity",value:function(e){var t=this.framework.getActiveMap(),i=this.entities.getById(e);if(i){var n,r,a=t.getDataSourceDisplay(),s=t.getScene(),o=s.camera,l=new Cesium.BoundingSphere,c=t.getViewPoint(),u=c.getHeading(),h=c.getPitch(),d=new Cesium.HeadingPitchRange(Cesium.Math.toRadians(u),Cesium.Math.toRadians(h<-45?h:-45),void 0),m=0,f=a.defaultDataSource;if(f.isLoading)r=f.loadingEvent.addEventListener(function(){n=s.postRender.addEventListener(y),r()});else n=s.postRender.addEventListener(y)}else this.logger.warning("could not find entity on this layer");function y(){var e=a.getBoundingSphere(i,!0,l);if(e!==Cesium.BoundingSphereState.PENDING){if(e===Cesium.BoundingSphereState.FAILED)return m++,void(m>3&&n());o.flyToBoundingSphere(l,{duration:1,offset:d}),n()}}}},{key:"removeObjectById",value:function(e){return this.entities.removeById(e)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking&&e.id.allowPicking){var n=e.id.id,r=e.id;return r.clickedPosition=e.clickedPosition,this.raiseFeatureEvent(t,n,r,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=Object.assign({},this._genericFeatureProperties,e.attributes||{});return{layerName:this.name,layerClass:this.className,attributes:t,longitude:e.clickedPosition.longitude,latitude:e.clickedPosition.latitude,height:e.clickedPosition.height,relativeToGround:!1}}}]),t}(At),Un=Bn;Dt.CESIUM_CZMLLAYER=Dt.lastLayerId++;var Wn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_CZMLLAYER,e.className=t.className,e.dataSource=new Cesium.CzmlDataSource,i=y(this,b(t).call(this,e)),i._loadedResolve=function(){},i._loadedReject=function(){},i.loaded=new Promise(function(e,t){i._loadedResolve=e,i._loadedReject=t}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Czml"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){Se(b(t.prototype),"initialize",this).call(this);var e=this.dataSource.load(this.url);return e.then(this._handleLoaded.bind(this),this._loadedReject),this.initialized=!0,e}}},{key:"_handleLoaded",value:function(){var e=this;this.entities.values.forEach(function(t){t[At.vcsLayerNameSymbol]=e.name,t.allowPicking=e.allowPicking}),this._loadedResolve()}}]),t}(Un),qn=Wn;Dt.CESIUM_GLTFLAYER=Dt.lastLayerId++;var Jn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_GLTFLAYER,e.className=t.className,i=y(this,b(t).call(this,e)),i.modelConfigs=e.models||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Gltf"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(Se(b(t.prototype),"initialize",this).call(this),this.modelConfigs.forEach(this.addObject,this))}},{key:"addObject",value:function(e){var t=this.getEntityOptionsFromModel(e);if(!t)return null;var i={uri:t.url,scale:t.scale};i=e.modelOptions?Object.assign({},e.modelOptions,i):i;var n={name:t.url,position:t.position,orientation:t.orientation,show:t.show,model:i};return this.addEntity(n,t.attributes,t.allowPicking)}},{key:"getEntityOptionsFromModel",value:function(e){var t={};if("string"!==typeof e.url)return this.logger.warning("Could not find URL for model ".concat(e)),null;t.url=e.url;var i=[e.longitude,e.latitude,e.height].every(function(e){return Number.isFinite(e)});if(!i)return this.logger.warning("Could not find longitude/latitude/height for model".concat(e)),null;t.position=Cesium.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height);var n=0;Number.isFinite(e.heading)?n=e.heading/180*Math.PI:Number.isFinite(e.rotation)&&(n=e.rotation/180*Math.PI);var r=0;Number.isFinite(e.pitch)&&(r=e.pitch/180*Math.PI);var a=0;Number.isFinite(e.roll)&&(a=e.roll/180*Math.PI);var s=new Cesium.HeadingPitchRoll(n,r,a);return t.orientation=Cesium.Transforms.headingPitchRollQuaternion(t.position,s),t.scale=1,Number.isFinite(e.scale)&&(t.scale=e.scale),t.attributes={},e.attributes&&(t.attributes=e.attributes),t.allowPicking=null==e.allowPicking||e.allowPicking,t.show=null==e.show||e.show,t}},{key:"updateEntityById",value:function(e,t){var i=this.entities.getById(e),n=this.getEntityOptionsFromModel(t);i&&n&&(i.model.scale=n.scale,i.orientation=n.orientation,i.position=n.position,i.attributes=n.attributes,i.allowPicking=n.allowPicking)}}]),t}(Un),Kn=Jn;Dt.CESIUM_POINTCLOUDLAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Zn=new Tt({}),Qn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_POINTCLOUDLAYER,e.className=t.className,i=y(this,b(t).call(this,e)),i.defaultPointSize=null!=e.pointSize?e.pointSize:null,i._pointSize=i.defaultPointSize,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.PointCloud"}}]),Object(m["a"])(t,[{key:"getStyleOrDefaultStyle",value:function(e,i){return Se(b(t.prototype),"getStyleOrDefaultStyle",this).call(this,e,i||Zn)}},{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._assignPointSize()}},{key:"clearStyle",value:function(){Se(b(t.prototype),"clearStyle",this).call(this),this.pointSize=this.defaultPointSize}},{key:"setStyle",value:function(e,i){e instanceof gt?this.logger.warning("trying to apply vector style to point cloud layer."):Se(b(t.prototype),"setStyle",this).call(this,e,i)}},{key:"_assignPointSize",value:function(){this.initialized&&(this.cesium3DTileset.style?(this.cesium3DTileset.style.pointSize=this._pointSize,this.cesium3DTileset.makeStyleDirty()):null!=this._pointSize&&(this.cesium3DTileset.style=new Cesium.Cesium3DTileStyle({pointSize:this._pointSize})))}},{key:"pointSize",set:function(e){l(e,[Number,String]),this._pointSize=e,this._assignPointSize()},get:function(){return this._pointSize}}]),t}(Hn),Xn=Qn,$n=Symbol("vcsFeatureType"),er={DYNAMIC:"dynamic",STATIC:"static",EDITED:"edited"},tr=new ol.format.GeoJSON,ir="EPSG:3857",nr=new ol.Sphere(6378137),rr=Y.getLogger("vcs.vcm.layer.GeoJSONHelper");function ar(e){var t=Object(Ie["a"])(e[e.length-1],2),i=t[0],n=t[1];e[0][0]===i&&e[0][1]===n||e.push(e[0].slice())}function sr(e){var t=Object(Ie["a"])(e[e.length-1],2),i=t[0],n=t[1];e[0][0]===i&&e[0][1]===n&&e.pop()}function or(e){if(e instanceof ol.geom.Polygon){var t=e.getCoordinates();t.forEach(function(e){sr(e)}),e.setCoordinates(t)}else if(e instanceof ol.geom.MultiPolygon){var i=e.getCoordinates();i.forEach(function(e){e.forEach(function(e){sr(e)})}),e.setCoordinates(i)}}function lr(e){var t=e.crs;if(t){if("name"===t.type)return t.properties.name;if("EPSG"===t.type)return"EPSG:".concat(t.properties.code)}return null}function cr(e){if(e.get("altitudeMode")&&(e.set("olcs_altitudeMode",e.get("altitudeMode"),!0),e.unset("altitudeMode",!0)),e.get("extrudedHeight")){if(e.get("drawingType"))e.set("olcs_extrudedHeight",e.get("extrudedHeight"),!0);else{var t=hi(e).min;e.set("olcs_extrudedHeight",e.get("extrudedHeight")-t,!0)}e.unset("extrudedHeight",!0)}e.get("skirt")&&(e.set("olcs_skirt",e.get("skirt"),!0),e.unset("skirt",!0)),e.get("radius")&&e.unset("radius",!0)}function ur(e,t){var i=tr.readGeometry(e,t.formatOptions);return"EPSG:3857"===String(t.formatOptions.featureProjection)&&(i[_n.alreadyTransformedToMercator]=!0),or(i),new ol.Feature({geometry:i})}function hr(e,t){return e.image&&e.image.src&&/^:\d+$/.test(e.image.src)&&(t.embeddedIcons?e.image.src=t.embeddedIcons[e.image.src.substring(1)]:delete e.image.src),e}function dr(e,t){var i=!!e.color&&Be(e.color),n=e.width||1.25,r=e.pointRadius||5,a=e.opacity||.8;if(delete e.color,delete e.width,delete e.pointRadius,delete e.opacity,"Polygon"===t||"Circle"===t){var s=i?i.slice():[255,255,255,.4];return s[3]=a,{fill:{color:s},stroke:{color:i||Be("#3399CC"),width:n}}}return"LineString"===t?{stroke:{color:i||Be("#3399CC"),width:n}}:"Point"===t?{image:{fill:{color:[255,255,255,.4]},radius:r,stroke:{color:i||Be("#3399CC"),width:1}}}:void 0}function mr(e,t){if(!e.geometry)return null;var i=e.geometry.olcs_radius,n=tr.readGeometry(e.geometry,t.formatOptions);if(e.radius&&n instanceof ol.geom.Point){var r=n.getCoordinates();2===r.length&&r.push(0),n=new ol.geom.Circle(r,e.radius,"XYZ")}if(i&&n instanceof ol.geom.Point){var a=n.getCoordinates();2===a.length&&a.push(0),n=gi(a,i)}"EPSG:3857"===String(t.formatOptions.featureProjection)&&(n[_n.alreadyTransformedToMercator]=!0),e.vcsMeta=e.vcsMeta||{},e.vcsStyle&&(e.vcsMeta.style=e.vcsMeta.style||e.vcsStyle);var s=e.properties;t.readLegacyStyleOptions&&!e.vcsMeta.style&&(e.vcsMeta.style=dr(s,n.getType())),or(n);var o,l=new ol.Feature(Object.assign({},s,{geometry:n}));(e.id&&l.setId(e.id),e.state&&(l[$n]=e.state),e.vcsMeta.style&&!t.dontReadStyle)&&(e.vcsMeta.style=hr(e.vcsMeta.style,t),t.defaultStyle?(o=t.defaultStyle.clone().assign(new gt(e.vcsMeta.style)),null!=o.label&&n.set("_vcsGeomType","Label")):o=new gt(e.vcsMeta.style),l[ft]=o,l.setStyle(o.style));return cr(l),l}function fr(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"===typeof e?JSON.parse(e):e,r=lr(n),a=r?{epsg:r}:i.dataProjection,s={formatOptions:{dataProjection:a?a.epsg:R.createGeographicProjection().epsg,featureProjection:i.targetProjection?i.targetProjection.epsg:R.createMercatorProjection().epsg},dontReadStyle:i.dontReadStyle,readLegacyStyleOptions:i.readLegacyStyleOptions,defaultStyle:i.defaultStyle};if(i.dynamicStyle&&!s.defaultStyle&&(s.defaultStyle=vt),"FeatureCollection"===n.type)return n.vcsMeta=n.vcsMeta||{embeddedIcons:n.vcsEmbeddedIcons,style:n.vcsStyle},n.vcsMeta.embeddedIcons&&(s.embeddedIcons=n.vcsMeta.embeddedIcons),n.vcsMeta.style&&i.dynamicStyle&&(n.vcsMeta.style.type===Fe.REFERENCE?(t=ne.getInstance().getStyleByName(n.vcsMeta.style.name),t?t instanceof gt&&(s.defaultStyle=t):rr.warning("could not load referenced style ".concat(n.vcsMeta.style.name))):n.vcsMeta.style.type===Fe.DECLARATIVE?t=new Tt(n.vcsMeta.style):(n.vcsMeta.style=hr(n.vcsMeta.style,s),s.defaultStyle=s.defaultStyle.clone().assign(new gt(n.vcsMeta.style)),t=s.defaultStyle)),{features:n.features.map(function(e){return mr(e,s)}).filter(function(e){return e}),style:n.vcsMeta.style?t:void 0,vcsMeta:n.vcsMeta?n.vcsMeta:void 0};if("Feature"===n.type){var o=mr(n,s);return{features:o?[o]:[],vcsMeta:n.vcsMeta?n.vcsMeta:void 0}}return null!=n.type?{features:[ur(n,s)]}:{features:[]}}function yr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={type:"Feature",properties:e.getProperties()};t.writeId&&(n.id=e.getId()),delete n.properties[e.getGeometryName()],delete n.properties.style,delete n.properties.olcs_allowPicking;var r=e.getGeometry(),a=null;if(r instanceof ol.geom.Circle){var s=r.getCoordinates();a=nr.haversineDistance(R.mercatorToWgs84(s[0],!0),R.mercatorToWgs84(s[1],!0)),r=new ol.geom.Point(r.getCenter())}else if(r instanceof ol.geom.Polygon){var o=r.getCoordinates();o.forEach(function(e){ar(e)}),r.setCoordinates(o)}else if(r instanceof ol.geom.MultiPolygon){var l=r.getCoordinates();l.forEach(function(e){e.forEach(function(e){ar(e)})}),r.setCoordinates(l)}return n.geometry=tr.writeGeometryObject(r,{featureProjection:ir,rightHanded:!0}),a&&(n.geometry.olcs_radius=a),n.vcsMeta={},t.writeStyle&&e[ft]&&(n.vcsMeta.style=cn(e[ft].getOptionsForFeature(e),i)),n}function gr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.vcsMeta||{};i.version=Yt;var n=e.features.map(function(e){return yr(e,t,i.embeddedIcons)}),r={type:"FeatureCollection",features:n,vcsMeta:i};return t.writeStyle&&e.style&&(rr.deprecate("data.style","use layer.getVcsMeta and pass that in instead"),hn(e.style,r.vcsMeta)),t.asObject?r:JSON.stringify(r,null,t.prettyPrint?2:null)}Dt.GEOJSON=Dt.lastLayerId++;var vr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,e.projection||(e.projection=R.createGeographicProjection().getConfigObject()),i=y(this,b(t).call(this,e)),i.url=e.url||null,i.altitudeMode=e.altitudeMode||"none",i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.GeoJSON"}}]),Object(m["a"])(t,[{key:"fetchData",value:function(){var e=this;return this._dataFetchedPromise?this._dataFetchedPromise:null!=this.url?(this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.get(this.url).then(function(t){var i=t.data;e.dataFetchedHandler(i)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)}),this._dataFetchedPromise):(this.logger.warning("Could not load GeoJSON layer, no url is set"),Promise.reject(new Error("missing url in GeoJSON layer")))}},{key:"dataFetchedHandler",value:function(e){var t=fr(e,{dataProjection:this.projection,dynamicStyle:!0});this.addFeatures(t.features),t.style&&this.setStyle(t.style)}}]),t}(_n),pr=vr,_r=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.url=e.url||"";var n=null!=e.minLevel?e.minLevel:e.minZoom,r=null!=e.maxLevel?e.maxLevel:e.maxZoom;return i.minLevel=Object(u["h"])(n,0),i.maxLevel=Object(u["h"])(r,18),i.tilingSchema=e.tilingSchema,null==n&&e.extent&&i.calculateMinLevel(),i.opacity=Object(u["g"])(e.opacity,1),i.opacity=i.opacity<0?0:i.opacity,i.opacity=i.opacity>1?1:i.opacity,"string"!==typeof i.url&&i.framework.subscribe("LOCALE_CHANGED",i.handleLocaleChange,f(i)),i}return w(t,e),Object(m["a"])(t,[{key:"handleLocaleChange",value:function(){var e=this.isActive(),t=function(){Object.values(this.specificImpl).forEach(function(e){e.initialized=!1}),e&&this.activate(!0)}.bind(this);e?this.activate(!1).then(t):t()}},{key:"getUrl",value:function(){if("string"===typeof this.url)return this.url;var e=this.framework.getLocale();return this.url[e]?this.url[e]:Object.values(this.url)[0]}},{key:"getTilingScheme",value:function(){var e={};return this.numberOfLevelZeroTilesX&&this.numberOfLevelZeroTilesY&&(e.numberOfLevelZeroTilesX=this.numberOfLevelZeroTilesX,e.numberOfLevelZeroTilesY=this.numberOfLevelZeroTilesY),"mercator"===this.tilingSchema?new Cesium.WebMercatorTilingScheme(e):new Cesium.GeographicTilingScheme(e)}},{key:"_getExtentPoints",value:function(){var e=this.extent.getCoordinatesInProjection(R.createGeographicProjection()),t=[ol.extent.getBottomLeft(e),ol.extent.getBottomRight(e),ol.extent.getTopRight(e),ol.extent.getTopLeft(e)];return t.map(function(e){return Cesium.Cartographic.fromDegrees(e[0],e[1])})}},{key:"calculateMinLevel",value:function(){if(this.extent.isValid()){var e=this.getTilingScheme(),t=this._getExtentPoints();while(this.minLevel<this.maxLevel){var i=t.map(function(t){return e.positionToTileXY(t,this.minLevel)},this),n=[];if(n.push(Math.abs(i[0].x-i[1].x)),n.push(Math.abs(i[0].y-i[3].y)),n[0]>1||n[1]>1){this.minLevel=this.minLevel-1;break}this.minLevel=this.minLevel+1}}}},{key:"setOpacity",value:function(e){this.opacity=e,Object.values(this.specificImpl).forEach(function(e){e.updateOpacity()})}}]),t}($i),br=_r;Dt.IMAGE=Dt.lastLayerId,Dt.lastLayerId+=1;var Lr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.IMAGE,e.className=t.className,i=y(this,b(t).call(this,e)),i.imageExtent=e.imageExtent,i.credit=e.credit,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.SingleImage"}}]),Object(m["a"])(t,[{key:"setExtent",value:function(e){this.imageExtent=e;var t=this.getImplementation(this.framework.getActiveMap());t&&t.updateLayer()}}]),t}(br),Mr=Lr;Dt.OPENSTREETMAP=Dt.lastLayerId++;var kr=function(e){function t(e){return Object(d["a"])(this,t),e.layertype=Dt.OPENSTREETMAP,e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.OpenStreetMap"}}]),t}($i),wr=kr;Dt.TMSBase=Dt.lastLayerId++;var Tr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.TMSBase,e.className=t.className,e.tilingSchema=e.tilingSchema||"mercator",i=y(this,b(t).call(this,e)),i.format=e.format||"jpeg",i.tileWidth=Object(u["h"])(e.tileWidth,256),i.tileHeight=Object(u["h"])(e.tileHeight,256),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.TMSBase"}}]),t}(br),Sr=Tr;Dt.TILED_LAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Or=Symbol("isTiledFeature"),Cr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype?e.layertype:Dt.TILED_LAYER,e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.featureVisibility=e.featureVisibility||new Ct,i.highlightStyle=null,e.highlightStyle&&(i.highlightStyle=e.highlightStyle instanceof gt?e.highlightStyle:new gt(e.highlightStyle)),i.cesiumTilesetLayerOptions=Object.assign({},e.cesiumTilesetLayerOptions,{featureVisibility:i.featureVisibility,highlightStyle:i.highlightStyle,genericFeatureProperties:i._genericFeatureProperties}),i.openlayersTiledLayerOptions=Object.assign({},e.openlayersTiledLayerOptions,{featureVisibility:i.featureVisibility,highlightStyle:i.highlightStyle,genericFeatureProperties:i._genericFeatureProperties}),i._dataFetched=!1,i.source=new ol.source.Vector({}),i.projection=R.createMercatorProjection(),i.sourceProjection=i.projection.getProjection(),i.internalProjection=R.createMercatorProjection(),i.zIndex=50,i.editing=null,i.addedEditingSymbol=!1,i.FVlastUpdated=0,i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.TiledLayer"}}]),Object(m["a"])(t,[{key:"getSource",value:function(){return this.source}},{key:"postRenderStyling",value:function(){_n.prototype.postRenderStyling.call(this)}},{key:"setEditing",value:function(e,t){this._dataFetched?this.addedEditingSymbol&&!t?(this.source.getFeatures().forEach(function(t){delete t[e]}),this.addedEditingSymbol=!1):t&&(this.addedEditingSymbol=!0,this.source.getFeatures().forEach(function(i){i[e]=t})):this.editing={symbol:e,featureType:t}}},{key:"getFeatureById",value:function(e){var t=e;return-1!==String(e).indexOf("_OBLIQUE")&&(t=String(e).split("_OBLIQUE")[0]),this.source.getFeatureById(t)}},{key:"initialize",value:function(){var e=this.framework.getActiveMap(),i="vcs.vcm.maps.Cesium"===e.className?!!this.cesiumTilesetLayerOptions.url:!!this.openlayersTiledLayerOptions.url;i&&Se(b(t.prototype),"initialize",this).call(this)}},{key:"activate",value:function(e){var i=this.framework.getActiveMap(),n="vcs.vcm.maps.Cesium"===i.className?!!this.cesiumTilesetLayerOptions.url:!!this.openlayersTiledLayerOptions.url;return n?Se(b(t.prototype),"activate",this).call(this,e):Promise.resolve()}},{key:"setHighlightStyle",value:function(e){this.highlightStyle=e}},{key:"determineHighlightStyle",value:function(e,t){var i=this.framework.getActiveMap();if(this.highlightStyle)return this.highlightStyle;if("vcs.vcm.maps.Cesium"===i.className){var n=this.getImplementation(this.framework.getActiveMap());return n.determineHighlightStyle()}return _n.prototype.determineHighlightStyle.call(this,e,t)}},{key:"setMaximumScreenSpaceError",value:function(e){var t=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(t){var i=this.getImplementation(t);i&&i.setMaximumScreenSpaceError(e)}}},{key:"fetchData",value:function(){var e=this;return this._dataFetchedPromise?this._dataFetchedPromise:(null!=this.openlayersTiledLayerOptions.url?(this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.get(this.openlayersTiledLayerOptions.url).then(function(t){var i=t.data,n=fr({features:i.features,type:"FeatureCollection"},{defaultStyle:e.defaultStyle instanceof gt?e.defaultStyle:vt}),r=n.features;r.forEach(function(e){e[Or]=!0}),_n.prototype.addFeatures.call(e,r),e.editing&&(e.setEditing(e.editing.symbol,e.editing.featureType),e.editing=null)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})):(this._dataFetched=!0,this._dataFetchedPromise=Promise.resolve()),this._dataFetchedPromise)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){var n=this.framework.getActiveMap();if((e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature)&&"vcs.vcm.maps.Cesium"===n.className){var r=this.getImplementation(n);return r.objectClickedHandler(e,t,i||this)}if(e instanceof ol.Feature&&("vcs.vcm.maps.Openlayers"===n.className||"vcs.vcm.maps.Oblique"===n.className))return _n.prototype.objectClickedHandler.call(this,e,t,i||this)}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=this.framework.getActiveMap(),i=this.getImplementation(t);return i?i.getGenericFeatureFromClickedObject(e):null}},{key:"screenSpaceErrorMobile",get:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(e){var t=this.getImplementation(e);if(t)return t.screenSpaceErrorMobile}return null}},{key:"screenSpaceError",get:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(e){var t=this.getImplementation(e);if(t)return t.screenSpaceError}return null}}]),t}($i),Er=Cr,Ir=i(66),Dr=i.n(Ir);Dt.CLUSTER=Dt.lastLayerId,Dt.lastLayerId+=1;var jr=function(e){function t(e){var i;Object(d["a"])(this,t),e.layertype=Dt.CLUSTER,e.className=t.className,e.zCoordinateEyeOffset=Object(u["h"])(e.zCoordinateEyeOffset,-200),e.heightAboveGround=Object(u["h"])(e.heightAboveGround,65),e.activeOnStartup=!0,e.altitudeMode=e.altitudeMode||"none",e.zIndex=Object(u["h"])(e.zIndex,60),i=y(this,b(t).call(this,e)),i.clusterSource=new ol.source.Cluster({source:i.source,distance:Object(u["h"])(e.clusterDistance,40)}),i.clusterLayers=e.clusterLayers||[],i.activeClusterLayers=[],i.activeClusterLayersLastUpdated={},i.lastClickedFeatures=[];var n=e.defaultFeatureTemplate||"<%=title%>";Array.isArray(n)&&(n=n.join(" ")),i.defaultFeatureTemplate=Dr()(n),i.showInContent=!!e.showInContent;var r=e.style||{};return i.icon=r.icon||"images/clusterIcon.svg",i.selectedIcon=r.selectedIcon||"images/clusterSelectedIcon.svg",i.iconWidth=Object(u["h"])(r.iconWidth,40),i.iconHeight=Object(u["h"])(r.iconHeight,44),i.iconScaleFactor=Object(u["h"])(r.iconScaleFactor,.05),i.fontSize=Object(u["h"])(r.fontSize,16),i.textOffset=Object(u["h"])(r.textOffset,-4),i.breaks=r.breaks||[2,3,4,5,10,15,20,25],i.zeroScaleOffset=Object(u["h"])(r.zeroScaleOffset,3),i._icons=new Array(i.breaks.length),i._selectedIcons=new Array(i.breaks.length),i._images=new Array(i.breaks.length),i._inactive2dClustering=!0,i._resultLayer=new _n({name:"_clusterResultLayer".concat(i.name),altitudeMode:i.altitudeMode,activeOnStartup:!0,zCoordinateEyeOffset:i.zCoordinateEyeOffset-20,zIndex:1e3,projection:R.createMercatorProjection().getConfigObject(),allowPicking:!1}),i._resultFeature=null,i._initialActivation=!1,i.framework.subscribe(B.LAYER_ACTIVATED,i._handleActivation.bind(f(i))),i.framework.subscribe(B.LAYER_DEACTIVATED,i._handleDeactivation.bind(f(i))),i.framework.subscribe(B.SELECTED_ITEM_CHANGED,i._handleSelectedItemChanged.bind(f(i))),i.mapNames=[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.VectorCluster"}}]),Object(m["a"])(t,[{key:"activate",value:function(e){var i=this;if(this.isSupported()){if(!e)return this.logger.warning("trying to deactivate cluster layer!"),Promise.reject(new Error("cannot deactivate cluster layer"));"vcs.vcm.maps.Openlayers"!==this.framework.getActiveMap().className?(this._inactive2dClustering=!0,this.clusterSource.setPause(!0)):(this._inactive2dClustering=!1,this.clusterSource.setPause(!1)),this.clusterLayers=this._validateLayers(this.clusterLayers);var n=Se(b(t.prototype),"activate",this).call(this,!0);return this._initialActivation?n:n.then(function(){return i.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"])}).then(this._createIcons.bind(this)).then(function(){i.setStyle(i._styleFunction.bind(i)),i._resultLayer.setStyle(i._getSelectedStyle()),i.framework.addLayer(i._resultLayer),i._initialActivation=!0})}return Promise.resolve()}},{key:"_validateLayers",value:function(e,t){var i=this;return e.filter(function(e){var n=i.framework.getLayerByName(e.name);if(!(n&&n instanceof _n))return i.logger.warning("Missconfigured cluster layer, failed with layer: ".concat(n)),!1;if("string"===typeof e.featureTemplate&&(e.featureTemplate=Dr()(e.featureTemplate)),n.heightAboveGround=i.heightAboveGround,n.altitudeMode=i.altitudeMode,n.setVisibility(!1),t){var r=i.clusterLayers.find(function(t){return t.name===e.name});r?(r.title=e.title||r.title,r.featureTemplate=e.featureTemplate||r.featureTemplate):i.clusterLayers.push(e)}return!0})}},{key:"_createIcons",value:function(){var e=this;function t(e,t,i,n,r){var a=this,s=t-this.zeroScaleOffset;s=s>0?s:0,s=r?s:s+.2;var o=Math.round(this.iconWidth*(1+this.iconScaleFactor*s)),l=Math.round(this.iconHeight*(1+this.iconScaleFactor*s));return new Promise(function(e){var t=document.createElement("canvas");t.width=o,t.height=l,canvg(t,i,{renderCallback:function(){e(t)}})}).then(function(i){return new Promise(function(n){var r,s=a.fontSize;r=t<a.zeroScaleOffset?e:"".concat(e,"+");var c='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(o,'" heigth="').concat(l,'" viewbox="0 0 ').concat(o," ").concat(l,'">')+'<text x="'.concat(o/2,'" y="').concat(l/2+s/2+a.textOffset,'" text-anchor="middle" ')+'lengthAdjust="spacingAndGlyphs" textLength="'.concat(o-20,'" ')+'font-size="'.concat(s,'" font-family="Arial" font-weight="bold">').concat(r,"</text></svg>"),u=document.createElement("canvas");u.width=o,u.height=l,canvg(u,c,{ignoreDimensions:!0,renderCallback:function(){var e=document.createElement("canvas");e.width=o,e.height=l;var t=e.getContext("2d");t.drawImage(i,0,0),t.drawImage(u,0,0),n(e)}})})}).then(function(e){return r&&(a._images[t]=e),n[t]=new ol.style.Style({image:new ol.style.Icon({img:e,imgSize:[o,l],anchor:[.5,.5]})}),Promise.resolve()})}var i=this.breaks.map(function(i,n){return Promise.all([t.bind(e)(i,n,e.icon,e._icons,!0),t.bind(e)(i,n,e.selectedIcon,e._selectedIcons,!1)])});return Promise.all(i)}},{key:"getSource",value:function(){return this.clusterSource}},{key:"_styleFunction",value:function(e){var t=this,i=e.get("features");if(i&&i.length>1){var n=i.length,r=this.breaks.findIndex(function(e,i){return i>t.zeroScaleOffset?n<e:n<=e});return r=r>this.zeroScaleOffset?r-1:r,-1===r?this._icons[this._icons.length-1]:this._icons[r]}var a=i?i[0]:e,s=a[_n.originalFeatureSymbol]||a,o=this.framework.getLayerByName(s.get("_layerName"));return o?s.getId()&&Q.getInstance().getCurrentItem().id===s.getId()?o.highlightStyle?o.highlightStyle.style:null:o.style.style:new ol.style.Style({})}},{key:"_getSelectedStyle",value:function(){return function(e){var t=this,i=e[_n.originalFeatureSymbol]||e,n=i.get("features");if(n&&n.length>1){var r=n.length,a=this.breaks.findIndex(function(e,i){return i>t.zeroScaleOffset?r<e:r<=e});return a=a>this.zeroScaleOffset?a-1:a,-1===a?this._selectedIcons[this._selectedIcons.length-1]:this._selectedIcons[a]}return this._selectedIcons[0]}.bind(this)}},{key:"cesiumStyleFunction",value:function(e,t){var i=this;if(!(e.length<2)){var n,r=e.length,a=this.breaks.findIndex(function(e,t){return t>i.zeroScaleOffset?r<e:r<=e});a=a>this.zeroScaleOffset?a-1:a,n=-1===a?this._images[this._images.length-1]:this._images[a],t.billboard.setImage(this.name+a,n),t.billboard.show=!0}}},{key:"objectClickedHandler",value:function(e,t,i){var n=this;this.unSelect();var r=e.get("features");if(r&&r.length>1){this.lastClickedFeatures.splice(0),r.forEach(function(e){var t=e[_n.originalFeatureSymbol]||e,i=n.clusterLayers.find(function(e){return e.name===t.get("_layerName")}),r=t.getProperties();r.template=i&&i.featureTemplate?i.featureTemplate(r):n.defaultFeatureTemplate(r),r.template=r.template.replace(/\[br\]/g,"<br>");var a={id:r.id,template:r.template,_layerName:r._layerName};n.lastClickedFeatures.push(a)}),this.raiseFeatureEvent(B.CLUSTER_CLICKED,"",r,this),this.framework.getSelectBehavior().clearCurrentItem();var a=e.getGeometry().clone();return a[_n.alreadyTransformedToImage]="vcs.vcm.maps.Oblique"===this.framework.getActiveMap().className,this._resultFeature=new ol.Feature({geometry:a,features:this.lastClickedFeatures}),this._resultLayer.addFeatures([this._resultFeature]),!0}var s=r?r[0]:e,o=s[_n.originalFeatureSymbol]||s,l=this.framework.getLayerByName(o.get("_layerName"));return l.objectClickedHandler(o,t,i)}},{key:"contains",value:function(e){var t=this.clusterLayers.findIndex(function(t){return t.name===e});return t>-1}},{key:"_handleActivation",value:function(e){var t=this,i=this.activeClusterLayers.findIndex(function(t){return t===e.name});if(this.contains(e.name)&&-1===i&&e instanceof _n){var n=e.getSource();if("ready"===n.getState()){var r=e.name,a=n.getFeatures();a.forEach(function(e){e.set("_layerName",r,!0),e.getId()||e.setId(t.framework.getNextUniqueId())}),this.source.addFeatures(a),this.activeClusterLayers.push(r)}else n.once("change",this._handleActivation.bind(this,e))}}},{key:"_handleDeactivation",value:function(e){var t=this;if(this.contains(e.name)&&e instanceof _n){this._inactive2dClustering||this.clusterSource.setPause(!0);var i=e.getSource();i.getFeatures().forEach(function(e){t.source.removeFeature(e,!0)}),this.source.changed();var n=this.activeClusterLayers.findIndex(function(t){return t===e.name});this.activeClusterLayers.splice(n,1),delete this.activeClusterLayersLastUpdated[e.name],this._inactive2dClustering||this.clusterSource.setPause(!1);var r=this.lastClickedFeatures.slice();this.lastClickedFeatures.splice(0),r.forEach(function(i){i._layerName!==e.name&&t.lastClickedFeatures.push(i)}),this._resultFeature&&this._resultFeature.changed()}}},{key:"_handleSelectedItemChanged",value:function(e){var t=this.lastClickedFeatures.find(function(t){return t.id===e});e&&!t&&this.unSelect()}},{key:"postRenderStyling",value:function(){for(var e=this,t=!1,i=function(i){var n=e.activeClusterLayers[i],r=e.framework.getLayerByName(n);if(r&&(!e.activeClusterLayersLastUpdated[n]||e.activeClusterLayersLastUpdated[n]<r.featureVisibility.lastUpdated)){var a=r.getSource();a.getFeatures().forEach(function(i){e.source.getFeatureById(i.getId())?r.featureVisibility.hiddenObjects[i.getId()]&&(e.source.removeFeature(i,!0),t=!0):r.featureVisibility.hiddenObjects[i.getId()]||(e.source.addFeature(i,!0),t=!0)}),e.activeClusterLayersLastUpdated[n]=Date.now()}},n=0;n<this.activeClusterLayers.length;n++)i(n);t&&this.source.changed()}},{key:"unSelect",value:function(){this._resultFeature=null,this._resultLayer.removeAllFeatures()}},{key:"addLayers",value:function(e){this._validateLayers(Array.isArray(e)?e:[e],!0)}}]),t}(_n),Pr=jr,Yr=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className;var n=new R(e.projection).getConfigObject();return n.alias=["http://www.opengis.net/gml/srs/epsg.xml#".concat(n.epsg.match(/\d+/)[0])],e.projection=n,i=y(this,b(t).call(this,e)),i.featureType=Array.isArray(e.featureType)?e.featureType:[e.featureType],i.featureNS=e.featureNS,i.featurePrefix=e.featurePrefix,i.getFeaturesOptions=e.getFeatureOptions||{},i.wfsFormat=new ol.format.WFS({featureNS:i.featureNS,featureType:i.featureType}),i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.WFS"}}]),Object(m["a"])(t,[{key:"fetchData",value:function(){var e=this;if(this._dataFetchedPromise)return this._dataFetchedPromise;if(null!=this.url){var t=this.wfsFormat.writeGetFeature(Object.assign({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureTypes:[this.featureType],srsName:this.projection.epsg},this.getFeaturesOptions));t=(new XMLSerializer).serializeToString(t),this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.post(this.url,t,{headers:{"Content-Type":"application/text+xml"}}).then(function(t){var i=t.data;e.dataFetchedHandler(i)}).catch(function(t){return e.logger.info("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})}return this.logger.warning("Could not load WFS layer, no url is set"),Promise.reject(new Error("missing url in WFS layer"))}},{key:"dataFetchedHandler",value:function(e){var t=this.wfsFormat.readFeatures(e);this.addFeatures(t)}}]),t}(_n),xr=Yr;Dt.WMS=Dt.lastLayerId++;var Ar=function(e){function t(e){var i,n;(Object(d["a"])(this,t),e.layertype=Dt.WMS,e.className=t.className,e.tilingSchema=e.tilingSchema||"geographic",i=y(this,b(t).call(this,e)),i.layers=e.layers?e.layers.split(","):[],i.version=e.version||"1.1.1",i.parameters={},e.parameters)&&("string"===typeof e.parameters?n=a["a"].parseQueryParams(e.parameters):e.parameters instanceof Object&&(n=e.parameters),Object.keys(n).forEach(function(e){i.parameters[e.toUpperCase()]=n[e]}));return null==i.parameters.TRANSPARENT&&(i.parameters.TRANSPARENT=!1),i.version&&(i.parameters.VERSION=i.version),i.parameters.LAYERS=i.layers.join(","),i.addTiledParameter&&(i.parameters.TILED=!0),i.featureInfo=e.featureInfo||!1,i.addTiledParameter=null==e.addTiledParameter||e.addTiledParameter,i.featureInfoResponseType=e.featureInfo&&e.featureInfo.responseType?e.featureInfo.responseType:"text/xml",i.featureInfoActivated=!1,i.featureInfoListenerKey=null,i.geoJsonFormats=["application/geojson","application/json","application/vnd.geo+json"],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wms"}}]),Object(m["a"])(t,[{key:"getParameter",value:function(){return this.parameters}},{key:"activateFeatureInfo",value:function(e){e&&!this.featureInfoActivated?(this.featureInfoListenerKey=this.framework.subscribe(B.MAP_CLICKED,this.featureInfoHandler.bind(this)),this.featureInfoActivated=!0):!e&&this.featureInfoActivated&&this.featureInfoListenerKey&&(this.framework.unsubscribeByKey(this.featureInfoListenerKey),this.featureInfoActivated=!1,this.featureInfoListenerKey=null)}},{key:"featureInfoHandler",value:function(e){var t=this,i=this.framework.getActiveMap(),n=0;if("vcs.vcm.maps.Openlayers"===i.className)n=i.getOl3Map().getView().getResolution()/1e5;else if("vcs.vcm.maps.Cesium"===i.className){var r=i.getViewPoint(),a=Math.PI/3,s={};s.width=this.framework.getMapContainer().offsetWidth,s.height=this.framework.getMapContainer().offsetHeight;var o=s.width/s.height,l=2*Math.atan(Math.tan(.5*a)/o),c=2*r.getDistance()*Math.tan(l/2),u=111194.87428468118,h=Math.cos(Math.abs(Cesium.Math.toRadians(e.latitude))),d=c/u/h;n=d/s.height}var m="EPSG:4326";"1.3.0"===this.version&&(m="CRS:84");var f=[e.longitude,e.latitude];"mercator"===this.tilingSchema&&(f=R.createGeographicProjection().transformTo(R.createMercatorProjection(),f),m="EPSG:3857");var y=this.wmsSource.getGetFeatureInfoUrl(f,n,m,{INFO_FORMAT:this.featureInfoResponseType});y&&ce.a.get(y).then(function(i){var n,r;if(i=i.data,"text/xml"===t.featureInfoResponseType)n=new ol.format.WFS;else{if(-1===t.geoJsonFormats.indexOf(t.featureInfoResponseType))return void t.logger.warning("Only geojson and text/xml is supported");n=new ol.format.GeoJSON}try{r=n.readFeatures(i)}catch(o){return void t.logger.warning("Features could not be read, please verify the featureInfoResponseType with the capabilities from the server")}if(Array.isArray(r)&&r.length>=1){var a="wmsFeatureInfo",s=r[0];s.setGeometry(new ol.geom.Point([e.longitude,e.latitude])),t.framework.publish(B.FEATURE_CLICKED,a,s,t)}})}},{key:"getTilingOptions",value:function(){for(var e="geographic"===this.tilingSchema?R.createGeographicProjection():R.createMercatorProjection(),t=e.getProjection().getExtent(),i=ol.extent.getWidth(t),n="geographic"===this.tilingSchema?i/512:i/256,r=this.maxLevel+1,a=[],s=0;s<r;++s)a.push(n/Math.pow(2,s));var o={origin:ol.extent.getTopLeft(t),resolutions:a,minZoom:this.minLevel};return this.extent.isValid()&&(o.extent=this.extent.getCoordinatesInProjection(e)),o}},{key:"setCommonSource",value:function(){if(!this.wmsSource){var e=this.getTilingOptions(),t=new ol.tilegrid.TileGrid(e),i={url:this.getUrl(),tileGrid:t,params:this.parameters};a["a"].hasSameOrigin(this.getUrl())||(i.crossOrigin="anonymous"),"geographic"===this.tilingSchema&&("1.3.0"===this.version?i.projection="CRS:84":i.projection="EPSG:4326"),this.wmsSource=new ol.source.TileWMS(i)}}},{key:"getUseFeatureInfo",value:function(){return this.featureInfo}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=e.getGeometry(),i=ol.extent.getCenter(t.getExtent()),n=e.getProperties();return delete n[e.getGeometryName()],{layerName:this.name,layerClass:this.className,attributes:Object.assign({},this._genericFeatureProperties,n),longitude:i[0],latitude:i[1],height:0,relativeToGround:!0}}},{key:"setLayers",value:function(e){o(e,[String,[String]]),this.layers=Array.isArray(e)?e:[e],this.parameters.LAYERS=this.layers.join(","),this._updateLayer()}},{key:"_updateLayer",value:function(){this.wmsSource&&(this.wmsSource.updateParams(this.parameters),Object.values(this.specificImpl).forEach(function(e){e.updateLayer()}))}}]),t}(br),Fr=Ar;Dt.WMTS=Dt.lastLayerId++;var Nr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.WMTS,e.className=t.className,e.tilingSchema=e.tilingSchema||"mercator",i=y(this,b(t).call(this,e)),i.numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX?e.numberOfLevelZeroTilesX:1,i.numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY?e.numberOfLevelZeroTilesY:1,i.layer=e.layer||"",i.style=e.style||"",i.format=e.format||"",i.tileMatrixPrefix=e.tileMatrixPrefix||"",i.tileMatrixSetID=e.tileMatrixSetID||"",i.olOptions=e.ol3Options?e.ol3Options:{},i.matrixIds=e.matrixIds?e.matrixIds:null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wmts"}}]),t}(br),Hr=Nr,Rr=null,zr=function(e){function t(){var e;Object(d["a"])(this,t),e=y(this,b(t).call(this,{className:t.className})),e.colorLayerMap={},e.layerLegendCanvasMap={},e.baseUrl="./images/icons.json",e.iconMap={0:{stroke:"inner_0.svg"},1:{stroke:"inner_2.svg",fill:"inner_2_fill_shaded.svg",colorizeInner:!0},2:{stroke:"inner_3.svg",fill:"inner_3_fill_white.svg",colorizeOuter:!0},3:{stroke:"inner_4.svg"},4:{stroke:"inner_1.svg",fill:"inner_1_fill_shaded.svg",colorizeInner:!0},5:{stroke:"inner_5.svg",fill:"inner_5_fill_white.svg",colorizeOuter:!0},6:{stroke:"inner_10.svg"},7:{stroke:"inner_9.svg",fill:"inner_9_fill_shaded.svg",colorizeInner:!0},8:{stroke:"inner_8.svg",fill:"inner_8_fill_white.svg",colorizeOuter:!0},9:{stroke:"inner_6.svg"},10:{stroke:"inner_12.svg",fill:"inner_12_fill_shaded.svg",colorizeInner:!0},11:{stroke:"inner_7.svg",fill:"inner_7_fill_white.svg",colorizeOuter:!0},12:{stroke:"inner_11.svg"},13:{stroke:"inner_0.svg",fill:"inner_0_fill_shaded.svg",colorizeInner:!0},14:{stroke:"inner_2.svg",fill:"inner_2_fill_white.svg",colorizeOuter:!0},15:{stroke:"inner_3.svg"},16:{stroke:"inner_4.svg",fill:"inner_4_fill_shaded.svg",colorizeInner:!0},17:{stroke:"inner_1.svg",fill:"inner_1_fill_white.svg",colorizeOuter:!0},18:{stroke:"inner_5.svg"},19:{stroke:"inner_10.svg",fill:"inner_10_fill_shaded.svg",colorizeInner:!0},20:{stroke:"inner_9.svg",fill:"inner_9_fill_white.svg",colorizeOuter:!0},21:{stroke:"inner_8.svg"},22:{stroke:"inner_6.svg",fill:"inner_6_fill_shaded.svg",colorizeInner:!0},23:{stroke:"inner_12.svg",fill:"inner_12_fill_white.svg",colorizeOuter:!0},24:{stroke:"inner_7.svg"},25:{stroke:"inner_11.svg",fill:"inner_11_fill_shaded.svg",colorizeInner:!0},26:{stroke:"inner_0.svg",fill:"inner_0_fill_white.svg",colorizeOuter:!0},27:{stroke:"inner_2.svg"},28:{stroke:"inner_3.svg",fill:"inner_3_fill_shaded.svg",colorizeInner:!0},29:{stroke:"inner_4.svg",fill:"inner_4_fill_white.svg",colorizeOuter:!0},30:{stroke:"inner_1.svg"},31:{stroke:"inner_5.svg",fill:"inner_5_fill_shaded.svg",colorizeInner:!0},32:{stroke:"inner_10.svg",fill:"inner_10_fill_white.svg",colorizeOuter:!0},33:{stroke:"inner_9.svg"},34:{stroke:"inner_8.svg",fill:"inner_8_fill_shaded.svg",colorizeInner:!0},35:{stroke:"inner_6.svg",fill:"inner_6_fill_white.svg",colorizeOuter:!0},36:{stroke:"inner_12.svg"},37:{stroke:"inner_7.svg",fill:"inner_7_fill_shaded.svg",colorizeInner:!0},38:{stroke:"inner_11.svg",fill:"inner_11_fill_white.svg",colorizeOuter:!0},39:{stroke:"inner_last.svg"}},e._svgMap={};var i=e.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"]),n=ce.a.get(e.baseUrl).then(function(t){return e._svgMap=t.data,!0});return e.readyPromise=Promise.all([i,n]),e.dedicatedIconMap={berlinpartner:"outerCircle.svg",sbahn:"SBahn.svg",ubahn:"UBahn.svg",haltestelle:"Haltestelle.svg",top200:"Top200.svg",gewerbeimmobilien:"GewerbeImmobilien-rot.svg"},e.width=40,e.height=44,e}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.IconManager"}}]),Object(m["a"])(t,[{key:"getStyleForColor",value:function(e,t,i){var n,r=this,a=ol.color.asArray(t);return a?(this.colorLayerMap[t]?-1!==this.colorLayerMap[t].indexOf(e)?n=this.colorLayerMap[t].indexOf(e):(n=this.colorLayerMap[t].length,this.colorLayerMap[t].push(e)):(this.colorLayerMap[t]=[e],n=0),n=n>39?39:n,this.readyPromise.then(function(){var t=a[0],s=a[1],o=a[2],l=[];return i?(l.push(r.createOutline(t,s,o,n,r._svgMap["outerSquare.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["innerWhiteSquare.svg"],r._svgMap["innerShadedSquare.svg"])),l.push(r.createOutline(t,s,o,n,r._svgMap["legendSquare_outer.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["legendSquare_inner_white.svg"],r._svgMap["legendSquare_inner_shaded.svg"]))):(l.push(r.createOutline(t,s,o,n,r._svgMap["outerCircle.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["innerWhiteCircle.svg"],r._svgMap["innerShadedCircle.svg"])),l.push(r.createOutline(t,s,o,n,r._svgMap["legendCircle_outer.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["legendCircle_inner_white.svg"],r._svgMap["legendCircle_inner_shaded.svg"]))),l.push(r.createInner(t,s,o,n)),Promise.all(l).then(function(t){var n=t[0],a=t[1],s=t[2],o=t[3],l=t[4],c=document.createElement("canvas");c.width=22,c.height=22;var u=c.getContext("2d");i?(u.drawImage(s,0,0,25,28,0,0,22,22),u.drawImage(o,0,0,25,28,0,0,22,22),u.drawImage(l,8,6,26,26,2.1,2.4,15,15)):(u.drawImage(o,0,0,28,28,0,0,22,22),u.drawImage(s,0,0,28,28,0,0,22,22),u.drawImage(l,8,6,26,26,3.7,2.9,15,15)),r.layerLegendCanvasMap[e]=c;var h=document.createElement("canvas");h.width=r.width,h.height=r.height;var d=h.getContext("2d");return d.drawImage(n,0,0),d.drawImage(a,0,0),i?d.drawImage(l,-.7,-.52):d.drawImage(l,0,0),h.id=e,new ol.style.Style({image:new ol.style.Icon({img:h,imgSize:[r.width,r.height],anchor:[.5,1]})})})})):Promise.reject(new Error("Not a valid color is provided for the layer with name ".concat(e,", no style is provided")))}},{key:"getStyleForDedicatedIcon",value:function(e,t){var i=this;return this.readyPromise.then(function(){return new Promise(function(n,r){if(t=t.toLowerCase(),i.dedicatedIconMap[t]){var a=document.createElement("canvas");a.width=i.width,a.height=i.height,canvg(a,i._svgMap.dedicatedIcons[i.dedicatedIconMap[t]],{renderCallback:function(){var t=new ol.style.Style({image:new ol.style.Icon({img:a,imgSize:[this.width,this.height],scale:.8})}),i=document.createElement("canvas");i.width=22,i.height=22;var r=i.getContext("2d");r.drawImage(a,0,0,39,44,0,0,22,22),this.layerLegendCanvasMap[e]=i,n(t)}.bind(i)})}else r(new Error("This icon is not known, please check"))})})}},{key:"getLegendCanvas",value:function(e){var t=this;if(this.layerLegendCanvasMap[e])return Promise.resolve(this.layerLegendCanvasMap[e]);var i=this.framework.getLayerByName(e);return i?i.dedicatedIcon?this.getStyleForDedicatedIcon(i.name,i.dedicatedIcon).then(function(){return t.getLegendCanvas(e)}):this.getStyleForColor(i.name,i.iconColor,i.useSquareShapeAsOuter).then(function(){return t.getLegendCanvas(e)}):Promise.reject(new Error("Could not find layer: ".concat(e)))}},{key:"createOutline",value:function(e,t,i,n,r){var a=this;return new Promise(function(n,s){var o=document.createElement("canvas");o.width=a.width,o.height=a.height;var l=o.getContext("2d");canvg(o,r,{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(o)}.bind(a)})})}},{key:"createFill",value:function(e,t,i,n,r,a){var s=this;return new Promise(function(o,l){var c=s.iconMap[n];if(c.colorizeOuter){var u=[];u.push(new Promise(function(e,t){var i=document.createElement("canvas");i.width=s.width,i.height=s.height,canvg(i,r,{renderCallback:function(){e(i)}})})),u.push(new Promise(function(n,r){var o=document.createElement("canvas");o.width=s.width,o.height=s.height;var l=o.getContext("2d");canvg(o,a,{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(o)}.bind(s)})})),Promise.all(u).then(function(e){var t=e[0],i=e[1],n=document.createElement("canvas");n.width=s.width,n.height=s.height;var r=n.getContext("2d");t&&r.drawImage(t,0,0),i&&r.drawImage(i,0,0),o(n)})}else{var h=document.createElement("canvas");h.width=s.width,h.height=s.height,canvg(h,r,{renderCallback:function(){o(h)}})}})}},{key:"createInner",value:function(e,t,i,n){var r=this;return new Promise(function(a,s){var o=r.iconMap[n],l=[];l.push(new Promise(function(n,a){if(o.stroke){var s=document.createElement("canvas");s.width=r.width,s.height=r.height;var l=s.getContext("2d");canvg(s,r._svgMap[o.stroke],{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(s)}.bind(r)})}else n()})),l.push(new Promise(function(n,a){if(o.fill){var s=document.createElement("canvas");s.width=r.width,s.height=r.height;var l=s.getContext("2d");canvg(s,r._svgMap[o.fill],{renderCallback:function(){o.colorizeInner&&Qe(l,[e,t,i,0],[this.width,this.height]),n(s)}.bind(r)})}else n()})),Promise.all(l).then(function(e){var t=e[0],i=e[1],n=document.createElement("canvas");n.width=r.width,n.height=r.height;var s=n.getContext("2d");i&&s.drawImage(i,0,0),t&&s.drawImage(t,0,0),a(n)})})}}],[{key:"getInstance",value:function(){return Rr||(Rr=new t),Rr}}]),t}(A),Gr=zr;Dt.WSV=Dt.lastLayerId,Dt.lastLayerId+=1;var Vr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.projection={},e.projection.epsg="EPSG:4326",e.projection.proj4="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ",e.zCoordinateEyeOffset=-100,e.heightAboveGround=10,e.altitudeMode="relativeToGround",e.zIndex=e.zIndex||60,e.className=t.className,e.layertype=Dt.WSV,i=y(this,b(t).call(this,e)),i.dedicatedIcon=e.dedicatedIcon||!1,i.iconColor=e.iconColor||!1,i.useSquareShapeAsOuter=!!e.useSquareShape,i.iconManagerInUse=!(!i.dedicatedIcon&&!i.iconColor),i.baseUrl=e.baseurl||"/wsv-live",i.name=e.name,i.logo="adf33bbe08057b9251536c73ff627f512955ffc7.png",i.scaleUnselected=i.iconManagerInUse?.8:.5,i.scaleSelected=i.iconManagerInUse?0:1,e.style&&(e.style.scaleUnselected&&(i.scaleUnselected=e.style.scaleUnselected),e.style.scaleSelected&&(i.scaleSelected=e.style.scaleSelected)),e.wsvProjection||(e.wsvProjection={proj4:"+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam +units=m +no_defs",epsg:"3068"}),i.wsvProjection=new R(e.wsvProjection),i.noFilterValue=e.noFilterValue?e.noFilterValue:"Keine Angabe",i.filter=e.filter?e.filter:null,i.framework.subscribe(B.LOCALE_CHANGED,i.handleLocaleChanged,f(i)),i.filterAttribute=e.filterAttribute?e.filterAttribute:"tags",i.filterAttributeName=e.filterAttributeName?e.filterAttributeName:null,i.loadedLibraries=i.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"]),i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wsv"}}]),Object(m["a"])(t,[{key:"activate",value:function(e){var i=this;return e?this.loadedLibraries.then(this.fetchData.bind(this)).then(function(){return Se(b(t.prototype),"activate",i).call(i,e)}):Se(b(t.prototype),"activate",this).call(this,e)}},{key:"fetchData",value:function(){var e=this;if(!this._dataFetchedPromise){this.framework.getActiveMap().setLayerLoading(this,!0);var t="".concat(this.baseUrl,"/api/").concat(this.framework.getLocale(),"/layer/").concat(this.name,".json");this._dataFetchedPromise=ce.a.get(t).then(function(t){var i=t.data;return e.dataFetchedHandler(i)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})}return this._dataFetchedPromise}},{key:"handleLocaleChanged",value:function(){if(this._dataFetchedPromise){var e=this.active;e&&this.activate(!1),this.removeAllFeatures(),this._dataFetchedPromise=null,e&&this.activate(!0)}}},{key:"getFilter",value:function(){if(this.filter)return this.filter;for(var e=this.source.getFeatures(),t={},i=0;i<e.length;i++){var n=e[i].get(this.filterAttribute);if(n)if(Array.isArray(n))for(var r=0;r<n.length;r++){var a=n[r];a&&(this.filterAttributeName?t[a[this.filterAttributeName]]=!0:t[a]=!0)}else"string"===typeof n?t[n]=!0:"object"===Object(s["a"])(n)&&this.filterAttributeName&&(t[n[this.filterAttributeName]]=!0);else t[this.noFilterValue]=!0}var o=[];for(var l in t)o.push(l);return o}},{key:"setFilter",value:function(e){this.activeFilter=e;for(var t=this.source.getFeatures(),i=0;i<t.length;i++){var n=t[i].get(this.filterAttribute),r=!1;if(n){if(Array.isArray(n))for(var a=0;a<n.length;a++)if(this.filterAttributeName){if(n[a][this.filterAttributeName]){var o=e.indexOf(n[a][this.filterAttributeName]);if(o>-1){r=!0;break}}}else{o=e.indexOf(n[a]);if(o>-1){r=!0;break}}else if("string"===typeof n){o=e.indexOf(n);if(o>-1){r=!0;break}}else if("object"===Object(s["a"])(n)&&this.filterAttributeName){o=e.indexOf(n[this.filterAttributeName]);if(o>-1){r=!0;break}}}else{o=e.indexOf(this.noFilterValue);o>-1&&(r=!0)}r?t[i].setGeometryName("geometry"):t[i].setGeometryName("hidden")}}},{key:"dataFetchedHandler",value:function(e){var t=this;try{return e?(e.logo&&(this.logo=this.baseUrl+e.logo),e.name&&(this.options.title=e.name),e.category&&(this.options.category=e.category),this._createStyle().then(function(){var i=e.locations;if(i){var n=[];i.forEach(function(e){var t=this._createLocation(e);t&&n.push(t)},t),t.addFeatures(n)}return t.activeFilter&&t.setFilter(t.activeFilter),!0})):Promise.resolve()}catch(i){return this.logger.warning("Could not load WSV json: ".concat(i.message)),Promise.reject()}}},{key:"_createStyle",value:function(){var e,t=this;return this.iconManagerInUse?(e=this.dedicatedIcon?Gr.getInstance().getStyleForDedicatedIcon(this.name,this.dedicatedIcon):Gr.getInstance().getStyleForColor(this.name,this.iconColor,this.useSquareShapeAsOuter),e.then(function(e){e.getImage().setScale(t.scaleUnselected),t.setStyle(e);var i=e.clone();return i.getImage().setOpacity(0),t.setHighlightStyle(i),!0})):(this.setStyle(new ol.style.Style({image:new ol.style.Icon({src:this.logo,scale:this.scaleUnselected})})),this.setHighlightStyle(new ol.style.Style({image:new ol.style.Icon({src:this.logo,scale:this.scaleSelected})})),Promise.resolve())}},{key:"_createLocation",value:function(e){if(!e.address||!e.address.x||!e.address.y||!e.name||!e.id)return!1;var t="&amp;",i=/&(?!([a-zA-Z0-9]+|#([0-9]+|x[A-Z0-9]+));)/g,n=new ol.Feature;e.id="".concat(this.name,"_").concat(e.id),n.setId(e.id),n.setProperties({name:e.name.replace(i,t)});var r=this.wsvProjection.transformTo(this.projection,[e.address.x,e.address.y]),a=new ol.geom.Point(r);if(this.extent.isValid()){var s=a.clone();if(s.transform(ol.proj.get("EPSG:4326"),this.extent.projection.getProjection()),!s.intersectsExtent(this.extent.extent))return!1}return n.setGeometry(a),n.setProperties(e),e.logo&&(n.setProperties({logo:this.baseUrl+e.logo}),e.logosize&&e.logosize.width&&e.logosize.height&&(n.setProperties({width:e.logosize.width}),n.setProperties({height:e.logosize.height}))),e.address&&e.address.city?n.setProperties({city:e.address.city.replace(i,t)}):n.setProperties({city:""}),e.address&&e.address.zip?n.setProperties({zip:e.address.zip}):n.setProperties({zip:""}),e.address&&e.address.street?n.setProperties({street:e.address.street.replace(i,t)}):n.setProperties({street:""}),e.contact&&e.contact.website?n.setProperties({website:e.contact.website}):n.setProperties({website:""}),n.setProperties({placemarkurl:"".concat(this.baseUrl,"/").concat(this.framework.getLocale(),"/location/").concat(e.id)}),this.options.title&&n.setProperties({layername:this.options.title}),this.options.category&&n.setProperties({category:this.options.category}),n}}]),t}(_n),Br=Vr,Ur=i(89),Wr=i.n(Ur),qr=i(648),Jr=i.n(qr);function Kr(e,t,i,n){return Kr="undefined"!==typeof Reflect&&Jr.a?Jr.a:function(e,t,i,n){var r,a=Te(e,t);if(a){if(r=Me()(a,t),r.set)return r.set.call(n,i),!0;if(!r.writable)return!1}if(r=Me()(n,t),r){if(!r.writable)return!1;r.value=i,Wr()(n,t,r)}else Object(oe["a"])(n,t,i);return!0},Kr(e,t,i,n)}function Zr(e,t,i,n,r){var a=Kr(e,t,i,n||e);if(!a&&r)throw new Error("failed to set property");return i}var Qr=Y.getLogger("vcs.vcm.layer.FeatureStoreChanges"),Xr=function(){function e(t){Object(d["a"])(this,e),this.layer=t,this._changesListeners={addfeature:null,changefeature:null,removefeature:null},this._addedFeatures=new Set,this._editedFeatures=new Set,this._removedFeatures=new Set,this._convertedFeatures=new Set,this.values={changed:!1}}return Object(m["a"])(e,[{key:"track",value:function(){null===this._changesListeners.addfeature&&(this._changesListeners.addfeature=this.layer.source.on("addfeature",this._featureAdded.bind(this))),null===this._changesListeners.changefeature&&(this._changesListeners.changefeature=this.layer.source.on("changefeature",this._featureChanged.bind(this))),null===this._changesListeners.removefeature&&(this._changesListeners.removefeature=this.layer.source.on("removefeature",this._featureRemoved.bind(this)))}},{key:"getChanges",value:function(){return{add:Object(T["a"])(this._addedFeatures),edit:Object(T["a"])(this._editedFeatures),remove:Object(T["a"])(this._removedFeatures)}}},{key:"commitChanges",value:function(e){var t=this,i=[];this._addedFeatures.forEach(function(e){var t=yr(e,{writeStyle:!0});i.push({action:"add",feature:t,original:e,success:function(t){e.setId(t),e[$n]=er.DYNAMIC}})}),this._editedFeatures.forEach(function(e){var t=yr(e,{writeStyle:!0});t._id=e.getId(),t.geomety="test",i.push({action:"edit",original:e,feature:t,success:function(){e[$n]===er.STATIC&&(e[$n]=er.EDITED)}})}),this._removedFeatures.forEach(function(e){var t=e.getId();i.push({original:e,action:"remove",feature:{_id:t},success:function(){}})});var n=Promise.resolve();return i.length&&(n=ce.a.post(e.toString(),i.map(function(e){return{action:e.action,feature:e.feature}})).then(function(e){var n=e.data,r=n.failedActions.map(function(e){var n=e.index,r=e.error,a=i[n];return Qr.log("failed action ".concat(a.action,": ").concat(r)),i[n]=null,t._resetFeature(a.original)});return i.filter(function(e){return e}).forEach(function(e){var t=e.action,i=e.success;"add"===t?i(n.insertedIds.shift()._id):i()}),Promise.all(r)})),n.then(function(){var e=[];t._convertedFeatures.forEach(function(i){e.push(t._resetFeature(i))}),Promise.all(e)}).then(function(){t._resetValues()}).catch(function(e){t._resetValues(),Qr.error(e.message)})}},{key:"reset",value:function(){var e=this,t=[];return this._addedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._editedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._removedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._convertedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),Promise.all(t).then(function(){e._resetValues()}).catch(function(t){Qr.error(t),e._resetValues()})}},{key:"_resetFeature",value:function(e){var t=this,i=[e.getId()];return e[$n]?e[$n]===er.STATIC?(this.layer.removeFeaturesById(i),this.layer.hiddenStaticFeatureIds.delete(e.getId()),this.layer.showObjects(i),Promise.resolve()):this.layer.injectedFetchDynamicFeatureFunc(e.getId()).then(function(e){var n=fr(e),r=n.features;t.layer.removeFeaturesById(i),t.layer.addFeatures(r)}).catch(function(e){Qr.error("failed to reset feature, giving up",e.message)}):(this.layer.removeFeaturesById(i),Promise.resolve())}},{key:"_resetValues",value:function(){this._addedFeatures.clear(),this._editedFeatures.clear(),this._removedFeatures.clear(),this._convertedFeatures.clear(),this.values.changed=!1}},{key:"unTrack",value:function(){ol.Observable.unByKey(Object.values(this._changesListeners)),this._changesListeners.addfeature=null,this._changesListeners.changefeature=null,this._changesListeners.removefeature=null,this._resetValues()}},{key:"pauseTracking",value:function(e){this._changesListeners[e]&&(ol.Observable.unByKey(this._changesListeners[e]),this._changesListeners[e]=null)}},{key:"_featureAdded",value:function(e){var t=e.feature;t[$n]?t[$n]===er.STATIC&&(this._convertedFeatures.add(t),this.values.changed=!0):(this._addedFeatures.add(t),this.values.changed=!0)}},{key:"_featureChanged",value:function(e){var t=e.feature;t[$n]&&(this._convertedFeatures.delete(t),this._editedFeatures.add(t),this.values.changed=!0)}},{key:"_featureRemoved",value:function(e){var t=e.feature;t[$n]?(this._removedFeatures.add(t),this._editedFeatures.delete(t),this._convertedFeatures.delete(t),this.values.changed=!0):this._addedFeatures.delete(t)}},{key:"removeFeature",value:function(e){o(e,ol.Feature),this._featureRemoved({feature:e})}},{key:"addFeature",value:function(e){o(e,ol.Feature),this._featureAdded({feature:e})}},{key:"editFeature",value:function(e){o(e,ol.Feature),this._featureChanged({feature:e})}},{key:"dispose",value:function(){this.unTrack(),this.layer=null}},{key:"active",get:function(){return Object.values(this._changesListeners).some(function(e){return null!==e})}}]),e}(),$r=Xr;Dt.FEATURESTORE=Dt.lastLayerId,Dt.lastLayerId+=1;var ea=function(e){function t(e){var i;Object(d["a"])(this,t);var n=Object.assign({altitudeMode:"clampToGround",layerType:Dt.FEATURESTORE,className:t.className,projection:R.createMercatorProjection().getConfigObject()},e);if(i=y(this,b(t).call(this,n)),i.extent.projection=R.createMercatorProjection(),i.layerId=e.id,i.staticRepresentation=e.staticRepresentation||{},i.hiddenStaticFeatureIds=new Set(e.hiddenStaticFeatureIds||[]),i.changeTracker=new $r(f(i)),i.vcsMeta=e.vcsMeta||{},i.setVcsMeta(i.vcsMeta),i.injectedFetchDynamicFeatureFunc=e.injectedFetchDynamicFeatureFunc,i._staticFeaturesLayer=new Er({cesiumTilesetLayerOptions:{url:i.staticRepresentation.threeDim,screenSpaceError:i.vcsMeta.screenSpaceError?i.vcsMeta.screenSpaceError:4},openlayersTiledLayerOptions:i.staticRepresentation.twoDim?{url:i.staticRepresentation.twoDim}:void 0,name:i.name,style:i.style,genericFeatureProperties:i._genericFeatureProperties}),i._staticFeaturesExtent=null,i._setEditing=null,e.features){var r={type:"FeatureCollection",features:e.features,vcsMeta:e.vcsMeta},a=fr(r,{targetProjection:R.createMercatorProjection(),dynamicStyle:!0}),s=a.style,o=a.features;s&&(i.defaultStyle=s,i._staticFeaturesLayer.defaultStyle=s,i.setStyle(s)),i.addFeatures(o)}return i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.FeatureStore"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(Se(b(t.prototype),"initialize",this).call(this),this._staticFeaturesLayer.initialize(),this._hideDynamicFeatures())}},{key:"getVcsMeta",value:function(e){var i=Se(b(t.prototype),"getVcsMeta",this).call(this,e);return i}},{key:"synchronizeImplementations",value:function(e,i){var n=this;return Se(b(t.prototype),"synchronizeImplementations",this).call(this,e,i).then(function(){return n._staticFeaturesLayer.synchronizeImplementations(e,i)})}},{key:"_hideDynamicFeatures",value:function(){var e=[];this.hiddenStaticFeatureIds.forEach(function(t){e.push(t)}),this._staticFeaturesLayer.hideObjects(e)}},{key:"activate",value:function(e){var i=this;return Se(b(t.prototype),"activate",this).call(this,e).then(function(){return i._staticFeaturesLayer.activate(e)}).then(function(){i._setEditing&&i.setEditing(i._setEditing.symbol,i._setEditing.featureType)}).catch(function(e){i.logger.error(e)})}},{key:"setStyle",value:function(e,i){var n=this.changeTracker.active;n&&this.changeTracker.pauseTracking("changefeature"),Se(b(t.prototype),"setStyle",this).call(this,e,i),this._staticFeaturesLayer.setStyle(e,i),n&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"getExtent",value:function(){var e=this.source.getExtent();if(this._staticFeaturesExtent)e=ol.extent.extend(e,this._staticFeaturesExtent);else if(this._staticFeaturesLayer.active){var t=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===t.className){var i=this._staticFeaturesLayer.getImplementation(t),n=i.cesium3DTileset.root.boundingVolume.rectangle,r=Cesium.Rectangle.southwest(n),a=Cesium.Rectangle.northeast(n),s=R.wgs84ToMercator([Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude)]),o=R.wgs84ToMercator([Cesium.Math.toDegrees(a.longitude),Cesium.Math.toDegrees(a.latitude)]);this._staticFeaturesExtent=[s[0],s[1],o[0],o[1]],e=ol.extent.extend(e,this._staticFeaturesExtent)}}return this.extent.extent=e,this.extent}},{key:"setEditing",value:function(e,t){var i=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(this._staticFeaturesLayer.setEditing(e,t),i){var n=this._staticFeaturesLayer.getImplementation(i);n.initialized?(null!=t?n.cesium3DTileset[e]=t:delete n.cesium3DTileset[e],this._setEditing=null):this._setEditing={symbol:e,featureType:t}}}},{key:"hideObjects",value:function(e){Se(b(t.prototype),"hideObjects",this).call(this,e),this._staticFeaturesLayer.hideObjects(e)}},{key:"showObjects",value:function(e){var i=this;Se(b(t.prototype),"showObjects",this).call(this,e);var n=e.filter(function(e){return!i.hiddenStaticFeatureIds.has(e)});this._staticFeaturesLayer.showObjects(n)}},{key:"clearHiddenObjects",value:function(){Se(b(t.prototype),"clearHiddenObjects",this).call(this),this._staticFeaturesLayer.clearHiddenObjects(),this._hideDynamicFeatures()}},{key:"highlight",value:function(e){Se(b(t.prototype),"highlight",this).call(this,e),this._staticFeaturesLayer.highlight(e)}},{key:"unHighlight",value:function(e){Se(b(t.prototype),"unHighlight",this).call(this,e),this._staticFeaturesLayer.unHighlight(e)}},{key:"clearHighlighting",value:function(){Se(b(t.prototype),"clearHighlighting",this).call(this),this._staticFeaturesLayer.clearHighlighting()}},{key:"objectClickedHandler",value:function(e,i,n){return e[Or]?this._staticFeaturesLayer.objectClickedHandler(e,i,n||this):e instanceof ol.Feature&&Se(b(t.prototype),"objectClickedHandler",this).call(this,e,i,n||this)}},{key:"getGenericFeatureFromClickedObject",value:function(e){if(e instanceof ol.Feature)return Se(b(t.prototype),"getGenericFeatureFromClickedObject",this).call(this,e);var i=this._staticFeaturesLayer.getGenericFeatureFromClickedObject(e);return i.layerName=this.name,i.layerClass=this.className,i}},{key:"determineHighlightStyle",value:function(e,i){var n=this.getFeatureById(e);return n||i instanceof ol.Feature?Se(b(t.prototype),"determineHighlightStyle",this).call(this,e,i):this._staticFeaturesLayer.determineHighlightStyle(e,i)}},{key:"setMaximumScreenSpaceError",value:function(e){this._staticFeaturesLayer.setMaximumScreenSpaceError(e)}},{key:"switchStaticFeatureToDynamic",value:function(e){var t=this;return this.hiddenStaticFeatureIds.has(e)?Promise.resolve(this.getFeatureById(e)):this.injectedFetchDynamicFeatureFunc?this.injectedFetchDynamicFeatureFunc(e).then(function(i){var n=fr(i,{targetProjection:R.createMercatorProjection(),defaultStyle:t.defaultStyle instanceof gt?t.defaultStyle:vt}),r=n.features;return t._staticFeaturesLayer.hideObjects([e]),t.hiddenStaticFeatureIds.add(e),t.addFeatures(r),r[0]}).catch(function(e){t.logger.error(e.message)}):Promise.reject(new Error("no injected fetching function"))}},{key:"removeStaticFeature",value:function(e){this._staticFeaturesLayer.hideObjects([e]),this.hiddenStaticFeatureIds.add(e);var t=new ol.Feature;t.setId(e),t[$n]=er.STATIC,this.changeTracker.removeFeature(t)}},{key:"dispose",value:function(){this.removeAllFeatures(),this._staticFeaturesLayer.dispose(),this.changeTracker.dispose(),Se(b(t.prototype),"dispose",this).call(this)}},{key:"altitudeMode",get:function(){return this._altitudeMode},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"altitudeMode",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"skirt",get:function(){return this._skirt},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"skirt",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"storeyHeight",get:function(){return this._storeyHeight},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"storeyHeight",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"classificationType",get:function(){return this._classificationType},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"classificationType",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"screenSpaceErrorMobile",get:function(){return this._staticFeaturesLayer.screenSpaceErrorMobile}},{key:"screenSpaceError",get:function(){return this._staticFeaturesLayer.screenSpaceError}}]),t}(_n),ta=ea;B.WIDGET_ACTIVATED="WIDGET_ACTIVATED",B.WIDGET_DEACTIVATED="WIDGET_DEACTIVATED",B.WIDGET_STATE_CHANGED="WIDGET_STATE_CHANGED";var ia,na=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.title=e.title?e.title:null,i.supportedMaps=e.supportedMaps?e.supportedMaps:["ALL"],i.initializeKey=null,i.initialized=!1,i.active=!1,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){if("ALL"===this.supportedMaps[0])return!0;var e=this.framework.getActiveMap();return this.isSupported(e)?(this.initializeKey&&this.framework.unsubscribeByKey(this.initializeKey),this.framework.subscribe(B.MAP_ACTIVATED,this.handleMapChangeEvent.bind(this)),!0):(this.initializeKey||(this.initializeKey=this.framework.subscribe(B.MAP_ACTIVATED,this.initialize.bind(this))),!1)}}},{key:"initializedFinished",value:function(){"ALL"!==this.supportedMaps[0]&&this.handleMapChangeEvent(this.framework.getActiveMap())}},{key:"dispose",value:function(){}},{key:"isActive",value:function(){return this.logger.deprecate("isActive","please use the property .active directly"),this.active}},{key:"activate",value:function(){this.active||(this.active=!0,this.framework.publish(B.WIDGET_ACTIVATED,this))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.framework.publish(B.WIDGET_DEACTIVATED,this))}},{key:"handleURLParameter",value:function(e){}},{key:"getLink",value:function(e){}},{key:"isSupported",value:function(e){o(e,[Ee,String]);var t=e instanceof Ee?e.className:e;return"ALL"===this.supportedMaps[0]||-1!==this.supportedMaps.indexOf(t)}},{key:"getSupportedMaps",value:function(){return this.supportedMaps}},{key:"handleMapChangeEvent",value:function(e){this.isSupported(e)?this.framework.publish(B.WIDGET_STATE_CHANGED,this):(this.framework.publish(B.WIDGET_STATE_CHANGED,this),this.deactivate())}},{key:"isInitialized",value:function(){return this.initialized}}]),t}(A),ra=na,aa=Y.getLogger("vcs.vcm.widgets.legend.TreeItem"),sa=function(){function e(t){Object(d["a"])(this,e),this.className=t.className,this.titleObject=t.title,this.infoUrl=t.infoUrl?t.infoUrl:null,this.infoUrlTarget=t.infoUrlTarget?t.infoUrlTarget:null,this.viewpointName=t.viewpointName?t.viewpointName:null,this.level=0,this.visible=!1,this.disabled=!1,this.id=t.name||Object(u["c"])(),this.focus=!1,this.initialized=!1,this.showInLegendIfDisabled=Object(u["e"])(t.showInLegendIfDisabled,!0)}return Object(m["a"])(e,[{key:"initialize",value:function(e){return this.initialized||(this.level=e),!0}},{key:"isInitialized",value:function(){return aa.deprecate("isInitialized","access the property .initialized directly."),this.initialized}},{key:"activate",value:function(e,t){}},{key:"mapChanged",value:function(e){}},{key:"layerChanged",value:function(e){}},{key:"getViewPoint",value:function(){return aa.deprecate("getViewPoint","use goToViewpoint instead or access the .viewpointName property."),this.viewpointName?ne.getInstance().getViewPointByName(this.viewpointName):null}},{key:"gotoViewpoint",value:function(){if(this.viewpointName){var e=ne.getInstance(),t=e.getViewPointByName(this.viewpointName);t&&e.getActiveMap().gotoViewPoint(t)}}}]),e}(),oa=sa,la=function(e){function t(e){var i;if(Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.factory=e.factory,i.startopen=Object(u["e"])(e.startOpen,!1),i.clickable=Object(u["e"])(e.clickable,!0),i.open=i.startopen,i.children=[],i.state="inactive",Array.isArray(e.children)){for(var n=e.children,r=0;r<n.length;r++){var a=n[r],s=i.factory(a);s&&s instanceof oa&&i.children.push(s)}if(e.clusterIcons){var o=[],l=function e(t){t.children?t.children.forEach(e):o.push({name:t.layerName,title:t.title,parent:{id:i.id,title:i.titleObject}})};if(n.forEach(l),"string"===typeof e.clusterIcons){var c=ne.getInstance(),h=c.getLayerByName(e.clusterIcons);h&&h instanceof Pr?h.addLayers(o):c.addLayer(new Pr({name:e.clusterIcons,clusterLayers:o,activeOnStartup:!0}))}}}return i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(e){var i=this;if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;var n=[];this.children.forEach(function(e,t){e.initialize(i.level+1)||n.push(t)});for(var r=n.length-1;r>-1;r--)this.children.splice(n[r],1)}return!0}},{key:"setState",value:function(){if(this.visible){var e=null,t=function(t){t.visible&&t.state&&(e?"active"===e||"inactive"===e?e!==t.state&&(e="loading"===t.state?t.state:"indeterminate"):"indeterminate"===e&&"loading"===t.state&&(e=t.state):e=t.state)};this.children.forEach(t),this.state=e}}},{key:"activate",value:function(e,t){this.children.forEach(function(t){t.activate(e,!0)},this),this.setState(),e&&!t&&this.gotoViewpoint()}},{key:"mapChanged",value:function(e){this.children.forEach(function(t){t.mapChanged(e)},this),this.visible=!!this.children.find(function(e){return e.visible}),this.setState()}},{key:"layerChanged",value:function(e){this.children.forEach(function(t){t.layerChanged(e)},this),this.visible=!!this.children.find(function(e){return e.visible}),this.setState()}}]),t}(oa),ca=la,ua=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.startopen=!0,i.clickable=!1,i.open=!0,i.breakAfter=!!e.breakAfter,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.ClusterItem"}}]),t}(ca),ha=ua,da=Y.getLogger("vcs.vcm.widgets.legend.LayerItem"),ma=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerName=e.layerName?e.layerName:"",i.availableStyles=e.availableStyles||[],e.styles&&(da.deprecate("styles","define styles in the config and add their names as availableStyles, do not define them in the LayerItem config"),e.styles.forEach(function(e){e.name||("string"===typeof e.title?e.name=e.title:e.name=Object(u["c"])()),ne.getInstance().addStyle(new Tt(e)),i.availableStyles.push(e.name)})),i.state="inactive",i.activeStyleName=null,i.hasFeatureListView=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.LayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;var i=ne.getInstance().getLayerByName(this.layerName);if(!i)return da.warning("Could not find Layer with name ".concat(this.layerName," Legend LayerItem for layer is not shown")),this.visible=!1,!1;this.activeStyleName=i.style?i.style.name:null}return!0}},{key:"layerChanged",value:function(e){e.name===this.layerName&&this.setState()}},{key:"mapChanged",value:function(e){var t=ne.getInstance().getLayerByName(this.layerName);t&&(this.visible=t.isSupported(e),this.setState())}},{key:"setState",value:function(){if(this.visible){var e=ne.getInstance().getLayerByName(this.layerName);e&&(e.active?this.state="active":this.state="inactive")}}},{key:"activate",value:function(e,t){var i=this;if("loading"!==this.state){var n=ne.getInstance().getLayerByName(this.layerName);n&&n.isSupported()&&n.active!==e&&(e&&(this.state="loading"),n.activate(e).then(function(){i.setState(),e&&!t&&i.gotoViewpoint()}).catch(function(){i.visible=!1}))}}},{key:"isIconManagerInUse",value:function(){var e=ne.getInstance().getLayerByName(this.layerName);return!!e&&e.iconManagerInUse}}]),t}(oa),fa=ma,ya=Y.getLogger("vcs.vcm.widgets.legend.GroupLayerItem"),ga=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerNames=e.layerNames||e.layerName||[],e.layerName&&ya.deprecate("option.layerName","Use option.layerNames instead"),i.state="inactive",i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.GroupLayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){Se(b(t.prototype),"initialize",this).call(this,e);var i=ne.getInstance(),n=[],r=this.layerNames.every(function(e){var t=i.getLayerByName(e);return t?(n.push(t),!0):(ya.warning("Could not find Layer with name ".concat(e," Legend GroupLayerItem is not shown")),!1)});if(!r)return!1;this.visible=n.some(function(e){return e.isSupported()}),this.state=n.every(function(e){return e.active||e.activeOnStartup})?"active":"inactive"}return!0}},{key:"activate",value:function(e,t){var i=this;if(this.setState(),"active"!==this.state&&e||!e){var n=ne.getInstance();this.state=e?"loading":"inactive";var r=this.layerNames.map(function(e){return n.getLayerByName(e)}).map(function(t){return t.activate(e)});e&&!t&&this.gotoViewpoint(),Promise.all(r).then(function(){i.state="indeterminate",i.setState()})}}},{key:"setState",value:function(){var e=ne.getInstance(),t=this.layerNames.map(function(t){return e.getLayerByName(t)}).filter(function(e){return e.isSupported()}).map(function(e){return e.active});("loading"!==this.state||t.every(function(e){return e}))&&(t.every(function(e){return e})?this.state="active":t.some(function(e){return e})?this.state="indeterminate":this.state="inactive")}},{key:"mapChanged",value:function(e){var t=ne.getInstance();this.visible=this.layerNames.map(function(e){return t.getLayerByName(e)}).some(function(t){return t.isSupported(e)}),this.visible&&"active"===this.state&&this.activate(!0)}},{key:"layerChanged",value:function(e){if(this.visible&&this.layerNames.includes(e.name)){if("active"===this.state||"loading"===this.state)return void this.setState();var t=ne.getInstance(),i=this.layerNames.map(function(e){return t.getLayerByName(e)}).every(function(e){return e.initialized&&!e.active||!e.initialized&&!e.activeOnStartup});i&&this.setState()}}}]),t}(oa),va=ga,pa=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.GroupItem"}}]),t}(ca),_a=pa,ba=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.name=e.name,i.plugin=e.plugin,i.config=e.config||{},i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PluginItem"}}]),t}(oa),La=ba,Ma=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerNames=e.layerNames||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.ViewpointItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;this.viewpointName&&(this.visible=!!ne.getInstance().getViewPointByName(this.viewpointName))}return!0}},{key:"activate",value:function(e,t){t||e&&(this.gotoViewpoint(),this.layerNames.forEach(function(e){var t=ne.getInstance().getLayerByName(e);t&&t.activate(!0)}))}}]),t}(oa),ka=Ma,wa=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.planningInstance=e.planningInstance,i.titleObject=i.planningInstance.name,i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PlanningInstanceItem"}}]),t}(oa),Ta=wa,Sa=Y.getLogger("vcs.vcm.widgets.legend.PlanningClusterItem"),Oa=function(e){function t(e){var i;return Object(d["a"])(this,t),ia?(Sa.warning("trying to instanciate PlanningClusterItem more then once!"),y(i,ia)):(i=y(this,b(t).call(this,e)),ia=f(i),i)}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PlanningClusterItem"}}]),Object(m["a"])(t,[{key:"destroy",value:function(){ia=void 0}}]),t}(ha),Ca=Oa;function Ea(){return ia}var Ia,Da=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.flightInstance=e.flightName?ne.getInstance().getFlightByName(e.flightName):e.flightInstance,i.titleObject=e.title||i.flightInstance.name,i.allowPlayer=Object(u["e"])(e.allowPlayer,!1),i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.FlightInstanceItem"}}]),Object(m["a"])(t,[{key:"mapChanged",value:function(e){this.visible=e instanceof Vt}}]),t}(oa),ja=Da;B.LEGEND_INITIALIZED="LEGEND_INITIALIZED";var Pa=(Ia={},Object(oe["a"])(Ia,ha.className,ha),Object(oe["a"])(Ia,fa.className,fa),Object(oe["a"])(Ia,va.className,va),Object(oe["a"])(Ia,_a.className,_a),Object(oe["a"])(Ia,La.className,La),Object(oe["a"])(Ia,Ta.className,Ta),Object(oe["a"])(Ia,ka.className,ka),Object(oe["a"])(Ia,ja.className,ja),Object(oe["a"])(Ia,Ca.className,Ca),Ia),Ya=Y.getLogger("vcs.vcm.widgets.legend.Legend");function xa(e){if(!e.type)return Ya.warning("Need a type to instanciate a Legend Entry"),null;var t=Pa[e.type];return t?(e.factory=xa,new t(e)):(Ya.warning("could not find constructor for ".concat(e.type)),null)}var Aa=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.cluster=[],i.level=-1;var n=[];if(Array.isArray(e.children))for(var r=e.children,a=0;a<r.length;a++){var s=r[a];if(s.type&&s.type===ha.className){var o=xa(s);o&&o instanceof ha&&i.cluster.push(o)}else n.push(s)}if(n.length>0){var l=new ha({children:n,factory:xa});i.cluster.push(l)}i.layerTitles={};var c=function e(t){t.children?t.children.forEach(e,this):t.layerName&&(this.layerTitles[t.layerName]=t.titleObject)};return i.cluster.forEach(c,f(i)),i.zoomToFirstLayer=!!e.zoomToFirstLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.Legend"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.cluster.forEach(function(e){e.initialize(this.level)},this);var i=this.framework.getActiveMap();this.cluster.forEach(function(e){e.mapChanged(i)},this),this.initialized=!0,this.framework.publish(B.LEGEND_INITIALIZED,this),this.framework.subscribe(B.MAP_ACTIVATED,this.mapChanged.bind(this)),this.framework.subscribe(B.LAYER_CHANGED,this.layerChanged.bind(this)),this.framework.subscribe(B.PLANNINGINSTANCES_CHANGED,this.layerChanged.bind(this,{}))}}},{key:"handleURLParameter",value:function(e){if(this.zoomToFirstLayer&&e.layerToActivate){var t=Array.isArray(e.layerToActivate)?e.layerToActivate:[e.layerToActivate],i=function e(i){if(i.children){var n=i.children.find(e);return n&&(i.open=!0,i.startopen=!0,(n instanceof fa||n instanceof va)&&(n.level>0?i.focus=!0:n.focus=!0)),n}return i.layerNames?i.visible&&i.layerNames.every(function(e){return t.includes(e)}):i.visible&&i.layerName&&t.includes(i.layerName)};this.cluster.find(i)}}},{key:"mapChanged",value:function(e){this.cluster.forEach(function(t){t.mapChanged(e)},this)}},{key:"layerChanged",value:function(e){this.cluster.forEach(function(t){t.layerChanged(e)},this)}},{key:"resetLayer",value:function(){for(var e=this.framework.getLayers(),t=0;t<e.length;t++)e[t].active!=e[t].activeOnStartup&&e[t].activate(e[t].activeOnStartup)}},{key:"getLayerTitle",value:function(e){return o(e,String),this.layerTitles[e]||null}},{key:"findTreeItems",value:function(e){var t=[];function i(n){for(var r=0;r<n.length;r++)e(n[r])&&t.push(n[r]),n[r]instanceof ca&&i(n[r].children)}return i(this.cluster),t}}]),t}(ra),Fa=Aa;B.PLANNING_OBJECT_SAVED="PLANNING_OBJECT_SAVED";var Na={GLTF:"gltf",FEATURE_STORE:"featureStore",IMAGE:"image",DRAWING:"drawing",PROCESSING:"processing"},Ha={INITIALIZING:"initializing",CONVERTING:"converting",OPTIMIZING:"optimizing",READY:"ready",FAILED:"failed"},Ra=function(){function e(t){Object(d["a"])(this,e),this.name=t.name?t.name:"think of something",this._id=t._id,this.planningInstanceId=t.planningInstanceId,this.type=t.type,this.created=t.created,this.lastUpdated=t.lastUpdated||null,this.allowPicking=t.allowPicking,this.status=t.status,this._onServiceUrl=t.url,this.serviceUrl=t.serviceUrl;var i=this.serviceUrl.clone();i.clearQueryParams(),this.url=t.url?i.extendPath("..",t.url).toString():null,this.description=t.description,this.positionFields=[],this.visible=Object(u["e"])(t.visibility,!0),this.supportedMaps=[],this.supported=!1,this.properties=t.properties||{}}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObject"}}]),Object(m["a"])(e,[{key:"initialize",value:function(){var e=ne.getInstance().getActiveMap();this.handleMapChange(e)}},{key:"getDefinition",value:function(){return{_id:this._id,planningId:this.planningInstanceId,name:this.name,description:this.description,type:this.type,visibility:this.visible,url:this.getDefinitionUrl()}}},{key:"handleMapChange",value:function(e){this.isSupported(e)}},{key:"isSupported",value:function(e){this.supported=0===this.supportedMaps.length||this.supportedMaps.indexOf(e.className)>-1}},{key:"save",value:function(){var e=this.serviceUrl.clone().extendPath("edit-object");return ce.a.post(e.toString(),this.getDefinition()).then(function(){ne.getInstance().publish(B.PLANNING_OBJECT_SAVED)})}},{key:"delete",value:function(){var e=this.serviceUrl.clone().extendPath("delete-object");return ce.a.post(e.toString(),{_id:this._id,planningId:this.planningInstanceId})}},{key:"getDefinitionUrl",value:function(){return this._onServiceUrl}},{key:"load",value:function(){}},{key:"unload",value:function(){}},{key:"hide",value:function(){this.visible=!1,this.unload()}},{key:"show",value:function(){this.visible=!0}},{key:"isPlaced",value:function(){return!0}},{key:"zoomTo",value:function(){}},{key:"destroy",value:function(){}},{key:"getConfigObject",value:function(){return{url:this.url,attributes:{name:this.name,description:this.description}}}}]),e}(),za=Ra,Ga=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.planningInstanceGltfLayerName=e.planningInstanceGltfLayerName,i.latitude=e.modelMeta.latitude,i.longitude=e.modelMeta.longitude,i.height=null!=e.modelMeta.height?e.modelMeta.height:0,i.heading=e.modelMeta.heading,i.heading=i.heading>180?i.heading-360:i.heading,i.pitch=e.modelMeta.pitch,i.roll=e.modelMeta.roll,i.scale=e.modelMeta.scale,i.positionFields=["longitude","latitude","height","heading","pitch","roll","scale"],i.supportedMaps=["vcs.vcm.maps.Cesium"],i.entityId=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectGltf"}}]),Object(m["a"])(t,[{key:"handleMapChange",value:function(e){if(Se(b(t.prototype),"handleMapChange",this).call(this,e),this.supported&&!this.entityId){var i=this.getModelLayer();this.entityId=i.addObject(this.getConfigObject())}}},{key:"getModelLayer",value:function(){var e=ne.getInstance().getLayerByName(this.planningInstanceGltfLayerName);return e}},{key:"getDefinition",value:function(){var e=this,i=Se(b(t.prototype),"getDefinition",this).call(this),n={};return this.positionFields.forEach(function(t){n[t]=e[t]}),i.modelMeta=n,i}},{key:"resetModelMatrix",value:function(){if(this.entityId){var e=this.getModelLayer();e.updateEntityById(this.entityId,this.getConfigObject())}}},{key:"zoomTo",value:function(){this.isPlaced()&&this.getModelLayer().flyToEntity(this.entityId)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.entityId&&this.getModelLayer().hideObjects([this.entityId])}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.entityId&&this.getModelLayer().showObjects([this.entityId])}},{key:"setObjectOntoTerrain",value:function(){var e=this,t=ne.getInstance().getLayers(),i=t.find(function(e){return e instanceof zt&&e.isActive()});return Ht(i.cesiumTerrainProvider,[[this.longitude,this.latitude]]).then(function(t){e.height=t[0][2]})}},{key:"isPlaced",value:function(){var e=this,t=[];return this.positionFields.forEach(function(i){var n=e[i];-1===t.indexOf(n)&&t.push(n)}),!(0===t[0]&&1===t[1]&&2===t.length)}},{key:"destroy",value:function(){this.entityId&&this.getModelLayer().removeObjectById(this.entityId)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.latitude=this.latitude,e.longitude=this.longitude,e.height=this.height,e.heading=this.heading,e.pitch=this.pitch,e.roll=this.roll,e.scale=this.scale,e.allowPicking=this.allowPicking,e.show=this.visible,e}}]),t}(za),Va=Ga,Ba=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.extent=[-.5,-.5,.5,.5],e.imageMeta.extent&&i._setExtent(e.imageMeta.extent),i.opacity=e.imageMeta.opacity,i.credit=e.imageMeta.credit,i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.editorId=e.editorId,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectImage"}}]),Object(m["a"])(t,[{key:"load",value:function(){if(!this.getImageLayer()){var e=new Mr({name:this._id,url:this.url,imageExtent:this.extent,opacity:this.opacity,credit:this.credit});ne.getInstance().addLayer(e)}this.visible&&this.getImageLayer().activate(!0)}},{key:"unload",value:function(){var e=this.getImageLayer();e&&e.activate(!1)}},{key:"isPlaced",value:function(){return!this.extent.every(function(e){return.5===Math.abs(e)})}},{key:"getImageLayer",value:function(){var e=ne.getInstance().getLayerByName(this._id);return e}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.imageMeta={extent:this.extent,opacity:this.opacity,credit:this.credit},e}},{key:"zoomTo",value:function(){if(this.isPlaced()){var e=ne.getInstance().getActiveMap(),t=V.createViewPointFromExtent(this.extent);t.setHeading(0),t.setPitch(-90),t.setRoll(0),e.gotoViewPoint(t)}}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.getImageLayer();e&&e.activate(!0)}},{key:"setOpacity",value:function(e){o(e,Number),this.opacity=e,this.getImageLayer().setOpacity(e)}},{key:"setExtent",value:function(e,t){o(e,[Number]),o(e.length,4),l(t,R);var i=this._setExtent(e,t);i.isValid()&&this.getImageLayer().setExtent(this.extent)}},{key:"_setExtent",value:function(e,t){var i=t?t.epsg:void 0;if(!i){var n=ol.extent.containsExtent(Ae.WGS_84_EXTENT,e);i=n?"EPSG:4326":i}var r=new Ae({coordinates:e,epsg:i});return r.isValid()&&r.getCoordinatesInProjection(R.createGeographicProjection(),this.extent),r}},{key:"destroy",value:function(){var e=this.getImageLayer();e&&e.dispose()}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.extent=this.extent,e.credit=this.credit,e.opacity=this.opacity,e}}]),t}(za),Ua=Ba,Wa=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i._onSelect=[],i._onCesiumSelect=[],i.featureMap=new Map,i.cesiumFeatureMap=new Map,i.state=e,i._defaultActive=me.CLICK,i._defaultModificationKey=de.NONE,i.modificationKey=i._defaultModificationKey,i.maintainSelection=!1,i.setActive(!1),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.state.featureTypeSymbol]&nn.EDITABLE&&!(e.feature[this.state.featureTypeSymbol]&nn.EDITING)?(e.key&de.NONE?this.selectFeature(e.feature):e.key&de.CTRL&&this.selectionSetClick(e.feature),e.stopPropagation=!(this.state.mode&tn.PROPAGATEONSELECT)):e.key&de.NONE&&(!e.feature||!e.feature[this.state.featureTypeSymbol]&&this.state.mode&(tn.EDIT|tn.SELECT))&&this.state.selectedFeatures>0&&this.clearSelectionSet(),Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,e),this.maintainSelection=!1}},{key:"hasMultiSelect",value:function(){this._defaultModificationKey&de.CTRL||(this._defaultModificationKey|=de.CTRL,this.setModification())}},{key:"selectFeature",value:function(e){this.state.mode&tn.TRANSLATE&&this.featureMap.has(e.getId())||(this.clearSelectionSet(!0),e[Or]?(this.cesiumFeatureMap.set(e.getId(),e),this.state.selectedCesiumFeatures=this.cesiumFeatureMap.size,this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this._setState(e),this._cesiumCb()):(this.featureMap.set(e.getId(),e),this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this._setState(e)),this._cb())}},{key:"_setState",value:function(e){if(e){this.state.selectedFeatureId=e.getId(),this.state.layerName=e[At.vcsLayerNameSymbol];var t=e.getProperty("olcs_classificationType");t&&on[t]?this.state.classificationType=on[t]:this.state.classificationType=this.state.defaultClassificationType;var i=e.getProperty("olcs_altitudeMode");if(i&&sn[i]){var n=sn[i];this.state.altitudeMode&an.ZPLANE&&n&an.ABSOLUTE||(this.state.altitudeMode=n)}else this.state.altitudeMode=this.state.defaultAltitudeMode}else this.state.altitudeMode=this.state.defaultAltitudeMode,this.state.classificationType=this.state.defaultClassificationType,this.state.selectedCesiumFeatures=0,this.state.selectedFeatures=0,this.state.selectedFeatureId=null}},{key:"selectionSetClick",value:function(e,t){var i=e.getId(),n=!e[Or],r=n?this.featureMap.delete(i):this.cesiumFeatureMap.delete(i);r||(n?this.featureMap.set(i,e):this.cesiumFeatureMap.set(i,e)),r?r&&i===this.state.selectedFeatureId&&(this.featureMap.size?this._setState(this.featureMap.values().next().value):this.cesiumFeatureMap.size?this._setState(this.cesiumFeatureMap.values().next().value):this._setState()):(n&&1===this.featureMap.size&&!this.cesiumFeatureMap.size||!n&&1===this.cesiumFeatureMap.size&&!this.featureMap.size)&&this._setState(e),this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this.state.selectedCesiumFeatures=this.cesiumFeatureMap.size,t||(n?this._cb():this._cesiumCb())}},{key:"clearCesiumSelectionSet",value:function(){var e=!!this.cesiumFeatureMap.size;this.cesiumFeatureMap.has(this.state.selectedFeatureId)&&(this.featureMap.size?this._setState(this.featureMap.values().next().value):this._setState()),this.state.selectedCesiumFeatures=0,this.cesiumFeatureMap.clear(),e&&this._cesiumCb()}},{key:"clearSelectionSet",value:function(e){this.featureMap.clear(),this.clearCesiumSelectionSet(),this._setState(),e||this._cb()}},{key:"onSelect",value:function(e){o(e,Function),this._onSelect.push(e)}},{key:"onCesiumSelect",value:function(e){o(e,Function),this._onCesiumSelect.push(e)}},{key:"_cb",value:function(){for(var e=0;e<this._onSelect.length;e++)this._onSelect[e]()}},{key:"_cesiumCb",value:function(){for(var e=0;e<this._onCesiumSelect.length;e++)this._onCesiumSelect[e]()}}]),t}(pe),qa=Wa,Ja=Y.getLogger("vcs.vcm.util.editor.AbstractEditor"),Ka=function(){function e(t){var i=this;Object(d["a"])(this,e),this.parent=t.parent||null;var n=this.parent?this.parent.scratchLayer:t.scratchLayer;this.scratchLayer=n||new _n({projection:R.createMercatorProjection().getConfigObject(),altitudeMode:"clampToGround",isDynamic:!0,zCoordinateEyeOffset:-1}),this.interactionChain=new be;var r=this.parent?this.parent.state:t.state;this.state=r||{mode:tn.NONE,altitudeMode:an.CLAMP,defaultAltitudeMode:an.CLAMP,allowedGeometries:[],allowedModes:[],onlyAllowTranslation:!1,selectedFeatures:0,selectedCesiumFeatures:0,layerName:null,selectedFeatureId:null,active:!1,featureTypeSymbol:Symbol("featureType"),exclusiveId:Object(u["c"])(),dedicatedFeatureStyle:!1,transformGeometryOnMove:Q.getInstance().transformGeometryOnMove,activeMap:null,isFeatureStore:!1,canSwitchToDynamic:!1,classificationType:on.terrain,defaultClassificationType:on.terrain,isDeclarativeStyle:!1,isLayerStyle:!1},this.isOblique=ne.getInstance().getActiveMap()instanceof Pi,this._mapChangedSubscriptionKey=ne.getInstance().subscribe(B.MAP_ACTIVATED,function(e){i.state.active&&i.handleMapChange(e)}),this.modeChange=new Cesium.Event}return Object(m["a"])(e,[{key:"className",get:function(){return"vcs.vcm.util.editor.AbstractEditor"}}]),Object(m["a"])(e,[{key:"activate",value:function(){this.isOblique=ne.getInstance().getActiveMap()instanceof Pi,this.parent||(this.state.active=!0,this.scratchLayer.activate(!0))}},{key:"deactivate",value:function(){this.parent||(this.state.active=!1,this.scratchLayer.activate(!1))}},{key:"getRootEditor",value:function(){var e=this;while(e.parent)e=e.parent;return e}},{key:"initialize",value:function(){this.interactionChain.initialize(),this.handleMapChange(ne.getInstance().getActiveMap())}},{key:"beforeSetMode",value:function(e){}},{key:"setMode",value:function(e){this.parent||this.beforeSetMode(e),Ja.debug("AbstractEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),o(e,Number),this.interactionChain.chain.forEach(function(e){e.setActive(!1)}),this.state.mode=e,this.modeChange.raiseEvent(e)}},{key:"destroy",value:function(){null!=this._mapChangedSubscriptionKey&&ne.getInstance().unsubscribeByKey(this._mapChangedSubscriptionKey)}},{key:"handleMapChange",value:function(e){this.isOblique=e instanceof Pi}}]),e}(),Za=Ka,Qa=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.zPlane=e.zPlane,i.scene=null,i.plane=null,i.ray=new Cesium.Ray,i.cartographic=new Cesium.Cartographic,i}return w(t,e),Object(m["a"])(t,[{key:"handleMapChange",value:function(e){this.plane=null,this.scene=e instanceof Vt?e.getScene():null}},{key:"createPlane",value:function(e){this.scene&&(this.plane=this.zPlane?ci(e,this.scene):li(e,this.scene))}},{key:"getPosition",value:function(e){var t=e.positionOrPixel.slice();if(this.plane){this.ray=this.scene.camera.getPickRay(e.windowPosition,this.ray);var i=Cesium.IntersectionTests.rayPlane(this.ray,this.plane);i&&(this.cartographic=this.scene.globe.ellipsoid.cartesianToCartographic(i,this.cartographic),this.zPlane?t=R.wgs84ToMercator([Cesium.Math.toDegrees(this.cartographic.longitude),Cesium.Math.toDegrees(this.cartographic.latitude),this.cartographic.height]):t[2]=this.cartographic.height)}return t}}]),t}(pe),Xa=Qa,$a=new ol.style.Style({}),es=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this,{zPlane:!0})),n.editor=e,n.selectFeatureInteraction=e.parent?e.parent.selectFeatureInteraction:null,n.forceZPlane=!!i,n._defaultActive=me.DRAGEVENTS,n._defaultModificationKey=de.ALT,n._lastPosition=null,n._vertex=null,n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=e.type&(me.DRAGEND|me.CLICK);this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._vertex,!(this.editor.state.transformGeometryOnMove||i)),this._lastPosition=t,i&&(this._lastPosition=null,this._vertex.setStyle(this._vertex[ft]?this._vertex[ft].style:null),this._vertex=null,this.editor.feature.set("olcs_allowPicking",!!(this.editor.state.mode&tn.EDIT)),this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0))}else e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&e.type&(me.DRAGSTART|me.CLICK)&&(this.scene&&(this.editor.state.altitudeMode&an.ZPLANE||this.forceZPlane&&this.editor.state.altitudeMode&an.ABSOLUTE)?(this._lastPosition=e.feature.getGeometry().getCoordinates(),this.createPlane(this._lastPosition)):(this.plane=null,this._lastPosition=this.scene?e.feature.getGeometry().getCoordinates():e.positionOrPixel),this._vertex=e.feature,this._vertex.setStyle($a),this.editor.feature.set("olcs_allowPicking",!1),this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!1));return Promise.resolve(e)}}]),t}(Xa),ts=es,is=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!1})),i.editor=e,i.selectFeatureInteraction=e.parent?e.parent.selectFeatureInteraction:null,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.CTRL,i._lastHeight=null,i._vertex=null,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this.scene)if(this._lastHeight){var t=this.getPosition(e),i=e.type&(me.DRAGEND|me.CLICK);this.editor.translateVertexHeight(t[2]-this._lastHeight,this._vertex,!(this.editor.state.transformGeometryOnMove||i)),this._lastHeight=t[2],i&&(this._lastHeight=null,this._vertex=null,this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0))}else if(e.key&de.CTRL&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&e.type&(me.DRAGSTART|me.CLICK)){var n=e.feature.getGeometry().getCoordinates();this._lastHeight=n[2],this.createPlane(n),this._vertex=e.feature,this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0)}return Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,"clampToGround"!==this.editor.feature.get("olcs_altitudeMode")&&e)}}]),t}(Xa),ns=is,rs=Symbol("vertexIndex"),as=Y.getLogger("vcs.vcm.util.editor.AbstractGeometryEditor"),ss=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this,e)),n.creationActive=!1,n.geometry=e.geometry,n.layer=e.layer,n.feature=e.feature,n.vertices=[],n.onFinish=e.onFinish||n.getRootEditor().setMode.bind(f(n),tn.EDIT),n.onRemoved=e.onRemoved||function(){},n._create=null,n._translateVertex=new ts(f(n),i),n.interactionChain.addInteraction(n._translateVertex),n._translateVertexHeight=new ns(f(n)),n.interactionChain.addInteraction(n._translateVertexHeight),n.setAltitudeModeToAbsoluteOnClassification=!0,n}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._createVertices(),this.feature.set("olcs_allowPicking",!1)}},{key:"_createVertices",value:function(){}},{key:"_createVertex",value:function(e,t){var i=this.feature.get("olcs_extrudedHeight")||this.feature.get("olcs_storeyNumber")&&this.feature.get("olcs_storeyHeight")?this.feature.get("olcs_groundLevel"):0;e[2]=i||e[2]||0;var n=new ol.geom.Point(e);this.isOblique&&(n[_n.alreadyTransformedToImage]=!0);var r=new ol.Feature({geometry:n});r[this.state.featureTypeSymbol]=nn.VERTEX,null!=t&&(r[rs]=t),r[_n.doNotTransform]=!0;var a=this.feature.get("olcs_altitudeMode")||this.layer.altitudeMode;return this.setAltitudeModeToAbsoluteOnClassification&&this.state.classificationType!==on.terrain&&(a="absolute"),r.set("olcs_altitudeMode",a),r}},{key:"getVertexIndex",value:function(e){return this.vertices.findIndex(function(t){return t.getId()===e.getId()})}},{key:"changeVertex",value:function(e,t,i){e.getGeometry().setCoordinates(t),i||this.updateGeometry()}},{key:"translateVertex",value:function(e,t,i,n,r){this.state.altitudeMode&an.ZPLANE?n.getGeometry().translate(e,t):(this.isOblique&&(n.getGeometry()[_n.alreadyTransformedToImage]=!0),n.getGeometry().setCoordinates(i)),r||this.updateGeometry()}},{key:"updateGeometry",value:function(){}},{key:"pushVertex",value:function(e){return null}},{key:"translateVertexHeight",value:function(e,t,i){var n=t.getGeometry(),r=n.getCoordinates();r[2]+=e,n.setCoordinates(r),i||this.updateGeometry()}},{key:"validate",value:function(){return!1}},{key:"_validateOnFinish",value:function(){this.creationActive=!1,this.validate()?this.onFinish():this._removeFeature()}},{key:"_removeFeature",value:function(){if(!this.parent||"vcs.vcm.util.editor.MultiGeometryEditor"!==this.parent.className){var e=ne.getInstance().getLayerByName(this.feature[At.vcsLayerNameSymbol]);e&&e instanceof _n&&e.removeFeaturesById([this.feature.getId()])}this.onRemoved()}},{key:"setAltitudeMode",value:function(e){var t=this.vertices.length;while(t--)this.vertices[t].set("olcs_altitudeMode",e&an.CLAMP?"clampToGround":"absolute");this.state.mode^tn.CREATE&&this.setMode(this.state.mode)}},{key:"stopCreation",value:function(){if(!this.validate()){var e=ne.getInstance().getLayerByName(this.feature[At.vcsLayerNameSymbol]);e&&e instanceof _n&&e.removeFeaturesById([this.feature.getId()])}}},{key:"setMode",value:function(e){as.debug("AbstractGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e})));var i=e;0===this.vertices.length&&(i=tn.CREATE),Se(b(t.prototype),"setMode",this).call(this,i),this.creationActive&&(this.stopCreation(),this.creationActive=!1),i&tn.CREATE?(this.creationActive=!0,this._create.setActive(!0)):i&tn.TRANSLATEVERTEX?(this._translateVertex.setModification(de.NONE),this._translateVertex.setActive(me.CLICKMOVE),this._translateVertexHeight.setModification(de.NONE|de.CTRL),this._translateVertexHeight.setActive(me.CLICKMOVE)):i&tn.GEOMETRYMODES&&(this._translateVertex.setActive(),this._translateVertexHeight.setActive())}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),this._clearVertices(),this.feature.set("olcs_allowPicking",!0)}},{key:"_clearVertices",value:function(){var e=this.vertices.map(function(e){return e.getId()});this.scratchLayer.removeFeaturesById(e),this.vertices.splice(0)}}]),t}(Za),os=ss,ls={selectShift:tn.SELECT|de.SHIFT,selectAlt:tn.SELECT|de.ALT,selectCtrl:tn.SELECT|de.CTRL,editShift:tn.EDIT|de.SHIFT,editAlt:tn.EDIT|de.ALT},cs={auto:"auto",scaleNESW:"nesw-resize",scaleNWSE:"nwse-resize",rotate:"crosshair",translate:"move",select:"pointer",edit:"pointer",translateVertex:"move",removeVertex:"pointer",insertVertex:"cell",addToSelection:"cell",removeFromSelection:"not-allowed"},us=function(e){function t(e){var i,n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n._lastFeature=null,n.features=e.features,n.cesiumFeatures=e.cesiumFeatures,n.state=e.state,n.cursorStyle=ne.getInstance().getMapContainer().style,n._keyDown=(i={},Object(oe["a"])(i,de.SHIFT,!1),Object(oe["a"])(i,de.ALT,!1),Object(oe["a"])(i,de.CTRL,!1),i),n.modifier=0,n.boundKeyListener=n._keyListener.bind(f(n)),n.eventEmitter=xn().eventEmitter,n.hasMultiSelect=!1,n.screenSpaceCameraController=null,n.originalLookEventTypes=[],n.originalTiltEventTypes=[],n._defaultActive=me.MOVE,n._defaultModificationKey=de.ALL,n.modificationKey=n._defaultModificationKey,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.state.featureTypeSymbol]?(this.screenSpaceCameraController&&(e.feature[this.state.featureTypeSymbol]&(nn.VERTEX|nn.HEIGHTVERTEX)?(this.screenSpaceCameraController.lookEventTypes=void 0,this.screenSpaceCameraController.tiltEventTypes=void 0):(this.screenSpaceCameraController.lookEventTypes=this.originalLookEventTypes,this.screenSpaceCameraController.tiltEventTypes=this.originalTiltEventTypes)),this.eventEmitter.setActive(!1),this._lastFeature=e.feature,this._evaluate()):(this.eventEmitter.setActive(),this._lastFeature=null,this.reset()),Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,e),this.active?(window.addEventListener("keydown",this.boundKeyListener),window.addEventListener("keyup",this.boundKeyListener)):(window.removeEventListener("keydown",this.boundKeyListener),window.removeEventListener("keyup",this.boundKeyListener)),this.cursorStyle.cursor=cs.auto}},{key:"reset",value:function(){this.cursorStyle.cursor=cs.auto,this.screenSpaceCameraController&&(this.screenSpaceCameraController.lookEventTypes=this.originalLookEventTypes,this.screenSpaceCameraController.tiltEventTypes=this.originalTiltEventTypes)}},{key:"handleMapChange",value:function(e){e instanceof Vt?(this.screenSpaceCameraController=e.getScene().screenSpaceCameraController,this.screenSpaceCameraController.lookEventTypes&&(this.originalLookEventTypes=Array.isArray(this.screenSpaceCameraController.lookEventTypes)?this.screenSpaceCameraController.lookEventTypes.slice():Object.assign({},this.screenSpaceCameraController.lookEventTypes)),this.screenSpaceCameraController.tiltEventTypes&&(this.originalTiltEventTypes=Array.isArray(this.screenSpaceCameraController.tiltEventTypes)?this.screenSpaceCameraController.tiltEventTypes.slice():Object.assign({},this.screenSpaceCameraController.tiltEventTypes))):this.screenSpaceCameraController=null}},{key:"_evaluate",value:function(){if(this._lastFeature){var e=this.state.mode|this.modifier|this._lastFeature[this.state.featureTypeSymbol];if(e&nn.VERTEX)return(e&ls.selectShift)===ls.selectShift||(e&ls.selectAlt)===ls.selectAlt||e&tn.SCALE?void(this.cursorStyle.cursor=1===this._lastFeature[rs]||3===this._lastFeature[rs]?cs.scaleNWSE:cs.scaleNESW):(e&ls.selectCtrl)===ls.selectCtrl||e&tn.ROTATE?void(this.cursorStyle.cursor=cs.rotate):(e&ls.editShift)===ls.editShift&&!this.state.onlyAllowTranslation||e&tn.REMOVEVERTEX?void(this.cursorStyle.cursor=cs.removeVertex):(e&ls.editAlt)===ls.editAlt||e&tn.TRANSLATEVERTEX?void(this.cursorStyle.cursor=cs.translateVertex):void(this.cursorStyle.cursor=cs.auto);if(e&nn.EDITABLE){var t=this.features.has(this._lastFeature.getId())||this.cesiumFeatures.has(this._lastFeature.getId());return t&&(e&ls.selectAlt)===ls.selectAlt?void(this.cursorStyle.cursor=cs.translate):e&tn.FEATUREMODES&&e&de.CTRL&&this.hasMultiSelect?void(this.cursorStyle.cursor=t?cs.removeFromSelection:cs.addToSelection):e&tn.GEOMETRYMODES&&e&de.CTRL&&!t&&this.hasMultiSelect?void(this.cursorStyle.cursor=cs.addToSelection):e&tn.TRANSLATE?void(this.cursorStyle.cursor=cs.translate):e&tn.EDIT&&t&&this.state.onlyAllowTranslation?void(this.cursorStyle.cursor=cs.auto):void(this.cursorStyle.cursor=cs.select)}}this.cursorStyle.cursor=cs.auto}},{key:"_keyListener",value:function(e){var t=!1,i={};i=Object.assign(i,this._keyDown),this._keyDown[de.ALT]=e.altKey,this._keyDown[de.CTRL]=e.ctrlKey,this._keyDown[de.SHIFT]=e.shiftKey,"Shift"!==e.key&&"Alt"!==e.key||(e.preventDefault(),e.stopPropagation());for(var n=[de.ALT,de.CTRL,de.SHIFT],r=0;r<3;r++)if(t=i[n[r]]!==this._keyDown[n[r]],t){this.modifier=this._keyDown[n[r]]?n[r]:0,this._evaluate();break}}}]),t}(pe),hs=us,ds=Y.getLogger("vcs.vcm.util.editor.AbstractLayerEditor"),ms={};function fs(e){return ms[e]}var ys=new gt({fill:{color:"#E8514C"}}),gs=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.id=Object(u["c"])(),i.convertStaticOnClick=Object(u["e"])(e.convertStaticOnClick,!0),i.defaultMode=tn.SELECT,i.layers={},i.editingFeature=null,i._listeners=[],i.eventHandler=xn(),i._interactionRemover=null,i.parent?(i.parent=i.parent,i.selectFeatureInteraction=i.parent.selectFeatureInteraction,i.features=i.selectFeatureInteraction.featureMap,i.mouseOverInteraction=i.parent.mouseOverInteraction):(i.selectFeatureInteraction=new qa(i.state),i.obliqueImageSubscriptionKey=ne.getInstance().subscribe("OBLIQUE_IMAGE_CHANGED",function(){i.state.active&&i.selectFeatureInteraction.active&&i.selectFeatureInteraction.clearSelectionSet()}),i.interactionChain.addInteraction(i.selectFeatureInteraction),i.features=i.selectFeatureInteraction.featureMap,i.mouseOverInteraction=new hs({cesiumFeatures:i.selectFeatureInteraction.cesiumFeatureMap,features:i.features,state:i.state}),i.interactionChain.addInteraction(i.mouseOverInteraction)),ms[i.id]=f(i),i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.AbstractLayerEditor"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),ne.getInstance().addLayer(this.scratchLayer),this.selectFeatureInteraction.onSelect(this.onSelect.bind(this)),this.selectFeatureInteraction.onCesiumSelect(this.onCesiumSelect.bind(this))}},{key:"onSelect",value:function(){}},{key:"onCesiumSelect",value:function(){if(!this.parent&&this.state.isFeatureStore&&this.activeLayer)if(this.convertStaticOnClick&&this.selectFeatureInteraction.cesiumFeatureMap.size)this.switchToDynamic();else{this.activeLayer.clearHighlighting();var e={};this.selectFeatureInteraction.cesiumFeatureMap.forEach(function(t,i){e[i]=ys}),this.activeLayer.highlight(e)}}},{key:"switchToDynamic",value:function(){var e=this;if(this.activeLayer instanceof ta&&this.activeLayer.injectedFetchDynamicFeatureFunc){var t=[];return this.selectFeatureInteraction.cesiumFeatureMap.forEach(function(i,n){t.push(e.activeLayer.switchStaticFeatureToDynamic(n))}),this.selectFeatureInteraction.clearCesiumSelectionSet(),Promise.all(t).then(function(t){t.forEach(function(t){e.selectFeatureInteraction.selectionSetClick(t)})})}return Promise.resolve()}},{key:"setAltitudeMode",value:function(e){return this.parent||(0===this.features.size&&(this.state.defaultAltitudeMode=e),this.state.altitudeMode=e,this._setPickingBehaviour()),Promise.resolve()}},{key:"activate",value:function(){if(Se(b(t.prototype),"activate",this).call(this),this._interactionRemover||(this._interactionRemover=this.eventHandler.addExclusiveInteraction(this.interactionChain,this.deactivate.bind(this),void 0,this.state.exclusiveId)),!this.parent){this._setPickingBehaviour();var e=ne.getInstance().getActiveMap();this.state.activeMap!==e.className&&this.handleMapChange(e)}}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.eventHandler.featureInteraction.setActive(),this.eventHandler.eventEmitter.setActive(),null!=this._interactionRemover&&(this._interactionRemover(),this._interactionRemover=null),this.mouseOverInteraction&&this.mouseOverInteraction.reset()}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this,e),this.state.active||(this.parent?ds.warning("Trying to set mode on inactive child, set mode on the parent"):this.activate())}},{key:"setMode",value:function(e){ds.debug("AbstractLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.parent||(e&tn.NONE&&this.selectFeatureInteraction.clearSelectionSet(!0),this._setPickingBehaviour())}},{key:"_setPickingBehaviour",value:function(){if(this.state.mode&tn.GEOMETRYMODES&&this.features.size?this.eventHandler.featureInteraction.hitTolerance=2:this.eventHandler.featureInteraction.hitTolerance=10,this.state.mode&tn.CREATE){Q.getInstance().deactivateClickBehavior(),this.mouseOverInteraction.setActive(!1),this.mouseOverInteraction.cursorStyle.cursor=cs.edit,this.selectFeatureInteraction.setActive(!1),this.eventHandler.eventEmitter.setActive(!1);var e=this.state.altitudeMode&an.CLAMP&&this.state.classificationType===on.terrain;e?(this.eventHandler.featureInteraction.setActive(),this.eventHandler.featureInteraction.pickPosition=me.NONE):(this.eventHandler.featureInteraction.setActive(me.CLICKMOVE),this.eventHandler.featureInteraction.pickPosition=me.CLICKMOVE,this.eventHandler.featureInteraction.pullPickedPosition=.05)}else if(this.state.mode&tn.NONE)Q.getInstance().activateClickBehavior(),this.eventHandler.featureInteraction.setActive(),this.eventHandler.eventEmitter.setActive(),this.eventHandler.featureInteraction.hitTolerance=10,this.mouseOverInteraction.setActive(!1);else{Q.getInstance().deactivateClickBehavior(),this.eventHandler.featureInteraction.setActive(me.ALL),this.mouseOverInteraction.cursorStyle.cursor=cs.auto,this.selectFeatureInteraction.setActive(),this.mouseOverInteraction.setActive();var t=this.state.altitudeMode&an.ABSOLUTE||this.state.altitudeMode&an.CLAMP&&this.state.classificationType!==on.terrain;this.state.mode&tn.EDIT&&t?(this.eventHandler.featureInteraction.pickPosition=me.DRAGEVENTS|me.CLICK,this.eventHandler.featureInteraction.pullPickedPosition=.05):this.state.mode&tn.TRANSLATEVERTEX&&t?(this.eventHandler.featureInteraction.pickPosition=me.CLICKMOVE,this.eventHandler.featureInteraction.pullPickedPosition=.05):this.eventHandler.featureInteraction.pickPosition=0}}},{key:"addEditingLayer",value:function(e){var t=this;if(o(e,_n),this.activeLayer=e,!this.parent){e.getFeatures().forEach(function(e){e[t.state.featureTypeSymbol]=nn.EDITABLE}),this.state.layerName=e.name,this.state.defaultClassificationType=on[e.classificationType]||on.terrain,this.state.classificationType=this.state.defaultClassificationType,this.state.defaultAltitudeMode="absolute"===e.altitudeMode?an.ABSOLUTE:an.CLAMP;var i=[];if(i.push(e.source.on("addfeature",function(e){var i=e.feature;i[t.state.featureTypeSymbol]=nn.EDITABLE})),i.push(e.source.on("removefeature",function(e){var i=e.feature;t.features.has(i.getId())&&t.selectFeatureInteraction.selectionSetClick(i),delete i[t.state.featureTypeSymbol]})),e instanceof ta){e.setEditing(this.state.featureTypeSymbol,nn.EDITABLE),this.state.isFeatureStore=!0;var n="vcs.vcm.util.editor.CompositeLayerEditor"===this.getRootEditor().className?!!this.getRootEditor().getFeatureLayerEditor():"vcs.vcm.util.editor.FeatureLayerEditor"===this.getRootEditor().className;this.state.canSwitchToDynamic=!!e.injectedFetchDynamicFeatureFunc&&n}else this.state.isFeatureStore=!1,this.state.canSwitchToDynamic=!1;this.layers[e.name]=i}}},{key:"removeEditingLayer",value:function(e){var t=this;o(e,_n),e.getFeatures().forEach(function(e){delete e[t.state.featureTypeSymbol]}),this.activeLayer instanceof ta&&(this.activeLayer.setEditing(this.state.featureTypeSymbol),this.state.isFeatureStore=!1,this.state.canSwitchToDynamic=!1);var i=this.layers[e.name]||[];i.forEach(function(e){ol.Observable.unByKey(e)}),delete this.layers[e.name],this.activeLayer=null,this.state.layerName=null}},{key:"handleMapChange",value:function(e){this.parent||(this.state.activeMap=e.className,this.selectFeatureInteraction.featureMap.size&&(this.isOblique||e instanceof Pi)&&(this.state.mode&tn.CREATE?this.getRootEditor().setMode(tn.NONE):this.selectFeatureInteraction.clearSelectionSet())),Se(b(t.prototype),"handleMapChange",this).call(this,e)}},{key:"destroy",value:function(){var e=this;Se(b(t.prototype),"destroy",this).call(this),Object.keys(this.layers).forEach(function(t){var i=ne.getInstance().getLayerByName(t);i&&i instanceof _n&&e.removeEditingLayer(i)}),null!=this.obliqueImageSubscriptionKey&&ne.getInstance().unsubscribeByKey(this.obliqueImageSubscriptionKey),delete ms[this.id]}},{key:"clearSelectionSet",value:function(e){this.selectFeatureInteraction.clearSelectionSet(e)}}]),t}(Za),vs=gs,ps=new gt({});ps.style=new ol.style.Style({fill:new ol.style.Fill({color:"rgba(200, 200, 200, 0.5)"}),stroke:new ol.style.Stroke({color:"rgb(200, 200, 200)",width:2}),image:new ol.style.Circle({fill:new ol.style.Fill({color:"rgba(200, 200, 200, 0.5)"}),stroke:new ol.style.Stroke({color:"rgb(200, 200, 200)",width:2}),radius:5})});var _s={},bs=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.loaded=null,i.greyed=!1,i.original=null,i.editorId=e.editorId;var n=new _n({name:i._id,projection:R.createMercatorProjection().getConfigObject(),genericFeatureProperties:{planningName:i.name,planningDescription:i.description}});return ne.getInstance().addLayer(n),n.getSource().on("addfeature",function(e){var t=e.feature;t.get("title")||t.set("title",i.name,!0),t.get("description")||t.set("description",i.description,!0)}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectDrawing"}}]),Object(m["a"])(t,[{key:"save",value:function(){var e=fs(this.editorId);return e.state.active&&e.setMode(rn.none),this.original=this._writeToGeoJSON(),Se(b(t.prototype),"save",this).call(this)}},{key:"load",value:function(){var e=this;!this.loaded&&this.url?this.loaded=ce.a.get(this.url).then(function(t){var i=t.data;e.original=i,e._setFeaturesFromGeoJSON()}):this.loaded=Promise.resolve(),this.loaded.then(function(){e.getDrawingLayer()||(ne.getInstance().addLayer(new _n({name:e._id,projection:R.createMercatorProjection().getConfigObject()})),e._setFeaturesFromGeoJSON())}).then(function(){e.visible&&e.getDrawingLayer().activate(!0)})}},{key:"unload",value:function(){var e=this.getDrawingLayer();e&&this.getDrawingLayer().activate(!1)}},{key:"_setFeaturesFromGeoJSON",value:function(){var e=this.getDrawingLayer(),t=fr(this.original,{dynamicStyle:!0,readLegacyStyleOptions:!0}),i=t.features,n=t.style;e.addFeatures(i),n&&e.setStyle(n);var r=function(){var e=i.filter(function(e){return"clampToGround"===e.get("olcs_altitudeMode")&&e.get("olcs_extrudedHeight")&&e.get("olcs_extrudedHeight")>0});e.forEach(function(e){mi(e).then(function(){e.set("olcs_altitudeMode","absolute")})})};if("vcs.vcm.maps.Cesium"===ne.getInstance().getActiveMap().className)r();else var a=ne.getInstance().subscribe("MAP_ACTIVATED",function(e){"vcs.vcm.maps.Cesium"===e.className&&(r(),ne.getInstance().unsubscribeByKey(a))})}},{key:"_writeToGeoJSON",value:function(){var e=this.getDrawingLayer(),t={asObject:!0,writeStyle:!0,embedIcons:!0};return gr({features:e.getFeatures(),vcsMeta:e.getVcsMeta(t)},t)}},{key:"getDrawingLayer",value:function(){return ne.getInstance().getLayerByName(this._id)}},{key:"zoomTo",value:function(){var e=this.getDrawingLayer();if(e.getFeatures().length>0){var t=e.source.getExtent(),i=R.getTransformer(R.createGeographicProjection(),R.createMercatorProjection());i(t,t,2);var n=V.createViewPointFromExtent(t);ne.getInstance().getActiveMap().gotoViewPoint(n)}}},{key:"greyOut",value:function(){var e=this.getDrawingLayer();this.loaded&&e.active&&!this.greyed&&(_s[this._id]=e.getStyle(),e.setStyle(ps),this.greyed=!0)}},{key:"unGrey",value:function(){this.greyed&&_s[this._id]&&(this.getDrawingLayer().setStyle(_s[this._id]),this.greyed=!1)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.getDrawingLayer().activate(!0)}},{key:"setDrawing",value:function(e){var t=fs(this.editorId);e?t.addEditingLayer(this.getDrawingLayer()):t.removeEditingLayer(this.getDrawingLayer())}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.geoJSON=this._writeToGeoJSON(),e}},{key:"reset",value:function(){this.getDrawingLayer().removeAllFeatures(),this._setFeaturesFromGeoJSON()}},{key:"destroy",value:function(){this.getDrawingLayer().removeAllFeatures(),this.getDrawingLayer().dispose()}}]),t}(za),Ls=bs,Ms=Y.getLogger("vcs.vcm.widgets.planning.PlanningObjectProcessing"),ks=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.description=e.stdoutMsgs&&Array.isArray(e.stdoutMsgs)?e.stdoutMsgs.join("\n"):"",i._pollingInterval=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectProcessing"}}]),Object(m["a"])(t,[{key:"load",value:function(){this._observeStatus()}},{key:"unload",value:function(){clearInterval(this._pollingInterval),this._pollingInterval=null}},{key:"observeStatus",value:function(){Ms.deprecate("observeStatus","Use load to start polling the status & unload to stop."),this._observeStatus()}},{key:"_observeStatus",value:function(){var e=this;null!=this._pollingInterval&&clearInterval(this._pollingInterval),this._pollingInterval=window.setInterval(function(){var t=e.serviceUrl.clone().extendPath("get-object-status",e._id);ce.a.post(t.toString()).then(function(t){if(e.status=t.data,e.status===Ha.FAILED||e.status===Ha.READY){var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});return i.updatePlanningObject(e).then(function(){e.destroy()})}return Promise.resolve()}).catch(function(t){if(t.response&&t.response.data&&"notFound"===t.response.data.error){var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});i.updatePlanningObjects()}else Ms.error("Could not update PlanningObject ".concat(e._id,", polling is stopped Error: ").concat(t.toString())),e.destroy()})},1e4)}},{key:"destroy",value:function(){clearInterval(this._pollingInterval),this._pollingInterval=null}}]),t}(za),ws=ks,Ts=Y.getLogger("vcs.vcm.widgets.planning.PlanningObjectFeatureStore"),Ss=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.loaded=null,i.featureStoreUrl=i.serviceUrl.clone(),i.featureStoreUrl.extendPath("feature-store"),i.featureStoreUrl.addQueryParams({planningId:i.planningInstanceId,planningObjectId:i._id}),i.layerId=e.layerId,i.editorId=e.editorId,i.trackerValues={},i.terrainUrl=e.terrainUrl,i._balloonTemplate=e.balloonTemplate||"",i._pollingInterval=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectFeatureStore"}}]),Object(m["a"])(t,[{key:"getLayer",value:function(){return ne.getInstance().getLayerByName(this.layerId)}},{key:"load",value:function(){var e=this;if(this.status===Ha.READY){if(!this.loaded){var t=this.featureStoreUrl.clone();t.extendPath("get-layer"),this.loaded=ce.a.get(t.toString()).then(function(t){var i=t.data;if(i.staticRepresentation&&i.staticRepresentation.threeDim){var n="".concat(e.serviceUrl.base);if(e.serviceUrl.path.length>1){var r=e.serviceUrl.path.slice(0,e.serviceUrl.path.length-1);n="".concat(n,"/").concat(r.join("/"))}i.staticRepresentation.threeDim="".concat(n,"/").concat(i.staticRepresentation.threeDim);var a=e.featureStoreUrl.clone().extendPath("get-layer-file");a.addQueryParams({asJson:!0,onlyStatic:!0}),i.staticRepresentation.twoDim=a.toString()}i.injectedFetchDynamicFeatureFunc=e.getDynamicFeature.bind(e),i.name=e.layerId;var s=ne.getInstance();i.genericFeatureProperties={planningName:e.name,planningDescription:e.description};var o=new ta(i);if(s.addLayer(o),e._balloonTemplate){var l=s.getWidgetByType("vcs.vcm.widgets.BalloonInfo");l&&l.addTypeForLayer(e.layerId,e._balloonTemplate)}}).catch(function(e){Ts.log(e)})}this.loaded.then(function(){e.visible&&e.getLayer().activate(!0)})}else this._observeStatus()}},{key:"unload",value:function(){var e=this.getLayer();e&&e.activate(!1),this._pollingInterval&&(clearInterval(this._pollingInterval),this._pollingInterval=null),this._removeModeChangeListener&&(this._removeModeChangeListener(),this._removeModeChangeListener=null)}},{key:"getDynamicFeature",value:function(e){var t=this.featureStoreUrl.clone();return t.extendPath("get-feature",this.planningInstanceId,this._id,e.toString()),ce.a.post(t.toString()).then(function(e){var t=e.data;return t})}},{key:"show",value:function(){this.getLayer()?(Se(b(t.prototype),"show",this).call(this),this.getLayer().activate(!0)):Ts.warning("FeatureStoreLayer for PlanningObjectFeatureStore does not exists, check code")}},{key:"setEditing",value:function(e){var t=fs(this.editorId),i=this.getLayer();this._removeModeChangeListener&&(this._removeModeChangeListener(),this._removeModeChangeListener=null),e?(this._removeModeChangeListener=t.modeChange.addEventListener(function(e){e&tn.NONE?i.changeTracker.pauseTracking("changefeature"):i.changeTracker.track()}),i.changeTracker.track(),this.trackerValues=i.changeTracker.values,t.addEditingLayer(i),fs(this.editorId).state.dedicatedFeatureStyle=!1):(i.changeTracker.unTrack(),t.removeEditingLayer(i),fs(this.editorId).state.dedicatedFeatureStyle=!0)}},{key:"appendFile",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,Object),o(i,Object),this.terrainUrl&&(i.terrain=i.terrain||this.terrainUrl),e.append("converterOptions",JSON.stringify(i));var n=this.featureStoreUrl.clone();return n.extendPath("append"),ce.a.post(n.toString(),e).then(function(){t.status=Ha.CONVERTING,t._observeStatus()})}},{key:"calculateStatic",value:function(){var e=this,t=this.featureStoreUrl.clone();t.extendPath("calculate-static");var i=this.terrainUrl?{terrain:this.terrainUrl}:void 0;return ce.a.post(t.toString(),i).then(function(){e.status=Ha.OPTIMIZING,e._observeStatus()})}},{key:"_observeStatus",value:function(){var e=this;null!=this._pollingInterval&&clearInterval(this._pollingInterval),this._pollingInterval=window.setInterval(function(){var t=e.serviceUrl.clone().extendPath("get-object-status",e._id);ce.a.post(t.toString()).then(function(t){if(e.status=t.data,e.status===Ha.FAILED)Ts.warning("conversion failed"),clearInterval(e._pollingInterval),e._pollingInterval=null;else if(e.status===Ha.READY){ne.getInstance().removeLayerByName(e.layerId);var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});e.loaded=null,i.loaded&&e.load(),clearInterval(e._pollingInterval),e._pollingInterval=null}}).catch(function(e){Ts.error(e)})},2e4)}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.balloonTemplate=this._balloonTemplate&&""!==this._balloonTemplate?this._balloonTemplate:void 0,e}},{key:"save",value:function(){var e=this,i=this.getLayer(),n=fs(this.editorId);n.state.active&&n.setMode(tn.NONE);var r=this.featureStoreUrl.clone();return r.extendPath("bulk"),i.changeTracker.commitChanges(r.toString()).then(function(){return e.saveVcsMeta()}).then(function(){return Se(b(t.prototype),"save",e).call(e)})}},{key:"saveVcsMeta",value:function(){var e=this.getLayer().getVcsMeta({writeStyle:!0}),t=this.featureStoreUrl.clone();return t.extendPath("edit-meta"),ce.a.post(t.toString(),e)}},{key:"reset",value:function(){var e=this.getLayer(),t=fs(this.editorId);return t.setMode(tn.NONE),e.changeTracker.reset()}},{key:"destroy",value:function(){var e=this.getLayer();e&&e.dispose(),this._pollingInterval&&(clearInterval(this._pollingInterval),this._pollingInterval=null)}},{key:"zoomTo",value:function(){var e=this.getLayer(),t=e.getExtent();if(t.isValid()){var i=t.getCoordinatesInProjection(R.createGeographicProjection()),n=V.createViewPointFromExtent(i);n.distance=n.distance<4e3?n.distance:4e3,ne.getInstance().getActiveMap().gotoViewPoint(n)}}},{key:"balloonTemplate",get:function(){return this._balloonTemplate},set:function(e){this._balloonTemplate=e;var t=ne.getInstance().getWidgetByType("vcs.vcm.widgets.BalloonInfo");if(t)if(this._balloonTemplate&&""!==this._balloonTemplate)if(t.layerNamesToBalloonTypes[this.layerId]){var i=t.balloonTypes[t.layerNamesToBalloonTypes[this.layerId]];i.template=this._balloonTemplate}else t.addTypeForLayer(this.layerId,this._balloonTemplate);else delete t.layerNamesToBalloonTypes[this.layerId]}},{key:"name",get:function(){return this._name},set:function(e){this._name=e;var t=this.getLayer();t&&t.addGenericFeatureProperties({planningName:e})}},{key:"description",get:function(){return this._description},set:function(e){this._description=e;var t=this.getLayer();t&&t.addGenericFeatureProperties({planningDescription:e})}}]),t}(za),Os=Ss,Cs=i(3),Es=i.n(Cs),Is="<div class='balloon' id='myBalloon'>\n  <h1 class='balloon-title'><%= obj.title %></h1>\n  <div class='balloon-content'>\n    <%= obj.description %>\n    <hr>\n    <small>\n    <% if (obj.edited) {%>\n      <i><%= obj.edited %></i>\n    <% }%>\n    <%= obj.author %> <%= obj.date %>\n    </small>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Ds=null,js=function(){function e(){var t=this;Object(d["a"])(this,e),this.active=!1,this.setupResolve=null,this.setupPromise=new Promise(function(e){t.setupResolve=e}),this.serviceUrl=null,this.scenarioId=null,this.projectId=null,this.currentUser={userSettings:null},this.projectGroups=[],this.projectUsers=[],this.projectSettings={hasMail:!1,selfRegister:!1,userInvite:!1},this.onLogin=[],this.onLogout=[],this.beforeLogout=[],window.addEventListener("beforeunload",function(){t.logout()})}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.util.Login"}}]),Object(m["a"])(e,[{key:"handleURLParameter",value:function(e){e["reset-token"]?e.enrollment?window.location.hash="#/login/enroll/".concat(e["reset-token"]):window.location.hash="#/login/reset/".concat(e["reset-token"]):e["verify-token"]&&(window.location.hash="#/login/verify/".concat(e["verify-token"]))}},{key:"registerWidget",value:function(e){if(this.active){var t=this.serviceUrl===e.serviceUrl,i=this.projectId===e.projectId,n=this.scenarioId===e.scenarioId;return t&&n&&i?(e.onLogin.forEach(function(e){this.onLogin.push(e)},this),e.onLogout.forEach(function(e){this.onLogout.push(e)},this),e.beforeLogout.forEach(function(e){this.beforeLogout.push(e)},this),Promise.resolve()):Promise.reject(new Error("Login recieved two different configurations"))}return this.serviceUrl=e.serviceUrl,this.url=a["a"].parse(this.serviceUrl),this.url.addQueryParams({version:3.6}),this.projectId=e.projectId,this.scenarioId=e.scenarioId,e.onLogin.forEach(function(e){this.onLogin.push(e)},this),e.onLogout.forEach(function(e){this.onLogout.push(e)},this),e.beforeLogout.forEach(function(e){this.beforeLogout.push(e)},this),this._getProject()}},{key:"registerHook",value:function(e,t){o(e,["onLogin","onLogout","beforeLogout"]),o(t,Function),"onLogin"===e?this.onLogin.push(t):"onLogout"===e?this.onLogout.push(t):"beforeLogout"===e&&this.beforeLogout.push(t)}},{key:"_getProject",value:function(){var e=this.url.clone();return ce.a.post(e.extendPath("project","get").toString(),{projectId:this.projectId}).then(this._setProject.bind(this)).catch(function(){}).then(this.setupResolve)}},{key:"_setProject",value:function(e){return e.data&&e.data._id===this.projectId?(Object.assign(this.projectSettings,e.data),this.active=!0,Promise.resolve()):Promise.reject("Login project was not found or did not match registered project")}},{key:"login",value:function(t,i){if(o(t,String),o(i,String),!this.active)return Promise.reject("Login has not been activated!");var n=e.sha256(i),r=this.url.clone();return ce.a.post(r.extendPath("user","login").toString(),{email:t,password:n,mapId:this.scenarioId}).then(this.setUser.bind(this))}},{key:"logout",value:function(){var e=this.beforeLogout.map(function(e){return e()}).filter(function(e){return null!=e}),t=function(e){return ce.a.post("".concat(this.serviceUrl,"/user/logout?access_token=").concat(this.getBearerToken())).then(this.clearUser.bind(this)),e?Promise.reject(new Error("logout failed")):Promise.resolve()};return Promise.all(e).then(t.bind(this,!1)).catch(t.bind(this,!0))}},{key:"register",value:function(t,i,n){if(o(t,String),o(i,String),l(n,String),!Object(u["d"])(t))throw new Error("i18n_error_invalidEmail");var r=n?{name:n}:null,a=e.sha256(i);return ce.a.post("".concat(this.serviceUrl,"/user/register"),{email:t,password:a,projectId:this.projectId,profile:r,mapId:this.scenarioId})}},{key:"invite",value:function(e){if(o(e,String),!Object(u["d"])(e))throw new Error("i18n_error_invalidEmail");var t=this.getBearerToken();return ce.a.post("".concat(this.serviceUrl,"/user/register")+"?access_token=".concat(t),{email:e,projectId:this.projectId,mapId:this.scenarioId})}},{key:"verifyEmail",value:function(e){return o(e,String),ce.a.post("".concat(this.serviceUrl,"/user/verify-email"),{token:e})}},{key:"requestResetPassword",value:function(e){return o(e,String),ce.a.post("".concat(this.serviceUrl,"/user/request-reset"),{email:e,mapId:this.scenarioId})}},{key:"resetPassword",value:function(t,i){o(t,String),o(i,String);var n=e.sha256(t);return ce.a.post("".concat(this.serviceUrl,"/user/reset-password"),{password:n,token:i}).then(this.setUser.bind(this))}},{key:"getCurrentUser",value:function(){return this.currentUser}},{key:"getUserById",value:function(e){return this.projectUsers.find(function(t){return t._id===e})}},{key:"getBearerToken",value:function(){return this.currentUser?this.currentUser.token:null}},{key:"setUser",value:function(e){var t=this;Object.assign(this.currentUser,e.data),this.url.addQueryParams({access_token:this.currentUser.token});var i=this.url.clone(),n=ce.a.post(i.extendPath("group","get-shareable").toString(),{projectId:this.projectId}),r=this.url.clone(),a=ce.a.post(r.extendPath("user","get").toString(),{userId:this.currentUser.id}),s=this.url.clone(),o=ce.a.get(s.extendPath("project-users",this.projectId).toString());return Promise.all([n,a,o]).then(function(e){t.setProjectGroups(e[0]),t.setProfile(e[1]),t._setProjectUsers(e[2]),t.onLogin.forEach(function(e){e()})})}},{key:"setProjectGroups",value:function(e){this.projectGroups.splice(0,this.projectGroups.length),e.data.forEach(function(e){var t={};t.id=e._id,t.name=e.name,this.projectGroups.push(t)},this)}},{key:"setProfile",value:function(e){this.currentUser.userSettings=e.data}},{key:"_setProjectUsers",value:function(e){var t=e.data;t.users&&t.users.forEach(function(e){this.projectUsers.push(e)},this)}},{key:"clearUser",value:function(){Object.keys(this.currentUser).forEach(function(e){"userSettings"===e?this.currentUser[e]=null:delete this.currentUser[e]},this),this.projectGroups.splice(0,this.projectGroups.length),this.onLogout.forEach(function(e){e()}),console.log("logged out",this.currentUser)}},{key:"searchUser",value:function(e){var t=this.url.clone();return ce.a.post(t.extendPath("user","search").toString(),{text:e,projectId:this.projectId})}}],[{key:"getInstance",value:function(){return Ds||(Ds=new e),Ds}},{key:"sha256",value:function(e){var t=8,i=0;function n(e,t){var i=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(i>>16);return n<<16|65535&i}function r(e,t){return e>>>t|e<<32-t}function a(e,t){return e>>>t}function s(e,t,i){return e&t^~e&i}function o(e,t,i){return e&t^e&i^t&i}function l(e){return r(e,2)^r(e,13)^r(e,22)}function c(e){return r(e,6)^r(e,11)^r(e,25)}function u(e){return r(e,7)^r(e,18)^a(e,3)}function h(e){return r(e,17)^r(e,19)^a(e,10)}function d(e,t){var i,r,a,d,m,f,y,g,v,p,_=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),b=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),L=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var M=0;M<e.length;M+=16){i=b[0],r=b[1],a=b[2],d=b[3],m=b[4],f=b[5],y=b[6],g=b[7];for(var k=0;k<64;k++)L[k]=k<16?e[k+M]:n(n(n(h(L[k-2]),L[k-7]),u(L[k-15])),L[k-16]),v=n(n(n(n(g,c(m)),s(m,f,y)),_[k]),L[k]),p=n(l(i),o(i,r,a)),g=y,y=f,f=m,m=n(d,v),d=a,a=r,r=i,i=n(v,p);b[0]=n(i,b[0]),b[1]=n(r,b[1]),b[2]=n(a,b[2]),b[3]=n(d,b[3]),b[4]=n(m,b[4]),b[5]=n(f,b[5]),b[6]=n(y,b[6]),b[7]=n(g,b[7])}return b}function m(e){for(var i=Array(),n=(1<<t)-1,r=0;r<e.length*t;r+=t)i[r>>5]|=(e.charCodeAt(r/t)&n)<<24-r%32;return i}function f(e){for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}function y(e){for(var t=i?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*e.length;r++)n+=t.charAt(e[r>>2]>>8*(3-r%4)+4&15)+t.charAt(e[r>>2]>>8*(3-r%4)&15);return n}return e=f(e),y(d(m(e),e.length*t))}}]),e}(),Ps=js,Ys=Y.getLogger("vcs.vcm.widgets.planning.PlanningComment");function xs(e){var t,i,n=e.properties;n.editedBy&&n.editedOn?(t=n.editedBy,i=n.editedOn,n.edited=q.getInstance().getSingleMessage("i18n_planning_comment_edited")):(t=n.createdBy,i=n.createdOn);var r=Ps.getInstance().getUserById(t);n.author=r&&r.profile?r.profile.name:"anonymous",n.date=Es()(i).format("LLL")}function As(e){var t=gr({features:[e]},{asObject:!0}),i=t.features[0];return i.id=e.getId(),delete i.properties.selected,i}var Fs={DEFAULT:"default",INFO:"info",SUCCESS:"success",WARNING:"warning"},Ns=function(){function e(t,i,n){var r=this;Object(d["a"])(this,e),this.planningId=t,this.url=i.clone(),this.url.addQueryParams({planningId:t}),this.url.extendPath("comment"),this.dataLoaded=!1,this.ready=new Promise(function(e){r._readyResolve=e}),this.permissions=n,this.comments=[];var a=ne.getInstance(),s=a.getWidgetByType("vcs.vcm.widgets.BalloonInfo");s&&s.addTypeForLayer("".concat(this.planningId,"_comments"),Is),a.subscribe("LOCALE_CHANGED",this.localeChanged.bind(this)),this.localeChanged(a.getLocale())}return Object(m["a"])(e,[{key:"getLayer",value:function(){var e=ne.getInstance(),t=e.getLayerByName("".concat(this.planningId,"_comments"));return t||(t=new _n({altitudeMode:"absolute",name:"".concat(this.planningId,"_comments"),allowPicking:!0,projection:R.createMercatorProjection().getConfigObject(),balloonHeightOffset:1,style:"planningCommentStyle"}),e.addLayer(t)),t}},{key:"load",value:function(){var e=this;if(!this.dataLoaded){var t=this.getLayer(),i=this.url.clone();i.extendPath("get-comments"),ce.a.get(i.toString()).then(function(i){var n,r=i.data;(n=e.comments).push.apply(n,Object(T["a"])(r.features)),e.comments.forEach(xs);var a=fr(r),s=a.features;t.addFeatures(s),e.dataLoaded=!0,e._readyResolve()}).catch(function(t){Ys.error(t.message),e.dataLoaded=!0,e._readyResolve()})}this.ready.then(function(){e.getLayer().activate(!0)})}},{key:"localeChanged",value:function(e){if(Es.a.locale(e),this.dataLoaded){var t=this.getLayer();this.comments.forEach(function(e){xs(e);var i=t.getFeatureById(e.id);i&&(e.properties.edited&&i.set("edited",e.properties.edited,!0),i.set("author",e.properties.author,!0),i.set("date",e.properties.date))})}}},{key:"unLoad",value:function(){this.getLayer().activate(!1)}},{key:"lookAt",value:function(e){var t=ne.getInstance(),i=this.getLayer(),n=i.getFeatureById(e),r=t.getActiveMap(),a=r.getViewPoint();a.pitch>-45&&(a.pitch=-45),a.distance||(a.distance=2e3),a.setCameraPosition(null),a.setGroundPosition(R.mercatorToWgs84(n.getGeometry().getCoordinates())),a.setAnimate(!0),r.gotoViewPoint(a),t.publish("FEATURE_CLICKED",n.getId(),n,i)}},{key:"addComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("add"),ce.a.post(n.toString(),i).then(function(i){var n=i.data;xs(n),t.comments.push(n),e.setId(n.id),e.set("author",n.properties.author,!0),e.set("date",n.properties.date)})}},{key:"editComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("edit"),ce.a.post(n.toString(),i).then(function(i){var n=i.data,r=t.comments.findIndex(function(e){return e.id===n.id});t.comments.splice(r,1,n),xs(n),e.set("author",n.properties.author,!0),e.set("date",n.properties.date)})}},{key:"deleteComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("delete"),ce.a.post(n.toString(),i).then(function(){var e=t.comments.findIndex(function(e){return e.id===i.id});t.comments.splice(e,1),t.getLayer().removeFeaturesById([i.id])})}},{key:"destroy",value:function(){this.comments.splice(0);var e=ne.getInstance().getLayerByName("".concat(this.planningId,"_comments"));e&&e.dispose()}}]),e}(),Hs=Ns;function Rs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.viewpoints.map(function(e){e.duration=null!=e.duration?e.duration:null;var t=F(e.cameraPosition.slice(),void 0,3),i=new ol.Feature({geometry:new ol.geom.Point(t)});return i.setProperties(Object.assign({},e)),i}),n={features:i,vcsMeta:{flightOptions:{name:e.name,loop:e.loop,interpolation:e.interpolation}}};return gr(n,t)}function zs(e){var t=fr(e),i=t.vcsMeta&&t.vcsMeta.flightOptions?t.vcsMeta.flightOptions:{name:"ImportedFlight"};return i.viewpoints=t.features.map(function(e){var t={name:e.get("name"),distance:e.get("distance"),groundPosition:e.get("groundPosition"),cameraPosition:e.get("cameraPosition"),heading:e.get("heading"),pitch:e.get("pitch"),roll:e.get("roll"),animate:!1,duration:null!=e.get("duration")?e.get("duration"):null};return t}),i}var Gs={SPLINE:"spline",LINEAR:"linear"},Vs=function(){function e(t){Object(d["a"])(this,e),this.id=Object(u["c"])(),this.name=t.name,this.viewpoints=t.viewpoints||[],this.multiplier=Object(u["g"])(t.multiplier,1),this.loop=Object(u["e"])(t.loop,!1),this.interpolation=t.interpolation||Gs.SPLINE,this.changed=new Cesium.Event,this.url=t.url,this._readyPromise=null}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.util.flight.FlightInstance"}}]),Object(m["a"])(e,[{key:"isValid",value:function(){var e=this;return this.viewpoints.forEach(function(t,i){t.cameraPosition||e.viewpoints.splice(i,1)}),this.viewpoints.length>=2}},{key:"assign",value:function(e){this.name=e.name,this.viewpoints=e.viewpoints,this.multiplier=e.multiplier,this.loop=e.loop,this.interpolation=e.interpolation,this.changed.raiseEvent()}},{key:"getConfigObject",value:function(){return{name:this.name,multiplier:this.multiplier,loop:this.loop,interpolation:this.interpolation,viewpoints:this.viewpoints.map(function(e){return Object.assign({},e)})}}},{key:"ready",get:function(){var e=this;return this._readyPromise||(this.url?this._readyPromise=ce.a.get(this.url).then(function(t){var i=t.data,n=zs(i);e.assign(n)}):this._readyPromise=Promise.resolve()),this._readyPromise}}]),e}(),Bs=Vs;B.PLANNING_INSTANCE_LOADED="PLANNING_INSTANCE_LOADED",B.PLANNING_INSTANCE_UNLOADED="PLANNING_INSTANCE_UNLOADED";var Us=Y.getLogger("vcs.vcm.widgets.planning.PlanningInstance"),Ws=It(),qs=function(){function e(t){var i=this;Object(d["a"])(this,e),this.maintainLockInterval=null,this._id=t._id,this.name=t.name&&""!==t.name?t.name:"planning: ".concat(t._id),this.hiddenObjects=t.hiddenObjects?t.hiddenObjects:[],this.planningObjects=[],this.viewpoints=[],t.viewpoints&&t.viewpoints.length>0?this.viewpoints=t.viewpoints:t.viewpoint&&(t.viewpoint.default=!0,this.viewpoints.push(t.viewpoint)),this.flights=[],t.flights&&t.flights.forEach(function(e){var t=zs(e);i.flights.push(new Bs(t))}),this.description=t.description?t.description:null,this.permissions=t.permissions||[],this.owner=t.created,this.lastUpdated=t.lastUpdated||null,this.public=t.public;var n=new Kn({allowPicking:!0,name:"_".concat(this._id,"_model")});ne.getInstance().addLayer(n),this.layerName=n.name,this.sharedUsers=[],this.mapId=t.mapId,this.url=t.url,this.editorId=t.editorId,this.terrainUrl=t.terrainUrl,t.planningObjects&&t.planningObjects.forEach(function(e){i.addPlanningObject(e)}),this.loaded=!1,this.comments=new Hs(this._id,this.url,this.permissions),this.properties=t.properties||{}}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningInstance"}}]),Object(m["a"])(e,[{key:"load",value:function(e){var t=ne.getInstance(),i=t.getLayerByName(this.layerName),n=t.getActiveMap();"vcs.vcm.maps.Cesium"===n.className&&(i.initialized||i.initialize(),i.activate(!0)),Ws.hideObjects(this.hiddenObjects),this.planningObjects.forEach(function(e){e.handleMapChange(n),e.load()}),e||this.gotoViewpoint(),this.comments.load(),this.loaded=!0,t.publish(B.PLANNING_INSTANCE_LOADED,this)}},{key:"unLoad",value:function(){var e=ne.getInstance(),t=e.getLayerByName(this.layerName);t.activate(!1),Ws.showObjects(this.hiddenObjects),this.planningObjects.forEach(function(e){e.unload()}),this.comments.unLoad(),this.loaded=!1,e.publish(B.PLANNING_INSTANCE_UNLOADED,this)}},{key:"handleMapChange",value:function(e){if(this.loaded){var t=ne.getInstance().getLayerByName(this.layerName);"vcs.vcm.maps.Cesium"===e.className?(t.initialized||t.initialize(),t.activate(!0)):t.isActive()&&t.activate(!1),this.planningObjects.forEach(function(t){t.handleMapChange(e)})}}},{key:"addPlanningObject",value:function(e){var t;return"geojson"===e.type&&(e.type="drawing"),"ready"!==e.status?(t="featureStore"===e.type?new Os(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId,terrainUrl:this.terrainUrl},e)):new ws(Object.assign({planningInstanceId:this._id,serviceUrl:this.url},e)),"failed"!==t.status&&this.loaded&&t.load(),this.planningObjects.push(t)):"gltf"===e.type?(t=new Va(Object.assign({planningInstanceId:this._id,planningInstanceGltfLayerName:this.layerName,serviceUrl:this.url},e)),this.planningObjects.push(t)):"drawing"===e.type?(t=new Ls(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId},e)),this.loaded&&!t.loaded&&t.load(),this.planningObjects.push(t)):"featureStore"===e.type?(t=new Os(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId,terrainUrl:this.terrainUrl},e)),this.loaded&&!t.loaded&&t.load(),this.planningObjects.push(t)):"image"===e.type&&(t=new Ua(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId},e)),this.loaded&&t.load(),this.planningObjects.push(t)),t.initialize(),t}},{key:"updatePlanningObject",value:function(e){var t=this,i=this.url.clone();return ce.a.post(i.extendPath("get-id").toString(),{id:this._id}).then(function(i){var n=i.data,r=t.planningObjects.findIndex(function(t){return t._id===e._id});t.planningObjects.splice(r,1);var a=n.planningObjects.find(function(t){return t._id===e._id});t.addPlanningObject(a)})}},{key:"updatePlanningObjects",value:function(){var e=this,t=this.url.clone();return ce.a.post(t.extendPath("get-id").toString(),{id:this._id}).then(function(t){var i=t.data;e.planningObjects.forEach(function(e){e.destroy()}),e.planningObjects.splice(0),i.planningObjects.forEach(e.addPlanningObject.bind(e))})}},{key:"deletePlanningObject",value:function(e,t){var i=this;o(e,za),l(t,Function);var n=this.planningObjects.findIndex(function(t){return t._id===e._id});return this.planningObjects.splice(n,1),e.delete().then(function(){e.destroy(),t(null)}).catch(function(n){var r=e.getConfigObject();e.destroy(),i.addPlanningObject(r),t(n)})}},{key:"lock",value:function(){var e=this,t=this.url.clone();return ce.a.post(t.extendPath("lock").toString(),{_id:this._id}).then(function(){e.maintainLockInterval||(e.maintainLockInterval=setInterval(e.maintainLock.bind(e),1e5))})}},{key:"maintainLock",value:function(){var e=this;this.lock().catch(function(){e.unlock()})}},{key:"unlock",value:function(){this.maintainLockInterval&&clearInterval(this.maintainLockInterval),this.maintainLockInterval=null;var e=this.url.clone();return ce.a.post(e.extendPath("unlock").toString(),{_id:this._id})}},{key:"save",value:function(){var e={_id:this._id,mapId:this.mapId,name:this.name,description:this.description,viewpoint:void 0,viewpoints:this.viewpoints,flights:this.flights.map(function(e){return Rs(e,{asObject:!0})}),hiddenObjects:this.hiddenObjects},t=this.url.clone();return ce.a.post(t.extendPath("update").toString(),e)}},{key:"getPlanningObjectDefinitions",value:function(){return Object.values(this.planningObjects).map(function(e){return e.getDefinition()})}},{key:"addHiddenObject",value:function(e){return o(e,String),!this.hiddenObjects.includes(e)&&(Ws.hideObjects([e]),this.hiddenObjects.push(e),!0)}},{key:"removeHiddenObject",value:function(e){if(o(e,[String,Number]),this.hiddenObjects.includes(e)){Ws.showObjects([e]);var t=this.hiddenObjects.indexOf(e);return this.hiddenObjects.splice(t,1),!0}return!1}},{key:"destroy",value:function(){for(var e=0;e<this.planningObjects.length;e++)this.planningObjects[e].destroy();this.loaded&&this.unLoad(),this.comments.destroy();var t=ne.getInstance().getLayerByName(this.layerName);return t.dispose(),this.layerName="",this.maintainLockInterval?this.unlock():Promise.resolve()}},{key:"gotoViewpoint",value:function(e){var t=e;if(null==t&&(t=this.viewpoints.findIndex(function(e){return e.default}),t=-1===t?0:t),this.viewpoints[t]){var i=new V(this.viewpoints[t]),n=ne.getInstance();n.getActiveMap().gotoViewPoint(i)}}},{key:"sharePlanning",value:function(e,t,i){o(e,String),o(t,String),l(i,[String]);var n={actorId:t,doc:{_id:e}};i&&(n.permissions=i);var r=this.url.clone().extendPath("share");return ce.a.post(r.toString(),n).then(this.getSharedUsers.bind(this))}},{key:"getSharedUsers",value:function(){var e=this,t=this.url.clone().extendPath("shared-users");return ce.a.post(t.toString(),{_id:this._id}).then(function(t){e.sharedUsers=t.data})}},{key:"publishPlanning",value:function(){var e=this,t=this.url.clone().extendPath("publish");return ce.a.post(t.toString(),{_id:this._id,public:!this.public}).then(function(){e.public=!e.public})}},{key:"userHasPermission",value:function(e){return o(e,String),this.permissions.indexOf(e)>-1}},{key:"isLocked",value:function(){return null!==this.maintainLockInterval}},{key:"uploadNewModel",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(e,Object),o(t,{percentage:[Number,String,null]}),o(n,Object);var r={};t&&(r.onUploadProgress=function(e){t.percentage=Math.round(100*e.loaded/e.total)}),this.terrainUrl&&(n.terrain=n.terrain||this.terrainUrl),e.append("converterOptions",JSON.stringify(n));var a=this.url.clone().extendPath("upload");return a.addQueryParams({planning_id:this._id}),ce.a.post(a.toString(),e,r).then(function(e){var t=e.data,n=null;return t.planningObjects.forEach(function(e){var t=i.planningObjects.find(function(t){return t._id===e._id});t||(n=i.addPlanningObject(e))}),n})}},{key:"createFeatureStoreObject",value:function(){var e=this,t=this.url.clone().extendPath("feature-store","create");return t.addQueryParams({planningId:this._id}),ce.a.post(t.toString()).then(function(t){var i=t.data;return e.addPlanningObject(i)})}},{key:"uploadNewDrawing",value:function(){var e=this;Us.deprecate("uploadNewDrawing","Drawings are deprecated on the virtualcityPLANNER, use createFeatureStoreObject instead");var t={type:"FeatureCollection",features:[]},i=this.url.clone().extendPath("add-drawing");return ce.a.post(i.toString(),{planningId:this._id,geoJSON:t}).then(function(t){var i=t.data,n=null;return i.planningObjects.forEach(function(t){var i=e.planningObjects.find(function(e){return e._id===t._id});i||(n=e.addPlanningObject(t))}),n})}}]),e}(),Js=qs,Ks=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._lastPosition=null,i._firstPosition=null,i._translationOptions={},i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.ALT,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=t[0]-this._lastPosition[0],n=t[1]-this._lastPosition[1];e.type&(me.CLICK|me.DRAGEND)?(this._translationOptions.dxTotal=t[0]-this._firstPosition[0],this._translationOptions.dyTotal=t[1]-this._firstPosition[1],this._translationOptions.isMoving=!1,this._translationOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,this.editor.translate(this.editor.state.transformGeometryOnMove?i:this._translationOptions.dxTotal,this.editor.state.transformGeometryOnMove?n:this._translationOptions.dyTotal,this._translationOptions),this.editor.selectFeatureInteraction.setActive(!0),this._lastPosition=null,this._firstPosition=null):e.type&(me.DRAG|me.MOVE)?(this.editor.translate(i,n,this._translationOptions),this._lastPosition=t):this._lastPosition=null}else e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.EDITABLE&&this.editor.features.has(e.feature.getId())&&(this.scene?(this.createPlane(e.positionOrPixel),this._lastPosition=this.getPosition(e),this._firstPosition=this.getPosition(e)):(this._lastPosition=e.positionOrPixel,this._firstPosition=e.positionOrPixel),this.editor.selectFeatureInteraction.setActive(!1),this._translationOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0});return Promise.resolve(e)}}]),t}(Xa),Zs=Ks,Qs=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.SHIFT|de.ALT,i._lastPosition=null,i._firstPosition=null,i.setActive(),i._scaleOptions={},i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=t[0]-this._lastPosition[0],n=t[1]-this._lastPosition[1];e.type&(me.CLICK|me.DRAGEND)?(this._scaleOptions.dxTotal=t[0]-this._firstPosition[0],this._scaleOptions.dyTotal=t[1]-this._firstPosition[1],this._scaleOptions.isMoving=!1,this._scaleOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,this.editor.scale(this.editor.state.transformGeometryOnMove?i:this._scaleOptions.dxTotal,this.editor.state.transformGeometryOnMove?n:this._scaleOptions.dyTotal,this._scaleOptions),this.editor.selectFeatureInteraction.setActive(!0),this._lastPosition=null,this._firstPosition=null):(this._lastPosition=t,this.editor.scale(i,n,this._scaleOptions))}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var r=e.feature.getGeometry().getCoordinates()[2]?e.feature.getGeometry().getCoordinates():e.positionOrPixel;this.editor.selectFeatureInteraction.setActive(!1),this._scaleOptions={maintainAspectRatio:!!(e.key&de.SHIFT),vertex:e.feature,toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this._lastPosition=r,this._firstPosition=r,this.scene&&this.createPlane(this._lastPosition)}return Promise.resolve(e)}}]),t}(Xa),Xs=Qs;function $s(e,t,i){var n=e.x*t.y-e.y*t.x;return n>0?i:-1*i}var eo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.CTRL,i._lastPosition=new Cesium.Cartesian2,i._firstPosition=new Cesium.Cartesian2,i._newPosition=new Cesium.Cartesian2,i._scratchCenter=new Cesium.Cartesian2,i._rotationOptions={},i._rotating=!1,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._rotating){var t,i=this.getPosition(e);this._newPosition=Cesium.Cartesian2.fromElements(i[0],i[1],this._newPosition),this._newPosition=Cesium.Cartesian2.subtract(this._scratchCenter,this._newPosition,this._newPosition),e.type&(me.DRAGEND|me.CLICK)?(this._rotationOptions.angleTotal=$s(this._firstPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._firstPosition,this._newPosition)),this._rotationOptions.isMoving=!1,this._rotationOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,t=this.editor.state.transformGeometryOnMove?$s(this._lastPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._lastPosition,this._newPosition)):this._rotationOptions.angleTotal,this.editor.selectFeatureInteraction.setActive(!0),this._rotating=!1):t=$s(this._lastPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._lastPosition,this._newPosition)),this.editor.rotate(t,this._rotationOptions),this._lastPosition=this._newPosition.clone(this._lastPosition)}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var n=e.feature.getGeometry().getCoordinates()[2]?e.feature.getGeometry().getCoordinates():e.positionOrPixel;this.scene&&this.createPlane(n),this.editor.selectFeatureInteraction.setActive(!1),this._scratchCenter=Cesium.Cartesian2.fromArray(ol.extent.getCenter(this.editor.extent),0,this._scratchCenter),this._firstPosition=Cesium.Cartesian2.fromArray(n,0,this._firstPosition),this._firstPosition=Cesium.Cartesian2.subtract(this._scratchCenter,this._firstPosition,this._firstPosition),this._lastPosition=this._firstPosition.clone(this._lastPosition),this._rotationOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this._rotating=!0}return Promise.resolve(e)}}]),t}(Xa),to=eo,io=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!1})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.ALT|de.SHIFT,i._lastHeight=null,i._firstHeight=null,i._isExtrusion=!1,i._heightOptions={},i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this.scene)if(null!==this._lastHeight){var t,i=this.getPosition(e);e.type&(me.CLICK|me.DRAGEND)?(this._heightOptions.heightTotal=i[2]-this._firstHeight,this._heightOptions.isMoving=!1,this.editor.state.transformGeometryOnMove?t=i[2]-this._lastHeight:(this._heightOptions.toTransform=lo.GEOMETRY,t=this._heightOptions.heightTotal),this._lastHeight=null,this._firstHeight=null):(t=i[2]-this._lastHeight,this._lastHeight=i[2]),this._isExtrusion?this.editor.extrude(t,i[2],this._heightOptions):this.editor.translateHeight(t,i[2],this._heightOptions)}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.HEIGHTVERTEX){var n=e.feature.getGeometry().getCoordinates();this._lastHeight=n[2]||e.positionOrPixel[2],this._firstHeight=this._lastHeight,this._isExtrusion=!!(e.key&de.SHIFT),this._heightOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this.createPlane(n)}return Promise.resolve(e)}}]),t}(Xa),no=io,ro=i(666),ao=i.n(ro),so=i(667),oo=i.n(so),lo={VERTEX:1,GEOMETRY:2,BOTH:0};lo.BOTH=lo.VERTEX|lo.GEOMETRY;var co=Symbol("isTransformation"),uo=Symbol("isEmpty"),ho=Y.getLogger("vcs.vcm.util.editor.FeatureLayerEditor"),mo=new ol.style.Icon({src:ao.a,anchor:[.5,.8],scale:.6}),fo=new ol.style.Style({image:mo}),yo={olcs_altitudeMode:"altitudeMode",olcs_skirt:"skirt",olcs_storeyHeight:"storeyHeight"},go=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.translateInteraction=new Zs(f(e)),e.interactionChain.addInteraction(e.translateInteraction),e.scaleTransformation=new Xs(f(e)),e.interactionChain.addInteraction(e.scaleTransformation),e.rotationTransformation=new to(f(e)),e.interactionChain.addInteraction(e.rotationTransformation),e.heightTransformation=new no(f(e)),e.interactionChain.addInteraction(e.heightTransformation),e.selectFeatureInteraction.hasMultiSelect(),e.mouseOverInteraction.hasMultiSelect=!0,(null==i.allowSelectMode||i.allowSelectMode)&&e.state.allowedModes.push(Object.keys(rn).find(function(e){return rn[e]===tn.SELECT})),e._scratchCenter=new Cesium.Cartesian2,e.flippedY=!1,e.flippedX=!1,e.heights={min:0,max:0,clamped:!0},e.extent=ol.extent.createEmpty(),e.geometry=e._createExtent(),e.feature=new ol.Feature({geometry:e.geometry}),e.feature[co]=!0,e.feature[_n.doNotTransform]=!0,e.feature.set("olcs_altitudeMode",e.heights.clamped?"clampToGround":"absolute"),e.feature.setId("_transformationFeature"),e.vertices=[],e.style=new ol.style.Style({stroke:new ol.style.Stroke({color:"#444444",width:2}),image:new ol.style.Icon({src:oo.a,scale:.45})}),e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.FeatureLayerEditor"}}]),Object(m["a"])(t,[{key:"onSelect",value:function(){this.state.mode&tn.FEATUREMODES&&this.state.active?this.recalculateExtent():this._clearGeometriesFromLayer()}},{key:"_createExtent",value:function(){var e=this,t=ol.extent.createEmpty(),i=-1/0,n=1/0,r=!0;this.features.forEach(function(a){var s=e.isOblique?a[_n.obliqueGeometry]:a.getGeometry();t=ol.extent.extend(t,s.getExtent());var o=a.get("olcs_altitudeMode");if(("clampToGround"===o||null==o&&"clampToGround"===e.activeLayer.altitudeMode)&&null==a.get("olcs_groundLevel"))n=n>0?0:n;else{r=!1;var l=hi(a,e.activeLayer.storeyHeight);i=l.max>i?l.max:i,n=l.min<n?l.min:n}}),this.extent=t,this.heights.max=i===-1/0?0:i,this.heights.min=n===1/0?0:n,this.heights.clamped=r;var a=ol.extent.getSize(this.extent);return 0===a[0]&&0===a[1]&&(this.extent=ol.extent.buffer(this.extent,10,this.extent)),this._createExtentGeom()}},{key:"_createExtentGeom",value:function(){function e(e,t){for(var i=[[0,1],[0,3],[2,3],[2,1],[0,1]],n=new Array(5),r=0;r<5;r++)n[r]=[e[i[r][0]],e[i[r][1]],t];return new ol.geom.LineString(n)}var t;if(ol.extent.isEmpty(this.extent)){var i=[0,0,1,1];t=new ol.geom.MultiLineString([e(i,this.heights.min).getCoordinates()]),t[uo]=!0}else{var n=e(this.extent,this.heights.max),r=n.getCoordinates();t=new ol.geom.MultiLineString([r]),t.appendLineString(e(this.extent,this.heights.min));for(var a=0;a<4;a++){var s=r[a].slice(0);s[2]=this.heights.min,t.appendLineString(new ol.geom.LineString([r[a],s]))}}return this.isOblique&&(t[_n.alreadyTransformedToImage]=!0),t}},{key:"_createVertex",value:function(e,t){e[2]=e[2]||0;var i=new ol.geom.Point(e);this.isOblique&&(i[_n.alreadyTransformedToImage]=!0);var n=new ol.Feature({geometry:i});return n[this.state.featureTypeSymbol]=nn.VERTEX,n[rs]=t,n[_n.doNotTransform]=!0,n}},{key:"_createVertices",value:function(){var e=this;if(!this.geometry[uo]){for(var t=this.geometry.getCoordinates()[0],i=0;i<4;i++){var n=t[i];this.vertices.push(this._createVertex(n,i))}var r=ol.extent.getCenter(this.extent);r[2]=this.heights.max;var a=this._createVertex(r,4);a[this.state.featureTypeSymbol]=nn.HEIGHTVERTEX,a.setStyle(fo),this.vertices.push(a);var s=this.heights.clamped?"clampToGround":"absolute";this.vertices.forEach(function(t,i){t.set("olcs_altitudeMode",s,!0),i<4&&t.setStyle(e.style)},this),this.feature.set("olcs_altitudeMode",s),this.scratchLayer.addFeatures([].concat(Object(T["a"])(this.vertices),[this.feature]))}}},{key:"setMode",value:function(e){ho.debug("FeatureLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.state.mode&tn.FEATUREMODES?this.recalculateExtent():this.state.mode&tn.FEATUREMODES||this._clearGeometriesFromLayer(),e&tn.SELECT?(this.translateInteraction.setActive(),this.scaleTransformation.setActive(),this.rotationTransformation.setActive(),this.heightTransformation.setActive()):e&tn.SCALE?(this.scaleTransformation.setModification(de.NONE|de.SHIFT),this.scaleTransformation.setActive(me.CLICKMOVE)):e&tn.TRANSLATE?(this.translateInteraction.setModification(de.NONE),this.translateInteraction.setActive(me.CLICKMOVE)):e&tn.ROTATE&&(this.rotationTransformation.setModification(de.NONE),this.rotationTransformation.setActive(me.CLICKMOVE))}},{key:"setAltitudeMode",value:function(e){var t=this,i=[],n=!0,r=!1,a=void 0;try{for(var s,o=function(){var t=s.value;if(e&(an.ABSOLUTE|an.ZPLANE)&&"absolute"!==t.get("olcs_altitudeMode")){var n=mi(t).then(function(){t.set("olcs_altitudeMode","absolute")});i.push(n)}else e&an.CLAMP&&"clampToGround"!==t.get("olcs_altitudeMode")&&(fi(t),i.push(Promise.resolve()))},l=this.features.values()[Symbol.iterator]();!(n=(s=l.next()).done);n=!0)o()}catch(u){r=!0,a=u}finally{try{n||null==l.return||l.return()}finally{if(r)throw a}}var c=Promise.all(i);return c.then(function(){i.length&&t.recalculateExtent()})}},{key:"translate",value:function(e,t,i){var n=this,r=i&&i.toTransform?i.toTransform:lo.BOTH;if(this.extent=[this.extent[0]+e,this.extent[1]+t,this.extent[2]+e,this.extent[3]+t],r&lo.VERTEX)for(var a=this.vertices.length-1;a>=0;a--)this.vertices[a].getGeometry().translate(e,t);r&lo.GEOMETRY&&(this.feature.getGeometry().translate(e,t),this.features.forEach(function(i){n.isOblique?i[_n.obliqueGeometry].translate(e,t):i.getGeometry().translate(e,t)}))}},{key:"translateHeight",value:function(e,t,i){var n=this;this.state.altitudeMode&an.CLAMP&&(this.state.altitudeMode=an.ABSOLUTE);var r=i&&i.toTransform?i.toTransform:lo.BOTH,a=!1;if(r&lo.GEOMETRY&&(this.features.forEach(function(i){var r=i.get("olcs_altitudeMode");a=a||"clampToGround"===r||!r&&"clampToGround"===n.activeLayer.altitudeMode,i.set("olcs_altitudeMode","absolute",!0);var s=i.get("olcs_groundLevel");i.unset("olcs_groundLevel");var o=s&&(i.get("olcs_extrudedHeight")||i.get("olcs_storeyNumber")&&i.get("olcs_storeyHeight"));di(i.getGeometry(),e,o?s+e:t,o)}),di(this.geometry,e,t)),r&lo.VERTEX){var s=this.vertices.length;while(s--)this.vertices[s].set("olcs_altitudeMode","absolute",!0),di(this.vertices[s].getGeometry(),e,t)}this.heights.min+=e,this.heights.max+=e,a&&this.recalculateExtent(),this.heights.clamped=!1}},{key:"extrude",value:function(e,t,i){var n=this,r=i||{};this.state.altitudeMode&an.CLAMP&&(this.state.altitudeMode=an.ABSOLUTE);var a=r.toTransform||lo.BOTH,s=[];if(a&lo.GEOMETRY)this.features.forEach(function(i){var a=i.get("olcs_extrudedHeight"),o=i.get("olcs_altitudeMode"),l="absolute"===o||"absolute"===n.activeLayer.altitudeMode&&null==o||null!=i.get("olcs_groundLevel");if(!l){i.set("olcs_altitudeMode","absolute",!0);var c=mi(i);s.push(c)}if(null==a)r.setHeight?i.set("olcs_extrudedHeight",t):i.set("olcs_extrudedHeight",e);else{if(Array.isArray(a)){var u=a.length;if(r.setHeight)while(u--)a[u]=t;else while(u--)a[u]+=e}else null!=a&&(r.setHeight?a=t:a+=e);i.set("olcs_extrudedHeight",a)}}),this.recalculateExtent();else if(a&lo.VERTEX){var o=this.vertices.length;while(o--)this.vertices[o].set("olcs_altitudeMode","absolute",!0),di(this.vertices[o].getGeometry(),e,t)}return s.length?Promise.all(s).then(function(){n.recalculateExtent()}):Promise.resolve()}},{key:"placeOnTerrain",value:function(){var e=this,t=[];return this.features.forEach(function(e){t.push(mi(e))}),t.length?Promise.all(t).then(function(){e.recalculateExtent()}):Promise.resolve()}},{key:"setProperty",value:function(e,t,i){this.features.forEach(function(n){n.set(e,t,i)}),0===this.features.size&&yo[e]&&(this.activeLayer[yo[e]]=t),!i&&this.features.size&&this.recalculateExtent()}},{key:"unsetProperty",value:function(e,t){this.features.forEach(function(i){i.unset(e,t)}),0===this.features.size&&yo[e]&&(this.activeLayer[yo[e]]=void 0),!t&&this.features.size&&this.recalculateExtent()}},{key:"scale",value:function(e,t,i){var n=this,r=i||{},a=r.toTransform||lo.BOTH,s=r.vertex||this.vertices[2],o=s[rs],l=s.getGeometry(),c=ol.extent.getSize(this.extent),u=t;if(r.maintainAspectRatio){var h=c[1]/c[0];u=e*h,u=1===o||3===o?-u:u}var d=[{dx:1,dy:3,across:2,flipY:!1,flipX:!1},{dx:0,dy:2,across:3,flipY:!0,flipX:!1},{dx:3,dy:1,across:0,flipY:!0,flipX:!0},{dx:2,dy:0,across:1,flipY:!1,flipX:!0}],m=d[o];if(a&lo.VERTEX&&(l.translate(e,u),this.vertices[m.dx].getGeometry().translate(e,0),this.vertices[m.dy].getGeometry().translate(0,u),this.vertices[4].getGeometry().translate(e/2,u/2)),a&lo.GEOMETRY){for(var f=this.vertices[m.across].getGeometry().getCoordinates(),y=l.getCoordinates(),g=f[1]-y[1]>0===m.flipY,v=f[0]-y[0]>0===m.flipX,p=[],_=0;_<4;_++)p[_]=this.vertices[_].getGeometry().getCoordinates();var b=ol.extent.boundingExtent(p),L=ol.extent.getSize(b),M=L[0]/c[0],k=L[1]/c[1];this.flippedY!==g&&(this.flippedY=g,k*=-1),this.flippedX!==v&&(this.flippedX=v,M*=-1),this.features.forEach(function(e){var t=n.isOblique?e[_n.obliqueGeometry]:e.getGeometry(),i=t.get("_vcsGeomType");!i||"bbox"!==i&&"rectangle"!==i||r.maintainAspectRatio||t.unset("_vcsGeomType",!0),t.scale(M,k,f)}),this.extent=b,this.feature.getGeometry().scale(M,k,f)}}},{key:"rotate",value:function(e,t){var i=this,n=t||{},r=n.toTransform||lo.BOTH,a=ol.extent.getCenter(this.extent);if(r&lo.VERTEX)for(var s=this.vertices.length-1;s>=0;s--)this.vertices[s].getGeometry().rotate(e,a);r&lo.GEOMETRY&&(this.feature.getGeometry().rotate(e,a),this.features.forEach(function(t){var n=i.isOblique?t[_n.obliqueGeometry]:t.getGeometry();"bbox"===n.get("_vcsGeomType")&&n.set("_vcsGeomType","rectangle",!0),n.rotate(e,a)})),n.isMoving||this.recalculateExtent()}},{key:"_clearGeometriesFromLayer",value:function(){var e=this.vertices.length,t=new Array(e+1);t[e]=this.feature.getId();while(e--)t[e]=this.vertices[e].getId();this.vertices.splice(0),this.scratchLayer.removeFeaturesById(t)}},{key:"recalculateExtent",value:function(){if(this.state.mode&tn.FEATUREMODES){var e=this._createExtent();if(this._clearGeometriesFromLayer(),e[uo])return;this.geometry=e,this.feature.set("olcs_altitudeMode",this.heights.clamped?"clampToGround":"absolute",!0),this.feature.setGeometry(e),this.flippedY=!1,this.flippedX=!1,this.feature.setStyle(this.style),this._createVertices()}}},{key:"handleMapChange",value:function(e){e instanceof Vt?fo.setImage(mo):fo.setImage(null),5===this.vertices.length&&this.vertices[4].changed(),Se(b(t.prototype),"handleMapChange",this).call(this,e)}}]),t}(vs),vo=go,po=new ol.style.Style({}),_o=function(e){function t(e,i,n){var r;return Object(d["a"])(this,t),r=y(this,b(t).call(this,{zPlane:!0})),r.editor=e,r.finished=!0,r.onFinish=i,r._lastVertex=null,r.maxVertices=n,r._lastPosition=null,r._defaultActive=me.CLICKMOVE,r.setActive(!1),r}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE?(t=this.getPosition(e),this.editor.vertices.length<this.maxVertices?this.editor.changeVertex(this._lastVertex,t,!this.editor.state.transformGeometryOnMove):this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._lastVertex,!this.editor.state.transformGeometryOnMove),this._lastPosition=t):e.type&me.CLICK&&(this.editor.vertices.length<this.maxVertices?(1!==this.editor.vertices.length||!this.scene||this.editor.state.altitudeMode&an.CLAMP||this.createPlane(e.positionOrPixel),t=this.getPosition(e),this._lastVertex.setStyle(null),this.editor.changeVertex(this._lastVertex,t),this._lastVertex=this.editor.pushVertex(t),this._lastVertex.setStyle(po),this._lastPosition=t):(t=this.getPosition(e),this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._lastVertex,!1),this._lastVertex.setStyle(null),this.editor.state.transformGeometryOnMove||this.editor.updateGeometry(),this._lastVertex&&this._lastVertex.setStyle(null),this.onFinish(),this.setActive(!1))),Promise.resolve(e));var t}},{key:"setActive",value:function(e){var i=e;e&&0===this.editor.vertices.length?(this.finished=!1,this._lastVertex=this.editor.pushVertex([0,0,0]),this._lastVertex.setStyle(po)):(i=!1,this.finished=!0),Se(b(t.prototype),"setActive",this).call(this,i)}}]),t}(Xa),bo=_o,Lo=function(e){function t(e){var i;Object(d["a"])(this,t);var n=e.geometry,r=n.getLinearRing(0);return e.geometry=r,i=y(this,b(t).call(this,e,!0)),i._create=new bo(f(i),i._validateOnFinish.bind(f(i)),e.isBBox?2:3),i.interactionChain.addInteraction(i._create),i.polygon=n,i.geometry=i.geometry,i._setupGeometry(n),i.isBBox=e.isBBox||!1,i._scratchCartesian1=new Cesium.Cartesian2,i._scratchCartesian2=new Cesium.Cartesian2,i.setAltitudeModeToAbsoluteOnClassification=!1,i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){for(var e=this.geometry.getCoordinates(),t=0;t<e.length;t++)this.vertices.push(this._createVertex(e[t],t));this.scratchLayer.addFeatures(this.vertices)}},{key:"pushVertex",value:function(e){var t=this;if(4===this.vertices.length)return this._create.setActive(!1),this.vertices[3];if(this.isBBox&&1===this.vertices.length){var i=[1,2,0].map(function(i){var n=e.slice();2===i?(n[0]+=1e-4,n[1]+=1e-4):n[i]+=1e-4;var r=t._createVertex(n);return t.vertices.push(r),r});return this.scratchLayer.addFeatures(i),this.vertices[0]}if(this.vertices.length<2){var n=this._createVertex(e),r=this.geometry.getCoordinates();return r.push(e),this.geometry.setCoordinates(r),this.vertices.push(n),this.scratchLayer.addFeatures([n]),n}var a=Cesium.Matrix2.fromArray([0,1,-1,0]),s=this.vertices[0].getGeometry().getCoordinates(),o=this.vertices[1].getGeometry().getCoordinates();this._scratchCartesian1=Cesium.Cartesian2.fromElements(s[0]-o[0],s[1]-o[1],this._scratchCartesian1),this._scratchCartesian2=Cesium.Matrix2.multiplyByVector(a,this._scratchCartesian1,this._scratchCartesian2),this._scratchCartesian2=Cesium.Cartesian2.normalize(this._scratchCartesian2,this._scratchCartesian2),this._scratchCartesian2=Cesium.Cartesian2.multiplyByScalar(this._scratchCartesian2,1e-4,this._scratchCartesian2);var l=[this._scratchCartesian2.x+s[0],this._scratchCartesian2.y+s[1],s[2]],c=this._createVertex([l[0]-this._scratchCartesian1.x,l[1]-this._scratchCartesian1.y,s[2]]),u=this._createVertex(l);return this.vertices.push(c),this.vertices.push(u),this.scratchLayer.addFeatures([c,u]),this.updateGeometry(),c}},{key:"updateGeometry",value:function(){var e=this;this.isOblique&&(this.geometry[_n.imageGeometryChanged]=!0),this.geometry.setCoordinates(this.vertices.map(function(t){return e.isOblique?t[_n.obliqueGeometry].getCoordinates():t.getGeometry().getCoordinates()}),"XYZ")}},{key:"_setupGeometry",value:function(e){var t=this;this.polygon=e,this.geometry=e.getLinearRing(0),this.listener=this.geometry.on("change",function(){t.polygon.setCoordinates([t.geometry.getCoordinates()],"XYZ")})}},{key:"translateVertex",value:function(e,t,i,n,r){var a=this.isOblique?n[_n.obliqueGeometry]:n.getGeometry();this.isOblique&&(a[_n.alreadyTransformedToImage]=!0),a.translate(e,t);var s=a.getCoordinates(),o={0:[3,1,2],1:[2,0,3],2:[1,3,0],3:[0,2,1]},l=o[this.getVertexIndex(n)],c=this.isOblique?this.vertices[l[2]][_n.obliqueGeometry]:this.vertices[l[2]].getGeometry(),u=c.getCoordinates(),h=ai(u,s);if(h<1e-4)a.setCoordinates([u[0]+1e-4,u[1]+1e-4,i[2]]);else{var d=this.isOblique?this.vertices[l[0]][_n.obliqueGeometry]:this.vertices[l[0]].getGeometry(),m=this.isOblique?this.vertices[l[1]][_n.obliqueGeometry]:this.vertices[l[1]].getGeometry();this.isOblique&&(d[_n.alreadyTransformedToImage]=!0,m[_n.alreadyTransformedToImage]=!0),d.setCoordinates(ni(u,d.getCoordinates(),s)),m.setCoordinates(ni(u,m.getCoordinates(),s)),r||this.updateGeometry()}}},{key:"translateVertexHeight",value:function(e,i,n){var r=this.vertices.length;while(r--)Se(b(t.prototype),"translateVertexHeight",this).call(this,e,this.vertices[r],!0);n||this.updateGeometry()}},{key:"validate",value:function(){return!this.creationActive&&4===this.vertices.length}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),ol.Observable.unByKey(this.listener)}},{key:"setExtent",value:function(e,t){o(e,[Number]),o(e.length,4);var i=ol.geom.Polygon.fromExtent(e).getLinearRing(0).getCoordinates();sr(i);var n=t||(this.vertices.length?this.vertices[0].getGeometry().getCoordinates()[2]:0);this.geometry.setCoordinates(i.map(function(e){return e[2]=n,e})),this._clearVertices(),this._createVertices()}}]),t}(os),Mo=Lo,ko=new ol.style.Style({});function wo(){}var To=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.finished=!0,n.onFinish=i||wo,n._defaultActive=me.CLICKMOVE,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE&&this.editor.changeVertex(this._lastVertex,e.positionOrPixel,!this.editor.state.transformGeometryOnMove),e.type&me.CLICK&&(this.editor.changeVertex(this._lastVertex,e.positionOrPixel),this._lastVertex.setStyle(null),this.editor.feature.setStyle(this._featureStyle),this.onFinish(),this.setActive(!1)),Promise.resolve(e))}},{key:"setActive",value:function(e){e&&0===this.editor.vertices.length?(this.finished=!1,this._lastVertex=this.editor.pushVertex([0,0,0]),this._lastVertex.setStyle(ko),this._featureStyle=this.editor.feature.getStyle(),this.editor.feature.setStyle(ko)):this.finished=!0,Se(b(t.prototype),"setActive",this).call(this,!this.finished&&e)}}]),t}(pe),So=To,Oo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.editor=e,i._defaultActive=me.CLICK,i._defaultModificationKey=de.SHIFT,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return!this.editor.state.onlyAllowTranslation&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&this.editor.removeVertex(e.feature),Promise.resolve(e)}}]),t}(pe),Co=Oo,Eo=[/\+/,/-/,/\*/,new RegExp("\\/")],Io=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.balloonContent=e.balloonContent,i.template=e.template,i.attributes=e.attributes,i.layerName=e.layerName,i.longitude=e.longitude,i.latitude=e.latitude,i.height=e.height||0,i.relativeToGround=e.relativeToGround,i.minTop=e.minTop||"0",i.viewerTopOffset=0,i.minLeft=e.minLeft||"0",i.containerId=e.containerId||"balloonContainer",i.balloonWidget=e.balloonWidget,i.balloonId=Object(u["c"])(),i.initialized=!1,i.initializedFor=null,i.cartographic=new Cesium.Cartographic,i.cartesian3=null,i.mercatorCoordinates=null,i.obliqueCoordinates=null,i.obliqueImageChangedSubscriptionKey=i.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,i.obliqueChangedListener.bind(f(i))),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.Balloon"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.framework.getActiveMap();e instanceof Vt?this.initializeForCesium():e instanceof Hi?this.initializeForOpenlayers():e instanceof Pi&&this.initializeForOblique()}},{key:"setPosition",value:function(e){var t=this;if("cesium"===this.initializedFor)R.mercatorToWgs84(e,!0),this.relativeToGround?(this.cartographic.longitude=Cesium.Math.toRadians(e[0]),this.cartographic.latitude=Cesium.Math.toRadians(e[1])):this.cartesian3=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2],this.cesiumScene.globe.ellipsoid,this.cartesian3);else if("openlayers"===this.initializedFor)this.mercatorCoordinates.splice(0,3,e[0],e[1],e[2]);else if("oblique"===this.initializedFor){var i=this.framework.getActiveMap();if(i instanceof Pi)return Object(Bt["f"])(i.activeLayer.currentImage,[e[0],e[1],e[2]],{dataProjection:ol.proj.get("EPSG:3857")}).then(function(e){var i=e.coords;t.obliqueCoordinates.splice(0,2,i[0],i[1])})}return Promise.resolve()}},{key:"obliqueChangedListener",value:function(){this.close()}},{key:"getDomNodes",value:function(){var e;if(this.balloonContent)e=this.balloonContent;else try{e=Dr()(this.template)(this.attributes)}catch(a){return this.logger.warning("Could not render the template for layer: ".concat(this.layerName,". Please verify that the balloon template is correct")),null}var t=document.createElement("div");if(t.setAttribute("id",this.balloonId),e instanceof HTMLElement?t.appendChild(e):t.innerHTML=e,!t.children.length){var i=document.createElement("div");i.innerHTML=e,t.appendChild(i)}for(var n=0;n<t.children.length;n++){q.getInstance().translateAll(t.children[n]);var r=t.children[n];r.style.top="-1000px",r.style.left="-1000px"}return t}},{key:"initializeForCesium",value:function(){if(!this.initialized){var e=this.initializeBalloon();if(this.cesiumMap=this.framework.getActiveMap(),this.cesiumScene=this.cesiumMap.getScene(),!this.cartesian3||this.relativeToGround&&Cesium.Cartographic.equals(this.cartographic,Cesium.Cartographic.ZERO)){if(null==this.longitude||null==this.latitude)return void this.logger.error("Cannot instatiate balloon without defined cartesian3 or longitude latitude");this.relativeToGround&&Cesium.Cartographic.equals(this.cartographic,Cesium.Cartographic.ZERO)?(this.cartographic=Cesium.Cartographic.fromDegrees(this.longitude,this.latitude,this.height,this.cartographic),this.cartographic.height=this.cesiumScene.globe.getHeight(this.cartographic)+this.height,this.cartesian3=Cesium.Cartographic.toCartesian(this.cartographic)):this.cartesian3=Cesium.Cartesian3.fromDegrees(this.longitude,this.latitude,this.height)}this.cesiumPostRenderBind=this.cesiumPostRenderHandler.bind(this,e.minTop,e.minLeft),this.cesiumScene.postRender.addEventListener(this.cesiumPostRenderBind),this.initialized=!0,this.initializedFor="cesium"}}},{key:"cesiumPostRenderHandler",value:function(e,t){this.relativeToGround&&(this.cartographic.height=this.cesiumScene.globe.getHeight(this.cartographic)+this.height,this.cartesian3=Cesium.Cartographic.toCartesian(this.cartographic,this.cesiumScene.globe.ellipsoid,this.cartesian3));var i=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.cesiumScene,this.cartesian3);i&&i.x&&i.y&&(this.poiLocationWindowCoordsx=i.x,this.poiLocationWindowCoordsy=i.y,this.setBalloonPosition(e,t))}},{key:"initializeForOpenlayers",value:function(){if(!this.initialized){var e=this.initializeBalloon();this.olMap=this.framework.getActiveMap().ol3map,this.mercatorCoordinates||(this.mercatorCoordinates=R.wgs84ToMercator([this.longitude,this.latitude,this.height])),this.openlayersUnsubscribeKey=this.olMap.on("postrender",this.olPostRenderHandler.bind(this,this.mercatorCoordinates,e.minTop,e.minLeft)),this.initialized=!0,this.initializedFor="openlayers",this.olMap.dispatchEvent("postrender")}}},{key:"setBalloonPosition",value:function(e,t){var i=document.getElementById(this.balloonId);if(i&&i.children[0]){var n=i.children[0];n.style.top="".concat(this.poiLocationWindowCoordsy-e,"px"),n.style.left="".concat(this.poiLocationWindowCoordsx-t,"px")}}},{key:"olPostRenderHandler",value:function(e,t,i){var n=this.olMap.getPixelFromCoordinate(e);if(n){var r=this.olMap.get("vcs_scale")||1;this.poiLocationWindowCoordsx=n[0]/r,this.poiLocationWindowCoordsy=n[1]/r,this.setBalloonPosition(t,i)}}},{key:"initializeBalloon",value:function(){var e=this.getDomNodes();if(!e)return null;var i=document.getElementById(this.containerId);i.appendChild(e);var n=t.computeOffset(e,this.minTop)-this.viewerTopOffset,r=t.computeOffset(e,this.minLeft),a=document.getElementById(this.balloonId).getElementsByClassName("close-balloon");if(a)for(var s=0;s<a.length;s++)a[s].addEventListener("click",this.closeBalloonClicked.bind(this));return{minTop:n,minLeft:r}}},{key:"initializeForOblique",value:function(){var e=this;if(!this.initialized){var t=this.initializeBalloon(),i=this.framework.getActiveMap();this.olMap=i.olMap;var n=Promise.resolve();this.obliqueCoordinates||(n=Object(Bt["f"])(i.activeLayer.currentImage,[this.longitude,this.latitude,this.relativeToGround?0:this.height],{dataProjection:ol.proj.get("EPSG:4326")}).then(function(t){var i=t.coords;e.obliqueCoordinates=i})),n.then(function(){e.obliqueUnsubscribeKey=e.olMap.on("postrender",e.olPostRenderHandler.bind(e,e.obliqueCoordinates,t.minTop,t.minLeft)),e.initializedFor="oblique",e.initialized=!0,e.olMap.dispatchEvent("postrender")})}}},{key:"close",value:function(){var e=document.getElementById(this.balloonId);e&&(e.parentNode.removeChild(e),"cesium"===this.initializedFor?this.cesiumScene.postRender.removeEventListener(this.cesiumPostRenderBind):"openlayers"===this.initializedFor?ol.Observable.unByKey(this.openlayersUnsubscribeKey):"oblique"===this.initializedFor&&ol.Observable.unByKey(this.obliqueUnsubscribeKey)),this.obliqueImageChangedSubscriptionKey&&this.framework.unsubscribeByKey(this.obliqueImageChangedSubscriptionKey),this.initialized=!1}},{key:"closeBalloonClicked",value:function(){var e=Q.getInstance();e&&this.balloonWidget?e.clearCurrentItem():this.close()}},{key:"show",value:function(e){document.getElementById(this.balloonId).style.display=e?"block":"none"}},{key:"getLink",value:function(e){var t="".concat(this.longitude.toFixed(8),",").concat(this.latitude.toFixed(8),",").concat(this.height.toFixed(2)),i={slLayer:this.layerName,slPos:t,slR2G:this.relativeToGround,slAt:JSON.stringify(this.attributes)};e.addQueryParams(i)}}],[{key:"computeOffset",value:function(e,t){if("number"===typeof t)return t;var i=e.children[0],n=i.offsetHeight,r=i.offsetWidth;function a(e){return/\d+/.test(e)?Number(e.match(/\d+/)[0]):/balloonHeight/.test(e)?n:/balloonWidth/.test(e)?r:0}function s(e,t){return e.reduce(function(e,i){switch(!0){case t.test("+"):return e+i;case t.test("-"):return e-i;case t.test("*"):return e*i;case t.test("/"):return e/i;default:return e+i}})}var o,l=Eo.find(function(e){return e.test(t)});if(l){var c=t.split(l),u=c.map(a);o=s(u,l)}else o=a(t);return Number(o)}}]),t}(A),Do=Io,jo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i._defaultActive=me.CLICK,i.editor=e,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.editor.state.featureTypeSymbol]&(nn.EDITING|nn.VERTEX)&&this.editor.editLabel(),Promise.resolve(e)}}]),t}(pe),Po=jo,Yo=Y.getLogger("vcs.vcm.util.editor.PointGeometryEditor"),xo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new So(f(i),i._checkLabel.bind(f(i))),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.feature[i.state.featureTypeSymbol]|=nn.VERTEX,i._removeVertex=new Co(f(i)),i.interactionChain.addInteraction(i._removeVertex),i.isLabel="Label"===i.geometry.get("_vcsGeomType"),i._selectLabel=null,i.isLabel&&(i._selectLabel=new Po(f(i)),i.interactionChain.addInteraction(i._selectLabel)),i._balloon=null,i._textArea=null,i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){var e=this.geometry.getCoordinates();if(!e.every(function(e){return 0===e})){var t=this._createVertex(e);this.vertices.push(t),this.scratchLayer.addFeatures([t])}}},{key:"pushVertex",value:function(e){if(this.vertices.length)return this.state.mode&tn.CREATE&&this.onFinish(),this.vertices[0];var t=this._createVertex(e);return this.vertices.push(t),this.geometry.setCoordinates(e),this.scratchLayer.addFeatures([t]),t}},{key:"_checkLabel",value:function(){!this._balloon&&this.isLabel&&1===this.vertices.length?this.editLabel():Se(b(t.prototype),"_validateOnFinish",this).call(this)}},{key:"_validateOnFinish",value:function(){this.creationActive=!!this.isLabel&&!this._hasLabel(),this.validate()?this.onFinish():this._removeFeature()}},{key:"addLabel",value:function(){this._selectLabel||(this._selectLabel=new Po(this),this.interactionChain.addInteraction(this._selectLabel)),this.isLabel=!0,this.geometry.set("_vcsGeomType","Label",!0),this.feature[ft]||(this.feature[ft]=this.parent.activeLayer.style.clone(),this.feature.setStyle(this.feature[ft].style),this.feature.changed()),this.editLabel()}},{key:"editLabel",value:function(){this._setBalloon(this.feature[ft].label)}},{key:"_setBalloon",value:function(e){this._textArea||(this._textArea=document.createElement("textarea"),this._textArea.rows=1,this._textArea.cols=100,this._textArea.classList.add("balloon"),this._textArea.addEventListener("keydown",this._labelKeyDown.bind(this))),e&&(this._textArea.value=e);var t={balloonContent:this._textArea};if(!this.isOblique){var i=R.mercatorToWgs84(this.geometry.getCoordinates()),n=Object(Ie["a"])(i,3);t.longitude=n[0],t.latitude=n[1],t.height=n[2]}this._balloon=new Do(t),this.isOblique&&(this._balloon.obliqueCoordinates=this.geometry.getCoordinates()),this._balloon.initialize(),this._textArea.focus()}},{key:"stopEditingLabel",value:function(e){this._balloon&&(e&&this._textArea&&(this.feature[ft].label=this._textArea.value,this.feature.changed()),this._balloon.close(),this._balloon=null,this._textArea=null,this.state.mode&tn.CREATE?this._validateOnFinish():this.validate()||this.stopCreation())}},{key:"translateVertex",value:function(e,i,n,r,a){Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,this.vertices[0],a)}},{key:"translateVertexHeight",value:function(e,i,n){Se(b(t.prototype),"translateVertexHeight",this).call(this,e,this.vertices[0],n)}},{key:"_labelKeyDown",value:function(e){e.stopPropagation(),"Escape"===e.key?this.stopEditingLabel():"Enter"===e.key&&this.stopEditingLabel(!0)}},{key:"removeVertex",value:function(e){this.scratchLayer.removeFeaturesById([e.getId()]),this._removeFeature()}},{key:"_hasLabel",value:function(){var e=this.feature[ft]?this.feature[ft].label:null;return e&&e.length}},{key:"stopCreation",value:function(){Se(b(t.prototype),"stopCreation",this).call(this),this.validate()&&this.isLabel&&(this._hasLabel()||this.geometry.unset("_vcsGeomType",!0))}},{key:"validate",value:function(){return!this.creationActive&&!this.geometry.getCoordinates().every(function(e){return 0===e})}},{key:"updateGeometry",value:function(){var e=this.vertices[0].getGeometry().getCoordinates();this.geometry.setCoordinates(e,"XYZ"),this._balloon&&(this.isOblique?this._balloon.obliqueCoordinates.splice(0,2,e[0],e[1]):this._balloon.setPosition(e))}},{key:"setPosition",value:function(e){o(e,[Number]),o(e.length,3),this.vertices.length?(this.vertices[0].getGeometry().setCoordinates(e),this.updateGeometry()):this.pushVertex(e),this.creationActive&&this._validateOnFinish()}},{key:"setMode",value:function(e){Yo.debug("PointGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.state.mode&tn.EDIT?(this._selectLabel&&this._selectLabel.setActive(),this._removeVertex.setActive()):this.state.mode&tn.REMOVEVERTEX&&(this._removeVertex.setActive(!0),this._removeVertex.setModification(de.NONE))}},{key:"handleMapChange",value:function(e){this._balloon&&(this._balloon.close(),this._setBalloon())}},{key:"destroy",value:function(){this._balloon&&(this._balloon.close(),this._balloon=null,this._textArea=null),this.feature[this.state.featureTypeSymbol]^=nn.VERTEX,Se(b(t.prototype),"destroy",this).call(this)}}]),t}(os),Ao=xo;function Fo(){}var No=new ol.style.Style({}),Ho=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.finished=!0,n._lastVertex=null,n.onFinish=i||Fo,n._defaultActive=me.CLICK|me.DBLCLICK|me.MOVE,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE&&this.editor.changeVertex(this._lastVertex,e.positionOrPixel,!this.editor.state.transformGeometryOnMove),e.type&me.CLICK&&(this.editor.changeVertex(this._lastVertex,e.positionOrPixel),this._lastVertex.setStyle(null),this._lastVertex=this.editor.reverse?this.editor.unshiftVertex(e.positionOrPixel):this.editor.pushVertex(e.positionOrPixel),this._lastVertex.setStyle(No)),e.type&me.DBLCLICK&&(this.editor.removeVertex(this._lastVertex),this.editor.reverse=!1,this.onFinish(),this.setActive(!1)),Promise.resolve(e))}},{key:"setActive",value:function(e){var i;e?(this.finished=!1,this.editor.vertices.length>0?(i=this.editor.reverse?this.editor.vertices[0]:this.editor.vertices.slice(-1)[0],i=i.getGeometry().getCoordinates()):i=[0,0,0],this._lastVertex=this.editor.reverse?this.editor.unshiftVertex(i):this.editor.pushVertex(i),this._lastVertex.setStyle(No)):this.finished=!0;Se(b(t.prototype),"setActive",this).call(this,e)}}]),t}(pe),Ro=Ho,zo=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.callback=i,n.timeOut=null,n.clickDuration=xn().clickDuration,n._defaultActive=me.CLICK|me.DBLCLICK,n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!this.editor.state.onlyAllowTranslation){if(e.type&me.DBLCLICK)return this.editor.reverse=!1,clearTimeout(this.timeOut),Promise.resolve(e);if(e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var t=this.editor.getVertexIndex(e.feature);0===t?(this.editor.reverse=!0,this.doCallback()):t===this.editor.vertices.length-1&&this.doCallback()}}return Promise.resolve(e)}},{key:"doCallback",value:function(){this.timeOut=setTimeout(this.callback,this.clickDuration)}}]),t}(pe),Go=zo,Vo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.editor=e,i._defaultActive=me.CLICK,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return!this.editor.state.onlyAllowTranslation&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.EDITING&&this.editor.insertVertex(e.positionOrPixel),Promise.resolve(e)}}]),t}(pe),Bo=Vo,Uo=Y.getLogger("vcs.vcm.util.editor.LineGeometryEditor"),Wo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new Ro(f(i),i._validateOnFinish.bind(f(i))),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.reverse=!1,i._lastVertex=new Go(f(i),function(){i.getRootEditor().setMode(tn.CREATE)}),i.interactionChain.addInteraction(i._lastVertex),i._insertVertex=new Bo(f(i)),i.interactionChain.addInteraction(i._insertVertex),i._removeVertex=new Co(f(i)),i.interactionChain.addInteraction(i._removeVertex),i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){for(var e=this.geometry.getCoordinates(),t=0;t<e.length;t++)this.vertices.push(this._createVertex(e[t]));this.scratchLayer.addFeatures(this.vertices)}},{key:"updateGeometry",value:function(){var e=this;this.isOblique&&(this.geometry[_n.imageGeometryChanged]=!0),this.geometry.setCoordinates(this.vertices.map(function(t){return e.isOblique?t[_n.obliqueGeometry].getCoordinates():t.getGeometry().getCoordinates()}),"XYZ")}},{key:"pushVertex",value:function(e){var t=this._createVertex(e);this.vertices.push(t),this.scratchLayer.addFeatures([t]);var i=this.geometry.getCoordinates();return i.push(e),this.geometry.setCoordinates(i),t}},{key:"insertVertex",value:function(e){var t=this.geometry.getCoordinates(),i=this.geometry.getClosestPoint(e);this.geometry instanceof ol.geom.LinearRing&&t.push(t[0]);var n="clampToGround"===this.feature.get("olcs_altitudeMode")?ri(i,e):ai(i,e);if(n<5){var r=t.length-1,a=0;for(a;a<r;a++){var s="clampToGround"===this.feature.get("olcs_altitudeMode")?oi(t[a],t[a+1],i):si(t[a],t[a+1],i);if(s)break}var o=this._createVertex(e);return this.vertices.splice(a+1,0,o),this.scratchLayer.addFeatures([o]),this.updateGeometry(),o}return null}},{key:"unshiftVertex",value:function(e){var t=this._createVertex(e);this.vertices.unshift(t),this.scratchLayer.addFeatures([t]);var i=this.geometry.getCoordinates();return i.unshift(e),this.geometry.setCoordinates(i),t}},{key:"removeVertex",value:function(e){var t=this.getVertexIndex(e);if(t>-1){var i=this.geometry.getCoordinates();i.splice(t,1),this.geometry.setCoordinates(i),this.vertices.splice(t,1),this.scratchLayer.removeFeaturesById([e.getId()])}}},{key:"stopCreation",value:function(){if(Se(b(t.prototype),"stopCreation",this).call(this),this.creationActive&&this.validate()){var e=this.reverse?this.vertices[0]:this.vertices[this.vertices.length-1];this.removeVertex(e)}}},{key:"setMode",value:function(e){Uo.debug("LineGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.feature.set("olcs_allowPicking",!!(e&tn.EDIT)),this.state.mode&tn.EDIT?(this._lastVertex.setActive(),this._insertVertex.setActive(),this._removeVertex.setActive()):this.state.mode&tn.REMOVEVERTEX&&(this._removeVertex.setActive(!0),this._removeVertex.setModification(de.NONE))}},{key:"validate",value:function(){var e=1;return this.creationActive&&(e+=1),"LinearRing"===this.geometry.getType()&&(e+=1),this.geometry.getCoordinates().length>e}}]),t}(os),qo=Wo,Jo=new ol.Sphere(6378137),Ko=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new bo(f(i),i._validateOnFinish.bind(f(i)),2),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.radius=null;var n=i.feature.get("olcs.circle_type");return n&&"sphere"===n||(i._translateVertex.forceZPlane=!0),i.setAltitudeModeToAbsoluteOnClassification=!1,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.geometry.getCenter();e[2]=e[2]||0;var i=this.geometry.getRadius();this.geometry.setCenterAndRadius(e,i,"XYZ"),Se(b(t.prototype),"initialize",this).call(this)}},{key:"_createVertices",value:function(){var e=this.geometry.getFirstCoordinate();if(!e.every(function(e){return 0===e})){this.vertices.push(this._createVertex(e,0));var t=this.geometry.getLastCoordinate();t.length&&this.vertices.push(this._createVertex(t,1)),this.scratchLayer.addFeatures(this.vertices)}}},{key:"updateGeometry",value:function(){2===this.vertices.length&&this.geometry.setCoordinates([this.vertices[0].getGeometry().getCoordinates(),this.vertices[1].getGeometry().getCoordinates()])}},{key:"pushVertex",value:function(e){if(this.vertices.length<2){var t=!1,i=this.vertices.length;1===i&&(this.geometry.setCenter(this.vertices[0].getGeometry().getCoordinates()),this.radius&&(this.geometry.setRadius(this.radius),e[0]+=this.radius,this.radius=null,t=!0));var n=this._createVertex(e,i);return this.vertices.push(n),this.scratchLayer.addFeatures([n]),t&&this.stopCreation(),n}return this.vertices[1]}},{key:"validate",value:function(){return!this.creationActive}},{key:"translateVertex",value:function(e,i,n,r,a){if(0===r[rs])Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,r,!0),a||(this.geometry.setCenter(r.getGeometry().getCoordinates()),this.vertices[1].getGeometry().setCoordinates(this.geometry.getLastCoordinate()));else{var s,o=this.feature.get("olcs.circle_type");if(o&&"sphere"===o?(s=ai,Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,r,!0)):(s=ri,r.getGeometry().translate(e,i)),!a){var l=this.vertices[0].getGeometry().getCoordinates(),c=r.getGeometry().getCoordinates(),u=s(l,c);this.geometry.setRadius(u)}}}},{key:"translateVertexHeight",value:function(e,t,i){var n=2;while(n--){var r=this.vertices[n].getGeometry(),a=r.getCoordinates();a[2]+=e,r.setCoordinates(a)}i||this.geometry.setCenter(this.vertices[0].getGeometry().getCoordinates())}},{key:"setPosition",value:function(e){o(e,[Number]),o(e.length,3),this.geometry.setCenter(e),this._clearVertices(),this._createVertices()}},{key:"setRadius",value:function(e){o(e,Number);var t=this.geometry.getCenter(),i=Jo.offset(R.mercatorToWgs84(t),e,Math.PI/2);i[2]=t[2],this.geometry.setCoordinates([t,R.wgs84ToMercator(i,!0)]),this.vertices.length>1?(this.vertices[1].getGeometry().setCoordinates(this.geometry.getLastCoordinate()),this.creationActive&&this._validateOnFinish()):this.radius=Math.abs(i[0]-t[0])}}]),t}(os),Zo=Ko,Qo=function(e){function t(e,i,n,r){var a;return Object(d["a"])(this,t),a=y(this,b(t).call(this)),a.geometry=e,a.cb=i,a.isEditingGeometry=n,a.featureTypeSymbol=r,a._defaultActive=me.CLICK,a.setActive(),a}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(e.feature&&e.feature[this.featureTypeSymbol]&nn.EDITING&&this.geometry[this.isEditingGeometry]){var t=Kt(this.geometry);if(0===t.length)return this.cb(0),Promise.resolve(e);for(var i=1/0,n=0,r=0;r<t.length;r++){var a=t[r].getClosestPoint(e.positionOrPixel),s=ai(a,e.positionOrPixel);s<i&&(n=r,i=s)}this.cb(n)}return Promise.resolve(e)}}]),t}(pe),Xo=Qo,$o={MultiPolygon:"Polygon",MultiPoint:"Point",MultiLineString:"LineString",Polygon:"LinearRing"},el=Y.getLogger("vcs.vcm.util.editor.MultiGeometryEditor"),tl=Symbol("isEditingGeometry"),il=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.geometry=e.geometry,i.feature=e.feature,i.layer=e.layer,i.editors=[],i.listeners=[],i.isEditingGeometry=Symbol("isEditingGeometry"),i._selectGeometryInteraction=new Xo(i.geometry,i.activateEditor.bind(f(i)),tl,i.state.featureTypeSymbol),i.interactionChain.addInteraction(i._selectGeometryInteraction),i._finishAction=e.onFinish||i.setMode.bind(f(i),tn.EDIT),i.onRemoved=e.onRemoved||function(){},i.activateEditorIndex=null,i._setupGeometries(),i.geometry[tl]=!0,i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.MultiGeometryEditor"}}]),Object(m["a"])(t,[{key:"_setupGeometries",value:function(){var e=Kt(this.geometry);e.forEach(this.addGeometry,this)}},{key:"addGeometry",value:function(e){var t=this,i=e||rl[$o[this.geometry.getType()]](),n=al({parent:this,geometry:i,layer:this.layer,feature:this.feature,onFinish:this._finishAction,onRemoved:this._geometryRemoved.bind(this,this.editors.length)}),r=this.editors.push(n)-1;this.listeners.push(i.on("change",function(){var e=t.geometry.getCoordinates();e[r]=i.getCoordinates(),t.geometry.setCoordinates(e,"XYZ")})),e||(Zt(this.geometry,i),this.state.mode=tn.CREATE,this.activateEditor(r))}},{key:"_geometryRemoved",value:function(e,t){if(e||"Polygon"!==this.geometry.getType()){var i=this.geometry.getCoordinates();if(i.splice(e,1),!i.length)return void this._removeFeature(t);this.geometry.setCoordinates(i,"XYZ"),this.destroy(),this.editors=[],this.listeners=[],this._setupGeometries()}else this._removeFeature(t)}},{key:"_removeFeature",value:function(e){var t=this.parent&&this.parent.className===this.className;if(!t){var i=ne.getInstance().getLayerByName(this.state.layerName);i.removeFeaturesById([this.feature.getId()])}e&&!t||this.onRemoved()}},{key:"setAltitudeMode",value:function(e){null!=this.activateEditorIndex&&this.editors[this.activateEditorIndex].setAltitudeMode(e)}},{key:"activateEditor",value:function(e){if(this.activateEditorIndex!==e){if(null!==this.activateEditorIndex){var t=this.editors[this.activateEditorIndex];t.destroy(),t.geometry[tl]=!1,this.interactionChain.removeInteraction(t.interactionChain)}this.activateEditorIndex=e,this._selectGeometryInteraction.setActive(!1);var i=this.editors[e];i.initialize(),i.geometry[tl]=!0,this.interactionChain.addInteraction(i.interactionChain),this.setMode(this.state.mode)}}},{key:"setMode",value:function(e){el.debug("MultiGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e})));var i=Kt(this.geometry,null===this.activateEditorIndex?0:this.activateEditorIndex);if(i){var n=e,r=i.getExtent();if((ol.extent.isEmpty(r)||r.every(function(e){return 0===e}))&&(n=tn.CREATE),Se(b(t.prototype),"setMode",this).call(this,n),n^tn.CREATE&&this._selectGeometryInteraction.setActive(),null===this.activateEditorIndex)this.activateEditor(0);else{var a=this.editors[this.activateEditorIndex];a.interactionChain.setActive(!0),a.setMode(n)}}else this.addGeometry()}},{key:"stopCreation",value:function(){null!==this.activateEditorIndex&&(this.editors[this.activateEditorIndex].validate()?this.editors[this.activateEditorIndex].stopCreation():this._geometryRemoved(this.activateEditorIndex,!0))}},{key:"validate",value:function(){return this.editors.some(function(e){return e.validate()})}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),ol.Observable.unByKey(this.listeners);for(var e=0;e<this.editors.length;e++)this.editors[e].destroy();this.activateEditorIndex=null}}]),t}(Za),nl=il,rl={Point:function(){var e=new ol.geom.Point([0,0,0],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e},Label:function(){var e=new ol.geom.Point([0,0,0],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e.set("_vcsGeomType","Label"),e},Circle:function(){var e=new ol.geom.Circle([0,0,0],20,"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e},LineString:function(){return new ol.geom.LineString([],"XYZ")},LinearRing:function(){return new ol.geom.LinearRing([],"XYZ")},Polygon:function(){return new ol.geom.Polygon([[]],"XYZ")},BBox:function(){var e=new ol.geom.Polygon([[]],"XYZ");return e.set("_vcsGeomType","bbox"),e},Rectangle:function(){var e=new ol.geom.Polygon([[]],"XYZ");return e.set("_vcsGeomType","rectangle"),e},MultiLineString:function(){return new ol.geom.MultiLineString([[]],"XYZ")},MultiPolygon:function(){return new ol.geom.MultiPolygon([[[]]],"XYZ")},MultiPoint:function(){var e=new ol.geom.MultiPoint([[0,0,0]],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e}};function al(e){var t=e.geometry;if(t instanceof ol.geom.Polygon){var i=t.get("_vcsGeomType");return i&&"rectangle"===i?new Mo(e):i&&"bbox"===i?new Mo(Object.assign(e,{isBBox:!0})):new nl(Object.assign(e,{geomType:"LinearRing"}))}if(t instanceof ol.geom.Circle)return new Zo(e);if(t instanceof ol.geom.Point)return new Ao(e);var n=["LineString","Polygon","Point"],r=n.find(function(e){return t instanceof ol.geom["Multi".concat(e)]});return r?new nl(Object.assign(e,{geomType:r})):new qo(e)}var sl=i(668),ll=i.n(sl),cl=Y.getLogger("vcs.vcm.util.editor.GeometryLayerEditor"),ul=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.state.allowedGeometries=i.allowedGeometries||["Point","LineString","Polygon","BBox","Circle","Rectangle","Label"],e.lastFeatureType=null,(null==i.allowEditMode||i.allowEditMode)&&e.state.allowedModes.push(Object.keys(rn).find(function(e){return rn[e]===tn.EDIT})),e.geometryEditor=null,e.defaultMode=rn[i.defaultMode]||tn.CREATE,e.scratchLayer.setStyle(new ol.style.Style({image:new ol.style.Icon({src:ll.a,scale:.45})})),e.state.dedicatedFeatureStyle=i.dedicatedFeatureStyle,e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.GeometryLayerEditor"}}]),Object(m["a"])(t,[{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.isOblique&&(ne.getInstance().getActiveMap().switchEnabled=!0)}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this,e),e&tn.GEOMETRYMODES||this.clearGeometryEditor()}},{key:"setMode",value:function(e){if(cl.debug("GeometryLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.isOblique&&(ne.getInstance().getActiveMap().switchEnabled=!(e&tn.GEOMETRYMODES)||0===this.features.size),e&tn.GEOMETRYMODES)if(this.geometryEditor)this.geometryEditor.validate()?(this.geometryEditor.setMode(e),this.geometryEditor.interactionChain.setActive(!0)):this.clearGeometryEditor();else if(this.features.size){var i=this.features.values().next().value;if(this.features.size>1)return void this.selectFeatureInteraction.selectFeature(i);this.editingFeature=i,this.editingFeature[this.state.featureTypeSymbol]|=nn.EDITING,this.geometryEditor=al({parent:this,layer:this.activeLayer,geometry:this.isOblique?this.editingFeature[_n.obliqueGeometry]:this.editingFeature.getGeometry(),feature:this.editingFeature,onFinish:this._onCreationFinish.bind(this),onRemoved:this._onCreationFinish.bind(this)}),this.geometryEditor.initialize(),this.geometryEditor.setMode(e),this.interactionChain.addInteraction(this.geometryEditor.interactionChain)}}},{key:"setAltitudeMode",value:function(e){var i=this;return e&this.state.altitudeMode?Promise.resolve():Se(b(t.prototype),"setAltitudeMode",this).call(this,e).then(function(){i.geometryEditor&&i.geometryEditor.setAltitudeMode(e)})}},{key:"createFeature",value:function(e,t,i){o(e,Object.keys(rl)),l(t,[String,Number]);var n=i||rl[e](),r=new ol.Feature({geometry:n});if(r[this.state.featureTypeSymbol]=nn.EDITABLE,this.state.altitudeMode!==this.state.defaultAltitudeMode){var a=this.state.altitudeMode!==an.CLAMP&&ne.getInstance().getActiveMap()instanceof Vt?"absolute":"clampToGround";r.set("olcs_altitudeMode",a)}else this.state.defaultAltitudeMode!==an.ABSOLUTE||ne.getInstance().getActiveMap()instanceof Vt||r.set("olcs_altitudeMode","clampToGround");if(this.state.classificationType!==this.state.defaultClassificationType&&r.set("olcs_classificationType",ln[this.state.classificationType]),t&&r.setId(t),this.lastFeatureType=e,this.state.layerName){var s=ne.getInstance().getLayerByName(this.state.layerName);if(s&&s instanceof _n&&(t&&s.removeFeaturesById([t]),this.isOblique&&(n[_n.alreadyTransformedToImage]=!0),s.addFeatures([r]),this.state.dedicatedFeatureStyle||"Label"===e)){var c=s.defaultStyle instanceof gt?s.defaultStyle:vt;r[ft]=c.clone(new gt({name:r.getId().toString()})),r.setStyle(r[ft].style)}}return r}},{key:"setModeAndSelectFeature",value:function(e,t){this.getRootEditor().beforeSetMode(e),this.state.mode=e,this.selectFeatureInteraction.selectFeature(t)}},{key:"clearGeometryEditor",value:function(){if(this.editingFeature&&(this.editingFeature[this.state.featureTypeSymbol]^=nn.EDITING,this.editingFeature=null),this.geometryEditor){var e=this.geometryEditor.feature.getId();this.features.has(e)&&!this.geometryEditor.validate()&&this.selectFeatureInteraction.clearSelectionSet(!0),this.geometryEditor.stopCreation(),this.interactionChain.removeInteraction(this.geometryEditor.interactionChain),this.geometryEditor.destroy(),this.geometryEditor=null}}},{key:"onSelect",value:function(){if(this.clearGeometryEditor(),this.state.active){var e=this.state.mode;this.state.mode&tn.GEOMETRYMODES&&this.features.size>1&&this.parent?(e=tn.SELECT,this.getRootEditor().setMode(e)):e&tn.CREATE&&0===this.features.size?this._onCreationFinish():e&tn.GEOMETRYMODES&&this.getRootEditor().setMode(e)}}},{key:"_onCreationFinish",value:function(){if(this.state.mode===tn.CREATE&&this.defaultMode===tn.CREATE){var e=this.createFeature(this.lastFeatureType);this.setModeAndSelectFeature(this.state.mode,e)}else this.getRootEditor().setMode(this.defaultMode)}},{key:"convertEditingFeatureToPolygon",value:function(){if(this.editingFeature&&1===this.features.size){var e=this.isOblique?this.editingFeature[_n.obliqueGeometry]:this.editingFeature.getGeometry(),t=yi(e);this.isOblique&&(t[_n.alreadyTransformedToImage]=!0),this.editingFeature.setGeometry(t);var i=this.editingFeature;this.selectFeatureInteraction.clearSelectionSet(!0),this.selectFeatureInteraction.selectFeature(i)}}},{key:"setEditingFeatureTypeProperty",value:function(e,t){this.editingFeature&&1===this.features.size&&(this.editingFeature.set(e,t),this.selectFeatureInteraction.clearSelectionSet(!0),this.selectFeatureInteraction.selectFeature(this.editingFeature))}},{key:"handleMapChange",value:function(e){Se(b(t.prototype),"handleMapChange",this).call(this,e)}}]),t}(vs),hl=ul,dl=window.localStorage,ml=Y.getLogger("vcs.vcm.util.storage");function fl(){if(!dl)return!1;try{var e="__storage_test__";return dl.setItem(e,e),dl.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==dl.length}}var yl=function(){function e(t){Object(d["a"])(this,e),this.namespace=t}return Object(m["a"])(e,[{key:"setItem",value:function(e,t){fl()?dl.setItem("".concat(this.namespace,".").concat(e),t):ml.warning("storage unavailable or full")}},{key:"getItem",value:function(e){return dl?dl.getItem("".concat(this.namespace,".").concat(e)):null}},{key:"removeItem",value:function(e){dl&&dl.removeItem("".concat(this.namespace,".").concat(e))}}]),e}(),gl=yl,vl=Y.getLogger("vcs.vcm.util.editor.StyleLayerEditor"),pl=new gl("StyleLayerEditor"),_l=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.icons=i.icons||[],e.customIcons=[],e.allowCustomIcons=i.allowCustomIcons||!1,e.storeCustomIcons=i.storeCustomIcons||!1,e.currentStyleOptions={text:null,fill:null,stroke:null,image:null},e.currentStyleItem=vt.clone(),!i.noDefaultIcons){var n=ne.getInstance().libraryBasePath;e._fetchIcons("".concat(n,"images/editor/defaultIconsCategory.json"))}return i.iconLibraries&&i.iconLibraries.forEach(e._fetchIcons.bind(f(e))),e.allowCustomIcons&&e.storeCustomIcons&&fl()&&e._fetchCustomIcons(),e._syncOptions(vt.getOptions()),e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.StyleLayerEditor"}}]),Object(m["a"])(t,[{key:"_fetchIcons",value:function(e){var t=this;return ce.a.get(e).then(function(i){var n=i.data,r=e.replace(/\/?[^\/]+$/,"");Array.isArray(n)?n.forEach(function(e){if("string"===typeof e){var i=/^data/.test(e)?e:"".concat(r,"/").concat(e);t.icons.push({src:i})}else e.src="".concat(r,"/").concat(e.src),t.icons.push(e)}):vl.error("could not load icon library, content of ".concat(e," is not a JSONArray"))})}},{key:"_fetchCustomIcons",value:function(){var e=this,t=pl.getItem("customIconIndex");t&&JSON.parse(t).forEach(function(t){var i=pl.getItem("".concat(t));i&&e.customIcons.push({src:i})})}},{key:"readIconFromFile",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.allowCustomIcons?new Promise(function(n,r){var a=new FileReader;a.onloadend=function(){var e=a.result;if(t.customIcons.push(Object.assign(i,{src:e})),t.storeCustomIcons&&fl()){var r=JSON.parse(pl.getItem("customIconIndex")||"[]"),s=Object(u["c"])();r.push(s),pl.setItem("customIconIndex",JSON.stringify(r)),pl.setItem("".concat(s),e)}n()},a.onerror=r,a.readAsDataURL(e)}):(vl.warning("custom icons are not supported at this time"),Promise.resolve())}},{key:"deleteCustomIcon",value:function(e){if(this.storeCustomIcons){var t=JSON.parse(pl.getItem("customIconIndex")||"[]"),i=t.filter(function(t){var i=pl.getItem(t);return i!==e||(pl.removeItem(t),!1)});pl.setItem("customIconIndex",JSON.stringify(i))}var n=this.customIcons.findIndex(function(t){return t.src===e});n>-1&&this.customIcons.splice(n,1)}},{key:"addEditingLayer",value:function(e){Se(b(t.prototype),"addEditingLayer",this).call(this,e),this.onSelect()}},{key:"setMode",value:function(){this.onSelect()}},{key:"onSelect",value:function(){if(this.activeLayer){this.state.isDeclarativeStyle=!1;var e=this.activeLayer.style;if(e instanceof Tt&&(this.state.isDeclarativeStyle=!0,e=null),!this.state.isDeclarativeStyle&&this.features.size){var t=this.features.get(this.state.selectedFeatureId);e=t[ft]||e}this.state.isLayerStyle=this.activeLayer.style===e,e?this.currentStyleItem&&this.currentStyleItem===e||(this.currentStyleItem=e,this._syncOptions(e.getOptions())):(this.currentStyleOptions.text=null,this.currentStyleOptions.fill=null,this.currentStyleOptions.stroke=null,this.currentStyleOptions.image=null,this.currentStyleItem=null)}}},{key:"setLayerStyle",value:function(e){this.activeLayer.setStyle(e||this.activeLayer.defaultStyle),this.onSelect()}},{key:"_syncOptions",value:function(e){e.fill?(this.currentStyleOptions.fill?this.currentStyleOptions.fill.color=e.fill.color:(e.fill.pattern||(e.fill.pattern=null),this.currentStyleOptions.fill=e.fill),e.fill.pattern&&this.currentStyleOptions.fill.pattern?Object.assign(this.currentStyleOptions.fill.pattern,e.fill.pattern):this.currentStyleOptions.fill.pattern={type:0,color:[0,0,0,1],width:1,size:10}):this.currentStyleOptions.fill=null,this.currentStyleOptions.stroke=e.stroke||null,e.text?(this.currentStyleOptions.text=e.text,this.currentStyleOptions.text.font=Ke(e.text.font||"18px sans-serif")):this.currentStyleOptions.text=null,e.image?(this.currentStyleOptions.image=e.image,this.currentStyleOptions.image.currentImage=e.image.radius?this.currentStyleItem.image.getImage(1).toDataURL():e.image.src):this.currentStyleOptions.image=null}},{key:"addDedicatedStyleFromCurrentStyle",value:function(){var e,t=this;!this.state.isDeclarativeStyle&&this.features.size&&(this.features.forEach(function(i){var n=t.currentStyleItem.clone(new gt({id:i.getId()}));e||(e=n),i[ft]=n,i.setStyle(i[ft].style),i.changed()}),this.currentStyleItem=e,this.state.isLayerStyle=!1)}},{key:"cloneCurrentStyleOntoLayer",value:function(){var e=this.currentStyleItem.clone();this.activeLayer.setStyle(e),this.currentStyleItem=e}},{key:"updateFont",value:function(e){this.currentStyleItem.text||(this.currentStyleItem.text=new ol.style.Text);var t=Ze(e);this.currentStyleItem.text.setFont(t),this.currentStyleOptions.text||(this.currentStyleOptions.text={}),this.currentStyleOptions.text.font?Object.assign(this.currentStyleOptions.text.font,e):this.currentStyleOptions.text.font=e}},{key:"setImage",value:function(e){var t,i=Object.assign({},e);t=i.radius?lt(i):new ol.style.Icon(i),this.currentStyleItem.image=t;var n=this.currentStyleItem.getOptions({image:!0});n.image?(this.currentStyleOptions.image=n.image,this.currentStyleOptions.image.currentImage=this.currentStyleOptions.image.src||this.currentStyleItem.image.getImage(1).toDataURL()):this.currentStyleOptions.image=null}},{key:"updateStyle",value:function(e){var t=this;this.features.size&&this.currentStyleItem&&this.features.forEach(function(e){if(!e[ft]||e[ft].name!==t.currentStyleItem.name){var i=e[ft];i?t.currentStyleItem.clone(i):e[ft]=t.currentStyleItem.clone(new gt({id:e.getId()})),e.setStyle(e[ft].style)}e.changed()}),e&&this._syncOptions(this.currentStyleItem.getOptions())}},{key:"updateStyleSection",value:function(e,t){var i=this;o(e,["fill","stroke","text","image"]),this.features.size&&this.currentStyleItem&&this.features.forEach(function(n){n[ft]||(n[ft]=i.activeLayer.style.clone(new gt({id:n.getId()})),n.setStyle(n[ft].style)),n[ft].name!==i.currentStyleItem.name&&("fill"===e?(n[ft].fillColor=i.currentStyleItem.fillColor.slice(),n[ft].pattern=i.currentStyleItem.pattern?Object.assign({},i.currentStyleItem.pattern):void 0):n[ft][e]=i.currentStyleItem[e].clone()),t||n.changed()})}}]),t}(vs),bl=_l,Ll=Y.getLogger("vcs.vcm.util.editor.CompositeLayerEditor"),Ml=function(e){function t(e){var i;if(Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.children=[],e.featureLayerEditor&&i.children.push(new vo(Object.assign(e.featureLayerEditor,{parent:f(i)}))),e.geometryLayerEditor){var n=Object.assign(e.geometryLayerEditor,{parent:f(i)});n.dedicatedFeatureStyle=!(null!=n.dedicatedFeatureStyle||!e.styleLayerEditor),i.children.push(new hl(n))}return e.styleLayerEditor&&i.children.push(new bl(Object.assign(e.styleLayerEditor,{parent:f(i)}))),i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.CompositeLayerEditor"}}]),Object(m["a"])(t,[{key:"getFeatureLayerEditor",value:function(){return this.children.find(function(e){return e instanceof vo})}},{key:"getGeometryLayerEditor",value:function(){return this.children.find(function(e){return e instanceof hl})}},{key:"getStyleLayerEditor",value:function(){return this.children.find(function(e){return e instanceof bl})}},{key:"initialize",value:function(){this.interactionChain.initialize(),this.children.forEach(function(e){e.initialize()}),this.selectFeatureInteraction.onCesiumSelect(this.onCesiumSelect.bind(this))}},{key:"activate",value:function(){this.children.forEach(function(e){e.activate()}),Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.children.forEach(function(e){e.deactivate()})}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this),this.children.forEach(function(t){t.beforeSetMode(e)})}},{key:"setMode",value:function(e){Ll.debug("CompositeLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.children.forEach(function(t){t.setMode(e)})}},{key:"setAltitudeMode",value:function(e){var i=this,n=Promise.resolve();return this.children.forEach(function(t){n=n.then(function(){return t.setAltitudeMode(e)})}),n.then(function(){return Se(b(t.prototype),"setAltitudeMode",i).call(i,e)})}},{key:"addEditingLayer",value:function(e){Se(b(t.prototype),"addEditingLayer",this).call(this,e),this.children.forEach(function(t){t.addEditingLayer(e)})}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),this.children.forEach(function(e){e.destroy()})}}]),t}(vs),kl=Ml,wl="<div class='balloon' id='myBalloon'>\n  <h1 class='balloon-title'><%= obj.planningName %></h1>\n  <div class='balloon-content'>\n    <%= obj.planningDescription %>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Tl="<div class='balloon' id='myBalloon'>\n  <div class='balloon-content'>\n    <h1 class='balloon-title'> Available Attributes </h1>\n    <% for (var key in obj) { %>\n    <% if (obj[key] instanceof Object){%>\n    <% for (var key2 in obj[key]) { %>\n    <p class='balloon-text'><span class='balloon-street'> <%=key%>.<%=key2%> : <%=obj[key][key2]%></span><br></p>\n    <% } %>\n    <% } else{ %>\n    <p class='balloon-text'><span class='balloon-street'> <strong> <%=key%> </strong> : <%=obj[key]%></span><br></p>\n    <% } %>\n    <% } %>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Sl=[{title:{de:"Leerer Balloon",en:"Empty Balloon"},template:""},{title:{de:"Ebenen Name & Beschreibung",en:"Layer Name & Description"},template:wl.trim()},{title:{de:"Alle Attribute",en:"All Properties"},template:Tl.trim()}],Ol=Sl;B.PLANNINGINSTANCES_CHANGED="PLANNINGINSTANCES_CHANGED";var Cl,El,Il,Dl,jl,Pl,Yl=function(e){function t(e){var i,n;(Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.serviceUrl=e.serviceUrl||"https://planning.virtualcityplanner.de",i.scenarioId=e.scenarioId,i.projectId=e.projectId,i.useLocalCRS=Object(u["e"])(e.useLocalCRS,!1),i.showInLegend=Object(u["e"])(e.showInLegend,!0),i.legendTitle=e.legendTitle||{en:"Plannings",de:"Planungen",pl:"Planowanie"},i.loginManager=Ps.getInstance(),i.url=a["a"].parse(i.serviceUrl),i.url.extendPath("planning"),i.loginManager.registerWidget({onLogin:[i.fetchUserPlannings.bind(f(i)),i.fetchUserCreate.bind(f(i))],onLogout:[i.fetchUserPlannings.bind(f(i))],beforeLogout:[i.clear.bind(f(i)),i.setUserMayCreate.bind(f(i),{data:!1})],serviceUrl:i.serviceUrl,projectId:i.projectId,scenarioId:i.scenarioId}).then(function(){i.url=i.loginManager.url.clone(),i.url.extendPath("planning"),i.url.queryParams=i.loginManager.url.queryParams}).catch(function(e){i.logger.warning(e.message),i.logger.warning("could not initialize planning, missing login url")}),i.planningInstances=[],i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i._linkedPlannings=[],i.activePlanningInstance=null,i.userMayCreate={permission:!1},i.fetching=null,i.legendCluster=new ha({title:i.legendTitle}),i.commentIcons=i._setupCommentStyle(e.commentIcons),i.terrainUrl=e.terrainUrl||null,i.useDefaultTerrain=Object(u["e"])(e.useDefaultTerrain,!0),i.allowBalloonEditor=Object(u["e"])(e.allowBalloonEditor,!1),i.predefinedBalloons=Ol,Array.isArray(e.predefinedBalloons))&&(n=i.predefinedBalloons).push.apply(n,Object(T["a"])(e.predefinedBalloons));return i.showStyleSelector=Object(u["e"])(e.showStyleSelector,!1),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Planning"}}]),Object(m["a"])(t,[{key:"_setupCommentStyle",value:function(e){var t;if(this.framework.getStyleByName("planningCommentStyle"))return{};var i=this.framework.libraryBasePath,n=e||(t={},Object(oe["a"])(t,Fs.DEFAULT,"".concat(i,"images/editor/icon-bubble.png")),Object(oe["a"])(t,Fs.WARNING,"".concat(i,"images/editor/icon-bubble-red.png")),Object(oe["a"])(t,Fs.INFO,"".concat(i,"images/editor/icon-bubble-blue.png")),Object(oe["a"])(t,Fs.SUCCESS,"".concat(i,"images/editor/icon-bubble-green.png")),t),r={pointSize:{conditions:[["${selected}===true","1.5"],["true","1"]]}};if("string"===typeof n)r.image='"'.concat(n,'"');else{var a=Object.values(Fs),s=[];Object.entries(n).forEach(function(e){var t=Object(Ie["a"])(e,2),i=t[0],n=t[1];a.includes(i)&&i!==Fs.DEFAULT&&s.push(['${commentType} === "'.concat(i,'"'),'"'.concat(n,'"')])}),n[Fs.DEFAULT]=n[Fs.DEFAULT]||"".concat(i,"images/editor/icon-bubble.png"),s.push(["true",'"'.concat(n[Fs.DEFAULT],'"')]),r.image={conditions:s},a.forEach(function(e){n[e]||(n[e]=n[Fs.DEFAULT])})}var o=new Tt({name:"planningCommentStyle",declarativeStyle:r});return o.cesiumStyle.ready?(this.framework.addStyle(o),"string"===typeof n?{}:n):(this.logger.warning("could not setup custom comment style, using default"),this._setupCommentStyle())}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;if(this.layerEditor=new kl({geometryLayerEditor:{},featureLayerEditor:{},styleLayerEditor:{allowCustomIcons:!0}}),this.layerEditor.initialize(),this.commentsLayerEditor=new kl({geometryLayerEditor:{allowedGeometries:["Point"],defaultMode:"edit"},styleLayerEditor:{}}),this.useDefaultTerrain&&!this.terrainUrl){var i=this.framework.getLayers().find(function(e){return e.activeOnStartup&&e instanceof zt});this.terrainUrl=i?i.url:null}if(this.terrainUrl&&!/https?:/.test(this.terrainUrl)){var n=a["a"].parse(window.location.href);n.queryParams={},n.hashPath=[],/^\//.test(this.terrainUrl)?(n.path=[],this.terrainUrl="".concat(n.toString()).concat(this.terrainUrl)):this.terrainUrl="".concat(n.toString().replace(/\/$/,""),"/").concat(this.terrainUrl.replace(/^\.\//,""))}if(this.fetchUserPlannings(),this.showInLegend&&(this.legendCluster=Ea(),!this.legendCluster)){this.legendCluster=new ha({title:this.legendTitle});var r=this.framework.getWidgetByType("vcs.vcm.widgets.legend.Legend");r&&r.cluster.push(this.legendCluster)}this.initialized=!0,this.initializedFinished()}return!0}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),-1===this.supportedMaps.indexOf(e.className)?this.legendCluster.visible=!1:this.legendCluster.visible=!0,this.planningInstances.forEach(function(t){t.handleMapChange(e)})}},{key:"fetchUserCreate",value:function(){var e=this.url.clone();ce.a.post(e.extendPath("permission").toString(),{mapId:this.scenarioId}).then(this.setUserMayCreate.bind(this))}},{key:"setUserMayCreate",value:function(e){null!==e.data&&(this.userMayCreate.permission=e.data)}},{key:"fetchUserPlannings",value:function(){var e=this,t=this.url.clone();this.fetching=ce.a.post(t.extendPath("list").toString(),{mapId:this.scenarioId}).then(this.setPlannings.bind(this)).catch(function(t){e.logger.error(t)})}},{key:"setPlannings",value:function(e){var t=this;this.clear().then(function(){var i=e.data;i.forEach(t.createPlanningInstance,t),t._linkedPlannings=[],t.fetching=null,t.framework.publish(B.PLANNINGINSTANCES_CHANGED,t.planningInstances)})}},{key:"setActivePlanning",value:function(e){if(o(e,Js),this.activePlanningInstance){if(this.activePlanningInstance._id===e._id)return;this.activePlanningInstance.maintainLockInterval&&this.activePlanningInstance.unlock(),this.activePlanningInstance.unLoad()}this.activePlanningInstance=e,this.activePlanningInstance&&this.activePlanningInstance.load()}},{key:"deactivateActivePlanning",value:function(){this.activePlanningInstance&&(this.activePlanningInstance.maintainLockInterval&&this.activePlanningInstance.unlock(),this.activePlanningInstance.unLoad()),this.activePlanningInstance=null}},{key:"createPlanningInstance",value:function(e){e.url=this.url;var t=new Js(Object.assign(e,{editorId:this.layerEditor.id,commentsEditorId:this.commentsLayerEditor.id,terrainUrl:this.terrainUrl}));return this._linkedPlannings.indexOf(e._id)>-1&&e.public&&t.load(),this.planningInstances.push(t),this.legendCluster.children.push(new Ta({planningInstance:t})),this.legendCluster.visible=!0,t}},{key:"addPlanningInstance",value:function(e,t,i){var n=this;o(e,String),l(t,String),l(i,Object);var r={name:e,description:t,mapId:this.scenarioId};i&&(r.properties=i);var a=this.url.clone();return ce.a.post(a.extendPath("add").toString(),r).then(function(e){var t=e.data,i=n.createPlanningInstance(t);return n.framework.publish(B.PLANNINGINSTANCES_CHANGED,n.planningInstances),i}).catch(function(e){n.logger.warning(e.response.data)})}},{key:"deletePlanning",value:function(e){var t=this;o(e,Js);var i=this.url.clone();return ce.a.post(i.extendPath("remove").toString(),{_id:e._id}).then(function(){var i=t.planningInstances.findIndex(function(t){return t._id===e._id});t.planningInstances.splice(i,1),t.activePlanningInstance&&t.activePlanningInstance._id===e._id&&(t.activePlanningInstance=null);var n=t.legendCluster.children.findIndex(function(t){return t instanceof Ta&&t.planningInstance._id===e._id});return t.legendCluster.children.splice(n,1),e.destroy(),t.framework.publish(B.PLANNINGINSTANCES_CHANGED,t.planningInstances),e._id})}},{key:"clear",value:function(){var e=this,t=this.planningInstances.map(function(t){return t.destroy().then(function(){return Promise.resolve()}).catch(function(){return e.logger.error("could not unlock planning instance".concat(t.name)),Promise.resolve()})});return Promise.all(t).then(function(){return e.planningInstances.splice(0),e.activePlanningInstance=null,e.legendCluster.children.splice(0),e.legendCluster.visible=!1,Promise.resolve()})}},{key:"getConfigObject",value:function(){return{useLocalCRS:this.useLocalCRS}}},{key:"handleURLParameter",value:function(e){var t=this;e.plannings&&Array.isArray(e.plannings)&&this.framework.subscribeOnce("PLANNINGINSTANCES_CHANGED",function(){t.planningInstances.filter(function(t){return e.plannings.includes(t._id)}).forEach(function(e){e.load()})})}},{key:"getLink",value:function(e){var t=this.planningInstances.filter(function(e){return e.public&&e.loaded}).map(function(e){return e._id});e.queryParams.plannings&&delete e.queryParams.plannings,t.length>0&&e.addQueryParams({plannings:JSON.stringify(t)})}}]),t}(ra),xl=Yl,Al=function(){function e(t,i,n){Object(d["a"])(this,e),this.id=t,this.symbol=i,this.openlayersFilter=n}return Object(m["a"])(e,[{key:"getId",value:function(){return this.id}},{key:"getOpenlayersFilter",value:function(){return this.openlayersFilter}}]),e}(),Fl={EQUAL_TO:new Al("EQUAL_TO"," = ",ol.format.filter.EqualTo),NOT_EQUAL_TO:new Al("NOT_EQUAL_TO"," != ",ol.format.filter.NotEqualTo),LESS_THAN:new Al("LESS_THAN"," < ",ol.format.filter.LessThan),GREATER_THAN:new Al("GREATER_THAN"," > ",ol.format.filter.GreaterThan),LESS_THAN_OR_EQUAL_TO:new Al("LESS_THAN_OR_EQUAL_TO"," <= ",ol.format.filter.LessThanOrEqualTo),GREATER_THAN_OR_EQUAL_TO:new Al("GREATER_THAN_OR_EQUAL_TO"," >= ",ol.format.filter.GreaterThanOrEqualTo),LIKE:new Al("LIKE","like",ol.format.filter.IsLike),BETWEEN:new Al("BETWEEN","between",ol.format.filter.IsBetween),BBOX:new Al("BBOX","bbox",ol.format.filter.Bbox),INTERSECTS:new Al("INTERSECTS","intersects",ol.format.filter.Intersects),DWITHIN:new Al("DWITHIN","distance within",ol.format.filter.DWithin),WITHIN:new Al("WITHIN","within",ol.format.filter.Within),AND:new Al("AND","and",ol.format.filter.and),OR:new Al("OR","or",ol.format.filter.or)},Nl=Al,Hl={GEOMETRY:0,ATTRIBUTE:1,GENERICATTRIBUTE:2,GENERICDATEATTRIBUTE:3,DATEATTRIBUTE:4,DATEYEARATTRIBUTE:5,FILTER:6},Rl=function(){function e(t,i,n,r,a,s){Object(d["a"])(this,e),this.id=t,this.type=n,this.allowedComparisons=[],this.prefix=s,this.valueReference=r||"".concat(s,":").concat(this.id);for(var o=0;o<a.length;o++){var l=a[o];i.hasOwnProperty(l)&&this.allowedComparisons.push(i[l])}}return Object(m["a"])(e,[{key:"getPrefix",value:function(){return this.prefix}},{key:"getId",value:function(){return this.id}},{key:"getType",value:function(){return this.type}},{key:"getAllowedComparisons",value:function(){return this.allowedComparisons}},{key:"getValueReference",value:function(){return this.valueReference}}]),e}(),zl={Filter:(Cl={},Object(oe["a"])(Cl,Fl.AND.id,Fl.AND),Object(oe["a"])(Cl,Fl.OR.id,Fl.OR),Cl),Geometry:(El={},Object(oe["a"])(El,Fl.BBOX.id,Fl.BBOX),Object(oe["a"])(El,Fl.INTERSECTS.id,Fl.INTERSECTS),Object(oe["a"])(El,Fl.DWITHIN.id,Fl.DWITHIN),Object(oe["a"])(El,Fl.WITHIN.id,Fl.WITHIN),El),StringAttribute:(Il={},Object(oe["a"])(Il,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Il,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(Il,Fl.LIKE.id,Fl.LIKE),Il),BooleanAttribute:(Dl={},Object(oe["a"])(Dl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Dl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Dl),DateAttribute:(jl={},Object(oe["a"])(jl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(jl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(jl,Fl.LESS_THAN.id,Fl.LESS_THAN),Object(oe["a"])(jl,Fl.GREATER_THAN.id,Fl.GREATER_THAN),Object(oe["a"])(jl,Fl.LESS_THAN_OR_EQUAL_TO.id,Fl.LESS_THAN_OR_EQUAL_TO),Object(oe["a"])(jl,Fl.GREATER_THAN_OR_EQUAL_TO.id,Fl.GREATER_THAN_OR_EQUAL_TO),Object(oe["a"])(jl,Fl.BETWEEN.id,Fl.BETWEEN),jl),NumberAttribute:(Pl={},Object(oe["a"])(Pl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Pl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(Pl,Fl.LESS_THAN.id,Fl.LESS_THAN),Object(oe["a"])(Pl,Fl.GREATER_THAN.id,Fl.GREATER_THAN),Object(oe["a"])(Pl,Fl.LESS_THAN_OR_EQUAL_TO.id,Fl.LESS_THAN_OR_EQUAL_TO),Object(oe["a"])(Pl,Fl.GREATER_THAN_OR_EQUAL_TO.id,Fl.GREATER_THAN_OR_EQUAL_TO),Object(oe["a"])(Pl,Fl.BETWEEN.id,Fl.BETWEEN),Pl)},Gl=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"boundedBy",zl.Geometry,Hl.GEOMETRY,"gml:boundedBy",e,"gml"))}return w(t,e),t}(Rl),Vl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"id",zl.StringAttribute,Hl.ATTRIBUTE,"@gml:id",e,"gml"))}return w(t,e),t}(Rl),Bl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"name",zl.StringAttribute,Hl.ATTRIBUTE,"gml:name",e,"gml"))}return w(t,e),t}(Rl),Ul=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"description",zl.StringAttribute,Hl.ATTRIBUTE,"gml:description",e,"gml"))}return w(t,e),t}(Rl),Wl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"lineage",zl.StringAttribute,Hl.ATTRIBUTE,"citydb:lineage",e,"citydb"))}return w(t,e),t}(Rl),ql=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"updatingPerson",zl.StringAttribute,Hl.ATTRIBUTE,"citydb:updatingPerson",e,"citydb"))}return w(t,e),t}(Rl),Jl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"lastModificationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"citydb:lastModificationDate",e,"citydb"))}return w(t,e),t}(Rl),Kl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"reasonForUpdate",zl.DateAttribute,Hl.DATEATTRIBUTE,"citydb:lastModificationDate",e,"citydb"))}return w(t,e),t}(Rl),Zl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"creationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"core:creationDate",e,"core"))}return w(t,e),t}(Rl),Ql=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"terminationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"core:terminationDate",e,"core"))}return w(t,e),t}(Rl),Xl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"relativeToTerrain",zl.StringAttribute,Hl.ATTRIBUTE,"core:relativeToTerrain",e,"core"))}return w(t,e),t}(Rl),$l=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"relativeToWater",zl.StringAttribute,Hl.ATTRIBUTE,"core:relativeToWater",e,"core"))}return w(t,e),t}(Rl),ec=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceInformationSystem",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:informationSystem",e,"core"))}return w(t,e),t}(Rl),tc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceName",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:externalObject/core:name",e,"core"))}return w(t,e),t}(Rl),ic=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceUri",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:externalObject/core:uri",e,"core"))}return w(t,e),t}(Rl),nc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"stringAttribute",zl.StringAttribute,Hl.GENERICATTRIBUTE,'gen:stringAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),rc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"doubleAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:doubleAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),ac=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"intAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:intAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),sc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"uriAttribute",zl.StringAttribute,Hl.GENERICATTRIBUTE,'gen:uriAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),oc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"dateAttribute",zl.DateAttribute,Hl.GENERICDATEATTRIBUTE,'gen:dateAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),lc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"measureAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:measureAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),cc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"class",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),uc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"function",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),hc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"usage",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),dc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"yearOfConstruction",zl.DateAttribute,Hl.DATEYEARATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),mc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"yearOfDemolition",zl.DateAttribute,Hl.DATEYEARATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),fc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"roofType",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),yc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"measuredHeight",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),gc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeysAboveGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),vc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeysBelowGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),pc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeyHeightsAboveGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),_c=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeyHeightsBelowGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),bc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"street",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:street",e,"citydb"))}return w(t,e),t}(Rl),Lc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"houseNumber",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:houseNumber",e,"citydb"))}return w(t,e),t}(Rl),Mc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"poBox",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:poBox",e,"citydb"))}return w(t,e),t}(Rl),kc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"zipCode",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:zipCode",e,"citydb"))}return w(t,e),t}(Rl),wc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"city",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:city",e,"citydb"))}return w(t,e),t}(Rl),Tc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"state",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:state",e,"citydb"))}return w(t,e),t}(Rl),Sc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"country",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:country",e,"citydb"))}return w(t,e),t}(Rl),Oc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"isMovable",zl.BooleanAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Cc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"species",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Ec=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"height",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Ic=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"trunkDiameter",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Dc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"crownDiameter",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),jc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"averageHeight",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Pc=Rl,Yc={gml:"http://www.opengis.net/gml",core:"http://www.opengis.net/citygml/2.0",citydb:"http://www.3dcitydb.org/citygml-ade/3.0",tran:"http://www.opengis.net/citygml/transportation/2.0",wtr:"http://www.opengis.net/citygml/waterbody/2.0",grp:"http://www.opengis.net/citygml/cityobjectgroup/2.0",luse:"http://www.opengis.net/citygml/landuse/2.0",frn:"http://www.opengis.net/citygml/cityfurniture/2.0",app:"http://www.opengis.net/citygml/appearance/2.0",tex:"http://www.opengis.net/citygml/texturedsurface/2.0",bldg:"http://www.opengis.net/citygml/building/2.0",xal:"urn:oasis:names:tc:ciq:xsdschema:xAL:2.0",dem:"http://www.opengis.net/citygml/relief/2.0",veg:"http://www.opengis.net/citygml/vegetation/2.0",gen:"http://www.opengis.net/citygml/generics/2.0",brid:"http://www.opengis.net/citygml/bridge/2.0",tun:"http://www.opengis.net/citygml/tunnel/2.0"},xc=["_CityObject","Building","CityFurniture","GenericCityObject","SolitaryVegetationObject","Bridge","Tunnel","CityObjectGroup","LandUse","TransportationComplex","Railway","Road","Square","Track","PlantCover","WaterBody"],Ac=["id","name","creationDate","terminationDate","relativeToTerrain","relativeToWater","externalReferenceInformationSystem","externalReferenceName","externalReferenceUri","stringAttribute","doubleAttribute","intAttribute","uriAttribute","dateAttribute","measureAttribute","class","function","usage","yearOfConstruction","yearOfDemolition","roofType","measuredHeight","storeysAboveGround","storeysBelowGround","storeyHeightsAboveGround","storeyHeightsBelowGround","street","houseNumber","poBox","zipCode","city","state","country","isMovable","species","height","trunkDiameter","crownDiameter","averageHeight","lineage","updatingPerson","lastModificationDate","reasonForUpdate"],Fc=["id","name","relativeToTerrain","relativeToWater","externalReferenceInformationSystem","externalReferenceName","externalReferenceUri","class","function","usage","roofType","measuredHeight","storeysAboveGround","storeysBelowGround","storeyHeightsAboveGround","storeyHeightsBelowGround","street","houseNumber","poBox","zipCode","city","state","country","isMovable","species","height","trunkDiameter","crownDiameter","averageHeight","lineage","updatingPerson"],Nc=["stringAttribute","doubleAttribute","intAttribute","uriAttribute","measureAttribute"],Hc=["creationDate","terminationDate","lastModificationDate","reasonForUpdate"],Rc=["yearOfConstruction","yearOfDemolition"],zc=["genericDateAttribute"],Gc=function(){function e(t,i,n,r,a){Object(d["a"])(this,e),this.featureType=t,this.featureNs=Yc[i],this.featurePrefix=i,this.allowedProperties=[];for(var s=0;s<r.length;s++){var o=r[s];if(n.hasOwnProperty(o)){var l=new n[o](a,i);this.allowedProperties.push(l)}}}return Object(m["a"])(e,[{key:"getFeatureType",value:function(){return this.featureType}},{key:"getFeatureNs",value:function(){return this.featureNs}},{key:"getFeaturePrefix",value:function(){return this.featurePrefix}},{key:"getAllowedProperties",value:function(){return this.allowedProperties}}]),e}(),Vc={boundedBy:Gl,id:Vl,name:Bl,description:Ul,lineage:Wl,updatingPerson:ql,lastModificationDate:Jl,reasonForUpdate:Kl,creationDate:Zl,terminationDate:Ql,relativeToTerrain:Xl,relativeToWater:$l,externalReferenceInformationSystem:ec,externalReferenceName:tc,externalReferenceUri:ic,stringAttribute:nc,doubleAttribute:rc,intAttribute:ac,uriAttribute:sc,dateAttribute:oc,measureAttribute:lc},Bc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"_CityObject","core",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){return Object.assign({},Vc)}}]),t}(Gc),Uc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"GenericCityObject","gen",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Wc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Building","bldg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc,roofType:fc,measuredHeight:yc,storeysAboveGround:gc,storeysBelowGround:vc,storeyHeightsAboveGround:pc,storeyHeightsBelowGround:_c,street:bc,houseNumber:Lc,poBox:Mc,zipCode:kc,city:wc,state:Tc,country:Sc})}}]),t}(Gc),qc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Bridge","brid",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc,isMovable:Oc})}}]),t}(Gc),Jc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Tunnel","tun",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc})}}]),t}(Gc),Kc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"CityFurniture","frn",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Zc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"CityObjectGroup","grp",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Qc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"LandUse","luse",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Xc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"TransportationComplex","tran",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),$c=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Railway","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),eu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Road","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),tu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Square","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),iu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Track","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),nu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"SolitaryVegetationObject","veg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,species:Cc,height:Ec,trunkDiameter:Ic,crownDiameter:Dc})}}]),t}(Gc),ru=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"PlantCover","veg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,averageHeight:jc})}}]),t}(Gc),au=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"WaterBody","wtr",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc);function su(e,t,i){var n={_CityObject:Bc,GenericCityObject:Uc,Building:Wc,Bridge:qc,Tunnel:Jc,CityFurniture:Kc,CityObjectGroup:Zc,LandUse:Qc,TransportationComplex:Xc,Railway:$c,Road:eu,Track:iu,Square:tu,SolitaryVegetationObject:nu,PlantCover:ru,WaterBody:au};return e.map(function(e){return new n[e](t,i)})}var ou=function(){function e(t){Object(d["a"])(this,e),this.type=t.type,this.id=t.id,this.comparison=t.comparison||null,this.fixedComparison=t.comparison&&t.isPreset,this.property=t.property||null,this.isPreset=t.isPreset||!1}return Object(m["a"])(e,[{key:"getFilter",value:function(){var e=this;o(this.comparison,Nl),o(this.property,Pc);var t=this.property.getAllowedComparisons().findIndex(function(t){return t.getId()===e.comparison.getId()});if(-1===t)throw new Error("Comparison ".concat(this.comparison.getId()," not allowed for ").concat(this.property.getId()));return null}},{key:"destroy",value:function(){}}]),e}(),lu=ou,cu=new Pc("filter",zl.Filter,Hl.FILTER,null,Object.keys(zl.Filter),""),uu=function(e){function t(e){var i;Object(d["a"])(this,t),e.type="combination",e.property=cu,e.comparison=cu.getAllowedComparisons()[0],i=y(this,b(t).call(this,e)),i.filters=e.filters||[],i.level=e.level||0;var n=!e.isPreset&&"all";return i.allowAdditional=e.allowAdditional||n,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.comparison.getOpenlayersFilter();if(0===this.filters.length)throw new Error("Cannot process empty filter");if(1===this.filters.length)return this.filters[0].getFilter();var i=this.filters.map(function(e){return e.getFilter()});return e.apply(void 0,Object(T["a"])(i))}},{key:"removeChild",value:function(e){var t=this.filters.findIndex(function(t){return t.id===e.id});this.filters.splice(t,1)}},{key:"hasChild",value:function(e){return this.filters.some(function(t){return t&&t.id===e.id})}}]),t}(lu),hu=uu;function du(e){var t=R.mercatorToWgs84(e,!0);return[t[1],t[0]]}function mu(e){var t=e.clone();if(t instanceof ol.geom.Polygon){var i=t.getCoordinates().map(function(e){return e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push(e[0].slice()),e.map(du)});t.setCoordinates(i,"XY")}else if(t instanceof ol.geom.Point){var n=t.getCoordinates();t.setCoordinates(du(n),"XY")}else if(t instanceof ol.geom.LineString){var r=t.getCoordinates().map(du);t.setCoordinates(r,"XY")}return t}var fu=function(e){function t(e){var i;Object(d["a"])(this,t),e.type="geometry";var n=e.allowedComparisons||Object.keys(zl.Geometry).map(function(e){return zl.Geometry[e].getId()});return e.property=new Pc("geometry",zl.Geometry,Hl.GEOMETRY,"gml:boundedBy",n,"gml"),i=y(this,b(t).call(this,e)),i.distance=null,i.editorId=e.editorId,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.comparison.getOpenlayersFilter(),i=ne.getInstance().getLayerByName("_queryWidgetGeometryFilterLayer"),n=i.getFeatureById(this.id);if(!n)throw new Error("cannot find drawing for filter");var r=n.getGeometry();if(!r)throw new Error("cannot find drawing for filter");var a=r.clone(),s=a.getCoordinates();ui(a,s).forEach(function(e){var t=e.slice();e[1]=t[0],e[0]=t[1]}),a.setCoordinates(s);var o=mu(r);if(!e)throw new Error("Comparison is not defined");if("DWITHIN"===this.comparison.getId()){if(!this.distance)throw new Error("DWITHIN filter requires a distance");return new e(this.property.getValueReference(),o,this.distance,"m","urn:ogc:def:crs:EPSG::4326")}return"BBOX"===this.comparison.getId()?new e(this.property.getValueReference(),r.getExtent(),"urn:ogc:def:crs:EPSG::4326"):new e(this.property.getValueReference(),o,"urn:ogc:def:crs:EPSG::4326")}},{key:"destroy",value:function(){var e=ne.getInstance().getLayerByName("_queryWidgetGeometryFilterLayer");e.removeFeaturesById([this.id])}}]),t}(lu),yu=fu,gu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type="property",i=y(this,b(t).call(this,e)),i.value=e.value||null,i.fixedValue=e.value&&e.isPreset,i.genericAttributeName=e.genericAttributeName||null,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.property.getValueReference();this.genericAttributeName&&(e=e.replace("token",this.genericAttributeName));var i=this.comparison.getOpenlayersFilter();return"BETWEEN"===this.comparison.id?(o(this.value,Array),this.value.sort(),this.value[0]instanceof Date?new i(e,this.value[0].toISOString(),this.value[1].toISOString()):new i(e,this.value[0],this.value[1])):this.value instanceof Date?new i(e,this.value.toISOString()):new i(e,this.value)}}]),t}(lu),vu=gu,pu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.url=e.url,i.projection=new R(e.projection),i.maxFeatures=e.maxFeatures||1e4,i.runningRequest=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.wfs.WFSObject"}}]),Object(m["a"])(t,[{key:"getFeatures",value:function(e,t){if(!this.url||""===this.url)return Promise.reject();this.cancelRequest();var i=(new ol.format.WFS2).writeGetFeature({featureNS:e.getFeatureNs(),featurePrefix:e.getFeaturePrefix(),featureTypes:[e.getFeatureType()],propertyNames:["gml:boundedBy"],filter:t,outputFormat:"application/gml+xml; version=3.1",count:this.maxFeatures,allNs:Yc});function n(e){var t;return t=window.ActiveXObject?e.xml:(new XMLSerializer).serializeToString(e),t}var r=n(i);return r=r.replace(/__--__/g,":"),this.runningRequest=ce.a.CancelToken.source(),ce.a.post(this.url,r,{cancelToken:this.runningRequest.token}).then(this.handleResponse.bind(this)).catch(function(e){var t=e.response;return t&&t.data?Promise.reject(new Error(t.data)):Promise.reject(e)})}},{key:"handleResponse",value:function(e){var t=e.data,i=this.framework.getProjection().getProjection();return(new ol.format.WFS2).readFeatures(t,{dataProjection:i})}},{key:"cancelRequest",value:function(){this.runningRequest&&this.runningRequest.cancel(),this.runningRequest=null}}]),t}(A),_u=["EQUAL_TO","NOT_EQUAL_TO","LESS_THAN","GREATER_THAN","LESS_THAN_OR_EQUAL_TO","GREATER_THAN_OR_EQUAL_TO","LIKE"],bu=["BETWEEN"],Lu=["EQUAL_TO","NOT_EQUAL_TO","LESS_THAN","GREATER_THAN","LESS_THAN_OR_EQUAL_TO","GREATER_THAN_OR_EQUAL_TO","LIKE","BETWEEN"],Mu=["INTERSECTS","WITHIN","DWITHIN"],ku=pu,wu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.allFeatureTypes=e.allFeatureTypes||xc,i.allProperties=e.allProperties||Ac,i.allLogicalRelations=e.allLogicalRelations||Lu,i.allSpatialFilters=e.allSpatialFilters||Mu,i.freeQueriesOption="false"!==String(e.freeQueries).toLowerCase(),i.predefinedQueries=e.predefinedQueries||[],i.featureTypes=su(i.allFeatureTypes,i.allProperties,i.allLogicalRelations),i.wfs=new ku(e.wfs?e.wfs:{}),i._filters=[],i._defaultMaxLevel=Object(u["h"])(e.maximumLevel,1),i.maximumLevel=i._defaultMaxLevel,i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.activeQuery={type:null,featureType:null,filter:null,runningRequest:null},i.foundFeatures=[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Query"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.geometryFilterLayer=new _n({name:"_queryWidgetGeometryFilterLayer",projection:R.createMercatorProjection(),altitudeMode:"clampToGround"}),this.framework.addLayer(this.geometryFilterLayer),this.geometryLayerEditor=new hl({allowedGeometries:["Point","LineString","BBox","Polygon"],defaultMode:"edit"}),this.geometryLayerEditor.initialize(),this.geometryLayerEditor.addEditingLayer(this.geometryFilterLayer),this.initialized=!0,this.initializedFinished()}return!0}},{key:"getAllowedProperties",value:function(e){o(e,String);var t=this.featureTypes.find(function(t){return t.getFeatureType()===e});return t?t.getAllowedProperties():[]}},{key:"setPreset",value:function(e){if(o(e,[Object,String]),this.activeQuery.filter&&this.removeFilter(this.activeQuery.filter),this.activeQuery.filter=null,this.activeQuery.featureType=null,this.maximumLevel=this._defaultMaxLevel,"_free"!==e){e=e,this.activeQuery.type=e.name;var t=JSON.parse(JSON.stringify(e));if(this.activeQuery.featureType=t.featureType,t.property){var i=this.getAllowedProperties(this.activeQuery.featureType).find(function(e){return e.getId()===t.property}),n=null;t.valueInput?n=t.valueInput:t.dateInput?n=new Date(t.dateInput.year,t.dateInput.month,t.dateInput.date):t.dateInputLower&&(n=[new Date(t.dateInputLower.year,t.dateInputLower.month,t.dateInputLower.date),new Date(t.dateInputUpper.year,t.dateInputUpper.month,t.dateInputUpper.date)]);var r=null;if(t.comparison){var a=Object.keys(Fl).find(function(e){return Fl[e].id===t.comparison});r=Fl[a]}t.allowAdditional||(this.maximumLevel=0),Number.isFinite(t.maximumLevel)&&(this.maximumLevel=t.maximumLevel),this.addFilter({type:"property",property:i,comparison:r,value:n,isPreset:!0,genericAttributeName:t.genericAttributeName,allowAdditional:t.allowAdditional})}}else this.activeQuery.type="_free"}},{key:"_createFilter",value:function(e){var t;return e.id=Object(u["c"])(),t="geometry"===e.type?new yu(Object.assign(e,{allowedComparisons:this.allSpatialFilters,editorId:this.geometryLayerEditor.id})):"property"===e.type?new vu(e):new hu(e),this._filters.push(t),t}},{key:"addFilter",value:function(e){if(o(e,{type:["geometry","property","combination"]}),this.activeQuery.filter)return this.addFilterToCombination(this.activeQuery.filter,e);"combination"===e.type&&(e.level=1);var t=this._createFilter(e);return this.activeQuery.filter=this._createFilter({type:"combination",filters:[t],isPreset:e.isPreset,allowAdditional:e.allowAdditional}),t.id}},{key:"removeFilter",value:function(e){var t=this;o(e,lu);var i=this._filters.find(function(t){return t instanceof hu&&t.hasChild(e)});if(!i)return this.activeQuery.filter=null,this._filters.forEach(function(e){e.destroy()}),void this._filters.splice(0);e instanceof hu&&e.filters.forEach(function(e){t.removeFilter(e)}),i.removeChild(e),0===i.filters.length&&this.removeFilter(i);var n=this._filters.findIndex(function(t){return t.id===e.id});e.destroy(),this._filters.splice(n,1)}},{key:"addFilterToCombination",value:function(e,t){if(o(t,{type:["geometry","property","combination"]}),o(e,hu),"combination"===t.type){if(e.level===this.maximumLevel)throw new Error("Maximum complexity reached, cannot add another level of depth");t.level=e.level+1}var i=this._createFilter(t);return e.filters.push(i),i.id}},{key:"sendRequest",value:function(){var e=this;this.foundFeatures.splice(0);var t=this.featureTypes.find(function(t){return t.featureType===e.activeQuery.featureType}),i=this.activeQuery.filter.getFilter();if(!t||!i)throw new Error("Could not find active featureType");return this.wfs.getFeatures(t,i).then(this._handleResult.bind(this))}},{key:"cancelRequest",value:function(){this.wfs.cancelRequest()}},{key:"_handleResult",value:function(e){var t=this;e.forEach(function(e){t.foundFeatures.push(e)})}},{key:"addToSelectionSet",value:function(e){l(e,Boolean);var t=this.framework.getSelectBehavior();e&&t.clearSelectionSet();var i=this.foundFeatures.map(function(e){return e.id});t.addToSelectionSet(i)}},{key:"zoomToFeatures",value:function(){if(this.foundFeatures.length>0){var e=ol.extent.createEmpty();this.foundFeatures.forEach(function(t){t.children&&t.children.forEach(function(t){"_3"===t.type&&(e=ol.extent.extend(e,t.attributes.extent))})});var t=ol.proj.getTransform(this.framework.getProjection().getProjection(),ol.proj.get("EPSG:4326"));e=ol.extent.applyTransform(e,t);var i=V.createViewPointFromExtent(e);this.framework.getActiveMap().gotoViewPoint(i)}}},{key:"zoomToFeature",value:function(e){var t=ol.extent.createEmpty();e.children&&e.children.forEach(function(e){"_3"===e.type&&(t=ol.extent.extend(t,e.attributes.extent))});var i=ol.proj.getTransform(this.framework.getProjection().getProjection(),ol.proj.get("EPSG:4326"));t=ol.extent.applyTransform(t,i);var n=V.createViewPointFromExtent(t);this.framework.getActiveMap().gotoViewPoint(n)}},{key:"clear",value:function(){var e=this.framework.getSelectBehavior();e.clearSelectionSet(),this.foundFeatures.splice(0)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.allFeatureTypes=this.allFeatureTypes,e.allProperties=this.allProperties,e.allLogicalRelations=this.allLogicalRelations,e.allSpatialFilters=this.allSpatialFilters,e.freeQueries=this.freeQueriesOption,e.predefinedQueries=this.predefinedQueries,e.maximumLevel=this.maximumLevel,e.wfs={maxFeatures:this.wfs.maxFeatures},e}}]),t}(ra),Tu=wu,Su=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.middleware=e.middleware||[],i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){}},{key:"search",value:function(e,t,i){}}]),t}(A),Ou=Su,Cu=Y.getLogger("vcs.vcm.widgets.search.Nominatim"),Eu=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e));var n=e.url||"https://nominatim.openstreetmap.org/search";return i.url=a["a"].parse(n),i.city=e.city||null,i.state=e.state||null,i.countrycode=e.countrycode||"de",i.extent=e.extent?new Ae(e.extent):null,i.limit=e.limit||20,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Nominatim"}}]),Object(m["a"])(t,[{key:"search",value:function(e,i,n){var r=this.url.clone(),a={q:e,countrycodes:this.countrycode,format:"json",polygon_geojson:1,addressdetails:1,limit:this.limit};this.city&&(a.q+=",".concat(this.city)),this.state&&(a.q+=",".concat(this.state)),this.extent&&(a.viewbox=this.extent.getCoordinatesInProjection(R.createGeographicProjection()).join(","),a.bounded=1),r.addQueryParams(a),ce.a.get(r.toString()).then(function(e){var i=t.handleSearchResults(e);n(i)}).catch(function(){Cu.error("got an error from the server"),n([])})}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return Object.assign({},e,{url:this.url.toString(),city:this.city,state:this.state,countrycode:this.countrycode,extent:this.extent?this.extent.getConfigObject():null,limit:this.limit})}}],[{key:"handleSearchResults",value:function(e){var t=e.data;return t.map(function(e){return e.point=[Number(e.lon),Number(e.lat)],e.geojson?e.type="geojson":e.type="point",e})}}]),t}(Ou),Iu=Eu,Du=(i(340),i(649)),ju=i.n(Du);function Pu(e,t,i,n,r,a,s){try{var o=e[a](s),l=o.value}catch(c){return void i(c)}o.done?t(l):ju.a.resolve(l).then(n,r)}function Yu(e){return function(){var t=this,i=arguments;return new ju.a(function(n,r){var a=e.apply(t,i);function s(e){Pu(a,n,r,s,o,"next",e)}function o(e){Pu(a,n,r,s,o,"throw",e)}s(void 0)})}}var xu,Au,Fu,Nu,Hu,Ru,zu=new gt({fill:{color:[85,110,255,.4]},stroke:{color:[0,0,0,1],width:1.25},image:{fill:{color:[255,255,255,1]},stroke:{color:[0,0,0,1],width:1},radius:5}}),Gu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.vectorLayer=new _n({name:"_locatorVector",altitudeMode:"clampToGround",classificationType:e.classificationType||"both",allowPicking:!1,heightAboveGround:2,projection:{epsg:"EPSG:4326"},style:e.style?zu.assign(new gt(e.style)):zu}),i.tracker=null,i.flatError=0,i.zoomDistance=e.zoomDistance?e.zoomDistance:1e3,i.locatorExtrusion=!1!==e.extrusion&&Object(u["h"])(e.extrusion,80),i.values={locatorVisibility:!1},i._pickingTerrain=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Locator"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;var n=t.testForApi();if(!n)return this.logger.warning("Locator Widget is not supported"),!1;this.framework.addLayer(this.vectorLayer),this.locatorPoint=new ol.Feature({geometry:new ol.geom.Point([0,0,0],"XYZ"),heading:!1}),this.locatorExtrusion&&this.locatorPoint.set("olcs_extrudedHeight",this.locatorExtrusion),this.errorCircle=new ol.Feature({geometry:new ol.geom.Circle([0,0],5e3)}),this.vectorLayer.addFeatures([this.locatorPoint,this.errorCircle]),this.framework.subscribe("MAP_ACTIVATED",function(t){"vcs.vcm.maps.Cesium"===t.className&&e.tracker&&e._placeLocatorOnTerrain()}),this.initialized=!0,this.initializedFinished()}return!0}},{key:"locatorClicked",value:function(){if(null===this.tracker)this.tracker=navigator.geolocation.watchPosition(this.trackLocator.bind(this),this.handleError.bind(this));else if(this.locatorInsideView())this.toggleVisibility(),navigator.geolocation.clearWatch(this.tracker),this.tracker=null;else{var e=this.locatorPoint.getGeometry().getCoordinates(),t=R.mercatorToWgs84(e);this.goToLocator(null,{coords:{longitude:t[0],latitude:t[1]}})}}},{key:"toggleVisibility",value:function(){this.values.locatorVisibility=!this.values.locatorVisibility,this.values.locatorVisibility?this.vectorLayer.activate(!0):this.vectorLayer.activate(!1)}},{key:"goToLocator",value:function(e,t){var i=this.framework.getActiveMap().getViewPoint();i.setAnimate(!0),i.setCameraPosition(null),i.setGroundPosition([t.coords.longitude,t.coords.latitude]),null!=e&&i.setDistance(e),this.framework.getActiveMap().gotoViewPoint(i,1,0)}},{key:"trackLocator",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t){var i,n,r,a,s,o=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!this._pickingTerrain){e.next=2;break}return e.abrupt("return");case 2:if(i=function(e){var t=ol.geom.Polygon.circular(new ol.Sphere(6378137),e,o.flatError,128);t.applyTransform(function(e,t,i){for(var n=e.length,r=0;r<n;r+=i){var a=[e[r],e[r+1]];R.wgs84ToMercator(a,!0),t[r]=a[0],t[r+1]=a[1]}return t}),o.errorCircle.setGeometry(t)},n=[t.coords.longitude,t.coords.latitude],r=t.coords.heading,null!=r?this.locatorPoint.set("heading",r):this.locatorPoint.set("heading",!1),a=this.locatorPoint.getGeometry().getCoordinates(),s=R.mercatorToWgs84(a),0===Math.abs(s[0]-n[0])&&0===Math.abs(s[1]-n[1])){e.next=16;break}return this.locatorPoint.getGeometry().setCoordinates(R.wgs84ToMercator(n)),e.next=12,this._placeLocatorOnTerrain();case 12:this.flatError=t.coords.accuracy,i(n),e.next=17;break;case 16:0!==Math.abs(this.flatError-t.coords.accuracy)&&(this.flatError=t.coords.accuracy,i(n));case 17:this.values.locatorVisibility||(this.goToLocator(this.zoomDistance,t),this.toggleVisibility());case 18:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"_placeLocatorOnTerrain",value:function(){var e=Yu(regeneratorRuntime.mark(function e(){var t,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.framework.getActiveMap(),"vcs.vcm.maps.Cesium"!==t.className){e.next=8;break}return i=this.locatorPoint.getGeometry().getCoordinates(),this._pickingTerrain=!0,e.next=6,t.getHeightFromTerrain([i]);case 6:this.locatorPoint.getGeometry().setCoordinates(i),this._pickingTerrain=!1;case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"locatorInsideView",value:function(){var e=this.locatorPoint.getGeometry().getCoordinates(),t=R.mercatorToWgs84(e);return this.framework.getActiveMap().pointIsVisible(t)}},{key:"handleError",value:function(e){switch(this.values.locatorVisibility&&this.toggleVisibility(),e.code){case 1:alert("Der Zugriff auf Ihre Position wurde verweigert.");break;case 2:alert("Ihre momentane Position konnte leider nicht erfasst werden.");break;case 3:alert("Wärend dem ermitteln Ihrer Position wurde die Verbindung verloren");break;default:alert("Ihre Position kann leider nicht erfasst werden");break}this.logger.warning("Geolocation could not be verified")}},{key:"setStyle",value:function(e){this.logger.deprecate("setStyle","use the config or set the style via the .vectorLayer property"),this.vectorLayer.setStyle(e);for(var t,i=this.vectorLayer.getFeatures(),n=0;n<i.length;n++)t=i[n],t.setStyle(e)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.zoomDistance=this.zoomDistance,e.style=this.vectorLayer.style.getOptions({fill:!0,stroke:!0,image:!0}),e.locatorExtrusion=this.locatorExtrusion,e.classificationType=this.vectorLayer.classificationType,e}},{key:"isVisible",value:function(){return this.logger.deprecate("isVisible","access values.locatorVisibility directly"),this.values.locatorVisibility}},{key:"getValuesObject",value:function(){return this.logger.deprecate("isVisible","access values directly"),this.values}}],[{key:"getLocation",value:function(){return new Promise(function(e,t){navigator.geolocation.getCurrentPosition(e,t)})}},{key:"testForApi",value:function(){var e=location,t=e.hostname,i=e.protocol,n=!!navigator.geolocation&&!ne.getInstance().isIE11;return"localhost"===t||"127.0.0.1"===t?n:"https:"===i&&n}}]),t}(ra),Vu=Gu,Bu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.sortByType=e.sortByType||!1,i.location={},i.resultSize=e.resultSize,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Elasticsearch"}}]),Object(m["a"])(t,[{key:"search",value:function(e,t,i){var n=this;this.initSearchQuery(e,t).then(function(r){var a=Dr()(JSON.stringify(r.query)),s=Object.assign(r.values,{userInput:e}),o=a(s);n.middleware.forEach(function(e){o=e.addToQuery(o)});var l=t.endpoints.find(function(e){return e.searchImpl===this.className},n),c=q.getInstance().getLocaleAwareString(l.url);ce.a.post(c,o).then(n.handleSearch.bind(n,i)).catch(n.handleSearch.bind(n,i))})}},{key:"handleSearch",value:function(e,t){if(t instanceof Error)e([]);else{var i=t.data,n=[];this.middleware.forEach(function(e){e.handleResult(i)});try{if(i.hits.hits.length>0){var r=i.hits.hits;n=r.map(function(e){return Object.assign(e._source,{type:e._type})})}}catch(a){}e(n)}}},{key:"parseSearchQuery",value:function(e,t){var i,n={},r=t.hasOwnProperty("filter"),a=t.hasOwnProperty("function")||t.decayByLocation,s=t.hasOwnProperty("rescore");if(t.hasOwnProperty("values")&&Object.assign(n,this.makeTemplateValues(e,t.values)),r&&a){if(t.hasOwnProperty("function")&&t.decayByLocation){var o=this.getDecayByLocation();l=t.functions.concat(o)}else l=t.hasOwnProperty("function")?t.function:this.getDecayByLocation();i={query:{filtered:{query:{function_score:{query:t.query,functions:l}},filter:t.filter}}}}else if(r)i={query:{filtered:{query:t.query,filter:t.filter}}};else if(a){var l;if(t.hasOwnProperty("function")&&t.decayByLocation){o=this.getDecayByLocation();l=t.functions.concat(o)}else l=t.hasOwnProperty("function")?t.function:this.getDecayByLocation();i={query:{function_score:{query:t.query,functions:l}}}}else i={query:t.query};return s&&(i.rescore=t.rescore),this.resultSize&&(i.size=this.resultSize),{query:i,values:n}}},{key:"initSearchQuery",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i){var n,r,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!i.decayByLocation){e.next=14;break}if(n=this.location.coords&&Date.now()-this.location.setAt>3e5,r=!this.location.coords&&Vu.testForApi(),!n&&!r){e.next=14;break}return e.prev=4,e.next=7,Vu.getLocation();case 7:a=e.sent,this.location={coords:{lat:a.coords.latitude,lon:a.coords.longitude},setAt:Date.now()},e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](4),this.logger.warning(e.t0.message);case 14:return e.abrupt("return",this.parseSearchQuery(t,i));case 15:case"end":return e.stop()}},e,this,[[4,11]])}));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"getDecayByLocation",value:function(){var e;return e=this.location.hasOwnProperty("coords")?[{gauss:{geoLocation:{origin:this.location.coords,offset:"1km",scale:"2km"}}}]:[],e}},{key:"makeTemplateValues",value:function(e,t){var i={};return Object.values(t).forEach(function(t){var n=new RegExp(t.regex),r=e.match(n)[0];t.hasOwnProperty("replace")&&(r=r.replace(new RegExp(t.replace.regex,"g"),t.replace.value)),i[t.name]=r.trim()}),i}}]),t}(Ou),Uu=Bu,Wu=function(e){function t(e){return Object(d["a"])(this,t),e.url&&(e.url=null),y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.VirtualcityLocationService"}}]),t}(Iu),qu=Wu,Ju=function(){function e(t){Object(d["a"])(this,e)}return Object(m["a"])(e,[{key:"initialize",value:function(){}},{key:"addToQuery",value:function(e){return e}},{key:"addFilter",value:function(e,t){var i=JSON.parse(e);if(i.query.hasOwnProperty("filtered")){var n=i.query.filtered.filter;if(n.hasOwnProperty("bool")){var r=n.bool;if(r.hasOwnProperty("must")){var a=r.must;if(Array.isArray(a))a.push(t);else{var s={};Object.assign(s,a),r.must=[s,t]}}else r.must=t}else{var o={};Object.assign(o,n);var l={bool:{must:[o,t]}};i.query.filtered.filter=l}return JSON.stringify(i)}var c={query:{filtered:{query:i.query,filter:t}}};return JSON.stringify(c)}},{key:"handleResult",value:function(e){}},{key:"clear",value:function(){}}]),e}(),Ku=Ju,Zu=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.className=t.className,i.tags=[],i.activeTags=[],i.doHandle=!0,i.tagOrder=e.tagOrder?e.tagOrder:[],i.combineTagsWithOr=!!e.combineTagsWithOr,i.isActive=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.middleware.Tags"}}]),Object(m["a"])(t,[{key:"addToQuery",value:function(e){var t=this._addTagAggregation(e);return this._filterByTags(t)}},{key:"_addTagAggregation",value:function(e){var t=JSON.parse(e);return t.aggregations?t.aggregations.tagCount={terms:{field:"tags"}}:t.aggregations={tagCount:{terms:{field:"tags"}}},JSON.stringify(t)}},{key:"_filterByTags",value:function(e){if(0===this.activeTags.length)return e;var t={};if(1===this.activeTags.length)t.term={tags:this.activeTags[0].key};else{var i=this.activeTags.map(function(e){return{term:{tags:e.key}}});t=this.combineTagsWithOr?{or:i}:{and:i}}return this.addFilter(e,t)}},{key:"handleResult",value:function(e){if(this.doHandle)if(e.aggregations&&e.aggregations.tagCount){var t=e.aggregations.tagCount.buckets;if(t.length){var i=this.sortTags(t),n=i.filter(function(e){return this.activeTags.find(function(t){return t.key===e.key})},this);this.clear(),i.forEach(function(e){this.tags.push(e)},this),n.forEach(function(e){this.activeTags.push(e)},this)}else this.clear()}else this.clear()}},{key:"setHandle",value:function(e){this.doHandle=e}},{key:"sortTags",value:function(e){var t=this;return e=this.tagOrder.length>0?e.sort(function(e,i){var n=t.tagOrder.indexOf(e.key),r=t.tagOrder.indexOf(i.key);return n=n>-1?n:t.tagOrder.length+1,r=r>-1?r:t.tagOrder.length+1,n-r}):e.sort(function(e,t){return e.key.toLocaleString()<t.key.toLocaleString()?-1:1}),e}},{key:"clear",value:function(){this.tags.splice(0,this.tags.length),this.activeTags.splice(0,this.activeTags.length),this.isActive=!1}}]),t}(Ku),Qu=Zu,Xu=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.className=t.className,i.fillColor=e.fillColor?e.fillColor:"rgba(85,110,255,0.4)",i.searchCenterIcon=e.searchCenterIcon?e.searchCenterIcon:null,i.pointId=null,i.cirleId=null,i.searchCenter=[0,0],i.searchDistance=500,i.isActive=!1,i.title=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.middleware.Near"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e,t=ne.getInstance(),i=new _n({projection:{epsg:4326},altitudeMode:"clampToGround",allowPicking:!1,name:"_".concat(Object(u["c"])())});t.addLayer(i),this.layerName=i.name,e=null!==this.searchCenterIcon?new ol.style.Icon({src:this.searchCenterIcon,scale:.5}):new ol.style.Circle({fill:new ol.style.Fill({color:"#000"}),stroke:new ol.style.Stroke({color:"rgba(1,1,1,0.0)",width:0}),radius:5}),i.setStyle(new ol.style.Style({image:e,fill:new ol.style.Fill({color:this.fillColor}),stroke:new ol.style.Stroke({width:0,color:"rgba(1,1,1,0.0)"})}));var n=new ol.Feature({geometry:new ol.geom.Point([0,0])}),r=new ol.Feature({geometry:new ol.geom.Circle([0,0]),radius:2e5}),a=i.addFeatures([n,r]);this.pointId=a[0],this.circleId=a[1]}},{key:"addToQuery",value:function(e){if(this.isActive){var t={geo_distance:{distance:this.searchDistance,geoLocation:this.searchCenter}};return this.addFilter(e,t)}return e}},{key:"activate",value:function(e,t){this.searchCenter=e,t||(t="".concat(String(Math.round(100*e[1])/100),"N ").concat(String(Math.round(100*e[0])/100),"E")),this.title=t,this.showLayer();var i=ne.getInstance(),n=i.getActiveMap(),r=n.getViewPoint();r.setAnimate(!0);var a=r.getGroundPosition(),s=this.searchCenter.slice();a&&a[2]&&(s[2]=a[2]);var o=r.getPitch();(!o||o>-20)&&r.setPitch(-20),r.setGroundPosition(s),r.setDistance(2e3),r.setCameraPosition(null),n.gotoViewPoint(r),this.isActive=!0}},{key:"setDistance",value:function(e){var t=Number(/^[0-9]+/.exec(e)[0]),i=/\D+$/.exec(e);i&&"m"!==i[0]&&(t*=1e3),this.searchDistance=t,this.isActive&&this.showLayer()}},{key:"getDistance",value:function(){return this.searchDistance}},{key:"showLayer",value:function(){var e=ne.getInstance().getLayerByName(this.layerName);this.searchCenter&&(e.updateGeometryOfFeature(this.pointId,new ol.geom.Point(this.searchCenter)),e.updateGeometryOfFeature(this.circleId,ol.geom.Polygon.circular(new ol.Sphere(6378137),this.searchCenter,this.searchDistance,128)),e.activate(!0))}},{key:"hideLayer",value:function(){if(this.layerName){var e=ne.getInstance().getLayerByName(this.layerName);e.activate(!1)}}},{key:"clear",value:function(){this.hideLayer(),this.isActive=!1,this.title=null}}]),t}(Ku),$u=Xu,eh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo2RUM4Mzk3QUJERDQxMUU1QjJEN0FDNDY2NkM0MTA0RiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3Nzc1MkM2NkRCQTExMUU1QUUwQjhGQjIwQjM0ODRBNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3Nzc1MkM2NURCQTExMUU1QUUwQjhGQjIwQjM0ODRBNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2NjMwYzU0NC03NmE3LWEzNGMtOWQ0OC1jNGU5OTZkMGIxYWMiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpkYmYzYzlmNi1kYmEwLTExZTUtYjFiYi1iMWYzNDcxM2ZjNzQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4hNWn9AAAJk0lEQVR42txafWwUxxV/t3t3Pp8/LtgEG0zBJC20caJijN1CpSYEWqXBFqJNaRAUsI0cJFQI1P2DSoVgKtqmSexQsJQmjogaF5IUU1onsdoGqNQUCjU2Ul1RigOJC8R8nO2zfT77dm/7ZvXGGfbWt3t3Nm4z0mN9y87O++3vzZv33owTxr85UCQUma4S3XMIz2gkERKVrtp4KuIcR0BOEheJW7gnghRBKSQjKGESfk+bbHCyACQVxYOSQve5OARgInOcKVWQYZQQypAAWE3miyfSJAFQGl05U7LAnplpmpmkyBhnkgEcFIBGJhocNz8GJoOAeeiem1hzJfjRNAI5TGAU+nsApZ9AxmWupkpoWnR/h8MhkfLpBMxLgDwkMn928+bNs1esWDF/zpw5n8vKyvqM1+u91+l0pqKkKYoyiDIUDAZv+v3+rsuXL//72LFj7QcOHPhQGE4l8wwR0CABZECHUb+IiX6JgcOOMrHlQ8kkkCnEnA5q9erVOdu2bXusoKDgUQQzPV7aEOz1jo6O47W1tS2HDh3qFkAOEoNMAih9jEXUUbUCB2OB40ImxwDNQnkQpQjlqyhfY1JeXr6+s7Pzj5FIRNHGobH3sPex9/IxaLwiGn8W6eM06Bkfc/g1nMTOFDLFFHqxnJeX5z569OiTRUVF35EkyTXeiyWCDLe2tr65cuXKQ1evXh0hFgPEIDPRHsYq6qrEzRyZGwOSj/IQSgnKUvYlKyoqNvT29l7S7kJj47DxiMGlpMdDpJf+ocdiLparTycT4MCWsQHq6+t3hMPhQe0uNjYejvtDArhMADiL9JTi8aDME84kGy/mwBobG/eoqhrWJqGxcdn4AoPFpN9M0tdhFmEYm4u84j3kIRn1Ul1d3fzKyspdOL+cMAmNLUXoiRfj0tLR0tLSTXoqxJpqttDLJuaYRsDSyIm40ObzampqnpVl2QOT2BjAhQsXLr5+/fr7586dGxCAaUJsqpl5Swd5w2yULA6OeUVcf+p8Pt9n4/J2ff0Q/N0fIPTn0zDS3gFq9y2IBPpBykgHOfdecM8vAM/DXwbviq+DlJkRF8i+vr5LyOLT5EX7aS30o9wmb6oZwXHvOE1gTz5z5sy64uLitfGA6nvhJeh/qRG0oZA1G6keyHhqLfi2V4Hksw/y7NmzjSUlJa8Rc70E8CYt8qrRLFMIEA+tUnAhnbFp06YdFKFYtsE3fw83nqiC0IlTOBsUe1ric8Onz8HAa2+Bc0YOuAvm2eo2ffr0L3R1dZ1sb28fFAJxHo8qInMOYi2HXCtbtCWM+3bk5+cvsbEwQs+u5yHwYkPS8yrz6UqY8sz32QSzfPbKlSsnMH79CQHrodizm0w1IgseMkNgzbNu3boZGzZs2OqwsfT37q6FQN0r4+I0hk+34T8j4HlkkeWz6AfykYDj58+fHyBT5OkSYy/CFU+luXYPiRu9UUVhYeGTlqb4VjPc2viDMVJhGdK++Th4y5aB64G5IE/NAvWWH8L/vAjB5vdg8MjbqI55Ljr1lZ9D2rdLLQG2tbW9sWDBggYC1UtygwXXPIFkjOWSSTJP6cAo/Vepqak5sV6s3rwN14q+oTsRY/MsWQzZL+wC532zxp5uH3wEt7fvxjn61+gQCZ3LjL+/C/K07JjghoaGbmAWspbmnZ9M82NmmjxLdgkZtGPLli2zrYDpLvln9abA0tc/ATlNL8cEphOL/59z5Jf686Ze99l6S+ZQz2lMXyJJxCHxKpVbuAmlpaVftOPyB15vMmes9hl6tZ0qjKw/z/oZG3u/2cczNtR3vuA7RvFw5pxCQQfQA821TC5xgTauYw6XE7Kf36krHF+ZSdb7sf53OGF8PxvHqrGMX1irZV5xE8HxKhVg/DbT6oWhk6ei7nm/9Tg475+dWBkO+7H+dsYxNkFfSajzjIITq1SAE9Ryvo3840I0uOVLk1oGvKXLbI0T1c/rnSaAG622SQbE+m9WzLF6oXq1O+qe3ehirOZ+YK6tcaJYdzq9QjDiEME5Yjw8tkPpH4h231N8SYEz6282jgW40atkVgdUFCVoqUhGerQiPX3J1U1M+kvpaTbCU2VIqH2OXrlZRoTgU3x4bAeXFz0tRzDySKaZ9Zdn5toBFzTZYNEkwy5LhGqIlobufvDz0ctD85+SAmfW32wck5pnt0BSxAhOEZnz+/3/sXqh5+HowDZ45B09pEqkKZ0f6v3tjGNsgr7cAhmeiAiO77QAK3Fbul/MoFmieceiG1b0WBHUODdmMGXyV+/R+xsTWTaOVRP0VYXsICIWV/huCzQ3N7dbOhQMbNPXrIxedDEIvr1tN6uq2gOGH8K/vQaGjr8fHaPi++1k54K+YRFPrKzgdRaUxtTrBmYFCycwKzj7Dsg5Uy2zgszMzO+iU+EJa7+YFYhbR6PsXbhw4YSlx8R0JIvFkmbhGSp8rWQ53KqshuBvWyB86QpEegP6lf1m9699qdQUmB5SPfcjS2BcTwSmCawN8yoYj1QV2i7iNQh3XV3duwcPHlxllYmzhDLccRH6al+Onko4hwZ/87YucZUatlZC2qoyO2V/jenJk3gCFTLWUCQyzcRrKDufg8C+V5OvoWypgCk11XZrKCcxI9hrVUPRhGQvhcC6A4HAB2VlZcstq1+oSOqjXwEXRvahv5wBLTScUOiV/Ys9kPm9clvA2C5QdXX1j9va2hiQIDEWIGBhu3XL9cXFxWsmtm65Bnzbn4q3bvnrkpKSg7HqlnYrzi/6fL77E6o4Yz42WnHGIFivOKOj0CvOjyxKtOLcWVBQsNWq4gwmewWMvftQWOqu76Bu3LixPBwOD2j/A43pwfSBT3Zc55O+mWDYyjLOJR6C8TqEXpdgmw7Z2dn/QjNYQhv/k9LYlvL+/ft37t279yJ5xAGaa33EoBoLnBGgi36nsG2jefPmdbFtpMkAyIAdPnz4p1VVVX8j/foFJ9JLUQlYgQMhU+D1FfY7pamp6aPc3NyLhYWFiyZiH3zsCE0NNjQ01JSXl5+ijy0C66G/7e0df1r2xJM9zbC6qKho1QSdZlBaW1vfmJDTDJ/6cyifBCBxnSBa6vV6c+NlCrOQj3E9fW88TxBNyNkvVrtnJW7h7FeO0+n0sCoVq3eghFhpgJ/9YvnYvn37rM5+8QNuyZ39ihUtwZ2n9tIJ8P/PqT07cS6Yn7d0CbX6eM5bKkI+xk8lBOEun7c0Wyd5JsHNM5GTsuJ+NjfHYZikk7JmTIqMJXvGWU2EqYkCZ3xnvKfTuXmO6+n0/wowALmncfsG1yHoAAAAAElFTkSuQmCC",th=eh,ih=function(){function e(t){Object(d["a"])(this,e),this.className=t.className,this.title=t.title?t.title:null,this.description=t.description?t.description:null,this.initialized=!1}return Object(m["a"])(e,[{key:"initialize",value:function(){return!0}},{key:"isInitialized",value:function(){return this.initialized}},{key:"handleClickEvent",value:function(e){}},{key:"destroy",value:function(){this.initialized=!1}},{key:"getClassName",value:function(){return this.className}}]),e}(),nh=ih,rh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.pointWGS84=e.pointWGS84||null,i.geometry=e.geometry||null,i.balloonContent=e.balloonContent||null,i.result=e.result||{},i.layerName=e.layerName,i.icon=e.icon||th,i.clearLayerOnClick=null==e.clearLayerOnClick||e.clearLayerOnClick,i._featureId=null,i.zoomDistance="number"===typeof e.zoomDistance?e.zoomDistance:2e3,i.initialize(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.FeatureItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=ne.getInstance();if(Se(b(t.prototype),"initialize",this).call(this),!this.initialized){if(!this.pointWGS84&&!this.geometry)return console.log("you need to specify a geometry or a point"),!1;if(!this.pointWGS84){var i=(new ol.format.GeoJSON).readFeature(this.geometry);if(!i)return!1;this.pointWGS84=ol.extent.getCenter(i.getGeometry().getExtent())}var n=this.layerName&&e.getLayerByName(this.layerName)instanceof _n;if(!n)return console.log("could not find the result layer vector layer: ".concat(this.layerName)),!1;this.initialized=!0}return!0}},{key:"handleClickEvent",value:function(){if(this.initialized){var e=ne.getInstance(),t=e.getActiveMap(),i=t.getViewPoint();i.setAnimate(!0);var n=i.getGroundPosition(),r=this.pointWGS84.slice();n&&n[2]&&(r[2]=n[2]),i.setGroundPosition(r),i.setDistance(this.zoomDistance),i.setCameraPosition(null);var a=i.getPitch();(!a||a>-20)&&i.setPitch(-20);var s=e.getLayerByName(this.layerName),o=this.getFeature();this.clearLayerOnClick&&s.removeAllFeatures(),s.addFeatures([o]),s.activate(!0),t.gotoViewPoint(i);var l=Q.getInstance();l.getCurrentItem()&&l.getCurrentItem().id===o.getId()||l.setCurrentItem(o.getId(),o,s)}}},{key:"getFeature",value:function(){if(this.initialized){var e,t=ne.getInstance();if(null!=this._featureId){var i=t.getLayerByName(this.layerName),n=i.getFeatureById(this._featureId);if(n)return n}if(this.geometry){var r=new ol.format.GeoJSON;e=r.readGeometry(this.geometry)}else e=new ol.geom.Point(this.pointWGS84);var a=new ol.Feature(Object.assign({},{geometry:e},this.result));return this._featureId=Object(u["c"])(),a.setId(this._featureId),this.balloonContent&&a.set("balloonContent",this.balloonContent),a}return null}},{key:"getCoords",value:function(){return this.pointWGS84}},{key:"destroy",value:function(){if(Se(b(t.prototype),"destroy",this).call(this),null!=this._featureId){var e=ne.getInstance(),i=e.getLayerByName(this.layerName);i.removeFeaturesById([this._featureId])}this._featureId=null}}]),t}(nh),ah=rh,sh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.slug=e.slug,i.initialize(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.LayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(Se(b(t.prototype),"initialize",this).call(this),!this.initialized){if(!this.slug)return console.log("Could not find layer for LayerItem"),!1;var e=ne.getInstance().getLayerByName(this.slug);if(!e)return console.log("Could not find layer for LayerItem"),!1;this.initialized=!0}return!0}},{key:"isActive",value:function(){return ne.getInstance().getLayerByName(this.slug).isActive()}},{key:"handleClickEvent",value:function(e){if(this.initialized){var t=ne.getInstance().getLayerByName(this.slug);if(t){var i=t.isActive();t.activate(!i).then(e)}}}}]),t}(nh),oh=sh,lh=(xu={},Object(oe["a"])(xu,Iu.className,Iu),Object(oe["a"])(xu,Uu.className,Uu),Object(oe["a"])(xu,qu.className,qu),xu),ch=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.autocomplete=!!e.autocomplete,i.autocompleteRequest=e.autocompleteRequest?e.autocompleteRequest:null,i.fullAddressRequest=e.fullAddressRequest?e.fullAddressRequest:null,i.extendedSearches=e.extendedSearches?e.extendedSearches:[],i.middleware=[],i.extendedSearches.forEach(function(t){var i;"string"===typeof t?"searchTags"===t?this.middleware.push(new Qu(e)):"searchNear"===t&&this.middleware.push(new $u(e)):("vcs.vcm.widgets.search.middleware.Near"===t.type?i=new $u(t):"vcs.vcm.widgets.search.middleware.Tags"===t.type&&(i=new Qu(t)),i&&i instanceof Ku&&this.middleware.push(i))},f(i)),i.searchImplementations=[];var n=e.searchImplementations?e.searchImplementations:[];if(n)for(var r=0;r<n.length;r++){n[r].middleware=i.middleware;var a=lh[n[r].type];if(a){var s=new a(n[r]);s&&s instanceof Ou&&(s.searchWidget=f(i),i.searchImplementations.push(s))}else i.logger.warning("could not find search implementation with type ".concat(n[r].type))}return i.searchQueries=e.searchQueries?e.searchQueries:[{endpoints:[{searchImpl:"vcs.vcm.widgets.search.Nominatim"}],regex:".*"}],i.searchQueries.reverse(),i.searchResultItems=e.searchResultItems?e.searchResultItems:{address:{zoomTo:!0,pointType:!0,geomProperty:"geometry",title:"",description:"<%= obj.fulladdress %>",balloonContent:["   <div class='balloon-content'>","       <p class='balloon-text'><span class='balloon-street'> <%= obj.fulladdress %></span><br></p>","   </div>"]},point:{pointType:!0,geomProperty:"point",title:"<%= obj.display_name %>",description:"<%= obj.licence %>",balloonContent:["   <h1 class='balloon-title'><%= obj.display_name %></h1>","   <div class='balloon-content'>","       <p class='balloon-text'><%= obj.licence %></p>","   </div>"]},geojson:{zoomTo:!0,pointType:!1,geomProperty:"geojson",pointProperty:"point",title:"<%= obj.display_name %>",description:"<%= obj.licence %>",balloonContent:["   <h1 class='balloon-title'><%= obj.display_name %></h1>","   <div class='balloon-content'>","       <p class='balloon-text'><%= obj.licence %></p>","   </div>"]}},Object.values(i.searchResultItems).forEach(function(e){Object.keys(e).forEach(function(t){if(["title","description","balloonContent"].indexOf(t)>-1){var i=e[t],n=Array.isArray(i)?i.join("\n"):i;e[t]=Dr()(n)}})}),i.resultIcon=e.resultIcon||th,i.currentResults=[],i.justSearched=!1,i.resultLayer=new _n({projection:{epsg:4326},name:"_searchResultVector",zCoordinateEyeOffset:-100,heightAboveGround:10,altitudeMode:"clampToGround"}),i.showAllResults=!!e.showAllResults,i.showSearchResultToolbar=!!e.showSearchResultToolbar,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Search"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.searchImplementations.forEach(function(e){e.initialize()}),this.middleware.forEach(function(e){e.initialize()}),this.framework.addLayer(this.resultLayer),this.resultLayer.setStyle(new ol.style.Style({image:new ol.style.Icon({src:this.resultIcon,scale:.5}),fill:new ol.style.Fill({color:"rgba(168,192,43,0.6)"}),stroke:new ol.style.Stroke({color:"#a8c02b",width:1.25})})),this.resultLayer.setHighlightStyle(new ol.style.Style({image:new ol.style.Icon({src:this.resultIcon,scale:.8}),fill:new ol.style.Fill({color:"rgba(168, 192, 43, 1)"}),stroke:new ol.style.Stroke({color:"#a8c02b",width:2})})),this.initialized=!0;var i=this.framework.getWidgetByType("vcs.vcm.widgets.BalloonInfo");i&&!i.hasTypeForLayerName("_searchResultVector")&&i.addTypeForLayer("_searchResultVector",["<div class='balloon' id='myBalloon'>","    <%= balloonContent %>","   <div class='balloon-close-col'>","       <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>","   </div>","   <div class='dialog-image-balloon'></div>","   <div class='balloon-left-edge'></div>","</div>"],"balloonHeight + 30","70"),this.initializedFinished()}}},{key:"search",value:function(e){var t=this;return this.clearSearch(),new Promise(function(i){var n=t._handleSearchResults.bind(t,i);t._handleSearch(e,n)})}},{key:"_handleSearch",value:function(e,t,i){var n;if(this.runningRequest&&this.runningRequest.cancel(),this.justSearched=!0,Number.isFinite(i)){if(!(i<this.searchQueries.length-1))return void t([]);n=this.searchQueries.slice(i+1).findIndex(function(t){var i=new RegExp(t.regex);return i.test(e)}),n=n+i+1}else n=this.searchQueries.findIndex(function(t){var i=new RegExp(t.regex);return i.test(e)});var r=this.searchQueries[n],a=this.searchImplementations.filter(function(e){var t=r.endpoints.findIndex(function(t){return t.searchImpl===e.className});return t>-1});if(0!==a.length){var s=this.searchCascade.bind(this,e,r.cascade,n,t);a.forEach(function(t){t.search(e,r,s)})}else t([])}},{key:"searchCascade",value:function(e,t,i,n,r){0===r.length&&t?this._handleSearch(e,n,i):n(r)}},{key:"_handleSearchResults",value:function(e,t){var i=this._getResultItems(t),n=i.map(function(e){return!!(e.isInitialized()&&(this.currentResults.push(e),this.showAllResults&&e instanceof ah))&&e.getFeature()},this).filter(function(e){return e});this.showAllResults&&(this.resultLayer.addFeatures(n),this.resultLayer.activate(!0)),e()}},{key:"_getResultItems",value:function(e){var t;if(0===e.length)return[];var i=[];return e.forEach(function(e){var n,r=this.searchResultItems[e.type];if(!r&&!t)throw new Error("Got undefined result type");if(t)n=e;else if(r.geomProperty){var a,s;if(r.pointType)s=e[r.geomProperty],a=!1;else{a=e[r.geomProperty];var o=new ol.format.GeoJSON,l=o.readGeometry(a);s=r.pointProperty&&e[r.pointProperty]?e[r.pointProperty]:ol.extent.getCenter(l.getExtent())}r.geomProperty&&e[r.geomProperty]&&delete e[r.geomProperty],r.pointProperty&&e[r.pointProperty]&&delete e[r.pointProperty],e.zoomTo=r.zoomTo,n=new ah({geometry:a,result:e,balloonContent:r.balloonContent(e),title:r.title(e),pointWGS84:s,description:r.description(e),layerName:"_searchResultVector",clearLayerOnClick:!this.showAllResults,icon:this.resultIcon,zoomDistance:r.zoomTo})}else"layer"===e.type&&(n=new oh({slug:e.slug,title:r.title(e),description:r.description(e)}));i.push(n)},this),i}},{key:"clearSearch",value:function(){this.runningRequest&&this.runningRequest.cancel(),this.resultLayer.removeAllFeatures(),this.currentResults.splice(0,this.currentResults.length),this.resultLayer.activate(!1)}},{key:"getAutocomplete",value:function(e,t){var i=this,n=JSON.parse(JSON.stringify(this.autocompleteRequest)),r=new RegExp(/\b[0-9]+/g),a=new RegExp(/\b[0-9]{5}\b/);if(r.test(e)&&null!==this.fullAddressRequest){var s=e.match(r);1===s.length&&a.test(e)||(n.query=Object.assign(n.query,this.fullAddressRequest))}var o=Dr()(JSON.stringify(n.query));this.runningRequest&&this.runningRequest.cancel();var l=q.getInstance().getLocaleAwareString(n.endPoint);return this.runningRequest=ce.a.CancelToken.source(),new Promise(function(n,r){ce.a.post(l,o({query:e}),{cancelToken:i.runningRequest.token}).then(function(e){var r=e.data;r=r.suggest||r;var a=[];if(i.justSearched)return t&&(n(a),t(a)),void(i.justSearched=!1);r.fullAddressSuggest&&r.fullAddressSuggest[0].options.length>0&&r.fullAddressSuggest[0].options.forEach(function(e){a.push(e.text)}),0===a.length&&r.nameSuggest[0].options.length>0&&r.nameSuggest[0].options.forEach(function(e){a.push(e.text)}),a=a.filter(function(e,t,i){return i.indexOf(e)===t}),t&&t(a),n(a)}).catch(function(e){t&&t([]),n([])}).then(function(){i.runningRequest=null})})}},{key:"getResultLayer",value:function(){return this.resultLayer}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.autocomplete=this.autocomplete,e.autocompleteRequest=this.autocompleteRequest,e.resultIcon=this.resultIcon!==th?this.resultIcon:null,e.searchImplementations=[],e.extendedSearches=this.extendedSearches,e.showSearchResultToolbar=this.showSearchResultToolbar,e.searchImplementations.push(new Iu({}).getConfigObject()),e}}]),t}(ra),uh=ch,hh=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.cb=i,n.scratchLayer=e,n._defaultActive=me.CLICK,n.coordinates=[],n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!e.position.every(function(e){return 0===e})){var t=e.position.slice();e.feature||2===this.coordinates.length||(t[2]+=1.6),this.coordinates.push(t),2===this.coordinates.length?(this.scratchLayer.addFeatures([new ol.Feature({geometry:new ol.geom.Point(t)}),new ol.Feature({geometry:new ol.geom.LineString(this.coordinates)})]),this.setActive(!1),this.cb(this.coordinates)):this.scratchLayer.addFeatures([new ol.Feature({geometry:new ol.geom.Point(t)})])}return Promise.resolve(e)}}]),t}(pe),dh=hh,mh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.navigationControls=null,i.color=e.color||"#A8C02B",i.featureLayer=new _n({projection:{epsg:3857},name:"_advancedWalkMode",altitudeMode:"none"}),i.supportedMaps=["vcs.vcm.maps.Cesium"],i._removeInteraction=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.AdvancedWalkMode"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished();var i=new ol.style.Fill({color:this.color}),n=new ol.style.Stroke({color:this.color,width:2});this.featureLayer.setStyle(new ol.style.Style({image:new ol.style.Circle({fill:i,stroke:n,radius:5}),fill:i,stroke:n}))}return!0}},{key:"isSupported",value:function(e){return!(!this.navigationControls&&this.framework.isInitialized()&&(this.navigationControls=this.framework.getWidgetByType("vcs.vcm.widgets.NavigationControls"),!this.navigationControls))&&Se(b(t.prototype),"isSupported",this).call(this,e)}},{key:"activate",value:function(){this.featureLayer.activate(!0),this.navigationControls.navigationMode.values.walkmode&&this.navigationControls.navigationMode.activateOverviewMode(),this.active&&this.deactivate();var e=new dh(this.featureLayer,this.calculateViewPoint.bind(this));this._removeInteraction=xn().addExclusiveInteraction(e,this.deactivate.bind(this)),Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){this._removeInteraction&&this._removeInteraction(),this.featureLayer.getSource().clear(),this.featureLayer.activate(!1),Se(b(t.prototype),"deactivate",this).call(this)}},{key:"calculateViewPoint",value:function(e){var t,i,n,r,a=e.map(function(e){return R.mercatorToWgs84(e)}),s=Object(Ie["a"])(a,2),o=s[0],l=s[1],c={};o[2]>l[2]?(c=o.slice(),c[2]=l[2]):(c=l.slice(),c[2]=o[2]),Au=(t=Cesium.Cartesian3).fromDegrees.apply(t,Object(T["a"])(o).concat([Cesium.Ellipsoid.WGS84,Au])),Fu=(i=Cesium.Cartesian3).fromDegrees.apply(i,Object(T["a"])(l).concat([Cesium.Ellipsoid.WGS84,Fu])),Nu=(n=Cesium.Cartesian3).fromDegrees.apply(n,Object(T["a"])(c).concat([Cesium.Ellipsoid.WGS84,Nu])),Fu=Cesium.Cartesian3.subtract(Fu,Au,new Cesium.Cartesian3),Nu=Cesium.Cartesian3.subtract(Nu,Au,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(Fu,Fu),Cesium.Cartesian3.normalize(Nu,Nu),r=o[2]>l[2]?Cesium.Math.toDegrees(Math.acos(Cesium.Cartesian3.dot(Fu,Nu)))-90:Cesium.Math.toDegrees(Math.acos(Cesium.Cartesian3.dot(Fu,Nu)));var u={groundPosition:o,distance:0,animate:!0,heading:Wt(o,l),pitch:r},h=new V(u);this.navigationControls.navigationMode.activateFirstPersonMode(h,null,null,null,!0),setTimeout(this.deactivate.bind(this),1e3)}}]),t}(ra),fh=mh,yh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),e.balloonTypes||(e.balloonTypes=[{template:["<div class='balloon' id='myBalloon'>","   <h1 class='balloon-title'><%= obj.title %></h1>","   <div class='balloon-content'>","       <%= obj.description %>","   </div>","   <div class='balloon-close-col'>","       <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>","   </div>","   <div class='dialog-image-balloon'></div>","   <div class='balloon-left-edge'></div>","</div>"],minTop:"balloonHeight + 70",minLeft:"70",layerTypes:["vcs.vcm.layer.Vector"],layerNames:[]}]),i.balloonTypes=[],i.layerNamesToBalloonTypes={},i.layerTypesToBalloonTypes={},e.balloonTypes.forEach(function(e,t){var i=e.template;"string"!==typeof e.template&&(i=e.template.join("\n")),this.balloonTypes.push({template:i,minTop:e.minTop?e.minTop:0,minLeft:e.minLeft?e.minLeft:0,layerNames:e.layerNames?e.layerNames:[],layerTypes:e.layerTypes?e.layerTypes:[]}),e.layerTypes&&e.layerTypes.forEach(function(e){this.layerTypesToBalloonTypes[e]=t},this),e.layerNames&&e.layerNames.forEach(function(e){this.layerNamesToBalloonTypes[e]=t},this)},f(i)),i.balloon=null,i.excludedLayerNames=e.excludedLayerNames||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.BalloonInfo"}}]),Object(m["a"])(t,[{key:"createBalloonForGenericFeature",value:function(e){this.clearBalloon();var t,i=e.layerName,n=e.layerClass;if(!this.excludedLayerNames.includes(i)){if(null!=this.layerNamesToBalloonTypes[i])t=this.balloonTypes[this.layerNamesToBalloonTypes[i]];else{if(null==this.layerTypesToBalloonTypes[n])return;t=this.balloonTypes[this.layerTypesToBalloonTypes[n]]}var r,a=e.attributes||e,s={};Object.keys(a).forEach(function(e){/^olcs_/.test(e)||(s[e]=a[e])});try{r=Dr()(t.template)(s)}catch(l){return void this.logger.warning("Could not render the template for layer: ".concat(i,". Please verify that the balloon template is correct"))}var o=Object.assign(e,{balloonWidget:this,minTop:t.minTop,minLeft:t.minLeft,balloonContent:r});this.balloon=new Do(o),this.balloon.initialize()}}},{key:"clearBalloon",value:function(){this.balloon&&(this.balloon.close(),this.balloon=null)}},{key:"hasTypeForLayerName",value:function(e){return o(e,String),null!=this.layerNamesToBalloonTypes[e]}},{key:"addTypeForLayer",value:function(e,t,i,n){Array.isArray(t)&&(t=t.join("")),o(e,String),o(t,String),l(n,String),l(i,String);var r={layerTypes:[],layerNames:[e],template:t,minTop:i||"balloonHeight + 30",minLeft:n||"70"},a=this.balloonTypes.length;this.balloonTypes.push(r),this.layerNamesToBalloonTypes[e]=a}},{key:"getLink",value:function(e){this.balloon&&this.balloon.getLink(e)}},{key:"dispose",value:function(){this.clearBalloon()}},{key:"getBalloon",value:function(){return this.balloon}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.balloonTypes=this.balloonTypes,e.balloonTypes.forEach(function(e){e.template&&(e.template=e.template.split("\n"))}),e.excludedLayerNames=this.excludedLayerNames,e}}]),t}(ra),gh=yh,vh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.data={},i.headerLogoBox=e.headerLogoBox||null,Array.isArray(i.headerLogoBox)&&(i.headerLogoBox=i.headerLogoBox.join("\n")),i.headerTitle=e.headerTitle||null,Array.isArray(i.headerTitle)&&(i.headerTitle=i.headerTitle.join("\n")),i.footerLogoBox=e.footerLogoBox||null,Array.isArray(i.footerLogoBox)&&(i.footerLogoBox=i.footerLogoBox.join("\n")),i.showOverflow=!!e.showOverflow,i.layerItems=[],i.uiOptions={headerLogoBox:i.headerLogoBox,headerTitle:i.headerTitle,footerLogoBox:i.footerLogoBox},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Copyright"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.updateLayers(),this.framework.subscribe(B.MAP_ACTIVATED,this.updateLayers.bind(this)),this.framework.subscribe(B.LAYER_CHANGED,this.layerChanged.bind(this)),this.initialized=!0,this.initializedFinished()}}},{key:"updateLayers",value:function(){var e=this.framework.getLayers(),t=this.framework.getActiveMap();t&&(this.layerItems.splice(0),e.forEach(function(e){if(e.isSupported(t)&&e.isActive()){var i=this.createLayerItem(e);i&&this.layerItems.push(i)}},this))}},{key:"layerChanged",value:function(e){var t=this.layerItems.findIndex(function(t){return t.layerName===e.name});if(e.isActive()){if(-1===t){var i=this.createLayerItem(e);i&&this.layerItems.push(i)}}else t>-1&&this.layerItems.splice(t,1)}},{key:"createLayerItem",value:function(e){var t=e.options.copyright;if(t&&t.provider&&""!==t.provider){t.layerName=e.name;var i="";return e.options.category&&(i+="".concat(e.options.category," - ")),e.options.title?i+=e.options.title:i+=e.name,t.title=i,t}return null}},{key:"handleURLParameter",value:function(e){var t=e.headerTitle;null!=t&&(this.uiOptions.headerTitle=t)}},{key:"getLink",value:function(e){this.headerTitle!==this.uiOptions.headerTitle&&e.addQueryParams({headerTitle:this.uiOptions.headerTitle})}}]),t}(ra),ph=vh,_h=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.CreateLink"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.initializedFinished()}}}]),t}(ra),bh=_h,Lh={AMBIENT_OCCLUSION:"ambientOcclusion",BLOOM:"bloom",BLACK_AND_WHITE:"blackAndWhite",BLUR:"blur",BRIGHTNESS:"brightness",DEPTH_OF_FIELD:"depthOfField",EDGE_DETECTION:"edgeDetection",LENS_FLARE:"lensFlare",NIGHT_VISION:"nightVision",SILHOUTTE:"silhouette"},Mh=function(){function e(t,i){var n=this;Object(d["a"])(this,e),this._enabled=t.enabled,this.uniforms={},Object.keys(i).forEach(function(e){"color"===i[e].type?Object.defineProperty(n.uniforms,e,{get:function(){var i=t.uniforms[e].toBytes();return i[3]/=255,i},set:function(i){t.uniforms[e]=Cesium.Color.fromBytes(i[0],i[1],i[2],255*i[3],t.uniforms[e])}}):n.uniforms[e]=t.uniforms[e]}),this.uniformTypes=i,this.update=this._update.bind(this,t),this.setEnabled=this._setEnabled.bind(this,t)}return Object(m["a"])(e,[{key:"_setEnabled",value:function(e){e.enabled=this._enabled}},{key:"_update",value:function(e){var t=this;Object.keys(this.uniforms).forEach(function(i){e.uniforms[i]=t.uniforms[i]})}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this.setEnabled()}}],[{key:"isSupported",value:function(e){return!0}}]),e}(),kh=Mh,wh=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e,{intensity:{type:"number"},bias:{type:"number"},lengthCap:{type:"number"},stepSize:{type:"number",step:.2},frustumLength:{type:"number",step:10},ambientOcclusionOnly:{type:"boolean"}})),i.uniforms.lengthCap=3,i.update(),i}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.AMBIENT_OCCLUSION}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(e)}}]),t}(kh),Th=wh,Sh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{contrast:{type:"number",step:2},brightness:{type:"number"},delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"},glowOnly:{type:"boolean"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLOOM}}]),t}(kh),Oh=Sh,Ch=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{gradations:{type:"number",step:1}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLACK_AND_WHITE}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBlackAndWhiteStage()}}]),t}(kh),Eh=Ch,Ih=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLUR}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBlurStage()}}]),t}(kh),Dh=Ih,jh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{brightness:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BRIGHTNESS}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBrightnessStage()}}]),t}(kh),Ph=jh,Yh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{focalDistance:{type:"number",step:1},delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.DEPTH_OF_FIELD}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(e)}},{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createDepthOfFieldStage()}}]),t}(kh),xh=Yh,Ah=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{intensity:{type:"number"},distortion:{type:"number",step:1},ghostDispersal:{type:"number"},haloWidth:{type:"number"},earthRadius:{type:"number",step:1e3}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.LENS_FLARE}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createLensFlarStage()}}]),t}(kh),Fh=Ah,Nh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.NIGHT_VISION}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createNightVisionStage()}}]),t}(kh),Hh=Nh,Rh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{color:{type:"color"},length:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.SILHOUTTE}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isSilhouetteSupported(e)}},{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createSilhouetteStage()}}]),t}(kh),zh=Rh,Gh=(Hu={},Object(oe["a"])(Hu,Th.type,Th),Object(oe["a"])(Hu,Oh.type,Oh),Object(oe["a"])(Hu,Eh.type,Eh),Object(oe["a"])(Hu,Dh.type,Dh),Object(oe["a"])(Hu,Ph.type,Ph),Object(oe["a"])(Hu,xh.type,xh),Object(oe["a"])(Hu,Fh.type,Fh),Object(oe["a"])(Hu,Hh.type,Hh),Object(oe["a"])(Hu,zh.type,zh),Hu),Vh=Y.getLogger("vcs.vcm.widets.DisplayQuality"),Bh=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.defaultQualityLevel=e.defaultQualityLevel||"medium",i.defaultMobileQualityLevel=e.defaultMobileQualityLevel||"low",i.viewModel=null;var n={},r=e.low||{};n.low=t.createViewModel({sse:4,fxaa:!1,fog:{enabled:!0,density:9e-4,screenSpaceErrorFactor:6},resolutionScale:.9,layerSSEFactor:2},r);var a=e.medium||{};n.medium=t.createViewModel({sse:2.333,fxaa:!1,fog:{enabled:!0,density:5e-4,screenSpaceErrorFactor:4},resolutionScale:1,layerSSEFactor:1.1},a);var s=e.high||{};n.high=t.createViewModel({sse:4/3,fxaa:!0,fog:{enabled:!1,density:0,screenSpaceErrorFactor:0},resolutionScale:1,layerSSEFactor:.5},s),i.viewModelSettings=n,i.showAdvancedSettings=e.showAdvancedSettings||!1,i.sseLayerTypes=["vcs.vcm.layer.cesium.AbstractCesiumTilesetLayer","vcs.vcm.layer.TiledLayer","vcs.vcm.layer.FeatureStore"],i.supportedMaps=["vcs.vcm.maps.Cesium"],i.cesiumMap=null,i.layers=[],i.activePreset={preset:null},i.postProcessStages={};var o=e.allowedPostRenderStages||[Th.type,Oh.type,Eh.type,Dh.type,Ph.type,xh.type,Hh.type,zh.type];return o.forEach(function(e){i.postProcessStages[e]=null}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.DisplayQuality"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;this.cesiumMap=this.framework.getMapByType("vcs.vcm.maps.Cesium");var n=this.cesiumMap.getScene(),r=n.postProcessStages;Object.keys(this.postProcessStages).forEach(function(t){Gh[t]&&Gh[t].isSupported(e.cesiumMap.getScene())?r[t]&&(e.postProcessStages[t]=new Gh[t](r[t])):delete e.postProcessStages[t]}),this.viewModel={sse:n.globe.maximumScreenSpaceError,fxaa:r.fxaa.enabled,fog:n.fog,resolutionScale:1},this.initializeLayers(),this.framework.subscribe(B.LAYER_ACTIVATED,this.layerActivated,this),this.framework.isMobile()?this.setPreset(this.defaultMobileQualityLevel):this.setPreset(this.defaultQualityLevel),this.initialized=!0,this.initializedFinished()}return!0}},{key:"addPostProcessingStage",value:function(e){this.postProcessStages[e]&&Vh.warning("trying to add existing stage");var t=Gh[e],i=this.cesiumMap.getScene();if(t&&t.isSupported(i)){var n=t.createStage();i.postProcessStages.add(n),this.postProcessStages[e]=new t(n)}else Vh.error("could not find ".concat(e," or ").concat(e," is not supported"))}},{key:"initializeLayers",value:function(){var e=this;this.framework.getLayers().filter(function(e){return e instanceof Hn||e instanceof Er||e instanceof ta}).forEach(function(t){var i=e.framework.isMobile()?t.screenSpaceErrorMobile:t.screenSpaceError;e.layers.push({layerName:t.name,sse:i,defaultSse:i})})}},{key:"layerActivated",value:function(e){var t=this.layers.find(function(t){return t.layerName===e.name});t&&this.setLayerQuality(e.name)}},{key:"setQuality",value:function(e){if(l(e,Boolean),e||(this.activePreset.preset=null),this.cesiumMap.isInitialized()&&this.viewModel){var t=this.cesiumMap.getViewer();t.scene.globe.maximumScreenSpaceError=this.viewModel.sse,t.scene.postProcessStages.fxaa.enabled=this.viewModel.fxaa,t.resolutionScale=this.viewModel.resolutionScale,t.scene.fog.enabled=this.viewModel.fog.enabled,t.scene.fog.density=this.viewModel.fog.density,t.scene.fog.screenSpaceErrorFactor=this.viewModel.fog.screenSpaceErrorFactor}}},{key:"setPreset",value:function(e){var t=this;o(e,["high","medium","low"]),this.activePreset.preset=e;var i={};"high"===e?Object.assign(i,this.viewModelSettings.high):"medium"===e?Object.assign(i,this.viewModelSettings.medium):Object.assign(i,this.viewModelSettings.low),Object.assign(this.viewModel,i),this.layers.forEach(function(e){e.sse=e.defaultSse*i.layerSSEFactor,t.setLayerQuality(e.layerName)}),this.setQuality(!0)}},{key:"setLayerQuality",value:function(e){o(e,String);var t=this.framework.getLayerByName(e);if(t&&t.isActive()){var i=this.layers.find(function(t){return t.layerName===e});i&&t.setMaximumScreenSpaceError(i.sse)}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.low=this.viewModelSettings.low,e.medium=this.viewModelSettings.medium,e.high=this.viewModelSettings.high,e.defaultQualityLevel=this.defaultQualityLevel,e.showAdvancedSettings=this.showAdvancedSettings,e.allowedPostRenderStages=this.options.allowedPostRenderStages||[Th.type,Oh.type,Eh.type,Dh.type,Ph.type,xh.type,Hh.type,zh.type],e}}],[{key:"createViewModel",value:function(e,t){var i=new Cesium.Fog,n=Object.assign(e.fog,"object"===Object(s["a"])(t.fog)?t.fog:{});i.enabled=!!n.enabled,i.density=Number(n.density),i.screenSpaceErrorFactor=Number(n.screenSpaceErrorFactor);var r=Object.assign(e,t);return{sse:Number(r.sse),fxaa:!!r.fxaa,fog:i,resolutionScale:Number(r.resolutionScale),layerSSEFactor:Number(r.layerSSEFactor)}}}]),t}(ra),Uh=Bh,Wh=new gt({image:{fill:{color:[255,255,255,.4]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:"#3399CC",width:2},fill:{color:[255,255,255,.4]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),qh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers","vcs.vcm.maps.Oblique"],i.allowedGeometries=e.allowedGeometries||["Point","LineString","Polygon","BBox","Circle","Rectangle","Label"],i.allowEditMode=Object(u["e"])(e.allowEditMode,!0),i.allowSelectMode=Object(u["e"])(e.allowSelectMode,!0),i.defaultMode=null!=rn[e.defaultMode]?e.defaultMode:"create",i.editorOptions={hideAltitudeMode:Object(u["e"])(e.hideAltitudeMode,!1),simpleStyleUi:Object(u["e"])(e.simpleStyleUi,!1),hideExport:Object(u["e"])(e.hideExport,!1),hideHelp:Object(u["e"])(e.hideHelp,!1),showFeatureEditorUiInEditMode:!i.allowSelectMode&&i.allowEditMode},("select"===i.defaultMode&&!i.allowSelectMode||"edit"===i.defaultMode&&!i.allowEditMode)&&(i.defaultMode="create"),i.editingLayer=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Drawing"}}]),Object(m["a"])(t,[{key:"activate",value:function(){Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.layerEditor.deactivate()}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0;var i=Wh.clone();this.options.style&&i.assign(new gt(this.options.style)),this.editingLayer=new _n({altitudeMode:"clampToGround",projection:R.createMercatorProjection(),style:i,isDynamic:!0}),this.framework.addLayer(this.editingLayer),this.editingLayer.activate(!0),this.layerEditor=new kl({geometryLayerEditor:{allowEditMode:this.allowEditMode,defaultMode:this.defaultMode,allowedGeometries:this.allowedGeometries},featureLayerEditor:{allowSelectMode:this.allowSelectMode},styleLayerEditor:{}}),this.layerEditor.initialize(),this.layerEditor.addEditingLayer(this.editingLayer),this.initializedFinished()}return!0}},{key:"getConfigObject",value:function(){var e=Wh.clone();return this.options.style&&e.assign(new gt(this.options.style)),{allowedGeometries:this.allowedGeometries,allowSelectMode:this.allowSelectMode,allowEditMode:this.allowEditMode,defaultMode:this.defaultMode,simpleStyleUi:this.editorOptions.simpleStyleUi,hideHelp:this.editorOptions.hideHelp,hideExport:this.editorOptions.hideExport,hideAltitudeMode:this.editorOptions.hideAltitudeMode,style:e.getOptions()}}}]),t}(ra),Jh=qh,Kh=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.showFreeFormCrsInput=Object(u["e"])(e.showFreeFormCrsInput,!1),i.dataProjection=e.dataProjection?new R(e.dataProjection):i.framework.projection;var n=i.dataProjection?i.dataProjection.epsg:"";i.coordinateSystem=e.coordinateSystem||n,i.heightMode=e.heightMode||"absolute",i.formatOptions=e.formats||["2D Shape","3D Shape - PolygonZ","3D Shape - Multipatch","CityGML","KMZ","DXF","DWG","3DS","ESRI FGDB","SketchUp","OBJ","3DPDF","VRML","FMEAR"],i.formatsWithTextures=["CityGML","3DS","SketchUp","OBJ","3DPDF","VRML","FMEAR"],i.lodOptions=e.lod||["LoD1","LoD2","LoD3","LoD4","haLoD"],i.citygmlclassesOptions=e.citygmlclasses||["26","7","16","5","21","85","64","45","43","46","8","9","4"],i.appearanceThemesOptions=e.appearanceThemes||["rgbTexture"],i.maxArea=Object(u["h"])(e.maxarea,2e6),i.useTokenSecurity=null==e.useTokenSecurity||e.useTokenSecurity,i.serverUrl=e.serverUrl||"http://fmeserver/fmedatadownload/Repository/workbench.fmw",i.securityToken=e.securityToken&&""!==e.securityToken?e.securityToken:null,i.tokenUrl=e.tokenUrl||"http://fmeserver/fmetoken/service/generate.json",i.token=null,i.fmeuser=e.fmeuser?e.fmeuser:"publicuser",i.fmepassword=e.fmepassword?e.fmepassword:"publicuser";var r=vt.clone();return e.style&&r.assign(new gt(e.style)),i._layerOptions={projection:R.createMercatorProjection(),name:"_exportLayer",classificationType:e.classificationType||"both",altitudeMode:"clampToGround",style:r},i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.singleFeatureId=Object(u["c"])(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Export"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;this.geometryLayer=new _n(this._layerOptions),this.framework.addLayer(this.geometryLayer),this.layerEditor=new hl({allowedGeometries:["Polygon","BBox"],defaultMode:"edit"}),this.layerEditor.initialize(),this.layerEditor.addEditingLayer(this.geometryLayer),this.fmeAuthenticate().then(function(t){var i=t.data;if(i)try{e.token=i.serviceResponse.token}catch(n){return Promise.reject(n)}return e.initialized=!0,e.initializedFinished(),Promise.resolve()}).catch(function(t){e.logger.warning("Could not authentificate FME : ".concat(t))})}return!0}},{key:"fmeAuthenticate",value:function(){if(this.useTokenSecurity&&null==this.securityToken){this.logger.deprecate("user/password","Use a security token. Future versions of the vcMAP may no longer support this.");var e="".concat(this.tokenUrl,"?user=").concat(this.fmeuser,"&password=").concat(this.fmepassword,"&expiration=1&timeunit=day");return ce.a.get(e)}return null!=this.securityToken?(this.token=this.securityToken,Promise.resolve()):Promise.reject(new Error("Missing security token"))}},{key:"prepareRequestAndSend",value:function(e,t,i){if(this.useTokenSecurity&&!this.token&&!i)throw new Error("i18n_export_authentification_error");if(!e.cityGmlClasses||0===e.cityGmlClasses.length)throw new Error("i18n_export_themclass_error");var n={COORD_SYS:e.crs||(Array.isArray(this.coordinateSystem)?this.coordinateSystem[0]:this.coordinateSystem),HEIGHT_MODE:this.heightMode,TOKEN:i||this.token,OPT_SERVICEMODE:"async"};if(n.EXPORT_FORMAT=e.format,n.THEM_CLASS=e.cityGmlClasses.map(function(e){return e.value}),n.TEXTURE=e.texture?"Yes":"No",n.APP_THEME=e.appearance||"none",n.LOD_SELECTION=e.level,e.useFeatureGeometry){n.SELECTION="Polygon";var r=this.geometryLayer.getFeatureById(this.singleFeatureId);if(!r)throw new Error("i18n_export_geometry_error");var a=r.getGeometry();if(!a||"Polygon"!==a.getType())throw new Error("i18n_export_geometry_error");if(null!=this.maxArea){var s=a.getArea();if(s>this.maxArea)throw new Error("i18n_export_maxArea_error")}a=a.clone(),a.transform(R.createMercatorProjection().proj,this.dataProjection.proj);var o=a.getCoordinates()[0];n.POLYGON=o.map(function(e){var t=Object(Ie["a"])(e,2),i=t[0],n=t[1];return"".concat(i,",").concat(n)}).join(";")}else{var l=this.framework.getSelectBehavior();if(l.getSizeOfSelectionSet()<=0)throw new Error("i18n_export_feature_error");n.SELECTION="Einzelobjekte",n.GMLID=l.getSelectionSet()}if(!Object(u["d"])(e.email))throw new Error("i18n_export_email_error");n.OPT_REQUESTEREMAIL=e.email;var c=Object.keys(n).map(function(e){return"".concat(e,"=").concat(encodeURIComponent(n[e]))}).join("&"),h=t||this.serverUrl;return ce.a.post(h,c,{headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}})}},{key:"getFormatOptions",value:function(){return this.logger.deprecate("getFormatOptions","use .formatOptions instead"),this.formatOptions}},{key:"getLodOptions",value:function(){return this.logger.deprecate("getFormatOptions","use .lodOptions instead"),this.lodOptions}},{key:"getCitygmlClassOptions",value:function(){var e={26:"Building",7:"SolitaryVegetationObjects",5:"GenericCityObject",21:"CityFurniture",16:"ReliefFeature",85:"Tunnel",64:"Bridge",45:"Road",43:"Track",46:"Square",8:"Plant Cover",9:"WaterBody",4:"LandUse"},t={85:!0,64:!0,45:!0,43:!0,46:!0,8:!0,9:!0,4:!0};return this.citygmlclassesOptions.map(function(i){return{value:i,title:e[i],citygmlOnly:t[i]}})}},{key:"getTexturedFormats",value:function(){return this.logger.deprecate("getFormatOptions","use .formatsWithTextures instead"),this.formatsWithTextures}},{key:"getAppearanceThemes",value:function(){return this.logger.deprecate("getFormatOptions","use .appearanceThemesOptions instead"),this.appearanceThemesOptions}},{key:"deactivate",value:function(){this.active&&(Se(b(t.prototype),"deactivate",this).call(this),this.framework.getSelectBehavior().deactivateClickBehavior())}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.formats=this.formatOptions,e.coordinateSystem=this.coordinateSystem,e.heightMode=this.heightMode,e.lod=this.lodOptions,e.citygmlclasses=this.citygmlclassesOptions,e.appearanceThemes=this.appearanceThemesOptions,e.maxarea=this.maxArea,e.useTokenSecurity=this.useTokenSecurity,e.serverUrl=this.serverUrl,e.tokenUrl=this.tokenUrl,e.fmeuser=this.fmeuser,e.fmepassword=this.fmepassword,e.serverUrl=this.serverUrl,e}}]),t}(ra),Zh=Kh,Qh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layers=new Set,i._setLayers(e.layerTypes,e.layers,e.excludedLayers),i.headerTemplate=e.headerTemplate?i._makeHeaderTemplate(e.headerTemplate):null,i.itemTemplate=e.itemTemplate||null,i.itemTemplate||(i.itemTemplate=["<div class='ui-listview-list-column-2 ui-listview-list-data-cell'>","<span class='ui-listview-list-data-cell-value'><%= data.feature.properties.name %>","<% if(data.feature.properties.website){ %>","<br><a href='<%= data.feature.properties.website %>' target='_blank'><%= data.feature.properties.website %></a>","<% } %>","</span>","</div>","<div class='ui-listview-list-column-3 ui-listview-list-data-cell'>","<span class='ui-listview-list-data-cell-value'><%= data.feature.properties.street %><br><%= data.feature.properties.zip %> <%= data.feature.properties.city %></span>","</div>"]),Array.isArray(i.itemTemplate)&&(i.itemTemplate=i.itemTemplate.join("")),i.layerTemplateMap={},Array.isArray(e.layerTemplates)&&e.layerTemplates.forEach(i._setLayerTemplates,f(i)),i.queryProperties=e.queryProperties||["name"],i.values={currentHeader:i.headerTemplate,query:!0},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.FeatureList"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;var i=function e(t){t.children?t.children.forEach(e,this):this.layers.has(t.layerName)&&(t.hasFeatureListView=!0)},n=this.framework.getWidgetsByType(Fa.className)[0];n&&n.cluster.forEach(i,this),this.initialized=!0,this.initializedFinished()}}},{key:"_setLayers",value:function(e,t,i){e&&this.framework.getLayers().filter(function(t){return e.includes(t.className)&&!/^_/.test(t.name)}).forEach(function(e){this.layers.add(e.name)},this),t&&t.forEach(function(e){this.layers.add(e)},this),i&&i.forEach(function(e){this.layers.delete(e)},this)}},{key:"_setLayerTemplates",value:function(e){var t=e.layers,i=e.itemTemplate,n=e.headerTemplate;i=Array.isArray(i)?i.join(""):i;var r={item:i,header:n?this._makeHeaderTemplate(n):this.headerTemplate,queryProperties:e.queryProperties||this.queryProperties};t.filter(function(e){return this.layers.has(e)},this).forEach(function(e){this.layerTemplateMap[e]=r},this)}},{key:"_makeHeaderTemplate",value:function(e){return Array.isArray(e)?e.join(""):("object"===Object(s["a"])(e)&&(e=e,Object.keys(e).forEach(function(t){e[t]=Array.isArray(e[t])?e[t].join(""):e[t]})),e)}},{key:"getItems",value:function(e){if(!this.layers.has(e))return this.logger.warning("Could not render listview for layer ".concat(e,". Please check your configuration.")),null;var t=this.framework.getLayerByName(e),i=t.getFeatures(),n=this.layerTemplateMap[e]?this.layerTemplateMap[e]:{item:this.itemTemplate,header:this.headerTemplate,queryProperties:this.queryProperties};this.values.currentHeader=n.header,this.values.query=!!n.queryProperties.length;var r=i.map(function(e){var t=e.getProperties();return delete t[e.getGeometryName()],{id:e.getId(),properties:t,query:n.queryProperties.reduce(function(t,i){var n=e.get(i);return null!=n?t+" "+n.toString():t},"")}});return r.map(function(e,t){return{template:Dr()(n.item)({data:{featureCount:t+1,feature:e}}),id:e.id,query:e.query}})}}]),t}(ra),Xh=Qh,$h={DISTANCE:"distance",AREA:"area",VERTICAL_HEIGHT:"verticalHeight",OBLIQUE_HEIGHT:"obliqueHeight",OBLIQUE_DISTANCE:"obliqueDistance",POINT:"point",CARTESIAN_DISTANCE:"cartesianDistance",CARTESIAN_AREA:"cartesianArea"},ed=function(){function e(t){Object(d["a"])(this,e),this.parent=t.parent,this.decimalPlaces=this.parent.decimalPlaces,this.map=ne.getInstance().getActiveMap(),this.featureIds=[],this.forceMove=null!=t.forceMove?t.forceMove:null,this.values={type:t.type,isValid:!1}}return Object(m["a"])(e,null,[{key:"measurementType",get:function(){return $h.DISTANCE}}]),Object(m["a"])(e,[{key:"_createFeature",value:function(e){if(this.feature=this.parent.geometryEditor.createFeature(e.geometryType),e.isAbsolute?this.feature.set("olcs_altitudeMode","absolute",!0):this.feature.set("olcs_altitudeMode","clampToGround",!0),e.startPosition){var t=this.feature.getGeometry();t instanceof ol.geom.LineString?t.setCoordinates([e.startPosition]):t instanceof ol.geom.Polygon?t.setCoordinates([[e.startPosition]]):t instanceof ol.geom.Point&&t.setCoordinates(e.startPosition)}e.addFeatureStyle&&(this.feature[ft]=this.parent.featureLayer.style.clone(),this.feature.setStyle(this.feature[ft].style)),this.map instanceof Pi?(this.feature[_n.obliqueGeometry].on("change",this.geometryChangedCallback.bind(this)),this.feature[_n.doNotTransform]=!0):this.feature.getGeometry().on("change",this.geometryChangedCallback.bind(this));var i=tn.CREATE;e.startPosition&&"Point"===e.geometryType&&(this.feature.getGeometry().changed(),i=tn.EDIT),this.parent.geometryEditor.setModeAndSelectFeature(i,this.feature),this.id=this.feature.getId().toString(),this.featureIds.push(this.id)}},{key:"geometryChangedCallback",value:function(e){}},{key:"getValue",value:function(e,t){var i=Math.abs(e),n=t?2:1,r=t?"m²":"m",a=Math.pow(1e3,n);return i>a*(t?1:10)&&(i/=a,r="k".concat(r)),"".concat(i.toFixed(this.decimalPlaces)," ").concat(r)}},{key:"addLabel",value:function(){var e=rl.Point(),t=new ol.Feature({geometry:e});return this.map instanceof Pi&&(e[_n.alreadyTransformedToImage]=!0,t[_n.doNotTransform]=!0),t.setStyle(new ol.style.Style({text:this.parent.featureLayer.style.text.clone()})),this.parent.featureLayer.addFeatures([t]),t[this.parent.geometryEditor.state.featureTypeSymbol]=0,this.featureIds.push(t.getId()),t}},{key:"destroy",value:function(){this.parent.featureLayer.removeFeaturesById(this.featureIds)}}],[{key:"setTextOnLabel",value:function(e,t){e.getStyle().getText().setText(t)}}]),e}(),td=ed,id=new ol.Sphere(6378137),nd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=e.type||t.measurementType,i=y(this,b(t).call(this,e)),i.segmentDistance=[],i.values.distance="0",i.values.estimate=!1,i.label=i.addLabel(),i._createFeature({geometryType:"LineString",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.DISTANCE}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=this,i=e.target.getCoordinates(),n=i.length;if(n>1&&(i[0][0]!==i[1][0]||i[0][1]!==i[1][1])){this.values.isValid=this.values.isValid||n>2,this.label.getGeometry().setCoordinates(i[n-1]);var r,a=Promise.resolve([]);if(this.map instanceof Pi){r=new Array(n);var s=i.map(function(e,i){return Object(Bt["e"])(t.map.activeLayer.currentImage,e,{dataProjection:ol.proj.get("EPSG:4326")}).then(function(e){r[i]=e.coords,t.values.estimate=e.estimate})});a=Promise.all(s)}else{for(var o=0;o<n;o++)R.mercatorToWgs84(i[o],!0);r=i}return a.then(function(){var e=t.calculateDistance(r);t.setValueAndLabel(e)})}return this.values.isValid&&this.parent.removeMeasurement(this),null}},{key:"calculateDistance",value:function(e){var t=e.length;this.segmentDistance=new Array(t-1);for(var i=0,n=1;n<t;n++)this.segmentDistance[n-1]=id.haversineDistance(e[n-1],e[n]),i+=this.segmentDistance[n-1];return i}},{key:"setValueAndLabel",value:function(e){this.values.distance=this.getValue(e),td.setTextOnLabel(this.label,this.values.distance),this.label.changed()}}]),t}(td),rd=nd,ad=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.values.area="0",i.values.circumference="0",i.label=i.addLabel(),i._createFeature({geometryType:"Polygon",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.AREA}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates()[0],n=i.length,r=0;if(n>2){this.values.isValid=this.values.isValid||n>3;for(var a=0;a<n;a++)R.mercatorToWgs84(i[a],!0),a&&(r+=id.haversineDistance(i[a-1],i[a])),a===n-1&&(r+=id.haversineDistance(i[a],i[0]));this.values.area=this.getValue(id.geodesicArea(i),!0),this.values.circumference=this.getValue(r),td.setTextOnLabel(this.label,this.values.area),this.label.setGeometry(t.getInteriorPoint())}else this.values.isValid&&this.parent.removeMeasurement(this)}}]),t}(td),sd=ad,od=new Cesium.Cartographic,ld=new Cesium.Cartesian3,cd=[{key:"height",indices:[0,1]},{key:"horizontal",indices:[1,2]},{key:"distance",indices:[0,2]}],ud={horizontal:0,height:0,distance:0},hd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.triangleFeature=new ol.Feature({geometry:rl.LineString(),olcs_altitudeMode:"absolute"}),i.parent.featureLayer.addFeatures([i.triangleFeature]),i.triangleFeature[i.parent.geometryEditor.state.featureTypeSymbol]=0,i.featureIds.push(i.triangleFeature.getId()),i.cartesians=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],i.labels={height:i.addLabel(),horizontal:i.addLabel(),distance:i.addLabel()},i.values.height="0",i.values.horizontal="0",i.values.distance="0",i.values.alpha="0",i.values.beta="0",Object.values(i.labels).forEach(function(e){e.set("olcs_altitudeMode","absolute")}),i._createFeature({geometryType:"LineString",isAbsolute:!0,startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.VERTICAL_HEIGHT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates();if(!this.values.isValid&&i.length>2&&(this.values.isValid=!0),this.values.isValid){if(this.parent.geometryEditor.state.mode===tn.CREATE&&this.parent.geometryEditor.setMode(tn.EDIT),i.length<2)return void this.parent.removeMeasurement(this);var n=i[0][2]<i[1][2]?0:1,r=i[n].slice();r[2]=i[n?0:1][2];var a=[i[n],r,i[n?0:1]];this.triangleFeature.getGeometry().setCoordinates(a);for(var s=0;s<3;s++)R.mercatorToWgs84(a[s],!0),Cesium.Cartesian3.fromDegrees(a[s][0],a[s][1],a[s][2],void 0,this.cartesians[s]);for(var o=0;o<3;o++){var l=cd[o],c=l.key,u=l.indices,h=Cesium.Cartesian3.distance(this.cartesians[u[0]],this.cartesians[u[1]]);ld=Cesium.Cartesian3.lerp(this.cartesians[u[0]],this.cartesians[u[1]],.5,ld),od=Cesium.Cartographic.fromCartesian(ld,void 0,od),ud[c]=h,this.values[c]=this.getValue(h),td.setTextOnLabel(this.labels[c],this.values[c]),this.labels[c].getGeometry().setCoordinates(R.wgs84ToMercator([Cesium.Math.toDegrees(od.longitude),Cesium.Math.toDegrees(od.latitude),od.height]))}var d=Cesium.Math.toDegrees(Math.asin(ud.horizontal/ud.distance)),m=90-d;this.values.alpha="".concat(d.toFixed(this.decimalPlaces),"°"),this.values.beta="".concat(m.toFixed(this.decimalPlaces),"°")}}}]),t}(td),dd=hd,md=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.values.x="0",i.values.y="0",i.values.z="0",i.values.estimate=!1,i.transformer=R.getTransformer(ne.getInstance().getProjection(),R.createMercatorProjection()),i.map instanceof Vt?i._callback=i.setCoords.bind(f(i),!0):i.map instanceof Hi?(i._callback=i.setCoords.bind(f(i),!1),delete i.values.z):i.map instanceof Pi&&(i._callback=i.setFromObliqueCoords.bind(f(i))),i.geometryCreated=!!e.startPosition,i._createFeature({geometryType:"Point",isAbsolute:!0,addFeatureStyle:!0,startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.POINT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){if(this._callback&&this.geometryCreated){var t=e.target.getCoordinates();this.values.isValid=!0,this._callback(t)}else this.geometryCreated=!0}},{key:"setCoords",value:function(e,t){this.transformer(t,t,3),this.values.x=t[0].toFixed(this.decimalPlaces),this.values.y=t[1].toFixed(this.decimalPlaces);var i="".concat(this.values.x,", ").concat(this.values.y);if(e){var n=this.getValue(t[2]);this.values.z=n,i="".concat(i,", ").concat(n)}this.feature[ft].label="(".concat(i,")"),this.feature.changed()}},{key:"setFromObliqueCoords",value:function(e){var t=this;return Object(Bt["e"])(this.map.activeLayer.currentImage,e,{dataProjection:R.createMercatorProjection().getProjection()}).then(function(e){t.values.estimate=e.estimate,t.setCoords(!e.estimate,e.coords)})}}]),t}(td),fd=md,yd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,e.forceMove=!0,i=y(this,b(t).call(this,e)),i.values.height="0",i.values.estimate=!1,i.map=i.map,i.startUndistorted=null,i.startDistorted=null,i.liftedUndistorted=null,i.measureVecGround=new Cesium.Cartesian3,i.measureVecOrientation=new Cesium.Cartesian3,i.set=!1,i.onHold=!1,i.selfCall=!1,i.label=i.addLabel(),i._createFeature({geometryType:"LineString",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.OBLIQUE_HEIGHT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=this;if(this.selfCall)this.selfCall=!1;else if(!this.onHold){var i=e.target.getCoordinates();if(this.values.isValid){if(this.parent.geometryEditor.state.mode===tn.CREATE)return void this.parent.geometryEditor.setMode(tn.EDIT);if(i.length<2)return void this.parent.removeMeasurement(this)}var n=this.map.activeLayer,r=n.currentImage.camera;if(this.set||2!==i.length){if(this.set){3!==i.length||this.values.isValid||(this.parent.geometryEditor.setMode(tn.EDIT),this.values.isValid=!0);var a=r.radialDistortionCoordinate(i[1],!0),s=[[a[0],a[1]],[a[0]+1,a[1]]],o=Object(Bt["b"])(s,[this.startUndistorted,this.liftedUndistorted]),l=[o.x,o.y],c=r.radialDistortionCoordinate(l,!1),u=new Cesium.Cartesian3(l[0],l[1],0),h=Cesium.Cartesian3.subtract(u,this.measureVecGround,new Cesium.Cartesian3);h=Cesium.Cartesian3.normalize(h,h);var d,m=Cesium.Cartesian3.dot(this.measureVecOrientation,h);if(this.selfCall=!0,m<0||Number.isNaN(m))this.values.height=this.getValue(0),d=[this.startDistorted,this.startDistorted];else{var f=this.findVertical3DPositionRegardingPixel(l,this.startPointRealWorld);this.values.height=this.getValue(ai(this.startPointRealWorld,f)),d=[this.startDistorted,c]}td.setTextOnLabel(this.label,this.values.height),this.label.getGeometry().setCoordinates(d[1]),this.feature.getGeometry().setCoordinates(d),this.parent.geometryEditor.geometryEditor.vertices[0].getGeometry().setCoordinates(d[0]),this.parent.geometryEditor.geometryEditor.vertices[1].getGeometry().setCoordinates(d[1])}}else this.onHold=!0,this.startUndistorted=r.radialDistortionCoordinate(i[0],!0),this.startDistorted=i[0].slice(),this.measureVecGround=Cesium.Cartesian3.fromElements(this.startUndistorted[0],this.startUndistorted[1],0,this.measureVecGround),Object(Bt["e"])(n.currentImage,i[0]).then(function(e){t.startPointRealWorld=e.coords,t.values.estimate=e.estimate;var i=e.coords.slice();return i[2]+=10,Object(Bt["f"])(n.currentImage,i)}).then(function(e){t.liftedUndistorted=r.radialDistortionCoordinate(e.coords,!0);var i=Cesium.Cartesian3.fromElements(t.liftedUndistorted[0],t.liftedUndistorted[1],0);t.onHold=!1,t.set=!0,t.measureVecOrientation=Cesium.Cartesian3.subtract(i,t.measureVecGround,t.measureVecOrientation),t.measureVecOrientation=Cesium.Cartesian3.normalize(t.measureVecOrientation,t.measureVecOrientation),t.selfCall=!0,t.feature.getGeometry().setCoordinates([t.startDistorted,t.startDistorted])})}}},{key:"findVertical3DPositionRegardingPixel",value:function(e,t){var i=this.map.getCurrentImage(),n=new Cesium.Cartesian3(e[0],i.size[1]-e[1],1);n=Cesium.Matrix3.multiplyByVector(i.pToRealworld,n,n);var r=new Cesium.Cartesian3(0,0,1),a=Cesium.Cartesian3.cross(r,n,new Cesium.Cartesian3),s=Cesium.Cartesian3.fromArray(t),o=Cesium.Cartesian3.subtract(i.projectionCenter,s,new Cesium.Cartesian3),l=Cesium.Matrix3.fromRowMajorArray([r.x,n.x,a.x,r.y,n.y,a.y,r.z,n.z,a.z]);l=Cesium.Matrix3.inverse(l,l);var c=Cesium.Matrix3.multiplyByVector(l,o,new Cesium.Cartesian3);return a=Cesium.Cartesian3.multiplyByScalar(a,c.z,a),r=Cesium.Cartesian3.multiplyByScalar(r,c.x,r),r=Cesium.Cartesian3.add(r,a,r),s=Cesium.Cartesian3.add(s,r,s),[s.x,s.y,s.z]}}]),t}(td),gd=yd,vd=function(e){function t(e){return Object(d["a"])(this,t),e.type=t.measurementType,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.OBLIQUE_DISTANCE}}]),t}(rd),pd=vd,_d=new Cesium.Cartesian3,bd=new Cesium.Cartesian3,Ld=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.segmentDistance=[],i.values.distance="0",i.label=i.addLabel(),i.label.set("olcs_altitudeMode","absolute"),i._createFeature({geometryType:"LineString",startPosition:e.startPosition,isAbsolute:!0}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.CARTESIAN_DISTANCE}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target.getCoordinates(),i=t.length;if(i>1&&(t[0][0]!==t[1][0]||t[0][1]!==t[1][1])){this.values.isValid=this.values.isValid||i>2,this.label.getGeometry().setCoordinates(t[i-1]),this.segmentDistance=new Array(i-1);var n=0;R.mercatorToWgs84(t[0],!0),_d=Cesium.Cartesian3.fromDegrees(t[0][0],t[0][1],t[0][2],void 0,_d);for(var r=1;r<i;r++)R.mercatorToWgs84(t[r],!0),bd=Cesium.Cartesian3.fromDegrees(t[r][0],t[r][1],t[r][2],void 0,bd),this.segmentDistance[r-1]=Cesium.Cartesian3.distance(_d,bd),n+=this.segmentDistance[r-1],_d=bd.clone(_d);this.values.distance=this.getValue(n),td.setTextOnLabel(this.label,this.values.distance),this.label.changed()}else this.values.isValid&&this.parent.removeMeasurement(this)}}]),t}(td),Md=Ld,kd=new Cesium.Cartesian3,wd=new Cesium.Cartesian3,Td=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,e.forceMove=!1,i=y(this,b(t).call(this,e)),i.values.area="0",i.values.circumference="0",i.label=i.addLabel(),i.label.set("olcs_altitudeMode","absolute"),i.label.set("olcs_zCoordinateEyeOffset",-10),i._createFeature({geometryType:"Polygon",startPosition:e.startPosition,isAbsolute:!0}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.CARTESIAN_AREA}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates()[0],n=i.length,r=0;if(this.values.isValid&&i.length<3)this.parent.removeMeasurement(this);else if(n>3||this.values.isValid){this.values.isValid=!0;for(var a=new Array(n),s=new Array(n),o=i[0][2],l=0,c=0;c<n;c++)o=i[c][2]>o?i[c][2]:o,R.mercatorToWgs84(i[c],!0),a[c]=Cesium.Cartesian3.fromDegrees(i[c][0],i[c][1],i[c][2]),s[c]=Cesium.Cartesian2.fromCartesian3(a[c]),c&&(l+=Cesium.Cartesian3.distance(a[c-1],a[c]));l+=Cesium.Cartesian3.distance(a[n-1],a[0]);for(var u=Cesium.PolygonPipeline.triangulate(s),h=u.length,d=0;d<h;d+=3){var m=u[d],f=u[d+1],y=u[d+2];kd=Cesium.Cartesian3.subtract(a[m],a[f],kd),wd=Cesium.Cartesian3.subtract(a[m],a[y],wd),kd=Cesium.Cartesian3.cross(kd,wd,kd),r+=Cesium.Cartesian3.magnitude(kd)/2}this.values.area=this.getValue(r,!0),this.values.circumference=this.getValue(l),td.setTextOnLabel(this.label,this.values.area);var g=t.getInteriorPoint().getCoordinates();g[2]=o,this.label.getGeometry().setCoordinates(g)}}}]),t}(td),Sd=Td,Od=(Ru={},Object(oe["a"])(Ru,rd.measurementType,rd),Object(oe["a"])(Ru,sd.measurementType,sd),Object(oe["a"])(Ru,dd.measurementType,dd),Object(oe["a"])(Ru,fd.measurementType,fd),Object(oe["a"])(Ru,gd.measurementType,gd),Object(oe["a"])(Ru,pd.measurementType,pd),Object(oe["a"])(Ru,Md.measurementType,Md),Object(oe["a"])(Ru,Sd.measurementType,Sd),Ru),Cd=["distance","cartesianDistance","cartesianArea","area","point","verticalHeight","obliqueDistance","obliqueHeight"],Ed=new gt({image:{fill:{color:[244,67,54,.8]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:[244,67,54,1],width:3},fill:{color:[244,67,54,.8]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),Id=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"];var n=Ed.clone();return e.style&&n.assign(new gt(e.style)),i.featureLayer=new _n({style:n,altitudeMode:"clampToGround",zCoordinateEyeOffset:-20}),i.geometryEditor=null,i.decimalPlaces=null!=e.decimalPlaces?e.decimalPlaces:1,i.allowedMeasurements=e.allowedMeasurements||Cd,(i.allowedMeasurements.includes("obliqueDistance")||i.allowedMeasurements.includes("obliqueHeight"))&&i.supportedMaps.push("vcs.vcm.maps.Oblique"),i.supportedMeasurements=[],i.useCartesianIn3D=null!=e.useCartesianIn3D&&e.useCartesianIn3D,i.measurements=new Map,i._defaultTransformOnMove=Q.getInstance().transformGeometryOnMove,i._transformOnMove=i._defaultTransformOnMove,i.obliqueListener=null,i.state=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Measurement"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.geometryEditor=new hl({allowedGeometries:["LineString","Polygon","Point"],defaultMode:"edit",dedicatedFeatureStyle:!1}),this.state={activeMeasurementId:null,editorState:this.geometryEditor.state,measurementsSize:0},this.framework.addLayer(this.featureLayer),this.handleMapChangeEvent(this.framework.getActiveMap()),this.geometryEditor.initialize(),this.geometryEditor.addEditingLayer(this.featureLayer),this._transformOnMove=Q.getInstance().transformGeometryOnMove,this.geometryEditor.selectFeatureInteraction.onSelect(this.onSelect.bind(this)),this.initialized=!0}return!0}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),this.active&&this.geometryEditor.setMode(tn.NONE),this.supportedMeasurements.splice(0),this._transformOnMove=this._defaultTransformOnMove,this.clearMeasurements(),e instanceof Hi?(this.supportedMeasurements.push(rd.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(sd.measurementType)):e instanceof Vt?(this.supportedMeasurements.push(Md.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(Sd.measurementType),this.supportedMeasurements.push(dd.measurementType),this.useCartesianIn3D||(this.supportedMeasurements.push(rd.measurementType),this.supportedMeasurements.push(sd.measurementType))):e instanceof Pi&&(this._transformOnMove=!1,this.obliqueListener||(this.obliqueListener=this.framework.subscribe("OBLIQUE_IMAGE_CHANGED",this.obliqueImageChangeHandler.bind(this))),this.supportedMeasurements.push(pd.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(gd.measurementType))}},{key:"checkObliqueMeasurementIsSupported",value:function(e,t){if(e.camera&&!this.supportedMeasurements.includes(t))this.supportedMeasurements.push(t);else if(!e.camera&&this.supportedMeasurements.includes(t)){var i=this.supportedMeasurements.indexOf(t);this.supportedMeasurements.splice(i,1)}}},{key:"obliqueImageChangeHandler",value:function(e,t){this.checkObliqueMeasurementIsSupported(t,gd.measurementType),this.checkObliqueMeasurementIsSupported(t,pd.measurementType),this.clearMeasurements()}},{key:"activate",value:function(){return Se(b(t.prototype),"activate",this).call(this),this.geometryEditor.activate(),this.featureLayer.activate(!0)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.geometryEditor.deactivate()}},{key:"createMeasurement",value:function(e,t){if(this.state.activeMeasurementId){var i=this.measurements.get(this.state.activeMeasurementId);i.values.isValid||this.removeMeasurement(i)}var n=Od[e],r=new n({parent:this,startPosition:t,defaultTransformOnMove:this._transformOnMove});this.measurements.set(r.id,r),this.state.activeMeasurementId=r.id,this.state.measurementsSize=this.measurements.size,this._setTransformOnMove(r)}},{key:"_setTransformOnMove",value:function(e){this.geometryEditor.state.transformGeometryOnMove=e&&null!==e.forceMove?e.forceMove:this._transformOnMove,this.geometryEditor.state.onlyAllowTranslation=e&&(e.values.type===dd.measurementType||e.values.type===gd.measurementType)}},{key:"removeMeasurement",value:function(e){e.destroy(),this.state.activeMeasurementId===e.id&&(this.state.activeMeasurementId=null),this.measurements.delete(e.id),this.state.measurementsSize=this.measurements.size}},{key:"clearMeasurements",value:function(){this.measurements.forEach(function(e){e.destroy()}),this.measurements.clear(),this.state.measurementsSize=this.measurements.size,this.activeMeasurement=null,this.state.activeMeasurementId=null}},{key:"onSelect",value:function(){if(this.geometryEditor.features.size){this.state.activeMeasurementId=this.geometryEditor.state.selectedFeatureId;var e=this.measurements.get(this.state.activeMeasurementId);this._setTransformOnMove(e)}else this.state.activeMeasurementId=null}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.style=this.featureLayer.style.getOptions(),e.decimalPlaces=this.decimalPlaces,this.allowedMeasurements!==Cd&&(e.allowedMeasurements=this.allowedMeasurements),e}}]),t}(ra),Dd=Id,jd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,e.allowedMeasurements=e.allowedMeasurements||["distance","cartesianDistance","verticalHeight","obliqueHeight"],i=y(this,b(t).call(this,e)),i.state=i.state,i.mapClickListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.SingleMeasurement"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.state=this.state,this.state.activeSingleMeasurementType=null}return!0}},{key:"createMeasurement",value:function(e,i){var n=this;this.clearMeasurements(),Se(b(t.prototype),"createMeasurement",this).call(this,e,i),this.state.activeSingleMeasurementType=e,this.mapClickListener&&this.framework.unsubscribeByKey(this.mapClickListener),this.mapClickListener=this.framework.subscribeOnce("CLICKED",function(t){if(n.active){var i=n.framework.getActiveMap()instanceof Pi?t.obliqueParameters.pixel:R.wgs84ToMercator([t.longitude,t.latitude,t.height]);n.createMeasurement(e,i)}})}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.mapClickListener&&(this.framework.unsubscribeByKey(this.mapClickListener),this.mapClickListener=null),this.featureLayer.activate(!1),this.clearMeasurements()}}]),t}(Dd),Pd=jd,Yd={north:"moveForward",south:"moveBackward",west:"moveLeft",east:"moveRight",increaseFOV:"increaseFOV",decreaseFOV:"decreaseFOV",up:"moveUp",down:"moveDown",tiltUp:"tiltUp",tiltDown:"tiltDown",rotateEast:"rotateEast",rotateWest:"rotateWest"},xd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.zoomFactor=Object(u["g"])(e.zoomFactor,2),i.moveFactor=Object(u["g"])(e.moveFactor,1.5),i.tiltFactor=Object(u["g"])(e.tiltFactor,10),i.walkModeMoveFactor=Object(u["g"])(e.walkModeMoveFactor,1),i.animationDuration=Object(u["g"])(e.animationDuration,.5),i.animation=null==e.animation||e.animation,i.showZoomButtons=null==e.showZoomButtons||e.showZoomButtons,i.showTiltButtons=null==e.showTiltButtons||e.showTiltButtons,i.showCompass=null==e.showCompass||e.showCompass,i.showHomeButton=null==e.showHomeButton||e.showHomeButton,i.pedestrianMode=null==e.pedestrianMode||e.pedestrianMode,i.pedestrianModeReferenceHeight=Object(u["g"])(e.pedestrianModeReferenceHeight,1.6),i.obliqueMoveImage=null==e.obliqueMoveImage||e.obliqueMoveImage,i.obliqueMoveImageDirectionDeviation=Object(u["g"])(e.obliqueMoveImageDirectionDeviation,Math.PI/4),i.rotationPerFrame=Object(u["g"])(e.rotationPerFrame,.5),i.timePerRotation=Object(u["g"])(e.timePerRotation,20),!e.timePerRotation&&e.rotationPerFrame&&(i.timePerRotation=6/i.rotationPerFrame),i.initializedForCesium=!1,i.initializedForOpenlayers=!1,i.initializedForOblique=!1,i.rotationActive=!1,i.tapedTwice=!1,i.navigationMode=Pe.getInstance(),i.navigationMode.setOptions({referenceHeight:i.pedestrianModeReferenceHeight,moveFactor:i.walkModeMoveFactor}),i.mapClickListenerKey=null,i.values={heading:0,walkmode:!1,rotation:!1,pedestrianMode:i.pedestrianMode,referenceHeight:i.pedestrianModeReferenceHeight,active:!1},i.navigationMode.setValues(i.values),i._navigationModeFlags=t.navigationModeFlags,i._obliqueMoving=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.NavigationControls"}},{key:"navigationModeFlags",get:function(){return Yd}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;document.addEventListener("keydown",this.keyDownListener.bind(this),!1),document.addEventListener("keyup",this.keyUpListener.bind(this),!1),this.mapChangedHandler(this.framework.getActiveMap()),this.framework.subscribe(B.MAP_ACTIVATED,this.mapChangedHandler.bind(this)),this.initialized=!0}}},{key:"keyDownListener",value:function(e){if(!Object(u["b"])(e))switch(e.keyCode){case 38:this.moveButtonPressed("north");break;case 40:this.moveButtonPressed("south");break;case 37:this.moveButtonPressed("west");break;case 39:this.moveButtonPressed("east");break;case 107:this.zoomButtonPressed("zoomIn");break;case 109:this.zoomButtonPressed("zoomOut");break;case 33:this.tiltButtonPressed("tiltUp");break;case 34:this.tiltButtonPressed("tiltDown");break;case 36:this.rotateButtonPressed("rotateEast");break;case 35:this.rotateButtonPressed("rotateWest");break;default:break}}},{key:"keyUpListener",value:function(e){if(!Object(u["b"])(e))switch(e.keyCode){case 38:this.moveButtonUp("north");break;case 40:this.moveButtonUp("south");break;case 37:this.moveButtonUp("west");break;case 39:this.moveButtonUp("east");break;case 107:this.fovButtonUp("zoomIn");break;case 109:this.fovButtonUp("zoomOut");break;case 33:this.tiltButtonUp("tiltUp");break;case 34:this.tiltButtonUp("tiltDown");break;case 36:this.rotateButtonUp("rotateEast");break;case 35:this.rotateButtonUp("rotateWest");break;default:break}}},{key:"mapChangedHandler",value:function(e){e.isInitialized()&&(e instanceof Vt?this.activateForCesium():e instanceof Hi?this.activateForOpenlayers():e instanceof Pi&&this.activateForOblique())}},{key:"activateForCesium",value:function(){if(!this.initializedForCesium){var e=this.framework.getActiveMap();this.cesiumViewer=e.getCesiumWidget(),this.cesiumScene=this.cesiumViewer.scene,this.cesiumCamera=this.cesiumScene.camera,this.cesiumPostRenderBind=this.postRenderHandlerCesium.bind(this),this.cesiumScene.postRender.addEventListener(this.cesiumPostRenderBind),this.initializedForCesium=!0}}},{key:"postRenderHandlerCesium",value:function(){var e=Cesium.Math.toDegrees(this.cesiumCamera.heading);(!this.values.heading||this.values.heading<e-.5||this.values.heading>e+.5)&&(this.values.heading=e)}},{key:"activateForOpenlayers",value:function(){this.initializedForOpenlayers||(this.ol3MapObject=this.framework.getActiveMap(),this.ol3Map=this.ol3MapObject.getOl3Map(),this.ol3Map.on("postrender",this.postRenderHandlerOpenlayers.bind(this)),this.initializedForOpenlayers=!0)}},{key:"postRenderHandlerOpenlayers",value:function(){var e=this.framework.getActiveMap();if(e){var t=e.getViewPoint(!1);t&&(this.values.heading=t.getHeading())}}},{key:"activateForOblique",value:function(){this.initializedForOblique||(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChange,this),this.initializedForOblique=!0);var e=this.framework.getActiveMap(),t=e.activeLayer;t&&t.currentImage&&this.obliqueImageChange(t)}},{key:"obliqueImageChange",value:function(e,t){var i,n=t||e.currentImage,r=(i={},Object(oe["a"])(i,h["a"].NORTH,0),Object(oe["a"])(i,h["a"].EAST,90),Object(oe["a"])(i,h["a"].SOUTH,180),Object(oe["a"])(i,h["a"].WEST,270),i);this.values.heading=n.viewDirectionAngle?90-Cesium.Math.toDegrees(n.viewDirectionAngle):r[n.viewDirection]}},{key:"computeNewGroundPosition",value:function(e,t){var i=t.getGroundPosition(),n=this.calculateBearing(e,t.getHeading()),r=t.getDistance()/this.moveFactor,a=Ut([i[0],i[1]],r,n);return a[2]=i[2],a}},{key:"calculateBearing",value:function(e,t){var i;return i="north"===e?t:"east"===e?t+90:"south"===e?t+180:"west"===e?t+270:t,i%=360,i}},{key:"computeNewCameraPosition",value:function(e,t){var i=t.getCameraPosition(),n=this.calculateBearing(e,t.getHeading()),r=2e3/this.moveFactor,a=Ut([i[0],i[1]],r,n);return a[2]=i[2],a}},{key:"moveButtonPressed",value:function(e){var t=this;if(this.navigationMode.isActive())this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else{var i=this.framework.getActiveMap();if(this.obliqueMoveImage&&i instanceof Pi){if(this._obliqueMoving||!i.activeLayer)return;var n=i.activeLayer.currentDirection;this._obliqueMoving=!0,i.getViewPoint(null,!0).then(function(i){var r=i.getHeading(),a=t.calculateBearing(e,r);return n.getImageIdInDirection(2*Math.PI-(a*Math.PI/180-Math.PI/2),t.obliqueMoveImageDirectionDeviation)}).then(function(e){return e?n.setImageOnMap(e):e}).catch(function(e){t.logger.warning(e.message)}).then(function(){t._obliqueMoving=!1})}else i.getViewPoint(null,!0).then(function(n){n.getGroundPosition()?(n.setGroundPosition(t.computeNewGroundPosition(e,n)),n.setCameraPosition(null)):(n.setCameraPosition(t.computeNewCameraPosition(e,n)),n.setGroundPosition(null)),n.setAnimate(t.animation),i.gotoViewPoint(n,t.animationDuration,0)})}}},{key:"moveButtonUp",value:function(e){this.navigationMode.isActive()&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"compassPointerClicked",value:function(e){var t=this;this.navigationMode.isActive()?this.navigationMode.setHeading(e):this.framework.getActiveMap().getViewPoint(!0,!0).then(function(i){i.setHeading(e),i.setAnimate(!0),i.setRoll(0),i.getGroundPosition()&&i.setCameraPosition(null),t.framework.getActiveMap().gotoViewPoint(i,1,0)})}},{key:"compassPointerDown",value:function(){var e=this.framework.getActiveMap().getViewPoint();e.setAnimate(!1),e.getGroundPosition()&&e.setCameraPosition(null),this.compassPointerPressedViewpoint=e}},{key:"compassPointerDragged",value:function(e){this.navigationMode.isActive()?this.navigationMode.setHeading(e):this.compassPointerPressedViewpoint&&(this.compassPointerPressedViewpoint.setHeading(e),this.framework.getActiveMap().gotoViewPoint(this.compassPointerPressedViewpoint,1,0))}},{key:"fovButtonPressed",value:function(e){this.navigationMode.isActive()&&this.navigationMode.setFlag(this._navigationModeFlags[e],!0)}},{key:"fovButtonUp",value:function(e){this.navigationMode.isActive()&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"zoomButtonPressed",value:function(e){var t=this;this.navigationMode.isActive()||this.framework.getActiveMap().getViewPoint(null,!0).then(function(i){"zoomIn"===e?i.setDistance(i.getDistance()/t.zoomFactor):i.setDistance(i.getDistance()*t.zoomFactor),i.setAnimate(t.animation),i.setCameraPosition(null),t.framework.getActiveMap().gotoViewPoint(i,t.animationDuration,0)})}},{key:"tiltButtonPressed",value:function(e){if(this.navigationMode.isActive())this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else if(this.framework.getActiveMap()instanceof Vt){var t=this.framework.getActiveMap().getViewPoint(),i=t.getPitch(),n=i;if(n="tiltUp"===e?i-this.tiltFactor:i+this.tiltFactor,n>-10&&(n=-10),n<-90&&(n=-90),t.setPitch(n),t.setAnimate(this.animation),!t.getGroundPosition())return;t.setCameraPosition(null),this.framework.getActiveMap().gotoViewPoint(t,this.animationDuration,0)}}},{key:"tiltButtonUp",value:function(e){this.navigationMode.isActive()&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"rotateButtonPressed",value:function(e){if(this.navigationMode.isActive())this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else{var t=this.framework.getActiveMap();if(t instanceof Vt||t instanceof Hi&&!t.fixedNorthOrientation){var i=this.framework.getActiveMap().getViewPoint(),n=i.getHeading(),r=n;if("rotateEast"===e?r+=10:r-=10,i.setHeading(r),i.setAnimate(this.animation),!i.getGroundPosition())return;i.setCameraPosition(null),this.framework.getActiveMap().gotoViewPoint(i,this.animationDuration,0)}}}},{key:"rotateButtonUp",value:function(e){this.navigationMode.isActive()&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"rotateCenterClicked",value:function(){var e=this.framework.getActiveMap();e instanceof Vt&&(this.rotationActive?this.navigationMode.isActive()?(this.navigationMode.setFlag("rotation",!1),this.rotationActive=!1,this.values.rotation=!1):this.rotateAroundCenterPosition(e,!1):this.navigationMode.isActive()?(this.navigationMode.setFlag("rotation",!0),this.rotationActive=!0,this.values.rotation=!0):this.rotateAroundCenterPosition(e,!0))}},{key:"rotateAroundCenterPosition",value:function(e,t){var i=e.getCesiumWidget(),n=i.scene;if(t!==this.rotationActive)if(t){var r=this.framework.getActiveMap().getViewPoint();r.getGroundPosition()&&(this.rotationActive=!0,this.values.rotation=!0,r.setCameraPosition(null),this.cesiumRotateCenterBind=this.rotateCenter.bind(this,r),n.postRender.addEventListener(this.cesiumRotateCenterBind))}else this.cesiumRotateCenterBind&&(n.postRender.removeEventListener(this.cesiumRotateCenterBind),this.cesiumRotateCenterBind=null,this.rotationActive=!1,this.values.rotation=!1)}},{key:"rotateCenter",value:function(e){var t=this.timeLastTick?this.cesiumViewer.clock.currentTime.secondsOfDay-this.timeLastTick.secondsOfDay:1/60;(t<=0||t>1)&&(t=1/60);var i=t/(1/60);this.timeLastTick=this.cesiumViewer.clock.currentTime;var n=360/(60*this.timePerRotation/i);e.setHeading(e.getHeading()+n),this.framework.getActiveMap().gotoViewPoint(e,this.animationDuration,0)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.zoomFactor=this.zoomFactor,e.moveFactor=this.moveFactor,e.tiltFactor=this.tiltFactor,e.animationDuration=this.animationDuration,e.animation=this.animation,e.showZoomButtons=this.showZoomButtons,e.showTiltButtons=this.showTiltButtons,e.showHomeButton=this.showHomeButton,e.pedestrianMode=this.pedestrianMode,e.pedestrianModeReferenceHeight=this.pedestrianModeReferenceHeight,e.showCompass=this.showCompass,e.rotationPerFrame=this.rotationPerFrame,e.walkModeMoveFactor=this.walkModeMoveFactor,e}},{key:"dispose",value:function(){document.removeEventListener("keyup",this.keyUpListener.bind(this),!1),document.removeEventListener("keydown",this.keyDownListener.bind(this),!1)}},{key:"getValuesObject",value:function(){return this.values}},{key:"mapClicked",value:function(e){if(e&&e.longitude&&e.latitude&&e.height){var t=[e.longitude,e.latitude,e.height];t[2]+=Number.parseFloat(this.values.referenceHeight);var i=this.framework.getActiveMap().getViewPoint();i.setAnimate(!0),i.setGroundPosition(t),i.setCameraPosition(null),i.setDistance(0),i.setPitch(0),i.setRoll(0),this.navigationMode.activateFirstPersonMode(i),this.framework.getMapContainer().style.cursor="auto",this.mapClickListenerKey=null}}},{key:"activateNavigationMode",value:function(e){if(e)if(null==this.mapClickListenerKey){var t=function(e){var t=encodeURIComponent(e).replace(/%20/g," ").replace(/%3D/g,"=").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%22/g,"'");return"data:image/svg+xml,".concat(t)},i='<svg width="24" height="24" viewBox="0 0 93.646 93.646" xmlns="http://www.w3.org/2000/svg"><path d="M67.971,49.778l-9.378-10.345c-0.584-0.644-1.121-1.971-1.148-2.841L57.1,25.858v-0.311c0-1.654-1.346-3-3-3h-9.18h-3.648\n\t\tc-1.478,0-3.127,1.047-3.756,2.384l-12.358,26.25c-0.342,0.728-0.376,1.541-0.096,2.292c0.28,0.75,0.84,1.342,1.575,1.666\n\t\tl1.821,0.803c0.388,0.171,0.802,0.258,1.231,0.258h0c1.177,0,2.273-0.669,2.794-1.704l5.789-11.517v11.576\n\t\tc-0.024,0.067-0.059,0.128-0.081,0.196l-9.783,30.638c-0.407,1.276-0.283,2.619,0.35,3.781s1.693,1.994,2.987,2.343l0.654,0.177\n\t\tc0.428,0.116,0.872,0.175,1.318,0.175c2.251,0,4.296-1.481,4.974-3.603l9.141-28.628l3.242,7.941\n\t\tc0.791,1.937,1.645,5.329,1.865,7.409l1.551,14.621c0.249,2.341,2.1,4.04,4.402,4.04c0.377,0,0.76-0.046,1.137-0.137l0.659-0.16\n\t\tc2.624-0.635,4.478-3.331,4.133-6.008l-2.297-17.828c-0.292-2.265-1.269-5.812-2.178-7.907l-3.102-7.144\n\t\tc-0.04-0.093-0.097-0.177-0.143-0.267v-4.841l5.59,5.836c0.556,0.581,1.3,0.901,2.094,0.901c0.803,0,1.553-0.326,2.111-0.918\n\t\tl1.034-1.098C69.036,52.899,69.055,50.973,67.971,49.778z"/>\n\t<path d="M48.52,20.005c5.516,0,10.003-4.487,10.003-10.003C58.523,4.487,54.036,0,48.52,0c-5.515,0-10.001,4.487-10.001,10.002\n\t\tC38.518,15.518,43.005,20.005,48.52,20.005z"/></svg>';this.framework.getMapContainer().style.cursor='url("'.concat(t(i),'"), pointer'),this.mapClickListenerKey=this.framework.subscribeOnceExclusive("MAP_CLICKED",this.mapClicked.bind(this),"walkMode",this.activateNavigationMode.bind(this,!0))}else this.framework.unsubscribeByKey(this.mapClickListenerKey),this.mapClickListenerKey=null,this.framework.getMapContainer().style.cursor="auto";else this.navigationMode.activateOverviewMode()}},{key:"setReferenceHeight",value:function(e){this.values.referenceHeight=e}}]),t}(ra),Ad=xd,Fd=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.initialized=!1,i.mapContainerId=e.containerId||"vcm_overviewmap_container";var n=e.cameraIcon;n&&""!==n||(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA8CAYAAADxJz2MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDphMzhlODgyYy00ZGYzLTZkNGMtYWZhYy1hYTkwOTI3MjRiYjEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEYxRkE1MDlENjRDMTFFNTlGRjhFMzM3RTA3MDJFMDciIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEYxRkE1MDhENjRDMTFFNTlGRjhFMzM3RTA3MDJFMDciIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OGJiODg5ODItZGM0Zi0xNjQyLWEyZDYtODJkZTcxMGNhNjkwIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzY5MTdhNjAtZDYzYy0xMWU1LThjNTgtYTMwNjE0MWQwNTkyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Fn8KKQAABwVJREFUeNrsW0toHVUYPufOvb2madNaa2NS3682BTcKiQqx4qO0i7gKpHFhoCBoG8SVC124ExcW02yCiFCQ4iLgIhWJCE2pYI1J1VitNFhTIz5STdI2D2tucsf/N9/YcTKvM+fMbYT54eu9nTvnzMx3/veZSNu2RSbJJZdRkBGYEZgRmBGYSUZgRmBGYEZgJslkTUZBoEjXpxcsxTz9U0OYIfxFsAi2a5DtOjnpxU09RNS9SEPXiXN8kbCWUCWhgZsIf+Am3WYdh0BpkFipeG3v2LhjdM4pgyPmbMI5aT1hHeECIV+BVVXRLJ17kR6LSnqOl8AbCZNsue4BWzAB/1B0TapLpEyJmDTcR9SCL4C8K4Tf+Jh3wK2EecIsoWDIFE1qSxoExvV9JcQLttAxfC7lPSdNgMQlqKpUuJht6MZ15gsao7OgElxw0NhAGMXvzJHtNzGzfBPILBj2dyY00ZT2qURdJmsr4TxcnCNW0CR1IPJ3RGk74YWTPITU0BTTGYLj92pB3E/e38MusAP5zsUQTayELxIKrkRX04SP39sEDfxGdRLWvPsIUyAyl1LkTMPkpAErYNKugyUOgUzlC20mbIfq5lN4gDiBREfTdYjka9cTRlBkJL7AnZjo54C6OY2bNz2n6mKUEDTOEX7Qzaf4wg+AvMkYzYc0nLkp7Y6zUCVY3gxMV5ggkIPITkw6j6aDCZMySYYJTV9CSVtF+Bi+P1TyEb/brlX5itCI77kKpy3SIKEyQlFY+47HIc+PQOnJ+dzH2ZGOI6iMeVIb1crBpCbqdleky+/dRvgyLGhEERj1nse3SCq3olIpKnYyZMqEJFkIJ1m+hfAL4YyCRVlJzJCDSAs6ErMuf5im9kmFVphqX3ARNS4r0/sgU8ZQpshKJCo/fAor5m46mCidTJmxVLBCrv17YbpOV76cxITjCl9omPAgCuxCism0aZ8oPfkem+4JPJP0IU6C1EWTBLJ8Dad7ByqVotDrLqdR74ZdawFFwhgyDG8skB5XYayD4hbeCniGcJkw55MfphkM4vq+oPZUDSznHfhz6dN1klGmbGLn7GaQ+CNuLFfhiJpEg3mhbye87WpRxQ0cxglkeYjwuLja6r4W3ZW448pwOx8STuo+eN4QgSeRG25Hsl1IITdUMeOg30og77SHPD/ti/R/JjXQWYwXQN6kYvsrKtE1USpyFN2CWv6gx7eFER9KoGXQzPmGfiU8BqdsY/4kyAHu716EjfOex89QTdhIeAtNESNi+UQdHbmI6qQZ3/OuPMrvwXIRsGIej1oMlnsJ7xG+03i+FRzlfXKfuBMFqfanhHsI9/s0HUxFXZXx7PfuJnxuImjoNhPiyhHcNKc4F3w0PY2A4pcLLuIe2CreNfBcdhIfmETYH35P2IXccAmLlcRs44zxmrLTr6xBo+B1wrSG2WoFEWW/ALkMP/gEPi2NQBDlD60A4jll6UGLqhBQ50ZJLsQyZVoa6AjnhLyvynsqU3gIGUKIqrYF/WYjaHxEOKrpnuw02lmqfvYN1M0TCZJ31Y4L+716dFdeEjFb8ybSGFOmLH384Rn0D8vi6iZ9TlMDpc8xgVyPF+tVwqWUePv3WS2DjtWvm+HIJfjBXfiuQlTOExjCxhYQdd8UAa9iGPb3tkkCo87hDeo65IeTrgohqZ+zfPwed1g+EMut+TRK1xX1cSV8oFs7eb+1C4FlIqB/aAv1Xb4y/N55wosJC4DUfWBUqSdjnMf+j3f2Wlz+0PLxa+7PMDh+rwaL83LCOjdxZWQp1MEyomOSi6k1F2HCj4rltroISEOEy8zd//cGEvZ71xMOieUXgVQty5mzrKOBJt4yUDGNczC5HWgvOWSUQQhr0w3ooFThmFNTL7mIZeEdwgGUj0nbYXZCLRWWpk/TiWCfEZ4Uy2+9z2G+WhBWPHDgwK6urq5txWJx8/Dw8ATGrANmMReP5a3VV0KsJKhZauSFJ1lhAr1j7kJQYb+1trW19ZG2traNp06dkvv37y/39vbKwcFBMT09faWurq6qvb3d3rNnzxHkeX+CzOfE8qt3sTaBTEvSPza0E46RPqbMOdv6lpaWnYcPH97Q2NgoSqWS6OvrkwMDA3J+fl6SFlZNTU2J5uZmMTMz87SLvIMgz5m/7NGu1LOMfIUWKuxBjhFaScNK1dXVcm5uTpw9e5axYszs7Kyora2VII1fvz1ucIGveSmnI8fIbB9uaGiob2pqWlMoFMTIyMh/COzo6LBZOzs7Ow8NDQ1xo+DZtOvc/5twRD5KBJ2wbXtkdHS03NPT8w/4Ox1boMDyCbor21bLTctVRmItkuGqffv2Lezdu/d5STI+Pj7V3d1NSjnC25GvieUud0ZgiHC93LR7927enBL9/f2seYOEL1bbjf4twAD8sqEzJ5yLRwAAAABJRU5ErkJggg=="),i.imageStyle=new ol.style.Icon({src:n,anchor:e.anchorPosition||[.5,.5]}),i.singleVectorObliqueResolutionFactor=Object(u["h"])(e.singleVectorObliqueResolutionFactor,2),i.activeOnStartup=e.activeOnStartup||!1,i.showOnlyActiveObliqueTile=!1;var r={fill:{color:"rgba(255,255,255,0.1)"},stroke:{color:"#a8c02b",width:1}},a={fill:{color:"rgba(255,255,255,0.8)"},stroke:{color:"#a8c02b",width:3}};return null!=e.oblique&&(i.showOnlyActiveObliqueTile=e.oblique.showOnlyActiveTile||!1,r=e.oblique.unselectedStyle||r,a=e.oblique.selectedStyle||a),i.unselectedObliqueTileStyle=new ol.style.Style({fill:r.fill?new ol.style.Fill(r.fill):null,stroke:r.stroke?new ol.style.Stroke(r.stroke):null}),i.selectedObliqueTileStyle=new ol.style.Style({fill:a.fill?new ol.style.Fill(a.fill):null,stroke:a.stroke?new ol.style.Stroke(a.stroke):null}),i.featureSet=!1,i.layerName=e.layerName||null,i.selectInteraction=null,i.layer=null,i.vectorSource=new ol.source.Vector({}),i.overviewMap=null,i.activeListener=null,i.oblique=!1,i.values={active:!1},i.initialized=!1,i._cachedViewPoint=null,i.minimumHeight=Object(u["h"])(e.minimumHeight,150),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.OverviewMap"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e||!this.layerName)return!1;this.layer=this.framework.getLayerByName(this.layerName);try{o(this.layer,[Sr,Fr,Hr,wr])}catch(i){return!1}this.mapActivatedSubscribeKey=this.framework.subscribe(B.MAP_ACTIVATED,this.resetOverviewWidget.bind(this)),this.initialized=!0,this.initializedFinished()}return!0}},{key:"resetOverviewWidget",value:function(){this.values.active&&(this.deactivate(),this.activate())}},{key:"createMap",value:function(){var e=this,t=this.layer.getImplementationObject(Hi.className),i=t.getOLLayer(),n=new ol.layer.Vector({source:this.vectorSource});return this.overviewMap=new ol.Map({target:this.mapContainerId,layers:[i,n],controls:[],interactions:[],renderer:"canvas"}),i.setVisible(!0),this.overviewMap.setSize([320,190]),new Promise(function(t){e.overviewMap.once("postrender",t)})}},{key:"updateSize",value:function(){this.overviewMap&&(this.overviewMap.updateSize(),this.oblique||this.addCameraFeature())}},{key:"activate",value:function(){var e=this;this.values.active=!0;var i=this.overviewMap?Promise.resolve():this.createMap();i.then(function(){Se(b(t.prototype),"activate",e).call(e),e.overviewMap.once("postcompose",e.updateSize,e);var i=e.framework.getActiveMap();i instanceof Vt?e.initializeForCesium(i):i instanceof Hi?e.initializeForOpenlayers(i):i instanceof Pi&&e.initializeForOblique(i)})}},{key:"deactivate",value:function(){this.activeListener&&(this.activeListener(),this.activeListener=null),Se(b(t.prototype),"deactivate",this).call(this),this.values.active=!1,this.vectorSource.clear(),this.featureSet=!1}},{key:"initializeForCesium",value:function(e){if(e.isInitialized()){var t=e.getCesiumWidget(),i=t.scene;this.addCameraFeature(),this.activeListener=i.postRender.addEventListener(this.addCameraFeature,this)}}},{key:"initializeForOpenlayers",value:function(e){var t=e.getOl3Map();this.addCameraFeature();var i=t.on("postrender",this.addCameraFeature,this);this.activeListener=function(){ol.Observable.unByKey(i)}}},{key:"initializeForOblique",value:function(e){var t=this;this.vectorSource.clear();var i=[];i.push(new ol.interaction.DragPan),i.push(new ol.interaction.MouseWheelZoom),i.push(new ol.interaction.PinchZoom),i.push(new ol.interaction.DragZoom),this.selectInteraction=new ol.interaction.Select({style:this.selectedObliqueTileStyle}),i.push(this.selectInteraction),i.forEach(function(e){t.overviewMap.addInteraction(e)});var n=this.overviewMap.on("singleclick",function(e){if(t.overviewMap.hasFeatureAtPixel(e.pixel)){var i=0;t.overviewMap.forEachFeatureAtPixel(e.pixel,function(e){if(!(i>=1)){var n=e.getId();t.obliqueDirection.setImageOnMap(n),i+=1}})}else e.stopPropagation()});e.activeLayer&&(this.obliqueDirectionChange(e.activeLayer),this.obliqueImageChange(e.activeLayer));var r=[];r.push(this.framework.subscribe(B.LAYER_ACTIVATED,this.obliqueLayerActivated,this)),r.push(this.framework.subscribe(B.LAYER_DEACTIVATED,this.obliqueLayerDeactivated,this)),r.push(this.framework.subscribe(B.OBLIQUE_DIRECTION_CHANGED,this.obliqueDirectionChange,this)),r.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChange,this)),this.activeListener=function(){t.obliqueDirection&&t.overviewMap.removeLayer(t.obliqueDirection.footPrintsLayer),i.forEach(function(e){t.overviewMap.removeInteraction(e)}),r.forEach(function(e){t.framework.unsubscribeByKey(e)}),ol.Observable.unByKey(n),t.oblique=!1},this.oblique=!0}},{key:"obliqueLayerDeactivated",value:function(e){e instanceof Di&&(this.selectInteraction.getFeatures().clear(),this.obliqueDirection&&this.overviewMap.removeLayer(this.obliqueDirection.footPrintsLayer))}},{key:"obliqueLayerActivated",value:function(e){e instanceof Di&&(this.obliqueDirectionChange(e),this.obliqueImageChange(e))}},{key:"obliqueDirectionChange",value:function(e,t){var i=this;if(this.obliqueDirection&&this.overviewMap.removeLayer(this.obliqueDirection.footPrintsLayer),this.obliqueDirection=t||e.currentDirection,this.obliqueDirection){var n=this.obliqueDirection.footPrintsLayer;this.showOnlyActiveObliqueTile?n.setStyle(function(e){var t=i.obliqueDirection.currentImage;return t&&!e.getId()===t.name?i.unselectedObliqueTileStyle:null}):n.setStyle(this.unselectedObliqueTileStyle),this.overviewMap.addLayer(n)}}},{key:"obliqueImageChange",value:function(e,t){if(this.obliqueDirection){var i=t||e.currentImage,n=this.selectInteraction.getFeatures();n.clear();var r=this.obliqueDirection.footPrintsLayer.getSource().getFeatureById(i.name);if(r){this.selectInteraction.getFeatures().push(r),this.overviewMap.getView().fit(r.getGeometry().getExtent());var a=this.overviewMap.getView().getResolution();this.overviewMap.getView().setResolution(a*this.singleVectorObliqueResolutionFactor)}}}},{key:"_detectChange",value:function(e,t,i){var n=!0;if(this.featureSet&&this._cachedViewPoint){var r=this._cachedViewPoint.position.some(function(t,i){return e[i]!==t});n=r||this._cachedViewPoint.heading!==t||this._cachedViewPoint.distance!==i}return n&&(this._cachedViewPoint={position:e,heading:t,distance:i}),n}},{key:"addCameraFeature",value:function(){var e=this.framework.getActiveMap().getViewPoint();if(e&&e.isValid()){var t=e.getGroundPosition(),i=e.getCameraPosition()||t,n=e.getHeading(),r=e.getDistance();!i[2]||r&&r<4*i[2]||(r=4*i[2]);var a=!this._detectChange(i,n,r);if(!a){var s=Pe.getInstance();if(s.values.walkmode&&(r=s.referenceHeight),r=r>this.minimumHeight?r:this.minimumHeight,null!=n&&null!=r){var o;if(this.featureSet)o=this.vectorSource.getFeatureById("cameraFeature");else{var l=new ol.geom.Point([i[0],i[1]]);o=new ol.Feature({geometry:l}),o.setId("cameraFeature"),o.setStyle(new ol.style.Style({image:this.imageStyle})),this.vectorSource.addFeature(o),this.featureSet=!0}o.getGeometry().setCoordinates(R.wgs84ToMercator(i));var c=e.getHeading(),u=Cesium.Math.toRadians(c);this.imageStyle.setRotation(u),e.setHeading(0),e.setCameraPosition(i),e.setGroundPosition(null),e.setDistance(4*r),Hi.prototype.gotoViewPoint.call({ol3map:this.overviewMap},e)}}}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.layerName=this.layerName,e.iconStyleObject={src:this.imageStyle.getSrc(),anchor:this.imageStyle.getAnchor()},e.minimumHeight=this.minimumHeight,e}},{key:"dispose",value:function(){this.deactivate(),this.framework.unsubscribeByKey(this.mapActivatedSubscribeKey)}}]),t}(ra),Nd=Fd,Hd=i(650),Rd=i.n(Hd);function zd(e,t){return!e.active||e.cesium3DTileset.tilesLoaded?Promise.resolve():new Promise(function(i){var n,r=e.cesium3DTileset.allTilesLoaded.addEventListener(function(){n&&clearTimeout(n),r(),i()});null!=t&&(n=setTimeout(function(){r(),i()},t))})}function Gd(e,t){return e.tilesLoaded?Promise.resolve():new Promise(function(i){var n,r=e.tileLoadProgressEvent.addEventListener(function(e){e<1&&(n&&clearTimeout(n),r(),i())});null!=t&&(n=setTimeout(function(){r(),i()},t))})}function Vd(e){return new Promise(function(t){var i,n=e.getLayers().getArray().filter(function(e){return e instanceof ol.layer.Tile&&e.getVisible()}).map(function(e){return e.getSource()}),r=n.length,a=new Array(3*r),s=-1,o=0,l=null;function c(){o+=1}function u(){s+=1,l&&(clearTimeout(l),l=null),o<=s&&(l=setTimeout(function(){ol.Observable.unByKey(a),t(i)},500))}e.once("postcompose",function(e){if(i=e.context.canvas,0===r)setTimeout(function(){t(i)},500);else{for(var s=0;s<r;s++)a[s]=n[s].on("tileloadstart",c),a[s+1]=n[s].on("tileloadend",u),a[s+2]=n[s].on("tileloaderror",u);u()}}),e.renderSync()})}var Bd=i(669),Ud=i.n(Bd);function Wd(e,t){var i=document.createElement("a");i.download=t,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function qd(e,t){window.navigator.msSaveBlob?window.navigator.msSaveOrOpenBlob(e,t):Wd(URL.createObjectURL(e),t)}function Jd(e,t){window.navigator.msSaveBlob?qd(new Blob([e]),t):Wd("data:text/plain;charset=utf-8, ".concat(encodeURIComponent(e)),t)}function Kd(e,t,i){null!=e.toBlob?e.toBlob(function(e){qd(e,t)},i):window.navigator.msSaveBlob&&qd(e.msToBlob(),t)}var Zd={LANDSCAPE:"landscape",PORTRAIT:"portrait",BOTH:"both"},Qd=Y.getLogger("vcs.vcm.widgets.PDFCreator"),Xd=16777216,$d=4194304;function em(e){var t=e;if(Array.isArray(t)){if(4===t.length)return t;if(2===t.length)return[t[0],t[1],t[0],t[1]];t=t[0]}var i=Object(u["h"])(t,40);return new Array(4).fill(i)}var tm,im,nm=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.libraryPromise=null,i.formatList=e.formatList||["A5","A4","A3","A2"],i.orientationMode=Object(u["f"])(e.orientationMode,Zd,Zd.BOTH);var n=i.orientationMode;return n===Zd.BOTH&&(n=Object(u["f"])(e.defaultOrientation,Zd,Zd.PORTRAIT)),n===Zd.BOTH&&(n=Zd.PORTRAIT),i.defaultOrientation=n,i.title=e.title||null,i.titleImage=e.titleImage||null,i.copyrightText=e.copyrightText||null,i.showTitle=Object(u["e"])(e.showTitle,!0),i.showTitleImage=Object(u["e"])(e.showTitleImage,!0),i.showCopyright=Object(u["e"])(e.showCopyright,!0),i.showComment=Object(u["e"])(e.showComment,!1),i.showTitleInput=Object(u["e"])(e.showTitleInput,!1),i.showBalloons=Object(u["e"])(e.showBalloons,!0),i.showNorthPoint=Object(u["e"])(e.showNorthPoint,!0),i.showHeaderLine=Object(u["e"])(e.showHeaderLine,!0),i.showScreenshotDownload=Object(u["e"])(e.showScreenshotDownload,!1),i.coordinateProjection=e.projection?new R(e.projection):i.framework.projection,i.imageMimetype=e.imageMimetype||"image/png",i.headerText=e.headerText||null,i.subText=e.subText||null,i.aspectRatio={landscape:Object(u["g"])(e.aspectRatioLandscape,2.22222),portrait:Object(u["g"])(e.aspectRatioPortrait,2.22222)},i.titleImageRatio=Object(u["g"])(e.titleImageRatio,.125),i.pageMargins=em(e.pageMargins),i.defaultRenderingWidth={portrait:Object(u["h"])(e.renderingWidthPortrait,1920),landscape:Object(u["h"])(e.renderingWidthLandscape,1920)},i.warningPixelCount=Object(u["h"])(e.warningPixelCount,i.getPixelCount("A4","landscape",300)),i.headerLineColor=e.headerLineColor||null,i.headerLine={table:{widths:["*"],heights:[.1],body:[[{text:"",fillColor:i.headerLineColor,border:[!1,!1,!1,!1]}]]},layout:"noBorders"},i.footer=e.footer||{},i.header=e.header||{},i.info=e.info||{},i.styles={header:{fontSize:9,bold:!0,margin:[0,0,2,0]},subheader:{bold:!0,fontSize:8,margin:[0,10,0,2]},copyright:{fontSize:6,italics:!0,alignment:"right",padding:[10,10,10,10],margin:[0,-7,1.5,0],color:"#000000",background:"#eeeeee"},tableHeader:{bold:!0,fontSize:8,color:"black"},subheaderText:{fontSize:8}},e.styles&&"object"===Object(s["a"])(e.styles)&&Object.assign(i.styles,e.styles),i.northPointImage=e.northPointImage||Ud.a,i.loadedTimeout=Object(u["h"])(e.loadedTimeout,3e4),i.floatPrecision=Object(u["h"])(e.floatPrecision,2),i._cancelled=!1,i._reset=function(){},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.PDFCreator"}}]),Object(m["a"])(t,[{key:"createTemplate",value:function(e,i,n,r,a){if(!Rd.a[e])return Qd.warning("Incorrect format"),{};var o=this.getImagePixel(e,i),l={pageSize:e,pageOrientation:i,content:[],images:{},pageMargins:this.pageMargins,info:this.info},c=this.copyrightText||t.getCopyrightText();if(n.copyright=c,this.headerText){var u,h=t.getJSONFromInput(this.headerText,n);if(Array.isArray(h))(u=l.content).push.apply(u,Object(T["a"])(h));else"object"!==Object(s["a"])(h)&&"string"!==typeof h||l.content.push(h)}else{var d={columns:[]},m=this.title||r;d.columns.push({width:"*",text:this.showTitle?"\n".concat(m):"",style:"header"}),this.showTitleImage&&d.columns.push({width:o[1]*this.titleImageRatio*2+40,image:"titleImage",alignment:"right",margin:[0,0,0,4],fit:[o[1]*this.titleImageRatio*2,o[1]*this.titleImageRatio]}),l.content.push(d)}if(this.showHeaderLine){if(!this.headerLineColor){var f=t.getHeaderBottomColorFromElements();this.headerLine.table.body[0][0].fillColor=f}l.content.push(this.headerLine)}if(l.content.push({image:"screenshot",fit:o}),this.showNorthPoint){var y=o[1]*this.titleImageRatio;l.content.push({image:"northPoint",width:y,absolutePosition:{x:this.pageMargins[0]+o[0]-10-y,y:this.pageMargins[1]+20+y}})}if(this.showCopyright&&c&&l.content.push({text:c,style:"copyright"}),l.content.push("\n"),this.subText){var g,v=this.subText,p=t.getJSONFromInput(v,n);if(Array.isArray(p))(g=l.content).push.apply(g,Object(T["a"])(p));else"object"!==Object(s["a"])(p)&&"string"!==typeof p||l.content.push(p)}return l.images={},this.showTitleImage&&(this.titleImage||a)&&(l.images.titleImage=this.titleImage||a),l.styles=this.styles,l.header=t.getJSONFromInput(this.header,n),l.footer=t.getJSONFromInput(this.footer,n),l}},{key:"collectAdditionalInformation",value:function(e){var i=this,n=ne.getInstance().getActiveMap(),r=new Date;if(e.date="".concat(r.getUTCDate(),".").concat(r.getUTCMonth()+1,".").concat(r.getUTCFullYear()),n){n instanceof Pi&&(e.obliqueImage=n.getCurrentImage());var a=n.getViewPoint(!0,!0);return a.then(function(n){var r=R.createGeographicProjection(),a=n.clone();return a.groundPosition=a.groundPosition?i.coordinateProjection.transformFrom(r,a.groundPosition):a.groundPosition,a.cameraPosition=a.cameraPosition?i.coordinateProjection.transformFrom(r,a.cameraPosition):a.cameraPosition,e.projection=i.coordinateProjection,e.viewpoint=t.viewpointToFixed(n,i.floatPrecision),e.transformedViewpoint=t.viewpointToFixed(a,i.floatPrecision),e})}return Promise.resolve(e)}},{key:"getTitleImage",value:function(){if(this.titleImage)return Promise.resolve(this.titleImage);var e=document.getElementsByClassName("logo-box"),t=e.length>0?e[0]:null;return t?(0===t.clientHeight&&(t.style.height="5.5rem"),window.html2canvas(t,{scale:3}).then(function(e){return e.toDataURL()})):Promise.reject(new Error("Could get Image DOM"))}},{key:"getTitle",value:function(){if(this.title)return Promise.resolve(this.title);var e=document.getElementsByClassName("vcm_copyright_headerTitle"),t=e.length>0?e[0]:null;return t?Promise.resolve(t.textContent):Promise.reject(new Error("Could get Title from DOM"))}},{key:"rotateNorthArrow",value:function(e){var t=this;return this.showNorthPoint?new Promise(function(i,n){var r=t.northPointImage,a=document.createElement("canvas"),s=68,o=68;a.width=s,a.height=o;var l=a.getContext("2d"),c=new Image;c.onload=function(){l.translate(s/2,o/2),l.rotate(-Cesium.Math.toRadians(e)),l.translate(-s/2,-o/2),l.drawImage(c,0,0),i(a.toDataURL())},c.onerror=function(){n(new Error("could not load northArrow"))},c.src=r}):Promise.resolve("")}},{key:"getPixelCount",value:function(e,t,i){var n=this.defaultRenderingWidth[t],r=this.getImageWidth(e,t),a=r/n,s=a*i/72;return n*s*(n/this.aspectRatio[t]*s)}},{key:"getScale",value:function(e,t,i){var n=this.defaultRenderingWidth[t],r=this.getImageWidth(e,t),a=r/n,s=a*i/72,o=n*s*(n/this.aspectRatio[t]*s),l=ne.getInstance().isIE11?$d:Xd;if(o>l){var c=Math.sqrt(l/o);return Math.round(s*c*100)/100}return Math.round(100*s)/100}},{key:"getImageWidth",value:function(e,t){var i=Rd.a[e],n="portrait"===t?i[0]:i[1],r=n-this.pageMargins[0]-this.pageMargins[2];return r}},{key:"getImagePixel",value:function(e,t){var i=this.getImageWidth(e,t);return[i,i/this.aspectRatio[t]]}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished()}return!0}},{key:"_cancelCheck",value:function(){if(this._cancelled)throw new Error("cancelled")}},{key:"cancelRunning",value:function(){this._cancelled=!0,this._reset(),this._reset=function(){}}},{key:"createPDF",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n,r){var a,s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._renderImage(t,i,n);case 2:return a=e.sent,s=a.toDataURL(),e.abrupt("return",this.makePDF(s,t,i,r));case 5:case"end":return e.stop()}},e,this)}));function t(t,i,n,r){return e.apply(this,arguments)}return t}()},{key:"createImage",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n){var r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._renderImage(t,i,n);case 2:return r=e.sent,Kd(r,"screenshot.png",this.imageMimetype),e.abrupt("return",!0);case 5:case"end":return e.stop()}},e,this)}));function t(t,i,n){return e.apply(this,arguments)}return t}()},{key:"_renderImage",value:function(){var e=Yu(regeneratorRuntime.mark(function e(i,n,r){var a,s,l,c,u;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return o(i,String),o(n,["landscape","portrait"]),o(r,Number),this._cancelled=!1,this.libraryPromise||(this.libraryPromise=this.framework.loadLibraries(["lib/vcm_pdf_thirdparty.js"])),e.next=7,this.libraryPromise;case 7:if(this._cancelCheck(),a=document.createElement("canvas"),s=this.defaultRenderingWidth[n],l=this.getScale(i,n,r),c=[s,s/this.aspectRatio[n]],a.width=c[0]*l,a.height=c[1]*l,u=this.framework.getActiveMap(),e.prev=15,!(u instanceof Vt)){e.next=23;break}return this._reset=t.prepareCesiumMap(u,c,l),e.next=20,this.getImageFromCesium(u,a);case 20:a=e.sent,e.next=31;break;case 23:if(!(u instanceof Hi||u instanceof Pi)){e.next=30;break}return this._reset=t.prepareOlMap(u,c,l),e.next=27,this.getImageFromOpenlayers(u,a);case 27:a=e.sent,e.next=31;break;case 30:throw new Error("wrong Map");case 31:return this._cancelCheck(),e.next=34,this.copyBalloon(a,c,l);case 34:a=e.sent,this._cancelCheck();case 36:return e.prev=36,this._reset(),this._reset=function(){},e.finish(36);case 40:return e.abrupt("return",a);case 41:case"end":return e.stop()}},e,this,[[15,,36,40]])}));function i(t,i,n){return e.apply(this,arguments)}return i}()},{key:"copyBalloon",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n){var r,a,s,o,l,c,u,h,d,m;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(r=document.getElementById("balloonContainer"),a=Object(Ie["a"])(i,2),s=a[0],o=a[1],!this.showBalloons||!r){e.next=12;break}return e.next=5,window.html2canvas(r,{width:s,height:o,scale:n,backgroundColor:null});case 5:for(l=e.sent,c=t.getContext("2d"),u=c.getImageData(0,0,s*n,o*n),h=l.getContext("2d").getImageData(0,0,s*n,o*n),d=!1,m=0;m<u.data.length;m+=4)0!==h.data[m+3]&&(d=!0,u.data[m]=h.data[m],u.data[m+1]=h.data[m+1],u.data[m+2]=h.data[m+2],u.data[m+3]=h.data[m+3]);d&&c.putImageData(u,0,0);case 12:return e.abrupt("return",t);case 13:case"end":return e.stop()}},e,this)}));function t(t,i,n){return e.apply(this,arguments)}return t}()},{key:"getImageFromCesium",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i){var n,r,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return n=t.getCesiumWidget(),n.render(),r=ne.getInstance().getLayers().map(function(e){if(e.active){if(e instanceof Hn)return zd(e,a.loadedTimeout);if(e instanceof Er)return zd(e.getImplementation(t),a.loadedTimeout)}return!1}).filter(function(e){return e}),r.push(Gd(n.scene.globe,this.loadedTimeout)),e.next=6,Promise.all(r);case 6:return this._cancelCheck(),e.abrupt("return",new Promise(function(e,t){var r=n.scene.postRender.addEventListener(function(){if(r(),a._cancelled)t(new Error("cancelled"));else{var s=i.getContext("2d");s.drawImage(n.scene.canvas,0,0),e(i)}})}));case 8:case"end":return e.stop()}},e,this)}));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"getImageFromOpenlayers",value:function(e,t){var i=this,n=e.getolMap();return Vd(n).then(function(e){i._cancelCheck();var n=t.getContext("2d");return n.drawImage(e,0,0),t})}},{key:"makePDF",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n,r){var a,s,o,l,c,u,h,d;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=ne.getInstance().getActiveMap().getViewPoint(!1,!1),s=a.getHeading(),e.next=4,this.getTitle();case 4:return o=e.sent,e.next=7,this.getTitleImage();case 7:return l=e.sent,e.next=10,this.rotateNorthArrow(s);case 10:return c=e.sent,e.next=13,this.collectAdditionalInformation(r);case 13:return u=e.sent,h=r.title||o,u.title=h,d=this.createTemplate(i,n,u,h,l),d.images.screenshot=t,this.showNorthPoint&&(d.images.northPoint=c),this._cancelCheck(),e.abrupt("return",new Promise(function(e){window.pdfMake.createPdf(d).download("map.pdf",e)}));case 21:case"end":return e.stop()}},e,this)}));function t(t,i,n,r){return e.apply(this,arguments)}return t}()}],[{key:"removeMapSpecificContent",value:function(e){var t=ne.getInstance().getActiveMap();Object(u["a"])(e,function(e){e&&(e.oblique||e.cesium||e.openlayers)&&(t instanceof Pi&&!e.oblique?e.text="":t instanceof Vt&&!e.cesium?e.text="":t instanceof Hi&&!e.openlayers&&(e.text=""))})}},{key:"getJSONFromInput",value:function(e,i){var n=e,r=ne.getInstance().getLocale();null!=n[r]&&(n=n[r]);var a=n;if("string"===typeof a)try{a=JSON.parse(n)}catch(o){Qd.warning(o.message)}null!=a[r]&&(a=a[r]);var s=JSON.stringify(a);s=t.replaceTokensInString(s,i);try{a=JSON.parse(s)}catch(o){Qd.warning(o.message),a=[]}return t.removeMapSpecificContent(a),a}},{key:"replaceTokensInString",value:function(e,t){var i=e,n=i.match(/\$\{(.*?)\}/g);return n&&Array.isArray(n)&&n.forEach(function(e){for(var n=e.substring(2,e.length-1),r=n.split("."),a=t,s=0;s<r.length;s++)a=a&&a[r[s]]?a[r[s]]:"";a="".concat(a).replace(/\n/g,"\\n"),i=i.replace(new RegExp("\\$\\{".concat(n,"\\}"),"g"),a)}),i}},{key:"viewpointToFixed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i={heading:e.heading.toFixed(t),pitch:e.pitch.toFixed(t),roll:e.roll.toFixed(t)};return null!=e.distance&&(i.distance=e.distance.toFixed(t)),e.cameraPosition&&(i.cameraPosition=e.cameraPosition.map(function(e){return e.toFixed(t)})),e.groundPosition&&(i.groundPosition=e.groundPosition.map(function(e){return e.toFixed(t)})),i}},{key:"getHeaderBottomColorFromElements",value:function(){var e=document.getElementsByTagName("header"),t=e.length>0?e[0]:null;if(t){var i=window.getComputedStyle(t);if(i){var n=i.getPropertyValue("border-bottom-color");if(n){var r=Be(n);return qe(r)}}}return"#a8c02b"}},{key:"getCopyrightText",value:function(){var e=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Copyright"),t="";if(e){var i=e.layerItems,n={};i.forEach(function(e){var t=n[e.provider];if(t){var i=t.years.indexOf(e.year);-1===i&&(t.years.every(function(t){return Number(t)<Number(e.years)})&&(t.url=e.url),t.years.push(e.year))}else n[e.provider]={years:[e.year],url:e.url}});var r=!0;return Object.keys(n).forEach(function(e){r?r=!1:t+=" | ",t+="© ",t+=e,t+=" ",t+=n[e].years.join(", ")}),t}return""}},{key:"prepareCesiumMap",value:function(e,i,n){var r=e.getCesiumWidget(),a=r.resolutionScale;return t.prepareMapForRender(e,i),r.resolutionScale=n,function(){r.resolutionScale=a,t.prepareMapForRender(e)}}},{key:"prepareOlMap",value:function(e,i,n){t.prepareMapForRender(e,i);var r=Object(Ie["a"])(i,2),a=r[0],s=r[1],o=e.getolMap(),l=o.getSize(),c=o.getView().calculateExtent(l),u=[a*n,s*n];return o.setSize(u),o.getView().fit(c,{size:u,constrainResolution:!1}),o.set("vcs_scale",n,!0),function(){t.prepareMapForRender(e),o.setSize(l),o.getView().fit(c,{size:l,constrainResolution:!1}),o.unset("vcs_scale",!0),o.renderSync()}}},{key:"prepareMapForRender",value:function(e,t){var i,n;if(t){var r=Object(Ie["a"])(t,2);i=r[0],n=r[1],i="".concat(i,"px"),n="".concat(n,"px")}else i="auto",n="auto";e.mapElement.style.width=i,e.mapElement.style.height=n,e.disableMovement(!!t)}}]),t}(ra),rm=nm,am=function(e){function t(e,i,n,r){var a;return Object(d["a"])(this,t),a=y(this,b(t).call(this)),a.position=e,a.positionDecimalPlaces=n,a.targetTransform="EPSG:3857"!==i.epsg?R.getTransformer(i,R.createMercatorProjection()):null,a._defaultActive=r?me.CLICK|me.MOVE:me.CLICK,a.setActive(),a}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!e.position.every(function(e){return 0===e})){var t=e.position;this.targetTransform&&(t=this.targetTransform(e.position,t.slice(),3));var i=3;while(i--)this.position[i]=t[i].toFixed(this.positionDecimalPlaces)}return Promise.resolve(e)}}]),t}(pe),sm=am,om=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.position={0:null,1:null,2:null},i.template=e.template||null,i.obliqueImage={name:null,direction:null},i.interaction=new sm(i.position,new R(e.projection),Object(u["h"])(e.positionDecimalPlaces,2),!!e.onMove),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.PositionDisplay"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return this.initialized||(this.framework.subscribe(B.OBLIQUE_DIRECTION_CHANGED,this.obliqueImageChanged,this),this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChanged,this),this.framework.subscribe(B.LAYER_ACTIVATED,this.obliqueImageChanged,this),this.initialized=!0,xn().addPersistentInteraction(this.interaction),this.initializedFinished()),!0}},{key:"obliqueImageChanged",value:function(e){if(e instanceof Di){var t=e.currentImage;this.obliqueImage.name=t.name,this.obliqueImage.direction=Object(h["b"])(t.viewDirection)}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.positionDecimalPlaces=this.interaction.positionDecimalPlaces,e.template=this.template,e.projection=this.options.projection,e}}]),t}(ra),lm=om,cm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.currentTime=new Date,i.timezone=e.timezone||null,i.activateShadowsOnStartup=!!e.activateShadowsOnStartup,i.values={active:i.active,date:i.currentTime.getTime()},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Shadow"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.handleMapChangeEvent(this.framework.getActiveMap()),this.activateShadowsOnStartup&&this.toggleShadow(),this.initialized=!0}return!0}},{key:"activate",value:function(){Se(b(t.prototype),"activate",this).call(this),this.map.getScene().shadowMap.enabled=!0,this.setCurrentTimeToMap(),this.values.active=this.active}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.map.getScene().shadowMap.enabled=!1,this.map.setDay(this.map.defaultJDate),this.values.active=this.active}},{key:"handleURLParameter",value:function(e){e.shadowTime&&(this.setDate(new Date(e.shadowTime)),this.activate())}},{key:"getLink",value:function(e){this.values.active&&e.addQueryParams({shadowTime:this.currentTime.getTime()})}},{key:"toggleShadow",value:function(){this.map.getScene().shadowMap.enabled?this.deactivate():this.activate()}},{key:"setMinutesOfDay",value:function(e){o(e,Number),this.currentTime.setHours(Math.floor(e/60)),this.currentTime.setMinutes(e%60),this.setDate(this.currentTime)}},{key:"setDayOfYear",value:function(e){o(e,Number);var t=new Date(this.currentTime.getFullYear(),0,e);this.currentTime.setMonth(t.getMonth()),this.currentTime.setDate(t.getDate()),this.setDate(this.currentTime)}},{key:"setDate",value:function(e){o(e,Date),this.currentTime=e,this.values.date=this.currentTime.getTime(),this.setCurrentTimeToMap()}},{key:"setCurrentTimeToMap",value:function(){var e=Cesium.JulianDate.fromDate(this.currentTime);this.map.setDay(e)}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),e instanceof Vt&&(this.map=e)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.activateShadowsOnStartup=this.activateShadowsOnStartup,e.timezone=this.timezone,e}}]),t}(ra),um=cm,hm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.cb=e,i._defaultActive=me.CLICKMOVE,i.paused=!1,i.coordinate=null,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.MOVE?e.position.every(function(e){return 0===e})||this.cb(e.position):e.type&me.CLICK&&(this.paused?e.feature&&e.feature.id&&"transparentTerrainBox"===e.feature.id._id&&(this.paused=!1,this.setActive(me.CLICKMOVE)):(this.paused=!0,this.setActive(me.CLICK))),Promise.resolve(e)}}]),t}(pe),dm=hm,mm=i(670),fm=i.n(mm),ym=new Cesium.Matrix4,gm=function(e){function t(e){var i,n,r;(Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.boxSize=e.boxSize?Cesium.Cartesian3.fromArray(e.boxSize):new Cesium.Cartesian3(100,100,50),i.boxSize.z=-Math.abs(i.boxSize.z),i.layerNames=e.layerNames||[],i.featureLayer=new Un({name:"_transparentTerrain"}),i.position=new Cesium.Cartesian3,i.scene=null,i.cesium3DTilesetCollection=new Map,i.supportedMaps=["vcs.vcm.maps.Cesium"],i._removeInteraction=null,e.color)?n="string"===typeof e.color?Cesium.Color.fromCssColorString(e.color):(r=Cesium.Color).fromBytes.apply(r,Object(T["a"])(e.color)):n=new Cesium.ImageMaterialProperty({image:fm.a,repeat:new Cesium.Cartesian2(Math.ceil(i.boxSize.x/20),Math.ceil(i.boxSize.y/20))});return i.material=n,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.TransparentTerrainMode"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.scene=this.framework.getActiveMap().getScene(),this.framework.addLayer(this.featureLayer),this.initialized=!0}return!0}},{key:"initClippingPlanes",value:function(){var e=this;this.box=new Cesium.Entity({id:"transparentTerrainBox",position:new Cesium.CallbackProperty(function(){return e.position},!1),box:new Cesium.BoxGraphics({dimensions:this.boxSize,material:this.material})}),this.featureLayer.addEntity(this.box),ym=this.box.computeModelMatrix(Cesium.JulianDate.now());var i=this.boxSize.x/2,n=this.boxSize.y/2,r=Math.abs(this.boxSize.z);this.scene.globe.clippingPlanes=t.createClippingPlane(i,n,r),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes=t.createClippingPlane(i,n,r)})}},{key:"activate",value:function(){this.featureLayer.activate(!0),this.active&&this.deactivate(),Se(b(t.prototype),"activate",this).call(this),this.framework.getLayers().filter(function(e){return e.isActive()&&e instanceof Hn}).forEach(this.setTilesets.bind(this));var e=this.scene.camera.positionCartographic.clone();e.height=0,this.position=Cesium.Cartographic.toCartesian(e,this.scene.globe.ellipsoid,this.position),this.initClippingPlanes();var i=new dm(this.translatePosition.bind(this));this._removeInteraction=xn().addExclusiveInteraction(i,this.deactivate.bind(this)),this.subscribeKey=this.framework.subscribe(B.LAYER_ACTIVATED,this.setTilesets.bind(this)),Q.getInstance().activateClickBehavior()}},{key:"deactivate",value:function(){this.active&&(Se(b(t.prototype),"deactivate",this).call(this),this._removeInteraction&&this._removeInteraction(),this.featureLayer.activate(!1),this.destroyClippingPlanes(),this.framework.unsubscribeByKey(this.subscribeKey),this.subscribeKey=null)}},{key:"setTilesets",value:function(e){if(this.layerNames.includes(e.name)&&e instanceof Hn&&!this.cesium3DTilesetCollection.has(e.name)&&e.cesium3DTileset){this.cesium3DTilesetCollection.set(e.name,e.cesium3DTileset);var i=this.boxSize.x/2,n=this.boxSize.y/2,r=Math.abs(this.boxSize.z);e.cesium3DTileset.clippingPlanes=t.createClippingPlane(i,n,r)}}},{key:"destroyClippingPlanes",value:function(){this.featureLayer.getEntities().removeAll(),this.scene.globe.clippingPlanes&&(this.scene.globe.clippingPlanes.removeAll(),this.scene.globe.clippingPlanes.enabled=!1,this.scene.globe.clippingPlanes=null),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes&&(e.clippingPlanes.removeAll(),e.clippingPlanes.enabled=!1,e.clippingPlanes=null)})}},{key:"translatePosition",value:function(e){var t=R.mercatorToWgs84(e),i=Object(Ie["a"])(t,3),n=i[0],r=i[1],a=i[2];this.position=Cesium.Cartesian3.fromDegrees(n,r,a+this.boxSize.z/2,Cesium.Ellipsoid.WGS84,this.position),this.scene.globe.clippingPlanes.modelMatrix=Cesium.Matrix4.setTranslation(ym,this.position,ym),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes.modelMatrix=Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(e._initialClippingPlanesOriginMatrix,e.clippingPlanes.modelMatrix),ym,e.clippingPlanes.modelMatrix)})}}],[{key:"createClippingPlane",value:function(e,t,i){return new Cesium.ClippingPlaneCollection({modelMatrix:ym,planes:[new Cesium.ClippingPlane(new Cesium.Cartesian3(1,0,0),-e),new Cesium.ClippingPlane(new Cesium.Cartesian3(-1,0,0),-e),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,1,0),-t),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,-1,0),-t),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,0,-1),-i)],edgeWidth:1,edgeColor:Cesium.Color.WHITE,enabled:!0})}}]),t}(ra),vm=gm,pm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.flightInstances=i.framework.getFlights(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Flight"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished()}return!0}},{key:"addFlight",value:function(e){this.flightInstances.push(e)}},{key:"deleteFlight",value:function(e){var t=this.flightInstances.indexOf(e);this.flightInstances.splice(t,1)}}]),t}(ra),_m=pm,bm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.featureTypeSymbol=e.featureTypeSymbol,i.cb=e.cb,i._defaultActive=me.DRAGSTART|me.DRAGEND,i._defaultModificationKey=de.ALT,i.setActive(!1),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.DRAGSTART&&e.feature&&e.feature[this.featureTypeSymbol]&nn.VERTEX?this._feature=!0:e.type&me.DRAGEND&&this._feature&&(this._feature=!1,this.cb()),Promise.resolve(e)}}]),t}(pe),Lm=bm,Mm=new Cesium.Cartesian3,km=new Cesium.Cartesian3,wm=new Cesium.Cartesian3,Tm=new Cesium.Cartographic,Sm=new Cesium.Cartographic,Om=new Cesium.Cartographic,Cm=new Map,Em=new gt({image:{fill:{color:[168,192,43,.8]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:[168,192,43,1],width:3},fill:{color:[168,192,43,.8]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),Im=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),e.style&&Em.assign(new gt(e.style)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.maxNrOfPoints=Object(u["h"])(e.maxNrOfPoints,5e4),i.maxCombinedMemoryUsage=Object(u["h"])(e.maxCombinedMemoryUsage,1024),i._cancelled=!1,i._geometryChangedCB=null;var n=Object(u["g"])(e.defaultResolution,2);return i.values={profilePoints:[],progress:0,running:!1,includeObjects:!0,resolution:n},i.allowSmallExport=Object(u["e"])(e.allowSmallExport,!0),i._cachedProfile=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.heightProfile.HeightProfile"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.featureLayer=new _n({projection:{epsg:3857},name:"_profile",style:Em,altitudeMode:"clampToGround",classificationType:"both"}),this.framework.addLayer(this.featureLayer),this.geometryEditor=new hl({allowedGeometries:["LineString"],defaultMode:"edit",dedicatedFeatureStyle:!1}),this.geometryEditor.initialize(),this.geometryEditor.addEditingLayer(this.featureLayer),this.geometryEditor.selectFeatureInteraction.onSelect(this._onSelect.bind(this)),this.geometryEditor.state.onlyAllowTranslation=!0,this.vertexChangedInteraction=new Lm({cb:this.calculateProfile.bind(this),featureTypeSymbol:this.geometryEditor.state.featureTypeSymbol}),this.initialized=!0,this.initializedFinished()}return!0}},{key:"activate",value:function(){var e=this;Se(b(t.prototype),"activate",this).call(this),this.geometryEditor.activate(),this._cachedProfile&&this.geometryEditor.setMode(tn.EDIT),this.featureLayer.activate(!0);var i=this.framework.getLayers().filter(function(e){return e.active&&(e instanceof Hn||e instanceof Er)});i.length>0&&i.forEach(function(t){var n;if(t instanceof Er){var r=t.getImplementation(e.framework.getActiveMap());n=r.cesium3DTileset}else n=t.cesium3DTileset;Cm.set(n,n.maximumMemoryUsage),n.maximumMemoryUsage=e.maxCombinedMemoryUsage/i.length})}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.cancel(),this._geometryChangedCB&&ol.Observable.unByKey(this._geometryChangedCB),this.geometryEditor.state.active&&(this.geometryEditor.interactionChain.removeInteraction(this.vertexChangedInteraction),this.vertexChangedInteraction.setActive(!1),this.geometryEditor.setMode(tn.NONE),this.geometryEditor.deactivate()),this.featureLayer.activate(!1),Cm.forEach(function(e,t){t.maximumMemoryUsage=e})}},{key:"cancel",value:function(){this._cancelled=!0,this._reset(),this._cachedProfile&&this.feature&&this.feature.getGeometry().setCoordinates(this._cachedProfile)}},{key:"_reset",value:function(){this.values.running=!1,this.values.progress=0,this._cachedProfile||this.featureLayer.removeAllFeatures()}},{key:"_onSelect",value:function(){this.geometryEditor.features.size?(this.geometryEditor.interactionChain.chain.includes(this.vertexChangedInteraction)||this.geometryEditor.interactionChain.addInteraction(this.vertexChangedInteraction),this.values.running?this.geometryEditor.selectFeatureInteraction.clearSelectionSet():this.vertexChangedInteraction.setActive()):(this.geometryEditor.interactionChain.removeInteraction(this.vertexChangedInteraction),this.vertexChangedInteraction.setActive(!1))}},{key:"newProfile",value:function(){this._reset(),this.feature=this.geometryEditor.createFeature("LineString","_profileLine"),this.feature.set("olcs_classificationType","both"),this._geometryChangedCB=this.feature.getGeometry().on("change",this.geometryChangedCallback.bind(this)),this.geometryEditor.setModeAndSelectFeature(tn.CREATE,this.feature)}},{key:"geometryChangedCallback",value:function(e){var t=e.target.getCoordinates(),i=t.length;i>2&&(this.geometryEditor.setMode(tn.EDIT),ol.Observable.unByKey(this._geometryChangedCB),this._geometryChangedCB=null,this.calculateProfile())}},{key:"calculateProfile",value:function(){var e=Yu(regeneratorRuntime.mark(function e(){var t,i,n,r,a,s,o,l,c,u,h,d,m=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this._cancelled=!1,this.geometryEditor.selectFeatureInteraction.clearSelectionSet(),this.values.running=!0,this.values.progress=0,t=this.framework.getActiveMap(),i=t.getScene(),n=this.values.includeObjects?i.sampleHeightMostDetailed.bind(i):Cesium.sampleTerrainMostDetailed.bind(null,i.terrainProvider),r=this.feature.getGeometry().getCoordinates(),a=R.mercatorToWgs84(r[0],r[0]),Cesium.Cartographic.fromDegrees(a[0],a[1],null,Tm),s=R.mercatorToWgs84(r[1],r[1]),Cesium.Cartographic.fromDegrees(s[0],s[1],null,Sm),o=new Cesium.EllipsoidGeodesic(Tm,Sm),l=o.surfaceDistance,c=Math.floor(l/this.values.resolution),c>this.maxNrOfPoints&&(c=this.maxNrOfPoints,this.values.resolution=Number((l/this.maxNrOfPoints).toFixed(1))),u=new Array(c),Cesium.Cartographic.toCartesian(Tm,null,Mm),Cesium.Cartographic.toCartesian(Sm,null,km),h=0;case 19:if(!(h<c)){e.next=31;break}return d=void 0,0===h?d=Tm:(Cesium.Cartesian3.lerp(Mm,km,h*this.values.resolution/l,wm),d=Cesium.Cartographic.fromCartesian(wm,null,Om)),e.next=24,n([d]);case 24:if(u[h]=d.height,!this._cancelled){e.next=27;break}return e.abrupt("break",31);case 27:this.values.progress=h/(c-1);case 28:h++,e.next=19;break;case 31:if(!(l/this.values.resolution-c>.01)){e.next=35;break}return e.next=34,n([Sm]);case 34:u.push(Sm.height);case 35:this._cancelled||(this._cachedProfile=this.feature.getGeometry().getCoordinates(),this.values.profilePoints=u.map(function(e,t){return new Cesium.Cartesian2(t*m.values.resolution,e)}),this.values.running=!1,this.values.progress=0);case 36:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"isActiveTerrain",value:function(){var e=this.framework.getLayers(),t=e.find(function(e){return e instanceof zt&&e.active});return!!t}}]),t}(ra),Dm=Im;i(654);function jm(e,t,i){var n=Q.getInstance(),r=e.slLayer;if(r===i.name){var a=e.slId?e.slId.toString():Object(u["c"])(),s=null,o=e.slPos;if(o){var l=o.split(",");s={longitude:parseFloat(l[0]),latitude:parseFloat(l[1]),height:parseFloat(l[2])}}if(i instanceof _n){var c=i.getFeatureById(a);s&&c?(c.set("clickedPosition",s),n.setCurrentItem(a,c,i)):s&&(c=new ol.Feature({}),c.setProperties(e.slAt||{}),c.clickedPosition=s,n.setCurrentItem(a,c,i))}else if(s){var h=e.slAt||{},d={attributes:h,clickedPosition:s};n.setCurrentItem(a,d,i)}else n.setCurrentItem(a,null,i);null!=tm&&t.unsubscribeByKey(tm)}}function Pm(e,t){null!=e.slLayer&&(tm=e.slLayer.startsWith("_searchResultVector")?t.subscribe(B.MAP_ACTIVATED,function(){var i=t.getLayerByName("_searchResultVector");i&&jm(e,t,i)}):t.subscribe(B.LAYER_ACTIVATED,jm.bind(null,e,t)))}function Ym(e,t){var i=a["a"].parse(window.location.href).getQueryParams();if(null!=i.startingmap&&(t.startingmap=i.startingmap),null==i.groundPosition&&null==i.cameraPosition||(t.startViewPoint=V.parseURLparameter(i)),i.verbose&&(Y.enabled=i.verbose),Pm(i,t),null!=i.allowSoftwareRendering){var n=e.maps.find(function(e){return"vcs.vcm.maps.Cesium"===e.type});n&&(n.allowSoftwareRendering=!0)}if(null!=i.layerToActivate){i.layerToActivate=Array.isArray(i.layerToActivate)?i.layerToActivate:[i.layerToActivate];var r=null;i.layerToActivate.forEach(function(e){var i=t.getLayerByName(e);i&&i instanceof Di&&!r&&(r=i,i.isDefaultObliqueLayer=!0)}),r&&t.getLayers().forEach(function(e){e instanceof Di&&e!==r&&(e.isDefaultObliqueLayer=!1)})}return i}function xm(e,t){var i,n,r;if(null!=e.layerToActivate){var a=e.layerToActivate;i=Array.isArray(a)?a:[a];for(var s=0;s<i.length;s++)n=i[s],r=t.getLayerByName(n),!r||r instanceof Di||r.activate(!0)}if(null!=e.layerToDeactivate){var o=e.layerToDeactivate;i=Array.isArray(o)?o:[o];for(var l=0;l<i.length;l++)n=i[l],r=t.getLayerByName(n),!r||r instanceof Di||(r.isCommonLayer()&&r.active&&r.sendLayerEvents(!1,!1),r.activate(!1))}(e["reset-token"]||e["verify-token"])&&Ps.getInstance().handleURLParameter(e),Object.values(t.widgets).forEach(function(t){return t.handleURLParameter(e)}),Object.values(t.maps).forEach(function(t){return t.handleURLParameter(e)}),Object.values(t.layers).forEach(function(t){return t.handleURLParameter(e)}),q.getInstance().handleURLParameter(e),Pe.getInstance().handleURLParameter(e)}function Am(e,t){function i(e,t){Object.keys(t).forEach(function(n){var r=t[n];"object"!==Object(s["a"])(r)||Array.isArray(r)||"object"!==Object(s["a"])(e[n])?e[n]=r:i(e[n],r)})}"object"===Object(s["a"])(e)&&("object"===Object(s["a"])(e.ui)&&i(t.config,{ui:e.ui}),Object.keys(e).filter(function(e){return/^ui_/.test(e)}).forEach(function(n){var r={},a=e[n],s=n.split("_");s.reverse().forEach(function(e,t){var i={};i[e]=t?r:a,r=i}),i(t.config,r)}))}B.FRAMEWORK_INITIALIZED="FRAMEWORK_INITIALIZED";var Fm=(im={},Object(oe["a"])(im,Vt.className,Vt),Object(oe["a"])(im,Hi.className,Hi),Object(oe["a"])(im,Pi.className,Pi),im),Nm=Y.getLogger();function Hm(e){return/maps/.test(e)?Fm[e]:/layer/.test(e)?Object.values(n).find(function(t){return t.className===e}):/widgets/.test(e)?Object.values(r).find(function(t){return t.className===e}):null}function Rm(e){if(!e.type)return Nm.warning("ObjectCreation failed: could not find type in options ".concat(e)),null;var t=Hm(e.type);if(!t)return Nm.warning("ObjectCreation failed: could not find javascript class of type ".concat(e.type)),null;var i=null;try{i=new t(e)}catch(n){Nm.warning("Error: ".concat(n)),i=null}return i||(Nm.warning("ObjectCreation failed: could not create new Object"),null)}function zm(e){var t=ne.getInstance(),i=Rm(e);i&&i instanceof At?(i[ne.configContentSymbol]=!0,t.addLayer(i)&&Nm.info("Loaded layer of type :".concat(e.type," with name: ").concat(e.name))):Nm.warning("Could not load Layer")}function Gm(e){var t=ne.getInstance(),i=Rm(e);i&&i instanceof Ee?t.addMap(i)&&Nm.info("Loaded map of type :".concat(e.type," with name: ").concat(e.name)):Nm.warning("Could not load map")}function Vm(e){var t=ne.getInstance();if(/Oblique\w+Measurement$/.test(e.type)){Nm.warning("Widget of type ".concat(e.type," is deprecated. Use ").concat(Dd.className," or ").concat(Pd.className," instead"));var i="vcs.vcm.widgets.ObliqueHeightMeasurement"===e.type?$h.OBLIQUE_HEIGHT:$h.OBLIQUE_DISTANCE,n=t.getWidgetByType(Dd.className);if(n||(n=t.getWidgetByType(Pd.className)),n)return void(n.allowedMeasurements.includes(i)||n.allowedMeasurements.push(i));e.type=Pd.className,e.allowedMeasurements=[i]}var r=Rm(e);r&&r instanceof ra?t.addWidget(r)&&(Nm.info("Loaded widget of type :".concat(e.type," with name: ").concat(e.name)),r.initialize()):Nm.warning("Could not load widget")}function Bm(e){if(e.name||e.id){var t;if(e.type===Fe.DECLARATIVE||e.declarativeStyle){if(t=new Tt(e),!t.cesiumStyle.ready)return void Nm.warning("declarative style: ".concat(e.name," has errors in the declarative style section and cannot be used"))}else t=new gt(e);t?(t[ne.configContentSymbol]=!0,ne.getInstance().addStyle(t),Nm.info("added ".concat(t.className," with name ").concat(t.name))):Nm.warning("could not create style item: ".concat(e.name))}else Nm.warning("styles need a name. please reconfigure the styles section.")}var Um=["vcs.vcm.widgets.legend.Legend","vcs.vcm.widgets.BalloonInfo","vcs.vcm.widgets.Measurement","vcs.vcm.widgets.SingleMeasurement","vcs.vcm.widgets.Planning"];function Wm(e,t){var i=t.selectBehavior||null;Q.getInstance(i),i=i||{};var n=i.excludedPickPositionEvents;n&&(n=Array.isArray(n)?n:[n]),i.excludedPickPositionEvents=n?n.map(function(e){var t=Object.keys(me).find(function(t){return t===e});return t?me[t]:null}).filter(function(e){return e}).reduce(function(e,t){return e|t},0):0,e.isIE11&&(i.pickTranslucent=i.pickTranslucent||!1,i.excludedPickPositionEvents=i.excludedPickPositionEvents||me.MOVE|me.DRAG),i.excludedPickPositionEvents&&(xn().featureInteraction.excludedPickPositionEvents=i.excludedPickPositionEvents),null!=i.pickTranslucent&&(xn().featureInteraction.pickTranslucent=i.pickTranslucent)}function qm(e){var t=ne.getInstance();if(e.logLevel&&(Y.enabled=e.logLevel),t.projection=new R(e.projection),t.mapcontainer=document.getElementById(e.mapcontainer),t.mapcontainer){for(var i in t.addElementsToMapContainer(),Array.isArray(e.styles)&&e.styles.forEach(Bm),Array.isArray(e.flights)&&e.flights.forEach(function(e){t.addFlight(new Bs(e))}),e.style&&(Nm.deprecate("style","use styles instead."),Array.isArray(e.style)&&e.style.forEach(Bm)),e.layers){var n=e.layers[i];zm(n)}for(var r in e.viewpoints){var a=e.viewpoints[r];t.createViewPointObject(a)}e.startViewPoint&&(t.startViewPoint=t.getViewPointByName(e.startViewPoint)),t.libraryBasePath=e.libraryBasePath||"",t.baseUrl=e.baseUrl||"",e.availableLocales=e.availableLocales||["de","en"],t.config=e,q.getInstance().initialize(e),t.handleUiPlugins(e.ui),Wm(t,e);var s=Ym(e,t);Array.isArray(e.maps)||(Nm.deprecate(".maps Object","Write an array, consistent with the other config keys (layers, widgets etc.)"),e.maps=Object.values(e.maps)),e.maps.forEach(function(e){Gm(e)});var o=t.getMapByName(t.startingmap);if(!o)for(var l in t.maps)t.maps[l].options.startingmap&&(o=t.maps[l]);o&&t.activateMap(o.name,t.startViewPoint);var c=e.widgets?e.widgets.sort(function(e,t){var i=Um,n=i.indexOf(e.type),r=i.indexOf(t.type);return n=n>-1?n:i.length+1,r=r>-1?r:i.length+1,n-r}):[];c.forEach(Vm),xm(s,t),Am(s,t);var u=document.getElementById("vcs_loading");u&&u.parentNode.removeChild(u),xn(),t.publish(B.FRAMEWORK_INITIALIZED),t.setInitialized(!0)}else alert("Could not find Container Element with id ".concat(e.mapcontainer))}function Jm(e){var t=ne.getInstance();t.getLogger().info("Sending request to load JSON config file [".concat(e,"]")),ce.a.get(e).then(function(e){qm(e.data)}).catch(function(e){Nm.log(e)})}function Km(){Yn.destroy(),Q.dispose(),ne.getInstance().dispose()}var Zm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.commonLayer=e.commonLayer,i.active=!1,i.initialized=!1,i}return w(t,e),Object(m["a"])(t,[{key:"isActive",value:function(){return this.active}},{key:"dispose",value:function(){this.initialized=!1}},{key:"show",value:function(){this.active=!0}},{key:"hide",value:function(){this.active=!1}},{key:"isInitialized",value:function(){return this.initialized}},{key:"mapActivated",value:function(e){return Promise.resolve()}},{key:"mapDeactivated",value:function(e){return Promise.resolve()}},{key:"updateStyle",value:function(e){}}]),t}(A),Qm=Zm,Xm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.clickListenerActivated=!1,i._removePostRenderHandler=function(){},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.VectorLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){this.olLayer=new ol.layer.Vector({renderOrder:null,visible:!1,source:this.commonLayer.getSource(),style:this.commonLayer.style.style,name:this.commonLayer.name,zIndex:this.commonLayer.getZIndex(),olcs_altitudeMode:this.commonLayer.altitudeMode,olcs_storeyHeight:this.commonLayer.storeyHeight,olcs_skirt:this.commonLayer.skirt,olcs_heightAboveGround:this.commonLayer.heightAboveGround,olcs_scaleByDistance:this.commonLayer.scaleByDistance,olcs_zCoordinateEyeOffset:this.commonLayer.zCoordinateEyeOffset,olcs_classificationType:this.commonLayer.classificationType,layerName:this.commonLayer.name});var e=this.commonLayer.getMinResolution(),t=this.commonLayer.getMaxResolution();e&&this.olLayer.setMinResolution(e),t&&this.olLayer.setMaxResolution(t),this.initialized=!0}return Promise.resolve()}},{key:"createSynchronization",value:function(e){if(this.commonLayer.isVisible()&&!this.alreadySynchronized&&e.isInitialized()){e.ol3map;var t=e.getSynchronizer(this);this.counterPart=t.createSingleLayerCounterparts(this.olLayer)[0],t.addCesiumObject(this.counterPart),this.alreadySynchronized=!0}}},{key:"mapActivated",value:function(e){return e instanceof Vt&&this.active&&!this.alreadySynchronized&&this.createSynchronization(e),Promise.resolve()}},{key:"mapDeactivated",value:function(e){if(e instanceof Vt&&this.counterPart&&this.commonLayer.isDynamic){var t=e.getSynchronizer(this);t.destroySingleLayerCounterparts(this.counterPart),this.alreadySynchronized=!1}return Promise.resolve()}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap();this.createSynchronization(e);var i=this.commonLayer.isVisible();this.olLayer.setVisible(i),e.initialized&&(this._removePostRenderHandler(),this._removePostRenderHandler=e.getScene().postRender.addEventListener(this.commonLayer.postRenderStyling.bind(this.commonLayer)))}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olLayer.setVisible(!1),this._removePostRenderHandler(),this.commonLayer.FVlastUpdated=0}},{key:"updateStyle",value:function(e){if(this.initialized){if(this.olLayer.setStyle(this.commonLayer.style.style),e)return;var t=this.olLayer.getSource().getFeatures();t.forEach(function(e){e.changed()})}}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}}]),t}(Qm);Ee.registerSpecificLayerImpl(Vt.className,_n.className,Xm),Ee.registerSpecificLayerImpl(Vt.className,ta.className,Xm);var $m=Xm,ef=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.AsyncVectorImplementation"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return Se(b(t.prototype),"initialize",this).call(this).then(this.commonLayer.fetchData.bind(this.commonLayer))}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,xr.className,ef),Ee.registerSpecificLayerImpl(Vt.className,pr.className,ef);var tf=ef,nf=function(e){function t(e){var i;Object(d["a"])(this,t);var n=e.commonLayer.cesiumTilesetLayerOptions,r={className:t.className,name:e.commonLayer.name};return i=y(this,b(t).call(this,Object.assign({},r,n))),i.commonLayer=e.commonLayer,i.style=i.commonLayer.style,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.CesiumTilesetLayerImpl"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this.cesium3DTileset[At.vcsLayerNameSymbol]=this.commonLayer.name,this.cesium3DTileset[Or]=!0}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.active=!0}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.active=!1}},{key:"mapActivated",value:function(e){return Promise.resolve()}},{key:"mapDeactivated",value:function(e){return Promise.resolve()}},{key:"updateStyle",value:function(e){this.setStyle(this.commonLayer.style,e)}},{key:"determineHighlightStyle",value:function(){return this.commonLayer.highlightStyle?this.commonLayer.highlightStyle:Q.getInstance()._currentItemHighlightColor}},{key:"objectClickedHandler",value:function(e,i,n){return!!this.commonLayer.allowPicking&&Se(b(t.prototype),"objectClickedHandler",this).call(this,e,i,n||this.commonLayer)}},{key:"getGenericFeatureFromClickedObject",value:function(e){var i=Se(b(t.prototype),"getGenericFeatureFromClickedObject",this).call(this,e);return i.layerName=this.commonLayer.name,i.layerClass=this.commonLayer.className,i}}]),t}(zn);Ee.registerSpecificLayerImpl(Vt.className,Er.className,nf);var rf=nf,af=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.cesiumLayer=null,i}return w(t,e),Object(m["a"])(t,[{key:"show",value:function(){var e=this.framework.getActiveMap();if(e&&e instanceof Vt&&e.isInitialized()&&this.cesiumLayer){Se(b(t.prototype),"show",this).call(this);var i=e.getScene().imageryLayers;if(!i.contains(this.cesiumLayer)){var n=this.commonLayer.index;this.cesiumLayer.VCMLayerIndex=n;for(var r=i.length,a=0;a<i.length;a++){var s=i.get(a),o=s.VCMLayerIndex;if(o&&(!(n>o)&&n<o)){r=a;break}}e.getScene().imageryLayers.add(this.cesiumLayer,r)}this.cesiumLayer.show=!0}}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.cesiumLayer&&(this.cesiumLayer.show=!1)}},{key:"dispose",value:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");e&&e instanceof Vt&&e.isInitialized()&&e.getScene().imageryLayers.contains(this.cesiumLayer)&&e.getScene().imageryLayers.remove(this.cesiumLayer,!0),this.cesiumLayer=null,this.initialized=!1,this.active=!1}},{key:"updateOpacity",value:function(){this.initialized&&this.cesiumLayer&&(this.cesiumLayer.alpha=this.commonLayer.opacity)}}]),t}(Qm),sf=af,of=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.OpenStreetMapLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){this.cesiumImageryProvider=Cesium.createOpenStreetMapImageryProvider({maximumLevel:19});var e={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(this.cesiumImageryProvider,e),this.initialized=!0}}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,wr.className,of);var lf=of,cf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i.currentExtent=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.singleImageLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||this.updateLayer()}},{key:"mapActivated",value:function(e){var i=this;return Se(b(t.prototype),"mapActivated",this).call(this,e).then(function(){i.currentExtent&&!i.currentExtent.every(function(e,t){return i.commonLayer.imageExtent[t]===e})&&i.updateLayer()})}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={url:this.commonLayer.url,credit:this.commonLayer.credit},i=this.commonLayer.imageExtent;i&&(this.currentExtent=i.slice(),t.rectangle=Cesium.Rectangle.fromDegrees(i[0],i[1],i[2],i[3]));var n=new Cesium.SingleTileImageryProvider(t),r={rectangle:t.rectangle,alpha:this.commonLayer.opacity,defaultAlpha:1};this.cesiumLayer=new Cesium.ImageryLayer(n,r),this.initialized=!0,e&&this.show()}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Mr.className,cf);var uf=cf,hf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.TMSBaseLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e={url:this.commonLayer.getUrl(),fileExtension:this.commonLayer.format,maximumLevel:this.commonLayer.maxLevel,minimumLevel:this.commonLayer.minLevel,show:!1};if(this.commonLayer.extent.isValid()){var t=this.commonLayer.extent.getCoordinatesInProjection(R.createGeographicProjection());e.rectangle=Cesium.Rectangle.fromDegrees(t[0],t[1],t[2],t[3])}"geographic"===this.commonLayer.tilingSchema&&(e.tilingScheme=new Cesium.GeographicTilingScheme);var i=Cesium.createTileMapServiceImageryProvider(e),n={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(i,n),this.initialized=!0}}},{key:"setOpacity",value:function(e){this.cesiumLayer.alpha=e}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Sr.className,hf);var df=hf,mf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.VectorClusterLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return Se(b(t.prototype),"initialize",this).call(this).then(function(){e.olLayer&&e.olLayer.set("olcs_zCoordinateEyeOffset",e.commonLayer.zCoordinateEyeOffset)})}},{key:"createSynchronization",value:function(e){if(!this.alreadySynchronized&&e.isInitialized()){var t=e.clusterSynchronizer,i=t.createSingleLayerCounterparts(this.olLayer)[0];this.clusterDataSource=i.getDataSource(),this.clusterDataSource.clustering.clusterLabels=!1,this.clusterDataSource.clustering.clusterPoints=!1,e.getClusterDatasources().add(this.clusterDataSource);var n=e.getClusterConverter();n.setLayerStyle(this.olLayer,this.commonLayer.cesiumStyleFunction.bind(this.commonLayer)),this.alreadySynchronized=!0}}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,Pr.className,mf);var ff=mf,yf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.WMSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.commonLayer.setCommonSource(),this.updateLayer())}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!0)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!1)}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={url:this.commonLayer.getUrl(),layers:this.commonLayer.layers.join(","),minimumLevel:this.commonLayer.minLevel,maximumLevel:this.commonLayer.maxLevel,show:!1,parameters:this.commonLayer.parameters};if(this.commonLayer.extent&&this.commonLayer.extent.isValid()){var i=this.commonLayer.extent.getCoordinatesInProjection(R.createGeographicProjection());i&&(t.rectangle=Cesium.Rectangle.fromDegrees(i[0],i[1],i[2],i[3]))}"mercator"===this.commonLayer.tilingSchema&&(t.tilingScheme=new Cesium.WebMercatorTilingScheme);var n=new Cesium.WebMapServiceImageryProvider(t),r={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(n,r),this.initialized=!0,e&&this.show()}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Fr.className,yf);var gf=yf,vf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.WMTSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=this.commonLayer.getUrl();e=-1!==e.indexOf("{Layer}")?e.replace("{Layer}",this.commonLayer.layer):e;var t=this.commonLayer.extent.getCoordinatesInProjection(vcs.vcm.util.Projection.createGeographicProjection()),i={url:e,layer:this.commonLayer.layer,style:this.commonLayer.style,format:this.commonLayer.format,tileMatrixSetID:this.commonLayer.tileMatrixSetID,maximumLevel:this.commonLayer.maxLevel,rectangle:Cesium.Rectangle.fromDegrees(t[0],t[1],t[2],t[3])},n={};if((this.commonLayer.numberOfLevelZeroTilesX>1||this.commonLayer.numberOfLevelZeroTilesY>1)&&(n.numberOfLevelZeroTilesX=this.commonLayer.numberOfLevelZeroTilesX,n.numberOfLevelZeroTilesY=this.commonLayer.numberOfLevelZeroTilesY),"geographic"===this.commonLayer.tilingSchema?i.tilingScheme=new Cesium.GeographicTilingScheme(n):i.tilingScheme=new Cesium.WebMercatorTilingScheme(n),this.commonLayer.matrixIds)this.commonLayer.matrixIds.length==this.commonLayer.maxLevel+1?i.tileMatrixLabels=this.commonLayer.matrixIds:this.logger.info("matrixIDs must have the same length as maxZoom");else if(""!==this.commonLayer.tileMatrixPrefix){for(var r=[],a=0;a<this.commonLayer.maxLevel+1;a++)r[a]=String(this.commonLayer.tileMatrixPrefix)+String(a);i.tileMatrixLabels=r}var s=new Cesium.WebMapTileServiceImageryProvider(i),o={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(s,o),this.initialized=!0}}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Hr.className,vf);var pf=vf,_f=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Wsv"}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,Br.className,_f);var bf=_f,Lf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i.obliqueSource=new ol.source.Vector({}),i.featureListeners={},i.frameworkListeners=[],i.sourceListener=[],i.currentExtent=null,i.fetchedFeaturesForImageName=null,i._postComposeListener=null,i.FVlastUpdated=0,i.featureVisibility=i.commonLayer.featureVisibility,i.globalHider=i.commonLayer.globalHider,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.VectorLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return this.initialized||(this.obliqueMap=this.framework.getActiveMap(),this.initializedPromise=this.obliqueMap.inializedPromise.then(function(){if(e.obliqueMap.initialized){e.olMap=e.obliqueMap.getOl3Map(),e.olLayer=new ol.layer.Vector({renderOrder:null,visible:!1,source:e.obliqueSource,style:e.commonLayer.style.style,name:e.commonLayer.name,zIndex:e.commonLayer.zIndex,altitudeMode:e.commonLayer.getAltitudeMode(),layerName:e.commonLayer.name});var t=e.commonLayer.getMinResolution(),i=e.commonLayer.getMaxResolution();t&&e.olLayer.setMinResolution(t),i&&e.olLayer.setMaxResolution(i),e.initialized=!0}return Promise.resolve()})),this.initializedPromise}},{key:"updateStyle",value:function(){this.initialized&&this.olLayer.setStyle(this.commonLayer.style.style)}},{key:"getFeatureById",value:function(e){return this.obliqueSource.getFeatureById("".concat(e,"_OBLIQUE"))}},{key:"show",value:function(){this.initialized&&(Se(b(t.prototype),"show",this).call(this),this.olLayer.setVisible(this.commonLayer.visibility),this.olMap.addLayer(this.olLayer),null===this._postComposeListener&&(this._postComposeListener=this.olMap.on("postcompose",this.commonLayer.postRenderStyling.bind(this))),this.fetchFeaturesInView())}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}},{key:"addFeature",value:function(e){var i=this;if(this.active||(this.fetchedFeaturesForImageName=null),this.active&&this.currentExtent&&this.framework.getActiveMap()instanceof Pi&&(!e[_n.doNotTransform]||e.getGeometry()[_n.alreadyTransformedToImage]||!e[_n.doNotTransform]&&e.getGeometry().intersectsExtent(this.currentExtent))){var n="".concat(e.getId(),"_OBLIQUE");if(this.obliqueSource.getFeatureById(n))return;var r=new ol.Feature({});r.setId(n),r[_n.originalFeatureSymbol]=e,t.setNewGeometry(e,r),r.setStyle(e.getStyle()),this.featureListeners[n]=new Array(3),this.featureListeners[n][0]=e.on("change:geometry",function(){ol.Observable.unByKey(i.featureListeners[n][2]),t.setNewGeometry(e,r),i.updateGeometry(e,r),i.featureListeners[n][2]=e.getGeometry().on("change",i.updateGeometry.bind(i,e,r))}),this.featureListeners[n][1]=e.on("change",function(){r.setStyle(e.getStyle())}),this.featureListeners[n][2]=e.getGeometry().on("change",this.updateGeometry.bind(this,e,r)),this.updateGeometry(e,r).then(function(){i.obliqueSource.addFeature(r)})}}},{key:"updateGeometry",value:function(e,t){var i=this,n=e.getGeometry();if(!n[_n.alreadyTransformedToImage]){var r=t.getGeometry();return _i(n,r,this.obliqueMap.activeLayer.currentImage).then(function(){i.featureListeners[t.getId()].push(r.once("change",function(){r[_n.imageGeometryChanged]=!0}))})}return t.getGeometry().setCoordinates(e.getGeometry().getCoordinates()),t.getGeometry()[_n.imageGeometryChanged]=!0,Promise.resolve()}},{key:"synchronizeGeometriesAndClearSource",value:function(){var e=this;function t(e){var t=e.getGeometry(),i=t instanceof ol.geom.Circle,n=yi(t);return i&&e.setGeometry(n),n}var i=[];return Object.keys(this.featureListeners).forEach(function(t){ol.Observable.unByKey(e.featureListeners[t]),delete e.featureListeners[t]}),this.obliqueSource.forEachFeature(function(n){var r=n[_n.originalFeatureSymbol];if(!r[_n.doNotTransform]&&n.getGeometry()[_n.imageGeometryChanged]){var a=t(r),s=t(n);i.push(bi(s,a,e.obliqueMap.activeLayer.obliqueCollection.getImageByName(e.fetchedFeaturesForImageName)).then(function(){delete a[_n.alreadyTransformedToImage]}))}}),Promise.all(i).then(function(){e.obliqueSource.clear(!0),e.fetchedFeaturesForImageName=null,e.FVlastUpdated=0})}},{key:"fetchFeaturesInView",value:function(){var e=this;return new Promise(function(t){e.active&&e.fetchedFeaturesForImageName!==e.obliqueMap.getCurrentImage().name&&(e.currentExtent=e.obliqueMap.getExtentOfCurrentImage().getCoordinatesInProjection(R.createMercatorProjection()),e.commonLayer.source.forEachFeatureInExtent(e.currentExtent,function(t){e.addFeature(t)}),e.commonLayer.source.forEachFeature(function(t){t.getGeometry()[_n.alreadyTransformedToImage]&&e.addFeature(t)}),e.fetchedFeaturesForImageName=e.obliqueMap.getCurrentImage().name),t()})}},{key:"removeFeature",value:function(e){var t=this.obliqueSource.getFeatureById("".concat(e.getId(),"_OBLIQUE"));if(t){var i=t.getId(),n=this.featureListeners[i];n&&(ol.Observable.unByKey(n),delete this.featureListeners[i]),this.obliqueSource.removeFeature(t)}}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olMap.removeLayer(this.olLayer),null!=this._postComposeListener&&(ol.Observable.unByKey(this._postComposeListener),this._postComposeListener=null),this.FVlastUpdated=0}},{key:"dispose",value:function(){if(this.olLayer){var e=this.framework.getMapByType("vcs.vcm.maps.Oblique");e.getOl3Map().removeLayer(this.olLayer)}this.olLayer=null,this.initialized=!1,this.active=!1,ol.Observable.unByKey(this.sourceListener),this.sourceListener=[],this.frameworkListeners.forEach(this.framework.unsubscribeByKey,this.framework),this.frameworkListeners=[]}},{key:"mapActivated",value:function(e){var t=this;return this.sourceListener.push(this.commonLayer.source.on("addfeature",function(e){t.addFeature(e.feature)})),this.sourceListener.push(this.commonLayer.source.on("removefeature",function(e){t.removeFeature(e.feature)})),this.sourceListener.push(this.commonLayer.source.on("changefeature",function(e){var i="".concat(e.feature.getId(),"_OBLIQUE");t.featureListeners[i]||t.addFeature(e.feature)})),this.frameworkListeners.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,function(){t.synchronizeGeometriesAndClearSource().then(function(){t.fetchFeaturesInView()})})),this.fetchFeaturesInView()}},{key:"mapDeactivated",value:function(e){return ol.Observable.unByKey(this.sourceListener),this.sourceListener=[],this.frameworkListeners.forEach(this.framework.unsubscribeByKey,this.framework),this.frameworkListeners=[],this.synchronizeGeometriesAndClearSource()}}],[{key:"setNewGeometry",value:function(e,t){var i=e.getGeometry().clone();t.setGeometry(e.getGeometry()[_n.alreadyTransformedToImage]?i:yi(i)),e.getGeometry()[_n.alreadyTransformedToImage]&&t.getGeometry().setProperties(e.getGeometry().getProperties(),!1),e[_n.obliqueGeometry]=t.getGeometry()}}]),t}(Qm);Ee.registerSpecificLayerImpl(Pi.className,_n.className,Lf),Ee.registerSpecificLayerImpl(Pi.className,ta.className,Lf);var Mf=Lf,kf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.AsyncVectorImplementation"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return Se(b(t.prototype),"initialize",this).call(this).then(this.commonLayer.fetchData.bind(this.commonLayer))}}]),t}(Mf);Ee.registerSpecificLayerImpl(Pi.className,xr.className,kf),Ee.registerSpecificLayerImpl(Pi.className,pr.className,kf),Ee.registerSpecificLayerImpl(Pi.className,Br.className,kf);var wf=kf,Tf=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.clusterSource=new ol.source.Cluster({source:i.obliqueSource}),i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return Se(b(t.prototype),"initialize",this).call(this).then(function(){e.clusterSource.setDistance(e.commonLayer.clusterSource.getDistance()),e.olLayer.setSource(e.clusterSource)})}},{key:"show",value:function(){this.initialized&&(null===this._postComposeListener&&(this._postComposeListener=this.olMap.on("postcompose",this.commonLayer.postRenderStyling.bind(this.commonLayer))),Se(b(t.prototype),"show",this).call(this))}},{key:"mapActivated",value:function(e){var t=this,i=function(){t.synchronizeGeometriesAndClearSource().then(function(){t.fetchFeaturesInView()})};return this.sourceListener.push(this.commonLayer.source.on("change",i)),this.frameworkListeners.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,i)),this.fetchFeaturesInView()}}]),t}(Mf);Ee.registerSpecificLayerImpl(Pi.className,Pr.className,Tf);var Sf=Tf,Of=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.olLayer=null,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.olLayer=this.getOLLayer(),this.initialized=!0)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap(),i=null,n=e.getOl3Map().getLayers().getArray(),r=this.commonLayer.index;this.olLayer.VCMLayerIndex=r;for(var a=null,s=0;s<n.length;s++){if(n[s]==this.olLayer){i=n[s];break}var o=n[s].VCMLayerIndex;o&&(r>o||r<o&&null===a&&(a=s))}i||(null===a&&(a=n.length),e.getOl3Map().getLayers().insertAt(a,this.olLayer));var l=!this.commonLayer.isVisible||this.commonLayer.isVisible();this.olLayer.setVisible(l)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olLayer.setVisible(!1)}},{key:"dispose",value:function(){if(this.olLayer){var e=this.framework.getMapByType("vcs.vcm.maps.Openlayers");e.getOl3Map().removeLayer(this.olLayer)}this.olLayer=null,this.initialized=!1,this.active=!1}},{key:"getOLLayer",value:function(){throw new Error}}]),t}(Qm),Cf=Of,Ef=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i._postComposeListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.VectorLayer"}}]),Object(m["a"])(t,[{key:"updateStyle",value:function(){this.initialized&&this.olLayer.setStyle(this.commonLayer.style.style)}},{key:"getOLLayer",value:function(){var e=new ol.layer.Vector({renderOrder:null,visible:!1,source:this.commonLayer.getSource(),style:this.commonLayer.style.style,zIndex:this.commonLayer.zIndex,name:this.commonLayer.name,altitudeMode:"clampToGround"}),t=this.commonLayer.maxResolution,i=this.commonLayer.minResolution;return t&&e.setMinResolution(t),i&&e.setMaxResolution(i),e}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap();null===this._postComposeListener&&(this._postComposeListener=e.ol3map.on("postcompose",this.commonLayer.postRenderStyling.bind(this.commonLayer)))}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),null!=this._postComposeListener&&(ol.Observable.unByKey(this._postComposeListener),this._postComposeListener=null),this.commonLayer.FVlastUpdated=0}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,_n.className,Ef),Ee.registerSpecificLayerImpl(Hi.className,Br.className,Ef),Ee.registerSpecificLayerImpl(Hi.className,ta.className,Ef);var If=Ef,Df=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.commonLayer.fetchData();return Se(b(t.prototype),"initialize",this).call(this),e}}]),t}(If);Ee.registerSpecificLayerImpl(Hi.className,xr.className,Df),Ee.registerSpecificLayerImpl(Hi.className,pr.className,Df),Ee.registerSpecificLayerImpl(Hi.className,Er.className,Df);var jf=Df,Pf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.OpenStreetMapLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){return new ol.layer.Tile({opacity:this.commonLayer.opacity,source:new ol.source.OSM})}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,wr.className,Pf);var Yf=Pf,xf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.SingleImageLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||this.updateLayer()}},{key:"getOLLayer",value:function(){return this.initialized||this.initialize(),this.olLayer}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={attributions:this.commonLayer.credit,url:this.commonLayer.url,projection:"EPSG:4326",imageExtent:this.commonLayer.imageExtent};a["a"].hasSameOrigin(this.commonLayer.getUrl())||(t.crossOrigin="anonymous"),this.olLayer=new ol.layer.Image({source:new ol.source.ImageStatic(t),opacity:this.commonLayer.opacity}),this.initialized=!0,e&&this.show()}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Mr.className,xf);var Af=xf,Ff=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.TMSBaseLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){var e={tileUrlFunction:function(e){var t="".concat(Cesium.appendForwardSlash(this.commonLayer.getUrl()),"{z}/{x}/{y}.").concat(this.commonLayer.format),i=(1<<e[0])- -e[2];return t.replace("{z}",e[0].toString()).replace("{x}",e[1].toString()).replace("{y}",i.toString())}.bind(this),tileSize:[this.commonLayer.tileWidth,this.commonLayer.tileHeight],minZoom:this.commonLayer.minLevel,maxZoom:this.commonLayer.maxLevel,wrapx:!1};a["a"].hasSameOrigin(this.commonLayer.getUrl())||(e.crossOrigin="anonymous"),"geographic"===this.commonLayer.tilingSchema&&(e.projection="EPSG:4326");var t={source:new ol.source.XYZ(e),opacity:this.commonLayer.opacity};this.commonLayer.extent.isValid()&&(t.extent=this.commonLayer.extent.getCoordinatesInProjection(R.createMercatorProjection()));var i=new ol.layer.Tile(t);return i}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Sr.className,Ff);var Nf=Ff,Hf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.VectorClusterLayer"}}]),t}(If);Ee.registerSpecificLayerImpl(Hi.className,Pr.className,Hf);var Rf=Hf,zf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.WMSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.olLayer=this.getOLLayer(),this.initialized=!0)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!0)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!1)}},{key:"getOLLayer",value:function(){return this.commonLayer.setCommonSource(),new ol.layer.Tile({renderOrder:null,visible:!1,source:this.commonLayer.wmsSource,opacity:this.commonLayer.opacity})}},{key:"updateLayer",value:function(){return!0}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Fr.className,zf);var Gf=zf,Vf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.WMTSLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){var e=R.createMercatorProjection();"geographic"===this.commonLayer.tilingSchema&&(e=R.createGeographicProjection());var t=e.getProjection().getExtent(),i=ol.extent.getWidth(t)/256;this.commonLayer.numberOfLevelZeroTilesX>1&&(i/=this.commonLayer.numberOfLevelZeroTilesX),"geographic"===this.commonLayer.tilingSchema&&(i=ol.extent.getWidth(t)/512);for(var n=this.commonLayer.maxLevel+1,r=new Array(n),s=new Array(n),o=0;o<n;++o)r[o]=i/Math.pow(2,o),s[o]=String(this.commonLayer.tileMatrixPrefix)+String(o);this.commonLayer.matrixIds&&(this.commonLayer.matrixIds.length==n?s=this.commonLayer.matrixIds:this.logger.info("matrixIDs must have the same length as maxZoom"));var l=this.commonLayer.extent.getCoordinatesInProjection(e),c={origin:ol.extent.getTopLeft(t),extent:l,resolutions:r,matrixIds:s,minZoom:this.commonLayer.minLevel};if(this.commonLayer.numberOfLevelZeroTilesX>1||this.commonLayer.numberOfLevelZeroTilesY>1){for(var u=[],h=this.commonLayer.numberOfLevelZeroTilesX,d=this.commonLayer.numberOfLevelZeroTilesY,m=0;m<=n;m++)u.push([h,-d]),h*=2,d*=2;c.sizes=u}var f=new ol.tilegrid.WMTS(c),y=this.commonLayer.getUrl().indexOf("{")>=0?"REST":"KVP",g={tileGrid:f,requestEncoding:y,layer:this.commonLayer.layer,style:this.commonLayer.style,format:this.commonLayer.format,matrixSet:this.commonLayer.tileMatrixSetID,url:this.commonLayer.getUrl()};for(var v in a["a"].hasSameOrigin(this.commonLayer.getUrl())||(g.crossOrigin="anonymous"),"geographic"===this.commonLayer.tilingSchema&&(g.projection="EPSG:4326"),this.commonLayer.olOptions)g[v]=this.commonLayer.olOptions[v];return new ol.layer.Tile({opacity:this.commonLayer.opacity,source:new ol.source.WMTS(g)})}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Hr.className,Vf);var Bf=Vf;function Uf(e,t){var i=ne.getInstance(),n=i.getActiveMap(),r={};r.startingmap=n.name,r.lang=i.getLocale(),r.layerToActivate=[],r.layerToDeactivate=[],i.getLayers().filter(function(e){return e[ne.configContentSymbol]&&e.isSupported(n)}).forEach(function(e){e.active!==e.activeOnStartup&&(e.active?r.layerToActivate.push(e.name):r.layerToDeactivate.push(e.name))}),r.layerToActivate.length||delete r.layerToActivate,r.layerToDeactivate.length||delete r.layerToDeactivate,delete e.queryParams.epsg,t&&(r.epsg=i.getProjection().epsg.match(/\d+/)[0]),e.addQueryParams(r);var a=i.getSelectBehavior();return a&&a.getLink(e),Pe.getInstance().getLink(e),n.getViewPoint(!0,!0).then(function(t){return t.getLink(e),e.toString()}).catch(function(){return e.toString()})}function Wf(e){var t=ne.getInstance(),i=a["a"].parse(window.location.href);if(t.baseUrl){var n=a["a"].parse(t.baseUrl);i.base=n.base,i.path=n.path}for(var r=t.getWidgets(),s=0;s<r.length;s++)r[s].getLink(i);return Uf(i,e)}i(641);var qf,Jf=Y.getLogger("vcs.vcm.util.flight.FlightPlayer"),Kf=function(){function e(){var t=this;Object(d["a"])(this,e),this.destinationSpline=null,this.quaternionSpline=null,this.values={playing:!1,paused:!1,multiplier:1,activeInstance:null,repeat:!1,valid:!1},this.clock={startTime:0,endTime:0,currentTime:0,times:[],currentSystemTime:null},this._postRenderHandler=null,this._flightInstanceChangeHandler=null,this.screenSpaceCameraController=null,this.readyPromise=Promise.resolve(),ne.getInstance().subscribe("MAP_ACTIVATED",function(){t.stop()})}return Object(m["a"])(e,[{key:"setActiveFlightInstance",value:function(e){var t=this;o(e,Bs),this.values.playing&&this.stop(),this.values.activeInstance=e;var i=Pe.getInstance();return i.values.walkmode&&i.activateOverviewMode(),this.readyPromise=e.ready.then(function(){t.values.activeInstance===e&&(t._flightInstanceChangeHandler&&(t._flightInstanceChangeHandler(),t._flightInstanceChangeHandler=null),t.changeHandler(),t._flightInstanceChangeHandler=e.changed.addEventListener(t.changeHandler.bind(t)))}),this.readyPromise}},{key:"clearActiveFlight",value:function(){this.values.playing&&this.stop(),this._flightInstanceChangeHandler&&(this._flightInstanceChangeHandler(),this._flightInstanceChangeHandler=null),this.values.activeInstance=null}},{key:"play",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t){var i,n,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(l(t,Bs),t||this.values.activeInstance){e.next=5;break}throw i="Player cannot play without activeInstance, provide a flightInstance or call setActiveInstance",Jf.error(i),new Error(i);case 5:if(this._postRenderHandler&&(this._postRenderHandler(),this._postRenderHandler=null),!t||this.values.activeInstance===t){e.next=11;break}return e.next=9,this.setActiveFlightInstance(t);case 9:if(this.values.activeInstance===t){e.next=11;break}return e.abrupt("return");case 11:n=ne.getInstance().getActiveMap(),n instanceof Vt&&(r=n.getScene(),this.screenSpaceCameraController=r.screenSpaceCameraController,this._postRenderHandler=r.postRender.addEventListener(this._cesiumPostRender.bind(this))),this.clock.currentSystemTime=null,this.values.playing=!0;case 15:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"_cesiumPostRender",value:function(e){var t=Date.now()/1e3;this.clock.currentSystemTime||(this.clock.currentSystemTime=t);var i=t-this.clock.currentSystemTime;if(this.clock.currentSystemTime=t,this.values.paused)this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!0);else{if(this.clock.currentTime+=i*this.values.multiplier,this.clock.currentTime>this.clock.endTime){if(!this.values.repeat)return void this.stop();this.clock.currentTime=this.clock.currentTime-this.clock.endTime}else if(this.clock.currentTime<this.clock.startTime){if(!this.values.repeat)return void(this.clock.currentTime=this.clock.startTime);this.clock.currentTime=this.clock.endTime+this.clock.currentTime}var n={destination:this.destinationSpline.evaluate(this.clock.currentTime),orientation:Cesium.HeadingPitchRoll.fromQuaternion(this.quaternionSpline.evaluate(this.clock.currentTime))};e.camera.setView(n),this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!1)}}},{key:"stop",value:function(){this._postRenderHandler&&(this._postRenderHandler(),this._postRenderHandler=null),this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!0),this.values.playing=!1,this.values.paused=!1,this.clock.currentTime=0,this.clock.currentSystemTime=null}},{key:"goToTime",value:function(e){if(this.values.activeInstance&&this.values.activeInstance.isValid()){if(e>this.clock.endTime)Jf.warning("time: ".concat(e," out of range"));else if(this.clock.currentTime=e,this.clock.currentSystemTime=null,!this.values.playing||this.values.playing&&this.values.paused){var t=ne.getInstance().getActiveMap();if(t instanceof Vt){var i={destination:this.destinationSpline.evaluate(this.clock.currentTime),orientation:Cesium.HeadingPitchRoll.fromQuaternion(this.quaternionSpline.evaluate(this.clock.currentTime))};t.getScene().camera.setView(i)}}}else Jf.warning("cannot go to time on missing or invalid flight")}},{key:"forward",value:function(){var e=this.clock.currentTime,t=this.clock.times.find(function(t){return t>e})||this.clock.times[this.clock.times.length-1];this.goToTime(t)}},{key:"backward",value:function(){var e=this,t=this.clock.currentTime,i=this.clock.times.findIndex(function(e){return e>=t})-1;this.backedBefore&&(i-=1,clearTimeout(this.backedBeforeTimeout)),i<0&&(i=0);var n=this.clock.times[i];this.goToTime(n),this.backedBefore=!0,this.backedBeforeTimeout=setTimeout(function(){e.backedBefore=!1},700)}},{key:"changeHandler",value:function(){this.values.activeInstance&&(this.values.valid=this.values.activeInstance.isValid(),this.values.valid&&this._updateSplines())}},{key:"_updateSplines",value:function(){var e=this.values.activeInstance,t=e.loop,i=e.viewpoints,n=t?i.length+1:i.length,r=new Array(n),a=new Array(n),s=new Array(n);i.forEach(function(e,t){if(r[t]=Cesium.Cartesian3.fromDegrees(e.cameraPosition[0],e.cameraPosition[1],e.cameraPosition[2]),a[t]=Cesium.Quaternion.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(e.heading,e.pitch,e.roll)),t>0){var n=i[t-1];n.duration||(n.duration=Cesium.Cartesian3.distance(r[t-1],r[t])/300||1),s[t]=s[t-1]+n.duration}else s[t]=0}),t&&(r[n-1]=Cesium.Cartesian3.fromDegrees(i[0].cameraPosition[0],i[0].cameraPosition[1],i[0].cameraPosition[2]),a[n-1]=Cesium.Quaternion.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(i[0].heading,i[0].pitch,i[0].roll)),i[n-2].duration||(i[n-2].duration=Cesium.Cartesian3.distance(r[n-2],r[n-1])/300||1),s[n-1]=s[n-2]+i[n-2].duration),this.destinationSpline=this.values.activeInstance.interpolation===Gs.SPLINE?new Cesium.CatmullRomSpline({times:s,points:r}):new Cesium.LinearSpline({times:s,points:r}),this.quaternionSpline=new Cesium.QuaternionSpline({times:s,points:a}),this.clock.endTime=s[n-1],this.clock.times=s,this.values.repeat=t}}]),e}();function Zf(){return qf||(qf=new Kf),qf}var Qf=Y.getLogger("vcs.vcm.util.flight.FlightVisualizer"),Xf=null,$f=new Cesium.Cartographic,ey=function(){function e(){var t=this;Object(d["a"])(this,e),this.extent=ol.extent.createEmpty(),this.flightLayer=new _n({projection:R.createGeographicProjection(),name:"_scratchFlightLayer",style:{declarativeStyle:{labelText:"${title}",image:"false",color:'color("#333333")',strokeWidth:"2"}},altitudeMode:"absolute"}),this._primitives=new Cesium.PrimitiveCollection,this.activeInstance=null,this._flightInstanceChangeHandler=null,this._mapActivatedListener=ne.getInstance().subscribe("MAP_ACTIVATED",function(){t.hide()})}return Object(m["a"])(e,[{key:"_createFeatures",value:function(){var e=this;this.flightLayer.removeAllFeatures();var t=ne.getInstance().getMapByType(Vt.className);if(t){var i=t.getScene();this._primitives.removeAll();var n=this.activeInstance.viewpoints.map(function(t,n){var r=new Cesium.Camera(i);return r.frustum.far=200,r.frustum.near=10,r.setView({destination:Cesium.Cartesian3.fromDegrees(t.cameraPosition[0],t.cameraPosition[1],t.cameraPosition[2]),orientation:Cesium.HeadingPitchRoll.fromDegrees(t.heading,t.pitch,t.roll)}),e._primitives.add(new Cesium.VcsCameraPrimitve({camera:r,allowPicking:!1})),new ol.Feature({geometry:new ol.geom.Point(t.cameraPosition,"XYZ"),title:t.name||"".concat(q.getInstance().getSingleMessage("i18n_viewpointeditor_number")," ").concat(n+1),duration:t.duration})});if(this.activeInstance.isValid()){var r=[],a=Zf();if(a.values.activeInstance===this.activeInstance){if(this.activeInstance.interpolation===Gs.SPLINE){for(var s=function(e){Cesium.Cartographic.fromCartesian(a.destinationSpline.evaluate(e),null,$f),r.push([Cesium.Math.toDegrees($f.longitude),Cesium.Math.toDegrees($f.latitude),$f.height])},o=a.clock.endTime,l=o/.2>500?o/500:.2,c=0;c<o;c+=l)s(c);s(o)}else n.forEach(function(e){r.push(e.getGeometry().getCoordinates())}),this.activeInstance.loop&&r.push(r[0]);var u=new ol.Feature({geometry:new ol.geom.LineString(r),title:"Flight Path"});u.setId("flightPathGeom"),n.push(u)}this.flightLayer.addFeatures(n);var h=this.flightLayer.getSource().getExtent();this.extent=N(h,h,2)}}else Qf.error("could not find a cesium map!")}},{key:"_makeDirty",value:function(){this.flightLayer.active&&this._createFeatures()}},{key:"visualizeFlight",value:function(e){var t=this;o(e,Bs);var i=ne.getInstance().getMapByType(Vt.className);if(!i)return Qf.error("could not find a cesium map!"),Promise.reject(new Error("could not find cesium map"));var n=Zf();return n.values.activeInstance!==e&&n.setActiveFlightInstance(e),n.readyPromise.then(function(){if(n.values.activeInstance===e){t._flightInstanceChangeHandler&&(t._flightInstanceChangeHandler(),t._flightInstanceChangeHandler=null),t._flightInstanceChangeHandler=e.changed.addEventListener(t._makeDirty.bind(t)),t.activeInstance=e,t._createFeatures(),t.flightLayer.activate(!0);var r=i.getScene();t._primitives.show=!0,r.primitives.contains(t._primitives)||r.primitives.add(t._primitives)}})}},{key:"hide",value:function(){this.flightLayer.activate(!1),this._primitives.show=!1}},{key:"dispose",value:function(){ne.getInstance().unsubscribeByKey(this._mapActivatedListener),this.flightLayer.dispose(),this._primitives.destroy(),Xf=null}},{key:"zoomToExtent",value:function(){if(this.activeInstance&&this.activeInstance.isValid()&&!ol.extent.isEmpty(this.extent)){var e=V.createViewPointFromExtent(this.extent),t=ne.getInstance();t.getActiveMap().gotoViewPoint(e)}}}]),e}();function ty(){return Xf||(Xf=new ey),Xf}var iy=Y.getLogger("vcs.vcm.util.style.Icon"),ny=new Map,ry={FAILED:0,IDLE:1,LOADING:2,LOADED:4,TINTED:8},ay=function(){function e(t){Object(d["a"])(this,e),this.src=t,this.image=new Image,this.state=ry.IDLE,this.size=[32,32],this.canvas=document.createElement("canvas"),ny.set(t,this)}return Object(m["a"])(e,[{key:"load",value:function(){var e=this;return this.state===ry.IDLE?(this.state=ry.LOADING,new Promise(function(t,i){e.image.onerror=function(t){e.state=ry.FAILED,i(t)},e.image.onload=function(){e.state=ry.LOADED},e.image.src=e.src})):Promise.resolve()}},{key:"_drawImage",value:function(){var e=this.canvas.getContext("2d");e.drawImage(this.image,0,0,this.size[32],this.size[32])}},{key:"tint",value:function(e){this.state&(ry.LOADED|ry.TINTED)?Qe(this.canvas.getContext("2d"),e,this.size):iy.debug("cannot tint unloaded image")}},{key:"untint",value:function(){this.state===ry.TINTED?(this._drawImage(),this.state=ry.TINTED):iy.debug("trying to untint a non-tinted image")}}]),e}(),sy=ay;function oy(e){return ny.get(e)}var ly=function(e){function t(){return Object(d["a"])(this,t),y(this,b(t).call(this,{className:t.className}))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.ErrorItem"}}]),t}(nh),cy=ly;ol.geom.Circle.prototype.getCoordinates=function(){return[this.getCenter(),this.getLastCoordinate()]},ol.geom.Circle.prototype.setCoordinates=function(e,t){o(e,[[Number]]),o(e.length,2);var i=t||this.getLayout(),n=/XYM?/.test(i)?ri:ai;this.setCenterAndRadius(e[0],n.apply(void 0,Object(T["a"])(e)),t)},ol.geom.Circle.prototype.rotate=function(e,t){},ol.geom.GeometryCollection.prototype.getCoordinates=function(){return this.getGeometries().map(function(e){return e.getCoordinates()})},ol.geom.GeometryCollection.prototype.setCoordinates=function(e,t){o(e,Array),o(e.length,this.getGeometries().length),this.setGeometries(this.getGeometries().map(function(i,n){return i.setCoordinates(e[n],t),i}))};i(714),i(715),i(716),i(717);var uy=new Cesium.Cartesian3,hy=new Cesium.Matrix3,dy=new Cesium.Quaternion,my=new Cesium.Color,fy=[1,1e5],yy=function(){function e(t){Object(d["a"])(this,e),this._outlinePrimitives=[],this._planesPrimitives=[],this.show="undefined"===typeof t.show||t.show,this._camera=t.camera,this._color=t.color||Cesium.Color.YELLOW,this.allowPicking="undefined"===typeof t.allowPicking||t.allowPicking,this.id=t.id||{}}return Object(m["a"])(e,[{key:"update",value:function(e){if(this.show){var t,i,n=this._planesPrimitives,r=this._outlinePrimitives;if(0===n.length){var a=this._camera,s=a.frustum,o=s.clone(),l=fy;l[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far;var c=a.positionWC,u=a.directionWC,h=a.upWC,d=a.rightWC;d=Cesium.Cartesian3.negate(d,uy);var m=hy;Cesium.Matrix3.setColumn(m,0,d,m),Cesium.Matrix3.setColumn(m,1,h,m),Cesium.Matrix3.setColumn(m,2,u,m);var f=Cesium.Quaternion.fromRotationMatrix(m,dy);n.length=1,r.length=1,o.near=l[0],o.far=l[1],n[0]=new Cesium.Primitive({allowPicking:this.allowPicking,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:c,orientation:f,frustum:o,_drawNearPlane:!0}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(this._color,.1,my))},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1}),r[0]=new Cesium.Primitive({allowPicking:this.allowPicking,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:c,orientation:f,frustum:o,_drawNearPlane:!0}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}for(i=n.length,t=0;t<i;++t)r[t].update(e),n[t].update(e)}}},{key:"destroy",value:function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return Cesium.destroyObject(this)}}]),e}();Cesium.VcsCameraPrimitve=yy,i.d(t,"vcs",function(){return gy});var gy={};window["vcs"]=gy,gy.Url=a["a"],gy.check=o,gy.checkMaybe=l,gy.deepForEach=u["a"],gy.eventCannotBeFromMap=u["b"],gy.isEmail=u["d"],gy.oblique={},gy.oblique.viewDirectionNames=h["c"],gy.parseBoolean=u["e"],gy.parseEnumValue=u["f"],gy.vcm={},gy.vcm.ExclusiveManager=se,gy.vcm.Framework=ne,gy.vcm.Framework.dispose=Km,gy.vcm.Framework.getObjectFromOptions=Rm,gy.vcm.Framework.init=qm,gy.vcm.Framework.loadConfig=Jm,gy.vcm.NavigationMode=Pe,gy.vcm.SelectBehavior=Q,gy.vcm.cityGML={},gy.vcm.cityGML.AllFeatureTypes=xc,gy.vcm.cityGML.AllProperties=Ac,gy.vcm.cityGML.AllPropertiesDateGeneric=zc,gy.vcm.cityGML.AllPropertiesDateNonGeneric=Hc,gy.vcm.cityGML.AllPropertiesValueGeneric=Nc,gy.vcm.cityGML.AllPropertiesValueNonGeneric=Fc,gy.vcm.cityGML.AllPropertiesYearNonGeneric=Rc,gy.vcm.cityGML.Namespaces=Yc,gy.vcm.event={},gy.vcm.event.EventType=B,gy.vcm.i18n=q,gy.vcm.interaction={},gy.vcm.interaction.AbstractInteraction=pe,gy.vcm.interaction.BitCounter=he,gy.vcm.interaction.EventHandler={},gy.vcm.interaction.EventHandler.getInstance=xn,gy.vcm.interaction.EventType=me,gy.vcm.interaction.ModificationKeyType=de,gy.vcm.interaction.PointerKeyType=fe,gy.vcm.layer={},gy.vcm.layer.AbstractRasterLayer=br,gy.vcm.layer.CommonLayer=$i,gy.vcm.layer.CommonLayerImpl=Qm,gy.vcm.layer.FeatureStore=ta,gy.vcm.layer.FeatureStore.featureStoreState=er,gy.vcm.layer.GeoJSON=pr,gy.vcm.layer.GeoJSON.getEPSGCodeFromGeojson=lr,gy.vcm.layer.GeoJSON.parseGeoJSON=fr,gy.vcm.layer.GeoJSON.updateLegacyFeature=cr,gy.vcm.layer.GeoJSON.writeGeoJSON=gr,gy.vcm.layer.GlobalHider={},gy.vcm.layer.GlobalHider.getInstance=It,gy.vcm.layer.Layer=At,gy.vcm.layer.OpenStreetMap=wr,gy.vcm.layer.SingleImage=Mr,gy.vcm.layer.TMSBase=Sr,gy.vcm.layer.TiledLayer=Er,gy.vcm.layer.Vector=_n,gy.vcm.layer.VectorCluster=Pr,gy.vcm.layer.WFS=xr,gy.vcm.layer.WMTS=Hr,gy.vcm.layer.WSV=Br,gy.vcm.layer.Wms=Fr,gy.vcm.layer.cesium={},gy.vcm.layer.cesium.AbstractCesiumTilesetLayer=Hn,gy.vcm.layer.cesium.AsyncVectorImplementation=tf,gy.vcm.layer.cesium.Buildings=Vn,gy.vcm.layer.cesium.CesiumTilesetLayer=zn,gy.vcm.layer.cesium.CesiumTilesetLayerImpl=rf,gy.vcm.layer.cesium.Czml=qn,gy.vcm.layer.cesium.Entities=Un,gy.vcm.layer.cesium.Gltf=Kn,gy.vcm.layer.cesium.ImageryLayer=sf,gy.vcm.layer.cesium.OpenStreetMapLayer=lf,gy.vcm.layer.cesium.PointCloud=Xn,gy.vcm.layer.cesium.SingleImageLayer=uf,gy.vcm.layer.cesium.TMSBaseLayer=df,gy.vcm.layer.cesium.Terrain=zt,gy.vcm.layer.cesium.VectorClusterLayer=ff,gy.vcm.layer.cesium.VectorLayer=$m,gy.vcm.layer.cesium.WMSLayer=gf,gy.vcm.layer.cesium.WMTSLayer=pf,gy.vcm.layer.cesium.Wsv=bf,gy.vcm.layer.oblique={},gy.vcm.layer.oblique.AsyncVectorImplementation=wf,gy.vcm.layer.oblique.ObliqueLayer=Di,gy.vcm.layer.oblique.VectorClusterLayer=Sf,gy.vcm.layer.oblique.VectorLayer=Mf,gy.vcm.layer.openlayers={},gy.vcm.layer.openlayers.AsyncVectorImplementation=jf,gy.vcm.layer.openlayers.Layer=Cf,gy.vcm.layer.openlayers.OpenStreetMapLayer=Yf,gy.vcm.layer.openlayers.SingleImageLayer=Af,gy.vcm.layer.openlayers.TMSBaseLayer=Nf,gy.vcm.layer.openlayers.VectorClusterLayer=Rf,gy.vcm.layer.openlayers.VectorLayer=If,gy.vcm.layer.openlayers.WMSLayer=Gf,gy.vcm.layer.openlayers.WMTSLayer=Bf,gy.vcm.maps={},gy.vcm.maps.Cesium=Vt,gy.vcm.maps.Oblique=Pi,gy.vcm.maps.Openlayers=Hi,gy.vcm.util={},gy.vcm.util.Balloon=Do,gy.vcm.util.CreateLink={},gy.vcm.util.CreateLink.getLink=Uf,gy.vcm.util.CreateLink.makeLink=Wf,gy.vcm.util.Extent=Ae,gy.vcm.util.IconManager=Gr,gy.vcm.util.Logger=Y,gy.vcm.util.Login=Ps,gy.vcm.util.Projection=R,gy.vcm.util.ViewPoint=V,gy.vcm.util.downloadBlob=qd,gy.vcm.util.downloadCanvas=Kd,gy.vcm.util.downloadText=Jd,gy.vcm.util.editor={},gy.vcm.util.editor.AltitudeModeNames=sn,gy.vcm.util.editor.CircleGeometryEditor=Zo,gy.vcm.util.editor.ClassificationType=on,gy.vcm.util.editor.ClassificationTypeNames=ln,gy.vcm.util.editor.CompositeLayerEditor=kl,gy.vcm.util.editor.FeatureLayerEditor=vo,gy.vcm.util.editor.GeometryLayerEditor=hl,gy.vcm.util.editor.LineGeometryEditor=qo,gy.vcm.util.editor.ModeNames=rn,gy.vcm.util.editor.MultiGeometryEditor=nl,gy.vcm.util.editor.PointGeometryEditor=Ao,gy.vcm.util.editor.RectangleGeometryEditor=Mo,gy.vcm.util.editor.StyleLayerEditor=bl,gy.vcm.util.editor.circleFromCenterRadius=gi,gy.vcm.util.editor.convertGeometryToPolygon=yi,gy.vcm.util.editor.getEditorById=fs,gy.vcm.util.editor.getFeatureHeights=hi,gy.vcm.util.flight={},gy.vcm.util.flight.FlightInstance=Bs,gy.vcm.util.flight.FlightPlayer={},gy.vcm.util.flight.FlightPlayer.getInstance=Zf,gy.vcm.util.flight.FlightVisualizer={},gy.vcm.util.flight.FlightVisualizer.getInstance=ty,gy.vcm.util.flight.exportFlightAsGeoJson=Rs,gy.vcm.util.flight.flightInterpolations=Gs,gy.vcm.util.flight.parseFlightOptionsFromGeoJson=zs,gy.vcm.util.style={},gy.vcm.util.style.DeclarativeStyleItem=Tt,gy.vcm.util.style.Icon=sy,gy.vcm.util.style.Icon.getIconBySrc=oy,gy.vcm.util.style.PatternType=ze,gy.vcm.util.style.StyleItem=He,gy.vcm.util.style.StyleType=Fe,gy.vcm.util.style.VectorStyleItem=gt,gy.vcm.util.style.VectorStyleItem.defaultVectorStyle=vt,gy.vcm.util.style.VectorStyleItem.fromCesiumColor=pt,gy.vcm.util.style.createPattern=We,gy.vcm.util.style.getShapeFromOptions=lt,gy.vcm.util.style.getStringColor=Ue,gy.vcm.util.style.hexToOlColor=Ge,gy.vcm.util.style.olColorToHex=qe,gy.vcm.util.style.parseColor=Be,gy.vcm.util.style.shapeCategory=ut,gy.vcm.util.style.validateHexColor=Je,gy.vcm.util.style.vectorStyleSymbol=ft,gy.vcm.widgets={},gy.vcm.widgets.AdvancedWalkMode=fh,gy.vcm.widgets.BalloonInfo=gh,gy.vcm.widgets.Copyright=ph,gy.vcm.widgets.CreateLink=bh,gy.vcm.widgets.DisplayQuality=Uh,gy.vcm.widgets.Drawing=Jh,gy.vcm.widgets.Drawing.defaultDrawingStyle=Wh,gy.vcm.widgets.Export=Zh,gy.vcm.widgets.FeatureList=Xh,gy.vcm.widgets.Flight=_m,gy.vcm.widgets.Locator=Vu,gy.vcm.widgets.Measurement=Dd,gy.vcm.widgets.Measurement.defaultMeasurementStyle=Ed,gy.vcm.widgets.NavigationControls=Ad,gy.vcm.widgets.OverviewMap=Nd,gy.vcm.widgets.PDFCreator=rm,gy.vcm.widgets.PDFCreator.OrientationMode=Zd,gy.vcm.widgets.PositionDisplay=lm,gy.vcm.widgets.Query=Tu,gy.vcm.widgets.Shadow=um,gy.vcm.widgets.SingleMeasurement=Pd,gy.vcm.widgets.TransparentTerrainMode=vm,gy.vcm.widgets.WFSObject=ku,gy.vcm.widgets.WFSObject.AllLogicalRelations=Lu,gy.vcm.widgets.WFSObject.AllLogicalRelationsDoubleValue=bu,gy.vcm.widgets.WFSObject.AllLogicalRelationsSingleValue=_u,gy.vcm.widgets.WFSObject.AllSpatialFilters=Mu,gy.vcm.widgets.displayQuality={},gy.vcm.widgets.displayQuality.PostProcessStageType=Lh,gy.vcm.widgets.heightProfile={},gy.vcm.widgets.heightProfile.HeightProfile=Dm,gy.vcm.widgets.legend={},gy.vcm.widgets.legend.AbstractGroupItem=ca,gy.vcm.widgets.legend.ClusterItem=ha,gy.vcm.widgets.legend.FlightInstanceItem=ja,gy.vcm.widgets.legend.GroupItem=_a,gy.vcm.widgets.legend.GroupLayerItem=va,gy.vcm.widgets.legend.LayerItem=fa,gy.vcm.widgets.legend.Legend=Fa,gy.vcm.widgets.legend.PlanningClusterItem=Ca,gy.vcm.widgets.legend.PlanningClusterItem.getPlanningClusterItem=Ea,gy.vcm.widgets.legend.PlanningInstanceItem=Ta,gy.vcm.widgets.legend.PluginItem=La,gy.vcm.widgets.legend.TreeItem=oa,gy.vcm.widgets.legend.ViewpointItem=ka,gy.vcm.widgets.measurement={},gy.vcm.widgets.measurement.MeasurementType=$h,gy.vcm.widgets.planning={},gy.vcm.widgets.planning.Planning=xl,gy.vcm.widgets.planning.PlanningComment={},gy.vcm.widgets.planning.PlanningComment.commentTypes=Fs,gy.vcm.widgets.planning.PlanningInstance=Js,gy.vcm.widgets.planning.PlanningObject=za,gy.vcm.widgets.planning.PlanningObject.Status=Ha,gy.vcm.widgets.planning.PlanningObject.Type=Na,gy.vcm.widgets.planning.PlanningObjectDrawing=Ls,gy.vcm.widgets.planning.PlanningObjectFeatureStore=Os,gy.vcm.widgets.planning.PlanningObjectGltf=Va,gy.vcm.widgets.planning.PlanningObjectImage=Ua,gy.vcm.widgets.planning.PlanningObjectProcessing=ws,gy.vcm.widgets.query={},gy.vcm.widgets.query.filter={},gy.vcm.widgets.query.filter.CombinationFilter=hu,gy.vcm.widgets.query.filter.Filter=lu,gy.vcm.widgets.query.filter.GeometryFilter=yu,gy.vcm.widgets.query.filter.PropertyFilter=vu,gy.vcm.widgets.search={},gy.vcm.widgets.search.Elasticsearch=Uu,gy.vcm.widgets.search.ErrorItem=cy,gy.vcm.widgets.search.FeatureItem=ah,gy.vcm.widgets.search.LayerItem=oh,gy.vcm.widgets.search.Nominatim=Iu,gy.vcm.widgets.search.ResultItem=nh,gy.vcm.widgets.search.Search=uh,gy.vcm.widgets.search.VirtualcityLocationService=qu,gy.vcm.widgets.search.middleware={},gy.vcm.widgets.search.middleware.Near=$u,gy.vcm.widgets.search.middleware.Tags=Qu}]);
\ No newline at end of file
+e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,i){"use strict";var n=i(152),r=i(33),a=i(629),s=i(630);function o(e){this.defaults=e,this.interceptors={request:new a,response:new a}}o.prototype.request=function(e){"string"===typeof e&&(e=r.merge({url:arguments[0]},arguments[1])),e=r.merge(n,{method:"get"},this.defaults,e),e.method=e.method.toLowerCase();var t=[s,void 0],i=Promise.resolve(e);this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});while(t.length)i=i.then(t.shift(),t.shift());return i},r.forEach(["delete","get","head","options"],function(e){o.prototype[e]=function(t,i){return this.request(r.merge(i||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){o.prototype[e]=function(t,i,n){return this.request(r.merge(n||{},{method:e,url:t,data:i}))}}),e.exports=o},function(e,t){var i,n,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function l(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(function(){try{i="function"===typeof setTimeout?setTimeout:a}catch(e){i=a}try{n="function"===typeof clearTimeout?clearTimeout:s}catch(e){n=s}})();var c,u=[],h=!1,d=-1;function m(){h&&c&&(h=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!h){var e=o(m);h=!0;var t=u.length;while(t){c=u,u=[];while(++d<t)c&&c[d].run();d=-1,t=u.length}c=null,h=!1,l(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];u.push(new y(e,t)),1!==u.length||h||o(f)},y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,i){"use strict";var n=i(33);e.exports=function(e,t){n.forEach(e,function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])})}},function(e,t,i){"use strict";var n=i(209);e.exports=function(e,t,i){var r=i.config.validateStatus;i.status&&r&&!r(i.status)?t(n("Request failed with status code "+i.status,i.config,null,i.request,i)):e(i)}},function(e,t,i){"use strict";e.exports=function(e,t,i,n,r){return e.config=t,i&&(e.code=i),e.request=n,e.response=r,e}},function(e,t,i){"use strict";var n=i(33);function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var a;if(i)a=i(t);else if(n.isURLSearchParams(t))a=t.toString();else{var s=[];n.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(r(t)+"="+r(e))}))}),a=s.join("&")}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e}},function(e,t,i){"use strict";var n=i(33),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,a,s={};return e?(n.forEach(e.split("\n"),function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),i=n.trim(e.substr(a+1)),t){if(s[t]&&r.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([i]):s[t]?s[t]+", "+i:i}}),s):s}},function(e,t,i){"use strict";var n=i(33);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function r(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=r(window.location.href),function(t){var i=n.isString(t)?r(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return function(){return!0}}()},function(e,t,i){"use strict";var n=i(33);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,i,r,a,s){var o=[];o.push(e+"="+encodeURIComponent(t)),n.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),n.isString(r)&&o.push("path="+r),n.isString(a)&&o.push("domain="+a),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,i){"use strict";var n=i(33);function r(){this.handlers=[]}r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,i){"use strict";var n=i(33),r=i(631),a=i(210),s=i(152),o=i(632),l=i(633);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){c(e),e.baseURL&&!o(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||s.adapter;return t(e).then(function(t){return c(e),t.data=r(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(c(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,i){"use strict";var n=i(33);e.exports=function(e,t,i){return n.forEach(i,function(i){e=i(e,t)}),e}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var n=i(211);function r(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var i=this;e(function(e){i.reason||(i.reason=new n(e),t(i.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t,i){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,i){i(118),i(93),e.exports=i(637)},function(e,t,i){var n=i(48),r=i(162);e.exports=i(19).getIterator=function(e){var t=r(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){var n={"./af":213,"./af.js":213,"./ar":214,"./ar-dz":215,"./ar-dz.js":215,"./ar-kw":216,"./ar-kw.js":216,"./ar-ly":217,"./ar-ly.js":217,"./ar-ma":218,"./ar-ma.js":218,"./ar-sa":219,"./ar-sa.js":219,"./ar-tn":220,"./ar-tn.js":220,"./ar.js":214,"./az":221,"./az.js":221,"./be":222,"./be.js":222,"./bg":223,"./bg.js":223,"./bm":224,"./bm.js":224,"./bn":225,"./bn.js":225,"./bo":226,"./bo.js":226,"./br":227,"./br.js":227,"./bs":228,"./bs.js":228,"./ca":229,"./ca.js":229,"./cs":230,"./cs.js":230,"./cv":231,"./cv.js":231,"./cy":232,"./cy.js":232,"./da":233,"./da.js":233,"./de":234,"./de-at":235,"./de-at.js":235,"./de-ch":236,"./de-ch.js":236,"./de.js":234,"./dv":237,"./dv.js":237,"./el":238,"./el.js":238,"./en-SG":239,"./en-SG.js":239,"./en-au":240,"./en-au.js":240,"./en-ca":241,"./en-ca.js":241,"./en-gb":242,"./en-gb.js":242,"./en-ie":243,"./en-ie.js":243,"./en-il":244,"./en-il.js":244,"./en-nz":245,"./en-nz.js":245,"./eo":246,"./eo.js":246,"./es":247,"./es-do":248,"./es-do.js":248,"./es-us":249,"./es-us.js":249,"./es.js":247,"./et":250,"./et.js":250,"./eu":251,"./eu.js":251,"./fa":252,"./fa.js":252,"./fi":253,"./fi.js":253,"./fo":254,"./fo.js":254,"./fr":255,"./fr-ca":256,"./fr-ca.js":256,"./fr-ch":257,"./fr-ch.js":257,"./fr.js":255,"./fy":258,"./fy.js":258,"./ga":259,"./ga.js":259,"./gd":260,"./gd.js":260,"./gl":261,"./gl.js":261,"./gom-latn":262,"./gom-latn.js":262,"./gu":263,"./gu.js":263,"./he":264,"./he.js":264,"./hi":265,"./hi.js":265,"./hr":266,"./hr.js":266,"./hu":267,"./hu.js":267,"./hy-am":268,"./hy-am.js":268,"./id":269,"./id.js":269,"./is":270,"./is.js":270,"./it":271,"./it-ch":272,"./it-ch.js":272,"./it.js":271,"./ja":273,"./ja.js":273,"./jv":274,"./jv.js":274,"./ka":275,"./ka.js":275,"./kk":276,"./kk.js":276,"./km":277,"./km.js":277,"./kn":278,"./kn.js":278,"./ko":279,"./ko.js":279,"./ku":280,"./ku.js":280,"./ky":281,"./ky.js":281,"./lb":282,"./lb.js":282,"./lo":283,"./lo.js":283,"./lt":284,"./lt.js":284,"./lv":285,"./lv.js":285,"./me":286,"./me.js":286,"./mi":287,"./mi.js":287,"./mk":288,"./mk.js":288,"./ml":289,"./ml.js":289,"./mn":290,"./mn.js":290,"./mr":291,"./mr.js":291,"./ms":292,"./ms-my":293,"./ms-my.js":293,"./ms.js":292,"./mt":294,"./mt.js":294,"./my":295,"./my.js":295,"./nb":296,"./nb.js":296,"./ne":297,"./ne.js":297,"./nl":298,"./nl-be":299,"./nl-be.js":299,"./nl.js":298,"./nn":300,"./nn.js":300,"./pa-in":301,"./pa-in.js":301,"./pl":302,"./pl.js":302,"./pt":303,"./pt-br":304,"./pt-br.js":304,"./pt.js":303,"./ro":305,"./ro.js":305,"./ru":306,"./ru.js":306,"./sd":307,"./sd.js":307,"./se":308,"./se.js":308,"./si":309,"./si.js":309,"./sk":310,"./sk.js":310,"./sl":311,"./sl.js":311,"./sq":312,"./sq.js":312,"./sr":313,"./sr-cyrl":314,"./sr-cyrl.js":314,"./sr.js":313,"./ss":315,"./ss.js":315,"./sv":316,"./sv.js":316,"./sw":317,"./sw.js":317,"./ta":318,"./ta.js":318,"./te":319,"./te.js":319,"./tet":320,"./tet.js":320,"./tg":321,"./tg.js":321,"./th":322,"./th.js":322,"./tl-ph":323,"./tl-ph.js":323,"./tlh":324,"./tlh.js":324,"./tr":325,"./tr.js":325,"./tzl":326,"./tzl.js":326,"./tzm":327,"./tzm-latn":328,"./tzm-latn.js":328,"./tzm.js":327,"./ug-cn":329,"./ug-cn.js":329,"./uk":330,"./uk.js":330,"./ur":331,"./ur.js":331,"./uz":332,"./uz-latn":333,"./uz-latn.js":333,"./uz.js":332,"./vi":334,"./vi.js":334,"./x-pseudo":335,"./x-pseudo.js":335,"./yo":336,"./yo.js":336,"./zh-cn":337,"./zh-cn.js":337,"./zh-hk":338,"./zh-hk.js":338,"./zh-tw":339,"./zh-tw.js":339};function r(e){var t=a(e);return i(t)}function a(e){var t=n[e];if(!(t+1)){var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}return t}r.keys=function(){return Object.keys(n)},r.resolve=a,e.exports=r,r.id=639},function(e,t,i){"use strict";var n=i(115);function r(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){var n=i(15);n(n.P,"String",{repeat:i(642)})},function(e,t,i){"use strict";var n=i(78),r=i(57);e.exports=function(e){var t=String(r(this)),i="",a=n(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(i+=t);return i}},function(e,t,i){e.exports=i(678)},function(e,t,i){e.exports=i(687)},function(e,t,i){"use strict";(function(e){i(13),i(88),i(26),i(11),i(7);var n=i(646),r=i(10),a=(i(12),i(22),i(4),i(654),i(1)),s=i(0),o=i(539),l=i.n(o),c=i(9),u=i.n(c),h=i(662),d=i(540),m=i(541),f=i(663),y=i(5),g=i(114),v=function(){function t(e){Object(a["a"])(this,t),this.terrainProvider=e.terrainProvider||null,this.projection=e.projection||null,this.directions={},this.options=e,this.meta=[],this.extent=ol.extent.createEmpty(),this.minZoom=Object(y["h"])(e.minZoom,0),this.maxZoom=Object(y["h"])(e.maxZoom,0),this.hideLevels=Object(y["h"])(e.hideLevels,0)}return Object(s["a"])(t,[{key:"loadData",value:function(e){var t=this,i=[],n=Array.isArray(e)?e:[e],r=u.a.create();return r.interceptors.response.use(function(e){return e},function(e){return String(e.response.status).startsWith("4")&&e.config&&!e.config.retriedWithNewURL?(e.config.retriedWithNewURL=!0,e.config.url="".concat(e.config.url,"/image.json"),r.request(e.config)):Promise.reject(e)}),n.forEach(function(e){i.push(r.get(e).then(function(e){var i=e.data,n=e.config,r=n.url.substring(0,n.url.lastIndexOf("/"));t.handleMetadataResponse(i,r)}).catch(function(t){console.log("Invalid image.json data. Please correct, File: ".concat(e,", Error ").concat(t.message))}))}),Promise.all(i)}},{key:"handleMetadataResponse",value:function(e,i){var n=t.getVersion(e);n.version>=3.5||3.4===n.version&&n.buildNumber>=36?this.handleMetadataResponseV35(e,i,n):console.log("Could not load Meta Data, only meta data version 3.5 and higher are supported")}},{key:"getImageMeta",value:function(e,t,i,n,r){var a=this.hideLevels?i.slice(0,i.length-this.hideLevels):i,s=this.meta.find(function(i){return i.isEqual(e,t,a)});if(s)return s;var o=new f["a"]({url:e,size:t,tileSize:n,tileResolution:a,minZoom:this.minZoom,maxZoom:this.maxZoom}),l=new h["a"]({size:t,view:o,version:r.version,buildNumber:r.buildNumber});return this.meta.push(l),l}},{key:"handleMetadataResponseV35",value:function(t,i,a){var s=this,o=[t.generalImageInfo.width,t.generalImageInfo.height],c=t.generalImageInfo["tile-resolution"],u=[t.generalImageInfo["tile-width"],t.generalImageInfo["tile-width"]];t.generalImageInfo.width&&t.generalImageInfo.height&&t.generalImageInfo["tile-resolution"]&&this.getImageMeta(i,o,c,u,a);var h=[];t.generalImageInfo.cameraParameter&&Array.isArray(t.generalImageInfo.cameraParameter)&&t.generalImageInfo.cameraParameter.forEach(function(e){h.push(new m["a"](e))});var f=null;if(t.generalImageInfo.crs){var y=l()();e.proj4.defs(y,t.generalImageInfo.crs),f=ol.proj.get(y)}var g=t.images.shift(),v={name:g.indexOf("name"),width:g.indexOf("width"),height:g.indexOf("height"),tileResolution:g.indexOf("tile-resolution"),viewDirection:g.indexOf("view-direction"),viewDirectionAngle:g.indexOf("view-direction-angle"),groundCoordinates:g.indexOf("groundCoordinates"),centerPointOnGround:g.indexOf("centerPointOnGround"),cameraIndex:g.indexOf("camera-index"),projectionCenter:g.indexOf("projection-center"),pToRealworld:g.indexOf("p-to-realworld"),pToImage:g.indexOf("p-to-image")},p={};t.images.forEach(function(e){var t=[];e[v.pToRealworld]&&e[v.pToRealworld].forEach(function(e){t.push.apply(t,Object(r["a"])(e))});var l=e[v.pToRealworld]?Object(n["a"])(Cesium.Matrix3,t):null,m=[];e[v.pToImage]&&(e[v.pToImage].forEach(function(e){m.push.apply(m,Object(r["a"])(e))}),m.push(0,0,0,1));var y=e[v.projectionCenter]?Cesium.Cartesian3.fromArray(e[v.projectionCenter]):null,g=e[v.pToImage]?Object(n["a"])(Cesium.Matrix4,m):null,_=e[v.width]&&e[v.height]?[e[v.width],e[v.height]]:o,b=e[v.tileResolution]?e[v.tileResolution]:c,L=s.getImageMeta(i,_,b,u,a),M={name:e[v.name],viewDirection:e[v.viewDirection],viewDirectionAngle:e[v.viewDirectionAngle],groundCoordinates:e[v.groundCoordinates],centerPointOnGround:e[v.centerPointOnGround],meta:L,camera:h[e[v.cameraIndex]],projectionCenter:y,pToRealworld:l,pToImage:g,projection:s.projection||f,terrainProvider:s.terrainProvider},k=new d["a"](M);p[k.viewDirection]||(p[k.viewDirection]={direction:k.viewDirection,images:{},rTreeItems:[],footPrintFeatures:[],projection:s.projection||f,terrainProvider:s.terrainProvider}),p[k.viewDirection].images[k.name]=k,p[k.viewDirection].rTreeItems.push({minX:k.centerPointOnGround[0],minY:k.centerPointOnGround[1],maxX:k.centerPointOnGround[0],maxY:k.centerPointOnGround[1],name:k.name});var w=new ol.geom.Polygon([k.groundCoordinates.concat([k.groundCoordinates[0]])]);w.transform(s.projection||f,ol.proj.get("EPSG:3857"));var T=new ol.Feature({geometry:w});T.setId(k.name),p[k.viewDirection].footPrintFeatures.push(T)}),Object.keys(p).forEach(function(e){s.directions[e]?s.directions[e].addOptions(p[e]):s.directions[e]=s.createDirection(p[e]),s.extent=ol.extent.extend(s.extent,s.directions[e].footPrintsLayer.getSource().getExtent())})}},{key:"createDirection",value:function(e){return new g["a"](e)}},{key:"getImageByName",value:function(e){for(var t=Object.values(this.directions),i=0;i<t.length;i++){var n=t[i];if(n.images[e])return n.images[e]}return null}}],[{key:"getVersion",value:function(e){var t={version:null,buildNumber:null};if(e.version){var i=e.version.match(/\d+\.\d+/);i&&(t.version=Number(i[0]));var n=e.version.match(/-\d+-/);n&&(t.buildNumber=Number(n[0].match(/\d+/)[0]))}return t}}]),t}();t["a"]=v}).call(this,i(212))},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var n=i(345),r=i.n(n),a=i(538);function s(){if("undefined"===typeof Reflect||!r.a)return!1;if(r.a.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(r()(Date,[],function(){})),!0}catch(e){return!1}}function o(e,t,i){return o=s()?r.a:function(e,t,i){var n=[null];n.push.apply(n,t);var r=Function.bind.apply(e,n),s=new r;return i&&Object(a["a"])(s,i.prototype),s},o.apply(null,arguments)}},function(e,t,i){"use strict";var n=i(695);function r(e,t,i,r,o,l){var c,u,h,d,m=e.data,f=[],y=e.toBBox,g=new n(null,a);while(m){for(c=0;c<m.children.length;c++)u=m.children[c],h=s(t,i,m.leaf?y(u):u),(!l||h<=l)&&g.push({node:u,isItem:m.leaf,dist:h});while(g.length&&g.peek().isItem)if(d=g.pop().node,o&&!o(d)||f.push(d),r&&f.length===r)return f;m=g.pop(),m&&(m=m.node)}return f}function a(e,t){return e.dist-t.dist}function s(e,t,i){var n=o(e,i.minX,i.maxX),r=o(t,i.minY,i.maxY);return n*n+r*r}function o(e,t,i){return e<t?t-e:e<=i?0:e-i}e.exports=r,e.exports.default=r},function(e,t,i){e.exports=i(702)},function(e,t,i){e.exports=i(704)},function(e,t,i){"use strict";e.exports={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]}},,function(e,t,i){var n=i(47),r=i(19),a=i(86);e.exports=function(e,t){var i=(r.Object||{})[e]||Object[e],s={};s[e]=t(i),n(n.S+n.F*a(function(){i(1)}),"Object",s)}},function(e,t){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){"use strict";var n=i(15),r=i(59),a=i(191),s="startsWith",o=""[s];n(n.P+n.F*i(192)(s),"String",{startsWith:function(e){var t=a(this,e,s),i=r(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return o?o.call(t,n,i):t.slice(i,i+n.length)===n}})},function(e,t,i){var n,r=i(17),a=i(45),s=i(68),o=s("typed_array"),l=s("view"),c=!(!r.ArrayBuffer||!r.DataView),u=c,h=0,d=9,m="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");while(h<d)(n=r[m[h++]])?(a(n.prototype,o,!0),a(n.prototype,l,!0)):u=!1;e.exports={ABV:c,CONSTR:u,TYPED:o,VIEW:l}},function(e,t,i){var n=i(78),r=i(59);e.exports=function(e){if(void 0===e)return 0;var t=n(e),i=r(t);if(t!==i)throw RangeError("Wrong length!");return i}},function(e,t,i){var n=i(48),r=i(115),a=i(28)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[a])?t:r(i)}},function(e,t,i){var n,r,a,s=i(108),o=i(653),l=i(346),c=i(159),u=i(36),h=u.process,d=u.setImmediate,m=u.clearImmediate,f=u.MessageChannel,y=u.Dispatch,g=0,v={},p="onreadystatechange",_=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},b=function(e){_.call(e.data)};d&&m||(d=function(e){var t=[],i=1;while(arguments.length>i)t.push(arguments[i++]);return v[++g]=function(){o("function"==typeof e?e:Function(e),t)},n(g),g},m=function(e){delete v[e]},"process"==i(109)(h)?n=function(e){h.nextTick(s(_,e,1))}:y&&y.now?n=function(e){y.now(s(_,e,1))}:f?(r=new f,a=r.port2,r.port1.onmessage=b,n=s(a.postMessage,a,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",b,!1)):n=p in c("script")?function(e){l.appendChild(c("script"))[p]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(s(_,e,1),0)}),e.exports={set:d,clear:m}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,i){var n=i(48),r=i(51),a=i(640);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=a.f(e),s=i.resolve;return s(t),i.promise}},function(e,t,i){e.exports=i(683)},function(e,t,i){"use strict";i(26),i(4),i(22),i(96);var n=i(1),r=i(0),a=i(27),s=function(){function e(t){var i=this;Object(n["a"])(this,e),this.size=t.size,this.views=new Map,t.view&&Object.values(a["a"]).forEach(function(e){i.views.set(e,t.view.clone())}),this.version=t.version||3.1,this.buildNumber=t.buildNumber||0}return Object(r["a"])(e,[{key:"getView",value:function(e){return this.views.get(e)}},{key:"isEqual",value:function(e,t,i){return this.size[0]===t[0]&&this.size[1]===t[1]&&(this.views.values().next().value.tileResolution.length===i.length&&this.views.values().next().value.url===e)}}]),e}();t["a"]=s},function(e,t,i){"use strict";var n=i(14),r=i(10),a=i(1),s=i(0),o=i(34),l=0,c=function(){function e(t){Object(a["a"])(this,e),this.id=l,l+=1,this.size=t.size,this.url=t.url,this.tileSize=t.tileSize,this.tileResolution=t.tileResolution,this.format=t.format||"jpg",this.minZoom=t.minZoom,this.maxZoom=t.maxZoom,this._createViewAndLayer()}return Object(s["a"])(e,[{key:"_createViewAndLayer",value:function(){var e=[0,0].concat(Object(r["a"])(this.size)),t=new ol.proj.Projection({code:"ZOOMIFY",units:"pixels",extent:e});this.view=new ol.View({projection:t,center:[this.size[0]/2,this.size[1]/2],minZoom:this.minZoom,maxZoom:this.maxZoom>0?this.maxZoom:this.tileResolution.length+4,extent:[-2e3,-2e3,this.size[0]+2e3,this.size[1]+2e3],zoom:this.minZoom});var i={projection:t,tileGrid:new ol.tilegrid.TileGrid({origin:[0,0],extent:e,resolutions:this.tileResolution,tileSize:this.tileSize})};o["a"].hasSameOrigin(this.url)||(i.crossOrigin="anonymous"),this.tileImageSource=new ol.source.TileImage(i),this.layer=new ol.layer.Tile({source:this.tileImageSource,extent:e})}},{key:"clone",value:function(){return new e({size:this.size,url:this.url,tileSize:this.tileSize,tileResolution:this.tileResolution,minZoom:this.minZoom,maxZoom:this.maxZoom})}},{key:"setSize",value:function(e){this.size=e,this._createViewAndLayer()}},{key:"setImageName",value:function(e){var t=this;this.tileImageSource.setTileUrlFunction(function(i){var r=Object(n["a"])(i,3),a=r[0],s=r[1],o=r[2];return"".concat(t.url,"/").concat(e,"/").concat(a,"/").concat(s,"/").concat(o,".").concat(t.format)}),this.tileImageSource.refresh()}}]),e}();t["a"]=c},function(e,t,i){"use strict";e.exports=r,e.exports.default=r;var n=i(694);function r(e,t){if(!(this instanceof r))return new r(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function a(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function s(e,t){o(e,0,e.children.length,t,e)}function o(e,t,i,n,r){r||(r=v(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var a,s=t;s<i;s++)a=e.children[s],l(r,e.leaf?n(a):a);return r}function l(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 c(e,t){return e.minX-t.minX}function u(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 m(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){var i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,a-n)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(e,t,i,r,a){var s,o=[t,i];while(o.length)i=o.pop(),t=o.pop(),i-t<=r||(s=t+Math.ceil((i-t)/r/2)*r,n(e,s,t,i,a),o.push(t,s,s,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],n=this.toBBox;if(!g(e,t))return i;var r,a,s,o,l=[];while(t){for(r=0,a=t.children.length;r<a;r++)s=t.children[r],o=t.leaf?n(s):s,g(e,o)&&(t.leaf?i.push(s):y(e,o)?this._all(s,i):l.push(s));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!g(e,t))return!1;var n,r,a,s,o=[];while(t){for(n=0,r=t.children.length;n<r;n++)if(a=t.children[n],s=t.leaf?i(a):a,g(e,s)){if(t.leaf||y(e,s))return!0;o.push(a)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(e,t){if(!e)return this;var i,n,r,s,o=this.data,l=this.toBBox(e),c=[],u=[];while(o||c.length){if(o||(o=c.pop(),n=c[c.length-1],i=u.pop(),s=!0),o.leaf&&(r=a(e,o.children,t),-1!==r))return o.children.splice(r,1),c.push(o),this._condense(c),this;s||o.leaf||!y(o,l)?n?(i++,o=n.children[i],s=!1):o=null:(c.push(o),u.push(i),i=0,n=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){var i=[];while(e)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,n){var r,a=i-t+1,o=this._maxEntries;if(a<=o)return r=v(e.slice(t,i+1)),s(r,this.toBBox),r;n||(n=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,n-1))),r=v([]),r.leaf=!1,r.height=n;var l,c,u,h,d=Math.ceil(a/o),m=d*Math.ceil(Math.sqrt(o));for(p(e,t,i,m,this.compareMinX),l=t;l<=i;l+=m)for(u=Math.min(l+m-1,i),p(e,l,u,d,this.compareMinY),c=l;c<=u;c+=d)h=Math.min(c+d-1,u),r.children.push(this._build(e,c,h,n-1));return s(r,this.toBBox),r},_chooseSubtree:function(e,t,i,n){var r,a,s,o,l,c,u,d;while(1){if(n.push(t),t.leaf||n.length-1===i)break;for(u=d=1/0,r=0,a=t.children.length;r<a;r++)s=t.children[r],l=h(s),c=m(e,s)-l,c<d?(d=c,u=l<u?l:u,o=s):c===d&&l<u&&(u=l,o=s);t=o||t.children[0]}return t},_insert:function(e,t,i){var n=this.toBBox,r=i?e:n(e),a=[],s=this._chooseSubtree(r,this.data,t,a);s.children.push(e),l(s,r);while(t>=0){if(!(a[t].children.length>this._maxEntries))break;this._split(a,t),t--}this._adjustParentBBoxes(r,a,t)},_split:function(e,t){var i=e[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var a=this._chooseSplitIndex(i,r,n),o=v(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,s(i,this.toBBox),s(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=v([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var n,r,a,s,l,c,u,d;for(c=u=1/0,n=t;n<=i-t;n++)r=o(e,0,n,this.toBBox),a=o(e,n,i,this.toBBox),s=f(r,a),l=h(r)+h(a),s<c?(c=s,d=n,u=l<u?l:u):s===c&&l<u&&(u=l,d=n);return d},_chooseSplitAxis:function(e,t,i){var n=e.leaf?this.compareMinX:c,r=e.leaf?this.compareMinY:u,a=this._allDistMargin(e,t,i,n),s=this._allDistMargin(e,t,i,r);a<s&&e.children.sort(n)},_allDistMargin:function(e,t,i,n){e.children.sort(n);var r,a,s=this.toBBox,c=o(e,0,t,s),u=o(e,i-t,i,s),h=d(c)+d(u);for(r=t;r<i-t;r++)a=e.children[r],l(c,e.leaf?s(a):a),h+=d(c);for(r=i-t-1;r>=t;r--)a=e.children[r],l(u,e.leaf?s(a):a),h+=d(u);return h},_adjustParentBBoxes:function(e,t,i){for(var n=i;n>=0;n--)l(t[n],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children,t.splice(t.indexOf(e[i]),1)):this.clear():s(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},function(e,t,i){"use strict";var n=Array.isArray,r=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){var s,o,l,c=n(t),u=n(i);if(c&&u){if(o=t.length,o!=i.length)return!1;for(s=o;0!==s--;)if(!e(t[s],i[s]))return!1;return!0}if(c!=u)return!1;var h=t instanceof Date,d=i instanceof Date;if(h!=d)return!1;if(h&&d)return t.getTime()==i.getTime();var m=t instanceof RegExp,f=i instanceof RegExp;if(m!=f)return!1;if(m&&f)return t.toString()==i.toString();var y=r(t);if(o=y.length,o!==r(i).length)return!1;for(s=o;0!==s--;)if(!a.call(i,y[s]))return!1;for(s=o;0!==s--;)if(l=y[s],!e(t[l],i[l]))return!1;return!0}return t!==t&&i!==i}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJhSURBVFiF7ZW/a1pRFMc/70XFYqVFUCq1hSClvCIShw6FItQ9U8EtHVySuYvg0C2BLB0KDeQf6NLFxU0KLRSKGMmDtKldqg3FEKVNaoqa6Hsd9JXrxR9tYsziF85wzzucz/fd++55cHYtAt97sXiOPmdSEPgFmL04Bu5OC24DPghwK/KAYxoGVgfArVi9aPhDoD3CQAd4dFHw60BJBPp8vhOfz3cimSj1aieuVyJIVVUznU4XM5lMUVVVQzLxetLwJxLAXFlZqZimmTdNM7+8vLwvPweWJgWfB47E5pqm/W42m1uWgVartRUKhY4lA3XgznnhNuC92NjhcHRyudxHC25FoVDYcTqdHclEDrCPAsyNMfAMaSvX1tb24vH4kVzo9/vbdru9k81mrwnpm3RvxtsxnIG6D/R94dFo9NAwjLz89mLEYrGf9O/CKfBgGEQZkr8KFBDO0OPxtHVd/xQIBE5Hua5UKrZwOHyvVquJW/8VWKA7vvukDunzUoQrisLGxkZpHBy6R7G5uVlSlL53mwdeDKof9A08RhqpiUTiIJVKHYyDW9I0rVUul23b29suIb0AfAF2xFr5CAKADnisRDAYbOi6/tnlchn/agCg0WgokUhEKxaLV4T0Yc9IeZCBOeANELUSqqqyvr7+TdO0pgzwer1tt9ttANTrdbVardrkmt3dXWcymbxtGH3e3wExurejT0mG/2QmHUkZDlCbooGaBRVvwY9Bri5If1niuS0Bz4EbUvEtaT1ytNIdPKL2pPU+8NRaDBtEo2SOef5fPYcNoqlpZmBmYGZgZuDSDfwBYHFBvEfx+bgAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABOSURBVFiF7dexDQAgCETRO+My7r+GveNga7AmNP86aHihAkvaaszoHA5AkmZuRMSpHGh7vXX7BgAAAAAAAAAAAAAAAPD9Bflur077BgBceZ8FPDUm8YQAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPnSURBVFiFtZdNTGNVFMd/fZ1SCjPFxohtnyGY8SMhMaRm2LkRmrqYgG2gJCbETBcTNEZXysLERU10oTvjAhIIloWbBpuujE1oWKgLP1IYYWF00uQlfbwymRJgmBHKe3XxaH1zbUvLlP/ynHPv+d97zr3nHButoxd4DRgBXgJ8wLUz3SGwA/wJ/Ar8CDxsZVNbCzYDwC0gBHS3SPYf4AcgASgXJeAE3gXeAuwtOhZxCnwLzAMn7RAYAL4Erl/QsYg/gA+B+60QeBn4GvCIClmWTyKRyOHo6OhRIBA49vv9OoCqqvZcLufMZrO9qVTKXSgUHHX23QU+AP5uRmAAWBKdy7Jcjsfju7FY7ECSpIbHBDAMg8XFxb54PP6MqqoikSLwNpabsBLoAr7BzPAawuHwfiKR0Nxut9HUs4C9vT17NBr1ra2tXRNUd4B3OMsJa3K9D7xutZydnS2trKxo3d3dlXacA7hcrsrMzMyBoij2jY0Nl0X1LGAAv8N/NzAAJK2EwuHw/urqqnrelZ8HwzAIhULPCTfxEIgA96u737I6l2W5nEgktCd1DiBJEslkcqe/v//UIu4BbgNImD9cyLooHo/vthvzZvB4PPrc3Nw9QXwT6LEBbwCfVaWyLJ8oinK3E6e3olwu2wYHB68LL+NjCfNvryESiRx22jmAw+GojI+PHwjiGxLCswsGg0cd936GUCgk7v2iBPitkuHh4ePLIhAIBMR6IFeTsAav16tfFgGv13sqiK52PthtQgIei4umaRctvedC07QrguiBBKhWSS6Xc14WgVwu1yWIChJmG1VDNpvt5ZKQyWSuCqK/JMweroZUKuXWdb2VVq0t6LpuS6fTYmX8RUJoIAuFgmNpacndaQILCwtuTdOsv+Aj4OfqST8B3qxq/H5/eWtrK+/xeDryJEulkn1oaOj5YrFoJfAd8Hn1GSYwG0gAVFV1RKNRn2E8eT0yDIOpqSm/4Lx85rNWgvcxS+Rw1SKfzzsVRbFPTEwc2WwXSwnDMIjFYt50Ot0nqFaANfh/S7YAvGK1HBsbO0wmkzvthqNUKtknJyf96+vrYuY3bMl0zIQMAbVF+Xzeuby83CdJkjEyMnJstzf/p3Rdt83Pz/dNT0/L29vbLkF9D3gPc5IC6rflLwBfAf2iwuv1liORyEEwGDwKBAInPp/vtFKpoKrqlc3Nza5MJtObTqfFbK+iiNmW37UKGwX3KeAL4NVGJ20Td4CPqDOYNLrP6mxnAENAvRO1gjJmwn0KPKhn0Ep6P43ZQN4ExJg2wiPge8w5Q21m2M776sEcz29gdlF+Hh/PVcy68hvwEy2O5/8CzKw/sVG0Ap4AAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAABDCAYAAADHyrhzAAAL9UlEQVR4Xs1bfVRU1RY/5zLO4KxRTDEx/EzRhFTmzuAiwq+MUktLW1jqk3LBCpHUQFEqLc0n8RRZIGJi44NXmolpJj5NS40kBBlmBAN8wnsaysPvEHB883HPeevwGtYIM3PPvXOn9e5fwPnt3973x7n3nn32PhD8QVdVVdUgAMDjVqvVn2GYfhjjXgzD9OQ4TgkhVDAM8wAh9BAA8AAA0AIAuIMxvm2xWG5FRETc+yPChN5yotfrB0IIx0AIh2OMB3viB0LYBiFsRAj9SyaTXRo/fjwRTPJLUjHIf99ms4UwDDMGIdRH8mj/R4gZhvnVZrPVyuXyGimFkUQMvV5PpvpEAIAWANDDSyJ0o4UQ3kUI/ajRaH6BEGJP/XosRmVlpQZCGIUx9hUbzPXr11WDBg1qF2sPAPi3TCY7PH78+FsecADRYpSWlvZVKBSvAACGehLAjRs3lDk5ObM3bdr0lSc8EELOZrOVhoWF/Uh+FsMlSgyDwfAMAGAaxlgmxqmjTV5e3rMlJSXPb9myZUtAQIDJUz6GYW5brdaDEyZMuCGUS5AYer3eD0I4BwAwTKgjV/j4+PgVJpOpT2Rk5A/x8fE/S8FLZgbG+EeWZX+GECJaTmoxyEsSAPAmhHAALTkfrri4eIhOp1tMcEqlsiUvLy+bz0bIOEKoJCws7AdaGyox6uvre7e1tb2JMe5HS0yD27hx4yuXL18OtWPffvvt/IkTJzbS2NJiMMYVWq327zR4XjFqampUFoslFiH0GA0hLeb+/fvy5cuXpyCEOt87o0aNurBu3bpvaTkE4PQajeYoH96tGFeuXPFtaWkhQvTnIxI6vmfPHvbEiROzHO0YhrFt27Zti5+fn0UoHx8eQljCsqzbR8atGAaDYRHGeASfIzHjSUlJsXfu3CH5yiNXVFTU0ZiYmEoxnHw2CKGvw8LCfnGFcylGZWVlOABgOp8DMeO1tbX9Pvnkk3ec2fbt27cpOztbJ4aXzwZC+FChUOSGhIQ4XeA5FaOqqupxjuPiMcY+fA7EjGdkZLxQVVVF1ipOr/fee297cHDwXTHcFDYNGo1mjzOcUzGMRuObCKHhFMSiILGxsSkWi4V8qp1eY8eOLVu9evUJUeQURgzDHFar1Re6QruJYTQaQxFCr1JwioIcPnw4+ODBg9HujGUymTk/Pz9dlAM6I5Ovr29WSEjIIy/qR8S4du1az1u3bi0jayA6TuGo1NTUhU1NTSP5LOfMmXNg7ty5tXw4D8bLNBrNd472j4hRUVExhWGYKR44cGva2NjY64MPPkim4Q8MDGxIT0/fS4MVg8EYI7lcnjNu3Ljf7PadYtTX1yva2tqSPEnF+YLKzc2dVFZWNpUPZx/ftGlT5pAhQ9po8UJxDMNcUKvVh7uJ4e1ZQRzakzLaoMPDw88kJib+RIsXius6OzpnhsFgWIIxDhBKSIs/derU8IKCghhaPMF5I3lz4v87jUZTRv7eIYZer/eHEDpdBAkJ3h12w4YNcxsaGsYK5YuJifk8KirqilA7WjzDMNfVanXHIq9DDG8/Infv3vVNTk5e6ZiU0QY7YsSIi+vXrz9EixeKYxiGbDBnkI3lDjGMRmMcQqhbniCU2BU+Pz8/7PTp0zPF8mVlZf2lX79+/xFrz2dnX4RB8hVpb29PRQjxpvN8pK7Gly1btqSlpUX0ptBzzz13fPHixefF+uezgxD+wrLs17C8vHyUTCZbwGcgdryysjIgKysrXqw9sevTp8/NnJycnZ5w8NiaNBrNZqjX6yMhhM97y1F6evqMmpqaCZ7yL1++fFdYWFizpzyu7FtbW/8MjUbjqwihzq03KZ2ZTCZZYmLiKpvNpvCUNyQkpCI1NfWYpzyu7E0mUzYR4y2EkGS73Y7OCgsLxxYVFc2V4gZI8pabm5uhVCptUvB15ZDL5bthZWUlWV/4e8PB6tWrY5qbmyXbCpg1a9ahefPmXfRGrFardS+ZGasQQiqpHdTX1/f5+OOPV0jJO3DgwCubN2/+XEpOB6790GAwrJWiMtY1wOzs7Kl6vX6S1IF/+OGH2UFBQaR/Q+rrEHlM1kvNSvji4uJWms1myWecVqv9acWKFWe8EHMRmRmpUqftx48fH/nll18u9ELAQKFQtOt0uq1e4N7vlXfGunXroq9evRrshYA7KBcsWLB3xowZDVLyI4T2kcckEQAgWZGItBikpKSkSBloV65hw4bVbty48YCUPjDGXxAx/gQA4N2TpHWs0+nCi4uLX6TFi8VJ1cJg989x3E4iBikUkYKRJFdCQsI77e3tkhaonQU2efLkk3FxceckCRoA0NramkFeoFqM8ctSkJ47dy5wx44dcVJw8XGoVKq7n3766XY+HOU41mg0G+D58+cDfHx8llAauYWlpaW9XFdXp5GCi4YjISFhd0RExHUarDsMhPAGy7I7O/YwDAbDGoxxT09ISVK2dOnSFI7j5EJ4fHx8bAEBAVeampqChNgR7OjRow1r164tEmrnBN9RQ7GL8QbG+ClPSPft2xd67Ngx0vBGfZF9iqVLlxaOGTPm3t69e0O///77mRzHUbdO+vj4WHfs2LHZ0+QNY/yVVqu9ZBfD4/dGcnLy4tu3bw+hVeLpp58+v2bNmuOO+IsXL/rv3LlzXmtrK/Wnfvr06d8uXLiwW92UNg6GYSwqlWprUFCQ2b47rmQYZqXYqruQpIyk4tHR0Ydmzpx52VXAaWlpL9XV1ZEGW96rf//+jZmZmfm8QBcAx0KSY91E9KOSmZn5vNFofJYvIH9//+uJiYlfjxw58j4f9siRI0998803r9JsDHnSwsAwTIFarb5K4nEUYyjGuKPzTujF12JA+FiWPZuUlHRaCHdDQ4NfTk7O6/fu3Rvozi40NPTnlStXUnf12bkghPdYlt3W+bujEzG7XkVFRaMLCwvfcBWsQqF4MH/+/IPTpk0TXQjKyMiIqqqqinDlQy6Xm3bv3r1FiNAE27VP45HygNFoHIYQeksI6fvvv//GtWvXRjuzGTBgwNVVq1YdkKLz9+TJkyP2798/11WTS3R09P7Zs2dfoo2drC3UanWeYwN+t1qJwWCgfne4S8oiIiJOJSQklNAGR4MjDfeZmZnRzr5agwcPvpyWlraPhodg7J9TR3w3McrKynorFIpEhBDvjra979uRUKlUti5atOhAZGSkxytDVze2ffv2yeXl5d36SGiTNwjhJZZluzXuO62ikUZ5jDFv5tm1xSAwMLA+JSXlkDdLgXaBSkpKBhUUFLzuuJtGORutvXv3zgkKCmrtKrbLkqLBYIh1d5zq7NmzQ3bt2tX59fF2CdDZLLl582bPrVu3vtbc3NzRq0rTwgAhPMqyrN4Zn0sxqqurH+M4LgEh5DTXsPd9q1Sq35YsWfKVpwdfaJ91ZzidTvdMcXHxC2QsNja2YMqUKb86vVkI/8my7BeufLktNldXV4+1Wq2vdTW2930PHTr0HykpKd/26tXL6snNSGGr1+sDPvvss9efeOKJXz/66KPO1iQ7N8MwLXK5XOeqIZbgeCvvFRUVzzIME+UYcGFh4TiO45j58+eLzgmkEMDZPykrK2vmu+++e8yx//z304+71Wq12xIDrxjE4YULFyI5jvNacVpqYcjMdRDDhDH+q1arvcPnh0oMQkJyD4TQIzOEj/z/YPyB2WwmG0BUh4SpxSA3RrYIIYQvebOxRUIB75vN5r/RCkH1zugaXHl5+fAePXrMwRj3ljBwqalqMcZHtVqtoAOAgmaGPeIzZ874qlSqFxmGUUt9F57wQQhJ39cRlmVFtVmLEsMecHV19ZMcx8324lFvIdpU+/r6nnT36eQj80gMQq7X63sghCbJZDKyhPf4nCtfwF3HyTlWAMBJtVpdL9S2K95jMeyE5GCfyWSa5OPjoxG7fSjkZsjGzO9nVy9KcQ5e1AuUL2DSStnS0hIsk8mCMcZPSikMhJAkV3UAgFq1Wt0olQj2e5JsZjgTqaamRm42m0kddwwAIEhk68MdknJbLJZL4eHhXtsW8MrMcDdzSktLe/r5+fW02WxKUnRyhlUoFNhms5kRQqaHDx+apk6d6pWGNme+/wtn7dJLR+980QAAAABJRU5ErkJggg=="},function(e,t,i){e.exports=i.p+"img/dirt_0.eb1569b0.png"},,,,,function(e,t,i){"use strict";var n=i(15),r=i(59),a=i(191),s="endsWith",o=""[s];n(n.P+n.F*i(192)(s),"String",{endsWith:function(e){var t=a(this,e,s),i=arguments.length>1?arguments[1]:void 0,n=r(t.length),l=void 0===i?n:Math.min(r(i),n),c=String(e);return o?o.call(t,c,l):t.slice(l-c.length,l)===c}})},function(e,t,i){var n=i(15),r=i(677);n(n.S+n.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(e,t,i){var n=i(17).parseInt,r=i(157).trim,a=i(158),s=/^[-+]?0[xX]/;e.exports=8!==n(a+"08")||22!==n(a+"0x16")?function(e,t){var i=r(String(e),3);return n(i,t>>>0||(s.test(i)?16:10))}:n},function(e,t,i){i(679),e.exports=i(19).Object.getPrototypeOf},function(e,t,i){var n=i(117),r=i(161);i(652)("getPrototypeOf",function(){return function(e){return r(n(e))}})},function(e,t,i){i(681),e.exports=i(19).Object.setPrototypeOf},function(e,t,i){var n=i(47);n(n.S,"Object",{setPrototypeOf:i(682).set})},function(e,t,i){var n=i(51),r=i(48),a=function(e,t){if(r(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=i(108)(Function.call,i(146).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(r){t=!0}return function(e,i){return a(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:a}},function(e,t,i){i(684);var n=i(19).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,i){var n=i(47);n(n.S,"Object",{create:i(138)})},function(e,t,i){i(686);var n=i(19).Object;e.exports=function(e,t){return n.getOwnPropertyDescriptor(e,t)}},function(e,t,i){var n=i(63),r=i(146).f;i(652)("getOwnPropertyDescriptor",function(){return function(e,t){return r(n(e),t)}})},function(e,t,i){i(688),e.exports=i(19).Reflect.get},function(e,t,i){var n=i(146),r=i(161),a=i(53),s=i(47),o=i(51),l=i(48);function c(e,t){var i,s,u=arguments.length<3?e:arguments[2];return l(e)===u?e[t]:(i=n.f(e,t))?a(i,"value")?i.value:void 0!==i.get?i.get.call(u):void 0:o(s=r(e))?c(s,t,u):void 0}s(s.S,"Reflect",{get:c})},function(e,t,i){i(690),e.exports=i(19).Reflect.construct},function(e,t,i){var n=i(47),r=i(138),a=i(115),s=i(48),o=i(51),l=i(86),c=i(691),u=(i(36).Reflect||{}).construct,h=l(function(){function e(){}return!(u(function(){},[],e)instanceof e)}),d=!l(function(){u(function(){})});n(n.S+n.F*(h||d),"Reflect",{construct:function(e,t){a(e),s(t);var i=arguments.length<3?e:a(arguments[2]);if(d&&!h)return u(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(c.apply(e,n))}var l=i.prototype,m=r(o(l)?l:Object.prototype),f=Function.apply.call(e,m,t);return o(f)?f:m}})},function(e,t,i){"use strict";var n=i(115),r=i(51),a=i(653),s=[].slice,o={},l=function(e,t,i){if(!(t in o)){for(var n=[],r=0;r<t;r++)n[r]="a["+r+"]";o[t]=Function("F,a","return new F("+n.join(",")+")")}return o[t](e,i)};e.exports=Function.bind||function(e){var t=n(this),i=s.call(arguments,1),o=function(){var n=i.concat(s.call(arguments));return this instanceof o?l(t,n.length,n):a(t,n,e)};return r(t.prototype)&&(o.prototype=t.prototype),o}},function(e,t){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);e.exports=function(){return i(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},function(e,t){for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);function r(e,t){var n=t||0,r=i;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}e.exports=r},function(e,t,i){"use strict";function n(e,t,i,n,a){r(e,t,i||0,n||e.length-1,a||s)}function r(e,t,i,n,s){while(n>i){if(n-i>600){var o=n-i+1,l=t-i+1,c=Math.log(o),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(o-u)/o)*(l-o/2<0?-1:1),d=Math.max(i,Math.floor(t-l*u/o+h)),m=Math.min(n,Math.floor(t+(o-l)*u/o+h));r(e,t,d,m,s)}var f=e[t],y=i,g=n;a(e,i,t),s(e[n],f)>0&&a(e,i,n);while(y<g){a(e,y,g),y++,g--;while(s(e[y],f)<0)y++;while(s(e[g],f)>0)g--}0===s(e[i],f)?a(e,i,g):(g++,a(e,g,n)),g<=t&&(i=g+1),t<=g&&(n=g-1)}}function a(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function s(e,t){return e<t?-1:e>t?1:0}e.exports=n,e.exports.default=n},function(e,t,i){"use strict";function n(e,t){if(!(this instanceof n))return new n(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function r(e,t){return e<t?-1:e>t?1:0}e.exports=n,e.exports.default=n,n.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){var t=this.data,i=this.compare,n=t[e];while(e>0){var r=e-1>>1,a=t[r];if(i(n,a)>=0)break;t[e]=a,e=r}t[e]=n},_down:function(e){var t=this.data,i=this.compare,n=this.length>>1,r=t[e];while(e<n){var a=1+(e<<1),s=a+1,o=t[a];if(s<this.length&&i(t[s],o)<0&&(a=s,o=t[s]),i(o,r)>=0)break;t[e]=o,e=a}t[e]=r}}},function(e,t,i){i(697)("Uint8",1,function(e){return function(t,i,n){return e(this,t,i,n)}})},function(e,t,i){"use strict";if(i(20)){var n=i(111),r=i(17),a=i(21),s=i(15),o=i(655),l=i(698),c=i(76),u=i(151),h=i(81),d=i(45),m=i(150),f=i(78),y=i(59),g=i(656),v=i(131),p=i(91),_=i(46),b=i(357),L=i(35),M=i(73),k=i(355),w=i(92),T=i(352),S=i(77).f,O=i(356),C=i(68),E=i(16),I=i(164),D=i(156),j=i(699),P=i(351),Y=i(80),x=i(359),A=i(169),F=i(206),N=i(700),H=i(24),R=i(106),z=H.f,G=R.f,V=r.RangeError,B=r.TypeError,U=r.Uint8Array,W="ArrayBuffer",q="Shared"+W,J="BYTES_PER_ELEMENT",K="prototype",Z=Array[K],Q=l.ArrayBuffer,X=l.DataView,$=I(0),ee=I(2),te=I(3),ie=I(4),ne=I(5),re=I(6),ae=D(!0),se=D(!1),oe=P.values,le=P.keys,ce=P.entries,ue=Z.lastIndexOf,he=Z.reduce,de=Z.reduceRight,me=Z.join,fe=Z.sort,ye=Z.slice,ge=Z.toString,ve=Z.toLocaleString,pe=E("iterator"),_e=E("toStringTag"),be=C("typed_constructor"),Le=C("def_constructor"),Me=o.CONSTR,ke=o.TYPED,we=o.VIEW,Te="Wrong length!",Se=I(1,function(e,t){return De(j(e,e[Le]),t)}),Oe=a(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Ce=!!U&&!!U[K].set&&a(function(){new U(1).set({})}),Ee=function(e,t){var i=f(e);if(i<0||i%t)throw V("Wrong offset!");return i},Ie=function(e){if(L(e)&&ke in e)return e;throw B(e+" is not a typed array!")},De=function(e,t){if(!(L(e)&&be in e))throw B("It is not a typed array constructor!");return new e(t)},je=function(e,t){return Pe(j(e,e[Le]),t)},Pe=function(e,t){var i=0,n=t.length,r=De(e,n);while(n>i)r[i]=t[i++];return r},Ye=function(e,t,i){z(e,t,{get:function(){return this._d[i]}})},xe=function(e){var t,i,n,r,a,s,o=M(e),l=arguments.length,u=l>1?arguments[1]:void 0,h=void 0!==u,d=O(o);if(void 0!=d&&!k(d)){for(s=d.call(o),n=[],t=0;!(a=s.next()).done;t++)n.push(a.value);o=n}for(h&&l>2&&(u=c(u,arguments[2],2)),t=0,i=y(o.length),r=De(this,i);i>t;t++)r[t]=h?u(o[t],t):o[t];return r},Ae=function(){var e=0,t=arguments.length,i=De(this,t);while(t>e)i[e]=arguments[e++];return i},Fe=!!U&&a(function(){ve.call(new U(1))}),Ne=function(){return ve.apply(Fe?ye.call(Ie(this)):Ie(this),arguments)},He={copyWithin:function(e,t){return N.call(Ie(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return ie(Ie(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return F.apply(Ie(this),arguments)},filter:function(e){return je(this,ee(Ie(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(Ie(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return re(Ie(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){$(Ie(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return se(Ie(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ae(Ie(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return me.apply(Ie(this),arguments)},lastIndexOf:function(e){return ue.apply(Ie(this),arguments)},map:function(e){return Se(Ie(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return he.apply(Ie(this),arguments)},reduceRight:function(e){return de.apply(Ie(this),arguments)},reverse:function(){var e,t=this,i=Ie(t).length,n=Math.floor(i/2),r=0;while(r<n)e=t[r],t[r++]=t[--i],t[i]=e;return t},some:function(e){return te(Ie(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return fe.call(Ie(this),e)},subarray:function(e,t){var i=Ie(this),n=i.length,r=v(e,n);return new(j(i,i[Le]))(i.buffer,i.byteOffset+r*i.BYTES_PER_ELEMENT,y((void 0===t?n:v(t,n))-r))}},Re=function(e,t){return je(this,ye.call(Ie(this),e,t))},ze=function(e){Ie(this);var t=Ee(arguments[1],1),i=this.length,n=M(e),r=y(n.length),a=0;if(r+t>i)throw V(Te);while(a<r)this[t+a]=n[a++]},Ge={entries:function(){return ce.call(Ie(this))},keys:function(){return le.call(Ie(this))},values:function(){return oe.call(Ie(this))}},Ve=function(e,t){return L(e)&&e[ke]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Be=function(e,t){return Ve(e,t=p(t,!0))?h(2,e[t]):G(e,t)},Ue=function(e,t,i){return!(Ve(e,t=p(t,!0))&&L(i)&&_(i,"value"))||_(i,"get")||_(i,"set")||i.configurable||_(i,"writable")&&!i.writable||_(i,"enumerable")&&!i.enumerable?z(e,t,i):(e[t]=i.value,e)};Me||(R.f=Be,H.f=Ue),s(s.S+s.F*!Me,"Object",{getOwnPropertyDescriptor:Be,defineProperty:Ue}),a(function(){ge.call({})})&&(ge=ve=function(){return me.call(this)});var We=m({},He);m(We,Ge),d(We,pe,Ge.values),m(We,{slice:Re,set:ze,constructor:function(){},toString:ge,toLocaleString:Ne}),Ye(We,"buffer","b"),Ye(We,"byteOffset","o"),Ye(We,"byteLength","l"),Ye(We,"length","e"),z(We,_e,{get:function(){return this[ke]}}),e.exports=function(e,t,i,l){l=!!l;var c=e+(l?"Clamped":"")+"Array",h="get"+e,m="set"+e,f=r[c],v=f||{},p=f&&T(f),_=!f||!o.ABV,M={},k=f&&f[K],O=function(e,i){var n=e._d;return n.v[h](i*t+n.o,Oe)},C=function(e,i,n){var r=e._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),r.v[m](i*t+r.o,n,Oe)},E=function(e,t){z(e,t,{get:function(){return O(this,t)},set:function(e){return C(this,t,e)},enumerable:!0})};_?(f=i(function(e,i,n,r){u(e,f,c,"_d");var a,s,o,l,h=0,m=0;if(L(i)){if(!(i instanceof Q||(l=b(i))==W||l==q))return ke in i?Pe(f,i):xe.call(f,i);a=i,m=Ee(n,t);var v=i.byteLength;if(void 0===r){if(v%t)throw V(Te);if(s=v-m,s<0)throw V(Te)}else if(s=y(r)*t,s+m>v)throw V(Te);o=s/t}else o=g(i),s=o*t,a=new Q(s);d(e,"_d",{b:a,o:m,l:s,e:o,v:new X(a)});while(h<o)E(e,h++)}),k=f[K]=w(We),d(k,"constructor",f)):a(function(){f(1)})&&a(function(){new f(-1)})&&x(function(e){new f,new f(null),new f(1.5),new f(e)},!0)||(f=i(function(e,i,n,r){var a;return u(e,f,c),L(i)?i instanceof Q||(a=b(i))==W||a==q?void 0!==r?new v(i,Ee(n,t),r):void 0!==n?new v(i,Ee(n,t)):new v(i):ke in i?Pe(f,i):xe.call(f,i):new v(g(i))}),$(p!==Function.prototype?S(v).concat(S(p)):S(v),function(e){e in f||d(f,e,v[e])}),f[K]=k,n||(k.constructor=f));var I=k[pe],D=!!I&&("values"==I.name||void 0==I.name),j=Ge.values;d(f,be,!0),d(k,ke,c),d(k,we,!0),d(k,Le,f),(l?new f(1)[_e]==c:_e in k)||z(k,_e,{get:function(){return c}}),M[c]=f,s(s.G+s.W+s.F*(f!=v),M),s(s.S,c,{BYTES_PER_ELEMENT:t}),s(s.S+s.F*a(function(){v.of.call(f,1)}),c,{from:xe,of:Ae}),J in k||d(k,J,t),s(s.P,c,He),A(c),s(s.P+s.F*Ce,c,{set:ze}),s(s.P+s.F*!D,c,Ge),n||k.toString==ge||(k.toString=ge),s(s.P+s.F*a(function(){new f(1).slice()}),c,{slice:Re}),s(s.P+s.F*(a(function(){return[1,2].toLocaleString()!=new f([1,2]).toLocaleString()})||!a(function(){k.toLocaleString.call([1,2])})),c,{toLocaleString:Ne}),Y[c]=D?I:j,n||D||d(k,pe,j)}}else e.exports=function(){}},function(e,t,i){"use strict";var n=i(17),r=i(20),a=i(111),s=i(655),o=i(45),l=i(150),c=i(21),u=i(151),h=i(78),d=i(59),m=i(656),f=i(77).f,y=i(24).f,g=i(206),v=i(95),p="ArrayBuffer",_="DataView",b="prototype",L="Wrong length!",M="Wrong index!",k=n[p],w=n[_],T=n.Math,S=n.RangeError,O=n.Infinity,C=k,E=T.abs,I=T.pow,D=T.floor,j=T.log,P=T.LN2,Y="buffer",x="byteLength",A="byteOffset",F=r?"_b":Y,N=r?"_l":x,H=r?"_o":A;function R(e,t,i){var n,r,a,s=new Array(i),o=8*i-t-1,l=(1<<o)-1,c=l>>1,u=23===t?I(2,-24)-I(2,-77):0,h=0,d=e<0||0===e&&1/e<0?1:0;for(e=E(e),e!=e||e===O?(r=e!=e?1:0,n=l):(n=D(j(e)/P),e*(a=I(2,-n))<1&&(n--,a*=2),e+=n+c>=1?u/a:u*I(2,1-c),e*a>=2&&(n++,a/=2),n+c>=l?(r=0,n=l):n+c>=1?(r=(e*a-1)*I(2,t),n+=c):(r=e*I(2,c-1)*I(2,t),n=0));t>=8;s[h++]=255&r,r/=256,t-=8);for(n=n<<t|r,o+=t;o>0;s[h++]=255&n,n/=256,o-=8);return s[--h]|=128*d,s}function z(e,t,i){var n,r=8*i-t-1,a=(1<<r)-1,s=a>>1,o=r-7,l=i-1,c=e[l--],u=127&c;for(c>>=7;o>0;u=256*u+e[l],l--,o-=8);for(n=u&(1<<-o)-1,u>>=-o,o+=t;o>0;n=256*n+e[l],l--,o-=8);if(0===u)u=1-s;else{if(u===a)return n?NaN:c?-O:O;n+=I(2,t),u-=s}return(c?-1:1)*n*I(2,u-t)}function G(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function V(e){return[255&e]}function B(e){return[255&e,e>>8&255]}function U(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return R(e,52,8)}function q(e){return R(e,23,4)}function J(e,t,i){y(e[b],t,{get:function(){return this[i]}})}function K(e,t,i,n){var r=+i,a=m(r);if(a+t>e[N])throw S(M);var s=e[F]._b,o=a+e[H],l=s.slice(o,o+t);return n?l:l.reverse()}function Z(e,t,i,n,r,a){var s=+i,o=m(s);if(o+t>e[N])throw S(M);for(var l=e[F]._b,c=o+e[H],u=n(+r),h=0;h<t;h++)l[c+h]=u[a?h:t-h-1]}if(s.ABV){if(!c(function(){k(1)})||!c(function(){new k(-1)})||c(function(){return new k,new k(1.5),new k(NaN),k.name!=p})){k=function(e){return u(this,k),new C(m(e))};for(var Q,X=k[b]=C[b],$=f(C),ee=0;$.length>ee;)(Q=$[ee++])in k||o(k,Q,C[Q]);a||(X.constructor=k)}var te=new w(new k(2)),ie=w[b].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||l(w[b],{setInt8:function(e,t){ie.call(this,e,t<<24>>24)},setUint8:function(e,t){ie.call(this,e,t<<24>>24)}},!0)}else k=function(e){u(this,k,p);var t=m(e);this._b=g.call(new Array(t),0),this[N]=t},w=function(e,t,i){u(this,w,_),u(e,k,_);var n=e[N],r=h(t);if(r<0||r>n)throw S("Wrong offset!");if(i=void 0===i?n-r:d(i),r+i>n)throw S(L);this[F]=e,this[H]=r,this[N]=i},r&&(J(k,x,"_l"),J(w,Y,"_b"),J(w,x,"_l"),J(w,A,"_o")),l(w[b],{getInt8:function(e){return K(this,1,e)[0]<<24>>24},getUint8:function(e){return K(this,1,e)[0]},getInt16:function(e){var t=K(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=K(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return G(K(this,4,e,arguments[1]))},getUint32:function(e){return G(K(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return z(K(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return z(K(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){Z(this,1,e,V,t)},setUint8:function(e,t){Z(this,1,e,V,t)},setInt16:function(e,t){Z(this,2,e,B,t,arguments[2])},setUint16:function(e,t){Z(this,2,e,B,t,arguments[2])},setInt32:function(e,t){Z(this,4,e,U,t,arguments[2])},setUint32:function(e,t){Z(this,4,e,U,t,arguments[2])},setFloat32:function(e,t){Z(this,4,e,q,t,arguments[2])},setFloat64:function(e,t){Z(this,8,e,W,t,arguments[2])}});v(k,p),v(w,_),o(w[b],s.VIEW,!0),t[p]=k,t[_]=w},function(e,t,i){var n=i(42),r=i(155),a=i(16)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[a])?t:r(i)}},function(e,t,i){"use strict";var n=i(73),r=i(131),a=i(59);e.exports=[].copyWithin||function(e,t){var i=n(this),s=a(i.length),o=r(e,s),l=r(t,s),c=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===c?s:r(c,s))-l,s-o),h=1;l<o&&o<l+u&&(h=-1,l+=u-1,o+=u-1);while(u-- >0)l in i?i[o]=i[l]:delete i[o],o+=h,l+=h;return i}},function(e,t,i){"use strict";var n={},r=Array.prototype,a=Object.prototype,s=r.slice,o=a.toString,l=a.hasOwnProperty,c=r.forEach,u=Object.keys,h=Array.isArray,d=function(){},m=d.each=d.forEach=function(e,t,i){if(null!=e)if(c&&e.forEach===c)e.forEach(t,i);else if(e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(t.call(i,e[r],r,e)===n)return}else{var s=d.keys(e);for(r=0,a=s.length;r<a;r++)if(t.call(i,e[s[r]],s[r],e)===n)return}};d.keys=u||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var i in e)d.has(e,i)&&t.push(i);return t},d.defaults=function(e){return m(s.call(arguments,1),function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])}),e},d.isArray=h||function(e){return"[object Array]"===o.call(e)},d.has=function(e,t){if(!d.isArray(t))return null!=e&&l.call(e,t);for(var i=t.length,n=0;n<i;n++){var r=t[n];if(null==e||!l.call(e,r))return!1;e=e[r]}return!!i};var f={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}},y={escape:new RegExp("["+d.keys(f.escape).join("")+"]","g")};d.each(["escape"],function(e){d[e]=function(t){return null==t?"":(""+t).replace(y[e],function(t){return f[e][t]})}}),d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,v={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},p=/\\|'|\r|\n|\t|\u2028|\u2029/g;d.template=function(e,t,i){var n;i=d.defaults({},i,d.templateSettings);var r=new RegExp([(i.escape||g).source,(i.interpolate||g).source,(i.evaluate||g).source].join("|")+"|$","g"),a=0,s="__p+='";e.replace(r,function(t,i,n,r,o){return s+=e.slice(a,o).replace(p,function(e){return"\\"+v[e]}),i&&(s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),n&&(s+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),r&&(s+="';\n"+r+"\n__p+='"),a=o+t.length,t}),s+="';\n",i.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(i.variable||"obj","_",s)}catch(l){throw l.source=s,l}if(t)return n(t,d);var o=function(e){return n.call(this,e,d)};return o.source="function("+(i.variable||"obj")+"){\n"+s+"}",o},e.exports=d},function(e,t,i){i(703),e.exports=i(19).Reflect.set},function(e,t,i){var n=i(49),r=i(146),a=i(161),s=i(53),o=i(47),l=i(79),c=i(48),u=i(51);function h(e,t,i){var o,d,m=arguments.length<4?e:arguments[3],f=r.f(c(e),t);if(!f){if(u(d=a(e)))return h(d,t,i,m);f=l(0)}if(s(f,"value")){if(!1===f.writable||!u(m))return!1;if(o=r.f(m,t)){if(o.get||o.set||!1===o.writable)return!1;o.value=i,n.f(m,t,o)}else n.f(m,t,l(0,i));return!0}return void 0!==f.set&&(f.set.call(m,i),!0)}o(o.S,"Reflect",{set:h})},function(e,t,i){i(347),i(93),i(118),i(705),i(712),i(713),e.exports=i(19).Promise},function(e,t,i){"use strict";var n,r,a,s,o=i(94),l=i(36),c=i(108),u=i(163),h=i(47),d=i(51),m=i(115),f=i(706),y=i(707),g=i(657),v=i(658).set,p=i(708)(),_=i(640),b=i(659),L=i(709),M=i(660),k="Promise",w=l.TypeError,T=l.process,S=T&&T.versions,O=S&&S.v8||"",C=l[k],E="process"==u(T),I=function(){},D=r=_.f,j=!!function(){try{var e=C.resolve(1),t=(e.constructor={})[i(28)("species")]=function(e){e(I,I)};return(E||"function"==typeof PromiseRejectionEvent)&&e.then(I)instanceof t&&0!==O.indexOf("6.6")&&-1===L.indexOf("Chrome/66")}catch(n){}}(),P=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},Y=function(e,t){if(!e._n){e._n=!0;var i=e._c;p(function(){var n=e._v,r=1==e._s,a=0,s=function(t){var i,a,s,o=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{o?(r||(2==e._h&&F(e),e._h=1),!0===o?i=n:(u&&u.enter(),i=o(n),u&&(u.exit(),s=!0)),i===t.promise?c(w("Promise-chain cycle")):(a=P(i))?a.call(i,l,c):l(i)):c(n)}catch(h){u&&!s&&u.exit(),c(h)}};while(i.length>a)s(i[a++]);e._c=[],e._n=!1,t&&!e._h&&x(e)})}},x=function(e){v.call(l,function(){var t,i,n,r=e._v,a=A(e);if(a&&(t=b(function(){E?T.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)}),e._h=E||A(e)?2:1),e._a=void 0,a&&t.e)throw t.v})},A=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){v.call(l,function(){var t;E?T.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},N=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),Y(t,!0))},H=function(e){var t,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw w("Promise can't be resolved itself");(t=P(e))?p(function(){var n={_w:i,_d:!1};try{t.call(e,c(H,n,1),c(N,n,1))}catch(r){N.call(n,r)}}):(i._v=e,i._s=1,Y(i,!1))}catch(n){N.call({_w:i,_d:!1},n)}}};j||(C=function(e){f(this,C,k,"_h"),m(e),n.call(this);try{e(c(H,this,1),c(N,this,1))}catch(t){N.call(this,t)}},n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=i(710)(C.prototype,{then:function(e,t){var i=D(g(this,C));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=E?T.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&Y(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n;this.promise=e,this.resolve=c(H,e,1),this.reject=c(N,e,1)},_.f=D=function(e){return e===C||e===s?new a(e):r(e)}),h(h.G+h.W+h.F*!j,{Promise:C}),i(116)(C,k),i(711)(k),s=i(19)[k],h(h.S+h.F*!j,k,{reject:function(e){var t=D(this),i=t.reject;return i(e),t.promise}}),h(h.S+h.F*(o||!j),k,{resolve:function(e){return M(o&&this===s?C:this,e)}}),h(h.S+h.F*!(j&&i(350)(function(e){C.all(e)["catch"](I)})),k,{all:function(e){var t=this,i=D(t),n=i.resolve,r=i.reject,a=b(function(){var i=[],a=0,s=1;y(e,!1,function(e){var o=a++,l=!1;i.push(void 0),s++,t.resolve(e).then(function(e){l||(l=!0,i[o]=e,--s||n(i))},r)}),--s||n(i)});return a.e&&r(a.v),i.promise},race:function(e){var t=this,i=D(t),n=i.reject,r=b(function(){y(e,!1,function(e){t.resolve(e).then(i.resolve,n)})});return r.e&&n(r.v),i.promise}})},function(e,t){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(108),r=i(348),a=i(349),s=i(48),o=i(160),l=i(162),c={},u={};t=e.exports=function(e,t,i,h,d){var m,f,y,g,v=d?function(){return e}:l(e),p=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(a(v)){for(m=o(e.length);m>_;_++)if(g=t?p(s(f=e[_])[0],f[1]):p(e[_]),g===c||g===u)return g}else for(y=v.call(e);!(f=y.next()).done;)if(g=r(y,p,f.value,t),g===c||g===u)return g};t.BREAK=c,t.RETURN=u},function(e,t,i){var n=i(36),r=i(658).set,a=n.MutationObserver||n.WebKitMutationObserver,s=n.process,o=n.Promise,l="process"==i(109)(s);e.exports=function(){var e,t,i,c=function(){var n,r;l&&(n=s.domain)&&n.exit();while(e){r=e.fn,e=e.next;try{r()}catch(a){throw e?i():t=void 0,a}}t=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(c)};else if(!a||n.navigator&&n.navigator.standalone)if(o&&o.resolve){var u=o.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new a(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){var n=i(36),r=n.navigator;e.exports=r&&r.userAgent||""},function(e,t,i){var n=i(62);e.exports=function(e,t,i){for(var r in t)i&&e[r]?e[r]=t[r]:n(e,r,t[r]);return e}},function(e,t,i){"use strict";var n=i(36),r=i(19),a=i(49),s=i(56),o=i(28)("species");e.exports=function(e){var t="function"==typeof r[e]?r[e]:n[e];s&&t&&!t[o]&&a.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,i){"use strict";var n=i(47),r=i(19),a=i(36),s=i(657),o=i(660);n(n.P+n.R,"Promise",{finally:function(e){var t=s(this,r.Promise||a.Promise),i="function"==typeof e;return this.then(i?function(i){return o(t,e()).then(function(){return i})}:e,i?function(i){return o(t,e()).then(function(){throw i})}:e)}})},function(e,t,i){"use strict";var n=i(47),r=i(640),a=i(659);n(n.S,"Promise",{try:function(e){var t=r.f(this),i=a(e);return(i.e?t.reject:t.resolve)(i.v),t.promise}})},function(e,t){ol.Feature.prototype.getProperty=function(e){if("attributes"===e){var t=this.getProperties();return this.getGeometryName()&&delete t[this.getGeometryName()],t}if("olcs_geometryType"===e){var i=this.getGeometry().getType();return"Polygon"===i?1:"LineString"===i?2:"Point"===i?3:"Circle"===i?1:"MultiPolygon"===i?1:"MultiLineString"===i?2:"MultiPoint"===i?3:void 0}return this.get(e)}},function(e,t){Cesium.Material._materialCache.addMaterial("Wallpaper",{fabric:{type:"Wallpaper",uniforms:{image:Cesium.Material.DefaultImageId,anchor:new Cesium.Cartesian2(0,0)},components:{diffuse:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).rgb",alpha:"texture2D(image, fract((gl_FragCoord.xy - anchor.xy) / vec2(imageDimensions.xy))).a"}},translucent:!1})},function(e,t){Cesium.Cesium3DTilePointFeature.prototype.getId=function(){return this.getProperty("id")||"".concat(this.content.url).concat(this._batchId)}},function(e,t){Cesium.Cesium3DTileFeature.prototype.getId=function(){return this.getProperty("id")||"".concat(this.content.url).concat(this._batchId)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";i.r(t);var n={};i.r(n),i.d(n,"Buildings",function(){return Vn}),i.d(n,"CesiumTilesetLayer",function(){return zn}),i.d(n,"Czml",function(){return qn}),i.d(n,"Gltf",function(){return Kn}),i.d(n,"PointCloud",function(){return Xn}),i.d(n,"Terrain",function(){return zt}),i.d(n,"ObliqueLayer",function(){return Di}),i.d(n,"GeoJSON",function(){return pr}),i.d(n,"SingleImage",function(){return Mr}),i.d(n,"OpenStreetMap",function(){return wr}),i.d(n,"TMSBase",function(){return Sr}),i.d(n,"Vector",function(){return _n}),i.d(n,"TiledLayer",function(){return Er}),i.d(n,"VectorCluster",function(){return Pr}),i.d(n,"WFS",function(){return xr}),i.d(n,"WMS",function(){return Fr}),i.d(n,"WMTS",function(){return Hr}),i.d(n,"Wsv",function(){return Br}),i.d(n,"FeatureStore",function(){return ta});var r={};i.r(r),i.d(r,"Legend",function(){return Fa}),i.d(r,"Planning",function(){return xl}),i.d(r,"Query",function(){return Tu}),i.d(r,"Search",function(){return uh}),i.d(r,"AdvancedWalkMode",function(){return fh}),i.d(r,"BalloonInfo",function(){return gh}),i.d(r,"Copyright",function(){return ph}),i.d(r,"CreateLink",function(){return bh}),i.d(r,"DisplayQuality",function(){return Uh}),i.d(r,"Drawing",function(){return Jh}),i.d(r,"Export",function(){return Zh}),i.d(r,"FeatureList",function(){return Xh}),i.d(r,"Locator",function(){return Vu}),i.d(r,"Measurement",function(){return Dd}),i.d(r,"SingleMeasurement",function(){return Pd}),i.d(r,"NavigationControls",function(){return Ad}),i.d(r,"OverviewMap",function(){return Nd}),i.d(r,"PDFCreator",function(){return rm}),i.d(r,"PositionDisplay",function(){return lm}),i.d(r,"Shadow",function(){return um}),i.d(r,"TransparentTerrainMode",function(){return vm}),i.d(r,"Flight",function(){return _m}),i.d(r,"HeightProfile",function(){return Dm});i(67),i(547),i(561),i(574),i(578);var a=i(34),s=(i(25),i(40),i(64),i(11),i(88),i(32),i(12),i(13),i(4),i(18));function o(e,t,i){var n,r=function(e,t){if(null===t)return null!==e&&"Expected ".concat(c.getErrorValue(e)," to be null");var n=c.atomic(e,t);if(null!==n)return n;var r=c.value(e,t);if(null!==r)return r;if(Array.isArray(t))return c.array(e,t,i);if(t instanceof Function)return!(e instanceof t)&&"Expected ".concat(c.getErrorValue(e,!0)," to be of Type ").concat(c.getConstructorString(t));if(t===Object)return c.object(e,{});if("object"!==Object(s["a"])(t)||"object"!==Object(s["a"])(e))throw new Error("Cannot handler pattern ".concat(t));var a=c.object(e,t);return a||!!i&&c.requireKeys(e,t)};if(Array.isArray(t)&&t.length>1){var a=t.every(function(t){var i=r(e,t);return i});a&&(n="Expected ".concat(c.getErrorValue(e)," to be a ").concat(t.map(function(e){return c.getConstructorString(e)}).join(" or ")))}else n=r(e,t);if(n)throw new Error("Match failed: ".concat(n));return!1}function l(e,t,i){var n=[null,void 0];return Array.isArray(t)&&t.length>1?t.forEach(function(e){n.push(e)}):n.push(t),o(e,n.reverse(),i)}var c={};c.patterns=[[String,"string"],[Number,"number"],[Boolean,"boolean"],[Function,"function"],[void 0,"undefined"]],c.getErrorValue=function(e,t){if(null===e)return"null";if("undefined"===typeof e)return"undefined";if(t)return Object(s["a"])(e);var i;try{i=JSON.stringify(e)}catch(n){i=Object(s["a"])(e)}return i.length>20?"".concat(i.substr(0,20),"..."):i},c.getConstructorString=function(e){if(null===e)return"null";var t=c.patterns.find(function(t){return t[0]===e});if(t)return t[1];var i=e.toString();if(e.className)return e.className;var n=i.match(/function (.*)\(/);if(n&&n.length>1)return n[1];if(c.isPlainObject(e)){var r={};Object.keys(e).forEach(function(t){r[t]=c.getConstructorString(e[t])});try{i="Object of ".concat(JSON.stringify(r))}catch(a){i="Object"}}return i},c.atomic=function(e,t){if(t===Number)return!Number.isFinite(e)&&"expected ".concat(c.getErrorValue(e)," to be a number, excluding NaN");for(var i=c.patterns.length;i--;)if(t===c.patterns[i][0])return Object(s["a"])(e)!==c.patterns[i][1]&&"expected ".concat(c.getErrorValue(e)," to be a ").concat(c.patterns[i][1]);return null},c.value=function(e,t){return"string"===typeof t||"number"===typeof t||"boolean"===typeof t?e!==t&&"Expected ".concat(c.getErrorValue(e)," to equal ").concat(t):null},c.array=function(e,t,i){if(Array.isArray(t)){if(1!==t.length)throw new Error("Array patterns may only have on type");if(Array.isArray(e)){var n=!1,r=e.findIndex(function(e){try{o(e,t[0],i)}catch(r){n=r.message.replace(/Match failed:\s/,"")}return n});return r>-1&&"".concat(n," in ").concat(c.getErrorValue(e))}return"Expected ".concat(c.getErrorValue(e)," to be an Array")}return null},c.object=function(e,t,i){var n=i?"".concat(i,"."):"",r=c.isPlainObject(e);if(!r)return"Expected ".concat(c.getErrorValue(e)," to be a plain Object");var a=!1,s=Object.keys(t).find(function(i){var r=e[i];if(c.isPlainObject(t[i]))a=c.object(r,t[i],n+i);else if("undefined"===typeof r&&void 0!==t[i])a="Missing key ".concat(n).concat(i," in ").concat(c.getErrorValue(e));else try{o(r,t[i])}catch(s){a=s.message.replace(/Match failed:\s/,"")}return a});return!!s&&"".concat(a," in object.").concat(n).concat(s)},c.isPlainObject=function(e){var t={};if(!e||"[object Object]"!==t.toString(e))return!1;var i=Object.getPrototypeOf(e);if(!i)return!0;var n=t.hasOwnProperty,r=n.call(i,"constructor")&&i.constructor;return"function"===typeof r&&n.toString.call(r)===n.toString.call(Object)},c.requireKeys=function(e,t,i){var n=i?"".concat(i,"."):"",r=!1,a=Object.keys(e).find(function(i){if(c.isPlainObject(t[i])){var a=e[i];r=c.requireKeys(a,t[i],n+i)}else t[i]||(r="Found additional key ".concat(n).concat(i));return r=!!r&&r.replace(/\sin.*/,""),r});return!!a&&"".concat(r," in ").concat(c.getErrorValue(e))};var u=i(5),h=i(27),d=(i(29),i(37),i(1)),m=i(0);i(26),i(7),i(44),i(22),i(74),i(75);function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return!t||"object"!==Object(s["a"])(t)&&"function"!==typeof t?f(e):t}var g=i(643),v=i.n(g),p=i(537),_=i.n(p);function b(e){return b=_.a?v.a:function(e){return e.__proto__||v()(e)},b(e)}var L=i(661),M=i.n(L),k=i(538);function w(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=M()(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(k["a"])(e,t)}var T=i(10),S=(i(168),i(96),{OFF:1,ERROR:2,WARN:4,INFO:8,DEBUG:16}),O={ERROR:0,WARN:0,INFO:0,DEBUG:0};O.ERROR=S.ERROR|S.WARN|S.INFO|S.DEBUG,O.WARN=S.WARN|S.INFO|S.DEBUG,O.INFO=S.INFO|S.DEBUG,O.DEBUG=S.DEBUG;var C,E=S.INFO,I=!1,D={},j=new Map;j.set(S.ERROR,"error"),j.set(S.WARN,"warn"),j.set(S.INFO,"info"),j.set(S.DEBUG,"log");var P=function(){function e(t){Object(d["a"])(this,e),this.className=t,this.deprecations=new Set}return Object(m["a"])(e,null,[{key:"loggers",get:function(){return D}},{key:"enabled",get:function(){return Object.keys(S).find(function(e){return S[e]===E})||"OFF"},set:function(e){if(e){var t="string"===typeof e?e.toUpperCase():"INFO";E=S[t]||S.INFO}else E=S.OFF}},{key:"timestamp",get:function(){return I},set:function(e){I=e}}]),Object(m["a"])(e,[{key:"error",value:function(e){if(o(e,String),E&O.ERROR){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.ERROR,i)}}},{key:"warning",value:function(e){if(o(e,String),E&O.WARN){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.WARN,i)}}},{key:"deprecate",value:function(e,t){if(o(e,String),l(t,String),!this.deprecations.has(e)){this.deprecations.add(e);var i="".concat(e," has been deprecated and will be removed");t&&(i="".concat(i,". ").concat(t)),this.warning(i)}}},{key:"info",value:function(e){if(o(e,String),E&O.INFO){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.INFO,i)}}},{key:"debug",value:function(e){if(o(e,String),E&O.DEBUG){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.DEBUG,i)}}},{key:"log",value:function(e){if(o(e,String),E&O.DEBUG){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this._log(e,S.DEBUG,i)}}},{key:"_log",value:function(e,t,i){var n,r=e;if(this.className&&(r="[".concat(this.className,"] ").concat(r)),I){var a=new Date(Date.now());r="".concat(a.toLocaleDateString()," ").concat(a.toLocaleTimeString()," ").concat(r)}(n=console)[j.get(t)].apply(n,[r].concat(Object(T["a"])(i))),t&S.ERROR&&(console.group(),console.trace(),console.groupEnd())}}],[{key:"getLogger",value:function(t){return t?e.loggers[t]||e.createLogger(t):C}},{key:"createLogger",value:function(t){var i=new e(t);return e.loggers[t]=i,i}}]),e}();C=new P;var Y=P,x=function(){function e(t){Object(d["a"])(this,e),this.className=t.className?t.className:"vcs.vcm.Framework",this.id=Object(u["c"])(),this.framework=ne.getInstance(),this.options=t,this.logger=Y.getLogger(this.className),this.name=t.name||Object(u["c"])()}return Object(m["a"])(e,[{key:"getClassName",value:function(){return this.logger.deprecate("getClassName","Access the property className directly"),this.className}},{key:"getName",value:function(){return this.logger.deprecate("getName","Access the property name directly"),this.name}},{key:"getId",value:function(){return this.logger.deprecate("getId","Use name property as a unique identifier"),this.id}},{key:"getConfigObject",value:function(){return{type:this.className,name:this.name}}}]),e}(),A=x,F=ol.proj.getTransform("EPSG:4326","EPSG:3857"),N=ol.proj.getTransform("EPSG:3857","EPSG:4326"),H=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d["a"])(this,t),i.className=t.className,e=y(this,b(t).call(this,i)),e.proj=null,e.proj4=null,e.epsg=null;var n=i.epsg,r=i.proj4;if("string"===typeof n&&""===n.trim()&&(n=null),n){if("string"===typeof n&&0!==n.indexOf("EPSG:")&&(n="EPSG:".concat(n)),Number.isFinite(n)&&(n="EPSG:".concat(n)),"string"===typeof r&&""===r.trim()&&(r=null),r&&(e.proj4=r,window.proj4.defs(n,r)),i.alias){var a=i.alias;a.forEach(function(e){window.proj4.defs(e,window.proj4.defs(n))},f(e))}e.epsg=n,e.proj=ol.proj.get(n)}return e.proj||(e.framework.getProjection()?e.epsg=e.framework.getProjection().getEPSG():e.epsg="EPSG:4326",e.proj=ol.proj.get(e.epsg)),e}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.Projection"}}]),Object(m["a"])(t,[{key:"getProjection",value:function(){return this.proj}},{key:"getEPSG",value:function(){return this.epsg}},{key:"getPROJ4",value:function(){return this.proj4}},{key:"transformTo",value:function(e,i){return t.transform(e,this,i)}},{key:"transformFrom",value:function(e,i){return t.transform(this,e,i)}},{key:"getConfigObject",value:function(){var e={epsg:this.epsg};return this.proj4&&(e.proj4=this.proj4),e}}],[{key:"transform",value:function(e,t,i){var n=ol.proj.getTransform(t.getProjection(),e.getProjection()),r=new Array(2);return n([i[0],i[1]],r,2),i.length>2&&r.push(i[2]),r}},{key:"transformCoordinates",value:function(e,i,n){for(var r=[],a=0;a<n.length;a++)r.push(t.transform(e,i,n[a]));return r}},{key:"getTransformer",value:function(e,t){return ol.proj.getTransform(t.getProjection(),e.getProjection())}},{key:"createGeographicProjection",value:function(){return new t({epsg:4326})}},{key:"createMercatorProjection",value:function(){return new t({epsg:3857})}},{key:"parseUrlParameter",value:function(e){var i=e.epsg,n=e.proj4;return new t({epsg:i,proj4:n})}},{key:"mercatorToWgs84",value:function(e,t){return N(e,t?e:void 0,e.length)}},{key:"wgs84ToMercator",value:function(e,t){return F(e,t?e:void 0,e.length)}}]),t}(A),R=H,z=Y.getLogger("vcs.vcm.util.ViewPoint"),G=function(){function e(t){if(Object(d["a"])(this,e),this.name=t.name?t.name:Object(u["c"])(),this.cameraPosition=t.cameraPosition?t.cameraPosition:null,Array.isArray(this.cameraPosition)&&3===this.cameraPosition.length)for(var i=0;i<this.cameraPosition.length;i++){var n=this.cameraPosition[i];"string"===typeof n&&(this.cameraPosition[i]=Number(n))}else this.cameraPosition=null;if(this.groundPosition=t.groundPosition?t.groundPosition:null,Array.isArray(this.groundPosition))for(i=0;i<this.groundPosition.length;i++){n=this.groundPosition[i];"string"===typeof n&&(this.groundPosition[i]=Number(n))}this.distance=null!=t.distance?t.distance:null,"string"===typeof this.distance&&(this.distance=Number(this.distance)),this.heading=t.heading?t.heading:0,"string"===typeof this.heading&&(this.heading=Number(this.heading)),this.pitch=t.pitch?t.pitch:-90,"string"===typeof this.pitch&&(this.pitch=Number(this.pitch)),this.roll=t.roll?t.roll:0,"string"===typeof this.roll&&(this.roll=Number(this.roll)),this.animate=!!t.animate&&t.animate,this.proj=t.proj?t.proj:null}return Object(m["a"])(e,[{key:"getConfigObject",value:function(){return{name:this.name,distance:this.distance,cameraPosition:this.cameraPosition,groundPosition:this.groundPosition,heading:this.heading,pitch:this.pitch,roll:this.roll,animate:this.animate}}},{key:"clone",value:function(){return new e({cameraPosition:this.cameraPosition?this.cameraPosition.slice():null,groundPosition:this.groundPosition?this.groundPosition.slice():null,distance:this.distance,heading:this.heading,pitch:this.pitch,roll:this.roll,animate:this.animate,proj:this.proj})}},{key:"getName",value:function(){return z.deprecate("getName","Access the property name directly"),this.name}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"setCameraPosition",value:function(e){this.cameraPosition=e}},{key:"getAnimate",value:function(){return this.animate}},{key:"setAnimate",value:function(e){this.animate=e}},{key:"getGroundPosition",value:function(){return this.groundPosition}},{key:"setGroundPosition",value:function(e){this.groundPosition=e}},{key:"getDistance",value:function(){return this.distance}},{key:"setDistance",value:function(e){this.distance=e}},{key:"getHeading",value:function(){return this.heading}},{key:"setHeading",value:function(e){this.heading=e}},{key:"getPitch",value:function(){return this.pitch}},{key:"setPitch",value:function(e){this.pitch=e}},{key:"getRoll",value:function(){return this.roll}},{key:"setRoll",value:function(e){this.roll=e}},{key:"getProjection",value:function(){return this.proj}},{key:"setProjection",value:function(e){this.proj=e}},{key:"toString",value:function(){var e="ViewPoint: [Ground:".concat(String(this.groundPosition?this.groundPosition:null),"]")+"[Camera:".concat(String(this.cameraPosition?this.cameraPosition:null),"]")+"[Distance:".concat(this.distance,"]")+"[heading:".concat(this.distance,"]")+"[pitch:".concat(this.distance,"]")+"[roll:".concat(this.distance,"]");return e}},{key:"getLink",value:function(e){var t={},i="",n=this.groundPosition,r=this.cameraPosition;if(null!=e.queryParams.epsg){var a=R.createGeographicProjection(),s=new R({epsg:e.queryParams.epsg});n&&(n=R.transform(s,a,this.groundPosition)),r&&(r=R.transform(s,a,this.cameraPosition))}r&&(r.forEach(function(e){i+="".concat(e.toFixed(5),",")}),i=i.slice(0,-1),t.cameraPosition=i),i="",n&&(n.forEach(function(e){i+="".concat(e.toFixed(5),",")}),i=i.slice(0,-1),t.groundPosition=i),null!=this.distance&&(t.distance=this.distance.toFixed(2)),null!=this.pitch&&(t.pitch=this.pitch.toFixed(2)),null!=this.heading&&(t.heading=this.heading.toFixed(2)),null!=this.roll&&(t.roll=this.roll.toFixed(2)),e.addQueryParams(t)}},{key:"isValid",value:function(){try{var e=!1,t=!1;try{e=!o(this.cameraPosition,[Number])&&3===this.cameraPosition.length}catch(i){t=!o(this.groundPosition,[Number])&&this.groundPosition.length>1&&this.groundPosition.length<4}if(!e&&!t)throw new Error("Viewpoint is missing position");return t&&o(this.distance,Number),o(this.heading,Number),o(this.pitch,Number),o(this.roll,Number),!0}catch(i){return!1}}}],[{key:"createViewPointFromExtent",value:function(t){if(t&&4===t.length){var i=t[0],n=t[1],r=t[2],a=t[3],s=[(r-i)/2+i,(a-n)/2+n],o=0,l=Math.max(r-i,a-n);return o=l<.001?400:3e5*l,new e({name:"viewpointFromExtend",distance:o,groundPosition:s,heading:360,pitch:-90,roll:0,animate:!0})}return null}},{key:"parseURLparameter",value:function(t){var i=t.cameraPosition;if(null!=i){i=i.split(",");for(var n=0;n<i.length;n++)i[n]=Number(i[n])}var r=t.groundPosition;if(null!=r){r=r.split(",");for(n=0;n<r.length;n++)r[n]=Number(r[n])}if(null!=t.epsg){var a=R.parseUrlParameter(t),s=R.createGeographicProjection();r&&(r=R.transform(s,a,r)),i&&(i=R.transform(s,a,i))}var o={cameraPosition:i,groundPosition:r,distance:Number(t.distance),pitch:Number(t.pitch),heading:Number(t.heading),roll:Number(t.roll)};return new e(o)}}]),e}(),V=G,B=(i(97),{LOCALE_CHANGED:"LOCALE_CHANGED"}),U=null,W=function(){function e(){Object(d["a"])(this,e),this.languages=[{token:"de",language:"Deutsch",data:{}},{token:"en",language:"English",data:{}}],this.currentlocale="",this.defaultLocale="de",this.availableLocales=[],this.logger=Y.getLogger("vcs.vcm.i18n"),this.i18nNumber=0}return Object(m["a"])(e,[{key:"detectBrowserLocale",value:function(){if(navigator.language){var e=navigator.language;return e.substring(0,2)}return null}},{key:"initialize",value:function(e){e.i18n&&this.setConfig(e.i18n);var t=e.availableLocales;if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=t[i];if(null!==n&&"object"===Object(s["a"])(n)){var r=n.locale;r&&(this.isLanguageAvailable(r)||this.registerLanguage(r,r,{}),this.availableLocales.push(r))}else this.isLanguageAvailable(t[i])&&this.availableLocales.push(t[i])}this.setDefaultLocale(e.locale),e.locale&&(this.defaultLocale=e.locale);var a=this.detectBrowserLocale();a&&this.availableLocales.indexOf(a)>=0&&(this.defaultLocale=a)}},{key:"setDefaultLocale",value:function(e){this.defaultLocale=this.availableLocales[0],e&&this.isLanguageAvailable(e)&&(this.defaultLocale=e);var t=this.detectBrowserLocale();t&&this.isLanguageAvailable(t)&&(this.defaultLocale=t)}},{key:"setConfig",value:function(e){for(var t in e)if(this.isLanguageAvailable(t)){for(var i=0;i<this.languages.length;i++)if(this.languages[i].token===t)for(var n in e[t])this.languages[i].data[n]=e[t][n]}else this.registerLanguage(t,t,e[t])}},{key:"getLocaleAwareString",value:function(e){return"string"===typeof e?e.replace("$locale$",this.currentlocale):e}},{key:"registerLanguage",value:function(e,t,i){for(var n={token:e,language:t,data:i},r=0;r<this.languages.length;r++)if(this.languages[r].token==e)return void this.logger.info("Language ".concat(t," already registered"));this.languages.push(n)}},{key:"isLanguageAvailable",value:function(e){for(var t=0;t<this.languages.length;t++)if(this.languages[t].token==e)return!0;return!1}},{key:"handleURLParameter",value:function(e){e.lang&&this.isLanguageAvailable(e.lang)&&(this.defaultLocale=e.lang)}},{key:"getSingleMessage",value:function(e){var t=this.getLanguageData(this.currentlocale),i=this.getLanguageData("en"),n=Object.assign({},i,t);return n&&n.hasOwnProperty(e)?n[e]:e}},{key:"getLanguageData",value:function(e){for(var t=0;t<this.languages.length;t++)if(this.languages[t].token==e)return this.languages[t].data;return this.languages.length>0?this.languages[0].data:null}},{key:"getLocale",value:function(){return this.currentlocale?this.currentlocale:this.defaultLocale}},{key:"setLocale",value:function(e){e||(e=this.defaultLocale),this.currentlocale!=e&&(this.currentlocale=e,this.translateAll(),ne.getInstance().publish(B.LOCALE_CHANGED,this.currentlocale))}},{key:"getRegisteredLanguages",value:function(){for(var e=[],t=0;t<this.languages.length;t++)e.push(this.languages[t].token);return e}},{key:"translateAll",value:function(e){var t=this.getLanguageData(this.currentlocale),i=this.getLanguageData("en"),n=Object.assign({},i,t),r=[],a=e||document.getElementById("balloonContainer")||document;for(var s in n){r=a.querySelectorAll(".".concat(s));for(var o=n[s],l=0;l<r.length;l++){var c=r[l];o=this.setParamValuesInTranslation(o,c),s.indexOf("tooltip")===s.length-"tooltip".length?c.title=o:"input"==c.nodeName.toLowerCase()?"submit"===c.attributes.type.value||"button"===c.attributes.type.value?c.value=o:c.placeholder=o:c.innerHTML=o}}}},{key:"setParamValuesInTranslation",value:function(e,t){var i=new RegExp("{[0-9]}","g"),n=e.match(i);if(n)for(var r=0;r<n.length;r++){var a=n[r].match(/{(.*)}/)[1],s=new RegExp("{[".concat(r,"]}"),"g"),o=t.getAttribute("data-".concat(a));o?e=e.replace(s,o):(e=e.replace(s,""),this.logger.warning("No attribute found to replace the placeholder at element: ".concat(t)))}return e}},{key:"replaceParamsInTranslation",value:function(e,t){var i=new RegExp("{[0-9]}","g"),n=e.match(i);if(n)for(var r=0;r<n.length;r++){n[r].match(/{(.*)}/)[1];var a=new RegExp("{[".concat(r,"]}"),"g"),s=t[r];e=s?e.replace(a,s):e.replace(a,"")}return e}}],[{key:"getInstance",value:function(){return U||(U=new e),U}},{key:"registerLanguage",value:function(t,i,n){e.getInstance().registerLanguage(t,i,n)}},{key:"getNextI18nNumber",value:function(){var t=e.getInstance();return t.i18nNumber++,t.i18nNumber}},{key:"getMessage",value:function(t){return e.getInstance().getSingleMessage(t)}},{key:"setMessage",value:function(t,i,n){var r={};r[i]=n;var a=e.getInstance(),s=a.getLanguageData(t);s&&(s[i]=n)}},{key:"setDataForElement",value:function(t,i){var n={};Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++)n["data-".concat(String(r))]=i[r];if(t)for(var a in n)t.setAttribute(a,n[a]);e.updateElement(t)}},{key:"updateElement",value:function(t){for(var i=e.getInstance(),n=t.classList,r=0;r<n.length;r++){var a=n[r];if(-1!==a.indexOf("i18n")){var s=i.getSingleMessage(a);s=i.setParamValuesInTranslation(s,t),t.textContent=s}}}}]),e}(),q=W;i(60);B.SELECTED_ITEM_CHANGED="SELECTED_ITEM_CHANGED",B.SELECTIONSET_CHANGED="SELECTIONSET_CHANGED";var J,K=null,Z=function(){function e(t){Object(d["a"])(this,e),this.className="vcs.vcm.SelectBehavior",this.logger=Y.getLogger(this.className);var i,n,r={invertClickBehaviorForCesiumMap:!(!t||!t.invertClickBehaviorForCesiumMap)&&t.invertClickBehaviorForCesiumMap,highlightStyle:{selectionset:{color:t&&t.highlightStyle&&t.highlightStyle.selectionset&&t.highlightStyle.selectionset.color?t.highlightStyle.selectionset.color:"#3F51B5"},currentItem:{color:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.color?t.highlightStyle.currentItem.color:"#F44336",pointStyle:{},lineStyle:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.lineStyle?t.highlightStyle.currentItem.lineStyle:{color:"#83f52c",width:1.25},polygonStyle:{fill:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.polygonStyle&&t.highlightStyle.currentItem.polygonStyle.fill?t.highlightStyle.currentItem.polygonStyle.fill:{color:"rgba(255,255,255,0.4)"},stroke:t&&t.highlightStyle&&t.highlightStyle.currentItem&&t.highlightStyle.currentItem.polygonStyle&&t.highlightStyle.currentItem.polygonStyle.stroke?t.highlightStyle.currentItem.polygonStyle.stroke:{color:"#83f52c",width:1}}}}};if(t&&t.highlightStyle&&t.highlightStyle.currentItem?t.highlightStyle.currentItem.pointStyle.icon?r.highlightStyle.currentItem.pointStyle.icon=t.highlightStyle.currentItem.pointStyle.icon:t.highlightStyle.currentItem.pointStyle.circle?r.highlightStyle.currentItem.pointStyle.circle=t.highlightStyle.currentItem.pointStyle.circle:r.highlightStyle.currentItem.pointStyle={icon:{scale:1,src:"{layerIcon}"}}:r.highlightStyle.currentItem.pointStyle={icon:{scale:1,src:"{layerIcon}"}},n=r.highlightStyle.selectionset.color,i=olcs.core.convertColorToCesium(n),this._selectionsetHighlightColor=i,n=r.highlightStyle.currentItem.color,i=olcs.core.convertColorToCesium(n),this._currentItemHighlightColor=i,r.highlightStyle.currentItem.pointStyle.icon)this._currentItemHighlightPointStyle=new ol.style.Style({image:new ol.style.Icon(r.highlightStyle.currentItem.pointStyle.icon)});else{var a=r.highlightStyle.currentItem.pointStyle.circle.stroke?new ol.style.Stroke(r.highlightStyle.currentItem.pointStyle.circle.stroke):void 0,s=new ol.style.Fill(r.highlightStyle.currentItem.pointStyle.circle.fill),o=r.highlightStyle.currentItem.pointStyle.circle.radius?r.highlightStyle.currentItem.pointStyle.circle.radius:5,l=new ol.style.Circle({fill:s,radius:o,stroke:a});this._currentItemHighlightPointStyle=new ol.style.Style({image:l})}this._currentItemHighlightLineStyle=new ol.style.Style({stroke:new ol.style.Stroke(r.highlightStyle.currentItem.lineStyle)});var c={};c.stroke=new ol.style.Stroke(r.highlightStyle.currentItem.polygonStyle.stroke),c.fill=new ol.style.Fill(r.highlightStyle.currentItem.polygonStyle.fill),this._currentItemHighlightPolygonStyle=new ol.style.Style(c),this._invertClickBehaviorForCesiumMap=!!r.invertClickBehaviorForCesiumMap,this._selectionset=[],this.selectMode="toplevelfeature",this._currentItem={},this._currentItemHighlightedUnderneath=!1,this.framework=ne.getInstance(),this.active=!1,this.options=r,this.activateClickBehavior(),this.framework.subscribe(B.LAYER_DEACTIVATED,this.layerDeactivatedListener.bind(this)),this.framework.subscribe(B.FEATURE_REMOVED,this.featureRemovedListener.bind(this)),this.framework.subscribe(B.MAP_ACTIVATED,this.mapActivatedListener.bind(this));var u=this.framework.getLayers();this.selectionSetLayers=[],u.forEach(function(e){"vcs.vcm.layer.cesium.Buildings"!==e.className&&"vcs.vcm.layer.cesium.CesiumTilesetLayer"!==e.className&&"vcs.vcm.layer.TiledLayer"!==e.className&&"vcs.vcm.layer.FeatureStore"!==e.className||this.selectionSetLayers.push(e)},this),this.framework.subscribe(B.LAYER_ACTIVATED,this.synchronizeSelectionSet.bind(this)),this.transformGeometryOnMove=!this.framework.isIE11}return Object(m["a"])(e,[{key:"activateClickBehavior",value:function(){this.active||(this.active=!0,this._invertClickBehaviorForCesiumMap?(this.featureClickedKey=this.framework.subscribe(B.FEATURE_CLICKED,this.handleFeatureCTRLClickedEvent.bind(this)),this.featureCtrlClickedKey=this.framework.subscribe(B.FEATURE_CTRL_CLICKED,this.handleFeatureClickedEvent.bind(this))):(this.featureClickedKey=this.framework.subscribe(B.FEATURE_CLICKED,this.handleFeatureClickedEvent.bind(this)),this.featureCtrlClickedKey=this.framework.subscribe(B.FEATURE_CTRL_CLICKED,this.handleFeatureCTRLClickedEvent.bind(this))),this.mapClickedKey=this.framework.subscribe(B.MAP_CLICKED,this.handleMapClickedEvent.bind(this)))}},{key:"deactivateClickBehavior",value:function(){this.active&&(this.active=!1,this.framework.unsubscribeByKey(this.featureClickedKey),this.framework.unsubscribeByKey(this.featureCtrlClickedKey),this.framework.unsubscribeByKey(this.mapClickedKey),this.clearCurrentItem())}},{key:"isClickBehaviorActivated",value:function(){return this.logger.deprecate("isClickBehaviorActivated","check the .active property"),this.active}},{key:"getInvertClickBehaviorForCesiumMap",value:function(){return this._invertClickBehaviorForCesiumMap}},{key:"setInvertClickBehaviorForCesiumMap",value:function(e){this._invertClickBehaviorForCesiumMap=e,this.deactivateClickBehavior(),this.activateClickBehavior()}},{key:"addToSelectionSet",value:function(e){var t=!1;e.forEach(function(e){if(-1===this._selectionset.indexOf(e))if(t=!0,this._selectionset.push(e),this._currentItem&&this._currentItem.id===e)this._currentItemHighlightedUnderneath=!0;else{var i={};i[e]=this._selectionsetHighlightColor,this.selectionSetLayers.forEach(function(e){e.initialized&&e.highlight(i)})}},this),t&&this.framework.publish(B.SELECTIONSET_CHANGED)}},{key:"removeFromSelectionSet",value:function(e){var t=!1;e.forEach(function(e){var i=this._selectionset.indexOf(e);-1!==i&&(t=!0,this._currentItem&&this._currentItem.id&&this._currentItem.object?this._currentItem.id!==this._selectionset[i]?this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[i]])},this):this._currentItemHighlightedUnderneath=null:this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[i]])},this),this._selectionset.splice(i,1))},this),t&&this.framework.publish(B.SELECTIONSET_CHANGED)}},{key:"synchronizeSelectionSet",value:function(){var e=this._selectionset.splice(0);this.clearSelectionSet(),this.addToSelectionSet(e)}},{key:"getSizeOfSelectionSet",value:function(){return this._selectionset.length}},{key:"getSelectionSet",value:function(){return this._selectionset}},{key:"clearSelectionSet",value:function(){this.removeFromSelectionSet(this._selectionset.slice(0))}},{key:"setCurrentItem",value:function(e,t,i){if(o(e,String),l(t,Object),i&&!/^vcs\.vcm\.layer/.test(i.className))throw new Error("Match failed: expected ".concat(i," to be an instanceof vcs.vcm.layer.Layer"));this.framework.publish(B.SELECTED_ITEM_CHANGED,e,t,i),this.clearCurrentItem();for(var n=0;n<this._selectionset.length;n++)this._selectionset[n]===e&&(this.selectionSetLayers.forEach(function(e){e.initialized&&e.unHighlight([this._selectionset[n]])},this),this._currentItemHighlightedUnderneath=!0);if(i){var r={};r[e]=i.determineHighlightStyle(e,t),i.highlight(r),this._currentItem={id:e,object:t,layer:i}}else this.selectionSetLayers.forEach(function(i){var n={};n[e]=i.determineHighlightStyle(e,t),i.highlight(n)}),this._currentItem={id:e,object:t,layer:this.selectionSetLayers};t&&i&&this.passToBalloonInfo(t,i)}},{key:"determineDefaultVectorHighlightStyle",value:function(e,t,i){var n=t.getGeometry(),r=t.get("olcs_extrudedHeight")||t.get("olcs_storeyNumber")&&t.get("olcs_storeyHeight");if(n instanceof ol.geom.Point||n instanceof ol.geom.MultiPoint){var a,s=t.getStyle()?t.getStyle():i.getStyle().style,o=!1;if(s instanceof Function&&(s=s(t),o=!0),s.getImage())if(this._currentItemHighlightPointStyle.getImage()instanceof ol.style.Icon)if(s.getImage()instanceof ol.style.Icon){if(!o)if("{layerIcon}"===this._currentItemHighlightPointStyle.getImage().getSrc())s=i.getStyle().style;else if("{featureIcon}"===this._currentItemHighlightPointStyle.getImage().getSrc()){var l=i.getFeatureById(e);s=l.getStyle()}var c,u=s.getImage().getImage();if("canvas"===u.nodeName.toLowerCase()){var h=s.getImage().getSize();c={img:u,imgSize:[h[0],h[1]],scale:this.options.highlightStyle.currentItem.pointStyle.icon.scale?this.options.highlightStyle.currentItem.pointStyle.icon.scale:1}}else{var d=s.getImage().getSrc();c=Object.assign({},this.options.highlightStyle.currentItem.pointStyle.icon,{src:d})}a=new ol.style.Style({image:new ol.style.Icon(c)})}else{var m=s.getImage().clone(),f=this.options.highlightStyle.currentItem.pointStyle.icon.scale?m.getScale()*this.options.highlightStyle.currentItem.pointStyle.icon.scale:2*m.getScale();m.setScale(f),a=new ol.style.Style({image:m})}else this._currentItemHighlightPointStyle.getImage()instanceof ol.style.Circle&&(a=new ol.style.Style({image:this._currentItemHighlightPointStyle.getImage()}));else a=new ol.style.Style({});if(s.getText()){var y=s.getText().clone(),g=y.getScale()||1,v=this.options.highlightStyle.currentItem.pointStyle.icon.scale?g*this.options.highlightStyle.currentItem.pointStyle.icon.scale:2*g;y.setScale(v),y.setFill(this._currentItemHighlightPolygonStyle.getFill()),a.setText(y)}return r&&a.setStroke(this._currentItemHighlightLineStyle.getStroke()),a}return n instanceof ol.geom.LineString||n instanceof ol.geom.MultiLineString?r?this._currentItemHighlightPolygonStyle:this._currentItemHighlightLineStyle:n instanceof ol.geom.Polygon||n instanceof ol.geom.Circle||n instanceof ol.geom.MultiPolygon?this._currentItemHighlightPolygonStyle:void 0}},{key:"passToBalloonInfo",value:function(e,t){var i=this.getBalloonInfoWidget();if(i){var n=t.getGenericFeatureFromClickedObject(e);n?i.createBalloonForGenericFeature(n):this.logger.warning("Could not create generic feature to pass to balloonInfo")}}},{key:"getBalloonInfoWidget",value:function(){return this.balloonWidget||(this.balloonWidget=this.framework.getWidgetByType("vcs.vcm.widgets.BalloonInfo")),this.balloonWidget}},{key:"clearCurrentItem",value:function(e){function t(e,t,n){e.unHighlight([t]),n&&(i={},i[t]=n,e.highlight(i))}var i;if(this._currentItem&&this._currentItem.id&&this._currentItem.layer){var n=this._currentItem.layer,r=this._currentItem.id;if(this._currentItem={},Array.isArray(n))n.forEach(function(e){var i=!!this._currentItemHighlightedUnderneath&&this._selectionsetHighlightColor;t(e,r,i)},this);else{var a=!!this._currentItemHighlightedUnderneath&&this._selectionsetHighlightColor;t(n,r,a)}}this._currentItemHighlightedUnderneath=!1;var s=this.getBalloonInfoWidget();s&&s.clearBalloon(),e||this.framework.publish(B.SELECTED_ITEM_CHANGED,null)}},{key:"getCurrentItem",value:function(){return this._currentItem}},{key:"handleFeatureClickedEvent",value:function(e,t,i){this.setCurrentItem(e,t,i)}},{key:"handleFeatureCTRLClickedEvent",value:function(e,t,i){-1!==this._selectionset.indexOf(e)?this.removeFromSelectionSet([e]):this.addToSelectionSet([e])}},{key:"getLink",value:function(e){if(null!=this._currentItem.id&&null!=this._currentItem.layer){var t={};if(t.slLayer=this._currentItem.layer.name,t.slId=this._currentItem.id,this._currentItem.object instanceof ol.Feature){var i=this._currentItem.object.getGeometry();t.slOlT=i.getType()}e.addQueryParams(t)}}},{key:"handleMapClickedEvent",value:function(){this.clearCurrentItem()}},{key:"layerDeactivatedListener",value:function(e){this._currentItem.layer===e&&this.clearCurrentItem()}},{key:"featureRemovedListener",value:function(e){this.removeFromSelectionSet([e.id]),this._currentItem.id===e.id&&this.clearCurrentItem()}},{key:"mapActivatedListener",value:function(e){this._currentItem.layer&&this._currentItem.object&&(this._currentItem.layer.isSupported(e)?this.passToBalloonInfo(this._currentItem.object,this._currentItem.layer):this.clearCurrentItem())}}],[{key:"getInstance",value:function(t){return K||(K=new e(t)),K}},{key:"dispose",value:function(){K=null}}]),e}(),Q=Z,X=function(){function e(){Object(d["a"])(this,e),this.key_=1,this.pendingKeys_=[],this.publishDepth_=0,this.subscriptions_=[],this.topics_={}}return Object(m["a"])(e,[{key:"subscribe",value:function(e,t,i){o(e,String),o(t,Function);var n=this.topics_[e];n||(n=this.topics_[e]=[]);var r=this.key_;return this.subscriptions_[r]=e,this.subscriptions_[r+1]=t,this.subscriptions_[r+2]=i,this.key_=r+3,n.push(r),r}},{key:"subscribeOnce",value:function(e,t,i){var n=!1,r=this.subscribe(e,function(e){n||(n=!0,this.unsubscribeByKey(r),t.apply(i,arguments))},this);return r}},{key:"unsubscribe",value:function(e,t,i){var n=this.topics_[e];if(n){var r=this.subscriptions_,a=n.find(function(e){return r[e+1]==t&&r[e+2]==i});if(a)return this.unsubscribeByKey(a)}return!1}},{key:"unsubscribeByKey",value:function(e){var t=this.subscriptions_[e];if(t){var i=this.topics_[t];if(0!=this.publishDepth_)this.pendingKeys_.push(e),this.subscriptions_[e+1]=function(){};else{if(i){var n=i.indexOf(e);i.splice(n,1)}delete this.subscriptions_[e],delete this.subscriptions_[e+1],delete this.subscriptions_[e+2]}}return!!t}},{key:"publish",value:function(t,i){var n=this.topics_[t];if(n){for(var r=new Array(arguments.length-1),a=1,s=arguments.length;a<s;a++)r[a-1]=arguments[a];if(this.async_)for(a=0;a<n.length;a++){var o=n[a];e.runAsync_(this.subscriptions_[o+1],this.subscriptions_[o+2],r)}else{this.publishDepth_++;try{for(a=0,s=n.length;a<s;a++){o=n[a];this.subscriptions_[o+1].apply(this.subscriptions_[o+2],r)}}finally{var l;if(this.publishDepth_--,this.pendingKeys_.length>0&&0==this.publishDepth_)while(l=this.pendingKeys_.pop())this.unsubscribeByKey(l)}}return 0!=a}return!1}},{key:"clear",value:function(e){if(e){var t=this.topics_[e];t&&(t.forEach(this.unsubscribeByKey,this),delete this.topics_[e])}else this.subscriptions_.length=0,this.topics_={}}},{key:"getCount",value:function(e){if(e){var t=this.topics_[e];return t?t.length:0}var i=0;for(var n in this.topics_)i+=this.getCount(n);return i}},{key:"disposeInternal",value:function(){this.clear(),this.pendingKeys_.length=0}}]),e}(),$=X,ee=0,te=Symbol("VcsConfigStyle"),ie=function(){function e(){Object(d["a"])(this,e),this.widgets={},this.maps={},this.layers={},this.viewpoints={},this.styles={},this.flights={},this.activemap=null,this.lastactivemap=null,this.startingmap="",this.startViewPoint=null,this.mapcontainer=null,this.urlParameter=null,this.pubsub=new $,this.projection=null,this.logger=Y.getLogger("vcs.vcm.Framework"),this.layerIndexCounter=0,this.numberOfLocales=0,this.initialized=!1,this.exclusiveListener={id:null,listeners:[],removedCallback:null},this.config={},this.currentLocale=null,this.libraryBasePath="",this.baseUrl="",this.isIE11=!!window.MSInputMethodContext&&!!document.documentMode}return Object(m["a"])(e,[{key:"setInitialized",value:function(e){this.initialized=e}},{key:"isInitialized",value:function(){return this.initialized}},{key:"loadLibraries",value:function(e,t,i){this.libs||(this.libs={});for(var n=[],r=0;r<e.length;r++){var a=e[r];""===this.libraryBasePath||t||(a=this.libraryBasePath+a),this.libs[a]?n.push(this.libs[a]):(this.libs[a]=new Promise(function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=a,n.defer=!1,n.async=!1,n.onload=e,n.onerror=t,i&&(/\.es6\.js$/.test(a)?n.type="module":n.noModule=!0),document.head.appendChild(n)}),n.push(this.libs[a]))}return Promise.all(n)}},{key:"addElementsToMapContainer",value:function(){var e=document.createElement("div");e.setAttribute("id","balloonContainer"),e.classList.add("mapElement"),e.classList.add("vcm-map-top");var t=document.createElement("div");t.setAttribute("id","vcmui"),this.mapcontainer.appendChild(e),this.mapcontainer.appendChild(t),this.mapcontainer.classList.add("vcs_map_container"),this.mapcontainer.classList.add("vcm-font-default")}},{key:"getConfig",value:function(e){var t=this.config;if(e)for(var i=e.split("."),n=0;n<i.length;n+=1){var r=i[n];if("undefined"===typeof t[r])return{};t=t[r]}return t}},{key:"handleUiPlugins",value:function(e){e&&e.plugins&&Object.keys(e.plugins).forEach(function(t){var i=this,n=e.plugins[t],r=n._entry||"plugins/".concat(t,"/").concat(t,".js");if("_dev"!==r){var a=[r],s=n._esmodule;s&&a.unshift(r.replace(/\.js$/,".es6.js")),this.loadLibraries(a,null,s).then(function(){i.logger.info("Loaded Plugin: ".concat(t))}).catch(function(){i.logger.warning("Could not find JS file for ui plugin ".concat(t)),delete e.plugins[t]})}},this)}},{key:"getI18nConfig",value:function(){return{availableLocales:this.config.availableLocales,locale:this.config.locale,i18n:this.config.i18n}}},{key:"addStyle",value:function(e){this.styles[e.name]=e}},{key:"getStyleByName",value:function(e){return o(e,String),this.styles[e]}},{key:"getStyles",value:function(){return this.styles}},{key:"addFlight",value:function(e){o(e.name,String),this.flights[e.name]=e}},{key:"getFlightByName",value:function(e){return o(e,String),this.flights[e]}},{key:"getFlights",value:function(){return Object.values(this.flights)}},{key:"getLogger",value:function(){return this.logger}},{key:"getActiveMap",value:function(){return this.activemap}},{key:"addMap",value:function(e){return this.maps[e.name]?(this.logger.warning("The map ".concat(e.name," already exist.")),!1):(this.maps[e.name]=e,!0)}},{key:"getMapByName",value:function(e){return this.maps[e]||null}},{key:"getMapByType",value:function(e){return Object.values(this.maps).find(function(t){return t.className===e})}},{key:"activateMap",value:function(e,t){var i=this,n=this.getMapByType(e);n||(n=this.getMapByName(e));var r=this.activemap?this.activemap.className:null,a=n?n.className:null;if("vcs.vcm.maps.Cesium"===r&&"vcs.vcm.maps.Openlayers"===a){var s=this.activemap.getViewPoint();s&&(n.fixedNorthOrientation&&s.setHeading(0),s.setPitch(-90),s.setAnimate(!0),s.getGroundPosition()&&s.setCameraPosition(null),this.activemap.gotoViewPoint(s,1,null,function(){var e={listener:null};e.listener=i.activemap.getScene().postRender.addEventListener(function(){e.listener&&e.listener(),i._activateMapHandler(n,t)})}))}else this._activateMapHandler(n,t)}},{key:"_synchronizeLayers",value:function(){var e=this;Object.values(this.layers).forEach(function(t){t.isSupported()&&(t.isInitialized()||!t.isActiveOnStartup()||t.isCommonLayer()||"vcs.vcm.layer.oblique.ObliqueLayer"===t.className?t.isCommonLayer()&&t.synchronizeImplementations(e.lastactivemap,e.activemap).then(function(){return t.activate(t.isActive())}):t.activate(!0))})}},{key:"_activateMapHandler",value:function(e,t){var i=this,n=e.name;if(e){var r=!1,a=t;if(a)if(this.activemap){if(this.activemap.name===n)return void this.activemap.gotoViewPoint(a);r=this.activemap.deactivate().then(function(){return i.lastactivemap=i.activemap,i.activemap=e,i.activemap.activate()})}else this.activemap=e,r=this.activemap.activate();else if(this.activemap){if(this.activemap.name===n)return;r=this.activemap.deactivate().then(function(t){return i.lastactivemap=i.activemap,i.activemap=e,a=t,i.activemap.activate()})}else this.activemap=e,r=this.activemap.activate();r?r.then(function(){e.active&&(i._synchronizeLayers(),a&&i.activemap.gotoViewPoint(a),i.publish(B.MAP_ACTIVATED,e))}).catch(function(e){i.logger.error(e.message)}):this.logger.error("could not activate map")}}},{key:"getMaps",value:function(){return Object.values(this.maps)}},{key:"createViewPointObject",value:function(e){var t=new V(e);this.addViewPoint(t)}},{key:"addViewPoint",value:function(e){this.viewpoints[e.name]=e}},{key:"getViewPointByName",value:function(e){for(var t in this.viewpoints)if(this.viewpoints.hasOwnProperty(t)&&this.viewpoints[t].name==e)return this.viewpoints[t];return null}},{key:"getViewPoints",value:function(){var e=[];for(var t in this.viewpoints)this.viewpoints.hasOwnProperty(t)&&e.push(this.viewpoints[t]);return e}},{key:"getStartViewPoint",value:function(){return this.startViewPoint}},{key:"addLayer",value:function(e){return this.layers[e.name]?(this.logger.warning("Could not add Layer with same name twice, make sure the LayerName is unique"),!1):(this.layers[e.name]=e,e.index=this.layerIndexCounter,this.layerIndexCounter+=1,this.getActiveMap()&&!e.isInitialized()&&e.isActiveOnStartup()&&e.activate(!0),!0)}},{key:"removeLayerByName",value:function(e){var t=this.getLayerByName(e);t&&(t.dispose(),this.removeLayer(t))}},{key:"removeLayer",value:function(e){this.layers[e.name]&&delete this.layers[e.name]}},{key:"getLayerByName",value:function(e){return this.layers[e]||null}},{key:"getLayers",value:function(){return Object.values(this.layers)}},{key:"addWidget",value:function(e){return this.widgets[e.name]?(this.logger.warning("Could not add Widget with same name twice, make sure the widgetname is unique"),!1):(this.widgets[e.name]=e,!0)}},{key:"getWidgetByName",value:function(e){return this.widgets[e]||null}},{key:"getWidgetsByType",value:function(e){return Object.values(this.widgets).filter(function(t){return t.className===e})}},{key:"getWidgets",value:function(){return Object.values(this.widgets)}},{key:"setStartViewPoint",value:function(e){this.startViewPoint=e}},{key:"getMapContainer",value:function(){return this.mapcontainer}},{key:"getWidgetByType",value:function(e){return Object.values(this.widgets).find(function(t){return t.className===e})}},{key:"subscribe",value:function(e,t,i){return this.pubsub.subscribe(e,t,i)}},{key:"subscribeOnce",value:function(e,t,i){return e?this.pubsub.subscribeOnce(e,t,i):null}},{key:"subscribeExclusive",value:function(e,t,i,n,r){o(e,[String,B]),o(t,Function),o(i,String),l(n,Function),this.setExclusive(i,n);var a=this.pubsub.subscribe(e,t,r);return this.exclusiveListener.listeners.push(a),a}},{key:"subscribeOnceExclusive",value:function(e,t,i,n,r){var a;o(e,[String,B]),o(t,Function),o(i,String),l(n,Function),this.setExclusive(i,n);var s=function(){this.exclusiveListener.listeners=this.exclusiveListener.listeners.filter(function(e){return e!==a}),0===this.exclusiveListener.listeners.length&&this.clearExclusive(),t.call.apply(t,[r].concat(Array.prototype.slice.call(arguments)))};return a=this.pubsub.subscribeOnce(e,s,this),this.exclusiveListener.listeners.push(a),a}},{key:"setExclusive",value:function(e,t){if(null!==this.exclusiveListener.id&&this.exclusiveListener.id!==e){this.exclusiveListener.removedCallback&&this.exclusiveListener.removedCallback();while(this.exclusiveListener.listeners.length>0)this.unsubscribeByKey(this.exclusiveListener.listeners.shift())}Q.getInstance().deactivateClickBehavior(),this.exclusiveListener.id=e,this.exclusiveListener.removedCallback=t}},{key:"clearExclusive",value:function(){Q.getInstance().activateClickBehavior(),this.exclusiveListener.id=null,this.exclusiveListener.removedCallback=null}},{key:"unsubscribe",value:function(e,t,i){this.pubsub.unsubscribe(e,t,i)}},{key:"unsubscribeByKey",value:function(e){var t=this.exclusiveListener.listeners.indexOf(e);t>-1&&(this.exclusiveListener.listeners.splice(t,1),0===this.exclusiveListener.listeners.length&&this.clearExclusive()),this.pubsub.unsubscribeByKey(e)}},{key:"publish",value:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.logger).debug.apply(t,["Published: ".concat(e)].concat(n)),this.pubsub.publish.apply(this.pubsub,arguments)}},{key:"getLocale",value:function(){return this.currentLocale}},{key:"getLocales",value:function(){return q.getInstance().getRegisteredLanguages()}},{key:"setLocale",value:function(e){this.currentLocale!==e&&(this.currentLocale=e,q.getInstance().setLocale(this.currentLocale))}},{key:"setProjection",value:function(e){this.projection=e}},{key:"getProjection",value:function(){return this.projection}},{key:"getSelectBehavior",value:function(){return Q.getInstance()}},{key:"getNextUniqueId",value:function(){return":".concat((ee++).toString(36))}},{key:"isMobile",value:function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}},{key:"dispose",value:function(){if(J){var t=e.getInstance();t.isInitialized()&&(Object.values(this.layers).forEach(function(e){return e.dispose()}),Object.values(this.maps).forEach(function(e){return e.dispose()}),Object.values(this.widgets).forEach(function(e){return e.dispose()}),this.widgets={},this.maps={},this.layers={},this.viewpoints={},this.startViewPoint=null,this.activemap=null,this.startingmap="",this.pubsub=new $,this.mapcontainer=null),J=void 0}}}],[{key:"activateLogging",value:function(){Y.enabled="info"}},{key:"getVersion",value:function(){return/VCM_VERSION/.test(e.VCM_VERSION)?"3.6.000-devel #12345":e.VCM_VERSION}},{key:"getInstance",value:function(){return J||(J=new e),J}},{key:"VCM_VERSION",get:function(){return"3.6.339-stable #217f884"}},{key:"configContentSymbol",get:function(){return te}}]),e}(),ne=ie,re=null,ae=function(){function e(){Object(d["a"])(this,e),this.layers={},this.framework=ne.getInstance(),this.framework.subscribe(B.LAYER_ACTIVATED,this.handleLayerActivated,this)}return Object(m["a"])(e,[{key:"handleLayerActivated",value:function(e){if(e.isExclusive()){var t=null;for(var i in this.layers)if(this.layers.hasOwnProperty(i))for(var n=0;n<this.layers[i].length;n++)this.layers[i][n]==e&&(t=i);if(t)for(n=0;n<this.layers[t].length;n++)this.layers[t][n]!=e&&this.layers[t][n].isActive()&&this.layers[t][n].activate(!1)}}}],[{key:"getInstance",value:function(){return re||(re=new e),re}},{key:"registerLayer",value:function(t){if(t.isExclusive()){var i=e.getInstance(),n=t.getExclusiveGroup();n&&(i.layers[n]||(i.layers[n]=[]),i.layers[n].includes(t)||i.layers[n].push(t))}}}]),e}(),se=ae,oe=(i(112),i(6)),le=i(9),ce=i.n(le),ue=1,he=function(){function e(){Object(d["a"])(this,e)}return Object(m["a"])(e,null,[{key:"getNextBit",value:function(e){return e<<1}},{key:"interactionTypeCounter",get:function(){return ue}}]),e}(),de={NONE:ue=he.getNextBit(ue),ALT:ue=he.getNextBit(ue),CTRL:ue=he.getNextBit(ue),SHIFT:ue=he.getNextBit(ue),ALL:0};de.ALL=de.NONE|de.ALT|de.CTRL|de.SHIFT;var me={NONE:0,CLICK:ue=he.getNextBit(ue),DBLCLICK:ue=he.getNextBit(ue),DRAG:ue=he.getNextBit(ue),DRAGSTART:ue=he.getNextBit(ue),DRAGEND:ue=he.getNextBit(ue),MOVE:ue=he.getNextBit(ue),DRAGEVENTS:0,CLICKMOVE:0,ALL:0};me.DRAGEVENTS=me.DRAG|me.DRAGEND|me.DRAGSTART,me.CLICKMOVE=me.CLICK|me.MOVE,me.ALL=Object.values(me).reduce(function(e,t){return e|t},0);var fe={LEFT:ue=he.getNextBit(ue),RIGHT:ue=he.getNextBit(ue),MIDDLE:ue=he.getNextBit(ue),ALL:0};fe.ALL=fe.LEFT|fe.RIGHT|fe.CENTER;var ye=0;function ge(){return ye+=1,ye}var ve=function(){function e(){Object(d["a"])(this,e),this.id=ge(),this._defaultActive=me.NONE,this.active=this._defaultActive,this._defaultModificationKey=de.NONE,this.modificationKey=this._defaultModificationKey,this._defaultPointerKey=fe.LEFT,this.pointerKey=this._defaultPointerKey}return Object(m["a"])(e,[{key:"initialize",value:function(){this.handleMapChange(ne.getInstance().getActiveMap())}},{key:"handleMapChange",value:function(e){}},{key:"pipe",value:function(e){return this.pipeThrough(e)}},{key:"pipeThrough",value:function(e){return Promise.resolve(e)}},{key:"setActive",value:function(e){"undefined"===typeof e?(this.active=this._defaultActive,this.modificationKey=this._defaultModificationKey,this.pointerKey=this._defaultPointerKey):this.active="boolean"===typeof e?e?this._defaultActive:me.NONE:e}},{key:"setModification",value:function(e){this.modificationKey=e||this._defaultModificationKey}},{key:"setPointer",value:function(e){this.pointerKey=e||this._defaultPointerKey}}]),e}(),pe=ve,_e=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.chain=e||[],i._defaultActive=me.ALL,i._defaultModificationKey=de.ALL,i._defaultPointerKey=fe.ALL,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"addInteraction",value:function(e,t){null!=t?this.chain.splice(t,0,e):this.chain.push(e)}},{key:"removeInteraction",value:function(e){var t=this.chain.findIndex(function(t){return t.id===e.id});return t>-1&&this.chain.splice(t,1),t}},{key:"initialize",value:function(){this.chain.forEach(function(e){e.initialize()})}},{key:"handleMapChange",value:function(e){this.chain.forEach(function(t){t.handleMapChange(e)})}},{key:"pipe",value:function(e){for(var t=Promise.resolve(e),i=this.chain.length,n=0;n<i;n++){var r=this.chain[n];r.active&e.type&&r.modificationKey&e.key&&r.pointerKey&e.pointer&&(t=t.then(function(e){return e.stopPropagation?Promise.resolve(e):this.pipe(e)}.bind(r)))}return t}},{key:"setModification",value:function(){this.modificationKey=this._defaultModificationKey}},{key:"setPointer",value:function(){this.pointerKey=this._defaultPointerKey}}]),t}(pe),be=_e,Le=i(344),Me=i.n(Le),ke=i(644),we=i.n(ke);function Te(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=b(e),null===e)break;return e}function Se(e,t,i){return Se="undefined"!==typeof Reflect&&we.a?we.a:function(e,t,i){var n=Te(e,t);if(n){var r=Me()(n,t);return r.get?r.get.call(i):r.value}},Se(e,t,i||e)}B.MAP_ACTIVATED="MAP_ACTIVATED",B.MAP_CLICKED="MAP_CLICKED",B.CLICKED="CLICKED",B.CLICKED_FIRST_HIT="CLICKED_FIRST_HIT",B.FEATURE_CLICKED="FEATURE_CLICKED",B.FEATURE_CTRL_CLICKED="FEATURE_CTRL_CLICKED",B.CLUSTER_CLICKED="CLUSTER_CLICKED";var Oe={},Ce=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.mapElement=document.createElement("div"),i.mapElement.setAttribute("id",Object(u["c"])()),i.framework.getMapContainer().appendChild(i.mapElement),i.mapElement.classList.add("mapElement"),i.mapElement.classList.add("vcm-map-top"),i.hide(),i.supportedlayers=[],i.active=!1,i.initialized=!1,i.layerState={},i.layerStateObject={state:!1},i.class_map_loading="vcm_map_loading",i.movementDisabled=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"specificLayerImpl",get:function(){return Oe}}]),Object(m["a"])(t,[{key:"isSupported",value:function(){return!0}},{key:"isInitialized",value:function(){return this.initialized}},{key:"raiseClickEvent",value:function(e,t,i,n,r){if(t&&i&&null!=n){var a={longitude:t,latitude:i,height:n};r&&(a.obliqueParameters=r),this.framework.publish(e,a)}}},{key:"raiseClickedFirstHitEvent",value:function(e){e.latitude&&e.longitude&&e.height&&this.framework.publish(B.CLICKED_FIRST_HIT,e)}},{key:"isActive",value:function(){return this.active}},{key:"setLayerLoading",value:function(e,t){this.layerState[e.name]=t,this.layerStateObject.state=Object.values(this.layerState).some(function(e){return e})}},{key:"activate",value:function(e){return Promise.resolve()}},{key:"deactivate",value:function(){this.active=!1;var e=this.getViewPoint();return this.hide(),Promise.resolve(e)}},{key:"show",value:function(){if(null!==this.mapElement){this.mapElement.style.display="";var e=this.className.substr(this.className.lastIndexOf(".")+1,this.className.length);this.framework.getMapContainer().classList.add(e)}}},{key:"hide",value:function(){if(null!==this.mapElement){this.mapElement.style.display="none";var e=this.className.substr(this.className.lastIndexOf(".")+1,this.className.length);this.framework.getMapContainer().classList.remove(e)}}},{key:"supportsLayer",value:function(e){if(null!=e)for(var t=e.getType(),i=0;i<this.supportedlayers.length;i++)if(this.supportedlayers[i]==t)return!0;return!1}},{key:"disableMovement",value:function(e){this.movementDisabled=e}},{key:"gotoViewPoint",value:function(e,t,i,n){}},{key:"getViewPoint",value:function(e,t){throw new Error}},{key:"dispose",value:function(){this.mapElement.parentElement.removeChild(this.mapElement),this.mapElement=null}},{key:"pointIsVisible",value:function(e){throw new Error}},{key:"handleURLParameter",value:function(e){}},{key:"requestRender",value:function(){}},{key:"activateMouseClickEvents",value:function(e){return e}},{key:"getActiveMouseClickEvents",value:function(){return!1}}],[{key:"registerSpecificLayerImpl",value:function(e,i,n){t.specificLayerImpl[e]||(t.specificLayerImpl[e]={}),t.specificLayerImpl[e][i]=n}},{key:"createSpecificLayerImpl",value:function(e,i){return t.specificLayerImpl[e.className][i.className]?new t.specificLayerImpl[e.className][i.className](i.options):null}}]),t}(A),Ee=Ce,Ie=(i(166),i(165),i(353),i(14)),De=(i(153),null),je=function(){function e(){Object(d["a"])(this,e),this.className="vcs.vcm.NavigationMode",this.logger=Y.getLogger(this.className),this.timeLastTick=null,this.lookFactor=.05,this.moveFactor=1,this.framework=ne.getInstance(),this.allowHeightChanges=!1,this.useAbsoluteHeight=!1,this.referenceHeight=1.6,this.navActive=!1,this.initialized=!1,this.clockListenerRemover=null,this.boundClockTickHandler=this.clockOnTickHandler.bind(this),this.values={referenceHeight:this.referenceHeight,active:!1,walkmode:!1},this.flags={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1,increaseFOV:!1,decreaseFOV:!1,rotation:!1,tiltUp:!1,tiltDown:!1,rotateEast:!1,rotateWest:!1},this.heading=null,this.defaultFOV=null}return Object(m["a"])(e,[{key:"setOptions",value:function(e){this.referenceHeight=e.referenceHeight||this.referenceHeight,this.moveFactor=e.moveFactor||this.moveFactor}},{key:"getLink",value:function(e){var t=this.framework.getActiveMap();this.navActive&&"vcs.vcm.maps.Cesium"===t.className&&e.addQueryParams({nav_uah:this.useAbsoluteHeight,nav_ahc:this.allowHeightChanges,nav_rh:this.referenceHeight})}},{key:"handleURLParameter",value:function(e){e.nav_rh&&(this.referenceHeight=e.nav_rh,this.values.referenceHeight=this.referenceHeight,this.activateFirstPersonMode(null,null,null,e.nav_ahc,e.nav_uah))}},{key:"isActive",value:function(){return this.logger.deprecate("isActive","access the navActive property directly"),this.navActive}},{key:"setFlags",value:function(e){var t=this;Object.entries(e).forEach(function(e){var i=Object(Ie["a"])(e,2),n=i[0],r=i[1];null!=t.flags[n]&&(t.flags[n]=r)})}},{key:"setFlag",value:function(e,t){this.flags[e]=t}},{key:"activateFirstPersonMode",value:function(e,t,i,n,r){var a=this,s=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===s.className){if(this.activateOverviewControls(!1),this.useAbsoluteHeight=r||!1,this.allowHeightChanges="boolean"===typeof n?n:this.allowHeightChanges,e){e.animate=!0;var o=t||null,l=i||null;this.navActive=!1,s.gotoViewPoint(e,o,l,function(){a.navActive=!0,a.activateFirstPersonControls(!0)})}else this.navActive=!0,this.activateFirstPersonControls(!0);Object.keys(this.flags).forEach(function(e){a.flags[e]=!1}),this.values.walkmode=!0}else this.logger.warning("First person mode only available on Cesium (3D) map")}},{key:"activateOverviewMode",value:function(e,t,i){var n=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===n.className)if(this.useAbsoluteHeight=!1,this.values.referenceHeight=1.6,this.navActive=!1,this.values.walkmode=!1,this.activateFirstPersonControls(!1),e){var r=t||null,a=i||null;n.gotoViewPoint(e,r,a,this.activateOverviewControls.bind(this,!0))}else this.activateOverviewControls(!0);else this.logger.warning("First person mode only available on Cesium (3D) map")}},{key:"activateFirstPersonControls",value:function(e){var t=this;if(e&&this.navActive)if(this.initializeCesium()){var i=this.cesiumMap.getViewPoint(!1),n=this.cesiumScene.globe.getHeight(Cesium.Cartographic.fromDegrees(i.cameraPosition[0],i.cameraPosition[1]));this.useAbsoluteHeight&&(this.values.referenceHeight=i.getCameraPosition()[2]-n),this.correctCurrentHeight(n),this.cesiumHandler.setInputAction(function(e){t.flags.looking=!0,t.startMousePosition=Cesium.Cartesian3.clone(e.position),t.mousePosition=t.startMousePosition},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.cesiumHandler.setInputAction(function(e){t.mousePosition=e.endPosition},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.cesiumHandler.setInputAction(function(){t.flags.looking=!1},Cesium.ScreenSpaceEventType.LEFT_UP),this.clockListenerRemover&&this.clockListenerRemover(),this.clockListenerRemover=this.cesiumViewer.clock.onTick.addEventListener(this.boundClockTickHandler)}else this.logger.warning("Could not initialize, is Cesium active");else this.initialized&&(null!==this.defaultFOV&&(this.cesiumViewer.camera.frustum.fov=this.defaultFOV),this.clockListenerRemover&&this.clockListenerRemover(),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE))}},{key:"initializeCesium",value:function(){return!!this.initialized||(this.cesiumMap=this.framework.getMapByType("vcs.vcm.maps.Cesium"),this.cesiumMap&&(this.cesiumViewer=this.cesiumMap.viewer,this.defaultFOV=this.cesiumViewer.camera.frustum.fov,this.cesiumScene=this.cesiumMap.getScene(),this.cesiumCanvas=this.cesiumScene.canvas,this.cesiumCanvas.setAttribute("tabindex","0"),this.cesiumCanvas.onclick=function(){this.cesiumCanvas.focus()}.bind(this),this.cesiumHandler=new Cesium.ScreenSpaceEventHandler(this.cesiumCanvas),this.cesiumEllipsoid=this.cesiumScene.globe.ellipsoid,this.initialized=!0),!0)}},{key:"activateOverviewControls",value:function(e){this.initializeCesium()?(this.cesiumScene.screenSpaceCameraController.enableRotate=e,this.cesiumScene.screenSpaceCameraController.enableTranslate=e,this.cesiumScene.screenSpaceCameraController.enableZoom=e,this.cesiumScene.screenSpaceCameraController.enableTilt=e,this.cesiumScene.screenSpaceCameraController.enableLook=e):this.logger.warning("Could not initialize, is Cesium active")}},{key:"clockOnTickHandler",value:function(e){if(!this.cesiumMap.movementDisabled){var t=this.timeLastTick?e.currentTime.secondsOfDay-this.timeLastTick.secondsOfDay:1/60;(t<=0||t>1)&&(t=1/60);var i=t/(1/60);this.timeLastTick=e.currentTime;var n=this.cesiumViewer.camera,r=this.lookFactor*i;if(this.flags.increaseFOV&&(n.frustum.fov=n.frustum.fov+.01>=5*Math.PI/8?n.frustum.fov:n.frustum.fov+.01),this.flags.decreaseFOV&&(n.frustum.fov=n.frustum.fov-.01<=Math.PI/10?Math.PI/10:n.frustum.fov-.01),this.flags.looking){var a=this.cesiumCanvas.clientWidth,s=this.cesiumCanvas.clientHeight,o=(this.mousePosition.x-this.startMousePosition.x)/a,l=-(this.mousePosition.y-this.startMousePosition.y)/s;n.look(n.position,r*o),n.lookUp(l*r)}if(this.flags.rotation&&n.look(n.position,r/10),this.flags.tiltUp&&n.lookUp(r/10),this.flags.tiltDown&&n.lookUp(-r/10),this.flags.rotateEast&&n.look(n.position,r/10),this.flags.rotateWest&&n.look(n.position,-r/10),null!==this.heading){var c=Cesium.Math.toRadians(this.heading)-n.heading;n.look(n.position,c),this.heading=null}var u=this.cesiumEllipsoid.cartesianToCartographic(n.position).height,h=this.cesiumScene.globe.getHeight(this.cesiumEllipsoid.cartesianToCartographic(n.position));h&&!this.useAbsoluteHeight||(h=u-this.referenceHeight);var d=(u-h)/30*i*this.moveFactor,m={heading:n.heading,pitch:n.pitch,roll:0},f=Cesium.Math.PI/2-.1;m.pitch>f&&(m.pitch=f),n.setView({orientation:{heading:n.heading,pitch:0,roll:0}}),this.flags.moveForward&&n.moveForward(d),this.flags.moveBackward&&n.moveBackward(d),this.flags.moveUp&&(this.referenceHeight+=d/2,this.values.referenceHeight=Number(this.referenceHeight.toFixed(2))),this.flags.moveDown&&(this.referenceHeight-=d/2,this.referenceHeight<1&&(this.referenceHeight=1),this.values.referenceHeight=Number(this.referenceHeight.toFixed(2))),this.flags.moveLeft&&n.moveLeft(d),this.flags.moveRight&&n.moveRight(d),this.correctCurrentHeight(h,m)}}},{key:"correctCurrentHeight",value:function(e,t){var i,n=this.cesiumViewer.camera,r=t||{heading:n.heading,pitch:n.pitch,roll:0};if(null==e||this.allowHeightChanges)n.setView({orientation:r});else{var a=n.positionCartographic,s=Number.parseFloat(this.values.referenceHeight.toString());Number.isNaN(s)||s.toFixed(2)===this.referenceHeight.toFixed(2)||(this.referenceHeight=s),this.values.referenceHeight=Number(this.referenceHeight.toFixed(2)),a.height=e+this.referenceHeight,i=Cesium.Cartesian3.fromRadians(a.longitude,a.latitude,a.height),n.setView({destination:i,orientation:r})}}},{key:"setValues",value:function(e){o(e,{referenceHeight:Number,active:Boolean,walkmode:Boolean},!1),this.values=e}},{key:"setHeading",value:function(e){this.logger.deprecate("setHeading","set the heading property instead"),this.heading=e}}],[{key:"getInstance",value:function(){return De||(De=new e),De}},{key:"dispose",value:function(){De=null}}]),e}(),Pe=je,Ye=Y.getLogger("vcs.vcm.util.Extent"),xe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d["a"])(this,e),this.projection=new R(t),this.extent=t.coordinates||this.projection.getProjection().getExtent()}return Object(m["a"])(e,[{key:"getInputCoordinates",value:function(){return Ye.deprecate("getInputCoordinates","access the .extent property directly"),this.extent}},{key:"getProjection",value:function(){return Ye.deprecate("getProjection","access the .projection property directly"),this.projection}},{key:"getCoordinatesInProjection",value:function(e,t){if(e.epsg===this.projection.epsg){var i=t?t.splice.apply(t,[0,4].concat(Object(T["a"])(this.extent))):this.extent.slice();return i}var n=R.getTransformer(e,this.projection),r=t||[];return n(this.extent,r,2),r}},{key:"isValid",value:function(){return!(!this.extent||!Array.isArray(this.extent)||4!==this.extent.length)&&(!!(Number.isFinite(this.extent[0])&&Number.isFinite(this.extent[1])&&Number.isFinite(this.extent[2])&&Number.isFinite(this.extent[3]))&&(this.extent[0]<=this.extent[2]&&this.extent[1]<=this.extent[3]))}},{key:"getConfigObject",value:function(){return Object.assign({coordinates:this.extent.slice()},this.projection.getConfigObject())}},{key:"inputCoordinates",get:function(){return Ye.deprecate("inputCoordinates","use .extent instead"),this.extent},set:function(e){Ye.deprecate("inputCoordinates","use .extent instead"),this.extent=e}}],[{key:"WGS_84_EXTENT",get:function(){return[-180,-90,180,90]}}]),e}(),Ae=xe,Fe={VECTOR:"vector",DECLARATIVE:"declarative",REFERENCE:"reference"},Ne=function(){function e(t){Object(d["a"])(this,e),this.className=t.className||"vcs.vcm.util.style.StyleItem",this.name=t.name||t.id||Object(u["c"])(),this.title=t.title||{en:this.name},this.legend=t.legend||[],this.supportedLayers=[],this.cesiumStyle=new Cesium.Cesium3DTileStyle({show:!0}),this.styleChanged=new Cesium.Event,this.colorBlendMode=Object(u["f"])(t.colorBlendMode,Cesium.Cesium3DTileColorBlendMode,Cesium.Cesium3DTileColorBlendMode.HIGHLIGHT),this.style=null}return Object(m["a"])(e,[{key:"isSupported",value:function(e){return 0===this.supportedLayers.length||this.supportedLayers.indexOf(e)>-1}},{key:"getOptions",value:function(e){return e&&e.meta?{name:this.name.toString(),title:this.title,legend:this.legend.length?this.legend:void 0}:{}}},{key:"clone",value:function(e){return e}},{key:"assign",value:function(e){return e}},{key:"getReference",value:function(){return{type:Fe.REFERENCE,name:this.name}}},{key:"_styleChanged",value:function(){this.styleChanged.raiseEvent()}}]),e}(),He=Ne,Re=Y.getLogger("vcs.vcm.util.style.StyleHelpers"),ze={NWSE:1,SWNE:2,DIAGONALCROSS:3,NS:4,WE:5,CROSS:6};function Ge(e,t){var i=e.substring(1);return 3===i.length&&(i=i.replace(/([\w\d])/g,"$1$1")),[parseInt(i.substring(0,2),16),parseInt(i.substring(2,4),16),parseInt(i.substring(4,6),16),null!=t?t:1]}function Ve(e){var t=e.toBytes();return t[3]/=255,t}function Be(e){if(Array.isArray(e))return 3===e.length&&e.push(1),e;if("string"===typeof e){if(/^#/.test(e))return Ge(e);if(/^rgba?\((\d+(,\s?)?){3}((0|1)(\.\d+)?)?\)/.test(e)){var t=e.replace(/^rgba?\(([\s\S]+?)\)/,"$1").replace(/\s/,"").split(",").map(function(e){return Number(e)});return 3===t.length&&t.push(1),t}}if(e instanceof CanvasPattern)return[255,255,255,.4];throw new Error("Cannot parse color ".concat(e))}function Ue(e){return"rgba(".concat(Be(e).join(","),")")}function We(e,t){var i=ol.has.DEVICE_PIXEL_RATIO,n=t||document.createElement("canvas");t&&n.width||(n.width=(e.pattern.size||10)*i,n.height=(e.pattern.size||10)*i);var r=n.getContext("2d"),a=n.width;function s(t,i){r.strokeStyle=Ue(e.pattern.color),r.lineWidth=e.pattern.width,r.lineCap="square",r.beginPath(),r.moveTo(t[0],t[1]),r.lineTo(i[0],i[1]),r.stroke()}switch(r.fillStyle=Ue(e.color),r.fillRect(0,0,a,a),e.pattern.type){case 1:s([a/2,a],[a,a/2]),s([0,a/2],[a/2,0]);break;case 2:s([a/2,a],[0,a/2]),s([a,a/2],[a/2,0]);break;case 3:s([a/2,a],[a,a/2]),s([0,a/2],[a/2,0]),s([a/2,a],[0,a/2]),s([a,a/2],[a/2,0]);break;case 4:s([a/2,0],[a/2,a]);break;case 5:s([0,a/2],[a,a/2]);break;case 6:s([a/2,0],[a/2,a]),s([0,a/2],[a,a/2]);break;default:return null}return r.createPattern(n,"repeat")}function qe(e){function t(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t}return e.slice(0,3).reduce(function(e,i){return"".concat(e).concat(t(i))},"#")}function Je(e){return/^#[0-9a-f]{6}$/.test(e)}function Ke(e){if("string"!==typeof e)return e;var t=null,i=null,n="normal",r="normal",a="normal",s="normal";return e.split(/\s+/).forEach(function(e){switch(e){case"normal":break;case"italic":case"oblique":n=e;break;case"small-caps":a=e;break;case"bold":case"bolder":case"lighter":case"100":case"200":case"300":case"400":case"500":case"600":case"700":case"800":case"900":r=e;break;default:if(!i){var o=e.split("/");i=o[0],o.length>1&&(s=o[1]);break}t=t?"".concat(t," ").concat(e):e;break}}),{fontStyle:n,fontVariant:a,fontWeight:r,fontSize:i,lineHeight:s,fontFamily:t}}function Ze(e){var t=["fontStyle","fontVariant","fontWeight","fontSize","fontFamily"],i=null;return Object.entries(e).filter(function(e){return"normal"!==e[1]&&"lineWeight"!==e[0]}).sort(function(e,i){var n=t.indexOf(e[0]),r=t.indexOf(i[0]);return n<r?-1:n>r?1:0}).forEach(function(e){i=i?"".concat(i," ").concat(e[1]):e[1]}),i||""}function Qe(e,t,i,n){for(var r=n||[0,0],a=e.getImageData(r[0],r[1],i[0],i[1]),s=a.data,o=Object(Ie["a"])(t,3),l=o[0],c=o[1],u=o[2],h=s.length,d=0;d<h;d+=4)s[d]=l,s[d+1]=c,s[d+2]=u;e.putImageData(a,r[0],r[1])}function Xe(e){if(e.getFill()){var t=e.getFill().getColor();try{t=Be(t).slice()}catch(i){Re.warning(i.message)}return{color:t}}}function $e(e){var t=e.getColor();if(t)try{t=Be(t).slice()}catch(i){Re.warning(i.message)}return{color:t,width:e.getWidth(),lineDash:e.getLineDash()}}function et(e){return{font:e.getFont(),fill:Xe(e),stroke:e.getStroke()?$e(e.getStroke()):void 0,textBaseline:e.getTextBaseline(),offsetY:e.getOffsetY(),offsetX:e.getOffsetX()}}function tt(e){var t=Object.assign({},e);return!t.fill||t.fill instanceof ol.style.Fill||(t.fill=new ol.style.Fill(t.fill)),!t.stroke||t.stroke instanceof ol.style.Stroke||(t.stroke=new ol.style.Stroke(t.stroke)),t.font&&"string"!==typeof t.font&&(t.font=Ze(t.font)),new ol.style.Text(t)}var it=new ol.style.Style({}),nt=[255,255,255,1],rt=[0,0,0,1],at={image:{fill:{color:[255,255,255,.4]},stroke:{color:rt,width:1},radius:5},stroke:{color:[51,153,204,1],width:1.25},fill:{color:[255,255,255,.4]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0}},st={olcs_color:Ue(nt),olcs_scale:"1.0",olcs_outlineWidth:"0.0",olcs_outlineColor:Ue(rt),olcs_pointSize:"8.0",olcs_image:void 0,olcs_font:"'".concat(at.text.font,"'"),olcs_fontColor:Ue(rt),olcs_fontOutlineWidth:"1.0",olcs_fontOutlineColor:Ue(nt),olcs_labelText:void 0,olcs_anchorLineColor:Ue(nt)};function ot(e,t){var i="Boolean(${".concat(e,"})===true"),n=t?"color(${".concat(e,"})"):"${".concat(e,"}");return[[i,n],["true",st[e]]]}function lt(e){return!e.fill||e.fill instanceof ol.style.Fill||(e.fill=new ol.style.Fill(e.fill)),!e.stroke||e.stroke instanceof ol.style.Stroke||(e.stroke=new ol.style.Stroke(e.stroke)),e.points?new ol.style.RegularShape(e):new ol.style.Circle(e)}var ct=function(){function e(){Object(d["a"])(this,e),this.shapes=[]}return Object(m["a"])(e,[{key:"addImage",value:function(e){var t=lt(Object.assign({},e)),i=t.getImage(1);e.src=i.toDataURL(),this.shapes.push(e)}}]),e}(),ut=new ct,ht={fill:new ol.style.Fill({color:[255,255,255,1]}),stroke:new ol.style.Stroke({color:[0,0,0,1],width:1}),radius:16};[null,{points:3},{points:3,angle:Math.PI},{points:4,angle:Math.PI/4},{points:6}].forEach(function(e){var t=e?Object.assign(e,ht):ht;ut.addImage(t)});var dt={POLYGON:1,POLYLINE:2,POINT:3},mt=Y.getLogger("vcs.vcm.util.style.StyleItem"),ft=Symbol("VcsVectorStyleItem"),yt=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),t.validateOptions(e),i.exclude={fill:!1===e.fill,stroke:!1===e.stroke,image:!1===e.image},i._fillOptions=null,i._fill=void 0,i._stroke=e.stroke?new ol.style.Stroke(e.stroke):void 0,i._text=void 0,e.text&&(i._text=tt(e.text)),i._label=e.label,i._cesiumColor=new Cesium.Color,i._image=void 0,e.image&&(i._image=e.image.radius?lt(Object.assign({},e.image)):new ol.style.Icon(e.image)),i._style=new ol.style.Style({image:i._image,stroke:i._stroke,text:i._text}),e.fill?(i._fillOptions=e.fill,i._setFill()):i.updateCesiumStyle(),i}return w(t,e),Object(m["a"])(t,[{key:"_setFill",value:function(){if(this._style instanceof ol.style.Style){var e=this._fillOptions.pattern?We(this._fillOptions):this._fillOptions.color;this._fill?this._fill.setColor(e):(this._fill=new ol.style.Fill({color:e}),this._style.setFill(this._fill)),this._fillOptions.pattern&&(this._fill.fallBackColor=this._fillOptions.color),this.updateCesiumStyle()}}},{key:"updateCesiumStyle",value:function(){this.updateCesiumStyleColor(!0),this.updateCesiumStyleImage(!0),this.updateCesiumStyleText(!0),this._styleChanged()}},{key:"updateCesiumStyleColor",value:function(e){var t=ot("olcs_color",!0);this.stroke&&this.stroke.getColor()&&t.splice(1,0,["${olcs_geometryType}===".concat(dt.POLYLINE),Ue(this.stroke.getColor())]),this._image instanceof ol.style.Circle&&this._image.getFill()&&t.splice(1,0,["${olcs_geometryType}===".concat(dt.POINT),Ue(this._image.getFill().getColor())]),this.fillColor&&t.splice(-1,1,["true",Ue(this.fillColor)]),this.cesiumStyle.color={conditions:t},e||this._styleChanged()}},{key:"updateCesiumStyleImage",value:function(e){var t=ot("olcs_scale"),i=ot("olcs_outlineWidth"),n=ot("olcs_outlineColor",!0),r=ot("olcs_pointSize"),a=ot("olcs_image");if(this._image)if(null!=this._image.getScale()&&t.splice(1,1,["true","".concat(this._image.getScale())]),this._image instanceof ol.style.Circle){var s=this._image.getStroke(),o=2*this._image.getRadius();if(s){this._image.getStroke().getColor()&&n.splice(1,1,["true",Ue(this._image.getStroke().getColor())]);var l=this._image.getStroke().getWidth();i.splice(1,1,["true","".concat(l)]),o-=l}r.splice(1,1,["true","".concat(o)])}else if(this._image instanceof ol.style.RegularShape){var c=this._image.getImage(1).toDataURL();a.splice(1,1,["true",'"'.concat(c,'"')])}else this._image instanceof ol.style.Icon&&a.splice(1,1,["true",'"'.concat(this._image.getSrc(),'"')]);this.cesiumStyle.scale={conditions:t},this.cesiumStyle.pointOutlineWidth={conditions:i},this.cesiumStyle.pointOutlineColor={conditions:n},this.cesiumStyle.pointSize={conditions:r},this.cesiumStyle.image={conditions:a},this.cesiumStyle.verticalOrigin="1",this.cesiumStyle.horizontalOrigin="0",e||this._styleChanged()}},{key:"updateCesiumStyleText",value:function(e){var t=ot("olcs_font"),i=ot("olcs_labelText"),n=ot("olcs_fontColor",!0),r=ot("olcs_fontOutlineWidth"),a=ot("olcs_fontOutlineColor",!0);this._text&&(this._text.getFont()&&t.splice(1,1,["true","'".concat(this._text.getFont(),"'")]),this._text.getText()&&i.splice(1,1,["true","'".concat(this._text.getText(),"'")]),this._text.getFill()&&this._text.getFill().getColor()&&n.splice(1,1,["true",Ue(this._text.getFill().getColor())]),this._text.getStroke()&&this._text.getStroke().getColor()&&(a.splice(1,1,["true",Ue(this._text.getStroke().getColor())]),r.splice(1,1,["true","".concat(this._text.getStroke().getWidth()||1.25)]))),this.cesiumStyle.font={conditions:t},this.cesiumStyle.labelText={conditions:i},this.cesiumStyle.labelColor={conditions:n},this.cesiumStyle.labelOutlineWidth={conditions:r},this.cesiumStyle.labelOutlineColor={conditions:a},this.cesiumStyle.labelStyle="Boolean(${olcs_fontOutlineWidth}) === true ? 2 : 0",this.cesiumStyle.labelHorizontalOrigin="0",this.cesiumStyle.labelVerticalOrigin="1",e||this._styleChanged()}},{key:"clone",value:function(e){var i=this;return e?(e.style=this._style instanceof ol.style.Style?this._style.clone():this._style,this._fillOptions&&this._fillOptions.color&&(e.fillColor=this._fillOptions.color.slice(),this._fillOptions.pattern&&(e.pattern=Object.assign({},this._fillOptions.pattern))),Object.keys(this.exclude).forEach(function(t){i.exclude[t]&&e.unset(t)}),e):new t(this.getOptions())}},{key:"assign",value:function(e){var t=this;return e.fillColor&&(this.fillColor=e.fillColor.slice()),e.pattern?this.pattern=Object.assign({},e.pattern):this.pattern=void 0,e.stroke&&(this.stroke=e.stroke.clone()),e.image&&(this.image=e.image.clone()),e.text&&(this.text=e.text.clone()),e.label&&(this.label=e.label),Object.keys(e.exclude).forEach(function(i){e.exclude[i]&&t.unset(i)}),this}},{key:"getOptions",value:function(e){var i=Se(b(t.prototype),"getOptions",this).call(this,e);i.type=Fe.VECTOR;var n=e||{fill:!0,stroke:!0,text:!0,image:!0};return n.fill&&(this._fillOptions?(i.fill={color:Be(this._fillOptions.color).slice()},this._fillOptions.pattern&&(i.fill.pattern=Object.assign({},this._fillOptions.pattern))):this.exclude.fill&&(i.fill=!1)),n.stroke&&(this._stroke?i.stroke=$e(this._stroke):this.exclude.stroke&&(i.stroke=!1)),n.text&&this._text&&(i.text=et(this._text)),n.label&&(i.label=this._label),n.image&&(this._image instanceof ol.style.Icon?i.image={src:this._image.getSrc(),scale:this._image.getScale(),opacity:this._image.getOpacity()}:this._image instanceof ol.style.Circle?i.image={scale:this._image.getScale(),fill:Xe(this._image),radius:this._image.getRadius(),stroke:this._image.getStroke()?$e(this._image.getStroke()):void 0}:this._image instanceof ol.style.RegularShape?i.image={scale:this._image.getScale(),fill:Xe(this._image),points:this._image.getPoints(),angle:this._image.getAngle(),radius:this._image.getRadius(),stroke:this._image.getStroke()?$e(this._image.getStroke()):void 0}:this.exclude.image&&(i.image=!1)),i}},{key:"getOptionsForFeature",value:function(e){var t=e.getGeometry().getType(),i=e.get("olcs_extrudedHeight")||e.get("olcs_storeyHeight")&&e.get("olcs_storeyNumber"),n={};return"Point"===t||"MultiPoint"===t?(null!=e[ft].label&&(n.text=!0,n.label=!0),n.image=!0,i&&(n.stroke=!0)):"LineString"===t||"MultiLineString"===t?(n.stroke=!0,i&&(n.fill=!0)):"Polygon"===t||"MultiPolygon"===t||"Circle"===t?(n.stroke=!0,n.fill=!0):"GeometryCollection"===t&&(n.stroke=!0,n.fill=!0,n.image=!0,n.text=!0),this.getOptions(n)}},{key:"unset",value:function(e){o(e,Object.keys(this.exclude)),"fill"===e?this.fillColor=void 0:this[e]=void 0,this.exclude[e]=!0}},{key:"fillColor",get:function(){return this._fillOptions?this._fillOptions.color:null},set:function(e){this.exclude.fill=!1,this._style instanceof ol.style.Style?e?(this._fillOptions?this._fillOptions.color=Be(e):this._fillOptions={color:Be(e)},this._setFill()):(this._fillOptions=null,this._fill=void 0,this._style.setFill(this._fill),this.updateCesiumStyleColor(!0)):mt.info("trying to set fill on a style function")}},{key:"cesiumFillColor",get:function(){var e,t=this.fillColor?this.fillColor.slice():null;return t?(t[3]=t[3]||1,t[3]*=255,(e=Cesium.Color).fromBytes.apply(e,Object(T["a"])(t).concat([this._cesiumColor]))):Cesium.Color.RED.clone(this._cesiumColor)}},{key:"pattern",get:function(){return this._fillOptions&&this._fillOptions.pattern?this._fillOptions.pattern:null},set:function(e){this._fillOptions?(e?(l(e,{color:[String,[Number]],width:Number,type:Number,size:[Number,void 0,null]},!0),this._fillOptions.pattern=e):this._fillOptions.pattern=void 0,this._setFill()):mt.error("Missing fill color")}},{key:"stroke",get:function(){return this._stroke},set:function(e){this.exclude.stroke=!1,this._style instanceof ol.style.Style?(l(e,ol.style.Stroke),this._style.setStroke(e),this._stroke=e,this.updateCesiumStyleColor(!0)):mt.info("trying to set stroke on a style function")}},{key:"label",get:function(){return this._label},set:function(e){l(e,String),e.length?this._label=e:this._label=void 0,this._text&&this._text.setText(e)}},{key:"text",get:function(){return this._text},set:function(e){this._style instanceof ol.style.Style?(l(e,ol.style.Text),this._text=e,this._text.setText(this._label),this._style.setText(this._text)):mt.info("trying to set text on a style function")}},{key:"image",get:function(){return this._image},set:function(e){this.exclude.image=!1,this._style instanceof ol.style.Style?(l(e,ol.style.Image),this._image=e,this._style.setImage(this._image),this.updateCesiumStyle()):mt.info("trying to set text on a style function")}},{key:"style",get:function(){return this._style},set:function(e){l(e,[ol.style.Style,Function]),e instanceof ol.style.Style?(this._stroke=e.getStroke(),this._fill=e.getFill(),this._text=e.getText(),this._image=e.getImage()):(this._stroke=void 0,this._fill=void 0,this._text=void 0,this._image=void 0),this._style=e,this._fill&&this._fill.getColor()&&(this._fillOptions={color:Be(this._fill.getColor())}),this._text&&this._text.setText(this._label),this.updateCesiumStyle()}}],[{key:"validateOptions",value:function(e){function t(e){try{e.color=Be(e.color),o(e.color,[Number]),o(e.color.length,[3,4])}catch(t){mt.error(t.message),e.color=[255,255,255,.4]}}function i(e){t(e),e.width||(mt.error("missing width for stroke, setting to 1.5"),e.width=1.5)}e.fill&&(t(e.fill),e.fill.pattern&&(i(e.fill.pattern),e.fill.pattern.type&&Object.values(ze).includes(e.fill.pattern.type)||(mt.error("Cannot find pattern ".concat(e.fill.pattern.type)),e.fill.pattern.type=ze.NWSE))),e.stroke&&i(e.stroke),e.image&&(e.image.icon?e.image=e.image.icon:e.image.circle&&(e.image=e.image.circle),e.image.src||e.image.radius||(mt.error("missing source or label in style, setting default circle"),e.image={fill:{color:"rgba(255,255,255,0.4)"},stroke:{color:"#3399CC",width:1},radius:5}),e.image.radius&&(e.image.radius=Number(e.image.radius),Number.isFinite(e.image.radius)||(mt.error("radius must be a number"),e.image.radius=5),e.image.fill&&t(e.image.fill),e.image.stroke&&i(e.image.stroke)))}}]),t}(He),gt=yt,vt=new yt(at);function pt(e){var t=e.toBytes();return t[3]/=255,new yt({fill:{color:t},stroke:{color:t,width:vt.stroke.getWidth()}})}var _t=new Cesium.Color,bt=Y.getLogger("vcs.vcm.util.style.DeclarativeStyleItem"),Lt=new ol.style.Text({font:"30px sans-serif",fill:new ol.style.Fill({color:nt}),textAlign:"left",offsetY:-15});function Mt(e,t,i){i[t].conditions?e[t]=new Cesium.ConditionsExpression(i[t],i.defines):e[t]=new Cesium.Expression(i[t],i.defines)}var kt,wt=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e));var n=e.declarativeStyle||{};return n.show=null==n.show||n.show,i.cesiumStyle=new Cesium.Cesium3DTileStyle(n),i.style=i._styleFunction.bind(f(i)),n.strokeColor&&Mt(i.cesiumStyle,"strokeColor",n),n.strokeWidth&&Mt(i.cesiumStyle,"strokeWidth",n),i._styleOptions=n,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.style.DeclarativeStyleItem"}}]),Object(m["a"])(t,[{key:"getOptions",value:function(e){var i=Se(b(t.prototype),"getOptions",this).call(this,e);i.type=Fe.DECLARATIVE;var n=e||{declarativeStyle:!0,defaults:!0};return n.declarativeStyle&&(i.declarativeStyle=this.cesiumStyle.style),i}},{key:"clone",value:function(e){return e?e.assign(this):new t(this.getOptions())}},{key:"assign",value:function(e){return this.cesiumStyle=e.cesiumStyle,this._styleOptions=this.cesiumStyle.style,this}},{key:"_styleFunction",value:function(e){if(!this.cesiumStyle.show.evaluate(e))return it;var t=e.getGeometry().getType();return"Point"===t?this._stylePoint(e):"Polygon"===t?this._stylePolygon(e):"LineString"===t?this._styleLineString(e):"Circle"===t?this._stylePolygon(e):"MultiPoint"===t?this._stylePoint(e):"MultiPolygon"===t?this._stylePolygon(e):"MultiLineString"===t?this._styleLineString(e):(bt.warning("could not style geometry type: ".concat(t)),it)}},{key:"_stylePolygon",value:function(e){var t=new ol.style.Style({}),i=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;return i&&t.setFill(new ol.style.Fill({color:Ve(i)})),this._evaluateStroke(e,t),t}},{key:"_styleLineString",value:function(e){var t=new ol.style.Style({}),i=e.get("olcs_extrudedHeight")||e.get("olcs_storeyHeight")&&e.get("olcs_storeyNumber"),n=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;if(n)if(i)t.setFill(new ol.style.Fill({color:Ve(n)}));else{var r=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(e):1;t.setStroke(new ol.style.Stroke({width:Number.isFinite(r)?r:1,color:Ve(n)}))}return i&&this._evaluateStroke(e,t),t}},{key:"_stylePoint",value:function(e){var t=new ol.style.Style({});if(this.cesiumStyle.labelText){var i=this.cesiumStyle.labelText.evaluate(e);if(i){var n=Lt.clone();if(n.setText(i.toString()),this.cesiumStyle.font){var r=this.cesiumStyle.font.evaluate(e);r&&n.setFont(r)}if(this.cesiumStyle.labelColor){var a=this.cesiumStyle.labelColor.evaluateColor(e,_t);a&&n.getFill().setColor(Ve(a))}if(this.cesiumStyle.labelOutlineColor){var s=this.cesiumStyle.labelOutlineColor.evaluate(e,_t);if(s){var o=this.cesiumStyle.labelOutlineWidth?this.cesiumStyle.labelOutlineWidth.evaluate(e):1;n.setStroke(new ol.style.Stroke({color:Ve(s),width:o}))}}t.setText(n)}}if(this.cesiumStyle.image){var l=this.cesiumStyle.image.evaluate(e);l&&t.setImage(new ol.style.Icon({src:l}))}else{var c={radius:4},u=this.cesiumStyle.color?this.cesiumStyle.color.evaluate(e,_t):Cesium.Color.WHITE;if(c.fill=new ol.style.Fill({color:Ve(u)}),this.cesiumStyle.pointSize){var h=this.cesiumStyle.pointSize.evaluate(e);c.radius=h/2}var d=this.cesiumStyle.pointOutlineWidth?this.cesiumStyle.pointOutlineWidth.evaluate(e):0;if(d){var m=this.cesiumStyle.pointOutlineColor?this.cesiumStyle.pointOutlineColor.evaluateColor(e,_t):Cesium.Color.BLACK;c.stroke=new ol.style.Stroke({color:Ve(m),width:d}),c.radius+=d/2}t.setImage(new ol.style.Circle(c))}if(this.cesiumStyle.scale&&t.getImage()){var f=this.cesiumStyle.scale.evaluate(e);Number.isFinite(f)&&t.getImage().setScale(f)}return this._evaluateStroke(e,t),t}},{key:"_evaluateStroke",value:function(e,t){if(this.cesiumStyle.strokeColor){var i=this.cesiumStyle.strokeColor.evaluateColor(e,_t);if(i){var n=this.cesiumStyle.strokeWidth?this.cesiumStyle.strokeWidth.evaluate(e):1;t.setStroke(new ol.style.Stroke({width:Number.isFinite(n)?n:1,color:Ve(i)}))}}}},{key:"show",get:function(){return this._styleOptions.show},set:function(e){this._styleOptions.show=e,this.cesiumStyle.show=e,this._styleChanged()}},{key:"color",get:function(){return this._styleOptions.color},set:function(e){this._styleOptions.color=e,this.cesiumStyle.color=e,this._styleChanged()}},{key:"strokeColor",get:function(){return this._styleOptions.strokeColor},set:function(e){this._styleOptions.strokeColor=e,this.cesiumStyle.strokeColor=e,this._styleChanged()}},{key:"strokeWidth",get:function(){return this._styleOptions.strokeWidth},set:function(e){this._styleOptions.strokeWidth=e,this.cesiumStyle.strokeWidth=e,this._styleChanged()}},{key:"image",get:function(){return this._styleOptions.image},set:function(e){this._styleOptions.image=e,this.cesiumStyle.image=e,this._styleChanged()}},{key:"labelText",get:function(){return this._styleOptions.labelText},set:function(e){this._styleOptions.labelText=e,this.cesiumStyle.labelText=e,this._styleChanged()}},{key:"labelColor",get:function(){return this._styleOptions.labelColor},set:function(e){this._styleOptions.labelColor=e,this.cesiumStyle.labelColor=e,this._styleChanged()}},{key:"font",get:function(){return this._styleOptions.font},set:function(e){this._styleOptions.font=e,this.cesiumStyle.font=e,this._styleChanged()}},{key:"pointSize",get:function(){return this._styleOptions.pointSize},set:function(e){this._styleOptions.pointSize=e,this.cesiumStyle.pointSize=e,this._styleChanged()}}]),t}(He),Tt=wt,St=new wt({declarativeStyle:{show:!0,color:{conditions:ot("olcs_color",!0)},scale:{conditions:ot("olcs_scale")},pointOutlineWidth:{conditions:ot("olcs_outlineWidth")},pointOutlineColor:{conditions:ot("olcs_outlineColor",!0)},pointSize:{conditions:ot("olcs_pointSize")},image:{conditions:ot("olcs_image")},font:{conditions:ot("olcs_font")},labelStyle:"2",labelText:{conditions:ot("olcs_labelText")},labelColor:{conditions:ot("olcs_fontColor",!0)},labelOutlineWidth:{conditions:ot("olcs_fontOutlineWidth")},labelOutlineColor:{conditions:ot("olcs_fontOutlineColor",!0)},verticalOrigin:"1",horizontalOrigin:"0",labelHorizontalOrigin:"0",labelVerticalOrigin:"1"}}),Ot=function(){function e(){Object(d["a"])(this,e),this.hiddenObjects={},this.highlightedObjects={},this.lastUpdated=Date.now()}return Object(m["a"])(e,[{key:"highlight",value:function(e){var t=this,i=!1;Object.entries(e).forEach(function(e){var n=Object(Ie["a"])(e,2),r=n[0],a=n[1],s=a;a instanceof Cesium.Color?s=pt(a):a instanceof ol.style.Style&&(s=new gt({}),a.getText()&&a.getText().getText()&&(s.label=a.getText().getText()),s.style=a),s=s,t.highlightedObjects[r]?t.highlightedObjects[r].style.fillColor.some(function(e,t){return e!==s.fillColor[t]})&&(t.highlightedObjects[r].style=s,i=!0):(t.highlightedObjects[r]={style:s,features:new Map},i=!0)}),i&&(this.lastUpdated=Date.now())}},{key:"unHighlight",value:function(t){var i=this;t.forEach(function(t){i.highlightedObjects[t]&&(i.highlightedObjects[t].features.forEach(function(n,r){r instanceof Cesium.Cesium3DTileFeature||r instanceof Cesium.Cesium3DTilePointFeature?e.featureExists(r)&&(r.color=n):r instanceof ol.Feature&&(i.hiddenObjects[t]||r.setStyle(n))}),delete i.highlightedObjects[t])})}},{key:"clearHighlighting",value:function(){this.unHighlight(Object.keys(this.highlightedObjects))}},{key:"hideObjects",value:function(e){var t=this,i=!1;e.forEach(function(e){t.hiddenObjects[e]||(t.hiddenObjects[e]=new Set,i=!0)}),i&&this._update()}},{key:"showObjects",value:function(t){var i=this,n=!1;t.forEach(function(t){i.hiddenObjects[t]&&(n=!0,i.hiddenObjects[t].forEach(function(n){if(n instanceof Cesium.Cesium3DTileFeature||n instanceof Cesium.Cesium3DTilePointFeature)e.featureExists(n)&&(n.show=!0);else if(n instanceof ol.Feature)if(i.highlightedObjects[t]){if(!i.highlightedObjects[t].features.has(n)){var r=n[ft]?n[ft].style:void 0;i.highlightedObjects[t].features.set(n,r)}n.setStyle(i.highlightedObjects[t].style.style)}else n.setStyle(n[ft]?n[ft].style:void 0)}),delete i.hiddenObjects[t])}),n&&this._update()}},{key:"clearHiddenObjects",value:function(){this.showObjects(Object.keys(this.hiddenObjects))}},{key:"_update",value:function(){this.lastUpdated=Date.now();var e=ne.getInstance().getActiveMap();e&&e.requestRender()}}],[{key:"featureExists",value:function(e){return e&&e.content&&!e.content.isDestroyed()&&!e.content.batchTable.isDestroyed()}}]),e}(),Ct=Ot,Et=function(){function e(){Object(d["a"])(this,e),this.hiddenObjects={},this._hiddenObjectFeatures={},this.lastUpdated=Date.now()}return Object(m["a"])(e,[{key:"hideObjects",value:function(e){var t=this;o(e,[String]);var i=!1;e.forEach(function(e){t.hiddenObjects[e]||(i=!0,t.hiddenObjects[e]=0),t.hiddenObjects[e]+=1}),i&&this._update()}},{key:"showObjects",value:function(e){var t=this;o(e,[String]);var i=!1;e.forEach(function(e){t.hiddenObjects[e]&&(t.hiddenObjects[e]-=1,0===t.hiddenObjects[e]&&(i=!0,t._hiddenObjectFeatures[e]&&(t._hiddenObjectFeatures[e].forEach(function(e){e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature?Ct.featureExists(e)&&(e.show=!0):e instanceof ol.Feature&&e.setStyle(e[ft]?e[ft].style:void 0)}),t._hiddenObjectFeatures[e].clear()),delete t.hiddenObjects[e]))}),i&&this._update()}},{key:"addFeature",value:function(e,t){this._hiddenObjectFeatures[e]||(this._hiddenObjectFeatures[e]=new Set),this._hiddenObjectFeatures[e].add(t)}},{key:"hasFeature",value:function(e,t){return!!this._hiddenObjectFeatures[e]&&this._hiddenObjectFeatures[e].has(t)}},{key:"_update",value:function(){this.lastUpdated=Date.now();var e=ne.getInstance().getActiveMap();e&&e.requestRender()}}]),e}();function It(){return kt||(kt=new Et),kt}B.LAYER_CHANGED="LAYER_CHANGED",B.LAYER_ACTIVATED="LAYER_ACTIVATED",B.LAYER_DEACTIVATED="LAYER_DEACTIVATED";var Dt={lastLayerId:0},jt=Dt.lastLayerId++,Pt=Symbol("vcsLayerName"),Yt="1.0",xt=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.extent=new Ae(e.extent),i.activeOnStartup=!!e.activeOnStartup,i.active=!1,i.loading=!1,i.enabled=!0,i.initialized=!1,i.type=null!=e.layertype?e.layertype:Dt.UNDEFINED,i.data={},i.mapNames=e.mapNames||[],i.exclusive=!1,i.exclusiveGroup="",i.url=e.url,i.index=null,i.hiddenObjectIds=Array.isArray(e.hiddenObjectIds)?e.hiddenObjectIds:[],i.iconManagerInUse=!1,i.groupedWith=[];var n=e.exclusive||"false";return"true"===n||!0===n?(i.exclusive=!0,i.exclusiveGroup="default"):"false"===n||!1===n?(i.exclusive=!1,i.exclusiveGroup="default"):(i.exclusive=!0,i.exclusiveGroup=String(n)),i.exclusive&&se.registerLayer(f(i)),i.allowPicking=null==e.allowPicking||e.allowPicking,i.style=i.getStyleOrDefaultStyle(e.activeStyleName||e.style),i.defaultStyle=i.style,i.featureVisibility=null,i.globalHider=It(),i._genericFeatureProperties=e.genericFeatureProperties||{},i}return w(t,e),Object(m["a"])(t,null,[{key:"UNDEFINED",get:function(){return jt}},{key:"className",get:function(){return"vcs.vcm.layer.Layer"}},{key:"vcsLayerNameSymbol",get:function(){return Pt}}]),Object(m["a"])(t,[{key:"raiseFeatureEvent",value:function(e,t,i,n){this.framework.publish(e,t,i,n)}},{key:"objectClickedHandler",value:function(e,t,i){return!1}},{key:"getExtent",value:function(){return this.extent}},{key:"initialize",value:function(){throw new Error}},{key:"isExclusive",value:function(){return this.exclusive}},{key:"isIconManagerInUse",value:function(){return this.iconManagerInUse}},{key:"getExclusiveGroup",value:function(){return this.exclusiveGroup}},{key:"isInitialized",value:function(){return this.initialized}},{key:"getType",value:function(){return this.type}},{key:"isActiveOnStartup",value:function(){return this.activeOnStartup}},{key:"isSupported",value:function(e){var t=e||this.framework.getActiveMap();return!(!t||!(0===this.mapNames.length||this.mapNames.indexOf(t.name)>=0))&&t.supportsLayer(this)}},{key:"isActive",value:function(){return this.active}},{key:"activate",value:function(e){var t=function(){return this.show(),this.active=e,this.framework.publish(B.LAYER_ACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this),this.globalHider.hideObjects(this.hiddenObjectIds),Promise.resolve()}.bind(this),i=function(){return this.hide(),this.active=e,this.framework.publish(B.LAYER_DEACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this),this.globalHider.showObjects(this.hiddenObjectIds),Promise.resolve()}.bind(this);if(e!=this.isActive()){if(!e)return this.isInitialized()?i():Promise.reject();if(this.isSupported()){var n=this.initialize();return n?n.then(t,function(){return Promise.reject()}):t()}}return Promise.resolve()}},{key:"dispose",value:function(){}},{key:"show",value:function(){}},{key:"hide",value:function(){}},{key:"getGenericFeatureFromClickedObject",value:function(e){return this.logger.warning("This method should be implemented by any specific layers"),null}},{key:"addGenericFeatureProperties",value:function(e){o(e,Object),Object.assign(this._genericFeatureProperties,e)}},{key:"isCommonLayer",value:function(){return!1}},{key:"handleURLParameter",value:function(e){}},{key:"highlight",value:function(e){this.featureVisibility&&this.featureVisibility.highlight(e)}},{key:"unHighlight",value:function(e){this.featureVisibility&&this.featureVisibility.unHighlight(e)}},{key:"clearHighlighting",value:function(){this.featureVisibility&&this.featureVisibility.clearHighlighting()}},{key:"hideObjects",value:function(e){this.featureVisibility&&this.featureVisibility.hideObjects(e)}},{key:"showObjects",value:function(e){this.featureVisibility&&this.featureVisibility.showObjects(e)}},{key:"clearHiddenObjects",value:function(){this.featureVisibility&&this.featureVisibility.clearHiddenObjects()}},{key:"determineHighlightStyle",value:function(e,t){return null}},{key:"isPartOfAGroupLayer",value:function(){return this.groupedWith.length>0}},{key:"getStyleOrDefaultStyle",value:function(e,t){if("string"===typeof e){var i=this.framework.getStyleByName(e);if(i)return i;this.logger.warning("could not find style with name ".concat(e))}else{if(e&&e instanceof He)return e;if(e){if(e.type===Fe.DECLARATIVE||e.declarativeStyle)return new Tt(e);if(e.type!==Fe.REFERENCE){var n=new gt(e);return t?t.assign(n):n}var r=this.framework.getStyleByName(e.name);if(r)return r;this.logger.warning("could not find style with name ".concat(e.name))}}return t||St.clone()}},{key:"setStyle",value:function(e,t){if(o(e,[ol.style.Style,He,Function,String]),"string"===typeof e){var i=this.framework.getStyleByName(e);if(!i)return void this.logger.warning("could not find style with name ".concat(e));this.style=i}else e instanceof He?this.style=e:(this.style=new gt({}),this.style.style=e)}},{key:"clearStyle",value:function(){this.setStyle(this.defaultStyle)}}]),t}(A),At=xt,Ft={};function Nt(e){if(!Ft[e.url])return Ft[e.url]=new Cesium.CesiumTerrainProvider(e),Ft[e.url];var t=Ft[e.url];return!t.requestVertexNormals&&e.requestVertexNormals&&(Ft[e.url]=new Cesium.CesiumTerrainProvider(e),t=Ft[e.url]),t}function Ht(e,t,i){var n=i?R.getTransformer(R.createGeographicProjection(),i):null,r=t.map(function(e){var t=n?n(e,e.slice(),e.length):e;return Cesium.Cartographic.fromDegrees(t[0],t[1])});return new Promise(function(i,n){Cesium.sampleTerrainMostDetailed(e,r).then(function(e){e.forEach(function(e,i){t[i][2]=e.height||0}),i(t)},n)})}Dt.CESIUM_TERRAIN=Dt.lastLayerId,Dt.lastLayerId+=1;var Rt=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_TERRAIN,e.className=t.className,i=y(this,b(t).call(this,e)),i.requestVertexNormals=null==e.requestVertexNormals||e.requestVertexNormals,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Terrain"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.cesiumTerrainProvider=Nt({url:this.url,requestVertexNormals:this.requestVertexNormals}),this.initialized=!0)}},{key:"show",value:function(){var e=this.framework.getActiveMap();if(e&&e.isInitialized()){this.framework.getLayers().filter(function(e){return e instanceof t}).forEach(function(e){e.activate(!1)});var i=e.getScene(),n=i.globe;n.depthTestAgainstTerrain=!0,n.terrainProvider=this.cesiumTerrainProvider}}},{key:"hide",value:function(){var e=this.framework.getActiveMap();if(e){this.ellipsoidProvider||(this.ellipsoidProvider=new Cesium.EllipsoidTerrainProvider({}));var t=e.getScene(),i=t.globe;i.depthTestAgainstTerrain=!1,i.terrainProvider=this.ellipsoidProvider}}},{key:"dispose",value:function(){var e=this.framework.getActiveMap();e&&(e.getCesiumWidget().terrainProvider=new Cesium.EllipsoidTerrainProvider({})),this.ellipsoidProvider=null,this.cesiumTerrainProvider=null,this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"getHeightForWGS84Coordinates",value:function(e){return Ht(this.cesiumTerrainProvider,e)}}]),t}(At),zt=Rt,Gt=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.viewer=null,i.debugMode=!1,i.enableLightning=Object(u["e"])(e.enableLightning,!0),i.tileCacheSize=Object(u["h"])(e.tileCacheSize,1),i.eventHandler=null,i.invertClickBehavior=!1,i.defaultJDate=Cesium.JulianDate.fromDate(new Date(2014,6,20,13,0,0,0)),i.supportedlayers=[Dt.CESIUM_BUILDINGSLAYER,Dt.CESIUM_TERRAIN,Dt.CESIUM_POINTCLOUDLAYER,Dt.CESIUM_GLTFLAYER,Dt.CESIUM_ENTITIESLAYER,Dt.CESIUM_CZMLLAYER,Dt.CESIUM_TILESET_LAYER,Dt.TMSBase,Dt.VECTOR,Dt.FEATURESTORE,Dt.CLUSTER,Dt.WMS,Dt.WMTS,Dt.WSV,Dt.GEOJSON,Dt.IMAGE,Dt.OPENSTREETMAP,Dt.TILED_LAYER],i.urlParameter=null,i.webGLaa=Object(u["e"])(e.webGLaa,!1),i.enableTerrainAdjustmentWhenLoading=Object(u["e"])(e.enableTerrainAdjustmentWhenLoading,!0),i.limitCameraHeight=null!=e.limitCameraHeight?Object(u["g"])(e.limitCameraHeight,0):null,i.globeColor=e.globeColor?Cesium.Color.fromCssColorString(e.globeColor):Cesium.Color.fromBytes(63,71,204),i._clusterDataSourceDisplay=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Cesium"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){try{this.viewer=new Cesium.CesiumWidget(this.mapElement.getAttribute("id"),{requestRenderMode:!1,scene3DOnly:!0,imageryProvider:!1,shadows:!1,terrainShadows:Cesium.ShadowMode.ENABLED,contextOptions:{webgl:{failIfMajorPerformanceCaveat:!1,antialias:this.webGLaa}}})}catch(s){return this.hide(),document.getElementById("error-message").classList.remove("vcm_ui_hidden"),this.initialized=!1,!1}this.viewer.scene.globe.tileCacheSize=this.tileCacheSize,this.viewer.scene.globe.baseColor=this.globeColor,this.dataSourceDisplay=new Cesium.DataSourceDisplay({scene:this.viewer.scene,dataSourceCollection:new Cesium.DataSourceCollection}),this.viewer.scene.frameState.creditDisplay.update=function(){},this.viewer.scene.frameState.creditDisplay.beginFrame=function(){},this.viewer.scene.frameState.creditDisplay.endFrame=function(){};var t=this.viewer.clock;t.shouldAnimate=!0,t.onTick.addEventListener(function(){var i=t.currentTime;e.dataSourceDisplay.update(i)}),this.viewer.scene.shadowMap.maximumDistance=5e3,this.viewer.scene.shadowMap.darkness=.6,this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.viewer.scene.highDynamicRange=!1,this.viewer.scene.globe.enableLighting=this.enableLightning,this.viewer.scene.camera.enableTerrainAdjustmentWhenLoading=this.enableTerrainAdjustmentWhenLoading,this.setDay(this.defaultJDate);var i=document.getElementsByClassName("cesium-widget-credits");if(i)for(var n=0;n<i.length;n++){var r=i[n];r.style.display="none"}var a=new Cesium.Cartographic;this.viewer.scene.preUpdate.addEventListener(function(){null!==e.limitCameraHeight&&(Cesium.Cartographic.fromCartesian(e.viewer.scene.camera.position,Cesium.Ellipsoid.WGS84,a),a&&a.height<e.limitCameraHeight&&(a.height=e.limitCameraHeight,Cesium.Cartographic.toCartesian(a,Cesium.Ellipsoid.WGS84,e.viewer.scene.camera.position)))}),this.eventHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.ol3map=new ol.Map({view:new ol.View({resolutions:[1],resolution:1})}),this.clusterConverter=new olcs.ClusterConverter(this.viewer.scene),this.synchronizer=new olcs.VectorSynchronizer(this.ol3map,this.viewer.scene),this.clusterSynchronizer=new olcs.VectorSynchronizer(this.ol3map,this.viewer.scene,this.clusterConverter),this.initialized=!0,this.urlParameter&&this.handleURLParameter(this.urlParameter)}return!0}},{key:"activate",value:function(e){return this.active=!0,this.show(),this.initialize()?(this.viewer.resize(),e&&this.gotoViewPoint(e),Promise.resolve()):Promise.resolve()}},{key:"show",value:function(){this.viewer&&(this.viewer.container.style.display="",this.viewer.useDefaultRenderLoop=!0,this.cesiumInspectorContainer&&(this.cesiumInspectorContainer.style.display="")),Se(b(t.prototype),"show",this).call(this)}},{key:"hide",value:function(){this.viewer&&(this.viewer.useDefaultRenderLoop=!1,this.viewer.container.style.display="none",this.cesiumInspectorContainer&&(this.cesiumInspectorContainer.style.display="none")),Se(b(t.prototype),"hide",this).call(this)}},{key:"getOL3Map",value:function(){return this.logger.deprecate("getOL3Map","is deprecated in v3.6, use the property ol3map directly"),this.ol3map}},{key:"getSynchronizer",value:function(e){return"vcs.vcm.layer.cesium.VectorCluster"===e.className?this.clusterSynchronizer:this.synchronizer}},{key:"getClusterConverter",value:function(){return this.clusterConverter}},{key:"getHeightFromTerrain",value:function(e){var t=this.viewer.scene.terrainProvider;return t.availability?Ht(t,e,R.createMercatorProjection()):Promise.resolve(e)}},{key:"getPositionOnGround",value:function(e,t){var i=Cesium.Cartesian3.fromDegreesArrayHeights(e)[0],n=Cesium.Cartesian3.fromDegreesArrayHeights(t)[0],r=new Cesium.Ray(i,n),a=this.viewer.scene.globe.pick(r,this.viewer.scene);if(a){var s=Cesium.Ellipsoid.WGS84.cartesianToCartographic(a),o=[Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),s.height];return o}return null}},{key:"getViewPoint",value:function(e,t){if(!this.viewer||!this.viewer.scene)return null;var i=null==e||e,n=this.viewer.scene.camera,r=n.position,a=null,s=null;if(i){var o=new Cesium.Ray(n.position,n.direction),l=this.viewer.scene.globe.pick(o,this.viewer.scene);if(l){s=Cesium.Cartesian3.distance(l,r);var c=Cesium.Ellipsoid.WGS84.cartesianToCartographic(l);a=[Cesium.Math.toDegrees(c.longitude),Cesium.Math.toDegrees(c.latitude),c.height]}}var u=n.positionCartographic,h=[Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude),u.height],d=new V({groundPosition:i?a:[],cameraPosition:h,distance:s,heading:Cesium.Math.toDegrees(n.heading),pitch:Cesium.Math.toDegrees(n.pitch),roll:Cesium.Math.toDegrees(n.roll)});return t?Promise.resolve(d):d}},{key:"gotoViewPoint",value:function(e,t,i,n){var r=this;if(!this.movementDisabled){var a=null!==t?t:void 0,s=null!==i?i:void 0;if(Pe.getInstance().navActive&&Pe.getInstance().activateOverviewMode(),e.isValid()){var o=null,l=e.getDistance(),c=0,u=Cesium.Math.toRadians(e.getHeading()),h=Cesium.Math.toRadians(e.getPitch()),d=Cesium.Math.toRadians(e.getRoll());if(e.getCameraPosition()){var m=e.getCameraPosition();o=Cesium.Cartesian3.fromDegrees(m[0],m[1],m[2])}else{if(!e.getGroundPosition())return;var f=e.getGroundPosition(),y=Cesium.Cartesian3.fromDegrees(f[0],f[1],f[2]),g=new Cesium.Camera(this.viewer.scene),v={destination:y,orientation:{heading:u,pitch:h,roll:d}};if(g.setView(v),!f[2]){var p=this.framework.getLayers(),_=p.filter(function(e){return e.active}).find(function(e){return e instanceof zt});_&&_.getHeightForWGS84Coordinates([[f[0],f[1]]]).then(function(e){var t=e[0][2];if(t>0){var i=r.viewer.scene.camera.positionCartographic.height,n=t+c-i;r.viewer.scene.camera.moveBackward(n)}});var b=Cesium.Cartographic.fromDegrees(f[0],f[1]),L=this.viewer.scene.globe.getHeight(b);if(L&&L>0){var M=Cesium.Cartesian3.fromDegrees(f[0],f[1],L);v.destination=M,g.setView(v)}}null===l||void 0===l?l=2e3:l>0&&g.moveBackward(l),o=g.position}var k=this.viewer.scene.camera,w={heading:u,pitch:h,roll:d};o=o||null,e.getAnimate()?k.flyTo({destination:o,orientation:w,duration:a,maximumHeight:s,complete:n}):(k.setView({destination:o,orientation:w}),n&&n()),c=k.positionCartographic.height}}}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),e?(this.originalState={enableRotate:this.viewer.scene.screenSpaceCameraController.enableRotate,enableTranslate:this.viewer.scene.screenSpaceCameraController.enableTranslate,enableZoom:this.viewer.scene.screenSpaceCameraController.enableZoom,enableTilt:this.viewer.scene.screenSpaceCameraController.enableTilt,enableLook:this.viewer.scene.screenSpaceCameraController.enableLook},this.viewer.scene.screenSpaceCameraController.enableRotate=!1,this.viewer.scene.screenSpaceCameraController.enableTranslate=!1,this.viewer.scene.screenSpaceCameraController.enableZoom=!1,this.viewer.scene.screenSpaceCameraController.enableTilt=!1,this.viewer.scene.screenSpaceCameraController.enableLook=!1):!e&&this.originalState&&(this.viewer.scene.screenSpaceCameraController.enableRotate=this.originalState.enableRotate,this.viewer.scene.screenSpaceCameraController.enableTranslate=this.originalState.enableTranslate,this.viewer.scene.screenSpaceCameraController.enableZoom=this.originalState.enableZoom,this.viewer.scene.screenSpaceCameraController.enableTilt=this.originalState.enableTilt,this.viewer.scene.screenSpaceCameraController.enableLook=this.originalState.enableLook,this.originalState=null)}},{key:"setDay",value:function(e){this.viewer.clock.currentTime=e,this.viewer.clock.multiplier=1}},{key:"setLightning",value:function(e){this.enableLightning=e,this.viewer.scene.globe.enableLighting=e}},{key:"getCesiumWidget",value:function(){return this.viewer}},{key:"getEntities",value:function(){return this.dataSourceDisplay.defaultDataSource.entities}},{key:"getDatasources",value:function(){return this.dataSourceDisplay.dataSources}},{key:"getClusterDatasources",value:function(){var e=this;if(this._clusterDataSourceDisplay)return this._clusterDataSourceDisplay.dataSources;var t=new Cesium.DataSourceCollection;function i(e,t,i){var n=i.entities;return[new Cesium.BillboardVisualizer(t,n),new Cesium.LabelVisualizer(t,n),new Cesium.PointVisualizer(t,n)]}return this._clusterDataSourceDisplay=new Cesium.DataSourceDisplay({scene:this.viewer.scene,dataSourceCollection:t,visualizersCallback:i}),this.viewer.clock.onTick.addEventListener(function(t){e._clusterDataSourceDisplay.update(t.currentTime)}),t}},{key:"getDataSourceDisplay",value:function(){return this.dataSourceDisplay}},{key:"getScene",value:function(){return this.viewer.scene}},{key:"getViewer",value:function(){return this.viewer}},{key:"pointIsVisible",value:function(e){var t=this.viewer.scene.camera,i=Cesium.Cartesian3.fromDegrees(e[0],e[1],0),n=t.frustum.computeCullingVolume(t.positionWC,t.directionWC,t.upWC);return n.computeVisibility(new Cesium.BoundingSphere(i))===Cesium.Intersect.INSIDE}},{key:"handleURLParameter",value:function(e){e.debug&&(this.initialized?this.setDebugMode():this.urlParameter=e)}},{key:"setDebugMode",value:function(){this.debugMode||(this.debugMode=!0,this.cesiumInspectorContainer=document.createElement("div"),this.cesiumInspectorContainer.className="cesium-viewer-cesiumInspectorContainer",this.framework.getMapContainer().appendChild(this.cesiumInspectorContainer),this.cesiumInspector=new Cesium.CesiumInspector(this.cesiumInspectorContainer,this.getScene()))}},{key:"pickPositionSupported",value:function(){return!!this.initialized&&this.viewer.scene.pickPositionSupported}},{key:"isGroundPrimitiveSupported",value:function(){return!!this.initialized&&this.viewer.scene.context.fragmentDepth}}]),t}(Ee),Vt=Gt,Bt=i(30);function Ut(e,t,i){var n=6371e3,r=Cesium.Math.toRadians(i),a=Cesium.Math.toRadians(e[1]),s=Cesium.Math.toRadians(e[0]),o=Math.asin(Math.sin(a)*Math.cos(t/n)+Math.cos(a)*Math.sin(t/n)*Math.cos(r)),l=s+Math.atan2(Math.sin(r)*Math.sin(t/n)*Math.cos(a),Math.cos(t/n)-Math.sin(a)*Math.sin(o));return[parseFloat(Cesium.Math.toDegrees(l).toFixed(5)),parseFloat(Cesium.Math.toDegrees(o).toFixed(5))]}function Wt(e,t){var i=Cesium.Math.toRadians(e[0]),n=Cesium.Math.toRadians(e[1]),r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),s=Math.sin(r-i)*Math.cos(a),o=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(r-i),l=Cesium.Math.toDegrees(Math.atan2(s,o));return l=(l+360)%360,l}function qt(e,t){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)}var Jt=new ol.Sphere(6378137);function Kt(e,t){if(e instanceof ol.geom.Polygon)return null!=t?e.getLinearRing(t):e.getLinearRings();if(e instanceof ol.geom.MultiLineString)return null!=t?e.getLineString(t):e.getLineStrings();if(e instanceof ol.geom.MultiPoint)return null!=t?e.getPoint(t):e.getPoints();if(e instanceof ol.geom.MultiPolygon)return null!=t?e.getPolygon(t):e.getPolygons();if(e instanceof ol.geom.GeometryCollection)return null!=t?e.getGeometries()[t]:e.getGeometries();throw new Error("Geometry is not a MultiGeometry")}function Zt(e,t){if(e instanceof ol.geom.Polygon&&t instanceof ol.geom.LinearRing)e.appendLinearRing(t);else if(e instanceof ol.geom.MultiLineString&&t instanceof ol.geom.LineString)e.appendLineString(t);else if(e instanceof ol.geom.MultiPoint&&t instanceof ol.geom.Point)e.appendPoint(t);else{if(!(e instanceof ol.geom.MultiPolygon&&t instanceof ol.geom.Polygon))throw new Error("Geometry is not a MultiGeometry");e.appendPolygon(t)}}var Qt=new Cesium.Cartesian2,Xt=new Cesium.Cartesian2,$t=new Cesium.Cartesian2,ei=new Cesium.Cartesian3,ti=new Cesium.Cartesian3,ii=new Cesium.Cartesian3;function ni(e,t,i){ei=Cesium.Cartesian3.fromElements(t[0]-e[0],t[1]-e[1],t[2]-e[2],ei),ei.equals(Cesium.Cartesian3.ZERO)&&(ei=Cesium.Cartesian3.fromElements(1,1,1,ei)),ei=Cesium.Cartesian3.normalize(ei,ei),ti=Cesium.Cartesian3.fromElements(i[0]-e[0],i[1]-e[1],i[2]-e[2],ti);var n=Cesium.Cartesian3.dot(ei,ti);return ei=Cesium.Cartesian3.multiplyByScalar(ei,n,ei),[ei.x+e[0],ei.y+e[1],ei.z+e[2]]}function ri(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function ai(e,t){return ei=Cesium.Cartesian3.fromElements(e[0],e[1],e[2],ei),ti=Cesium.Cartesian3.fromElements(t[0],t[1],t[2],ti),Cesium.Cartesian3.distance(ei,ti)}function si(e,t,i,n){ei=Cesium.Cartesian3.fromElements(t[0]-e[0],t[1]-e[1],t[2]-e[2],ei),ti=Cesium.Cartesian3.fromElements(i[0]-e[0],i[1]-e[1],i[2]-e[2],ti),ii=Cesium.Cartesian3.fromElements(i[0]-t[0],i[1]-t[1],i[2]-i[2],ii);var r=Cesium.Cartesian3.magnitude(ei);return!(r<Cesium.Cartesian3.magnitude(ti)||r<Cesium.Cartesian3.magnitude(ii))&&(ei=Cesium.Cartesian3.normalize(ei,ei),ti=Cesium.Cartesian3.normalize(ti,ti),ei.equalsEpsilon(ti,n||Cesium.Math.EPSILON5))}function oi(e,t,i,n){Qt=Cesium.Cartesian2.fromElements(t[0]-e[0],t[1]-e[1],Qt),Xt=Cesium.Cartesian2.fromElements(i[0]-e[0],i[1]-e[1],Xt),$t=Cesium.Cartesian2.fromElements(i[0]-t[0],i[1]-t[1],$t);var r=Cesium.Cartesian2.magnitude(Qt);return!(r<Cesium.Cartesian2.magnitude(Xt)||r<Cesium.Cartesian2.magnitude($t))&&(Qt=Cesium.Cartesian2.normalize(Qt,Qt),Xt=Cesium.Cartesian2.normalize(Xt,Xt),Qt.equalsEpsilon(Xt,n||Cesium.Math.EPSILON5))}function li(e,t){var i=R.mercatorToWgs84(e);return ei=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),ti=t.globe.ellipsoid.geodeticSurfaceNormal(ei,ti),ti=Cesium.Cartesian3.cross(t.camera.rightWC,ti,ti),ti=Cesium.Cartesian3.normalize(ti,ti),Cesium.Plane.fromPointNormal(ei,ti)}function ci(e,t){var i=R.mercatorToWgs84(e);return ei=Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),ti=t.globe.ellipsoid.geodeticSurfaceNormal(ei,ti),Cesium.Plane.fromPointNormal(ei,ti)}function ui(e,t){var i=t||e.getCoordinates(),n=null;return e instanceof ol.geom.Point?n=[i]:e instanceof ol.geom.LineString?n=i:e instanceof ol.geom.Polygon?n=i.reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.MultiPoint?n=i:e instanceof ol.geom.MultiLineString?n=i.reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.MultiPolygon?n=i.reduce(function(e,t){return e.concat(t)}).reduce(function(e,t){return e.concat(t)}):e instanceof ol.geom.Circle?n=i:e instanceof ol.geom.GeometryCollection&&(n=e.getGeometries().map(function(e,t){return ui(e,i[t])}).reduce(function(e,t){return e.concat(t)})),n}function hi(e,t,i){var n=-1/0,r=1/0,a=e.getGeometry();if(a){var s=ui(a),o=s.length;while(o--)3===s[o].length&&(n=s[o][2]>n?s[o][2]:n,r=s[o][2]<r?s[o][2]:r);if(!i&&"sphere"===e.get("olcs.circle_type")&&a instanceof ol.geom.Circle){var l=a.getCoordinates();R.mercatorToWgs84(l[0],!0),R.mercatorToWgs84(l[1],!0);var c=Jt.haversineDistance(l[0],l[1]),u=l[0][2]||0;n=u+c>n?u+c:n,r=u-c<r?u-c:r}}if(r=r===1/0?0:r,!i){var h=e.get("olcs_extrudedHeight");if(!h){var d=e.get("olcs_storeyHeight")||t,m=e.get("olcs_storeyNumber");d&&m&&(h=m*d)}var f=e.get("olcs_groundLevel");h&&(r=f||r),Array.isArray(h)||h&&(h>0?(n=f||n,n=r+h>n?r+h:n):(n=r>n?r:n,r=r+h<r?r+h:r))}return{max:r>n?r:n,min:r}}function di(e,t,i,n){function r(e){var r=e.length;while(r--)null==e[r][2]||n?e[r][2]=i:e[r][2]+=t;return e}var a=e.getCoordinates(),s=ui(e,a);r(s),e.setCoordinates(a)}function mi(e){e.unset("olcs_groundLevel",!0);var t=ne.getInstance().getActiveMap();if(t instanceof Vt){var i=e.getGeometry();if(i){var n=i.getCoordinates(),r=ui(i,n);return t.getHeightFromTerrain(r).then(function(){i.setCoordinates(n)})}}return Promise.resolve()}function fi(e){e.set("olcs_altitudeMode","clampToGround")}function yi(e){return e instanceof ol.geom.Circle?ol.geom.Polygon.fromCircle(e):(e instanceof ol.geom.Polygon&&e.unset("_vcsGeomType"),e)}function gi(e,t){var i=Jt.offset(R.mercatorToWgs84(e),t,Math.PI/2),n=R.wgs84ToMercator(i),r=e[0]-n[0],a=e[1]-n[1],s=r*r,o=a*a,l=Math.sqrt(s+o);return new ol.geom.Circle(e,l,"XYZ")}function vi(e){for(var t=0,i=0;i<e.length;i++){var n=i+1;n>=e.length&&(n=0);var r=e[i],a=e[n],s=qt(r,a);s>t&&(t=s)}return t}function pi(e,t){var i=vi(t.groundCoordinates),n=Math.PI/3,r=e.getViewport(),a={height:r.offsetHeight,width:r.offsetWidth},s=a.width/a.height,o=2*Math.atan(Math.tan(.5*n)/s),l=i/t.size[0];return{size:a,fovy:o,metersPerUnit:l}}function _i(e,t,i){var n=e instanceof ol.geom.Circle?ol.geom.Polygon.fromCircle(e):e,r=n.getCoordinates(),a=ui(n,r),s=ol.proj.getTransform(ol.proj.get("EPSG:4326"),i.projection),o=a.map(function(e){return R.mercatorToWgs84(e,!0),Cesium.Cartographic.fromDegrees(e[0],e[1])});return Cesium.sampleTerrainMostDetailed(i.terrainProvider,o).then(function(e){return a.forEach(function(e){return s(e,e,3)}),e.forEach(function(e,t){var n=i.transformRealWorld2Image(a[t],e.height);a[t][0]=n[0],a[t][1]=n[1]}),t.setCoordinates(r),t})}function bi(e,t,i){var n=e.getCoordinates(),r=ol.proj.get("EPSG:3857"),a=ui(e,n),s=a.map(function(e){return Object(Bt["e"])(i,e,{dataProjection:r}).then(function(t){e[0]=t.coords[0],e[1]=t.coords[1],e[2]=t.coords[2]})});return Promise.all(s).then(function(){return t.setCoordinates(n),t})}var Li=i(645),Mi=i(540),ki=i(541),wi=i(114),Ti=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.layer=e.layer||null,i.suppressPublish=!1,i}return w(t,e),Object(m["a"])(t,[{key:"activateWithViewPoint",value:function(e,t){var i=this;return this.state===wi["a"].STATE.INACTIVE&&(this.state=wi["a"].STATE.LOADING,this.olMap=e,t)?this.setViewPoint(t).then(function(){i.state=wi["a"].STATE.ACTIVE}):Promise.resolve(this.state)}},{key:"setImageOnMap",value:function(e,i){var n=this,r=!this.suppressPublish&&(!this.currentImage||this.currentImage.name!==e);return Se(b(t.prototype),"setImageOnMap",this).call(this,e,i).then(function(){r&&ne.getInstance().publish(B.OBLIQUE_IMAGE_CHANGED,n.layer,n.currentImage)})}},{key:"setViewPoint",value:function(e){var t=this,i=e.getGroundPosition();i||(i=e.getCameraPosition());var n=ol.proj.transform(i,R.createGeographicProjection().getProjection(),this.projection),r=this.getImageNameForCoordinates(n);if(null!=r){var a=i[2]||!this.terrainProvider?Promise.resolve([n]):Object(Bt["c"])(this.terrainProvider,[n],this.projection);return a.then(function(e){var i=Object(Ie["a"])(e,1),n=i[0];return t.setImageOnMap(r,n)}).catch(function(){return t.setImageOnMap(r,n)}).then(function(){var i=e.getDistance();i||(i=e.getCameraPosition()?e.getCameraPosition()[2]:1e3);var n=pi(t.olMap,t.currentImage),r=n.size,a=n.fovy,s=n.metersPerUnit,o=2*i*Math.tan(a/2),l=o/s,c=l/r.height,u=t.currentView.view;u.setResolution(u.constrainResolution(c))})}return Promise.reject(new Error("could not find an image in this direction"))}},{key:"canShowViewpoint",value:function(e){var t=e.getGroundPosition();t||(t=e.getCameraPosition());var i=ol.proj.transform(t,R.createGeographicProjection().getProjection(),this.projection),n=this.getImageNameForCoordinates(i);if(null!=n){var r=this.images[n],a=ol.extent.boundingExtent(r.groundCoordinates);return ol.extent.containsCoordinate(a,i)}return!1}}]),t}(wi["a"]),Si=Ti,Oi=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.layer=e.layer,i.directions={},i}return w(t,e),Object(m["a"])(t,[{key:"handleMetadataResponse",value:function(e,t){var i=Li["a"].getVersion(e);i.version>=3.5||3.4===i.version&&i.buildNumber>=36?this.handleMetadataResponseV35(e,t,i):i.version>=3.1||null===i.version?this.handleMetadataResponseV34(e,t,i):console.log("Could not load Meta Data, only meta data version 3.4 and higher are supported")}},{key:"createDirection",value:function(e){return new Si(Object.assign({layer:this.layer},e))}},{key:"handleMetadataResponseV34",value:function(e,i,n){var r=this,a=[e.generalImageInfo.width,e.generalImageInfo.height],s=e.generalImageInfo["tile-resolution"],o=[e.generalImageInfo["tile-width"],e.generalImageInfo["tile-width"]];e.generalImageInfo.width&&e.generalImageInfo.height&&e.generalImageInfo["tile-resolution"]&&this.getImageMeta(i,a,s,o,n);var l=[],c=e.generalImageInfo.cameraParameter;c&&Object.keys(c).forEach(function(e){var t=new ki["a"](Object.assign({name:e},c[e]));l.push(t)});var u={};e.images&&Array.isArray(e.images)&&(e.images.forEach(function(e){var h=t.getImageOptionsFromJSON(e,l,c),d=e.width&&e.height?[e.width,e.height]:a,m=e["tile-resolution"]?e["tile-resolution"]:s,f=r.getImageMeta(i,d,m,o,n),y=new Mi["a"](Object.assign({terrainProvider:r.terrainProvider,projection:r.projection,meta:f},h));u[y.viewDirection]||(u[y.viewDirection]={direction:y.viewDirection,images:{},rTreeItems:[],footPrintFeatures:[],projection:r.projection,terrainProvider:r.terrainProvider}),u[y.viewDirection].images[y.name]=y,u[y.viewDirection].rTreeItems.push({minX:y.centerPointOnGround[0],minY:y.centerPointOnGround[1],maxX:y.centerPointOnGround[0],maxY:y.centerPointOnGround[1],name:y.name});var g=new ol.geom.Polygon([y.groundCoordinates.concat([y.groundCoordinates[0]])]);g.transform(r.projection,ol.proj.get("EPSG:3857"));var v=new ol.Feature({geometry:g});v.setId(y.name),u[y.viewDirection].footPrintFeatures.push(v)}),Object.keys(u).forEach(function(e){r.directions[e]?r.directions[e].addOptions(u[e]):r.directions[e]=r.createDirection(u[e]),r.extent=ol.extent.extend(r.extent,r.directions[e].footPrintsLayer.getSource().getExtent())}))}}],[{key:"getImageOptionsFromJSON",value:function(e,t,i){var n=h["c"][e["view-direction"]],r=e["view-directionAngle"],a=e["projection-center"],s=e.name,o=e.groundCoordinates,l=e.centerPointOnGround,c=e["camera-name"],u=t.find(function(e){return e.name===c}),d={name:s,viewDirection:n,viewDirectionAngle:r,groundCoordinates:o,centerPointOnGround:l};if(u){var m,f,y=i[c],g=Cesium.Matrix3.fromRowMajorArray((m=[]).concat.apply(m,Object(T["a"])(y["camera-matrix"]))),v=Cesium.Matrix3.inverse(g,new Cesium.Matrix3),p=Cesium.Matrix3.fromRowMajorArray((f=[]).concat.apply(f,Object(T["a"])(e["rotation-matrix"]))),_=Cesium.Matrix3.transpose(p,new Cesium.Matrix3),b=-1*y["focal-length"];Cesium.Matrix3.multiplyByScalar(v,b,v);var L=Cesium.Matrix3.multiply(_,v,new Cesium.Matrix3),M=Cesium.Matrix4.fromRotationTranslation(g,Cesium.Cartesian3.ZERO,new Cesium.Matrix4),k=Cesium.Cartesian3.fromArray(a),w=Cesium.Matrix4.fromTranslation(Cesium.Cartesian3.multiplyByScalar(k,-1,new Cesium.Cartesian3),new Cesium.Matrix4),S=Cesium.Matrix4.fromRotationTranslation(p,Cesium.Cartesian3.ZERO,new Cesium.Matrix4),O=Cesium.Matrix4.multiply(M,Cesium.Matrix4.multiply(S,w,new Cesium.Matrix4),new Cesium.Matrix4);d.projectionCenter=k,d.camera=u,d.pToRealworld=L,d.pToImage=O}return d}}]),t}(Li["a"]),Ci=Oi;function Ei(e){var t=e.getHeading(),i=h["a"].NORTH;return t>=45&&t<135?i=h["a"].EAST:t>=135&&t<225?i=h["a"].SOUTH:t>=225&&t<315&&(i=h["a"].WEST),i}Dt.OBLIQUE_OBLIQUELAYER=Dt.lastLayerId,Dt.lastLayerId+=1,B.OBLIQUE_IMAGE_CHANGED="OBLIQUE_IMAGE_CHANGED",B.OBLIQUE_DIRECTION_CHANGED="OBLIQUE_DIRECTION_CHANGED";var Ii=function(e){function t(e){var i;Object(d["a"])(this,t),e.layertype=Dt.OBLIQUE_OBLIQUELAYER,e.className=t.className,i=y(this,b(t).call(this,e));var n=e.terrain?e.terrain.url:e.terrainUrl;return i.terrainProvider=n?Nt({url:n}):null,i.sourceProjection=e.projection?new R(e.projection):new R({epsg:e.epsg,proj4:e.proj4}),i.terrainErrorThreshold=Object(u["g"])(e.terrainErrorThreshold,1),i.terrainErrorCountThreshold=Object(u["h"])(e.terrainErrorCountThreshold,3),i.obliqueCollection=new Ci({terrainProvider:i.terrainProvider,projection:i.sourceProjection.getProjection(),minZoom:e.minZoom,maxZoom:e.maxZoom,hideLevels:e.hideLevels,layer:f(i)}),i.obliqueMap=null,i.currentDirection=null,i.isDefaultObliqueLayer=i.activeOnStartup,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.ObliqueLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return this.initialized?Promise.resolve():(this.obliqueMap||(this.obliqueMap=this.framework.getMapByType("vcs.vcm.maps.Oblique"),this.obliqueMap||this.logger.warning("Oblique layer is not loading on top of an oblique map, please check: ".concat(this.name)),this.olMap=this.obliqueMap.getolMap()),this.obliqueCollection.loadData(this.url).then(function(){e.initialized=!0,e.currentDirection=e.obliqueCollection.directions[h["a"].NORTH]}))}},{key:"activate",value:function(e){if(e&&e!==this.active&&this.isSupported()){var t=this.framework.getActiveMap();return this.olMap=t.olMap,t.setObliqueLayer(this)}return Promise.resolve()}},{key:"show",value:function(e){var t=this;return this.active=!0,this.initialize().then(function(){return e?t.setViewPoint(e):t.currentDirection.activate(t.olMap,[0,0],t.obliqueCollection.options.minZoom)})}},{key:"canShowViewpoint",value:function(e){var t=this;return this.initialize().then(function(){var i=Ei(e);return!!t.obliqueCollection.directions[i]&&t.obliqueCollection.directions[i].canShowViewpoint(e)})}},{key:"hide",value:function(){this.active=!1,this.currentDirection&&this.currentDirection.deactivate()}},{key:"getExtent",value:function(){return this.extent}},{key:"getExtentOfCurrentImage",value:function(){return this.currentImage&&this.currentImage.groundCoordinates?new Ae({coordinates:ol.extent.boundingExtent(this.currentImage.groundCoordinates),epsg:this.sourceProjection.getEPSG()}):(this.logger.warning("No currentImage, cannot compute extent"),null)}},{key:"computeViewpoint",value:function(e){var t=this;if(!this.currentImage)return e?Promise.resolve(null):null;if(e)return Object(Bt["e"])(this.currentImage,this.olMap.getView().getCenter(),{dataProjection:ol.proj.get("EPSG:4326")}).then(function(e){var i=e.coords;return t._computeViewpointInternal(i)});var i=this.olMap.getView().getCenter(),n=this.currentImage.transformImage2RealWorld(i,this.currentImage.averageHeight),r=this.sourceProjection.transformTo(R.createGeographicProjection(),n);return this._computeViewpointInternal(r)}},{key:"_computeViewpointInternal",value:function(e){var t,i=(t={},Object(oe["a"])(t,h["a"].NORTH,0),Object(oe["a"])(t,h["a"].EAST,90),Object(oe["a"])(t,h["a"].SOUTH,180),Object(oe["a"])(t,h["a"].WEST,270),t),n=pi(this.olMap,this.currentImage),r=n.size,a=n.fovy,s=n.metersPerUnit,o=this.olMap.getView(),l=o.getResolution(),c=l*r.height,u=c*s,d=Math.abs(u/2/Math.tan(a/2)),m=e[2]||this.currentImage.averageHeight,f=d+m;return new V({cameraPosition:[e[0],e[1],f],groundPosition:e,heading:i[this.currentImage.viewDirection],pitch:0,roll:0,distance:d})}},{key:"setViewPoint",value:function(e){var t=this,i=Ei(e);if(this.currentDirection){if(this.currentDirection.direction===i)return this.currentDirection.state===wi["a"].STATE.ACTIVE?this.currentDirection.setViewPoint(e):this.currentDirection.activateWithViewPoint(this.olMap,e);this.currentDirection.deactivate()}return this.obliqueCollection.directions[i]&&(this.currentDirection=this.obliqueCollection.directions[i]),this.currentDirection.suppressPublish=!0,this.currentDirection.activateWithViewPoint(this.olMap,e).then(function(){t.framework.publish(B.OBLIQUE_DIRECTION_CHANGED,t,t.currentDirection),t.framework.publish(B.OBLIQUE_IMAGE_CHANGED,t,t.currentImage),t.currentDirection.suppressPublish=!1}).catch(function(e){t.logger.error(e.message),t.currentDirection.suppressPublish=!1})}},{key:"getCurrentImage",value:function(){return this.currentImage}},{key:"existsImageForViewDirection",value:function(e){var t=this.currentImage.transformRealWorld2Image(e);return!(t[0]<0||t[0]>this.currentImage.size[0]||t[1]<0||t[1]>this.currentImage.size[1])}},{key:"currentImage",get:function(){return this.currentDirection?this.currentDirection.currentImage:null}}]),t}(At),Di=Ii;B.OBLIQUE_FALLBACK_ACTIVATED="OBLIQUE_FALLBACK_ACTIVATED";var ji=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.mouseClickEvents=!1,i.activeLayer=null,i.listenerKey=null,i.mapChangeEvent=e.changeOnMoveEnd?"moveend":"postrender",i.switchThreshold=Object(u["g"])(e.switchThreshold,0),i.switchThreshold>1&&(i.switchThreshold=.2),i._switchOnEdge=null==e.switchOnEdge||e.switchOnEdge,i.switchEnabled=!0,i.supportedlayers=[Dt.OBLIQUE_OBLIQUELAYER,Dt.VECTOR,Dt.GEOJSON,Dt.WSV,Dt.CLUSTER],i.interactionsDefaultsObject={altShiftDragRotate:!1,pinchRotate:!1,shiftDragZoom:!1,doubleClickZoom:!1},i._initialViewpoint=null,i.fallbackMap=e.fallbackMap,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Oblique"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){this.olMap||(this.olMap=new ol.Map({layers:[],logo:!1,controls:[],loadTilesWhileInteracting:!0,interactions:this.getMapInteractions(),target:this.mapElement}));var t=Object.values(this.framework.getLayers()).filter(function(e){return e instanceof Di}),i=t.find(function(e){return e.isDefaultObliqueLayer})||t[0];if(!i)return Promise.reject(new Error("Could not find an oblique layer for configured oblique map"));this.setLayerLoading(i,!0);var n=Promise.resolve(!0);if(this.fallbackMap&&this._initialViewpoint){var r=this.framework.getMapByName(this.fallbackMap);r?n=i.canShowViewpoint(this._initialViewpoint):(this.logger.warning("cannot use ".concat(this.fallbackMap," as a fallback, it does not exist")),this.fallbackMap=void 0)}this.inializedPromise=n.then(function(e){return!1===e?e:i.activate(!0)}).then(function(t){return!1!==t&&(e._initialViewpoint=null,e.initialized=!0,e.olMap.on(e.mapChangeEvent,e._postRenderHandler.bind(e))),t})}return this.inializedPromise}},{key:"getOl3Map",value:function(){return this.olMap}},{key:"setObliqueLayer",value:function(e){var t=this;this.switchEnabled=!1;var i=Promise.resolve(null);if(this.activeLayer){var n=this.activeLayer;i=n.computeViewpoint(!0).then(function(e){return n.hide(),t.framework.publish(B.LAYER_CHANGED,n),t.framework.publish(B.LAYER_DEACTIVATED,n),e})}else this._initialViewpoint&&(this.olMap.updateSize(),i=Promise.resolve(this._initialViewpoint));return this.setLayerLoading(e,!0),this.activeLayer=e,i.then(function(e){return t.activeLayer.show(e)}).then(function(){t.framework.getActiveMap().setLayerLoading(e,!1),t.switchEnabled=!0,t.framework.publish(B.LAYER_CHANGED,t.activeLayer),t.framework.publish(B.LAYER_ACTIVATED,t.activeLayer)}).catch(function(i){t.activeLayer=null,t.logger.warning("could not show oblique layer ".concat(e.name)),t.logger.warning("".concat(i.message))})}},{key:"_postRenderHandler",value:function(){if(this.active&&this._switchOnEdge&&this.switchEnabled){var e=this.olMap.getView().getCenter(),t=this.activeLayer,i=t.currentImage,n=t.currentDirection,r=this.switchThreshold,a=1-r;if(!i||e[0]/i.size[0]>r&&e[0]/i.size[0]<a&&e[1]/i.size[1]>r&&e[1]/i.size[1]<a)return;if(null===i.averageHeight)return;n.postRenderHandler(e)}}},{key:"activate",value:function(e){var t,i=this;return this.show(),this.switchEnabled=!0,this.initialized?t=e?this.gotoViewPoint(e):Promise.resolve():(this._initialViewpoint=e,t=this.initialize().then(function(e){return!1!==e&&(i.show(),i.olMap.updateSize()),e})),t.then(function(t){!1===t?(i.framework.publish("OBLIQUE_FALLBACK_ACTIVATED",!0),i.framework.activateMap(i.fallbackMap,e)):i.active=!0}).catch(function(e){i.logger.warning("could not activate oblique map"),i.logger.warning("".concat(e.message))})}},{key:"getExtentOfCurrentImage",value:function(){return this.activeLayer?this.activeLayer.getExtentOfCurrentImage():(this.logger.warning("Could not compute extent, because no oblique layer is active in the map"),new Ae({coordinates:[-18924313.4349,-15538711.0963,18924313.4349,15538711.0963],epsg:"EPSG:3857"}))}},{key:"getExtent",value:function(){return this.activeLayer?this.activeLayer.getExtent():(this.logger.warning("Could not compute extent, because no oblique layer is active in the map"),new Ae({coordinates:[-18924313.4349,-15538711.0963,18924313.4349,15538711.0963],epsg:"EPSG:3857"}))}},{key:"getCurrentImage",value:function(){return this.activeLayer?this.activeLayer.currentImage:(this.logger.warning("Could not obtain currentImage, because no oblique layer is active in the map"),null)}},{key:"deactivate",value:function(){var e=this;return this.inializedPromise.then(function(){return e.active=!1,e.getViewPoint(!1,!0).then(function(t){return e.hide(),t})})}},{key:"getViewPoint",value:function(e,t){return this.activeLayer?this.activeLayer.computeViewpoint(t):this._initialViewpoint?t?Promise.resolve(this._initialViewpoint):this._initialViewpoint:t?Promise.reject(new Error("no active layer or cachedViewpoint")):null}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),this.olMap.getInteractions().forEach(function(t){t.setActive(!e)})}},{key:"gotoViewPoint",value:function(e){var t=this;return this.movementDisabled?Promise.resolve():this.activeLayer?this.fallbackMap?this.activeLayer.canShowViewpoint(e).then(function(i){return i?t.activeLayer.setViewPoint(e):Promise.resolve(!1)}):this.activeLayer.setViewPoint(e):(this.logger.warning("Can't go to viewpoint, no active oblique layer."),Promise.resolve())}},{key:"getMapInteractions",value:function(){return ol.interaction.defaults(this.interactionsDefaultsObject)}},{key:"getolMap",value:function(){return this.olMap}},{key:"pointIsVisible",value:function(e){var t=this.olMap.getView(),i=t.calculateExtent(this.olMap.getSize()),n=[i[0],i[3]];n=this.activeLayer.currentImage.transformImage2RealWorld(n);var r=[i[2],i[1]];r=this.activeLayer.currentImage.transformImage2RealWorld(r);var a=[n,r],s=R.transformCoordinates(R.createGeographicProjection(),this.activeLayer.sourceProjection,a);return ol.extent.containsXY(ol.extent.boundingExtent(s),e[0],e[1])}},{key:"requestRender",value:function(){this.initialized&&this.olMap.render()}},{key:"switchOnEdge",get:function(){return this._switchOnEdge},set:function(e){this.logger.warning("switchOnEdge is deprecated, use switchEnabled instead"),this._switchOnEdge=e}}]),t}(Ee),Pi=ji,Yi=new Cesium.Cartographic,xi=new Cesium.Cartesian3,Ai=function(e){function t(){var e;return Object(d["a"])(this,t),e=y(this,b(t).call(this)),e.activeMapHandler=e.pipeThrough,e._defaultActive=me.ALL,e._defaultModificationKey=de.ALL,e.setActive(),e}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.activeMapHandler(e)}},{key:"handleMapChange",value:function(e){this.activeMapHandler=e instanceof Vt?t.cesiumHandler.bind(null,e):e instanceof Pi?t.obliqueHandler.bind(null,e):this.pipeThrough}}],[{key:"cesiumHandler",value:function(e,t){var i=e.getScene();return t.ray=i.camera.getPickRay(t.windowPosition),xi=i.globe.pick(t.ray,i,xi),xi?(Yi=Cesium.Cartographic.fromCartesian(xi,i.globe.ellipsoid,Yi),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Yi.longitude),Cesium.Math.toDegrees(Yi.latitude),Yi.height],!0)):(xi=new Cesium.Cartesian3,t.position=[0,0,0]),t.positionOrPixel=t.position,Promise.resolve(t)}},{key:"obliqueHandler",value:function(e,t){if(e.activeLayer&&e.activeLayer.currentImage){var i=t.type&(me.MOVE^me.DRAGEVENTS),n=t.position.slice(0,2);return Object(Bt["e"])(e.activeLayer.currentImage,n,{dontUseTerrain:!!i,dataProjection:R.createMercatorProjection().getProjection()}).then(function(e){return t.obliqueParameters={pixel:n},t.position=e.coords,t.obliqueParameters.estimate=e.estimate,t})}return t.stopPropagation=!0,Promise.resolve(t)}}]),t}(pe),Fi=Ai,Ni=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.ol3map=null,i.listenerKey=null,i.fixedNorthOrientation=null==e.fixedNorthOrientation||e.fixedNorthOrientation,i.supportedlayers=[Dt.TMSBase,Dt.VECTOR,Dt.CLUSTER,Dt.WSV,Dt.WMS,Dt.WMTS,Dt.GEOJSON,Dt.IMAGE,Dt.OPENSTREETMAP,Dt.TILED_LAYER],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.maps.Openlayers"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=[];this.ol3map=new ol.Map({layers:e,logo:!1,controls:[],interactions:ol.interaction.defaults({altShiftDragRotate:!1,pinchRotate:!1,shiftDragZoom:!1,doubleClickZoom:!1}),loadTilesWhileInteracting:!0,target:this.mapElement,view:new ol.View({center:[1230922.6203948376,6350766.117974091],zoom:13})}),this.initialized=!0}}},{key:"activate",value:function(e){return this.active=!0,this.show(),this.initialize(),e&&(this.fixedNorthOrientation&&e.setHeading(0),this.gotoViewPoint(e)),this.ol3map.updateSize(),Promise.resolve()}},{key:"getViewPoint",value:function(e,t){var i=this.ol3map.getView(),n=i.getCenter(),r=ol.proj.getTransform(i.getProjection(),"EPSG:4326"),a=Math.PI/3,s=this.ol3map.getViewport(),o={};o.height=s.offsetHeight,o.width=s.offsetWidth;var l=o.width/o.height,c=2*Math.atan(Math.tan(.5*a)/l),u=r(n.slice(0,2)),h=i.getProjection().getMetersPerUnit(),d=i.getResolution(),m=d*o.height,f=Math.cos(Math.abs(Cesium.Math.toRadians(u[1]))),y=m*h*f,g=Math.abs(y/2/Math.tan(c/2)),v=-Cesium.Math.toDegrees(i.getRotation()),p=u,_=-90,b=new V({groundPosition:p,pitch:_,heading:v,distance:g});return t?Promise.resolve(b):b}},{key:"disableMovement",value:function(e){Se(b(t.prototype),"disableMovement",this).call(this,e),this.ol3map.getInteractions().forEach(function(t){t.setActive(!e)})}},{key:"gotoViewPoint",value:function(e){if(!this.movementDisabled){var t=this.ol3map.getView(),i=ol.proj.getTransform("EPSG:4326",t.getProjection()),n=[];n=e.getGroundPosition()?e.getGroundPosition().slice(0,2):e.getCameraPosition().slice(0,2);var r=e.getDistance();null==r&&(r=e.getCameraPosition()[2]);var a=i(n),s=Math.PI/3,o=this.ol3map.getViewport(),l={};l.height=o.offsetHeight?o.offsetHeight:1,l.width=o.offsetWidth?o.offsetWidth:1;var c=l.width/l.height,u=2*Math.atan(Math.tan(.5*s)/c),h=2*r*Math.tan(u/2),d=t.getProjection().getMetersPerUnit(),m=Math.cos(Math.abs(Cesium.Math.toRadians(n[1]))),f=h/d/m,y=f/l.height;if(e.getAnimate()){var g=0;this.fixedNorthOrientation||null==e.getHeading()||(g=-Cesium.Math.toRadians(e.getHeading())),t.animate({duration:100,center:a,source:t.getCenter(),easing:ol.easing.inAndOut,resolution:y,rotation:g})}else t.setCenter(a),t.setResolution(y),this.fixedNorthOrientation||null==e.getHeading()||t.setRotation(-Cesium.Math.toRadians(e.getHeading()))}}},{key:"getolMap",value:function(){return this.ol3map}},{key:"getOl3Map",value:function(){return this.ol3map}},{key:"pointIsVisible",value:function(e){var t=this.ol3map.getView(),i=t.calculateExtent(this.ol3map.getSize()),n=ol.proj.getTransform(t.getProjection(),"EPSG:4326"),r=[i[0],i[3]],a=[i[2],i[1]],s=[n(r),n(a)];return ol.extent.containsXY(ol.extent.boundingExtent(s),e[0],e[1])}},{key:"requestRender",value:function(){this.initialized&&this.ol3map.render()}}]),t}(Ee),Hi=Ni;i(696);function Ri(e,t,i,n){var r=1e-6,a=[0,0,0],s=[0,0,0],o=[0,0,0],l=[0,0,0],c=[0,0,0];function u(e,t,i){var n=t[0],r=t[1],a=t[2],s=i[0],o=i[1],l=i[2];return e[0]=r*l-a*o,e[1]=a*s-n*l,e[2]=n*o-r*s,e}function h(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}h(a,n[1],n[0]),h(s,n[2],n[0]),u(l,i,s);var m=d(a,l);if(m<r)return null;h(o,t,n[0]);var f=d(o,l);if(f<0||f>m)return null;u(c,o,a);var y=d(i,c);if(y<0||f+y>m)return null;var g=d(s,c)/m;return e[0]=t[0]+g*i[0],e[1]=t[1]+g*i[1],e[2]=t[2]+g*i[2],e}function zi(e){var t=4;e||console.error("b3dmBuffer is not defined.");var i=new Uint8Array(e),n=Cesium.getStringFromTypedArray(i,0,4);"b3dm"!==n&&console.error('Invalid magic, expected "b3dm", got: "'.concat(n,'".'));var r=new DataView(e),a=4,s=r.getUint32(a,!0);1!==s&&console.error('Invalid version, only "1" is valid, got: "'.concat(s,'".')),a+=t;var o=r.getUint32(a,!0);a+=t;var l=r.getUint32(a,!0);a+=t;var c=r.getUint32(a,!0);a+=t;var u=r.getUint32(a,!0);a+=t;var h,d=r.getUint32(a,!0);a+=t,u>=570425344?(a-=2*t,h=l,u=c,d=0,l=0,c=0):d>=570425344&&(a-=t,h=u,u=l,d=c,l=0,c=0),a+=u,a+=d,a+=l,a+=c,0!==d&&console.error("The length of the binary BatchTable is not zero, currently only JSON based BatchTables are supported");var m=new Uint8Array(e,a,o-a);return{header:{magic:n,version:s,batchLength:h},batchTable:null,binaryGLTF:m}}function Gi(e){var t=4;function i(e){var t=Cesium.getMagic(e);return"glTF"===t}i(e)||console.error("bgltf is not a valid Binary glTF file.");var n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t,a=n.getUint32(r,!0);if(1!==a&&2!==a&&console.error("Only Binary glTF version 1 is supported.  Version ".concat(a," is not.")),1===a){r+=t;var s=n.getUint32(r,!0);console.log("len",s),r+=t;var o=n.getUint32(r,!0);r+=t;var l=n.getUint32(r,!0);0!==l&&console.error("content format should be 0 (-> JSON)");var c=20+o;r+=t;var u=r,h=u+o,d=Cesium.getStringFromTypedArray(e,u,o),m=e.subarray(c,s);return{glTF:JSON.parse(d),binaryOffset:h,binaryData:m,version:a,contentLength:o}}var f=null;r+=t;var y,g=n.getUint32(r,!0),v=12;while(v<g){var p=new DataView(e.buffer,e.byteOffset+v,8),_=p.getInt32(0,!0),b=p.getInt32(4,!0);v+=8;var L=e.subarray(v,v+_);if(v+=_,1313821514===b){var M=Cesium.getStringFromTypedArray(L);f=JSON.parse(M)}else 5130562===b&&(y=L)}return{glTF:f,version:a,binaryData:y}}function Vi(e){var t=[],i=e.meshes;for(var n in i)if(i.hasOwnProperty(n))for(var r=i[n].primitives,a=0;a<r.length;a++){var s=r[a].mode;if(4==s){var o=r[a].attributes.POSITION,l=e.accessors[o],c=l.bufferView,u=void 0!==r[a].attributes.BATCHID&&null!==r[a].attributes.BATCHID?r[a].attributes.BATCHID:r[a].attributes._BATCHID,h=e.accessors[u],d=h.bufferView,m={positionAccessor:l,positionBufferView:e.bufferViews[c],batchIdAccessor:h,batchIdBufferView:e.bufferViews[d]};t.push(m)}else console.log("Unknown mode: ".concat(s))}return t}function Bi(e){for(var t=[],i=0;i<e.length;i+=3){var n=[];n.push(e[i]),n.push(e[i+1]),n.push(e[i+2]),t.push(n)}return t}function Ui(e,t,i,n,r,a){var s=new Array(3),o=new Cesium.Matrix4,l=(new Cesium.Matrix4,Object.keys(a.glTF.nodes));o=Cesium.Matrix4.fromArray(a.glTF.nodes[l[0]].matrix,0,o);for(var c=0;c<3;c++)s[c]=e.getFloat32(t+i*c,!0);var u=new Cesium.Cartesian3;u=Cesium.Matrix4.multiplyByPoint(o,new Cesium.Cartesian3(s[0],s[1],s[2]),u);var h=Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationX(Cesium.Math.PI_OVER_TWO)),d=new Cesium.Cartesian3;d=Cesium.Matrix4.multiplyByPoint(h,u,d);var m=Cesium.Cartesian3.fromArray(r.center,0),f=new Cesium.Cartesian3;return f=Cesium.Cartesian3.add(m,d,f),[f.x,f.y,f.z]}function Wi(e,t,i,n){function r(e){var t=e.componentType;switch(t){case 5120:case 5121:return 1;case 5122:case 5123:return 2;case 5126:return 4}}for(var a=i.glTF.extensions.CESIUM_RTC,s=(Cesium.Cartographic.fromCartesian(new Cesium.Cartesian3(a.center[0],a.center[1],a.center[2])),i.contentLength,[]),o=0;o<t.length;o++){var l=t[o];if(l.batchIdAccessor.min[0]<=n&&l.batchIdAccessor.max[0]>=n){var c=r(l.positionAccessor),u=r(l.batchIdAccessor),h=void 0,d=void 0;1===i.version?(h=null!=l.positionAccessor.byteStride?l.positionAccessor.byteStride:c,d=null!=l.batchIdAccessor.byteStride?l.batchIdAccessor.byteStride:u):(h=null!=l.positionBufferView.byteStride?l.positionBufferView.byteStride:c,d=null!=l.batchIdBufferView.byteStride?l.batchIdBufferView.byteStride:u);for(var m=l.positionBufferView,f=l.batchIdBufferView,y=new DataView(i.binaryData.buffer,i.binaryData.byteOffset+f.byteOffset,f.byteLength),g=new DataView(i.binaryData.buffer,i.binaryData.byteOffset+m.byteOffset,m.byteLength),v=null!=l.positionAccessor.byteOffset?l.positionAccessor.byteOffset:0,p=0,_=l.batchIdAccessor.byteOffset;p<l.batchIdAccessor.count;p++,_+=d){var b=y.getUint16(_,!0);if(b===n){var L=Ui(g,v+p*h,c,h,a,i);s.push(L)}}}}return s}function qi(e,t){function i(e,t){var i,n=0;for(i=0;i<e.length;i++)n+=Math.pow(e[i]-t[i],2);return n}for(var n,r=99999999999,a=0;a<t.length;a++){var s=Ri([],e.origin,e.direction,t[a]);if(null!=s){var o=i(e.origin,s);r>=o&&(r=o,n=s)}}return null==n?(console.error("No intersection found!"),null):n}function Ji(e,t,i,n){return Cesium.Resource.fetchArrayBuffer({url:e}).then(function(e){var r=zi(e),a=r.binaryGLTF,s=Gi(a),o=Vi(s.glTF),l=Wi(a,o,s,t),c=Bi(l),u={origin:[i.origin.x,i.origin.y,i.origin.z],direction:[i.direction.x,i.direction.y,i.direction.z]},h=qi(u,c);if(h)return Cesium.Cartesian3.fromElements(h[0],h[1],h[2],n)}).otherwise(function(e){console.error(e)})}var Ki,Zi=i(665),Qi=i.n(Zi),Xi=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.specificImpl={},i.active=i.activeOnStartup,i.options.commonLayer=f(i),i}return w(t,e),Object(m["a"])(t,[{key:"getImplementation",value:function(e){var t=e.id;return this.specificImpl[t]||(this.specificImpl[t]=this.getImplementationObject(e.className)),this.specificImpl[t]}},{key:"getImplementationObject",value:function(e){return Ee.specificLayerImpl[e]&&Ee.specificLayerImpl[e][this.className]?new Ee.specificLayerImpl[e][this.className](this.options):null}},{key:"isCommonLayer",value:function(){return!0}},{key:"initialize",value:function(){this.initialized=!0}},{key:"synchronizeImplementations",value:function(e,t){var i=Promise.resolve();if(e){var n=this.getImplementation(e);n&&(i=i.then(function(){return n.mapDeactivated(e)}))}if(t){var r=this.getImplementation(t);r&&(i=i.then(function(){return r.mapActivated(t)}))}return i}},{key:"activate",value:function(e){var t=this;return new Promise(function(i){var n=t.framework.getActiveMap(),r=t.getImplementation(n);if(r&&t.isSupported(n)){var a=r.initialized;if(e!==r.isActive())if(e){var s=r.initialize();if(s){var o=function(){this.initialize(),r.show(),this.sendLayerEvents(e,a),i()}.bind(t);s.then(o).catch(o)}else t.initialize(),r.show(),t.sendLayerEvents(e,a),i()}else{for(var l in t.specificImpl)t.specificImpl[l]&&t.specificImpl[l].initialized&&t.specificImpl[l].hide();t.sendLayerEvents(e,a),i()}else i()}else if(e)i();else{for(var l in t.specificImpl)t.specificImpl[l]&&t.specificImpl[l].initialized&&t.specificImpl[l].hide();t.sendLayerEvents(e,a),i()}})}},{key:"setStyle",value:function(e,i){Se(b(t.prototype),"setStyle",this).call(this,e,i),Object.values(this.specificImpl).forEach(function(e){e&&e.updateStyle(i)})}},{key:"sendLayerEvents",value:function(e,t){(e!==this.active||!t&&e)&&(this.active=e,e?this.framework.publish(B.LAYER_ACTIVATED,this):this.framework.publish(B.LAYER_DEACTIVATED,this),this.framework.publish(B.LAYER_CHANGED,this))}},{key:"dispose",value:function(){for(var e in this.specificImpl)this.specificImpl[e]&&this.specificImpl[e].dispose();this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}}]),t}(At),$i=Xi,en=he.interactionTypeCounter,tn={NONE:en=he.getNextBit(en),SELECT:en=he.getNextBit(en),TRANSLATE:en=he.getNextBit(en),ROTATE:en=he.getNextBit(en),SCALE:en=he.getNextBit(en),CREATE:en=he.getNextBit(en),EDIT:en=he.getNextBit(en),REMOVEVERTEX:en=he.getNextBit(en),TRANSLATEVERTEX:en=he.getNextBit(en),PAINTBUCKET:en=he.getNextBit(en),PIPETTE:en=he.getNextBit(en),FEATUREMODES:0,GEOMETRYMODES:0,PROPAGATEONSELECT:0};tn.FEATUREMODES=tn.SELECT|tn.TRANSLATE|tn.ROTATE|tn.SCALE|tn.PAINTBUCKET|tn.PIPETTE,tn.GEOMETRYMODES=tn.CREATE|tn.EDIT|tn.REMOVEVERTEX|tn.TRANSLATEVERTEX,tn.PROPAGATEONSELECT=tn.TRANSLATE|tn.PAINTBUCKET|tn.PIPETTE;var nn={EDITING:en=he.getNextBit(en),EDITABLE:en=he.getNextBit(en),VERTEX:en=he.getNextBit(en),HEIGHTVERTEX:en=he.getNextBit(en)},rn={none:tn.NONE,select:tn.SELECT,translate:tn.TRANSLATE,rotate:tn.ROTATE,scale:tn.SCALE,create:tn.CREATE,edit:tn.EDIT,removeVertex:tn.REMOVEVERTEX,translateVertex:tn.TRANSLATEVERTEX,paintBucket:tn.PAINTBUCKET,pipette:tn.PIPETTE,geometryModes:tn.GEOMETRYMODES,featureModes:tn.FEATUREMODES},an={CLAMP:1,ABSOLUTE:2,ZPLANE:4},sn={clampToGround:an.CLAMP,absolute:an.ABSOLUTE,zPlane:an.ZPLANE},on={both:Cesium.ClassificationType.BOTH,terrain:Cesium.ClassificationType.TERRAIN,cesium3DTile:Cesium.ClassificationType.CESIUM_3D_TILE},ln=(Ki={},Object(oe["a"])(Ki,on.both,"both"),Object(oe["a"])(Ki,on.terrain,"terrain"),Object(oe["a"])(Ki,on.cesium3DTile,"cesium3DTile"),Ki);function cn(e,t){if(e.image&&e.image.src&&/^data:/.test(e.image.src))if(t){var i=t.indexOf(e.image.src);-1===i&&(t.push(e.image.src),i=t.length-1),e.image.src=":".concat(i)}else e.image={radius:5};return e}function un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e[ne.configContentSymbol]?t.style=e.getReference():e instanceof gt?t.style=cn(e.getOptions(),t.embeddedIcons):e instanceof Tt&&(t.style=e.getOptions()),t}var hn=un;Dt.VECTOR=Dt.lastLayerId++,B.FEATURE_REMOVED="FEATURE_REMOVED";var dn=Symbol("alreadyTransformedToMercator"),mn=Symbol("alreadyTransformedToImage"),fn=Symbol("imageGeometryChanged"),yn=Symbol("obliqueGeometry"),gn=Symbol("doNotTransform"),vn=Symbol("OriginalFeature"),pn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype?e.layertype:Dt.VECTOR,e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.source=new ol.source.Vector({}),i.projection=new R(e.projection),i.maxResolution=null!=e.maxResolution?e.maxResolution:null,i.minResolution=null!=e.minResolution?e.minResolution:null,i.dontUseTerrainForOblique=!!e.dontUseTerrainForOblique,i.sourceProjection=i.projection.getProjection(),i._altitudeMode=e.altitudeMode||"relativeToGround",i._skirt=Object(u["g"])(e.skirt,null),i._storeyHeight=Object(u["g"])(e.storeyHeight,null),i._classificationType=e.classificationType,i.balloonHeightOffset=Object(u["h"])(e.balloonHeightOffset,10),i.zIndex=Object(u["h"])(e.zIndex,50),i.zCoordinateEyeOffset=Object(u["h"])(e.zCoordinateEyeOffset,0),i.heightAboveGround=null!=e.heightAboveGround?e.heightAboveGround:null,i.scaleByDistance=e.scaleByDistance||null,i.internalProjection=R.createMercatorProjection(),i.destinationProjection=i.internalProjection.getProjection(),i.highlightStyle=e.highlightStyle?new gt(e.highlightStyle):null,i.featureVisibility=e.featureVisibility||new Ct,i.hasFeatureUUID=!1,i.visibility=!0,i.isDynamic=e.isDynamic,i.FVlastUpdated=0,i._onStyleChangeRemover=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Vector"}},{key:"alreadyTransformedToMercator",get:function(){return dn}},{key:"alreadyTransformedToImage",get:function(){return mn}},{key:"imageGeometryChanged",get:function(){return fn}},{key:"obliqueGeometry",get:function(){return yn}},{key:"doNotTransform",get:function(){return gn}},{key:"originalFeatureSymbol",get:function(){return vn}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._trackStyleChanges()}},{key:"getVcsMeta",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={version:Yt};if(this.skirt&&(t.skirt=this.skirt),this.storeyHeight&&(t.storeyHeight=this.storeyHeight),this.classificationType&&(t.classificationType=this.classificationType),this.altitudeMode&&(t.altitudeMode=this.altitudeMode),e.embedIcons&&(t.embeddedIcons=[]),e.writeStyle){var i=this.getStyleOrDefaultStyle(this.options.activeStyleName||this.options.style);!e.writeDefaultStyle&&Qi()(i.getOptions(),this.style.getOptions())||hn(this.style,t)}return t}},{key:"setVcsMeta",value:function(e){e.skirt!==this.skirt&&(this.skirt=e.skirt),e.storeyHeight!==this.storeyHeight&&(this.storeyHeight=e.storeyHeight),e.altitudeMode&&e.altitudeMode!==this.altitudeMode&&(this.altitudeMode=e.altitudeMode),e.classificationType!==this.classificationType&&(this.classificationType=e.classificationType)}},{key:"getStyleOrDefaultStyle",value:function(e,i){return Se(b(t.prototype),"getStyleOrDefaultStyle",this).call(this,e,i||vt.clone())}},{key:"setStyle",value:function(e,i){var n=this;Se(b(t.prototype),"setStyle",this).call(this,e,i),this._trackStyleChanges();var r=e instanceof Tt;this.getFeatures().forEach(function(e){e[ft]&&(r?n.featureVisibility.highlightedObjects[e.getId()]&&n.featureVisibility.highlightedObjects[e.getId()].features.has(e)?n.featureVisibility.highlightedObjects[e.getId()].features.set(e,void 0):e.setStyle(void 0):e.getStyle()?n.featureVisibility.highlightedObjects[e.getId()]&&n.featureVisibility.highlightedObjects[e.getId()].features.has(e)&&n.featureVisibility.highlightedObjects[e.getId()].features.set(e,e[ft].style):e.setStyle(e[ft].style))})}},{key:"_trackStyleChanges",value:function(){var e=this;this._onStyleChangeRemover&&(this._onStyleChangeRemover(),this._onStyleChangeRemover=null);var t=this.style instanceof Tt;this._onStyleChangeRemover=this.style.styleChanged.addEventListener(function(){e.getFeatures().forEach(function(e){!t&&e[ft]||e.changed()})})}},{key:"setHighlightStyle",value:function(e){o(e,[ol.style.Style,gt,Function]),e instanceof gt?this.highlightStyle=e:(this.highlightStyle||(this.highlightStyle=new gt({})),this.highlightStyle.style=e)}},{key:"postRenderStyling",value:function(){if(this.FVlastUpdated<this.featureVisibility.lastUpdated||this.FVlastUpdated<this.globalHider.lastUpdated){if(this.visibility){for(var e=Object.keys(this.featureVisibility.highlightedObjects),t=e.length,i=0;i<t;i++){var n=e[i];if(!this.featureVisibility.hiddenObjects[n]){var r=this.getFeatureById(n);r&&(this.featureVisibility.highlightedObjects[n].features.has(r)||this.featureVisibility.highlightedObjects[n].features.set(r,r.getStyle()),r.getStyle()!==this.featureVisibility.highlightedObjects[n].style.style&&r.setStyle(this.featureVisibility.highlightedObjects[n].style.style))}}for(var a=Object.keys(this.featureVisibility.hiddenObjects),s=a.length,o=0;o<s;o++){var l=a[o],c=this.getFeatureById(l);c&&!this.featureVisibility.hiddenObjects[l].has(c)&&(c.setStyle(it.clone()),this.featureVisibility.hiddenObjects[l].add(c))}if(this.hasFeatureUUID)for(var u=Object.keys(this.globalHider.hiddenObjects),h=u.length,d=0;d<h;d++){var m=u[d],f=this.getFeatureById(m);f&&!this.globalHider.hasFeature(m,f)&&(f.setStyle(it.clone()),this.globalHider.addFeature(m,f))}}this.FVlastUpdated=Date.now()}}},{key:"getSource",value:function(){return this.source}},{key:"updateGeometryOfFeature",value:function(e,t){t=t.transform(this.sourceProjection,this.destinationProjection);var i=this.source.getFeatureById(e);i&&i.setGeometry(t)}},{key:"addFeatures",value:function(e){for(var i=[],n=null,r=this.style instanceof Tt,a=0;a<e.length;a++){if(n=e[a],null==n.getId())n.setId(Object(u["c"])());else{this.hasFeatureUUID=!0;var s=n.getId();if(s&&this.getFeatureById(s.toString())){i.push(s.toString());continue}}if(this.projection.getEPSG()!==this.internalProjection.getEPSG()){var o=n.getGeometry();o&&(o[t.alreadyTransformedToMercator]||(o.transform(this.sourceProjection,this.destinationProjection),o[t.alreadyTransformedToMercator]=!0))}this.zCoordinateEyeOffset&&!n.get("olcs_zCoordinateEyeOffset")&&n.set("olcs_zCoordinateEyeOffset",this.zCoordinateEyeOffset,!1),this.heightAboveGround&&!n.get("olcs_heightAboveGround")&&n.set("olcs_heightAboveGround",this.heightAboveGround,!1),this.scaleByDistance&&!n.get("olcs_scaleByDistance")&&n.set("olcs_scaleByDistance",this.scaleByDistance,!1),n[At.vcsLayerNameSymbol]=this.name,r&&n[ft]&&n.setStyle(),this.source.addFeature(n),i.push(n.getId())}return this.FVlastUpdated=0,i}},{key:"removeFeaturesById",value:function(e){for(var t=this.getFeaturesById(e),i=0;i<t.length;i++)this.source.removeFeature(t[i]),delete t[At.vcsLayerNameSymbol]}},{key:"removeAllFeatures",value:function(){this.source.clear()}},{key:"getFeaturesById",value:function(e){for(var t,i=[],n=null,r=0;r<e.length;r++)t=e[r],n=this.getFeatureById(t),n&&i.push(n);return i}},{key:"getFeatureById",value:function(e){-1!==String(e).indexOf("_OBLIQUE")&&(e=String(e).split("_OBLIQUE")[0]);var t=this.source.getFeatureById(e);return t}},{key:"getFeatures",value:function(){return this.source.getFeatures()}},{key:"setVisibility",value:function(e){var t=this.getImplementation(this.framework.getActiveMap());t&&t.setVisibility(e),this.visibility=e}},{key:"determineHighlightStyle",value:function(e,t){var i=t||this.source.getFeatureById(e);return i?this.highlightStyle?this.highlightStyle:this.framework.getSelectBehavior().determineDefaultVectorHighlightStyle(e,i,this):(this.logger.warning("No object found to highlight."),null)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){e=this.getFeatureById(e.getId());var n=e.getId();return this.raiseFeatureEvent(t,n,e,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){if(!(e instanceof ol.Feature))return null;var t=e.getProperties();delete t[e.getGeometryName()];var i=e.clickedPosition,n=e.getGeometry();if(n&&("Point"===n.getType()||i&&!i.exactPosition||!i&&n)){var r=ol.extent.getCenter(n.getExtent());r&&(R.mercatorToWgs84(r,!0),i={longitude:r[0],latitude:r[1]})}var a=hi(e,this.storeyHeight).max,s=!1,o=e.get("olcs_altitudeMode")||this.altitudeMode;return a&&(sn[o]===an.ABSOLUTE||e.get("olcs_extrudedHeight")||e.get("olcs_storeyNumber"))||(a=this.heightAboveGround,s=!0),a+=this.balloonHeightOffset,delete t.clickedPosition,{layerName:this.name,layerClass:this.className,attributes:Object.assign({},this._genericFeatureProperties,t),longitude:i.longitude,latitude:i.latitude,height:a,relativeToGround:s}}},{key:"isVisible",value:function(){return this.logger.deprecate("isVisible","Access the property visibility directly"),this.visibility}},{key:"getZCoordinateEyeOffset",value:function(){return this.logger.deprecate("zCoordinateEyeOffset","Access the property zCoordinateEyeOffset directly"),this.zCoordinateEyeOffset}},{key:"getHeightAboveGround",value:function(){return this.logger.deprecate("getHeightAboveGround","Access the property heightAboveGround directly"),this.heightAboveGround}},{key:"getZIndex",value:function(){return this.zIndex}},{key:"getAltitudeMode",value:function(){return this.logger.deprecate("altitudeMode","Access the property altitudeMode directly"),this.altitudeMode}},{key:"getScaleByDistance",value:function(){return this.logger.deprecate("scaleByDistance","Access the property scaleByDistance directly"),this.scaleByDistance}},{key:"getProjection",value:function(){return this.projection}},{key:"setProjection",value:function(e){this.projection=e}},{key:"getStyle",value:function(){return this.style}},{key:"getMaxResolution",value:function(){return this.maxResolution}},{key:"getMinResolution",value:function(){return this.minResolution}},{key:"altitudeMode",get:function(){return this._altitudeMode},set:function(e){this._altitudeMode=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_altitudeMode",e)})}},{key:"skirt",get:function(){return this._skirt},set:function(e){this._skirt=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_skirt",e)})}},{key:"storeyHeight",get:function(){return this._storeyHeight},set:function(e){this._storeyHeight=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_storeyHeight",e)})}},{key:"classificationType",get:function(){return this._classificationType},set:function(e){this._classificationType=e,Object.values(this.specificImpl).forEach(function(t){t.olLayer&&t.olLayer.set("olcs_classificationType",e)})}}]),t}($i),_n=pn,bn=null,Ln=new Cesium.Cartographic,Mn=new Cesium.Cartesian3,kn=new Cesium.Cartesian3,wn=function(e){function t(){var e;return Object(d["a"])(this,t),e=y(this,b(t).call(this)),e.activeMapHandler=e.pipeThrough,e._pickPosition=me.CLICK,e._pickPositionMask=-1,e.pickTranslucent=!0,e.pullPickedPosition=0,e.hitTolerance=10,e._defaultModificationKey=de.ALL,e._defaultActive=me.ALL^me.MOVE,e.setActive(),e}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.DRAG&&!(this._pickPosition&me.DRAG)?(bn&&(e.feature=bn),Promise.resolve(e)):(e.type&me.DRAGEND&&(bn=null),this.activeMapHandler(e).then(function(t){return e.type&me.DRAGSTART&&t.feature&&(bn=t.feature),e.type&me.DRAG&&bn&&(e.feature=bn),Promise.resolve(e)}))}},{key:"handleMapChange",value:function(e){this.activeMapHandler=e instanceof Hi?this._openlayersHandler.bind(this,e):e instanceof Pi?this._obliqueHandler.bind(this,e):e instanceof Vt?this._cesiumHandler.bind(this,e):this.pipeThrough}},{key:"setActive",value:function(e){"undefined"===typeof e&&(this.pickPosition=me.CLICK,this.pullPickedPosition=0),Se(b(t.prototype),"setActive",this).call(this,e)}},{key:"_openlayersHandler",value:function(e,t){var i=null,n=null;return e.ol3map.forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],function(e,t){return!e||null!=e.get("olcs_allowPicking")&&!0!==e.get("olcs_allowPicking")||(i=e,n=t),!0},{hitTolerance:this.hitTolerance}),i&&n&&(t.feature=i,i.get("features")&&(t.feature[At.vcsLayerNameSymbol]=n.get("name")),t.exactPosition=!0),Promise.resolve(t)}},{key:"_obliqueHandler",value:function(e,t){var i=null,n=null;return e.getOl3Map().forEachFeatureAtPixel([t.windowPosition.x,t.windowPosition.y],function(e,t){return e&&(i=e.get("features")&&!e[_n.originalFeatureSymbol]?e:e[_n.originalFeatureSymbol]),n=t,!0},{hitTolerance:this.hitTolerance}),i&&n&&(t.feature=i,i.get("features")&&(t.feature[At.vcsLayerNameSymbol]=n.get("name")),t.exactPosition=!0),Promise.resolve(t)}},{key:"_cesiumHandler",value:function(e,t){var i=this,n=e.getScene(),r=n.pick(t.windowPosition,this.hitTolerance,this.hitTolerance),a=function(){return Mn?(i.pullPickedPosition&&t.ray&&(kn=Cesium.Cartesian3.multiplyByScalar(t.ray.direction,i.pullPickedPosition,kn),Mn=Cesium.Cartesian3.subtract(Mn,kn,Mn)),Ln=Cesium.Cartographic.fromCartesian(Mn,n.globe.ellipsoid,Ln),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Ln.longitude),Cesium.Math.toDegrees(Ln.latitude),Ln.height],!0),t.positionOrPixel=t.position,n.pickTranslucentDepth=!1,Promise.resolve(t)):(Mn=new Cesium.Cartesian3,Promise.resolve(t))};if(r){if(r.primitive&&r.primitive.olFeature)t.feature=r.primitive.olFeature;else if(r.primitive&&r.primitive[At.vcsLayerNameSymbol]&&(r instanceof Cesium.Cesium3DTileFeature||r instanceof Cesium.Cesium3DTilePointFeature)){t.feature=r;for(var s=Object.getOwnPropertySymbols(r.primitive),o=s.length,l=0;l<o;l++)t.feature[s[l]]=r.primitive[s[l]]}else if(r.id&&r.id.olFeature)t.feature=r.id.olFeature;else if(r.id&&r.id[At.vcsLayerNameSymbol])t.feature=r,t.feature[At.vcsLayerNameSymbol]=r.id[At.vcsLayerNameSymbol];else if(Array.isArray(r.id)){if(1!==r.id.length)return Ln=Cesium.Cartographic.fromCartesian(r.primitive.position,null,Ln),t.position=R.wgs84ToMercator([Cesium.Math.toDegrees(Ln.longitude),Cesium.Math.toDegrees(Ln.latitude),Ln.height],!0),t.positionOrPixel=t.position,t.feature=new ol.Feature({geometry:new ol.geom.Point(t.position),features:r.id.map(function(e){return e.olFeature})}),t.feature[At.vcsLayerNameSymbol]=r.id[0].olLayer.get("layerName"),Promise.resolve(t);t.feature=r.id[0].olFeature}else t.feature=r;if(!(t.type&this.pickPosition))return Promise.resolve(t);if(n.pickPositionSupported)return r.primitive&&this.pickTranslucent&&(n.pickTranslucentDepth=!0,n.render(e.getViewer().clock.currentTime),t.exactPosition=!0),Mn=n.pickPosition(t.windowPosition,Mn),a();if(r.content&&r.content.url&&null!=r._batchId){var c=t.ray||n.camera.getPickRay(t.windowPosition);return Ji(r.content.url,r._batchId,c,Mn).then(function(e){return e?a():Promise.resolve(t)})}}return Promise.resolve(t)}},{key:"pickPosition",get:function(){return this._pickPosition},set:function(e){this._pickPosition=e&this._pickPositionMask}},{key:"excludedPickPositionEvents",get:function(){return~this._pickPositionMask},set:function(e){this._pickPositionMask=~e}}]),t}(pe),Tn=wn,Sn=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.events=Object.assign({},e||B),i._defaultActive=me.CLICK,i._defaultModificationKey=de.NONE|de.CTRL,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(e.key&de.CTRL){if(e.feature&&e.feature[At.vcsLayerNameSymbol]){var t=ne.getInstance().getLayerByName(e.feature[At.vcsLayerNameSymbol]);t.objectClickedHandler(e.feature,B.FEATURE_CTRL_CLICKED)}return Promise.resolve(e)}if(!e.position.every(function(e){return 0===e})){var i=R.mercatorToWgs84(e.position),n=Object(Ie["a"])(i,3),r=n[0],a=n[1],s=n[2],o={latitude:a,longitude:r,height:s||0};if(e.obliqueParameters&&(o.obliqueParameters=e.obliqueParameters),this.raise(B.CLICKED,o),e.feature&&e.feature[At.vcsLayerNameSymbol]){o.exactPosition=e.exactPosition,e.feature.clickedPosition=o;var l=ne.getInstance().getLayerByName(e.feature[At.vcsLayerNameSymbol]);l.objectClickedHandler(e.feature,B.FEATURE_CLICKED)}else this.raise(B.MAP_CLICKED,o)}return Promise.resolve(e)}},{key:"raise",value:function(e){if(this.events[e]){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=ne.getInstance()).publish.apply(t,[e].concat(n))}}}]),t}(pe),On=Sn,Cn=new Fi,En=new Tn,In=new On,Dn=new be([Cn,En,In]),jn=null,Pn=function(){function e(){var t=this;Object(d["a"])(this,e),this.listeners=[],this.clickDuration=400,this.dragDuration=100,this._lastDown=null,this._lastClick={time:null,windowPosition:new Cesium.Cartesian2},this._dragging=null,this._running=!1,this._eventQueue=[];var i=ne.getInstance();i.subscribe("MAP_ACTIVATED",this.handleMapChange,this),this.handleMapChange(ne.getInstance().getActiveMap()),Dn.initialize();var n=function(){t._dragging=null,t._lastClick.time=null,t._lastDown=null,t._multiples=!1};i.getMapContainer().addEventListener("mouseout",n),this.removeMapContainerEventListener=function(){i.getMapContainer().removeEventListener("mouseout",n)},this._exclusiveInteraction=null,this._exclusiveFrameworkKey=null,this._multiples=!1}return Object(m["a"])(e,[{key:"addExclusiveInteraction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0;return o(e,pe),o(t,Function),o(i,Number),l(n,String),this._exclusiveInteraction&&this._exclusiveInteraction.id!==n&&this._removeExclusive(),e.handleMapChange(ne.getInstance().getActiveMap()),Dn.addInteraction(e,i),this._exclusiveInteraction?(this._exclusiveInteraction.interactions.push(e),this._exclusiveInteraction.cb.push(t)):this._exclusiveInteraction={id:n||Object(u["c"])(),cb:[t],interactions:[e]},null===this._exclusiveFrameworkKey&&(this._exclusiveFrameworkKey=ne.getInstance().subscribeExclusive(B.CLICKED,function(){},"vcs:EventHandler",this._removeExclusive.bind(this))),this._exclusiveUnListen.bind(this,e,this._exclusiveInteraction.id)}},{key:"_removeExclusive",value:function(){this._exclusiveInteraction&&(this._exclusiveInteraction.interactions.filter(function(e){return e}).forEach(function(e){Dn.removeInteraction(e)}),this._exclusiveInteraction.cb.filter(function(e){return e}).forEach(function(e){e()}),this._exclusiveInteraction=null)}},{key:"_exclusiveUnListen",value:function(e,t){if(!this._exclusiveInteraction||this._exclusiveInteraction&&this._exclusiveInteraction.id!==t)return 0;var i=Dn.removeInteraction(e),n=this._exclusiveInteraction.interactions.findIndex(function(t){return t&&t.id===e.id});return n>-1&&(this._exclusiveInteraction.interactions.splice(n,1,void 0),this._exclusiveInteraction.cb.splice(n,1,void 0)),this._exclusiveInteraction.interactions.every(function(e){return void 0===e})&&(this._exclusiveInteraction=null,ne.getInstance().unsubscribeByKey(this._exclusiveFrameworkKey),this._exclusiveFrameworkKey=null),-1!==i?1:0}},{key:"addPersistentInteraction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return o(e,pe),o(t,Number),e.handleMapChange(ne.getInstance().getActiveMap()),Dn.addInteraction(e,t),function(){return-1!==Dn.removeInteraction(e)?1:0}}},{key:"handleMapChange",value:function(e){this.listeners.forEach(function(e){e()}),this.listeners.splice(0),e instanceof Hi||e instanceof Pi?this._setupOpenlayersHandlers(e):e instanceof Vt&&this._setupCesiumHandlers(e),Dn.handleMapChange(e)}},{key:"_mouseDown",value:function(e,t,i){if(this._lastDown)this._multiples=!0;else{var n=e(t,i);0===n.windowPosition.x&&0===n.windowPosition.y||(this._lastDown=n,this._lastDown.time=Date.now())}}},{key:"_mouseUp",value:function(e,t,i){var n=e(t,i);return n.multipleTouch?(this._multiples=!0,void(this._lastDown=null)):this._multiples?(this._lastDown=null,void(this._multiples=!1)):(this._dragging?(n.type=me.DRAGEND,n.key=this._dragging.key,n.pointer=this._dragging.pointer,this._startChain(n)):this._lastDown&&(this._lastClick.time&&Date.now()-this._lastClick.time<this.clickDuration&&Cesium.Cartesian2.distanceSquared(this._lastClick.windowPosition,n.windowPosition)<12?(this._lastClick.time=null,n.type=me.DBLCLICK):(this._lastClick.time=Date.now(),Cesium.Cartesian2.clone(n.windowPosition,this._lastClick.windowPosition),n.type=me.CLICK),this._startChain(n)),this._dragging=null,void(this._lastDown=null))}},{key:"_mouseMove",value:function(e,t,i){var n=e(t,i);this._lastDown?this._dragging?(n.type=me.DRAG,n.key=this._dragging.key,n.pointer=this._dragging.pointer,this._startChain(n,!0)):!this._dragging&&Date.now()-this._lastDown.time>this.dragDuration&&(n=Object.assign({type:me.DRAGSTART},this._lastDown),this._dragging=n,this._startChain(n,!0)):(n.type=me.MOVE,this._startChain(n,!0))}},{key:"_startChain",value:function(e,t){this._running&&t||(this._running?this._eventQueue.push(e):(this._running=!0,Dn.pipe(e).then(this._endChain.bind(this)).catch(this._endChain.bind(this))))}},{key:"_endChain",value:function(){this._running=!1,this._eventQueue.length>0&&this._startChain(this._eventQueue.shift())}},{key:"_setupOpenlayersHandlers",value:function(e){var t=function(e,t){var i={"-1":fe.ALL,0:fe.LEFT,1:fe.MIDDLE,2:fe.RIGHT},n=t.originalEvent.shiftKey?de.SHIFT:de.NONE;n=t.originalEvent.ctrlKey?de.CTRL:n,n=t.originalEvent.altKey?de.ALT:n,n!==de.NONE&&t.preventDefault(),t.originalEvent.preventDefault();var r=[t.coordinate[0],t.coordinate[1],0];return{position:r,positionOrPixel:r,windowPosition:Cesium.Cartesian2.fromArray(t.pixel,0,new Cesium.Cartesian2),key:n,pointer:i[t.originalEvent.button||0]}},i=e.getOl3Map(),n=[];n.push(i.on("pointerdown",this._mouseDown.bind(this,t,null))),n.push(i.on("pointerup",this._mouseUp.bind(this,t,null))),n.push(i.on("pointermove",this._mouseMove.bind(this,t,null))),this.listeners=n.map(function(e){return function(){ol.Observable.unByKey(e)}})}},{key:"_setupCesiumHandlers",value:function(e){var t,i,n=this,r=(t={},Object(oe["a"])(t,Cesium.KeyboardEventModifier.ALT,de.ALT),Object(oe["a"])(t,Cesium.KeyboardEventModifier.CTRL,de.CTRL),Object(oe["a"])(t,Cesium.KeyboardEventModifier.SHIFT,de.SHIFT),t),a=function(t,i){var n=t.mod,a=t.pointer,s=e.eventHandler._positions.length>1;return{windowPosition:i.position||i.endPosition,key:r[n]||de.NONE,pointer:a,multipleTouch:s}},s=(i={},Object(oe["a"])(i,Cesium.ScreenSpaceEventType.LEFT_DOWN,{handler:this._mouseDown,pointer:fe.LEFT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.LEFT_UP,{handler:this._mouseUp,pointer:fe.LEFT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.RIGHT_DOWN,{handler:this._mouseDown,pointer:fe.RIGHT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.RIGHT_UP,{handler:this._mouseUp,pointer:fe.RIGHT}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MIDDLE_DOWN,{handler:this._mouseDown,pointer:fe.MIDDLE}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MIDDLE_UP,{handler:this._mouseUp,pointer:fe.MIDDLE}),Object(oe["a"])(i,Cesium.ScreenSpaceEventType.MOUSE_MOVE,{handler:this._mouseMove,pointer:fe.ALL}),i);Object.keys(s).forEach(function(t){var i=Object.keys(r);i.push(void 0),i.forEach(function(i){var r=s[t],o=r.handler,l=r.pointer;null!=i?(e.eventHandler.setInputAction(o.bind(n,a,{mod:i,pointer:l}),t,i),n.listeners.push(function(){e.eventHandler.removeInputAction(t,i)})):(e.eventHandler.setInputAction(o.bind(n,a,{mod:i,pointer:l}),t),n.listeners.push(function(){e.eventHandler.removeInputAction(t)}))})})}},{key:"positionInteraction",get:function(){return Cn}},{key:"featureInteraction",get:function(){return En}},{key:"eventEmitter",get:function(){return In}},{key:"interactions",get:function(){return Dn.chain.slice()}}],[{key:"destroy",value:function(){jn&&(jn._removeExclusive(),jn.listeners.forEach(function(e){e()}),jn.removeMapContainerEventListener()),jn=null}}]),e}(),Yn=Pn;function xn(){return null===jn&&(jn=new Pn),jn}function An(e){for(var t=e.getPropertyNames(),i={},n=0;n<t.length;n++)i[t[n]]=e.getProperty(t[n]);return null==i.id&&(i.id="".concat(e.content.url).concat(e._batchId)),i.attributes?i.attributes.gmlId=i.id:null==i.gmlId&&(i.gmlId=i.id),i.clickedPosition=e.clickedPosition?e.clickedPosition:{},i}var Fn=Symbol("_lastUpdated"),Nn=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.url&&!/\.json$/.test(i.url)&&(i.url="".concat(i.url.replace(/\/$/,""),"/tileset.json")),i.featureVisibility=e.featureVisibility||new Ct,i.highlightStyle=e.highlightStyle?new gt(e.highlightStyle):null,i.jumpToLocation=!!e.jumpToLocation,i.screenSpaceError=Object(u["h"])(e.screenSpaceError,16),i.screenSpaceErrorMobile=Object(u["h"])(e.screenSpaceErrorMobile,32),i.maximumMemoryUsage=Object(u["h"])(e.maximumMemoryUsage,16);var n=e.tilesetOptions||{};return i.tilesetOptions=Object.assign({url:i.url,maximumScreenSpaceError:i.framework.isMobile()?i.screenSpaceErrorMobile:i.screenSpaceError,maximumMemoryUsage:i.maximumMemoryUsage},n),i._styleLastUpdated=Date.now(),i._loadProgressListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.AbstractCesiumTilesetLayer"}},{key:"lastUpdated",get:function(){return Fn}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;this.initialized||(this.cesium3DTileset=new Cesium.Cesium3DTileset(this.tilesetOptions),this.cesium3DTileset[At.vcsLayerNameSymbol]=this.name,this.cesium3DTileset.tileVisible.addEventListener(this.applyStyle.bind(this)),this.cesium3DTileset.tileUnload.addEventListener(function(e){delete e[t.lastUpdated]}),this.layerLoadingEventListener=function(e,t){0===e&&0===t?this.framework.getActiveMap().setLayerLoading(this,!1):this.framework.getActiveMap().setLayerLoading(this,!0)}.bind(this),this.jumpToLocation&&this.cesium3DTileset.readyPromise.then(function(t){var i=e.framework.getActiveMap();i.getCesiumWidget().camera.viewBoundingSphere(t.boundingSphere,new Cesium.HeadingPitchRange(0,-2,0)),i.getCesiumWidget().camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}),this.initialized=!0,this.setStyle(this.style))}},{key:"show",value:function(){var e=this.framework.getActiveMap();e&&"vcs.vcm.maps.Cesium"===e.className&&(e.getScene().primitives.contains(this.cesium3DTileset)||e.getScene().primitives.add(this.cesium3DTileset)),this._loadProgressListener||(this._loadProgressListener=this.cesium3DTileset.loadProgress.addEventListener(this.layerLoadingEventListener)),this.cesium3DTileset.show=!0}},{key:"hide",value:function(){this._loadProgressListener&&(this._loadProgressListener(),this._loadProgressListener=null),this.cesium3DTileset.show=!1,this.framework.getActiveMap().setLayerLoading(this,!1)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){var n=An(e);if(n)return this.raiseFeatureEvent(t,n.id,n,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=Object.assign({},this._genericFeatureProperties,e.attributes||e);return{layerName:this.name,layerClass:this.className,attributes:t,longitude:e.clickedPosition.longitude,latitude:e.clickedPosition.latitude,height:e.clickedPosition.height,relativeToGround:!1}}},{key:"getCesium3DTileset",value:function(){return this.logger.warning("Function getCesium3DTileset is deprecated and will be removed in the next release. Access the property cesium3DTileset directly instead"),this.cesium3DTileset}},{key:"setStyle",value:function(e,i){var n=this;Se(b(t.prototype),"setStyle",this).call(this,e,i),this.initialized&&(this.cesium3DTileset.style=this.style.cesiumStyle,this._onStyleChangeRemover&&this._onStyleChangeRemover(),this._onStyleChangeRemover=this.style.styleChanged.addEventListener(function(){n.cesium3DTileset.makeStyleDirty(),n._styleLastUpdated=Date.now(),n._lastUpdated=Date.now()}),this._styleLastUpdated=Date.now(),this.featureVisibility.lastUpdated=Date.now(),this.cesium3DTileset.readyPromise.then(function(){n.cesium3DTileset.colorBlendMode!==n.style.colorBlendMode&&(n.style.colorBlendMode!==Cesium.Cesium3DTileColorBlendMode.HIGHLIGHT?n.cesium3DTileset.extras&&n.cesium3DTileset.extras._3DTILESDIFFUSE&&(n.cesium3DTileset.colorBlendMode=n.style.colorBlendMode):n.cesium3DTileset.colorBlendMode=n.style.colorBlendMode)}))}},{key:"applyStyle",value:function(e){if(e.content instanceof Cesium.Composite3DTileContent)for(var t=0;t<e.content.innerContents.length;t++)this.styleContent(e.content.innerContents[t]);else this.styleContent(e.content)}},{key:"styleContent",value:function(e){if(!e[t.lastUpdated]||e[t.lastUpdated]<this.featureVisibility.lastUpdated||e[t.lastUpdated]<this.globalHider.lastUpdated||e[t.lastUpdated]<this._styleLastUpdated){for(var i=e.featuresLength,n=0;n<i;n++){var r=e.getFeature(n);if(r){var a=r.getProperty("id");a||(a="".concat(e.url).concat(n)),this.featureVisibility.highlightedObjects[a]&&((!this.featureVisibility.highlightedObjects[a].features.has(r)||this._styleLastUpdated>e[t.lastUpdated])&&this.featureVisibility.highlightedObjects[a].features.set(r,r.color.clone()),r.color=this.featureVisibility.highlightedObjects[a].style.cesiumFillColor),this.featureVisibility.hiddenObjects[a]?(this.featureVisibility.hiddenObjects[a].add(r),r.show=!1):this.globalHider.hiddenObjects[a]&&(this.globalHider.addFeature(a,r),r.show=!1)}}e[t.lastUpdated]=Date.now()}}},{key:"determineHighlightStyle",value:function(){return this.highlightStyle?this.highlightStyle:Q.getInstance()._currentItemHighlightColor}},{key:"setMaximumScreenSpaceError",value:function(e){this.cesium3DTileset&&(this.cesium3DTileset.maximumScreenSpaceError=e)}},{key:"dispose",value:function(){if(this.cesium3DTileset){this.hide();var e=this.framework.getMapByType("vcs.vcm.maps.CesiumMap"),t=!1;e&&e.initialized&&(t=e.getScene().primitives.remove(this.cesium3DTileset)),t||this.cesium3DTileset.destroy(),this.cesium3DTileset=null}this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"handleURLParameter",value:function(e){e.debug&&(this.cesium3DTileset?(this.cesium3DTileset.debugShowRenderingStatistics=!0,this.cesium3DTileset.debugShowBoundingVolume=!0,this.cesium3DTileset.debugShowContentBoundingVolume=!0):(this.tilesetOptions.debugShowRenderingStatistics=!0,this.tilesetOptions.debugShowBoundingVolume=!0,this.tilesetOptions.debugShowContentBoundingVolume=!0))}}]),t}(At),Hn=Nn;Dt.CESIUM_TILESET_LAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Rn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype||Dt.CESIUM_TILESET_LAYER,e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.pickMode=e.pickMode||"topLevelFeature",i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.CesiumTilesetLayer"}}]),t}(Hn),zn=Rn;Dt.CESIUM_BUILDINGSLAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Gn=function(e){function t(e){return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_BUILDINGSLAYER,e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Buildings"}}]),t}(zn),Vn=Gn;Dt.CESIUM_ENTITIESLAYER=Dt.lastLayerId++;var Bn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_ENTITIESLAYER,e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.dataSource=e.dataSource||new Cesium.CustomDataSource(i.name),i.entities=i.dataSource.entities,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Entities"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=this.framework.getActiveMap();e.getDatasources().add(this.dataSource),this.initialized=!0}}},{key:"getEntities",value:function(){return this.logger.deprecate("getEntities","access the entities property directly"),this.entities}},{key:"getDataSource",value:function(){return this.logger.deprecate("getEntities","access the dataSource property directly"),this.dataSource}},{key:"show",value:function(){this.dataSource.show=!0}},{key:"hide",value:function(){this.dataSource.show=!1}},{key:"dispose",value:function(){if(this.entities.removeAll(),this.initialized){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");e&&e.getDatasources().contains(this.dataSource)&&e.getDatasources().remove(this.dataSource)}this.initialized=!1,this.active=!1,this.framework.removeLayer(this)}},{key:"hideObjects",value:function(e){e.forEach(function(e){var t=this.entities.getById(e);t&&(t.show=!1)},this)}},{key:"showObjects",value:function(e){e.forEach(function(e){var t=this.entities.getById(e);t&&(t.show=!0)},this)}},{key:"addEntity",value:function(e,t,i){var n=this.entities.add(e);return n[At.vcsLayerNameSymbol]=this.name,n.attributes=t||null,n.allowPicking=null!=i?i:this.allowPicking,n.id}},{key:"flyToEntity",value:function(e){var t=this.framework.getActiveMap(),i=this.entities.getById(e);if(i){var n,r,a=t.getDataSourceDisplay(),s=t.getScene(),o=s.camera,l=new Cesium.BoundingSphere,c=t.getViewPoint(),u=c.getHeading(),h=c.getPitch(),d=new Cesium.HeadingPitchRange(Cesium.Math.toRadians(u),Cesium.Math.toRadians(h<-45?h:-45),void 0),m=0,f=a.defaultDataSource;if(f.isLoading)r=f.loadingEvent.addEventListener(function(){n=s.postRender.addEventListener(y),r()});else n=s.postRender.addEventListener(y)}else this.logger.warning("could not find entity on this layer");function y(){var e=a.getBoundingSphere(i,!0,l);if(e!==Cesium.BoundingSphereState.PENDING){if(e===Cesium.BoundingSphereState.FAILED)return m++,void(m>3&&n());o.flyToBoundingSphere(l,{duration:1,offset:d}),n()}}}},{key:"removeObjectById",value:function(e){return this.entities.removeById(e)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking&&e.id.allowPicking){var n=e.id.id,r=e.id;return r.clickedPosition=e.clickedPosition,this.raiseFeatureEvent(t,n,r,i||this),!0}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=Object.assign({},this._genericFeatureProperties,e.attributes||{});return{layerName:this.name,layerClass:this.className,attributes:t,longitude:e.clickedPosition.longitude,latitude:e.clickedPosition.latitude,height:e.clickedPosition.height,relativeToGround:!1}}}]),t}(At),Un=Bn;Dt.CESIUM_CZMLLAYER=Dt.lastLayerId++;var Wn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_CZMLLAYER,e.className=t.className,e.dataSource=new Cesium.CzmlDataSource,i=y(this,b(t).call(this,e)),i._loadedResolve=function(){},i._loadedReject=function(){},i.loaded=new Promise(function(e,t){i._loadedResolve=e,i._loadedReject=t}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Czml"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){Se(b(t.prototype),"initialize",this).call(this);var e=this.dataSource.load(this.url);return e.then(this._handleLoaded.bind(this),this._loadedReject),this.initialized=!0,e}}},{key:"_handleLoaded",value:function(){var e=this;this.entities.values.forEach(function(t){t[At.vcsLayerNameSymbol]=e.name,t.allowPicking=e.allowPicking}),this._loadedResolve()}}]),t}(Un),qn=Wn;Dt.CESIUM_GLTFLAYER=Dt.lastLayerId++;var Jn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_GLTFLAYER,e.className=t.className,i=y(this,b(t).call(this,e)),i.modelConfigs=e.models||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Gltf"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(Se(b(t.prototype),"initialize",this).call(this),this.modelConfigs.forEach(this.addObject,this))}},{key:"addObject",value:function(e){var t=this.getEntityOptionsFromModel(e);if(!t)return null;var i={uri:t.url,scale:t.scale};i=e.modelOptions?Object.assign({},e.modelOptions,i):i;var n={name:t.url,position:t.position,orientation:t.orientation,show:t.show,model:i};return this.addEntity(n,t.attributes,t.allowPicking)}},{key:"getEntityOptionsFromModel",value:function(e){var t={};if("string"!==typeof e.url)return this.logger.warning("Could not find URL for model ".concat(e)),null;t.url=e.url;var i=[e.longitude,e.latitude,e.height].every(function(e){return Number.isFinite(e)});if(!i)return this.logger.warning("Could not find longitude/latitude/height for model".concat(e)),null;t.position=Cesium.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height);var n=0;Number.isFinite(e.heading)?n=e.heading/180*Math.PI:Number.isFinite(e.rotation)&&(n=e.rotation/180*Math.PI);var r=0;Number.isFinite(e.pitch)&&(r=e.pitch/180*Math.PI);var a=0;Number.isFinite(e.roll)&&(a=e.roll/180*Math.PI);var s=new Cesium.HeadingPitchRoll(n,r,a);return t.orientation=Cesium.Transforms.headingPitchRollQuaternion(t.position,s),t.scale=1,Number.isFinite(e.scale)&&(t.scale=e.scale),t.attributes={},e.attributes&&(t.attributes=e.attributes),t.allowPicking=null==e.allowPicking||e.allowPicking,t.show=null==e.show||e.show,t}},{key:"updateEntityById",value:function(e,t){var i=this.entities.getById(e),n=this.getEntityOptionsFromModel(t);i&&n&&(i.model.scale=n.scale,i.orientation=n.orientation,i.position=n.position,i.attributes=n.attributes,i.allowPicking=n.allowPicking)}}]),t}(Un),Kn=Jn;Dt.CESIUM_POINTCLOUDLAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Zn=new Tt({}),Qn=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.CESIUM_POINTCLOUDLAYER,e.className=t.className,i=y(this,b(t).call(this,e)),i.defaultPointSize=null!=e.pointSize?e.pointSize:null,i._pointSize=i.defaultPointSize,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.PointCloud"}}]),Object(m["a"])(t,[{key:"getStyleOrDefaultStyle",value:function(e,i){return Se(b(t.prototype),"getStyleOrDefaultStyle",this).call(this,e,i||Zn)}},{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._assignPointSize()}},{key:"clearStyle",value:function(){Se(b(t.prototype),"clearStyle",this).call(this),this.pointSize=this.defaultPointSize}},{key:"setStyle",value:function(e,i){e instanceof gt?this.logger.warning("trying to apply vector style to point cloud layer."):Se(b(t.prototype),"setStyle",this).call(this,e,i)}},{key:"_assignPointSize",value:function(){this.initialized&&(this.cesium3DTileset.style?(this.cesium3DTileset.style.pointSize=this._pointSize,this.cesium3DTileset.makeStyleDirty()):null!=this._pointSize&&(this.cesium3DTileset.style=new Cesium.Cesium3DTileStyle({pointSize:this._pointSize})))}},{key:"pointSize",set:function(e){l(e,[Number,String]),this._pointSize=e,this._assignPointSize()},get:function(){return this._pointSize}}]),t}(Hn),Xn=Qn,$n=Symbol("vcsFeatureType"),er={DYNAMIC:"dynamic",STATIC:"static",EDITED:"edited"},tr=new ol.format.GeoJSON,ir="EPSG:3857",nr=new ol.Sphere(6378137),rr=Y.getLogger("vcs.vcm.layer.GeoJSONHelper");function ar(e){var t=Object(Ie["a"])(e[e.length-1],2),i=t[0],n=t[1];e[0][0]===i&&e[0][1]===n||e.push(e[0].slice())}function sr(e){var t=Object(Ie["a"])(e[e.length-1],2),i=t[0],n=t[1];e[0][0]===i&&e[0][1]===n&&e.pop()}function or(e){if(e instanceof ol.geom.Polygon){var t=e.getCoordinates();t.forEach(function(e){sr(e)}),e.setCoordinates(t)}else if(e instanceof ol.geom.MultiPolygon){var i=e.getCoordinates();i.forEach(function(e){e.forEach(function(e){sr(e)})}),e.setCoordinates(i)}}function lr(e){var t=e.crs;if(t){if("name"===t.type)return t.properties.name;if("EPSG"===t.type)return"EPSG:".concat(t.properties.code)}return null}function cr(e){if(e.get("altitudeMode")&&(e.set("olcs_altitudeMode",e.get("altitudeMode"),!0),e.unset("altitudeMode",!0)),e.get("extrudedHeight")){if(e.get("drawingType"))e.set("olcs_extrudedHeight",e.get("extrudedHeight"),!0);else{var t=hi(e).min;e.set("olcs_extrudedHeight",e.get("extrudedHeight")-t,!0)}e.unset("extrudedHeight",!0)}e.get("skirt")&&(e.set("olcs_skirt",e.get("skirt"),!0),e.unset("skirt",!0)),e.get("radius")&&e.unset("radius",!0)}function ur(e,t){var i=tr.readGeometry(e,t.formatOptions);return"EPSG:3857"===String(t.formatOptions.featureProjection)&&(i[_n.alreadyTransformedToMercator]=!0),or(i),new ol.Feature({geometry:i})}function hr(e,t){return e.image&&e.image.src&&/^:\d+$/.test(e.image.src)&&(t.embeddedIcons?e.image.src=t.embeddedIcons[e.image.src.substring(1)]:delete e.image.src),e}function dr(e,t){var i=!!e.color&&Be(e.color),n=e.width||1.25,r=e.pointRadius||5,a=e.opacity||.8;if(delete e.color,delete e.width,delete e.pointRadius,delete e.opacity,"Polygon"===t||"Circle"===t){var s=i?i.slice():[255,255,255,.4];return s[3]=a,{fill:{color:s},stroke:{color:i||Be("#3399CC"),width:n}}}return"LineString"===t?{stroke:{color:i||Be("#3399CC"),width:n}}:"Point"===t?{image:{fill:{color:[255,255,255,.4]},radius:r,stroke:{color:i||Be("#3399CC"),width:1}}}:void 0}function mr(e,t){if(!e.geometry)return null;var i=e.geometry.olcs_radius,n=tr.readGeometry(e.geometry,t.formatOptions);if(e.radius&&n instanceof ol.geom.Point){var r=n.getCoordinates();2===r.length&&r.push(0),n=new ol.geom.Circle(r,e.radius,"XYZ")}if(i&&n instanceof ol.geom.Point){var a=n.getCoordinates();2===a.length&&a.push(0),n=gi(a,i)}"EPSG:3857"===String(t.formatOptions.featureProjection)&&(n[_n.alreadyTransformedToMercator]=!0),e.vcsMeta=e.vcsMeta||{},e.vcsStyle&&(e.vcsMeta.style=e.vcsMeta.style||e.vcsStyle);var s=e.properties;t.readLegacyStyleOptions&&!e.vcsMeta.style&&(e.vcsMeta.style=dr(s,n.getType())),or(n);var o,l=new ol.Feature(Object.assign({},s,{geometry:n}));(e.id&&l.setId(e.id),e.state&&(l[$n]=e.state),e.vcsMeta.style&&!t.dontReadStyle)&&(e.vcsMeta.style=hr(e.vcsMeta.style,t),t.defaultStyle?(o=t.defaultStyle.clone().assign(new gt(e.vcsMeta.style)),null!=o.label&&n.set("_vcsGeomType","Label")):o=new gt(e.vcsMeta.style),l[ft]=o,l.setStyle(o.style));return cr(l),l}function fr(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"===typeof e?JSON.parse(e):e,r=lr(n),a=r?{epsg:r}:i.dataProjection,s={formatOptions:{dataProjection:a?a.epsg:R.createGeographicProjection().epsg,featureProjection:i.targetProjection?i.targetProjection.epsg:R.createMercatorProjection().epsg},dontReadStyle:i.dontReadStyle,readLegacyStyleOptions:i.readLegacyStyleOptions,defaultStyle:i.defaultStyle};if(i.dynamicStyle&&!s.defaultStyle&&(s.defaultStyle=vt),"FeatureCollection"===n.type)return n.vcsMeta=n.vcsMeta||{embeddedIcons:n.vcsEmbeddedIcons,style:n.vcsStyle},n.vcsMeta.embeddedIcons&&(s.embeddedIcons=n.vcsMeta.embeddedIcons),n.vcsMeta.style&&i.dynamicStyle&&(n.vcsMeta.style.type===Fe.REFERENCE?(t=ne.getInstance().getStyleByName(n.vcsMeta.style.name),t?t instanceof gt&&(s.defaultStyle=t):rr.warning("could not load referenced style ".concat(n.vcsMeta.style.name))):n.vcsMeta.style.type===Fe.DECLARATIVE?t=new Tt(n.vcsMeta.style):(n.vcsMeta.style=hr(n.vcsMeta.style,s),s.defaultStyle=s.defaultStyle.clone().assign(new gt(n.vcsMeta.style)),t=s.defaultStyle)),{features:n.features.map(function(e){return mr(e,s)}).filter(function(e){return e}),style:n.vcsMeta.style?t:void 0,vcsMeta:n.vcsMeta?n.vcsMeta:void 0};if("Feature"===n.type){var o=mr(n,s);return{features:o?[o]:[],vcsMeta:n.vcsMeta?n.vcsMeta:void 0}}return null!=n.type?{features:[ur(n,s)]}:{features:[]}}function yr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={type:"Feature",properties:e.getProperties()};t.writeId&&(n.id=e.getId()),delete n.properties[e.getGeometryName()],delete n.properties.style,delete n.properties.olcs_allowPicking;var r=e.getGeometry(),a=null;if(r instanceof ol.geom.Circle){var s=r.getCoordinates();a=nr.haversineDistance(R.mercatorToWgs84(s[0],!0),R.mercatorToWgs84(s[1],!0)),r=new ol.geom.Point(r.getCenter())}else if(r instanceof ol.geom.Polygon){var o=r.getCoordinates();o.forEach(function(e){ar(e)}),r.setCoordinates(o)}else if(r instanceof ol.geom.MultiPolygon){var l=r.getCoordinates();l.forEach(function(e){e.forEach(function(e){ar(e)})}),r.setCoordinates(l)}return n.geometry=tr.writeGeometryObject(r,{featureProjection:ir,rightHanded:!0}),a&&(n.geometry.olcs_radius=a),n.vcsMeta={},t.writeStyle&&e[ft]&&(n.vcsMeta.style=cn(e[ft].getOptionsForFeature(e),i)),n}function gr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.vcsMeta||{};i.version=Yt;var n=e.features.map(function(e){return yr(e,t,i.embeddedIcons)}),r={type:"FeatureCollection",features:n,vcsMeta:i};return t.writeStyle&&e.style&&(rr.deprecate("data.style","use layer.getVcsMeta and pass that in instead"),hn(e.style,r.vcsMeta)),t.asObject?r:JSON.stringify(r,null,t.prettyPrint?2:null)}Dt.GEOJSON=Dt.lastLayerId++;var vr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,e.projection||(e.projection=R.createGeographicProjection().getConfigObject()),i=y(this,b(t).call(this,e)),i.url=e.url||null,i.altitudeMode=e.altitudeMode||"none",i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.GeoJSON"}}]),Object(m["a"])(t,[{key:"fetchData",value:function(){var e=this;return this._dataFetchedPromise?this._dataFetchedPromise:null!=this.url?(this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.get(this.url).then(function(t){var i=t.data;e.dataFetchedHandler(i)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)}),this._dataFetchedPromise):(this.logger.warning("Could not load GeoJSON layer, no url is set"),Promise.reject(new Error("missing url in GeoJSON layer")))}},{key:"dataFetchedHandler",value:function(e){var t=fr(e,{dataProjection:this.projection,dynamicStyle:!0});this.addFeatures(t.features),t.style&&this.setStyle(t.style)}}]),t}(_n),pr=vr,_r=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.url=e.url||"";var n=null!=e.minLevel?e.minLevel:e.minZoom,r=null!=e.maxLevel?e.maxLevel:e.maxZoom;return i.minLevel=Object(u["h"])(n,0),i.maxLevel=Object(u["h"])(r,18),i.tilingSchema=e.tilingSchema,null==n&&e.extent&&i.calculateMinLevel(),i.opacity=Object(u["g"])(e.opacity,1),i.opacity=i.opacity<0?0:i.opacity,i.opacity=i.opacity>1?1:i.opacity,"string"!==typeof i.url&&i.framework.subscribe("LOCALE_CHANGED",i.handleLocaleChange,f(i)),i}return w(t,e),Object(m["a"])(t,[{key:"handleLocaleChange",value:function(){var e=this.isActive(),t=function(){Object.values(this.specificImpl).forEach(function(e){e.initialized=!1}),e&&this.activate(!0)}.bind(this);e?this.activate(!1).then(t):t()}},{key:"getUrl",value:function(){if("string"===typeof this.url)return this.url;var e=this.framework.getLocale();return this.url[e]?this.url[e]:Object.values(this.url)[0]}},{key:"getTilingScheme",value:function(){var e={};return this.numberOfLevelZeroTilesX&&this.numberOfLevelZeroTilesY&&(e.numberOfLevelZeroTilesX=this.numberOfLevelZeroTilesX,e.numberOfLevelZeroTilesY=this.numberOfLevelZeroTilesY),"mercator"===this.tilingSchema?new Cesium.WebMercatorTilingScheme(e):new Cesium.GeographicTilingScheme(e)}},{key:"_getExtentPoints",value:function(){var e=this.extent.getCoordinatesInProjection(R.createGeographicProjection()),t=[ol.extent.getBottomLeft(e),ol.extent.getBottomRight(e),ol.extent.getTopRight(e),ol.extent.getTopLeft(e)];return t.map(function(e){return Cesium.Cartographic.fromDegrees(e[0],e[1])})}},{key:"calculateMinLevel",value:function(){if(this.extent.isValid()){var e=this.getTilingScheme(),t=this._getExtentPoints();while(this.minLevel<this.maxLevel){var i=t.map(function(t){return e.positionToTileXY(t,this.minLevel)},this),n=[];if(n.push(Math.abs(i[0].x-i[1].x)),n.push(Math.abs(i[0].y-i[3].y)),n[0]>1||n[1]>1){this.minLevel=this.minLevel-1;break}this.minLevel=this.minLevel+1}}}},{key:"setOpacity",value:function(e){this.opacity=e,Object.values(this.specificImpl).forEach(function(e){e.updateOpacity()})}}]),t}($i),br=_r;Dt.IMAGE=Dt.lastLayerId,Dt.lastLayerId+=1;var Lr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.IMAGE,e.className=t.className,i=y(this,b(t).call(this,e)),i.imageExtent=e.imageExtent,i.credit=e.credit,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.SingleImage"}}]),Object(m["a"])(t,[{key:"setExtent",value:function(e){this.imageExtent=e;var t=this.getImplementation(this.framework.getActiveMap());t&&t.updateLayer()}}]),t}(br),Mr=Lr;Dt.OPENSTREETMAP=Dt.lastLayerId++;var kr=function(e){function t(e){return Object(d["a"])(this,t),e.layertype=Dt.OPENSTREETMAP,e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.OpenStreetMap"}}]),t}($i),wr=kr;Dt.TMSBase=Dt.lastLayerId++;var Tr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.TMSBase,e.className=t.className,e.tilingSchema=e.tilingSchema||"mercator",i=y(this,b(t).call(this,e)),i.format=e.format||"jpeg",i.tileWidth=Object(u["h"])(e.tileWidth,256),i.tileHeight=Object(u["h"])(e.tileHeight,256),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.TMSBase"}}]),t}(br),Sr=Tr;Dt.TILED_LAYER=Dt.lastLayerId,Dt.lastLayerId+=1;var Or=Symbol("isTiledFeature"),Cr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=e.layertype?e.layertype:Dt.TILED_LAYER,e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.featureVisibility=e.featureVisibility||new Ct,i.highlightStyle=null,e.highlightStyle&&(i.highlightStyle=e.highlightStyle instanceof gt?e.highlightStyle:new gt(e.highlightStyle)),i.cesiumTilesetLayerOptions=Object.assign({},e.cesiumTilesetLayerOptions,{featureVisibility:i.featureVisibility,highlightStyle:i.highlightStyle,genericFeatureProperties:i._genericFeatureProperties}),i.openlayersTiledLayerOptions=Object.assign({},e.openlayersTiledLayerOptions,{featureVisibility:i.featureVisibility,highlightStyle:i.highlightStyle,genericFeatureProperties:i._genericFeatureProperties}),i._dataFetched=!1,i.source=new ol.source.Vector({}),i.projection=R.createMercatorProjection(),i.sourceProjection=i.projection.getProjection(),i.internalProjection=R.createMercatorProjection(),i.zIndex=50,i.editing=null,i.addedEditingSymbol=!1,i.FVlastUpdated=0,i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.TiledLayer"}}]),Object(m["a"])(t,[{key:"getSource",value:function(){return this.source}},{key:"postRenderStyling",value:function(){_n.prototype.postRenderStyling.call(this)}},{key:"setEditing",value:function(e,t){this._dataFetched?this.addedEditingSymbol&&!t?(this.source.getFeatures().forEach(function(t){delete t[e]}),this.addedEditingSymbol=!1):t&&(this.addedEditingSymbol=!0,this.source.getFeatures().forEach(function(i){i[e]=t})):this.editing={symbol:e,featureType:t}}},{key:"getFeatureById",value:function(e){var t=e;return-1!==String(e).indexOf("_OBLIQUE")&&(t=String(e).split("_OBLIQUE")[0]),this.source.getFeatureById(t)}},{key:"initialize",value:function(){var e=this.framework.getActiveMap(),i="vcs.vcm.maps.Cesium"===e.className?!!this.cesiumTilesetLayerOptions.url:!!this.openlayersTiledLayerOptions.url;i&&Se(b(t.prototype),"initialize",this).call(this)}},{key:"activate",value:function(e){var i=this.framework.getActiveMap(),n="vcs.vcm.maps.Cesium"===i.className?!!this.cesiumTilesetLayerOptions.url:!!this.openlayersTiledLayerOptions.url;return n?Se(b(t.prototype),"activate",this).call(this,e):Promise.resolve()}},{key:"setHighlightStyle",value:function(e){this.highlightStyle=e}},{key:"determineHighlightStyle",value:function(e,t){var i=this.framework.getActiveMap();if(this.highlightStyle)return this.highlightStyle;if("vcs.vcm.maps.Cesium"===i.className){var n=this.getImplementation(this.framework.getActiveMap());return n.determineHighlightStyle()}return _n.prototype.determineHighlightStyle.call(this,e,t)}},{key:"setMaximumScreenSpaceError",value:function(e){var t=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(t){var i=this.getImplementation(t);i&&i.setMaximumScreenSpaceError(e)}}},{key:"fetchData",value:function(){var e=this;return this._dataFetchedPromise?this._dataFetchedPromise:(null!=this.openlayersTiledLayerOptions.url?(this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.get(this.openlayersTiledLayerOptions.url).then(function(t){var i=t.data,n=fr({features:i.features,type:"FeatureCollection"},{defaultStyle:e.defaultStyle instanceof gt?e.defaultStyle:vt}),r=n.features;r.forEach(function(e){e[Or]=!0}),_n.prototype.addFeatures.call(e,r),e.editing&&(e.setEditing(e.editing.symbol,e.editing.featureType),e.editing=null)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})):(this._dataFetched=!0,this._dataFetchedPromise=Promise.resolve()),this._dataFetchedPromise)}},{key:"objectClickedHandler",value:function(e,t,i){if(this.allowPicking){var n=this.framework.getActiveMap();if((e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature)&&"vcs.vcm.maps.Cesium"===n.className){var r=this.getImplementation(n);return r.objectClickedHandler(e,t,i||this)}if(e instanceof ol.Feature&&("vcs.vcm.maps.Openlayers"===n.className||"vcs.vcm.maps.Oblique"===n.className))return _n.prototype.objectClickedHandler.call(this,e,t,i||this)}return!1}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=this.framework.getActiveMap(),i=this.getImplementation(t);return i?i.getGenericFeatureFromClickedObject(e):null}},{key:"screenSpaceErrorMobile",get:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(e){var t=this.getImplementation(e);if(t)return t.screenSpaceErrorMobile}return null}},{key:"screenSpaceError",get:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(e){var t=this.getImplementation(e);if(t)return t.screenSpaceError}return null}}]),t}($i),Er=Cr,Ir=i(66),Dr=i.n(Ir);Dt.CLUSTER=Dt.lastLayerId,Dt.lastLayerId+=1;var jr=function(e){function t(e){var i;Object(d["a"])(this,t),e.layertype=Dt.CLUSTER,e.className=t.className,e.zCoordinateEyeOffset=Object(u["h"])(e.zCoordinateEyeOffset,-200),e.heightAboveGround=Object(u["h"])(e.heightAboveGround,65),e.activeOnStartup=!0,e.altitudeMode=e.altitudeMode||"none",e.zIndex=Object(u["h"])(e.zIndex,60),i=y(this,b(t).call(this,e)),i.clusterSource=new ol.source.Cluster({source:i.source,distance:Object(u["h"])(e.clusterDistance,40)}),i.clusterLayers=e.clusterLayers||[],i.activeClusterLayers=[],i.activeClusterLayersLastUpdated={},i.lastClickedFeatures=[];var n=e.defaultFeatureTemplate||"<%=title%>";Array.isArray(n)&&(n=n.join(" ")),i.defaultFeatureTemplate=Dr()(n),i.showInContent=!!e.showInContent;var r=e.style||{};return i.icon=r.icon||"images/clusterIcon.svg",i.selectedIcon=r.selectedIcon||"images/clusterSelectedIcon.svg",i.iconWidth=Object(u["h"])(r.iconWidth,40),i.iconHeight=Object(u["h"])(r.iconHeight,44),i.iconScaleFactor=Object(u["h"])(r.iconScaleFactor,.05),i.fontSize=Object(u["h"])(r.fontSize,16),i.textOffset=Object(u["h"])(r.textOffset,-4),i.breaks=r.breaks||[2,3,4,5,10,15,20,25],i.zeroScaleOffset=Object(u["h"])(r.zeroScaleOffset,3),i._icons=new Array(i.breaks.length),i._selectedIcons=new Array(i.breaks.length),i._images=new Array(i.breaks.length),i._inactive2dClustering=!0,i._resultLayer=new _n({name:"_clusterResultLayer".concat(i.name),altitudeMode:i.altitudeMode,activeOnStartup:!0,zCoordinateEyeOffset:i.zCoordinateEyeOffset-20,zIndex:1e3,projection:R.createMercatorProjection().getConfigObject(),allowPicking:!1}),i._resultFeature=null,i._initialActivation=!1,i.framework.subscribe(B.LAYER_ACTIVATED,i._handleActivation.bind(f(i))),i.framework.subscribe(B.LAYER_DEACTIVATED,i._handleDeactivation.bind(f(i))),i.framework.subscribe(B.SELECTED_ITEM_CHANGED,i._handleSelectedItemChanged.bind(f(i))),i.mapNames=[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.VectorCluster"}}]),Object(m["a"])(t,[{key:"activate",value:function(e){var i=this;if(this.isSupported()){if(!e)return this.logger.warning("trying to deactivate cluster layer!"),Promise.reject(new Error("cannot deactivate cluster layer"));"vcs.vcm.maps.Openlayers"!==this.framework.getActiveMap().className?(this._inactive2dClustering=!0,this.clusterSource.setPause(!0)):(this._inactive2dClustering=!1,this.clusterSource.setPause(!1)),this.clusterLayers=this._validateLayers(this.clusterLayers);var n=Se(b(t.prototype),"activate",this).call(this,!0);return this._initialActivation?n:n.then(function(){return i.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"])}).then(this._createIcons.bind(this)).then(function(){i.setStyle(i._styleFunction.bind(i)),i._resultLayer.setStyle(i._getSelectedStyle()),i.framework.addLayer(i._resultLayer),i._initialActivation=!0})}return Promise.resolve()}},{key:"_validateLayers",value:function(e,t){var i=this;return e.filter(function(e){var n=i.framework.getLayerByName(e.name);if(!(n&&n instanceof _n))return i.logger.warning("Missconfigured cluster layer, failed with layer: ".concat(n)),!1;if("string"===typeof e.featureTemplate&&(e.featureTemplate=Dr()(e.featureTemplate)),n.heightAboveGround=i.heightAboveGround,n.altitudeMode=i.altitudeMode,n.setVisibility(!1),t){var r=i.clusterLayers.find(function(t){return t.name===e.name});r?(r.title=e.title||r.title,r.featureTemplate=e.featureTemplate||r.featureTemplate):i.clusterLayers.push(e)}return!0})}},{key:"_createIcons",value:function(){var e=this;function t(e,t,i,n,r){var a=this,s=t-this.zeroScaleOffset;s=s>0?s:0,s=r?s:s+.2;var o=Math.round(this.iconWidth*(1+this.iconScaleFactor*s)),l=Math.round(this.iconHeight*(1+this.iconScaleFactor*s));return new Promise(function(e){var t=document.createElement("canvas");t.width=o,t.height=l,canvg(t,i,{renderCallback:function(){e(t)}})}).then(function(i){return new Promise(function(n){var r,s=a.fontSize;r=t<a.zeroScaleOffset?e:"".concat(e,"+");var c='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(o,'" heigth="').concat(l,'" viewbox="0 0 ').concat(o," ").concat(l,'">')+'<text x="'.concat(o/2,'" y="').concat(l/2+s/2+a.textOffset,'" text-anchor="middle" ')+'lengthAdjust="spacingAndGlyphs" textLength="'.concat(o-20,'" ')+'font-size="'.concat(s,'" font-family="Arial" font-weight="bold">').concat(r,"</text></svg>"),u=document.createElement("canvas");u.width=o,u.height=l,canvg(u,c,{ignoreDimensions:!0,renderCallback:function(){var e=document.createElement("canvas");e.width=o,e.height=l;var t=e.getContext("2d");t.drawImage(i,0,0),t.drawImage(u,0,0),n(e)}})})}).then(function(e){return r&&(a._images[t]=e),n[t]=new ol.style.Style({image:new ol.style.Icon({img:e,imgSize:[o,l],anchor:[.5,.5]})}),Promise.resolve()})}var i=this.breaks.map(function(i,n){return Promise.all([t.bind(e)(i,n,e.icon,e._icons,!0),t.bind(e)(i,n,e.selectedIcon,e._selectedIcons,!1)])});return Promise.all(i)}},{key:"getSource",value:function(){return this.clusterSource}},{key:"_styleFunction",value:function(e){var t=this,i=e.get("features");if(i&&i.length>1){var n=i.length,r=this.breaks.findIndex(function(e,i){return i>t.zeroScaleOffset?n<e:n<=e});return r=r>this.zeroScaleOffset?r-1:r,-1===r?this._icons[this._icons.length-1]:this._icons[r]}var a=i?i[0]:e,s=a[_n.originalFeatureSymbol]||a,o=this.framework.getLayerByName(s.get("_layerName"));return o?s.getId()&&Q.getInstance().getCurrentItem().id===s.getId()?o.highlightStyle?o.highlightStyle.style:null:o.style.style:new ol.style.Style({})}},{key:"_getSelectedStyle",value:function(){return function(e){var t=this,i=e[_n.originalFeatureSymbol]||e,n=i.get("features");if(n&&n.length>1){var r=n.length,a=this.breaks.findIndex(function(e,i){return i>t.zeroScaleOffset?r<e:r<=e});return a=a>this.zeroScaleOffset?a-1:a,-1===a?this._selectedIcons[this._selectedIcons.length-1]:this._selectedIcons[a]}return this._selectedIcons[0]}.bind(this)}},{key:"cesiumStyleFunction",value:function(e,t){var i=this;if(!(e.length<2)){var n,r=e.length,a=this.breaks.findIndex(function(e,t){return t>i.zeroScaleOffset?r<e:r<=e});a=a>this.zeroScaleOffset?a-1:a,n=-1===a?this._images[this._images.length-1]:this._images[a],t.billboard.setImage(this.name+a,n),t.billboard.show=!0}}},{key:"objectClickedHandler",value:function(e,t,i){var n=this;this.unSelect();var r=e.get("features");if(r&&r.length>1){this.lastClickedFeatures.splice(0),r.forEach(function(e){var t=e[_n.originalFeatureSymbol]||e,i=n.clusterLayers.find(function(e){return e.name===t.get("_layerName")}),r=t.getProperties();r.template=i&&i.featureTemplate?i.featureTemplate(r):n.defaultFeatureTemplate(r),r.template=r.template.replace(/\[br\]/g,"<br>");var a={id:r.id,template:r.template,_layerName:r._layerName};n.lastClickedFeatures.push(a)}),this.raiseFeatureEvent(B.CLUSTER_CLICKED,"",r,this),this.framework.getSelectBehavior().clearCurrentItem();var a=e.getGeometry().clone();return a[_n.alreadyTransformedToImage]="vcs.vcm.maps.Oblique"===this.framework.getActiveMap().className,this._resultFeature=new ol.Feature({geometry:a,features:this.lastClickedFeatures}),this._resultLayer.addFeatures([this._resultFeature]),!0}var s=r?r[0]:e,o=s[_n.originalFeatureSymbol]||s,l=this.framework.getLayerByName(o.get("_layerName"));return l.objectClickedHandler(o,t,i)}},{key:"contains",value:function(e){var t=this.clusterLayers.findIndex(function(t){return t.name===e});return t>-1}},{key:"_handleActivation",value:function(e){var t=this,i=this.activeClusterLayers.findIndex(function(t){return t===e.name});if(this.contains(e.name)&&-1===i&&e instanceof _n){var n=e.getSource();if("ready"===n.getState()){var r=e.name,a=n.getFeatures();a.forEach(function(e){e.set("_layerName",r,!0),e.getId()||e.setId(t.framework.getNextUniqueId())}),this.source.addFeatures(a),this.activeClusterLayers.push(r)}else n.once("change",this._handleActivation.bind(this,e))}}},{key:"_handleDeactivation",value:function(e){var t=this;if(this.contains(e.name)&&e instanceof _n){this._inactive2dClustering||this.clusterSource.setPause(!0);var i=e.getSource();i.getFeatures().forEach(function(e){t.source.removeFeature(e,!0)}),this.source.changed();var n=this.activeClusterLayers.findIndex(function(t){return t===e.name});this.activeClusterLayers.splice(n,1),delete this.activeClusterLayersLastUpdated[e.name],this._inactive2dClustering||this.clusterSource.setPause(!1);var r=this.lastClickedFeatures.slice();this.lastClickedFeatures.splice(0),r.forEach(function(i){i._layerName!==e.name&&t.lastClickedFeatures.push(i)}),this._resultFeature&&this._resultFeature.changed()}}},{key:"_handleSelectedItemChanged",value:function(e){var t=this.lastClickedFeatures.find(function(t){return t.id===e});e&&!t&&this.unSelect()}},{key:"postRenderStyling",value:function(){for(var e=this,t=!1,i=function(i){var n=e.activeClusterLayers[i],r=e.framework.getLayerByName(n);if(r&&(!e.activeClusterLayersLastUpdated[n]||e.activeClusterLayersLastUpdated[n]<r.featureVisibility.lastUpdated)){var a=r.getSource();a.getFeatures().forEach(function(i){e.source.getFeatureById(i.getId())?r.featureVisibility.hiddenObjects[i.getId()]&&(e.source.removeFeature(i,!0),t=!0):r.featureVisibility.hiddenObjects[i.getId()]||(e.source.addFeature(i,!0),t=!0)}),e.activeClusterLayersLastUpdated[n]=Date.now()}},n=0;n<this.activeClusterLayers.length;n++)i(n);t&&this.source.changed()}},{key:"unSelect",value:function(){this._resultFeature=null,this._resultLayer.removeAllFeatures()}},{key:"addLayers",value:function(e){this._validateLayers(Array.isArray(e)?e:[e],!0)}}]),t}(_n),Pr=jr,Yr=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className;var n=new R(e.projection).getConfigObject();return n.alias=["http://www.opengis.net/gml/srs/epsg.xml#".concat(n.epsg.match(/\d+/)[0])],e.projection=n,i=y(this,b(t).call(this,e)),i.featureType=Array.isArray(e.featureType)?e.featureType:[e.featureType],i.featureNS=e.featureNS,i.featurePrefix=e.featurePrefix,i.getFeaturesOptions=e.getFeatureOptions||{},i.wfsFormat=new ol.format.WFS({featureNS:i.featureNS,featureType:i.featureType}),i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.WFS"}}]),Object(m["a"])(t,[{key:"fetchData",value:function(){var e=this;if(this._dataFetchedPromise)return this._dataFetchedPromise;if(null!=this.url){var t=this.wfsFormat.writeGetFeature(Object.assign({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureTypes:[this.featureType],srsName:this.projection.epsg},this.getFeaturesOptions));t=(new XMLSerializer).serializeToString(t),this.framework.getActiveMap().setLayerLoading(this,!0),this._dataFetchedPromise=ce.a.post(this.url,t,{headers:{"Content-Type":"application/text+xml"}}).then(function(t){var i=t.data;e.dataFetchedHandler(i)}).catch(function(t){return e.logger.info("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})}return this.logger.warning("Could not load WFS layer, no url is set"),Promise.reject(new Error("missing url in WFS layer"))}},{key:"dataFetchedHandler",value:function(e){var t=this.wfsFormat.readFeatures(e);this.addFeatures(t)}}]),t}(_n),xr=Yr;Dt.WMS=Dt.lastLayerId++;var Ar=function(e){function t(e){var i,n;(Object(d["a"])(this,t),e.layertype=Dt.WMS,e.className=t.className,e.tilingSchema=e.tilingSchema||"geographic",i=y(this,b(t).call(this,e)),i.layers=e.layers?e.layers.split(","):[],i.version=e.version||"1.1.1",i.parameters={},e.parameters)&&("string"===typeof e.parameters?n=a["a"].parseQueryParams(e.parameters):e.parameters instanceof Object&&(n=e.parameters),Object.keys(n).forEach(function(e){i.parameters[e.toUpperCase()]=n[e]}));return null==i.parameters.TRANSPARENT&&(i.parameters.TRANSPARENT=!1),i.version&&(i.parameters.VERSION=i.version),i.parameters.LAYERS=i.layers.join(","),i.addTiledParameter&&(i.parameters.TILED=!0),i.featureInfo=e.featureInfo||!1,i.addTiledParameter=null==e.addTiledParameter||e.addTiledParameter,i.featureInfoResponseType=e.featureInfo&&e.featureInfo.responseType?e.featureInfo.responseType:"text/xml",i.featureInfoActivated=!1,i.featureInfoListenerKey=null,i.geoJsonFormats=["application/geojson","application/json","application/vnd.geo+json"],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wms"}}]),Object(m["a"])(t,[{key:"getParameter",value:function(){return this.parameters}},{key:"activateFeatureInfo",value:function(e){e&&!this.featureInfoActivated?(this.featureInfoListenerKey=this.framework.subscribe(B.MAP_CLICKED,this.featureInfoHandler.bind(this)),this.featureInfoActivated=!0):!e&&this.featureInfoActivated&&this.featureInfoListenerKey&&(this.framework.unsubscribeByKey(this.featureInfoListenerKey),this.featureInfoActivated=!1,this.featureInfoListenerKey=null)}},{key:"featureInfoHandler",value:function(e){var t=this,i=this.framework.getActiveMap(),n=0;if("vcs.vcm.maps.Openlayers"===i.className)n=i.getOl3Map().getView().getResolution()/1e5;else if("vcs.vcm.maps.Cesium"===i.className){var r=i.getViewPoint(),a=Math.PI/3,s={};s.width=this.framework.getMapContainer().offsetWidth,s.height=this.framework.getMapContainer().offsetHeight;var o=s.width/s.height,l=2*Math.atan(Math.tan(.5*a)/o),c=2*r.getDistance()*Math.tan(l/2),u=111194.87428468118,h=Math.cos(Math.abs(Cesium.Math.toRadians(e.latitude))),d=c/u/h;n=d/s.height}var m="EPSG:4326";"1.3.0"===this.version&&(m="CRS:84");var f=[e.longitude,e.latitude];"mercator"===this.tilingSchema&&(f=R.createGeographicProjection().transformTo(R.createMercatorProjection(),f),m="EPSG:3857");var y=this.wmsSource.getGetFeatureInfoUrl(f,n,m,{INFO_FORMAT:this.featureInfoResponseType});y&&ce.a.get(y).then(function(i){var n,r;if(i=i.data,"text/xml"===t.featureInfoResponseType)n=new ol.format.WFS;else{if(-1===t.geoJsonFormats.indexOf(t.featureInfoResponseType))return void t.logger.warning("Only geojson and text/xml is supported");n=new ol.format.GeoJSON}try{r=n.readFeatures(i)}catch(o){return void t.logger.warning("Features could not be read, please verify the featureInfoResponseType with the capabilities from the server")}if(Array.isArray(r)&&r.length>=1){var a="wmsFeatureInfo",s=r[0];s.setGeometry(new ol.geom.Point([e.longitude,e.latitude])),t.framework.publish(B.FEATURE_CLICKED,a,s,t)}})}},{key:"getTilingOptions",value:function(){for(var e="geographic"===this.tilingSchema?R.createGeographicProjection():R.createMercatorProjection(),t=e.getProjection().getExtent(),i=ol.extent.getWidth(t),n="geographic"===this.tilingSchema?i/512:i/256,r=this.maxLevel+1,a=[],s=0;s<r;++s)a.push(n/Math.pow(2,s));var o={origin:ol.extent.getTopLeft(t),resolutions:a,minZoom:this.minLevel};return this.extent.isValid()&&(o.extent=this.extent.getCoordinatesInProjection(e)),o}},{key:"setCommonSource",value:function(){if(!this.wmsSource){var e=this.getTilingOptions(),t=new ol.tilegrid.TileGrid(e),i={url:this.getUrl(),tileGrid:t,params:this.parameters};a["a"].hasSameOrigin(this.getUrl())||(i.crossOrigin="anonymous"),"geographic"===this.tilingSchema&&("1.3.0"===this.version?i.projection="CRS:84":i.projection="EPSG:4326"),this.wmsSource=new ol.source.TileWMS(i)}}},{key:"getUseFeatureInfo",value:function(){return this.featureInfo}},{key:"getGenericFeatureFromClickedObject",value:function(e){var t=e.getGeometry(),i=ol.extent.getCenter(t.getExtent()),n=e.getProperties();return delete n[e.getGeometryName()],{layerName:this.name,layerClass:this.className,attributes:Object.assign({},this._genericFeatureProperties,n),longitude:i[0],latitude:i[1],height:0,relativeToGround:!0}}},{key:"setLayers",value:function(e){o(e,[String,[String]]),this.layers=Array.isArray(e)?e:[e],this.parameters.LAYERS=this.layers.join(","),this._updateLayer()}},{key:"_updateLayer",value:function(){this.wmsSource&&(this.wmsSource.updateParams(this.parameters),Object.values(this.specificImpl).forEach(function(e){e.updateLayer()}))}}]),t}(br),Fr=Ar;Dt.WMTS=Dt.lastLayerId++;var Nr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.layertype=Dt.WMTS,e.className=t.className,e.tilingSchema=e.tilingSchema||"mercator",i=y(this,b(t).call(this,e)),i.numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX?e.numberOfLevelZeroTilesX:1,i.numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY?e.numberOfLevelZeroTilesY:1,i.layer=e.layer||"",i.style=e.style||"",i.format=e.format||"",i.tileMatrixPrefix=e.tileMatrixPrefix||"",i.tileMatrixSetID=e.tileMatrixSetID||"",i.olOptions=e.ol3Options?e.ol3Options:{},i.matrixIds=e.matrixIds?e.matrixIds:null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wmts"}}]),t}(br),Hr=Nr,Rr=null,zr=function(e){function t(){var e;Object(d["a"])(this,t),e=y(this,b(t).call(this,{className:t.className})),e.colorLayerMap={},e.layerLegendCanvasMap={},e.baseUrl="./images/icons.json",e.iconMap={0:{stroke:"inner_0.svg"},1:{stroke:"inner_2.svg",fill:"inner_2_fill_shaded.svg",colorizeInner:!0},2:{stroke:"inner_3.svg",fill:"inner_3_fill_white.svg",colorizeOuter:!0},3:{stroke:"inner_4.svg"},4:{stroke:"inner_1.svg",fill:"inner_1_fill_shaded.svg",colorizeInner:!0},5:{stroke:"inner_5.svg",fill:"inner_5_fill_white.svg",colorizeOuter:!0},6:{stroke:"inner_10.svg"},7:{stroke:"inner_9.svg",fill:"inner_9_fill_shaded.svg",colorizeInner:!0},8:{stroke:"inner_8.svg",fill:"inner_8_fill_white.svg",colorizeOuter:!0},9:{stroke:"inner_6.svg"},10:{stroke:"inner_12.svg",fill:"inner_12_fill_shaded.svg",colorizeInner:!0},11:{stroke:"inner_7.svg",fill:"inner_7_fill_white.svg",colorizeOuter:!0},12:{stroke:"inner_11.svg"},13:{stroke:"inner_0.svg",fill:"inner_0_fill_shaded.svg",colorizeInner:!0},14:{stroke:"inner_2.svg",fill:"inner_2_fill_white.svg",colorizeOuter:!0},15:{stroke:"inner_3.svg"},16:{stroke:"inner_4.svg",fill:"inner_4_fill_shaded.svg",colorizeInner:!0},17:{stroke:"inner_1.svg",fill:"inner_1_fill_white.svg",colorizeOuter:!0},18:{stroke:"inner_5.svg"},19:{stroke:"inner_10.svg",fill:"inner_10_fill_shaded.svg",colorizeInner:!0},20:{stroke:"inner_9.svg",fill:"inner_9_fill_white.svg",colorizeOuter:!0},21:{stroke:"inner_8.svg"},22:{stroke:"inner_6.svg",fill:"inner_6_fill_shaded.svg",colorizeInner:!0},23:{stroke:"inner_12.svg",fill:"inner_12_fill_white.svg",colorizeOuter:!0},24:{stroke:"inner_7.svg"},25:{stroke:"inner_11.svg",fill:"inner_11_fill_shaded.svg",colorizeInner:!0},26:{stroke:"inner_0.svg",fill:"inner_0_fill_white.svg",colorizeOuter:!0},27:{stroke:"inner_2.svg"},28:{stroke:"inner_3.svg",fill:"inner_3_fill_shaded.svg",colorizeInner:!0},29:{stroke:"inner_4.svg",fill:"inner_4_fill_white.svg",colorizeOuter:!0},30:{stroke:"inner_1.svg"},31:{stroke:"inner_5.svg",fill:"inner_5_fill_shaded.svg",colorizeInner:!0},32:{stroke:"inner_10.svg",fill:"inner_10_fill_white.svg",colorizeOuter:!0},33:{stroke:"inner_9.svg"},34:{stroke:"inner_8.svg",fill:"inner_8_fill_shaded.svg",colorizeInner:!0},35:{stroke:"inner_6.svg",fill:"inner_6_fill_white.svg",colorizeOuter:!0},36:{stroke:"inner_12.svg"},37:{stroke:"inner_7.svg",fill:"inner_7_fill_shaded.svg",colorizeInner:!0},38:{stroke:"inner_11.svg",fill:"inner_11_fill_white.svg",colorizeOuter:!0},39:{stroke:"inner_last.svg"}},e._svgMap={};var i=e.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"]),n=ce.a.get(e.baseUrl).then(function(t){return e._svgMap=t.data,!0});return e.readyPromise=Promise.all([i,n]),e.dedicatedIconMap={berlinpartner:"outerCircle.svg",sbahn:"SBahn.svg",ubahn:"UBahn.svg",haltestelle:"Haltestelle.svg",top200:"Top200.svg",gewerbeimmobilien:"GewerbeImmobilien-rot.svg"},e.width=40,e.height=44,e}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.IconManager"}}]),Object(m["a"])(t,[{key:"getStyleForColor",value:function(e,t,i){var n,r=this,a=ol.color.asArray(t);return a?(this.colorLayerMap[t]?-1!==this.colorLayerMap[t].indexOf(e)?n=this.colorLayerMap[t].indexOf(e):(n=this.colorLayerMap[t].length,this.colorLayerMap[t].push(e)):(this.colorLayerMap[t]=[e],n=0),n=n>39?39:n,this.readyPromise.then(function(){var t=a[0],s=a[1],o=a[2],l=[];return i?(l.push(r.createOutline(t,s,o,n,r._svgMap["outerSquare.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["innerWhiteSquare.svg"],r._svgMap["innerShadedSquare.svg"])),l.push(r.createOutline(t,s,o,n,r._svgMap["legendSquare_outer.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["legendSquare_inner_white.svg"],r._svgMap["legendSquare_inner_shaded.svg"]))):(l.push(r.createOutline(t,s,o,n,r._svgMap["outerCircle.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["innerWhiteCircle.svg"],r._svgMap["innerShadedCircle.svg"])),l.push(r.createOutline(t,s,o,n,r._svgMap["legendCircle_outer.svg"])),l.push(r.createFill(t,s,o,n,r._svgMap["legendCircle_inner_white.svg"],r._svgMap["legendCircle_inner_shaded.svg"]))),l.push(r.createInner(t,s,o,n)),Promise.all(l).then(function(t){var n=t[0],a=t[1],s=t[2],o=t[3],l=t[4],c=document.createElement("canvas");c.width=22,c.height=22;var u=c.getContext("2d");i?(u.drawImage(s,0,0,25,28,0,0,22,22),u.drawImage(o,0,0,25,28,0,0,22,22),u.drawImage(l,8,6,26,26,2.1,2.4,15,15)):(u.drawImage(o,0,0,28,28,0,0,22,22),u.drawImage(s,0,0,28,28,0,0,22,22),u.drawImage(l,8,6,26,26,3.7,2.9,15,15)),r.layerLegendCanvasMap[e]=c;var h=document.createElement("canvas");h.width=r.width,h.height=r.height;var d=h.getContext("2d");return d.drawImage(n,0,0),d.drawImage(a,0,0),i?d.drawImage(l,-.7,-.52):d.drawImage(l,0,0),h.id=e,new ol.style.Style({image:new ol.style.Icon({img:h,imgSize:[r.width,r.height],anchor:[.5,1]})})})})):Promise.reject(new Error("Not a valid color is provided for the layer with name ".concat(e,", no style is provided")))}},{key:"getStyleForDedicatedIcon",value:function(e,t){var i=this;return this.readyPromise.then(function(){return new Promise(function(n,r){if(t=t.toLowerCase(),i.dedicatedIconMap[t]){var a=document.createElement("canvas");a.width=i.width,a.height=i.height,canvg(a,i._svgMap.dedicatedIcons[i.dedicatedIconMap[t]],{renderCallback:function(){var t=new ol.style.Style({image:new ol.style.Icon({img:a,imgSize:[this.width,this.height],scale:.8})}),i=document.createElement("canvas");i.width=22,i.height=22;var r=i.getContext("2d");r.drawImage(a,0,0,39,44,0,0,22,22),this.layerLegendCanvasMap[e]=i,n(t)}.bind(i)})}else r(new Error("This icon is not known, please check"))})})}},{key:"getLegendCanvas",value:function(e){var t=this;if(this.layerLegendCanvasMap[e])return Promise.resolve(this.layerLegendCanvasMap[e]);var i=this.framework.getLayerByName(e);return i?i.dedicatedIcon?this.getStyleForDedicatedIcon(i.name,i.dedicatedIcon).then(function(){return t.getLegendCanvas(e)}):this.getStyleForColor(i.name,i.iconColor,i.useSquareShapeAsOuter).then(function(){return t.getLegendCanvas(e)}):Promise.reject(new Error("Could not find layer: ".concat(e)))}},{key:"createOutline",value:function(e,t,i,n,r){var a=this;return new Promise(function(n,s){var o=document.createElement("canvas");o.width=a.width,o.height=a.height;var l=o.getContext("2d");canvg(o,r,{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(o)}.bind(a)})})}},{key:"createFill",value:function(e,t,i,n,r,a){var s=this;return new Promise(function(o,l){var c=s.iconMap[n];if(c.colorizeOuter){var u=[];u.push(new Promise(function(e,t){var i=document.createElement("canvas");i.width=s.width,i.height=s.height,canvg(i,r,{renderCallback:function(){e(i)}})})),u.push(new Promise(function(n,r){var o=document.createElement("canvas");o.width=s.width,o.height=s.height;var l=o.getContext("2d");canvg(o,a,{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(o)}.bind(s)})})),Promise.all(u).then(function(e){var t=e[0],i=e[1],n=document.createElement("canvas");n.width=s.width,n.height=s.height;var r=n.getContext("2d");t&&r.drawImage(t,0,0),i&&r.drawImage(i,0,0),o(n)})}else{var h=document.createElement("canvas");h.width=s.width,h.height=s.height,canvg(h,r,{renderCallback:function(){o(h)}})}})}},{key:"createInner",value:function(e,t,i,n){var r=this;return new Promise(function(a,s){var o=r.iconMap[n],l=[];l.push(new Promise(function(n,a){if(o.stroke){var s=document.createElement("canvas");s.width=r.width,s.height=r.height;var l=s.getContext("2d");canvg(s,r._svgMap[o.stroke],{renderCallback:function(){Qe(l,[e,t,i,0],[this.width,this.height]),n(s)}.bind(r)})}else n()})),l.push(new Promise(function(n,a){if(o.fill){var s=document.createElement("canvas");s.width=r.width,s.height=r.height;var l=s.getContext("2d");canvg(s,r._svgMap[o.fill],{renderCallback:function(){o.colorizeInner&&Qe(l,[e,t,i,0],[this.width,this.height]),n(s)}.bind(r)})}else n()})),Promise.all(l).then(function(e){var t=e[0],i=e[1],n=document.createElement("canvas");n.width=r.width,n.height=r.height;var s=n.getContext("2d");i&&s.drawImage(i,0,0),t&&s.drawImage(t,0,0),a(n)})})}}],[{key:"getInstance",value:function(){return Rr||(Rr=new t),Rr}}]),t}(A),Gr=zr;Dt.WSV=Dt.lastLayerId,Dt.lastLayerId+=1;var Vr=function(e){function t(e){var i;return Object(d["a"])(this,t),e.projection={},e.projection.epsg="EPSG:4326",e.projection.proj4="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ",e.zCoordinateEyeOffset=-100,e.heightAboveGround=10,e.altitudeMode="relativeToGround",e.zIndex=e.zIndex||60,e.className=t.className,e.layertype=Dt.WSV,i=y(this,b(t).call(this,e)),i.dedicatedIcon=e.dedicatedIcon||!1,i.iconColor=e.iconColor||!1,i.useSquareShapeAsOuter=!!e.useSquareShape,i.iconManagerInUse=!(!i.dedicatedIcon&&!i.iconColor),i.baseUrl=e.baseurl||"/wsv-live",i.name=e.name,i.logo="adf33bbe08057b9251536c73ff627f512955ffc7.png",i.scaleUnselected=i.iconManagerInUse?.8:.5,i.scaleSelected=i.iconManagerInUse?0:1,e.style&&(e.style.scaleUnselected&&(i.scaleUnselected=e.style.scaleUnselected),e.style.scaleSelected&&(i.scaleSelected=e.style.scaleSelected)),e.wsvProjection||(e.wsvProjection={proj4:"+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam +units=m +no_defs",epsg:"3068"}),i.wsvProjection=new R(e.wsvProjection),i.noFilterValue=e.noFilterValue?e.noFilterValue:"Keine Angabe",i.filter=e.filter?e.filter:null,i.framework.subscribe(B.LOCALE_CHANGED,i.handleLocaleChanged,f(i)),i.filterAttribute=e.filterAttribute?e.filterAttribute:"tags",i.filterAttributeName=e.filterAttributeName?e.filterAttributeName:null,i.loadedLibraries=i.framework.loadLibraries(["./lib/thirdparty/canvg-1.4/rgbcolor.js","./lib/thirdparty/canvg-1.4/StackBlur.js","./lib/thirdparty/canvg-1.4/canvg.js"]),i._dataFetchedPromise=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.Wsv"}}]),Object(m["a"])(t,[{key:"activate",value:function(e){var i=this;return e?this.loadedLibraries.then(this.fetchData.bind(this)).then(function(){return Se(b(t.prototype),"activate",i).call(i,e)}):Se(b(t.prototype),"activate",this).call(this,e)}},{key:"fetchData",value:function(){var e=this;if(!this._dataFetchedPromise){this.framework.getActiveMap().setLayerLoading(this,!0);var t="".concat(this.baseUrl,"/api/").concat(this.framework.getLocale(),"/layer/").concat(this.name,".json");this._dataFetchedPromise=ce.a.get(t).then(function(t){var i=t.data;return e.dataFetchedHandler(i)}).catch(function(t){return e.logger.warning("Could not send request for loading layer content (".concat(t.message,")")),Promise.reject(t)}).then(function(){e.framework.getActiveMap().setLayerLoading(e,!1)})}return this._dataFetchedPromise}},{key:"handleLocaleChanged",value:function(){if(this._dataFetchedPromise){var e=this.active;e&&this.activate(!1),this.removeAllFeatures(),this._dataFetchedPromise=null,e&&this.activate(!0)}}},{key:"getFilter",value:function(){if(this.filter)return this.filter;for(var e=this.source.getFeatures(),t={},i=0;i<e.length;i++){var n=e[i].get(this.filterAttribute);if(n)if(Array.isArray(n))for(var r=0;r<n.length;r++){var a=n[r];a&&(this.filterAttributeName?t[a[this.filterAttributeName]]=!0:t[a]=!0)}else"string"===typeof n?t[n]=!0:"object"===Object(s["a"])(n)&&this.filterAttributeName&&(t[n[this.filterAttributeName]]=!0);else t[this.noFilterValue]=!0}var o=[];for(var l in t)o.push(l);return o}},{key:"setFilter",value:function(e){this.activeFilter=e;for(var t=this.source.getFeatures(),i=0;i<t.length;i++){var n=t[i].get(this.filterAttribute),r=!1;if(n){if(Array.isArray(n))for(var a=0;a<n.length;a++)if(this.filterAttributeName){if(n[a][this.filterAttributeName]){var o=e.indexOf(n[a][this.filterAttributeName]);if(o>-1){r=!0;break}}}else{o=e.indexOf(n[a]);if(o>-1){r=!0;break}}else if("string"===typeof n){o=e.indexOf(n);if(o>-1){r=!0;break}}else if("object"===Object(s["a"])(n)&&this.filterAttributeName){o=e.indexOf(n[this.filterAttributeName]);if(o>-1){r=!0;break}}}else{o=e.indexOf(this.noFilterValue);o>-1&&(r=!0)}r?t[i].setGeometryName("geometry"):t[i].setGeometryName("hidden")}}},{key:"dataFetchedHandler",value:function(e){var t=this;try{return e?(e.logo&&(this.logo=this.baseUrl+e.logo),e.name&&(this.options.title=e.name),e.category&&(this.options.category=e.category),this._createStyle().then(function(){var i=e.locations;if(i){var n=[];i.forEach(function(e){var t=this._createLocation(e);t&&n.push(t)},t),t.addFeatures(n)}return t.activeFilter&&t.setFilter(t.activeFilter),!0})):Promise.resolve()}catch(i){return this.logger.warning("Could not load WSV json: ".concat(i.message)),Promise.reject()}}},{key:"_createStyle",value:function(){var e,t=this;return this.iconManagerInUse?(e=this.dedicatedIcon?Gr.getInstance().getStyleForDedicatedIcon(this.name,this.dedicatedIcon):Gr.getInstance().getStyleForColor(this.name,this.iconColor,this.useSquareShapeAsOuter),e.then(function(e){e.getImage().setScale(t.scaleUnselected),t.setStyle(e);var i=e.clone();return i.getImage().setOpacity(0),t.setHighlightStyle(i),!0})):(this.setStyle(new ol.style.Style({image:new ol.style.Icon({src:this.logo,scale:this.scaleUnselected})})),this.setHighlightStyle(new ol.style.Style({image:new ol.style.Icon({src:this.logo,scale:this.scaleSelected})})),Promise.resolve())}},{key:"_createLocation",value:function(e){if(!e.address||!e.address.x||!e.address.y||!e.name||!e.id)return!1;var t="&amp;",i=/&(?!([a-zA-Z0-9]+|#([0-9]+|x[A-Z0-9]+));)/g,n=new ol.Feature;e.id="".concat(this.name,"_").concat(e.id),n.setId(e.id),n.setProperties({name:e.name.replace(i,t)});var r=this.wsvProjection.transformTo(this.projection,[e.address.x,e.address.y]),a=new ol.geom.Point(r);if(this.extent.isValid()){var s=a.clone();if(s.transform(ol.proj.get("EPSG:4326"),this.extent.projection.getProjection()),!s.intersectsExtent(this.extent.extent))return!1}return n.setGeometry(a),n.setProperties(e),e.logo&&(n.setProperties({logo:this.baseUrl+e.logo}),e.logosize&&e.logosize.width&&e.logosize.height&&(n.setProperties({width:e.logosize.width}),n.setProperties({height:e.logosize.height}))),e.address&&e.address.city?n.setProperties({city:e.address.city.replace(i,t)}):n.setProperties({city:""}),e.address&&e.address.zip?n.setProperties({zip:e.address.zip}):n.setProperties({zip:""}),e.address&&e.address.street?n.setProperties({street:e.address.street.replace(i,t)}):n.setProperties({street:""}),e.contact&&e.contact.website?n.setProperties({website:e.contact.website}):n.setProperties({website:""}),n.setProperties({placemarkurl:"".concat(this.baseUrl,"/").concat(this.framework.getLocale(),"/location/").concat(e.id)}),this.options.title&&n.setProperties({layername:this.options.title}),this.options.category&&n.setProperties({category:this.options.category}),n}}]),t}(_n),Br=Vr,Ur=i(89),Wr=i.n(Ur),qr=i(648),Jr=i.n(qr);function Kr(e,t,i,n){return Kr="undefined"!==typeof Reflect&&Jr.a?Jr.a:function(e,t,i,n){var r,a=Te(e,t);if(a){if(r=Me()(a,t),r.set)return r.set.call(n,i),!0;if(!r.writable)return!1}if(r=Me()(n,t),r){if(!r.writable)return!1;r.value=i,Wr()(n,t,r)}else Object(oe["a"])(n,t,i);return!0},Kr(e,t,i,n)}function Zr(e,t,i,n,r){var a=Kr(e,t,i,n||e);if(!a&&r)throw new Error("failed to set property");return i}var Qr=Y.getLogger("vcs.vcm.layer.FeatureStoreChanges"),Xr=function(){function e(t){Object(d["a"])(this,e),this.layer=t,this._changesListeners={addfeature:null,changefeature:null,removefeature:null},this._addedFeatures=new Set,this._editedFeatures=new Set,this._removedFeatures=new Set,this._convertedFeatures=new Set,this.values={changed:!1}}return Object(m["a"])(e,[{key:"track",value:function(){null===this._changesListeners.addfeature&&(this._changesListeners.addfeature=this.layer.source.on("addfeature",this._featureAdded.bind(this))),null===this._changesListeners.changefeature&&(this._changesListeners.changefeature=this.layer.source.on("changefeature",this._featureChanged.bind(this))),null===this._changesListeners.removefeature&&(this._changesListeners.removefeature=this.layer.source.on("removefeature",this._featureRemoved.bind(this)))}},{key:"getChanges",value:function(){return{add:Object(T["a"])(this._addedFeatures),edit:Object(T["a"])(this._editedFeatures),remove:Object(T["a"])(this._removedFeatures)}}},{key:"commitChanges",value:function(e){var t=this,i=[];this._addedFeatures.forEach(function(e){var t=yr(e,{writeStyle:!0});i.push({action:"add",feature:t,original:e,success:function(t){e.setId(t),e[$n]=er.DYNAMIC}})}),this._editedFeatures.forEach(function(e){var t=yr(e,{writeStyle:!0});t._id=e.getId(),t.geomety="test",i.push({action:"edit",original:e,feature:t,success:function(){e[$n]===er.STATIC&&(e[$n]=er.EDITED)}})}),this._removedFeatures.forEach(function(e){var t=e.getId();i.push({original:e,action:"remove",feature:{_id:t},success:function(){}})});var n=Promise.resolve();return i.length&&(n=ce.a.post(e.toString(),i.map(function(e){return{action:e.action,feature:e.feature}})).then(function(e){var n=e.data,r=n.failedActions.map(function(e){var n=e.index,r=e.error,a=i[n];return Qr.log("failed action ".concat(a.action,": ").concat(r)),i[n]=null,t._resetFeature(a.original)});return i.filter(function(e){return e}).forEach(function(e){var t=e.action,i=e.success;"add"===t?i(n.insertedIds.shift()._id):i()}),Promise.all(r)})),n.then(function(){var e=[];t._convertedFeatures.forEach(function(i){e.push(t._resetFeature(i))}),Promise.all(e)}).then(function(){t._resetValues()}).catch(function(e){t._resetValues(),Qr.error(e.message)})}},{key:"reset",value:function(){var e=this,t=[];return this._addedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._editedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._removedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),this._convertedFeatures.forEach(function(i){t.push(e._resetFeature(i))}),Promise.all(t).then(function(){e._resetValues()}).catch(function(t){Qr.error(t),e._resetValues()})}},{key:"_resetFeature",value:function(e){var t=this,i=[e.getId()];return e[$n]?e[$n]===er.STATIC?(this.layer.removeFeaturesById(i),this.layer.hiddenStaticFeatureIds.delete(e.getId()),this.layer.showObjects(i),Promise.resolve()):this.layer.injectedFetchDynamicFeatureFunc(e.getId()).then(function(e){var n=fr(e),r=n.features;t.layer.removeFeaturesById(i),t.layer.addFeatures(r)}).catch(function(e){Qr.error("failed to reset feature, giving up",e.message)}):(this.layer.removeFeaturesById(i),Promise.resolve())}},{key:"_resetValues",value:function(){this._addedFeatures.clear(),this._editedFeatures.clear(),this._removedFeatures.clear(),this._convertedFeatures.clear(),this.values.changed=!1}},{key:"unTrack",value:function(){ol.Observable.unByKey(Object.values(this._changesListeners)),this._changesListeners.addfeature=null,this._changesListeners.changefeature=null,this._changesListeners.removefeature=null,this._resetValues()}},{key:"pauseTracking",value:function(e){this._changesListeners[e]&&(ol.Observable.unByKey(this._changesListeners[e]),this._changesListeners[e]=null)}},{key:"_featureAdded",value:function(e){var t=e.feature;t[$n]?t[$n]===er.STATIC&&(this._convertedFeatures.add(t),this.values.changed=!0):(this._addedFeatures.add(t),this.values.changed=!0)}},{key:"_featureChanged",value:function(e){var t=e.feature;t[$n]&&(this._convertedFeatures.delete(t),this._editedFeatures.add(t),this.values.changed=!0)}},{key:"_featureRemoved",value:function(e){var t=e.feature;t[$n]?(this._removedFeatures.add(t),this._editedFeatures.delete(t),this._convertedFeatures.delete(t),this.values.changed=!0):this._addedFeatures.delete(t)}},{key:"removeFeature",value:function(e){o(e,ol.Feature),this._featureRemoved({feature:e})}},{key:"addFeature",value:function(e){o(e,ol.Feature),this._featureAdded({feature:e})}},{key:"editFeature",value:function(e){o(e,ol.Feature),this._featureChanged({feature:e})}},{key:"dispose",value:function(){this.unTrack(),this.layer=null}},{key:"active",get:function(){return Object.values(this._changesListeners).some(function(e){return null!==e})}}]),e}(),$r=Xr;Dt.FEATURESTORE=Dt.lastLayerId,Dt.lastLayerId+=1;var ea=function(e){function t(e){var i;Object(d["a"])(this,t);var n=Object.assign({altitudeMode:"clampToGround",layerType:Dt.FEATURESTORE,className:t.className,projection:R.createMercatorProjection().getConfigObject()},e);if(i=y(this,b(t).call(this,n)),i.extent.projection=R.createMercatorProjection(),i.layerId=e.id,i.staticRepresentation=e.staticRepresentation||{},i.hiddenStaticFeatureIds=new Set(e.hiddenStaticFeatureIds||[]),i.changeTracker=new $r(f(i)),i.vcsMeta=e.vcsMeta||{},i.setVcsMeta(i.vcsMeta),i.injectedFetchDynamicFeatureFunc=e.injectedFetchDynamicFeatureFunc,i._staticFeaturesLayer=new Er({cesiumTilesetLayerOptions:{url:i.staticRepresentation.threeDim,screenSpaceError:i.vcsMeta.screenSpaceError?i.vcsMeta.screenSpaceError:4},openlayersTiledLayerOptions:i.staticRepresentation.twoDim?{url:i.staticRepresentation.twoDim}:void 0,name:i.name,style:i.style,genericFeatureProperties:i._genericFeatureProperties}),i._staticFeaturesExtent=null,i._setEditing=null,e.features){var r={type:"FeatureCollection",features:e.features,vcsMeta:e.vcsMeta},a=fr(r,{targetProjection:R.createMercatorProjection(),dynamicStyle:!0}),s=a.style,o=a.features;s&&(i.defaultStyle=s,i._staticFeaturesLayer.defaultStyle=s,i.setStyle(s)),i.addFeatures(o)}return i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.FeatureStore"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(Se(b(t.prototype),"initialize",this).call(this),this._staticFeaturesLayer.initialize(),this._hideDynamicFeatures())}},{key:"getVcsMeta",value:function(e){var i=Se(b(t.prototype),"getVcsMeta",this).call(this,e);return i}},{key:"synchronizeImplementations",value:function(e,i){var n=this;return Se(b(t.prototype),"synchronizeImplementations",this).call(this,e,i).then(function(){return n._staticFeaturesLayer.synchronizeImplementations(e,i)})}},{key:"_hideDynamicFeatures",value:function(){var e=[];this.hiddenStaticFeatureIds.forEach(function(t){e.push(t)}),this._staticFeaturesLayer.hideObjects(e)}},{key:"activate",value:function(e){var i=this;return Se(b(t.prototype),"activate",this).call(this,e).then(function(){return i._staticFeaturesLayer.activate(e)}).then(function(){i._setEditing&&i.setEditing(i._setEditing.symbol,i._setEditing.featureType)}).catch(function(e){i.logger.error(e)})}},{key:"setStyle",value:function(e,i){var n=this.changeTracker.active;n&&this.changeTracker.pauseTracking("changefeature"),Se(b(t.prototype),"setStyle",this).call(this,e,i),this._staticFeaturesLayer.setStyle(e,i),n&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"getExtent",value:function(){var e=this.source.getExtent();if(this._staticFeaturesExtent)e=ol.extent.extend(e,this._staticFeaturesExtent);else if(this._staticFeaturesLayer.active){var t=this.framework.getActiveMap();if("vcs.vcm.maps.Cesium"===t.className){var i=this._staticFeaturesLayer.getImplementation(t),n=i.cesium3DTileset.root.boundingVolume.rectangle,r=Cesium.Rectangle.southwest(n),a=Cesium.Rectangle.northeast(n),s=R.wgs84ToMercator([Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude)]),o=R.wgs84ToMercator([Cesium.Math.toDegrees(a.longitude),Cesium.Math.toDegrees(a.latitude)]);this._staticFeaturesExtent=[s[0],s[1],o[0],o[1]],e=ol.extent.extend(e,this._staticFeaturesExtent)}}return this.extent.extent=e,this.extent}},{key:"setEditing",value:function(e,t){var i=this.framework.getMapByType("vcs.vcm.maps.Cesium");if(this._staticFeaturesLayer.setEditing(e,t),i){var n=this._staticFeaturesLayer.getImplementation(i);n.initialized?(null!=t?n.cesium3DTileset[e]=t:delete n.cesium3DTileset[e],this._setEditing=null):this._setEditing={symbol:e,featureType:t}}}},{key:"hideObjects",value:function(e){Se(b(t.prototype),"hideObjects",this).call(this,e),this._staticFeaturesLayer.hideObjects(e)}},{key:"showObjects",value:function(e){var i=this;Se(b(t.prototype),"showObjects",this).call(this,e);var n=e.filter(function(e){return!i.hiddenStaticFeatureIds.has(e)});this._staticFeaturesLayer.showObjects(n)}},{key:"clearHiddenObjects",value:function(){Se(b(t.prototype),"clearHiddenObjects",this).call(this),this._staticFeaturesLayer.clearHiddenObjects(),this._hideDynamicFeatures()}},{key:"highlight",value:function(e){Se(b(t.prototype),"highlight",this).call(this,e),this._staticFeaturesLayer.highlight(e)}},{key:"unHighlight",value:function(e){Se(b(t.prototype),"unHighlight",this).call(this,e),this._staticFeaturesLayer.unHighlight(e)}},{key:"clearHighlighting",value:function(){Se(b(t.prototype),"clearHighlighting",this).call(this),this._staticFeaturesLayer.clearHighlighting()}},{key:"objectClickedHandler",value:function(e,i,n){return e[Or]?this._staticFeaturesLayer.objectClickedHandler(e,i,n||this):e instanceof ol.Feature&&Se(b(t.prototype),"objectClickedHandler",this).call(this,e,i,n||this)}},{key:"getGenericFeatureFromClickedObject",value:function(e){if(e instanceof ol.Feature)return Se(b(t.prototype),"getGenericFeatureFromClickedObject",this).call(this,e);var i=this._staticFeaturesLayer.getGenericFeatureFromClickedObject(e);return i.layerName=this.name,i.layerClass=this.className,i}},{key:"determineHighlightStyle",value:function(e,i){var n=this.getFeatureById(e);return n||i instanceof ol.Feature?Se(b(t.prototype),"determineHighlightStyle",this).call(this,e,i):this._staticFeaturesLayer.determineHighlightStyle(e,i)}},{key:"setMaximumScreenSpaceError",value:function(e){this._staticFeaturesLayer.setMaximumScreenSpaceError(e)}},{key:"switchStaticFeatureToDynamic",value:function(e){var t=this;return this.hiddenStaticFeatureIds.has(e)?Promise.resolve(this.getFeatureById(e)):this.injectedFetchDynamicFeatureFunc?this.injectedFetchDynamicFeatureFunc(e).then(function(i){var n=fr(i,{targetProjection:R.createMercatorProjection(),defaultStyle:t.defaultStyle instanceof gt?t.defaultStyle:vt}),r=n.features;return t._staticFeaturesLayer.hideObjects([e]),t.hiddenStaticFeatureIds.add(e),t.addFeatures(r),r[0]}).catch(function(e){t.logger.error(e.message)}):Promise.reject(new Error("no injected fetching function"))}},{key:"removeStaticFeature",value:function(e){this._staticFeaturesLayer.hideObjects([e]),this.hiddenStaticFeatureIds.add(e);var t=new ol.Feature;t.setId(e),t[$n]=er.STATIC,this.changeTracker.removeFeature(t)}},{key:"dispose",value:function(){this.removeAllFeatures(),this._staticFeaturesLayer.dispose(),this.changeTracker.dispose(),Se(b(t.prototype),"dispose",this).call(this)}},{key:"altitudeMode",get:function(){return this._altitudeMode},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"altitudeMode",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"skirt",get:function(){return this._skirt},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"skirt",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"storeyHeight",get:function(){return this._storeyHeight},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"storeyHeight",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"classificationType",get:function(){return this._classificationType},set:function(e){var i=this.changeTracker.active;i&&this.changeTracker.pauseTracking("changefeature"),Zr(b(t.prototype),"classificationType",e,this,!0),i&&(this.changeTracker.track(),this.changeTracker.values.changed=!0)}},{key:"screenSpaceErrorMobile",get:function(){return this._staticFeaturesLayer.screenSpaceErrorMobile}},{key:"screenSpaceError",get:function(){return this._staticFeaturesLayer.screenSpaceError}}]),t}(_n),ta=ea;B.WIDGET_ACTIVATED="WIDGET_ACTIVATED",B.WIDGET_DEACTIVATED="WIDGET_DEACTIVATED",B.WIDGET_STATE_CHANGED="WIDGET_STATE_CHANGED";var ia,na=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.title=e.title?e.title:null,i.supportedMaps=e.supportedMaps?e.supportedMaps:["ALL"],i.initializeKey=null,i.initialized=!1,i.active=!1,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){if("ALL"===this.supportedMaps[0])return!0;var e=this.framework.getActiveMap();return this.isSupported(e)?(this.initializeKey&&this.framework.unsubscribeByKey(this.initializeKey),this.framework.subscribe(B.MAP_ACTIVATED,this.handleMapChangeEvent.bind(this)),!0):(this.initializeKey||(this.initializeKey=this.framework.subscribe(B.MAP_ACTIVATED,this.initialize.bind(this))),!1)}}},{key:"initializedFinished",value:function(){"ALL"!==this.supportedMaps[0]&&this.handleMapChangeEvent(this.framework.getActiveMap())}},{key:"dispose",value:function(){}},{key:"isActive",value:function(){return this.logger.deprecate("isActive","please use the property .active directly"),this.active}},{key:"activate",value:function(){this.active||(this.active=!0,this.framework.publish(B.WIDGET_ACTIVATED,this))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.framework.publish(B.WIDGET_DEACTIVATED,this))}},{key:"handleURLParameter",value:function(e){}},{key:"getLink",value:function(e){}},{key:"isSupported",value:function(e){o(e,[Ee,String]);var t=e instanceof Ee?e.className:e;return"ALL"===this.supportedMaps[0]||-1!==this.supportedMaps.indexOf(t)}},{key:"getSupportedMaps",value:function(){return this.supportedMaps}},{key:"handleMapChangeEvent",value:function(e){this.isSupported(e)?this.framework.publish(B.WIDGET_STATE_CHANGED,this):(this.framework.publish(B.WIDGET_STATE_CHANGED,this),this.deactivate())}},{key:"isInitialized",value:function(){return this.initialized}}]),t}(A),ra=na,aa=Y.getLogger("vcs.vcm.widgets.legend.TreeItem"),sa=function(){function e(t){Object(d["a"])(this,e),this.className=t.className,this.titleObject=t.title,this.infoUrl=t.infoUrl?t.infoUrl:null,this.infoUrlTarget=t.infoUrlTarget?t.infoUrlTarget:null,this.viewpointName=t.viewpointName?t.viewpointName:null,this.level=0,this.visible=!1,this.disabled=!1,this.id=t.name||Object(u["c"])(),this.focus=!1,this.initialized=!1,this.showInLegendIfDisabled=Object(u["e"])(t.showInLegendIfDisabled,!0)}return Object(m["a"])(e,[{key:"initialize",value:function(e){return this.initialized||(this.level=e),!0}},{key:"isInitialized",value:function(){return aa.deprecate("isInitialized","access the property .initialized directly."),this.initialized}},{key:"activate",value:function(e,t){}},{key:"mapChanged",value:function(e){}},{key:"layerChanged",value:function(e){}},{key:"getViewPoint",value:function(){return aa.deprecate("getViewPoint","use goToViewpoint instead or access the .viewpointName property."),this.viewpointName?ne.getInstance().getViewPointByName(this.viewpointName):null}},{key:"gotoViewpoint",value:function(){if(this.viewpointName){var e=ne.getInstance(),t=e.getViewPointByName(this.viewpointName);t&&e.getActiveMap().gotoViewPoint(t)}}}]),e}(),oa=sa,la=function(e){function t(e){var i;if(Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.factory=e.factory,i.startopen=Object(u["e"])(e.startOpen,!1),i.clickable=Object(u["e"])(e.clickable,!0),i.open=i.startopen,i.children=[],i.state="inactive",Array.isArray(e.children)){for(var n=e.children,r=0;r<n.length;r++){var a=n[r],s=i.factory(a);s&&s instanceof oa&&i.children.push(s)}if(e.clusterIcons){var o=[],l=function e(t){t.children?t.children.forEach(e):o.push({name:t.layerName,title:t.title,parent:{id:i.id,title:i.titleObject}})};if(n.forEach(l),"string"===typeof e.clusterIcons){var c=ne.getInstance(),h=c.getLayerByName(e.clusterIcons);h&&h instanceof Pr?h.addLayers(o):c.addLayer(new Pr({name:e.clusterIcons,clusterLayers:o,activeOnStartup:!0}))}}}return i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(e){var i=this;if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;var n=[];this.children.forEach(function(e,t){e.initialize(i.level+1)||n.push(t)});for(var r=n.length-1;r>-1;r--)this.children.splice(n[r],1)}return!0}},{key:"setState",value:function(){if(this.visible){var e=null,t=function(t){t.visible&&t.state&&(e?"active"===e||"inactive"===e?e!==t.state&&(e="loading"===t.state?t.state:"indeterminate"):"indeterminate"===e&&"loading"===t.state&&(e=t.state):e=t.state)};this.children.forEach(t),this.state=e}}},{key:"activate",value:function(e,t){this.children.forEach(function(t){t.activate(e,!0)},this),this.setState(),e&&!t&&this.gotoViewpoint()}},{key:"mapChanged",value:function(e){this.children.forEach(function(t){t.mapChanged(e)},this),this.visible=!!this.children.find(function(e){return e.visible}),this.setState()}},{key:"layerChanged",value:function(e){this.children.forEach(function(t){t.layerChanged(e)},this),this.visible=!!this.children.find(function(e){return e.visible}),this.setState()}}]),t}(oa),ca=la,ua=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.startopen=!0,i.clickable=!1,i.open=!0,i.breakAfter=!!e.breakAfter,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.ClusterItem"}}]),t}(ca),ha=ua,da=Y.getLogger("vcs.vcm.widgets.legend.LayerItem"),ma=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerName=e.layerName?e.layerName:"",i.availableStyles=e.availableStyles||[],e.styles&&(da.deprecate("styles","define styles in the config and add their names as availableStyles, do not define them in the LayerItem config"),e.styles.forEach(function(e){e.name||("string"===typeof e.title?e.name=e.title:e.name=Object(u["c"])()),ne.getInstance().addStyle(new Tt(e)),i.availableStyles.push(e.name)})),i.state="inactive",i.activeStyleName=null,i.hasFeatureListView=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.LayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;var i=ne.getInstance().getLayerByName(this.layerName);if(!i)return da.warning("Could not find Layer with name ".concat(this.layerName," Legend LayerItem for layer is not shown")),this.visible=!1,!1;this.activeStyleName=i.style?i.style.name:null}return!0}},{key:"layerChanged",value:function(e){e.name===this.layerName&&this.setState()}},{key:"mapChanged",value:function(e){var t=ne.getInstance().getLayerByName(this.layerName);t&&(this.visible=t.isSupported(e),this.setState())}},{key:"setState",value:function(){if(this.visible){var e=ne.getInstance().getLayerByName(this.layerName);e&&(e.active?this.state="active":this.state="inactive")}}},{key:"activate",value:function(e,t){var i=this;if("loading"!==this.state){var n=ne.getInstance().getLayerByName(this.layerName);n&&n.isSupported()&&n.active!==e&&(e&&(this.state="loading"),n.activate(e).then(function(){i.setState(),e&&!t&&i.gotoViewpoint()}).catch(function(){i.visible=!1}))}}},{key:"isIconManagerInUse",value:function(){var e=ne.getInstance().getLayerByName(this.layerName);return!!e&&e.iconManagerInUse}}]),t}(oa),fa=ma,ya=Y.getLogger("vcs.vcm.widgets.legend.GroupLayerItem"),ga=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerNames=e.layerNames||e.layerName||[],e.layerName&&ya.deprecate("option.layerName","Use option.layerNames instead"),i.state="inactive",i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.GroupLayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){Se(b(t.prototype),"initialize",this).call(this,e);var i=ne.getInstance(),n=[],r=this.layerNames.every(function(e){var t=i.getLayerByName(e);return t?(n.push(t),!0):(ya.warning("Could not find Layer with name ".concat(e," Legend GroupLayerItem is not shown")),!1)});if(!r)return!1;this.visible=n.some(function(e){return e.isSupported()}),this.state=n.every(function(e){return e.active||e.activeOnStartup})?"active":"inactive"}return!0}},{key:"activate",value:function(e,t){var i=this;if(this.setState(),"active"!==this.state&&e||!e){var n=ne.getInstance();this.state=e?"loading":"inactive";var r=this.layerNames.map(function(e){return n.getLayerByName(e)}).map(function(t){return t.activate(e)});e&&!t&&this.gotoViewpoint(),Promise.all(r).then(function(){i.state="indeterminate",i.setState()})}}},{key:"setState",value:function(){var e=ne.getInstance(),t=this.layerNames.map(function(t){return e.getLayerByName(t)}).filter(function(e){return e.isSupported()}).map(function(e){return e.active});("loading"!==this.state||t.every(function(e){return e}))&&(t.every(function(e){return e})?this.state="active":t.some(function(e){return e})?this.state="indeterminate":this.state="inactive")}},{key:"mapChanged",value:function(e){var t=ne.getInstance();this.visible=this.layerNames.map(function(e){return t.getLayerByName(e)}).some(function(t){return t.isSupported(e)}),this.visible&&"active"===this.state&&this.activate(!0)}},{key:"layerChanged",value:function(e){if(this.visible&&this.layerNames.includes(e.name)){if("active"===this.state||"loading"===this.state)return void this.setState();var t=ne.getInstance(),i=this.layerNames.map(function(e){return t.getLayerByName(e)}).every(function(e){return e.initialized&&!e.active||!e.initialized&&!e.activeOnStartup});i&&this.setState()}}}]),t}(oa),va=ga,pa=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.GroupItem"}}]),t}(ca),_a=pa,ba=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.name=e.name,i.plugin=e.plugin,i.config=e.config||{},i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PluginItem"}}]),t}(oa),La=ba,Ma=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layerNames=e.layerNames||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.ViewpointItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(e){if(!this.initialized){if(!Se(b(t.prototype),"initialize",this).call(this,e))return!1;this.viewpointName&&(this.visible=!!ne.getInstance().getViewPointByName(this.viewpointName))}return!0}},{key:"activate",value:function(e,t){t||e&&(this.gotoViewpoint(),this.layerNames.forEach(function(e){var t=ne.getInstance().getLayerByName(e);t&&t.activate(!0)}))}}]),t}(oa),ka=Ma,wa=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.planningInstance=e.planningInstance,i.titleObject=i.planningInstance.name,i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PlanningInstanceItem"}}]),t}(oa),Ta=wa,Sa=Y.getLogger("vcs.vcm.widgets.legend.PlanningClusterItem"),Oa=function(e){function t(e){var i;return Object(d["a"])(this,t),ia?(Sa.warning("trying to instanciate PlanningClusterItem more then once!"),y(i,ia)):(i=y(this,b(t).call(this,e)),ia=f(i),i)}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.PlanningClusterItem"}}]),Object(m["a"])(t,[{key:"destroy",value:function(){ia=void 0}}]),t}(ha),Ca=Oa;function Ea(){return ia}var Ia,Da=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.flightInstance=e.flightName?ne.getInstance().getFlightByName(e.flightName):e.flightInstance,i.titleObject=e.title||i.flightInstance.name,i.allowPlayer=Object(u["e"])(e.allowPlayer,!1),i.visible=!0,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.FlightInstanceItem"}}]),Object(m["a"])(t,[{key:"mapChanged",value:function(e){this.visible=e instanceof Vt}}]),t}(oa),ja=Da;B.LEGEND_INITIALIZED="LEGEND_INITIALIZED";var Pa=(Ia={},Object(oe["a"])(Ia,ha.className,ha),Object(oe["a"])(Ia,fa.className,fa),Object(oe["a"])(Ia,va.className,va),Object(oe["a"])(Ia,_a.className,_a),Object(oe["a"])(Ia,La.className,La),Object(oe["a"])(Ia,Ta.className,Ta),Object(oe["a"])(Ia,ka.className,ka),Object(oe["a"])(Ia,ja.className,ja),Object(oe["a"])(Ia,Ca.className,Ca),Ia),Ya=Y.getLogger("vcs.vcm.widgets.legend.Legend");function xa(e){if(!e.type)return Ya.warning("Need a type to instanciate a Legend Entry"),null;var t=Pa[e.type];return t?(e.factory=xa,new t(e)):(Ya.warning("could not find constructor for ".concat(e.type)),null)}var Aa=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.cluster=[],i.level=-1;var n=[];if(Array.isArray(e.children))for(var r=e.children,a=0;a<r.length;a++){var s=r[a];if(s.type&&s.type===ha.className){var o=xa(s);o&&o instanceof ha&&i.cluster.push(o)}else n.push(s)}if(n.length>0){var l=new ha({children:n,factory:xa});i.cluster.push(l)}i.layerTitles={};var c=function e(t){t.children?t.children.forEach(e,this):t.layerName&&(this.layerTitles[t.layerName]=t.titleObject)};return i.cluster.forEach(c,f(i)),i.zoomToFirstLayer=!!e.zoomToFirstLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.legend.Legend"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.cluster.forEach(function(e){e.initialize(this.level)},this);var i=this.framework.getActiveMap();this.cluster.forEach(function(e){e.mapChanged(i)},this),this.initialized=!0,this.framework.publish(B.LEGEND_INITIALIZED,this),this.framework.subscribe(B.MAP_ACTIVATED,this.mapChanged.bind(this)),this.framework.subscribe(B.LAYER_CHANGED,this.layerChanged.bind(this)),this.framework.subscribe(B.PLANNINGINSTANCES_CHANGED,this.layerChanged.bind(this,{}))}}},{key:"handleURLParameter",value:function(e){if(this.zoomToFirstLayer&&e.layerToActivate){var t=Array.isArray(e.layerToActivate)?e.layerToActivate:[e.layerToActivate],i=function e(i){if(i.children){var n=i.children.find(e);return n&&(i.open=!0,i.startopen=!0,(n instanceof fa||n instanceof va)&&(n.level>0?i.focus=!0:n.focus=!0)),n}return i.layerNames?i.visible&&i.layerNames.every(function(e){return t.includes(e)}):i.visible&&i.layerName&&t.includes(i.layerName)};this.cluster.find(i)}}},{key:"mapChanged",value:function(e){this.cluster.forEach(function(t){t.mapChanged(e)},this)}},{key:"layerChanged",value:function(e){this.cluster.forEach(function(t){t.layerChanged(e)},this)}},{key:"resetLayer",value:function(){for(var e=this.framework.getLayers(),t=0;t<e.length;t++)e[t].active!=e[t].activeOnStartup&&e[t].activate(e[t].activeOnStartup)}},{key:"getLayerTitle",value:function(e){return o(e,String),this.layerTitles[e]||null}},{key:"findTreeItems",value:function(e){var t=[];function i(n){for(var r=0;r<n.length;r++)e(n[r])&&t.push(n[r]),n[r]instanceof ca&&i(n[r].children)}return i(this.cluster),t}}]),t}(ra),Fa=Aa;B.PLANNING_OBJECT_SAVED="PLANNING_OBJECT_SAVED";var Na={GLTF:"gltf",FEATURE_STORE:"featureStore",IMAGE:"image",DRAWING:"drawing",PROCESSING:"processing"},Ha={INITIALIZING:"initializing",CONVERTING:"converting",OPTIMIZING:"optimizing",READY:"ready",FAILED:"failed"},Ra=function(){function e(t){Object(d["a"])(this,e),this.name=t.name?t.name:"think of something",this._id=t._id,this.planningInstanceId=t.planningInstanceId,this.type=t.type,this.created=t.created,this.lastUpdated=t.lastUpdated||null,this.allowPicking=t.allowPicking,this.status=t.status,this._onServiceUrl=t.url,this.serviceUrl=t.serviceUrl;var i=this.serviceUrl.clone();i.clearQueryParams(),this.url=t.url?i.extendPath("..",t.url).toString():null,this.description=t.description,this.positionFields=[],this.visible=Object(u["e"])(t.visibility,!0),this.supportedMaps=[],this.supported=!1,this.properties=t.properties||{}}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObject"}}]),Object(m["a"])(e,[{key:"initialize",value:function(){var e=ne.getInstance().getActiveMap();this.handleMapChange(e)}},{key:"getDefinition",value:function(){return{_id:this._id,planningId:this.planningInstanceId,name:this.name,description:this.description,type:this.type,visibility:this.visible,url:this.getDefinitionUrl()}}},{key:"handleMapChange",value:function(e){this.isSupported(e)}},{key:"isSupported",value:function(e){this.supported=0===this.supportedMaps.length||this.supportedMaps.indexOf(e.className)>-1}},{key:"save",value:function(){var e=this.serviceUrl.clone().extendPath("edit-object");return ce.a.post(e.toString(),this.getDefinition()).then(function(){ne.getInstance().publish(B.PLANNING_OBJECT_SAVED)})}},{key:"delete",value:function(){var e=this.serviceUrl.clone().extendPath("delete-object");return ce.a.post(e.toString(),{_id:this._id,planningId:this.planningInstanceId})}},{key:"getDefinitionUrl",value:function(){return this._onServiceUrl}},{key:"load",value:function(){}},{key:"unload",value:function(){}},{key:"hide",value:function(){this.visible=!1,this.unload()}},{key:"show",value:function(){this.visible=!0}},{key:"isPlaced",value:function(){return!0}},{key:"zoomTo",value:function(){}},{key:"destroy",value:function(){}},{key:"getConfigObject",value:function(){return{url:this.url,attributes:{name:this.name,description:this.description}}}}]),e}(),za=Ra,Ga=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.planningInstanceGltfLayerName=e.planningInstanceGltfLayerName,i.latitude=e.modelMeta.latitude,i.longitude=e.modelMeta.longitude,i.height=null!=e.modelMeta.height?e.modelMeta.height:0,i.heading=e.modelMeta.heading,i.heading=i.heading>180?i.heading-360:i.heading,i.pitch=e.modelMeta.pitch,i.roll=e.modelMeta.roll,i.scale=e.modelMeta.scale,i.positionFields=["longitude","latitude","height","heading","pitch","roll","scale"],i.supportedMaps=["vcs.vcm.maps.Cesium"],i.entityId=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectGltf"}}]),Object(m["a"])(t,[{key:"handleMapChange",value:function(e){if(Se(b(t.prototype),"handleMapChange",this).call(this,e),this.supported&&!this.entityId){var i=this.getModelLayer();this.entityId=i.addObject(this.getConfigObject())}}},{key:"getModelLayer",value:function(){var e=ne.getInstance().getLayerByName(this.planningInstanceGltfLayerName);return e}},{key:"getDefinition",value:function(){var e=this,i=Se(b(t.prototype),"getDefinition",this).call(this),n={};return this.positionFields.forEach(function(t){n[t]=e[t]}),i.modelMeta=n,i}},{key:"resetModelMatrix",value:function(){if(this.entityId){var e=this.getModelLayer();e.updateEntityById(this.entityId,this.getConfigObject())}}},{key:"zoomTo",value:function(){this.isPlaced()&&this.getModelLayer().flyToEntity(this.entityId)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.entityId&&this.getModelLayer().hideObjects([this.entityId])}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.entityId&&this.getModelLayer().showObjects([this.entityId])}},{key:"setObjectOntoTerrain",value:function(){var e=this,t=ne.getInstance().getLayers(),i=t.find(function(e){return e instanceof zt&&e.isActive()});return Ht(i.cesiumTerrainProvider,[[this.longitude,this.latitude]]).then(function(t){e.height=t[0][2]})}},{key:"isPlaced",value:function(){var e=this,t=[];return this.positionFields.forEach(function(i){var n=e[i];-1===t.indexOf(n)&&t.push(n)}),!(0===t[0]&&1===t[1]&&2===t.length)}},{key:"destroy",value:function(){this.entityId&&this.getModelLayer().removeObjectById(this.entityId)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.latitude=this.latitude,e.longitude=this.longitude,e.height=this.height,e.heading=this.heading,e.pitch=this.pitch,e.roll=this.roll,e.scale=this.scale,e.allowPicking=this.allowPicking,e.show=this.visible,e}}]),t}(za),Va=Ga,Ba=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.extent=[-.5,-.5,.5,.5],e.imageMeta.extent&&i._setExtent(e.imageMeta.extent),i.opacity=e.imageMeta.opacity,i.credit=e.imageMeta.credit,i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.editorId=e.editorId,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectImage"}}]),Object(m["a"])(t,[{key:"load",value:function(){if(!this.getImageLayer()){var e=new Mr({name:this._id,url:this.url,imageExtent:this.extent,opacity:this.opacity,credit:this.credit});ne.getInstance().addLayer(e)}this.visible&&this.getImageLayer().activate(!0)}},{key:"unload",value:function(){var e=this.getImageLayer();e&&e.activate(!1)}},{key:"isPlaced",value:function(){return!this.extent.every(function(e){return.5===Math.abs(e)})}},{key:"getImageLayer",value:function(){var e=ne.getInstance().getLayerByName(this._id);return e}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.imageMeta={extent:this.extent,opacity:this.opacity,credit:this.credit},e}},{key:"zoomTo",value:function(){if(this.isPlaced()){var e=ne.getInstance().getActiveMap(),t=V.createViewPointFromExtent(this.extent);t.setHeading(0),t.setPitch(-90),t.setRoll(0),e.gotoViewPoint(t)}}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.getImageLayer();e&&e.activate(!0)}},{key:"setOpacity",value:function(e){o(e,Number),this.opacity=e,this.getImageLayer().setOpacity(e)}},{key:"setExtent",value:function(e,t){o(e,[Number]),o(e.length,4),l(t,R);var i=this._setExtent(e,t);i.isValid()&&this.getImageLayer().setExtent(this.extent)}},{key:"_setExtent",value:function(e,t){var i=t?t.epsg:void 0;if(!i){var n=ol.extent.containsExtent(Ae.WGS_84_EXTENT,e);i=n?"EPSG:4326":i}var r=new Ae({coordinates:e,epsg:i});return r.isValid()&&r.getCoordinatesInProjection(R.createGeographicProjection(),this.extent),r}},{key:"destroy",value:function(){var e=this.getImageLayer();e&&e.dispose()}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.extent=this.extent,e.credit=this.credit,e.opacity=this.opacity,e}}]),t}(za),Ua=Ba,Wa=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i._onSelect=[],i._onCesiumSelect=[],i.featureMap=new Map,i.cesiumFeatureMap=new Map,i.state=e,i._defaultActive=me.CLICK,i._defaultModificationKey=de.NONE,i.modificationKey=i._defaultModificationKey,i.maintainSelection=!1,i.setActive(!1),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.state.featureTypeSymbol]&nn.EDITABLE&&!(e.feature[this.state.featureTypeSymbol]&nn.EDITING)?(e.key&de.NONE?this.selectFeature(e.feature):e.key&de.CTRL&&this.selectionSetClick(e.feature),e.stopPropagation=!(this.state.mode&tn.PROPAGATEONSELECT)):e.key&de.NONE&&(!e.feature||!e.feature[this.state.featureTypeSymbol]&&this.state.mode&(tn.EDIT|tn.SELECT))&&this.state.selectedFeatures>0&&this.clearSelectionSet(),Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,e),this.maintainSelection=!1}},{key:"hasMultiSelect",value:function(){this._defaultModificationKey&de.CTRL||(this._defaultModificationKey|=de.CTRL,this.setModification())}},{key:"selectFeature",value:function(e){this.state.mode&tn.TRANSLATE&&this.featureMap.has(e.getId())||(this.clearSelectionSet(!0),e[Or]?(this.cesiumFeatureMap.set(e.getId(),e),this.state.selectedCesiumFeatures=this.cesiumFeatureMap.size,this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this._setState(e),this._cesiumCb()):(this.featureMap.set(e.getId(),e),this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this._setState(e)),this._cb())}},{key:"_setState",value:function(e){if(e){this.state.selectedFeatureId=e.getId(),this.state.layerName=e[At.vcsLayerNameSymbol];var t=e.getProperty("olcs_classificationType");t&&on[t]?this.state.classificationType=on[t]:this.state.classificationType=this.state.defaultClassificationType;var i=e.getProperty("olcs_altitudeMode");if(i&&sn[i]){var n=sn[i];this.state.altitudeMode&an.ZPLANE&&n&an.ABSOLUTE||(this.state.altitudeMode=n)}else this.state.altitudeMode=this.state.defaultAltitudeMode}else this.state.altitudeMode=this.state.defaultAltitudeMode,this.state.classificationType=this.state.defaultClassificationType,this.state.selectedCesiumFeatures=0,this.state.selectedFeatures=0,this.state.selectedFeatureId=null}},{key:"selectionSetClick",value:function(e,t){var i=e.getId(),n=!e[Or],r=n?this.featureMap.delete(i):this.cesiumFeatureMap.delete(i);r||(n?this.featureMap.set(i,e):this.cesiumFeatureMap.set(i,e)),r?r&&i===this.state.selectedFeatureId&&(this.featureMap.size?this._setState(this.featureMap.values().next().value):this.cesiumFeatureMap.size?this._setState(this.cesiumFeatureMap.values().next().value):this._setState()):(n&&1===this.featureMap.size&&!this.cesiumFeatureMap.size||!n&&1===this.cesiumFeatureMap.size&&!this.featureMap.size)&&this._setState(e),this.state.selectedFeatures=this.featureMap.size+this.cesiumFeatureMap.size,this.state.selectedCesiumFeatures=this.cesiumFeatureMap.size,t||(n?this._cb():this._cesiumCb())}},{key:"clearCesiumSelectionSet",value:function(){var e=!!this.cesiumFeatureMap.size;this.cesiumFeatureMap.has(this.state.selectedFeatureId)&&(this.featureMap.size?this._setState(this.featureMap.values().next().value):this._setState()),this.state.selectedCesiumFeatures=0,this.cesiumFeatureMap.clear(),e&&this._cesiumCb()}},{key:"clearSelectionSet",value:function(e){this.featureMap.clear(),this.clearCesiumSelectionSet(),this._setState(),e||this._cb()}},{key:"onSelect",value:function(e){o(e,Function),this._onSelect.push(e)}},{key:"onCesiumSelect",value:function(e){o(e,Function),this._onCesiumSelect.push(e)}},{key:"_cb",value:function(){for(var e=0;e<this._onSelect.length;e++)this._onSelect[e]()}},{key:"_cesiumCb",value:function(){for(var e=0;e<this._onCesiumSelect.length;e++)this._onCesiumSelect[e]()}}]),t}(pe),qa=Wa,Ja=Y.getLogger("vcs.vcm.util.editor.AbstractEditor"),Ka=function(){function e(t){var i=this;Object(d["a"])(this,e),this.parent=t.parent||null;var n=this.parent?this.parent.scratchLayer:t.scratchLayer;this.scratchLayer=n||new _n({projection:R.createMercatorProjection().getConfigObject(),altitudeMode:"clampToGround",isDynamic:!0,zCoordinateEyeOffset:-1}),this.interactionChain=new be;var r=this.parent?this.parent.state:t.state;this.state=r||{mode:tn.NONE,altitudeMode:an.CLAMP,defaultAltitudeMode:an.CLAMP,allowedGeometries:[],allowedModes:[],onlyAllowTranslation:!1,selectedFeatures:0,selectedCesiumFeatures:0,layerName:null,selectedFeatureId:null,active:!1,featureTypeSymbol:Symbol("featureType"),exclusiveId:Object(u["c"])(),dedicatedFeatureStyle:!1,transformGeometryOnMove:Q.getInstance().transformGeometryOnMove,activeMap:null,isFeatureStore:!1,canSwitchToDynamic:!1,classificationType:on.terrain,defaultClassificationType:on.terrain,isDeclarativeStyle:!1,isLayerStyle:!1},this.isOblique=ne.getInstance().getActiveMap()instanceof Pi,this._mapChangedSubscriptionKey=ne.getInstance().subscribe(B.MAP_ACTIVATED,function(e){i.state.active&&i.handleMapChange(e)}),this.modeChange=new Cesium.Event}return Object(m["a"])(e,[{key:"className",get:function(){return"vcs.vcm.util.editor.AbstractEditor"}}]),Object(m["a"])(e,[{key:"activate",value:function(){this.isOblique=ne.getInstance().getActiveMap()instanceof Pi,this.parent||(this.state.active=!0,this.scratchLayer.activate(!0))}},{key:"deactivate",value:function(){this.parent||(this.state.active=!1,this.scratchLayer.activate(!1))}},{key:"getRootEditor",value:function(){var e=this;while(e.parent)e=e.parent;return e}},{key:"initialize",value:function(){this.interactionChain.initialize(),this.handleMapChange(ne.getInstance().getActiveMap())}},{key:"beforeSetMode",value:function(e){}},{key:"setMode",value:function(e){this.parent||this.beforeSetMode(e),Ja.debug("AbstractEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),o(e,Number),this.interactionChain.chain.forEach(function(e){e.setActive(!1)}),this.state.mode=e,this.modeChange.raiseEvent(e)}},{key:"destroy",value:function(){null!=this._mapChangedSubscriptionKey&&ne.getInstance().unsubscribeByKey(this._mapChangedSubscriptionKey)}},{key:"handleMapChange",value:function(e){this.isOblique=e instanceof Pi}}]),e}(),Za=Ka,Qa=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.zPlane=e.zPlane,i.scene=null,i.plane=null,i.ray=new Cesium.Ray,i.cartographic=new Cesium.Cartographic,i}return w(t,e),Object(m["a"])(t,[{key:"handleMapChange",value:function(e){this.plane=null,this.scene=e instanceof Vt?e.getScene():null}},{key:"createPlane",value:function(e){this.scene&&(this.plane=this.zPlane?ci(e,this.scene):li(e,this.scene))}},{key:"getPosition",value:function(e){var t=e.positionOrPixel.slice();if(this.plane){this.ray=this.scene.camera.getPickRay(e.windowPosition,this.ray);var i=Cesium.IntersectionTests.rayPlane(this.ray,this.plane);i&&(this.cartographic=this.scene.globe.ellipsoid.cartesianToCartographic(i,this.cartographic),this.zPlane?t=R.wgs84ToMercator([Cesium.Math.toDegrees(this.cartographic.longitude),Cesium.Math.toDegrees(this.cartographic.latitude),this.cartographic.height]):t[2]=this.cartographic.height)}return t}}]),t}(pe),Xa=Qa,$a=new ol.style.Style({}),es=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this,{zPlane:!0})),n.editor=e,n.selectFeatureInteraction=e.parent?e.parent.selectFeatureInteraction:null,n.forceZPlane=!!i,n._defaultActive=me.DRAGEVENTS,n._defaultModificationKey=de.ALT,n._lastPosition=null,n._vertex=null,n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=e.type&(me.DRAGEND|me.CLICK);this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._vertex,!(this.editor.state.transformGeometryOnMove||i)),this._lastPosition=t,i&&(this._lastPosition=null,this._vertex.setStyle(this._vertex[ft]?this._vertex[ft].style:null),this._vertex=null,this.editor.feature.set("olcs_allowPicking",!!(this.editor.state.mode&tn.EDIT)),this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0))}else e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&e.type&(me.DRAGSTART|me.CLICK)&&(this.scene&&(this.editor.state.altitudeMode&an.ZPLANE||this.forceZPlane&&this.editor.state.altitudeMode&an.ABSOLUTE)?(this._lastPosition=e.feature.getGeometry().getCoordinates(),this.createPlane(this._lastPosition)):(this.plane=null,this._lastPosition=this.scene?e.feature.getGeometry().getCoordinates():e.positionOrPixel),this._vertex=e.feature,this._vertex.setStyle($a),this.editor.feature.set("olcs_allowPicking",!1),this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!1));return Promise.resolve(e)}}]),t}(Xa),ts=es,is=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!1})),i.editor=e,i.selectFeatureInteraction=e.parent?e.parent.selectFeatureInteraction:null,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.CTRL,i._lastHeight=null,i._vertex=null,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this.scene)if(this._lastHeight){var t=this.getPosition(e),i=e.type&(me.DRAGEND|me.CLICK);this.editor.translateVertexHeight(t[2]-this._lastHeight,this._vertex,!(this.editor.state.transformGeometryOnMove||i)),this._lastHeight=t[2],i&&(this._lastHeight=null,this._vertex=null,this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0))}else if(e.key&de.CTRL&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&e.type&(me.DRAGSTART|me.CLICK)){var n=e.feature.getGeometry().getCoordinates();this._lastHeight=n[2],this.createPlane(n),this._vertex=e.feature,this.selectFeatureInteraction&&this.selectFeatureInteraction.setActive(!0)}return Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,"clampToGround"!==this.editor.feature.get("olcs_altitudeMode")&&e)}}]),t}(Xa),ns=is,rs=Symbol("vertexIndex"),as=Y.getLogger("vcs.vcm.util.editor.AbstractGeometryEditor"),ss=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this,e)),n.creationActive=!1,n.geometry=e.geometry,n.layer=e.layer,n.feature=e.feature,n.vertices=[],n.onFinish=e.onFinish||n.getRootEditor().setMode.bind(f(n),tn.EDIT),n.onRemoved=e.onRemoved||function(){},n._create=null,n._translateVertex=new ts(f(n),i),n.interactionChain.addInteraction(n._translateVertex),n._translateVertexHeight=new ns(f(n)),n.interactionChain.addInteraction(n._translateVertexHeight),n.setAltitudeModeToAbsoluteOnClassification=!0,n}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this._createVertices(),this.feature.set("olcs_allowPicking",!1)}},{key:"_createVertices",value:function(){}},{key:"_createVertex",value:function(e,t){var i=this.feature.get("olcs_extrudedHeight")||this.feature.get("olcs_storeyNumber")&&this.feature.get("olcs_storeyHeight")?this.feature.get("olcs_groundLevel"):0;e[2]=i||e[2]||0;var n=new ol.geom.Point(e);this.isOblique&&(n[_n.alreadyTransformedToImage]=!0);var r=new ol.Feature({geometry:n});r[this.state.featureTypeSymbol]=nn.VERTEX,null!=t&&(r[rs]=t),r[_n.doNotTransform]=!0;var a=this.feature.get("olcs_altitudeMode")||this.layer.altitudeMode;return this.setAltitudeModeToAbsoluteOnClassification&&this.state.classificationType!==on.terrain&&(a="absolute"),r.set("olcs_altitudeMode",a),r}},{key:"getVertexIndex",value:function(e){return this.vertices.findIndex(function(t){return t.getId()===e.getId()})}},{key:"changeVertex",value:function(e,t,i){e.getGeometry().setCoordinates(t),i||this.updateGeometry()}},{key:"translateVertex",value:function(e,t,i,n,r){this.state.altitudeMode&an.ZPLANE?n.getGeometry().translate(e,t):(this.isOblique&&(n.getGeometry()[_n.alreadyTransformedToImage]=!0),n.getGeometry().setCoordinates(i)),r||this.updateGeometry()}},{key:"updateGeometry",value:function(){}},{key:"pushVertex",value:function(e){return null}},{key:"translateVertexHeight",value:function(e,t,i){var n=t.getGeometry(),r=n.getCoordinates();r[2]+=e,n.setCoordinates(r),i||this.updateGeometry()}},{key:"validate",value:function(){return!1}},{key:"_validateOnFinish",value:function(){this.creationActive=!1,this.validate()?this.onFinish():this._removeFeature()}},{key:"_removeFeature",value:function(){if(!this.parent||"vcs.vcm.util.editor.MultiGeometryEditor"!==this.parent.className){var e=ne.getInstance().getLayerByName(this.feature[At.vcsLayerNameSymbol]);e&&e instanceof _n&&e.removeFeaturesById([this.feature.getId()])}this.onRemoved()}},{key:"setAltitudeMode",value:function(e){var t=this.vertices.length;while(t--)this.vertices[t].set("olcs_altitudeMode",e&an.CLAMP?"clampToGround":"absolute");this.state.mode^tn.CREATE&&this.setMode(this.state.mode)}},{key:"stopCreation",value:function(){if(!this.validate()){var e=ne.getInstance().getLayerByName(this.feature[At.vcsLayerNameSymbol]);e&&e instanceof _n&&e.removeFeaturesById([this.feature.getId()])}}},{key:"setMode",value:function(e){as.debug("AbstractGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e})));var i=e;0===this.vertices.length&&(i=tn.CREATE),Se(b(t.prototype),"setMode",this).call(this,i),this.creationActive&&(this.stopCreation(),this.creationActive=!1),i&tn.CREATE?(this.creationActive=!0,this._create.setActive(!0)):i&tn.TRANSLATEVERTEX?(this._translateVertex.setModification(de.NONE),this._translateVertex.setActive(me.CLICKMOVE),this._translateVertexHeight.setModification(de.NONE|de.CTRL),this._translateVertexHeight.setActive(me.CLICKMOVE)):i&tn.GEOMETRYMODES&&(this._translateVertex.setActive(),this._translateVertexHeight.setActive())}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),this._clearVertices(),this.feature.set("olcs_allowPicking",!0)}},{key:"_clearVertices",value:function(){var e=this.vertices.map(function(e){return e.getId()});this.scratchLayer.removeFeaturesById(e),this.vertices.splice(0)}}]),t}(Za),os=ss,ls={selectShift:tn.SELECT|de.SHIFT,selectAlt:tn.SELECT|de.ALT,selectCtrl:tn.SELECT|de.CTRL,editShift:tn.EDIT|de.SHIFT,editAlt:tn.EDIT|de.ALT},cs={auto:"auto",scaleNESW:"nesw-resize",scaleNWSE:"nwse-resize",rotate:"crosshair",translate:"move",select:"pointer",edit:"pointer",translateVertex:"move",removeVertex:"pointer",insertVertex:"cell",addToSelection:"cell",removeFromSelection:"not-allowed"},us=function(e){function t(e){var i,n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n._lastFeature=null,n.features=e.features,n.cesiumFeatures=e.cesiumFeatures,n.state=e.state,n.cursorStyle=ne.getInstance().getMapContainer().style,n._keyDown=(i={},Object(oe["a"])(i,de.SHIFT,!1),Object(oe["a"])(i,de.ALT,!1),Object(oe["a"])(i,de.CTRL,!1),i),n.modifier=0,n.boundKeyListener=n._keyListener.bind(f(n)),n.eventEmitter=xn().eventEmitter,n.hasMultiSelect=!1,n.screenSpaceCameraController=null,n.originalLookEventTypes=[],n.originalTiltEventTypes=[],n._defaultActive=me.MOVE,n._defaultModificationKey=de.ALL,n.modificationKey=n._defaultModificationKey,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.state.featureTypeSymbol]?(this.screenSpaceCameraController&&(e.feature[this.state.featureTypeSymbol]&(nn.VERTEX|nn.HEIGHTVERTEX)?(this.screenSpaceCameraController.lookEventTypes=void 0,this.screenSpaceCameraController.tiltEventTypes=void 0):(this.screenSpaceCameraController.lookEventTypes=this.originalLookEventTypes,this.screenSpaceCameraController.tiltEventTypes=this.originalTiltEventTypes)),this.eventEmitter.setActive(!1),this._lastFeature=e.feature,this._evaluate()):(this.eventEmitter.setActive(),this._lastFeature=null,this.reset()),Promise.resolve(e)}},{key:"setActive",value:function(e){Se(b(t.prototype),"setActive",this).call(this,e),this.active?(window.addEventListener("keydown",this.boundKeyListener),window.addEventListener("keyup",this.boundKeyListener)):(window.removeEventListener("keydown",this.boundKeyListener),window.removeEventListener("keyup",this.boundKeyListener)),this.cursorStyle.cursor=cs.auto}},{key:"reset",value:function(){this.cursorStyle.cursor=cs.auto,this.screenSpaceCameraController&&(this.screenSpaceCameraController.lookEventTypes=this.originalLookEventTypes,this.screenSpaceCameraController.tiltEventTypes=this.originalTiltEventTypes)}},{key:"handleMapChange",value:function(e){e instanceof Vt?(this.screenSpaceCameraController=e.getScene().screenSpaceCameraController,this.screenSpaceCameraController.lookEventTypes&&(this.originalLookEventTypes=Array.isArray(this.screenSpaceCameraController.lookEventTypes)?this.screenSpaceCameraController.lookEventTypes.slice():Object.assign({},this.screenSpaceCameraController.lookEventTypes)),this.screenSpaceCameraController.tiltEventTypes&&(this.originalTiltEventTypes=Array.isArray(this.screenSpaceCameraController.tiltEventTypes)?this.screenSpaceCameraController.tiltEventTypes.slice():Object.assign({},this.screenSpaceCameraController.tiltEventTypes))):this.screenSpaceCameraController=null}},{key:"_evaluate",value:function(){if(this._lastFeature){var e=this.state.mode|this.modifier|this._lastFeature[this.state.featureTypeSymbol];if(e&nn.VERTEX)return(e&ls.selectShift)===ls.selectShift||(e&ls.selectAlt)===ls.selectAlt||e&tn.SCALE?void(this.cursorStyle.cursor=1===this._lastFeature[rs]||3===this._lastFeature[rs]?cs.scaleNWSE:cs.scaleNESW):(e&ls.selectCtrl)===ls.selectCtrl||e&tn.ROTATE?void(this.cursorStyle.cursor=cs.rotate):(e&ls.editShift)===ls.editShift&&!this.state.onlyAllowTranslation||e&tn.REMOVEVERTEX?void(this.cursorStyle.cursor=cs.removeVertex):(e&ls.editAlt)===ls.editAlt||e&tn.TRANSLATEVERTEX?void(this.cursorStyle.cursor=cs.translateVertex):void(this.cursorStyle.cursor=cs.auto);if(e&nn.EDITABLE){var t=this.features.has(this._lastFeature.getId())||this.cesiumFeatures.has(this._lastFeature.getId());return t&&(e&ls.selectAlt)===ls.selectAlt?void(this.cursorStyle.cursor=cs.translate):e&tn.FEATUREMODES&&e&de.CTRL&&this.hasMultiSelect?void(this.cursorStyle.cursor=t?cs.removeFromSelection:cs.addToSelection):e&tn.GEOMETRYMODES&&e&de.CTRL&&!t&&this.hasMultiSelect?void(this.cursorStyle.cursor=cs.addToSelection):e&tn.TRANSLATE?void(this.cursorStyle.cursor=cs.translate):e&tn.EDIT&&t&&this.state.onlyAllowTranslation?void(this.cursorStyle.cursor=cs.auto):void(this.cursorStyle.cursor=cs.select)}}this.cursorStyle.cursor=cs.auto}},{key:"_keyListener",value:function(e){var t=!1,i={};i=Object.assign(i,this._keyDown),this._keyDown[de.ALT]=e.altKey,this._keyDown[de.CTRL]=e.ctrlKey,this._keyDown[de.SHIFT]=e.shiftKey,"Shift"!==e.key&&"Alt"!==e.key||(e.preventDefault(),e.stopPropagation());for(var n=[de.ALT,de.CTRL,de.SHIFT],r=0;r<3;r++)if(t=i[n[r]]!==this._keyDown[n[r]],t){this.modifier=this._keyDown[n[r]]?n[r]:0,this._evaluate();break}}}]),t}(pe),hs=us,ds=Y.getLogger("vcs.vcm.util.editor.AbstractLayerEditor"),ms={};function fs(e){return ms[e]}var ys=new gt({fill:{color:"#E8514C"}}),gs=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.id=Object(u["c"])(),i.convertStaticOnClick=Object(u["e"])(e.convertStaticOnClick,!0),i.defaultMode=tn.SELECT,i.layers={},i.editingFeature=null,i._listeners=[],i.eventHandler=xn(),i._interactionRemover=null,i.parent?(i.parent=i.parent,i.selectFeatureInteraction=i.parent.selectFeatureInteraction,i.features=i.selectFeatureInteraction.featureMap,i.mouseOverInteraction=i.parent.mouseOverInteraction):(i.selectFeatureInteraction=new qa(i.state),i.obliqueImageSubscriptionKey=ne.getInstance().subscribe("OBLIQUE_IMAGE_CHANGED",function(){i.state.active&&i.selectFeatureInteraction.active&&i.selectFeatureInteraction.clearSelectionSet()}),i.interactionChain.addInteraction(i.selectFeatureInteraction),i.features=i.selectFeatureInteraction.featureMap,i.mouseOverInteraction=new hs({cesiumFeatures:i.selectFeatureInteraction.cesiumFeatureMap,features:i.features,state:i.state}),i.interactionChain.addInteraction(i.mouseOverInteraction)),ms[i.id]=f(i),i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.AbstractLayerEditor"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),ne.getInstance().addLayer(this.scratchLayer),this.selectFeatureInteraction.onSelect(this.onSelect.bind(this)),this.selectFeatureInteraction.onCesiumSelect(this.onCesiumSelect.bind(this))}},{key:"onSelect",value:function(){}},{key:"onCesiumSelect",value:function(){if(!this.parent&&this.state.isFeatureStore&&this.activeLayer)if(this.convertStaticOnClick&&this.selectFeatureInteraction.cesiumFeatureMap.size)this.switchToDynamic();else{this.activeLayer.clearHighlighting();var e={};this.selectFeatureInteraction.cesiumFeatureMap.forEach(function(t,i){e[i]=ys}),this.activeLayer.highlight(e)}}},{key:"switchToDynamic",value:function(){var e=this;if(this.activeLayer instanceof ta&&this.activeLayer.injectedFetchDynamicFeatureFunc){var t=[];return this.selectFeatureInteraction.cesiumFeatureMap.forEach(function(i,n){t.push(e.activeLayer.switchStaticFeatureToDynamic(n))}),this.selectFeatureInteraction.clearCesiumSelectionSet(),Promise.all(t).then(function(t){t.forEach(function(t){e.selectFeatureInteraction.selectionSetClick(t)})})}return Promise.resolve()}},{key:"setAltitudeMode",value:function(e){return this.parent||(0===this.features.size&&(this.state.defaultAltitudeMode=e),this.state.altitudeMode=e,this._setPickingBehaviour()),Promise.resolve()}},{key:"activate",value:function(){if(Se(b(t.prototype),"activate",this).call(this),this._interactionRemover||(this._interactionRemover=this.eventHandler.addExclusiveInteraction(this.interactionChain,this.deactivate.bind(this),void 0,this.state.exclusiveId)),!this.parent){this._setPickingBehaviour();var e=ne.getInstance().getActiveMap();this.state.activeMap!==e.className&&this.handleMapChange(e)}}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.eventHandler.featureInteraction.setActive(),this.eventHandler.eventEmitter.setActive(),null!=this._interactionRemover&&(this._interactionRemover(),this._interactionRemover=null),this.mouseOverInteraction&&this.mouseOverInteraction.reset()}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this,e),this.state.active||(this.parent?ds.warning("Trying to set mode on inactive child, set mode on the parent"):this.activate())}},{key:"setMode",value:function(e){ds.debug("AbstractLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.parent||(e&tn.NONE&&this.selectFeatureInteraction.clearSelectionSet(!0),this._setPickingBehaviour())}},{key:"_setPickingBehaviour",value:function(){if(this.state.mode&tn.GEOMETRYMODES&&this.features.size?this.eventHandler.featureInteraction.hitTolerance=2:this.eventHandler.featureInteraction.hitTolerance=10,this.state.mode&tn.CREATE){Q.getInstance().deactivateClickBehavior(),this.mouseOverInteraction.setActive(!1),this.mouseOverInteraction.cursorStyle.cursor=cs.edit,this.selectFeatureInteraction.setActive(!1),this.eventHandler.eventEmitter.setActive(!1);var e=this.state.altitudeMode&an.CLAMP&&this.state.classificationType===on.terrain;e?(this.eventHandler.featureInteraction.setActive(),this.eventHandler.featureInteraction.pickPosition=me.NONE):(this.eventHandler.featureInteraction.setActive(me.CLICKMOVE),this.eventHandler.featureInteraction.pickPosition=me.CLICKMOVE,this.eventHandler.featureInteraction.pullPickedPosition=.05)}else if(this.state.mode&tn.NONE)Q.getInstance().activateClickBehavior(),this.eventHandler.featureInteraction.setActive(),this.eventHandler.eventEmitter.setActive(),this.eventHandler.featureInteraction.hitTolerance=10,this.mouseOverInteraction.setActive(!1);else{Q.getInstance().deactivateClickBehavior(),this.eventHandler.featureInteraction.setActive(me.ALL),this.mouseOverInteraction.cursorStyle.cursor=cs.auto,this.selectFeatureInteraction.setActive(),this.mouseOverInteraction.setActive();var t=this.state.altitudeMode&an.ABSOLUTE||this.state.altitudeMode&an.CLAMP&&this.state.classificationType!==on.terrain;this.state.mode&tn.EDIT&&t?(this.eventHandler.featureInteraction.pickPosition=me.DRAGEVENTS|me.CLICK,this.eventHandler.featureInteraction.pullPickedPosition=.05):this.state.mode&tn.TRANSLATEVERTEX&&t?(this.eventHandler.featureInteraction.pickPosition=me.CLICKMOVE,this.eventHandler.featureInteraction.pullPickedPosition=.05):this.eventHandler.featureInteraction.pickPosition=0}}},{key:"addEditingLayer",value:function(e){var t=this;if(o(e,_n),this.activeLayer=e,!this.parent){e.getFeatures().forEach(function(e){e[t.state.featureTypeSymbol]=nn.EDITABLE}),this.state.layerName=e.name,this.state.defaultClassificationType=on[e.classificationType]||on.terrain,this.state.classificationType=this.state.defaultClassificationType,this.state.defaultAltitudeMode="absolute"===e.altitudeMode?an.ABSOLUTE:an.CLAMP;var i=[];if(i.push(e.source.on("addfeature",function(e){var i=e.feature;i[t.state.featureTypeSymbol]=nn.EDITABLE})),i.push(e.source.on("removefeature",function(e){var i=e.feature;t.features.has(i.getId())&&t.selectFeatureInteraction.selectionSetClick(i),delete i[t.state.featureTypeSymbol]})),e instanceof ta){e.setEditing(this.state.featureTypeSymbol,nn.EDITABLE),this.state.isFeatureStore=!0;var n="vcs.vcm.util.editor.CompositeLayerEditor"===this.getRootEditor().className?!!this.getRootEditor().getFeatureLayerEditor():"vcs.vcm.util.editor.FeatureLayerEditor"===this.getRootEditor().className;this.state.canSwitchToDynamic=!!e.injectedFetchDynamicFeatureFunc&&n}else this.state.isFeatureStore=!1,this.state.canSwitchToDynamic=!1;this.layers[e.name]=i}}},{key:"removeEditingLayer",value:function(e){var t=this;o(e,_n),e.getFeatures().forEach(function(e){delete e[t.state.featureTypeSymbol]}),this.activeLayer instanceof ta&&(this.activeLayer.setEditing(this.state.featureTypeSymbol),this.state.isFeatureStore=!1,this.state.canSwitchToDynamic=!1);var i=this.layers[e.name]||[];i.forEach(function(e){ol.Observable.unByKey(e)}),delete this.layers[e.name],this.activeLayer=null,this.state.layerName=null}},{key:"handleMapChange",value:function(e){this.parent||(this.state.activeMap=e.className,this.selectFeatureInteraction.featureMap.size&&(this.isOblique||e instanceof Pi)&&(this.state.mode&tn.CREATE?this.getRootEditor().setMode(tn.NONE):this.selectFeatureInteraction.clearSelectionSet())),Se(b(t.prototype),"handleMapChange",this).call(this,e)}},{key:"destroy",value:function(){var e=this;Se(b(t.prototype),"destroy",this).call(this),Object.keys(this.layers).forEach(function(t){var i=ne.getInstance().getLayerByName(t);i&&i instanceof _n&&e.removeEditingLayer(i)}),null!=this.obliqueImageSubscriptionKey&&ne.getInstance().unsubscribeByKey(this.obliqueImageSubscriptionKey),delete ms[this.id]}},{key:"clearSelectionSet",value:function(e){this.selectFeatureInteraction.clearSelectionSet(e)}}]),t}(Za),vs=gs,ps=new gt({});ps.style=new ol.style.Style({fill:new ol.style.Fill({color:"rgba(200, 200, 200, 0.5)"}),stroke:new ol.style.Stroke({color:"rgb(200, 200, 200)",width:2}),image:new ol.style.Circle({fill:new ol.style.Fill({color:"rgba(200, 200, 200, 0.5)"}),stroke:new ol.style.Stroke({color:"rgb(200, 200, 200)",width:2}),radius:5})});var _s={},bs=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.loaded=null,i.greyed=!1,i.original=null,i.editorId=e.editorId;var n=new _n({name:i._id,projection:R.createMercatorProjection().getConfigObject(),genericFeatureProperties:{planningName:i.name,planningDescription:i.description}});return ne.getInstance().addLayer(n),n.getSource().on("addfeature",function(e){var t=e.feature;t.get("title")||t.set("title",i.name,!0),t.get("description")||t.set("description",i.description,!0)}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectDrawing"}}]),Object(m["a"])(t,[{key:"save",value:function(){var e=fs(this.editorId);return e.state.active&&e.setMode(rn.none),this.original=this._writeToGeoJSON(),Se(b(t.prototype),"save",this).call(this)}},{key:"load",value:function(){var e=this;!this.loaded&&this.url?this.loaded=ce.a.get(this.url).then(function(t){var i=t.data;e.original=i,e._setFeaturesFromGeoJSON()}):this.loaded=Promise.resolve(),this.loaded.then(function(){e.getDrawingLayer()||(ne.getInstance().addLayer(new _n({name:e._id,projection:R.createMercatorProjection().getConfigObject()})),e._setFeaturesFromGeoJSON())}).then(function(){e.visible&&e.getDrawingLayer().activate(!0)})}},{key:"unload",value:function(){var e=this.getDrawingLayer();e&&this.getDrawingLayer().activate(!1)}},{key:"_setFeaturesFromGeoJSON",value:function(){var e=this.getDrawingLayer(),t=fr(this.original,{dynamicStyle:!0,readLegacyStyleOptions:!0}),i=t.features,n=t.style;e.addFeatures(i),n&&e.setStyle(n);var r=function(){var e=i.filter(function(e){return"clampToGround"===e.get("olcs_altitudeMode")&&e.get("olcs_extrudedHeight")&&e.get("olcs_extrudedHeight")>0});e.forEach(function(e){mi(e).then(function(){e.set("olcs_altitudeMode","absolute")})})};if("vcs.vcm.maps.Cesium"===ne.getInstance().getActiveMap().className)r();else var a=ne.getInstance().subscribe("MAP_ACTIVATED",function(e){"vcs.vcm.maps.Cesium"===e.className&&(r(),ne.getInstance().unsubscribeByKey(a))})}},{key:"_writeToGeoJSON",value:function(){var e=this.getDrawingLayer(),t={asObject:!0,writeStyle:!0,embedIcons:!0};return gr({features:e.getFeatures(),vcsMeta:e.getVcsMeta(t)},t)}},{key:"getDrawingLayer",value:function(){return ne.getInstance().getLayerByName(this._id)}},{key:"zoomTo",value:function(){var e=this.getDrawingLayer();if(e.getFeatures().length>0){var t=e.source.getExtent(),i=R.getTransformer(R.createGeographicProjection(),R.createMercatorProjection());i(t,t,2);var n=V.createViewPointFromExtent(t);ne.getInstance().getActiveMap().gotoViewPoint(n)}}},{key:"greyOut",value:function(){var e=this.getDrawingLayer();this.loaded&&e.active&&!this.greyed&&(_s[this._id]=e.getStyle(),e.setStyle(ps),this.greyed=!0)}},{key:"unGrey",value:function(){this.greyed&&_s[this._id]&&(this.getDrawingLayer().setStyle(_s[this._id]),this.greyed=!1)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.getDrawingLayer().activate(!0)}},{key:"setDrawing",value:function(e){var t=fs(this.editorId);e?t.addEditingLayer(this.getDrawingLayer()):t.removeEditingLayer(this.getDrawingLayer())}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.geoJSON=this._writeToGeoJSON(),e}},{key:"reset",value:function(){this.getDrawingLayer().removeAllFeatures(),this._setFeaturesFromGeoJSON()}},{key:"destroy",value:function(){this.getDrawingLayer().removeAllFeatures(),this.getDrawingLayer().dispose()}}]),t}(za),Ls=bs,Ms=Y.getLogger("vcs.vcm.widgets.planning.PlanningObjectProcessing"),ks=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.description=e.stdoutMsgs&&Array.isArray(e.stdoutMsgs)?e.stdoutMsgs.join("\n"):"",i._pollingInterval=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectProcessing"}}]),Object(m["a"])(t,[{key:"load",value:function(){this._observeStatus()}},{key:"unload",value:function(){clearInterval(this._pollingInterval),this._pollingInterval=null}},{key:"observeStatus",value:function(){Ms.deprecate("observeStatus","Use load to start polling the status & unload to stop."),this._observeStatus()}},{key:"_observeStatus",value:function(){var e=this;null!=this._pollingInterval&&clearInterval(this._pollingInterval),this._pollingInterval=window.setInterval(function(){var t=e.serviceUrl.clone().extendPath("get-object-status",e._id);ce.a.post(t.toString()).then(function(t){if(e.status=t.data,e.status===Ha.FAILED||e.status===Ha.READY){var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});return i.updatePlanningObject(e).then(function(){e.destroy()})}return Promise.resolve()}).catch(function(t){if(t.response&&t.response.data&&"notFound"===t.response.data.error){var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});i.updatePlanningObjects()}else Ms.error("Could not update PlanningObject ".concat(e._id,", polling is stopped Error: ").concat(t.toString())),e.destroy()})},1e4)}},{key:"destroy",value:function(){clearInterval(this._pollingInterval),this._pollingInterval=null}}]),t}(za),ws=ks,Ts=Y.getLogger("vcs.vcm.widgets.planning.PlanningObjectFeatureStore"),Ss=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.loaded=null,i.featureStoreUrl=i.serviceUrl.clone(),i.featureStoreUrl.extendPath("feature-store"),i.featureStoreUrl.addQueryParams({planningId:i.planningInstanceId,planningObjectId:i._id}),i.layerId=e.layerId,i.editorId=e.editorId,i.trackerValues={},i.terrainUrl=e.terrainUrl,i._balloonTemplate=e.balloonTemplate||"",i._pollingInterval=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningObjectFeatureStore"}}]),Object(m["a"])(t,[{key:"getLayer",value:function(){return ne.getInstance().getLayerByName(this.layerId)}},{key:"load",value:function(){var e=this;if(this.status===Ha.READY){if(!this.loaded){var t=this.featureStoreUrl.clone();t.extendPath("get-layer"),this.loaded=ce.a.get(t.toString()).then(function(t){var i=t.data;if(i.staticRepresentation&&i.staticRepresentation.threeDim){var n="".concat(e.serviceUrl.base);if(e.serviceUrl.path.length>1){var r=e.serviceUrl.path.slice(0,e.serviceUrl.path.length-1);n="".concat(n,"/").concat(r.join("/"))}i.staticRepresentation.threeDim="".concat(n,"/").concat(i.staticRepresentation.threeDim);var a=e.featureStoreUrl.clone().extendPath("get-layer-file");a.addQueryParams({asJson:!0,onlyStatic:!0}),i.staticRepresentation.twoDim=a.toString()}i.injectedFetchDynamicFeatureFunc=e.getDynamicFeature.bind(e),i.name=e.layerId;var s=ne.getInstance();i.genericFeatureProperties={planningName:e.name,planningDescription:e.description};var o=new ta(i);if(s.addLayer(o),e._balloonTemplate){var l=s.getWidgetByType("vcs.vcm.widgets.BalloonInfo");l&&l.addTypeForLayer(e.layerId,e._balloonTemplate)}}).catch(function(e){Ts.log(e)})}this.loaded.then(function(){e.visible&&e.getLayer().activate(!0)})}else this._observeStatus()}},{key:"unload",value:function(){var e=this.getLayer();e&&e.activate(!1),this._pollingInterval&&(clearInterval(this._pollingInterval),this._pollingInterval=null),this._removeModeChangeListener&&(this._removeModeChangeListener(),this._removeModeChangeListener=null)}},{key:"getDynamicFeature",value:function(e){var t=this.featureStoreUrl.clone();return t.extendPath("get-feature",this.planningInstanceId,this._id,e.toString()),ce.a.post(t.toString()).then(function(e){var t=e.data;return t})}},{key:"show",value:function(){this.getLayer()?(Se(b(t.prototype),"show",this).call(this),this.getLayer().activate(!0)):Ts.warning("FeatureStoreLayer for PlanningObjectFeatureStore does not exists, check code")}},{key:"setEditing",value:function(e){var t=fs(this.editorId),i=this.getLayer();this._removeModeChangeListener&&(this._removeModeChangeListener(),this._removeModeChangeListener=null),e?(this._removeModeChangeListener=t.modeChange.addEventListener(function(e){e&tn.NONE?i.changeTracker.pauseTracking("changefeature"):i.changeTracker.track()}),i.changeTracker.track(),this.trackerValues=i.changeTracker.values,t.addEditingLayer(i),fs(this.editorId).state.dedicatedFeatureStyle=!1):(i.changeTracker.unTrack(),t.removeEditingLayer(i),fs(this.editorId).state.dedicatedFeatureStyle=!0)}},{key:"appendFile",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(e,Object),o(i,Object),this.terrainUrl&&(i.terrain=i.terrain||this.terrainUrl),e.append("converterOptions",JSON.stringify(i));var n=this.featureStoreUrl.clone();return n.extendPath("append"),ce.a.post(n.toString(),e).then(function(){t.status=Ha.CONVERTING,t._observeStatus()})}},{key:"calculateStatic",value:function(){var e=this,t=this.featureStoreUrl.clone();t.extendPath("calculate-static");var i=this.terrainUrl?{terrain:this.terrainUrl}:void 0;return ce.a.post(t.toString(),i).then(function(){e.status=Ha.OPTIMIZING,e._observeStatus()})}},{key:"_observeStatus",value:function(){var e=this;null!=this._pollingInterval&&clearInterval(this._pollingInterval),this._pollingInterval=window.setInterval(function(){var t=e.serviceUrl.clone().extendPath("get-object-status",e._id);ce.a.post(t.toString()).then(function(t){if(e.status=t.data,e.status===Ha.FAILED)Ts.warning("conversion failed"),clearInterval(e._pollingInterval),e._pollingInterval=null;else if(e.status===Ha.READY){ne.getInstance().removeLayerByName(e.layerId);var i=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Planning").planningInstances.find(function(t){return t._id===e.planningInstanceId});e.loaded=null,i.loaded&&e.load(),clearInterval(e._pollingInterval),e._pollingInterval=null}}).catch(function(e){Ts.error(e)})},2e4)}},{key:"getDefinition",value:function(){var e=Se(b(t.prototype),"getDefinition",this).call(this);return e.balloonTemplate=this._balloonTemplate&&""!==this._balloonTemplate?this._balloonTemplate:void 0,e}},{key:"save",value:function(){var e=this,i=this.getLayer(),n=fs(this.editorId);n.state.active&&n.setMode(tn.NONE);var r=this.featureStoreUrl.clone();return r.extendPath("bulk"),i.changeTracker.commitChanges(r.toString()).then(function(){return e.saveVcsMeta()}).then(function(){return Se(b(t.prototype),"save",e).call(e)})}},{key:"saveVcsMeta",value:function(){var e=this.getLayer().getVcsMeta({writeStyle:!0}),t=this.featureStoreUrl.clone();return t.extendPath("edit-meta"),ce.a.post(t.toString(),e)}},{key:"reset",value:function(){var e=this.getLayer(),t=fs(this.editorId);return t.setMode(tn.NONE),e.changeTracker.reset()}},{key:"destroy",value:function(){var e=this.getLayer();e&&e.dispose(),this._pollingInterval&&(clearInterval(this._pollingInterval),this._pollingInterval=null)}},{key:"zoomTo",value:function(){var e=this.getLayer(),t=e.getExtent();if(t.isValid()){var i=t.getCoordinatesInProjection(R.createGeographicProjection()),n=V.createViewPointFromExtent(i);n.distance=n.distance<4e3?n.distance:4e3,ne.getInstance().getActiveMap().gotoViewPoint(n)}}},{key:"balloonTemplate",get:function(){return this._balloonTemplate},set:function(e){this._balloonTemplate=e;var t=ne.getInstance().getWidgetByType("vcs.vcm.widgets.BalloonInfo");if(t)if(this._balloonTemplate&&""!==this._balloonTemplate)if(t.layerNamesToBalloonTypes[this.layerId]){var i=t.balloonTypes[t.layerNamesToBalloonTypes[this.layerId]];i.template=this._balloonTemplate}else t.addTypeForLayer(this.layerId,this._balloonTemplate);else delete t.layerNamesToBalloonTypes[this.layerId]}},{key:"name",get:function(){return this._name},set:function(e){this._name=e;var t=this.getLayer();t&&t.addGenericFeatureProperties({planningName:e})}},{key:"description",get:function(){return this._description},set:function(e){this._description=e;var t=this.getLayer();t&&t.addGenericFeatureProperties({planningDescription:e})}}]),t}(za),Os=Ss,Cs=i(3),Es=i.n(Cs),Is="<div class='balloon' id='myBalloon'>\n  <h1 class='balloon-title'><%= obj.title %></h1>\n  <div class='balloon-content'>\n    <%= obj.description %>\n    <hr>\n    <small>\n    <% if (obj.edited) {%>\n      <i><%= obj.edited %></i>\n    <% }%>\n    <%= obj.author %> <%= obj.date %>\n    </small>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Ds=null,js=function(){function e(){var t=this;Object(d["a"])(this,e),this.active=!1,this.setupResolve=null,this.setupPromise=new Promise(function(e){t.setupResolve=e}),this.serviceUrl=null,this.scenarioId=null,this.projectId=null,this.currentUser={userSettings:null},this.projectGroups=[],this.projectUsers=[],this.projectSettings={hasMail:!1,selfRegister:!1,userInvite:!1},this.onLogin=[],this.onLogout=[],this.beforeLogout=[],window.addEventListener("beforeunload",function(){t.logout()})}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.util.Login"}}]),Object(m["a"])(e,[{key:"handleURLParameter",value:function(e){e["reset-token"]?e.enrollment?window.location.hash="#/login/enroll/".concat(e["reset-token"]):window.location.hash="#/login/reset/".concat(e["reset-token"]):e["verify-token"]&&(window.location.hash="#/login/verify/".concat(e["verify-token"]))}},{key:"registerWidget",value:function(e){if(this.active){var t=this.serviceUrl===e.serviceUrl,i=this.projectId===e.projectId,n=this.scenarioId===e.scenarioId;return t&&n&&i?(e.onLogin.forEach(function(e){this.onLogin.push(e)},this),e.onLogout.forEach(function(e){this.onLogout.push(e)},this),e.beforeLogout.forEach(function(e){this.beforeLogout.push(e)},this),Promise.resolve()):Promise.reject(new Error("Login recieved two different configurations"))}return this.serviceUrl=e.serviceUrl,this.url=a["a"].parse(this.serviceUrl),this.url.addQueryParams({version:3.6}),this.projectId=e.projectId,this.scenarioId=e.scenarioId,e.onLogin.forEach(function(e){this.onLogin.push(e)},this),e.onLogout.forEach(function(e){this.onLogout.push(e)},this),e.beforeLogout.forEach(function(e){this.beforeLogout.push(e)},this),this._getProject()}},{key:"registerHook",value:function(e,t){o(e,["onLogin","onLogout","beforeLogout"]),o(t,Function),"onLogin"===e?this.onLogin.push(t):"onLogout"===e?this.onLogout.push(t):"beforeLogout"===e&&this.beforeLogout.push(t)}},{key:"_getProject",value:function(){var e=this.url.clone();return ce.a.post(e.extendPath("project","get").toString(),{projectId:this.projectId}).then(this._setProject.bind(this)).catch(function(){}).then(this.setupResolve)}},{key:"_setProject",value:function(e){return e.data&&e.data._id===this.projectId?(Object.assign(this.projectSettings,e.data),this.active=!0,Promise.resolve()):Promise.reject("Login project was not found or did not match registered project")}},{key:"login",value:function(t,i){if(o(t,String),o(i,String),!this.active)return Promise.reject("Login has not been activated!");var n=e.sha256(i),r=this.url.clone();return ce.a.post(r.extendPath("user","login").toString(),{email:t,password:n,mapId:this.scenarioId}).then(this.setUser.bind(this))}},{key:"logout",value:function(){var e=this.beforeLogout.map(function(e){return e()}).filter(function(e){return null!=e}),t=function(e){return ce.a.post("".concat(this.serviceUrl,"/user/logout?access_token=").concat(this.getBearerToken())).then(this.clearUser.bind(this)),e?Promise.reject(new Error("logout failed")):Promise.resolve()};return Promise.all(e).then(t.bind(this,!1)).catch(t.bind(this,!0))}},{key:"register",value:function(t,i,n){if(o(t,String),o(i,String),l(n,String),!Object(u["d"])(t))throw new Error("i18n_error_invalidEmail");var r=n?{name:n}:null,a=e.sha256(i);return ce.a.post("".concat(this.serviceUrl,"/user/register"),{email:t,password:a,projectId:this.projectId,profile:r,mapId:this.scenarioId})}},{key:"invite",value:function(e){if(o(e,String),!Object(u["d"])(e))throw new Error("i18n_error_invalidEmail");var t=this.getBearerToken();return ce.a.post("".concat(this.serviceUrl,"/user/register")+"?access_token=".concat(t),{email:e,projectId:this.projectId,mapId:this.scenarioId})}},{key:"verifyEmail",value:function(e){return o(e,String),ce.a.post("".concat(this.serviceUrl,"/user/verify-email"),{token:e})}},{key:"requestResetPassword",value:function(e){return o(e,String),ce.a.post("".concat(this.serviceUrl,"/user/request-reset"),{email:e,mapId:this.scenarioId})}},{key:"resetPassword",value:function(t,i){o(t,String),o(i,String);var n=e.sha256(t);return ce.a.post("".concat(this.serviceUrl,"/user/reset-password"),{password:n,token:i}).then(this.setUser.bind(this))}},{key:"getCurrentUser",value:function(){return this.currentUser}},{key:"getUserById",value:function(e){return this.projectUsers.find(function(t){return t._id===e})}},{key:"getBearerToken",value:function(){return this.currentUser?this.currentUser.token:null}},{key:"setUser",value:function(e){var t=this;Object.assign(this.currentUser,e.data),this.url.addQueryParams({access_token:this.currentUser.token});var i=this.url.clone(),n=ce.a.post(i.extendPath("group","get-shareable").toString(),{projectId:this.projectId}),r=this.url.clone(),a=ce.a.post(r.extendPath("user","get").toString(),{userId:this.currentUser.id}),s=this.url.clone(),o=ce.a.get(s.extendPath("project-users",this.projectId).toString());return Promise.all([n,a,o]).then(function(e){t.setProjectGroups(e[0]),t.setProfile(e[1]),t._setProjectUsers(e[2]),t.onLogin.forEach(function(e){e()})})}},{key:"setProjectGroups",value:function(e){this.projectGroups.splice(0,this.projectGroups.length),e.data.forEach(function(e){var t={};t.id=e._id,t.name=e.name,this.projectGroups.push(t)},this)}},{key:"setProfile",value:function(e){this.currentUser.userSettings=e.data}},{key:"_setProjectUsers",value:function(e){var t=e.data;t.users&&t.users.forEach(function(e){this.projectUsers.push(e)},this)}},{key:"clearUser",value:function(){Object.keys(this.currentUser).forEach(function(e){"userSettings"===e?this.currentUser[e]=null:delete this.currentUser[e]},this),this.projectGroups.splice(0,this.projectGroups.length),this.onLogout.forEach(function(e){e()}),console.log("logged out",this.currentUser)}},{key:"searchUser",value:function(e){var t=this.url.clone();return ce.a.post(t.extendPath("user","search").toString(),{text:e,projectId:this.projectId})}}],[{key:"getInstance",value:function(){return Ds||(Ds=new e),Ds}},{key:"sha256",value:function(e){var t=8,i=0;function n(e,t){var i=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(i>>16);return n<<16|65535&i}function r(e,t){return e>>>t|e<<32-t}function a(e,t){return e>>>t}function s(e,t,i){return e&t^~e&i}function o(e,t,i){return e&t^e&i^t&i}function l(e){return r(e,2)^r(e,13)^r(e,22)}function c(e){return r(e,6)^r(e,11)^r(e,25)}function u(e){return r(e,7)^r(e,18)^a(e,3)}function h(e){return r(e,17)^r(e,19)^a(e,10)}function d(e,t){var i,r,a,d,m,f,y,g,v,p,_=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),b=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),L=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var M=0;M<e.length;M+=16){i=b[0],r=b[1],a=b[2],d=b[3],m=b[4],f=b[5],y=b[6],g=b[7];for(var k=0;k<64;k++)L[k]=k<16?e[k+M]:n(n(n(h(L[k-2]),L[k-7]),u(L[k-15])),L[k-16]),v=n(n(n(n(g,c(m)),s(m,f,y)),_[k]),L[k]),p=n(l(i),o(i,r,a)),g=y,y=f,f=m,m=n(d,v),d=a,a=r,r=i,i=n(v,p);b[0]=n(i,b[0]),b[1]=n(r,b[1]),b[2]=n(a,b[2]),b[3]=n(d,b[3]),b[4]=n(m,b[4]),b[5]=n(f,b[5]),b[6]=n(y,b[6]),b[7]=n(g,b[7])}return b}function m(e){for(var i=Array(),n=(1<<t)-1,r=0;r<e.length*t;r+=t)i[r>>5]|=(e.charCodeAt(r/t)&n)<<24-r%32;return i}function f(e){for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}function y(e){for(var t=i?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*e.length;r++)n+=t.charAt(e[r>>2]>>8*(3-r%4)+4&15)+t.charAt(e[r>>2]>>8*(3-r%4)&15);return n}return e=f(e),y(d(m(e),e.length*t))}}]),e}(),Ps=js,Ys=Y.getLogger("vcs.vcm.widgets.planning.PlanningComment");function xs(e){var t,i,n=e.properties;n.editedBy&&n.editedOn?(t=n.editedBy,i=n.editedOn,n.edited=q.getInstance().getSingleMessage("i18n_planning_comment_edited")):(t=n.createdBy,i=n.createdOn);var r=Ps.getInstance().getUserById(t);n.author=r&&r.profile?r.profile.name:"anonymous",n.date=Es()(i).format("LLL")}function As(e){var t=gr({features:[e]},{asObject:!0}),i=t.features[0];return i.id=e.getId(),delete i.properties.selected,i}var Fs={DEFAULT:"default",INFO:"info",SUCCESS:"success",WARNING:"warning"},Ns=function(){function e(t,i,n){var r=this;Object(d["a"])(this,e),this.planningId=t,this.url=i.clone(),this.url.addQueryParams({planningId:t}),this.url.extendPath("comment"),this.dataLoaded=!1,this.ready=new Promise(function(e){r._readyResolve=e}),this.permissions=n,this.comments=[];var a=ne.getInstance(),s=a.getWidgetByType("vcs.vcm.widgets.BalloonInfo");s&&s.addTypeForLayer("".concat(this.planningId,"_comments"),Is),a.subscribe("LOCALE_CHANGED",this.localeChanged.bind(this)),this.localeChanged(a.getLocale())}return Object(m["a"])(e,[{key:"getLayer",value:function(){var e=ne.getInstance(),t=e.getLayerByName("".concat(this.planningId,"_comments"));return t||(t=new _n({altitudeMode:"absolute",name:"".concat(this.planningId,"_comments"),allowPicking:!0,projection:R.createMercatorProjection().getConfigObject(),balloonHeightOffset:1,style:"planningCommentStyle"}),e.addLayer(t)),t}},{key:"load",value:function(){var e=this;if(!this.dataLoaded){var t=this.getLayer(),i=this.url.clone();i.extendPath("get-comments"),ce.a.get(i.toString()).then(function(i){var n,r=i.data;(n=e.comments).push.apply(n,Object(T["a"])(r.features)),e.comments.forEach(xs);var a=fr(r),s=a.features;t.addFeatures(s),e.dataLoaded=!0,e._readyResolve()}).catch(function(t){Ys.error(t.message),e.dataLoaded=!0,e._readyResolve()})}this.ready.then(function(){e.getLayer().activate(!0)})}},{key:"localeChanged",value:function(e){if(Es.a.locale(e),this.dataLoaded){var t=this.getLayer();this.comments.forEach(function(e){xs(e);var i=t.getFeatureById(e.id);i&&(e.properties.edited&&i.set("edited",e.properties.edited,!0),i.set("author",e.properties.author,!0),i.set("date",e.properties.date))})}}},{key:"unLoad",value:function(){this.getLayer().activate(!1)}},{key:"lookAt",value:function(e){var t=ne.getInstance(),i=this.getLayer(),n=i.getFeatureById(e),r=t.getActiveMap(),a=r.getViewPoint();a.pitch>-45&&(a.pitch=-45),a.distance||(a.distance=2e3),a.setCameraPosition(null),a.setGroundPosition(R.mercatorToWgs84(n.getGeometry().getCoordinates())),a.setAnimate(!0),r.gotoViewPoint(a),t.publish("FEATURE_CLICKED",n.getId(),n,i)}},{key:"addComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("add"),ce.a.post(n.toString(),i).then(function(i){var n=i.data;xs(n),t.comments.push(n),e.setId(n.id),e.set("author",n.properties.author,!0),e.set("date",n.properties.date)})}},{key:"editComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("edit"),ce.a.post(n.toString(),i).then(function(i){var n=i.data,r=t.comments.findIndex(function(e){return e.id===n.id});t.comments.splice(r,1,n),xs(n),e.set("author",n.properties.author,!0),e.set("date",n.properties.date)})}},{key:"deleteComment",value:function(e){var t=this;o(e,ol.Feature);var i=As(e),n=this.url.clone();return n.extendPath("delete"),ce.a.post(n.toString(),i).then(function(){var e=t.comments.findIndex(function(e){return e.id===i.id});t.comments.splice(e,1),t.getLayer().removeFeaturesById([i.id])})}},{key:"destroy",value:function(){this.comments.splice(0);var e=ne.getInstance().getLayerByName("".concat(this.planningId,"_comments"));e&&e.dispose()}}]),e}(),Hs=Ns;function Rs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.viewpoints.map(function(e){e.duration=null!=e.duration?e.duration:null;var t=F(e.cameraPosition.slice(),void 0,3),i=new ol.Feature({geometry:new ol.geom.Point(t)});return i.setProperties(Object.assign({},e)),i}),n={features:i,vcsMeta:{flightOptions:{name:e.name,loop:e.loop,interpolation:e.interpolation}}};return gr(n,t)}function zs(e){var t=fr(e),i=t.vcsMeta&&t.vcsMeta.flightOptions?t.vcsMeta.flightOptions:{name:"ImportedFlight"};return i.viewpoints=t.features.map(function(e){var t={name:e.get("name"),distance:e.get("distance"),groundPosition:e.get("groundPosition"),cameraPosition:e.get("cameraPosition"),heading:e.get("heading"),pitch:e.get("pitch"),roll:e.get("roll"),animate:!1,duration:null!=e.get("duration")?e.get("duration"):null};return t}),i}var Gs={SPLINE:"spline",LINEAR:"linear"},Vs=function(){function e(t){Object(d["a"])(this,e),this.id=Object(u["c"])(),this.name=t.name,this.viewpoints=t.viewpoints||[],this.multiplier=Object(u["g"])(t.multiplier,1),this.loop=Object(u["e"])(t.loop,!1),this.interpolation=t.interpolation||Gs.SPLINE,this.changed=new Cesium.Event,this.url=t.url,this._readyPromise=null}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.util.flight.FlightInstance"}}]),Object(m["a"])(e,[{key:"isValid",value:function(){var e=this;return this.viewpoints.forEach(function(t,i){t.cameraPosition||e.viewpoints.splice(i,1)}),this.viewpoints.length>=2}},{key:"assign",value:function(e){this.name=e.name,this.viewpoints=e.viewpoints,this.multiplier=e.multiplier,this.loop=e.loop,this.interpolation=e.interpolation,this.changed.raiseEvent()}},{key:"getConfigObject",value:function(){return{name:this.name,multiplier:this.multiplier,loop:this.loop,interpolation:this.interpolation,viewpoints:this.viewpoints.map(function(e){return Object.assign({},e)})}}},{key:"ready",get:function(){var e=this;return this._readyPromise||(this.url?this._readyPromise=ce.a.get(this.url).then(function(t){var i=t.data,n=zs(i);e.assign(n)}):this._readyPromise=Promise.resolve()),this._readyPromise}}]),e}(),Bs=Vs;B.PLANNING_INSTANCE_LOADED="PLANNING_INSTANCE_LOADED",B.PLANNING_INSTANCE_UNLOADED="PLANNING_INSTANCE_UNLOADED";var Us=Y.getLogger("vcs.vcm.widgets.planning.PlanningInstance"),Ws=It(),qs=function(){function e(t){var i=this;Object(d["a"])(this,e),this.maintainLockInterval=null,this._id=t._id,this.name=t.name&&""!==t.name?t.name:"planning: ".concat(t._id),this.hiddenObjects=t.hiddenObjects?t.hiddenObjects:[],this.planningObjects=[],this.viewpoints=[],t.viewpoints&&t.viewpoints.length>0?this.viewpoints=t.viewpoints:t.viewpoint&&(t.viewpoint.default=!0,this.viewpoints.push(t.viewpoint)),this.flights=[],t.flights&&t.flights.forEach(function(e){var t=zs(e);i.flights.push(new Bs(t))}),this.description=t.description?t.description:null,this.permissions=t.permissions||[],this.owner=t.created,this.lastUpdated=t.lastUpdated||null,this.public=t.public;var n=new Kn({allowPicking:!0,name:"_".concat(this._id,"_model")});ne.getInstance().addLayer(n),this.layerName=n.name,this.sharedUsers=[],this.mapId=t.mapId,this.url=t.url,this.editorId=t.editorId,this.terrainUrl=t.terrainUrl,t.planningObjects&&t.planningObjects.forEach(function(e){i.addPlanningObject(e)}),this.loaded=!1,this.comments=new Hs(this._id,this.url,this.permissions),this.properties=t.properties||{}}return Object(m["a"])(e,null,[{key:"className",get:function(){return"vcs.vcm.widgets.planning.PlanningInstance"}}]),Object(m["a"])(e,[{key:"load",value:function(e){var t=ne.getInstance(),i=t.getLayerByName(this.layerName),n=t.getActiveMap();"vcs.vcm.maps.Cesium"===n.className&&(i.initialized||i.initialize(),i.activate(!0)),Ws.hideObjects(this.hiddenObjects),this.planningObjects.forEach(function(e){e.handleMapChange(n),e.load()}),e||this.gotoViewpoint(),this.comments.load(),this.loaded=!0,t.publish(B.PLANNING_INSTANCE_LOADED,this)}},{key:"unLoad",value:function(){var e=ne.getInstance(),t=e.getLayerByName(this.layerName);t.activate(!1),Ws.showObjects(this.hiddenObjects),this.planningObjects.forEach(function(e){e.unload()}),this.comments.unLoad(),this.loaded=!1,e.publish(B.PLANNING_INSTANCE_UNLOADED,this)}},{key:"handleMapChange",value:function(e){if(this.loaded){var t=ne.getInstance().getLayerByName(this.layerName);"vcs.vcm.maps.Cesium"===e.className?(t.initialized||t.initialize(),t.activate(!0)):t.isActive()&&t.activate(!1),this.planningObjects.forEach(function(t){t.handleMapChange(e)})}}},{key:"addPlanningObject",value:function(e){var t;return"geojson"===e.type&&(e.type="drawing"),"ready"!==e.status?(t="featureStore"===e.type?new Os(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId,terrainUrl:this.terrainUrl},e)):new ws(Object.assign({planningInstanceId:this._id,serviceUrl:this.url},e)),"failed"!==t.status&&this.loaded&&t.load(),this.planningObjects.push(t)):"gltf"===e.type?(t=new Va(Object.assign({planningInstanceId:this._id,planningInstanceGltfLayerName:this.layerName,serviceUrl:this.url},e)),this.planningObjects.push(t)):"drawing"===e.type?(t=new Ls(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId},e)),this.loaded&&!t.loaded&&t.load(),this.planningObjects.push(t)):"featureStore"===e.type?(t=new Os(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId,terrainUrl:this.terrainUrl},e)),this.loaded&&!t.loaded&&t.load(),this.planningObjects.push(t)):"image"===e.type&&(t=new Ua(Object.assign({planningInstanceId:this._id,serviceUrl:this.url,editorId:this.editorId},e)),this.loaded&&t.load(),this.planningObjects.push(t)),t.initialize(),t}},{key:"updatePlanningObject",value:function(e){var t=this,i=this.url.clone();return ce.a.post(i.extendPath("get-id").toString(),{id:this._id}).then(function(i){var n=i.data,r=t.planningObjects.findIndex(function(t){return t._id===e._id});t.planningObjects.splice(r,1);var a=n.planningObjects.find(function(t){return t._id===e._id});t.addPlanningObject(a)})}},{key:"updatePlanningObjects",value:function(){var e=this,t=this.url.clone();return ce.a.post(t.extendPath("get-id").toString(),{id:this._id}).then(function(t){var i=t.data;e.planningObjects.forEach(function(e){e.destroy()}),e.planningObjects.splice(0),i.planningObjects.forEach(e.addPlanningObject.bind(e))})}},{key:"deletePlanningObject",value:function(e,t){var i=this;o(e,za),l(t,Function);var n=this.planningObjects.findIndex(function(t){return t._id===e._id});return this.planningObjects.splice(n,1),e.delete().then(function(){e.destroy(),t(null)}).catch(function(n){var r=e.getConfigObject();e.destroy(),i.addPlanningObject(r),t(n)})}},{key:"lock",value:function(){var e=this,t=this.url.clone();return ce.a.post(t.extendPath("lock").toString(),{_id:this._id}).then(function(){e.maintainLockInterval||(e.maintainLockInterval=setInterval(e.maintainLock.bind(e),1e5))})}},{key:"maintainLock",value:function(){var e=this;this.lock().catch(function(){e.unlock()})}},{key:"unlock",value:function(){this.maintainLockInterval&&clearInterval(this.maintainLockInterval),this.maintainLockInterval=null;var e=this.url.clone();return ce.a.post(e.extendPath("unlock").toString(),{_id:this._id})}},{key:"save",value:function(){var e={_id:this._id,mapId:this.mapId,name:this.name,description:this.description,viewpoint:void 0,viewpoints:this.viewpoints,flights:this.flights.map(function(e){return Rs(e,{asObject:!0})}),hiddenObjects:this.hiddenObjects},t=this.url.clone();return ce.a.post(t.extendPath("update").toString(),e)}},{key:"getPlanningObjectDefinitions",value:function(){return Object.values(this.planningObjects).map(function(e){return e.getDefinition()})}},{key:"addHiddenObject",value:function(e){return o(e,String),!this.hiddenObjects.includes(e)&&(Ws.hideObjects([e]),this.hiddenObjects.push(e),!0)}},{key:"removeHiddenObject",value:function(e){if(o(e,[String,Number]),this.hiddenObjects.includes(e)){Ws.showObjects([e]);var t=this.hiddenObjects.indexOf(e);return this.hiddenObjects.splice(t,1),!0}return!1}},{key:"destroy",value:function(){for(var e=0;e<this.planningObjects.length;e++)this.planningObjects[e].destroy();this.loaded&&this.unLoad(),this.comments.destroy();var t=ne.getInstance().getLayerByName(this.layerName);return t.dispose(),this.layerName="",this.maintainLockInterval?this.unlock():Promise.resolve()}},{key:"gotoViewpoint",value:function(e){var t=e;if(null==t&&(t=this.viewpoints.findIndex(function(e){return e.default}),t=-1===t?0:t),this.viewpoints[t]){var i=new V(this.viewpoints[t]),n=ne.getInstance();n.getActiveMap().gotoViewPoint(i)}}},{key:"sharePlanning",value:function(e,t,i){o(e,String),o(t,String),l(i,[String]);var n={actorId:t,doc:{_id:e}};i&&(n.permissions=i);var r=this.url.clone().extendPath("share");return ce.a.post(r.toString(),n).then(this.getSharedUsers.bind(this))}},{key:"getSharedUsers",value:function(){var e=this,t=this.url.clone().extendPath("shared-users");return ce.a.post(t.toString(),{_id:this._id}).then(function(t){e.sharedUsers=t.data})}},{key:"publishPlanning",value:function(){var e=this,t=this.url.clone().extendPath("publish");return ce.a.post(t.toString(),{_id:this._id,public:!this.public}).then(function(){e.public=!e.public})}},{key:"userHasPermission",value:function(e){return o(e,String),this.permissions.indexOf(e)>-1}},{key:"isLocked",value:function(){return null!==this.maintainLockInterval}},{key:"uploadNewModel",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(e,Object),o(t,{percentage:[Number,String,null]}),o(n,Object);var r={};t&&(r.onUploadProgress=function(e){t.percentage=Math.round(100*e.loaded/e.total)}),this.terrainUrl&&(n.terrain=n.terrain||this.terrainUrl),e.append("converterOptions",JSON.stringify(n));var a=this.url.clone().extendPath("upload");return a.addQueryParams({planning_id:this._id}),ce.a.post(a.toString(),e,r).then(function(e){var t=e.data,n=null;return t.planningObjects.forEach(function(e){var t=i.planningObjects.find(function(t){return t._id===e._id});t||(n=i.addPlanningObject(e))}),n})}},{key:"createFeatureStoreObject",value:function(){var e=this,t=this.url.clone().extendPath("feature-store","create");return t.addQueryParams({planningId:this._id}),ce.a.post(t.toString()).then(function(t){var i=t.data;return e.addPlanningObject(i)})}},{key:"uploadNewDrawing",value:function(){var e=this;Us.deprecate("uploadNewDrawing","Drawings are deprecated on the virtualcityPLANNER, use createFeatureStoreObject instead");var t={type:"FeatureCollection",features:[]},i=this.url.clone().extendPath("add-drawing");return ce.a.post(i.toString(),{planningId:this._id,geoJSON:t}).then(function(t){var i=t.data,n=null;return i.planningObjects.forEach(function(t){var i=e.planningObjects.find(function(e){return e._id===t._id});i||(n=e.addPlanningObject(t))}),n})}}]),e}(),Js=qs,Ks=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._lastPosition=null,i._firstPosition=null,i._translationOptions={},i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.ALT,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=t[0]-this._lastPosition[0],n=t[1]-this._lastPosition[1];e.type&(me.CLICK|me.DRAGEND)?(this._translationOptions.dxTotal=t[0]-this._firstPosition[0],this._translationOptions.dyTotal=t[1]-this._firstPosition[1],this._translationOptions.isMoving=!1,this._translationOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,this.editor.translate(this.editor.state.transformGeometryOnMove?i:this._translationOptions.dxTotal,this.editor.state.transformGeometryOnMove?n:this._translationOptions.dyTotal,this._translationOptions),this.editor.selectFeatureInteraction.setActive(!0),this._lastPosition=null,this._firstPosition=null):e.type&(me.DRAG|me.MOVE)?(this.editor.translate(i,n,this._translationOptions),this._lastPosition=t):this._lastPosition=null}else e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.EDITABLE&&this.editor.features.has(e.feature.getId())&&(this.scene?(this.createPlane(e.positionOrPixel),this._lastPosition=this.getPosition(e),this._firstPosition=this.getPosition(e)):(this._lastPosition=e.positionOrPixel,this._firstPosition=e.positionOrPixel),this.editor.selectFeatureInteraction.setActive(!1),this._translationOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0});return Promise.resolve(e)}}]),t}(Xa),Zs=Ks,Qs=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.SHIFT|de.ALT,i._lastPosition=null,i._firstPosition=null,i.setActive(),i._scaleOptions={},i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._lastPosition){var t=this.getPosition(e),i=t[0]-this._lastPosition[0],n=t[1]-this._lastPosition[1];e.type&(me.CLICK|me.DRAGEND)?(this._scaleOptions.dxTotal=t[0]-this._firstPosition[0],this._scaleOptions.dyTotal=t[1]-this._firstPosition[1],this._scaleOptions.isMoving=!1,this._scaleOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,this.editor.scale(this.editor.state.transformGeometryOnMove?i:this._scaleOptions.dxTotal,this.editor.state.transformGeometryOnMove?n:this._scaleOptions.dyTotal,this._scaleOptions),this.editor.selectFeatureInteraction.setActive(!0),this._lastPosition=null,this._firstPosition=null):(this._lastPosition=t,this.editor.scale(i,n,this._scaleOptions))}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var r=e.feature.getGeometry().getCoordinates()[2]?e.feature.getGeometry().getCoordinates():e.positionOrPixel;this.editor.selectFeatureInteraction.setActive(!1),this._scaleOptions={maintainAspectRatio:!!(e.key&de.SHIFT),vertex:e.feature,toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this._lastPosition=r,this._firstPosition=r,this.scene&&this.createPlane(this._lastPosition)}return Promise.resolve(e)}}]),t}(Xa),Xs=Qs;function $s(e,t,i){var n=e.x*t.y-e.y*t.x;return n>0?i:-1*i}var eo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!0})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.CTRL,i._lastPosition=new Cesium.Cartesian2,i._firstPosition=new Cesium.Cartesian2,i._newPosition=new Cesium.Cartesian2,i._scratchCenter=new Cesium.Cartesian2,i._rotationOptions={},i._rotating=!1,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this._rotating){var t,i=this.getPosition(e);this._newPosition=Cesium.Cartesian2.fromElements(i[0],i[1],this._newPosition),this._newPosition=Cesium.Cartesian2.subtract(this._scratchCenter,this._newPosition,this._newPosition),e.type&(me.DRAGEND|me.CLICK)?(this._rotationOptions.angleTotal=$s(this._firstPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._firstPosition,this._newPosition)),this._rotationOptions.isMoving=!1,this._rotationOptions.toTransform=this.editor.state.transformGeometryOnMove?lo.BOTH:lo.GEOMETRY,t=this.editor.state.transformGeometryOnMove?$s(this._lastPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._lastPosition,this._newPosition)):this._rotationOptions.angleTotal,this.editor.selectFeatureInteraction.setActive(!0),this._rotating=!1):t=$s(this._lastPosition,this._newPosition,Cesium.Cartesian2.angleBetween(this._lastPosition,this._newPosition)),this.editor.rotate(t,this._rotationOptions),this._lastPosition=this._newPosition.clone(this._lastPosition)}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var n=e.feature.getGeometry().getCoordinates()[2]?e.feature.getGeometry().getCoordinates():e.positionOrPixel;this.scene&&this.createPlane(n),this.editor.selectFeatureInteraction.setActive(!1),this._scratchCenter=Cesium.Cartesian2.fromArray(ol.extent.getCenter(this.editor.extent),0,this._scratchCenter),this._firstPosition=Cesium.Cartesian2.fromArray(n,0,this._firstPosition),this._firstPosition=Cesium.Cartesian2.subtract(this._scratchCenter,this._firstPosition,this._firstPosition),this._lastPosition=this._firstPosition.clone(this._lastPosition),this._rotationOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this._rotating=!0}return Promise.resolve(e)}}]),t}(Xa),to=eo,io=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,{zPlane:!1})),i.editor=e,i._defaultActive=me.DRAGEVENTS,i._defaultModificationKey=de.ALT|de.SHIFT,i._lastHeight=null,i._firstHeight=null,i._isExtrusion=!1,i._heightOptions={},i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(this.scene)if(null!==this._lastHeight){var t,i=this.getPosition(e);e.type&(me.CLICK|me.DRAGEND)?(this._heightOptions.heightTotal=i[2]-this._firstHeight,this._heightOptions.isMoving=!1,this.editor.state.transformGeometryOnMove?t=i[2]-this._lastHeight:(this._heightOptions.toTransform=lo.GEOMETRY,t=this._heightOptions.heightTotal),this._lastHeight=null,this._firstHeight=null):(t=i[2]-this._lastHeight,this._lastHeight=i[2]),this._isExtrusion?this.editor.extrude(t,i[2],this._heightOptions):this.editor.translateHeight(t,i[2],this._heightOptions)}else if(e.type&(me.DRAGSTART|me.CLICK)&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.HEIGHTVERTEX){var n=e.feature.getGeometry().getCoordinates();this._lastHeight=n[2]||e.positionOrPixel[2],this._firstHeight=this._lastHeight,this._isExtrusion=!!(e.key&de.SHIFT),this._heightOptions={toTransform:this.editor.state.transformGeometryOnMove?lo.BOTH:lo.VERTEX,isMoving:!0},this.createPlane(n)}return Promise.resolve(e)}}]),t}(Xa),no=io,ro=i(666),ao=i.n(ro),so=i(667),oo=i.n(so),lo={VERTEX:1,GEOMETRY:2,BOTH:0};lo.BOTH=lo.VERTEX|lo.GEOMETRY;var co=Symbol("isTransformation"),uo=Symbol("isEmpty"),ho=Y.getLogger("vcs.vcm.util.editor.FeatureLayerEditor"),mo=new ol.style.Icon({src:ao.a,anchor:[.5,.8],scale:.6}),fo=new ol.style.Style({image:mo}),yo={olcs_altitudeMode:"altitudeMode",olcs_skirt:"skirt",olcs_storeyHeight:"storeyHeight"},go=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.translateInteraction=new Zs(f(e)),e.interactionChain.addInteraction(e.translateInteraction),e.scaleTransformation=new Xs(f(e)),e.interactionChain.addInteraction(e.scaleTransformation),e.rotationTransformation=new to(f(e)),e.interactionChain.addInteraction(e.rotationTransformation),e.heightTransformation=new no(f(e)),e.interactionChain.addInteraction(e.heightTransformation),e.selectFeatureInteraction.hasMultiSelect(),e.mouseOverInteraction.hasMultiSelect=!0,(null==i.allowSelectMode||i.allowSelectMode)&&e.state.allowedModes.push(Object.keys(rn).find(function(e){return rn[e]===tn.SELECT})),e._scratchCenter=new Cesium.Cartesian2,e.flippedY=!1,e.flippedX=!1,e.heights={min:0,max:0,clamped:!0},e.extent=ol.extent.createEmpty(),e.geometry=e._createExtent(),e.feature=new ol.Feature({geometry:e.geometry}),e.feature[co]=!0,e.feature[_n.doNotTransform]=!0,e.feature.set("olcs_altitudeMode",e.heights.clamped?"clampToGround":"absolute"),e.feature.setId("_transformationFeature"),e.vertices=[],e.style=new ol.style.Style({stroke:new ol.style.Stroke({color:"#444444",width:2}),image:new ol.style.Icon({src:oo.a,scale:.45})}),e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.FeatureLayerEditor"}}]),Object(m["a"])(t,[{key:"onSelect",value:function(){this.state.mode&tn.FEATUREMODES&&this.state.active?this.recalculateExtent():this._clearGeometriesFromLayer()}},{key:"_createExtent",value:function(){var e=this,t=ol.extent.createEmpty(),i=-1/0,n=1/0,r=!0;this.features.forEach(function(a){var s=e.isOblique?a[_n.obliqueGeometry]:a.getGeometry();t=ol.extent.extend(t,s.getExtent());var o=a.get("olcs_altitudeMode");if(("clampToGround"===o||null==o&&"clampToGround"===e.activeLayer.altitudeMode)&&null==a.get("olcs_groundLevel"))n=n>0?0:n;else{r=!1;var l=hi(a,e.activeLayer.storeyHeight);i=l.max>i?l.max:i,n=l.min<n?l.min:n}}),this.extent=t,this.heights.max=i===-1/0?0:i,this.heights.min=n===1/0?0:n,this.heights.clamped=r;var a=ol.extent.getSize(this.extent);return 0===a[0]&&0===a[1]&&(this.extent=ol.extent.buffer(this.extent,10,this.extent)),this._createExtentGeom()}},{key:"_createExtentGeom",value:function(){function e(e,t){for(var i=[[0,1],[0,3],[2,3],[2,1],[0,1]],n=new Array(5),r=0;r<5;r++)n[r]=[e[i[r][0]],e[i[r][1]],t];return new ol.geom.LineString(n)}var t;if(ol.extent.isEmpty(this.extent)){var i=[0,0,1,1];t=new ol.geom.MultiLineString([e(i,this.heights.min).getCoordinates()]),t[uo]=!0}else{var n=e(this.extent,this.heights.max),r=n.getCoordinates();t=new ol.geom.MultiLineString([r]),t.appendLineString(e(this.extent,this.heights.min));for(var a=0;a<4;a++){var s=r[a].slice(0);s[2]=this.heights.min,t.appendLineString(new ol.geom.LineString([r[a],s]))}}return this.isOblique&&(t[_n.alreadyTransformedToImage]=!0),t}},{key:"_createVertex",value:function(e,t){e[2]=e[2]||0;var i=new ol.geom.Point(e);this.isOblique&&(i[_n.alreadyTransformedToImage]=!0);var n=new ol.Feature({geometry:i});return n[this.state.featureTypeSymbol]=nn.VERTEX,n[rs]=t,n[_n.doNotTransform]=!0,n}},{key:"_createVertices",value:function(){var e=this;if(!this.geometry[uo]){for(var t=this.geometry.getCoordinates()[0],i=0;i<4;i++){var n=t[i];this.vertices.push(this._createVertex(n,i))}var r=ol.extent.getCenter(this.extent);r[2]=this.heights.max;var a=this._createVertex(r,4);a[this.state.featureTypeSymbol]=nn.HEIGHTVERTEX,a.setStyle(fo),this.vertices.push(a);var s=this.heights.clamped?"clampToGround":"absolute";this.vertices.forEach(function(t,i){t.set("olcs_altitudeMode",s,!0),i<4&&t.setStyle(e.style)},this),this.feature.set("olcs_altitudeMode",s),this.scratchLayer.addFeatures([].concat(Object(T["a"])(this.vertices),[this.feature]))}}},{key:"setMode",value:function(e){ho.debug("FeatureLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.state.mode&tn.FEATUREMODES?this.recalculateExtent():this.state.mode&tn.FEATUREMODES||this._clearGeometriesFromLayer(),e&tn.SELECT?(this.translateInteraction.setActive(),this.scaleTransformation.setActive(),this.rotationTransformation.setActive(),this.heightTransformation.setActive()):e&tn.SCALE?(this.scaleTransformation.setModification(de.NONE|de.SHIFT),this.scaleTransformation.setActive(me.CLICKMOVE)):e&tn.TRANSLATE?(this.translateInteraction.setModification(de.NONE),this.translateInteraction.setActive(me.CLICKMOVE)):e&tn.ROTATE&&(this.rotationTransformation.setModification(de.NONE),this.rotationTransformation.setActive(me.CLICKMOVE))}},{key:"setAltitudeMode",value:function(e){var t=this,i=[],n=!0,r=!1,a=void 0;try{for(var s,o=function(){var t=s.value;if(e&(an.ABSOLUTE|an.ZPLANE)&&"absolute"!==t.get("olcs_altitudeMode")){var n=mi(t).then(function(){t.set("olcs_altitudeMode","absolute")});i.push(n)}else e&an.CLAMP&&"clampToGround"!==t.get("olcs_altitudeMode")&&(fi(t),i.push(Promise.resolve()))},l=this.features.values()[Symbol.iterator]();!(n=(s=l.next()).done);n=!0)o()}catch(u){r=!0,a=u}finally{try{n||null==l.return||l.return()}finally{if(r)throw a}}var c=Promise.all(i);return c.then(function(){i.length&&t.recalculateExtent()})}},{key:"translate",value:function(e,t,i){var n=this,r=i&&i.toTransform?i.toTransform:lo.BOTH;if(this.extent=[this.extent[0]+e,this.extent[1]+t,this.extent[2]+e,this.extent[3]+t],r&lo.VERTEX)for(var a=this.vertices.length-1;a>=0;a--)this.vertices[a].getGeometry().translate(e,t);r&lo.GEOMETRY&&(this.feature.getGeometry().translate(e,t),this.features.forEach(function(i){n.isOblique?i[_n.obliqueGeometry].translate(e,t):i.getGeometry().translate(e,t)}))}},{key:"translateHeight",value:function(e,t,i){var n=this;this.state.altitudeMode&an.CLAMP&&(this.state.altitudeMode=an.ABSOLUTE);var r=i&&i.toTransform?i.toTransform:lo.BOTH,a=!1;if(r&lo.GEOMETRY&&(this.features.forEach(function(i){var r=i.get("olcs_altitudeMode");a=a||"clampToGround"===r||!r&&"clampToGround"===n.activeLayer.altitudeMode,i.set("olcs_altitudeMode","absolute",!0);var s=i.get("olcs_groundLevel");i.unset("olcs_groundLevel");var o=s&&(i.get("olcs_extrudedHeight")||i.get("olcs_storeyNumber")&&i.get("olcs_storeyHeight"));di(i.getGeometry(),e,o?s+e:t,o)}),di(this.geometry,e,t)),r&lo.VERTEX){var s=this.vertices.length;while(s--)this.vertices[s].set("olcs_altitudeMode","absolute",!0),di(this.vertices[s].getGeometry(),e,t)}this.heights.min+=e,this.heights.max+=e,a&&this.recalculateExtent(),this.heights.clamped=!1}},{key:"extrude",value:function(e,t,i){var n=this,r=i||{};this.state.altitudeMode&an.CLAMP&&(this.state.altitudeMode=an.ABSOLUTE);var a=r.toTransform||lo.BOTH,s=[];if(a&lo.GEOMETRY)this.features.forEach(function(i){var a=i.get("olcs_extrudedHeight"),o=i.get("olcs_altitudeMode"),l="absolute"===o||"absolute"===n.activeLayer.altitudeMode&&null==o||null!=i.get("olcs_groundLevel");if(!l){i.set("olcs_altitudeMode","absolute",!0);var c=mi(i);s.push(c)}if(null==a)r.setHeight?i.set("olcs_extrudedHeight",t):i.set("olcs_extrudedHeight",e);else{if(Array.isArray(a)){var u=a.length;if(r.setHeight)while(u--)a[u]=t;else while(u--)a[u]+=e}else null!=a&&(r.setHeight?a=t:a+=e);i.set("olcs_extrudedHeight",a)}}),this.recalculateExtent();else if(a&lo.VERTEX){var o=this.vertices.length;while(o--)this.vertices[o].set("olcs_altitudeMode","absolute",!0),di(this.vertices[o].getGeometry(),e,t)}return s.length?Promise.all(s).then(function(){n.recalculateExtent()}):Promise.resolve()}},{key:"placeOnTerrain",value:function(){var e=this,t=[];return this.features.forEach(function(e){t.push(mi(e))}),t.length?Promise.all(t).then(function(){e.recalculateExtent()}):Promise.resolve()}},{key:"setProperty",value:function(e,t,i){this.features.forEach(function(n){n.set(e,t,i)}),0===this.features.size&&yo[e]&&(this.activeLayer[yo[e]]=t),!i&&this.features.size&&this.recalculateExtent()}},{key:"unsetProperty",value:function(e,t){this.features.forEach(function(i){i.unset(e,t)}),0===this.features.size&&yo[e]&&(this.activeLayer[yo[e]]=void 0),!t&&this.features.size&&this.recalculateExtent()}},{key:"scale",value:function(e,t,i){var n=this,r=i||{},a=r.toTransform||lo.BOTH,s=r.vertex||this.vertices[2],o=s[rs],l=s.getGeometry(),c=ol.extent.getSize(this.extent),u=t;if(r.maintainAspectRatio){var h=c[1]/c[0];u=e*h,u=1===o||3===o?-u:u}var d=[{dx:1,dy:3,across:2,flipY:!1,flipX:!1},{dx:0,dy:2,across:3,flipY:!0,flipX:!1},{dx:3,dy:1,across:0,flipY:!0,flipX:!0},{dx:2,dy:0,across:1,flipY:!1,flipX:!0}],m=d[o];if(a&lo.VERTEX&&(l.translate(e,u),this.vertices[m.dx].getGeometry().translate(e,0),this.vertices[m.dy].getGeometry().translate(0,u),this.vertices[4].getGeometry().translate(e/2,u/2)),a&lo.GEOMETRY){for(var f=this.vertices[m.across].getGeometry().getCoordinates(),y=l.getCoordinates(),g=f[1]-y[1]>0===m.flipY,v=f[0]-y[0]>0===m.flipX,p=[],_=0;_<4;_++)p[_]=this.vertices[_].getGeometry().getCoordinates();var b=ol.extent.boundingExtent(p),L=ol.extent.getSize(b),M=L[0]/c[0],k=L[1]/c[1];this.flippedY!==g&&(this.flippedY=g,k*=-1),this.flippedX!==v&&(this.flippedX=v,M*=-1),this.features.forEach(function(e){var t=n.isOblique?e[_n.obliqueGeometry]:e.getGeometry(),i=t.get("_vcsGeomType");!i||"bbox"!==i&&"rectangle"!==i||r.maintainAspectRatio||t.unset("_vcsGeomType",!0),t.scale(M,k,f)}),this.extent=b,this.feature.getGeometry().scale(M,k,f)}}},{key:"rotate",value:function(e,t){var i=this,n=t||{},r=n.toTransform||lo.BOTH,a=ol.extent.getCenter(this.extent);if(r&lo.VERTEX)for(var s=this.vertices.length-1;s>=0;s--)this.vertices[s].getGeometry().rotate(e,a);r&lo.GEOMETRY&&(this.feature.getGeometry().rotate(e,a),this.features.forEach(function(t){var n=i.isOblique?t[_n.obliqueGeometry]:t.getGeometry();"bbox"===n.get("_vcsGeomType")&&n.set("_vcsGeomType","rectangle",!0),n.rotate(e,a)})),n.isMoving||this.recalculateExtent()}},{key:"_clearGeometriesFromLayer",value:function(){var e=this.vertices.length,t=new Array(e+1);t[e]=this.feature.getId();while(e--)t[e]=this.vertices[e].getId();this.vertices.splice(0),this.scratchLayer.removeFeaturesById(t)}},{key:"recalculateExtent",value:function(){if(this.state.mode&tn.FEATUREMODES){var e=this._createExtent();if(this._clearGeometriesFromLayer(),e[uo])return;this.geometry=e,this.feature.set("olcs_altitudeMode",this.heights.clamped?"clampToGround":"absolute",!0),this.feature.setGeometry(e),this.flippedY=!1,this.flippedX=!1,this.feature.setStyle(this.style),this._createVertices()}}},{key:"handleMapChange",value:function(e){e instanceof Vt?fo.setImage(mo):fo.setImage(null),5===this.vertices.length&&this.vertices[4].changed(),Se(b(t.prototype),"handleMapChange",this).call(this,e)}}]),t}(vs),vo=go,po=new ol.style.Style({}),_o=function(e){function t(e,i,n){var r;return Object(d["a"])(this,t),r=y(this,b(t).call(this,{zPlane:!0})),r.editor=e,r.finished=!0,r.onFinish=i,r._lastVertex=null,r.maxVertices=n,r._lastPosition=null,r._defaultActive=me.CLICKMOVE,r.setActive(!1),r}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE?(t=this.getPosition(e),this.editor.vertices.length<this.maxVertices?this.editor.changeVertex(this._lastVertex,t,!this.editor.state.transformGeometryOnMove):this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._lastVertex,!this.editor.state.transformGeometryOnMove),this._lastPosition=t):e.type&me.CLICK&&(this.editor.vertices.length<this.maxVertices?(1!==this.editor.vertices.length||!this.scene||this.editor.state.altitudeMode&an.CLAMP||this.createPlane(e.positionOrPixel),t=this.getPosition(e),this._lastVertex.setStyle(null),this.editor.changeVertex(this._lastVertex,t),this._lastVertex=this.editor.pushVertex(t),this._lastVertex.setStyle(po),this._lastPosition=t):(t=this.getPosition(e),this.editor.translateVertex(t[0]-this._lastPosition[0],t[1]-this._lastPosition[1],t,this._lastVertex,!1),this._lastVertex.setStyle(null),this.editor.state.transformGeometryOnMove||this.editor.updateGeometry(),this._lastVertex&&this._lastVertex.setStyle(null),this.onFinish(),this.setActive(!1))),Promise.resolve(e));var t}},{key:"setActive",value:function(e){var i=e;e&&0===this.editor.vertices.length?(this.finished=!1,this._lastVertex=this.editor.pushVertex([0,0,0]),this._lastVertex.setStyle(po)):(i=!1,this.finished=!0),Se(b(t.prototype),"setActive",this).call(this,i)}}]),t}(Xa),bo=_o,Lo=function(e){function t(e){var i;Object(d["a"])(this,t);var n=e.geometry,r=n.getLinearRing(0);return e.geometry=r,i=y(this,b(t).call(this,e,!0)),i._create=new bo(f(i),i._validateOnFinish.bind(f(i)),e.isBBox?2:3),i.interactionChain.addInteraction(i._create),i.polygon=n,i.geometry=i.geometry,i._setupGeometry(n),i.isBBox=e.isBBox||!1,i._scratchCartesian1=new Cesium.Cartesian2,i._scratchCartesian2=new Cesium.Cartesian2,i.setAltitudeModeToAbsoluteOnClassification=!1,i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){for(var e=this.geometry.getCoordinates(),t=0;t<e.length;t++)this.vertices.push(this._createVertex(e[t],t));this.scratchLayer.addFeatures(this.vertices)}},{key:"pushVertex",value:function(e){var t=this;if(4===this.vertices.length)return this._create.setActive(!1),this.vertices[3];if(this.isBBox&&1===this.vertices.length){var i=[1,2,0].map(function(i){var n=e.slice();2===i?(n[0]+=1e-4,n[1]+=1e-4):n[i]+=1e-4;var r=t._createVertex(n);return t.vertices.push(r),r});return this.scratchLayer.addFeatures(i),this.vertices[0]}if(this.vertices.length<2){var n=this._createVertex(e),r=this.geometry.getCoordinates();return r.push(e),this.geometry.setCoordinates(r),this.vertices.push(n),this.scratchLayer.addFeatures([n]),n}var a=Cesium.Matrix2.fromArray([0,1,-1,0]),s=this.vertices[0].getGeometry().getCoordinates(),o=this.vertices[1].getGeometry().getCoordinates();this._scratchCartesian1=Cesium.Cartesian2.fromElements(s[0]-o[0],s[1]-o[1],this._scratchCartesian1),this._scratchCartesian2=Cesium.Matrix2.multiplyByVector(a,this._scratchCartesian1,this._scratchCartesian2),this._scratchCartesian2=Cesium.Cartesian2.normalize(this._scratchCartesian2,this._scratchCartesian2),this._scratchCartesian2=Cesium.Cartesian2.multiplyByScalar(this._scratchCartesian2,1e-4,this._scratchCartesian2);var l=[this._scratchCartesian2.x+s[0],this._scratchCartesian2.y+s[1],s[2]],c=this._createVertex([l[0]-this._scratchCartesian1.x,l[1]-this._scratchCartesian1.y,s[2]]),u=this._createVertex(l);return this.vertices.push(c),this.vertices.push(u),this.scratchLayer.addFeatures([c,u]),this.updateGeometry(),c}},{key:"updateGeometry",value:function(){var e=this;this.isOblique&&(this.geometry[_n.imageGeometryChanged]=!0),this.geometry.setCoordinates(this.vertices.map(function(t){return e.isOblique?t[_n.obliqueGeometry].getCoordinates():t.getGeometry().getCoordinates()}),"XYZ")}},{key:"_setupGeometry",value:function(e){var t=this;this.polygon=e,this.geometry=e.getLinearRing(0),this.listener=this.geometry.on("change",function(){t.polygon.setCoordinates([t.geometry.getCoordinates()],"XYZ")})}},{key:"translateVertex",value:function(e,t,i,n,r){var a=this.isOblique?n[_n.obliqueGeometry]:n.getGeometry();this.isOblique&&(a[_n.alreadyTransformedToImage]=!0),a.translate(e,t);var s=a.getCoordinates(),o={0:[3,1,2],1:[2,0,3],2:[1,3,0],3:[0,2,1]},l=o[this.getVertexIndex(n)],c=this.isOblique?this.vertices[l[2]][_n.obliqueGeometry]:this.vertices[l[2]].getGeometry(),u=c.getCoordinates(),h=ai(u,s);if(h<1e-4)a.setCoordinates([u[0]+1e-4,u[1]+1e-4,i[2]]);else{var d=this.isOblique?this.vertices[l[0]][_n.obliqueGeometry]:this.vertices[l[0]].getGeometry(),m=this.isOblique?this.vertices[l[1]][_n.obliqueGeometry]:this.vertices[l[1]].getGeometry();this.isOblique&&(d[_n.alreadyTransformedToImage]=!0,m[_n.alreadyTransformedToImage]=!0),d.setCoordinates(ni(u,d.getCoordinates(),s)),m.setCoordinates(ni(u,m.getCoordinates(),s)),r||this.updateGeometry()}}},{key:"translateVertexHeight",value:function(e,i,n){var r=this.vertices.length;while(r--)Se(b(t.prototype),"translateVertexHeight",this).call(this,e,this.vertices[r],!0);n||this.updateGeometry()}},{key:"validate",value:function(){return!this.creationActive&&4===this.vertices.length}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),ol.Observable.unByKey(this.listener)}},{key:"setExtent",value:function(e,t){o(e,[Number]),o(e.length,4);var i=ol.geom.Polygon.fromExtent(e).getLinearRing(0).getCoordinates();sr(i);var n=t||(this.vertices.length?this.vertices[0].getGeometry().getCoordinates()[2]:0);this.geometry.setCoordinates(i.map(function(e){return e[2]=n,e})),this._clearVertices(),this._createVertices()}}]),t}(os),Mo=Lo,ko=new ol.style.Style({});function wo(){}var To=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.finished=!0,n.onFinish=i||wo,n._defaultActive=me.CLICKMOVE,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE&&this.editor.changeVertex(this._lastVertex,e.positionOrPixel,!this.editor.state.transformGeometryOnMove),e.type&me.CLICK&&(this.editor.changeVertex(this._lastVertex,e.positionOrPixel),this._lastVertex.setStyle(null),this.editor.feature.setStyle(this._featureStyle),this.onFinish(),this.setActive(!1)),Promise.resolve(e))}},{key:"setActive",value:function(e){e&&0===this.editor.vertices.length?(this.finished=!1,this._lastVertex=this.editor.pushVertex([0,0,0]),this._lastVertex.setStyle(ko),this._featureStyle=this.editor.feature.getStyle(),this.editor.feature.setStyle(ko)):this.finished=!0,Se(b(t.prototype),"setActive",this).call(this,!this.finished&&e)}}]),t}(pe),So=To,Oo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.editor=e,i._defaultActive=me.CLICK,i._defaultModificationKey=de.SHIFT,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return!this.editor.state.onlyAllowTranslation&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX&&this.editor.removeVertex(e.feature),Promise.resolve(e)}}]),t}(pe),Co=Oo,Eo=[/\+/,/-/,/\*/,new RegExp("\\/")],Io=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.balloonContent=e.balloonContent,i.template=e.template,i.attributes=e.attributes,i.layerName=e.layerName,i.longitude=e.longitude,i.latitude=e.latitude,i.height=e.height||0,i.relativeToGround=e.relativeToGround,i.minTop=e.minTop||"0",i.viewerTopOffset=0,i.minLeft=e.minLeft||"0",i.containerId=e.containerId||"balloonContainer",i.balloonWidget=e.balloonWidget,i.balloonId=Object(u["c"])(),i.initialized=!1,i.initializedFor=null,i.cartographic=new Cesium.Cartographic,i.cartesian3=null,i.mercatorCoordinates=null,i.obliqueCoordinates=null,i.obliqueImageChangedSubscriptionKey=i.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,i.obliqueChangedListener.bind(f(i))),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.util.Balloon"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.framework.getActiveMap();e instanceof Vt?this.initializeForCesium():e instanceof Hi?this.initializeForOpenlayers():e instanceof Pi&&this.initializeForOblique()}},{key:"setPosition",value:function(e){var t=this;if("cesium"===this.initializedFor)R.mercatorToWgs84(e,!0),this.relativeToGround?(this.cartographic.longitude=Cesium.Math.toRadians(e[0]),this.cartographic.latitude=Cesium.Math.toRadians(e[1])):this.cartesian3=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2],this.cesiumScene.globe.ellipsoid,this.cartesian3);else if("openlayers"===this.initializedFor)this.mercatorCoordinates.splice(0,3,e[0],e[1],e[2]);else if("oblique"===this.initializedFor){var i=this.framework.getActiveMap();if(i instanceof Pi)return Object(Bt["f"])(i.activeLayer.currentImage,[e[0],e[1],e[2]],{dataProjection:ol.proj.get("EPSG:3857")}).then(function(e){var i=e.coords;t.obliqueCoordinates.splice(0,2,i[0],i[1])})}return Promise.resolve()}},{key:"obliqueChangedListener",value:function(){this.close()}},{key:"getDomNodes",value:function(){var e;if(this.balloonContent)e=this.balloonContent;else try{e=Dr()(this.template)(this.attributes)}catch(a){return this.logger.warning("Could not render the template for layer: ".concat(this.layerName,". Please verify that the balloon template is correct")),null}var t=document.createElement("div");if(t.setAttribute("id",this.balloonId),e instanceof HTMLElement?t.appendChild(e):t.innerHTML=e,!t.children.length){var i=document.createElement("div");i.innerHTML=e,t.appendChild(i)}for(var n=0;n<t.children.length;n++){q.getInstance().translateAll(t.children[n]);var r=t.children[n];r.style.top="-1000px",r.style.left="-1000px"}return t}},{key:"initializeForCesium",value:function(){if(!this.initialized){var e=this.initializeBalloon();if(this.cesiumMap=this.framework.getActiveMap(),this.cesiumScene=this.cesiumMap.getScene(),!this.cartesian3||this.relativeToGround&&Cesium.Cartographic.equals(this.cartographic,Cesium.Cartographic.ZERO)){if(null==this.longitude||null==this.latitude)return void this.logger.error("Cannot instatiate balloon without defined cartesian3 or longitude latitude");this.relativeToGround&&Cesium.Cartographic.equals(this.cartographic,Cesium.Cartographic.ZERO)?(this.cartographic=Cesium.Cartographic.fromDegrees(this.longitude,this.latitude,this.height,this.cartographic),this.cartographic.height=this.cesiumScene.globe.getHeight(this.cartographic)+this.height,this.cartesian3=Cesium.Cartographic.toCartesian(this.cartographic)):this.cartesian3=Cesium.Cartesian3.fromDegrees(this.longitude,this.latitude,this.height)}this.cesiumPostRenderBind=this.cesiumPostRenderHandler.bind(this,e.minTop,e.minLeft),this.cesiumScene.postRender.addEventListener(this.cesiumPostRenderBind),this.initialized=!0,this.initializedFor="cesium"}}},{key:"cesiumPostRenderHandler",value:function(e,t){this.relativeToGround&&(this.cartographic.height=this.cesiumScene.globe.getHeight(this.cartographic)+this.height,this.cartesian3=Cesium.Cartographic.toCartesian(this.cartographic,this.cesiumScene.globe.ellipsoid,this.cartesian3));var i=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.cesiumScene,this.cartesian3);i&&i.x&&i.y&&(this.poiLocationWindowCoordsx=i.x,this.poiLocationWindowCoordsy=i.y,this.setBalloonPosition(e,t))}},{key:"initializeForOpenlayers",value:function(){if(!this.initialized){var e=this.initializeBalloon();this.olMap=this.framework.getActiveMap().ol3map,this.mercatorCoordinates||(this.mercatorCoordinates=R.wgs84ToMercator([this.longitude,this.latitude,this.height])),this.openlayersUnsubscribeKey=this.olMap.on("postrender",this.olPostRenderHandler.bind(this,this.mercatorCoordinates,e.minTop,e.minLeft)),this.initialized=!0,this.initializedFor="openlayers",this.olMap.dispatchEvent("postrender")}}},{key:"setBalloonPosition",value:function(e,t){var i=document.getElementById(this.balloonId);if(i&&i.children[0]){var n=i.children[0];n.style.top="".concat(this.poiLocationWindowCoordsy-e,"px"),n.style.left="".concat(this.poiLocationWindowCoordsx-t,"px")}}},{key:"olPostRenderHandler",value:function(e,t,i){var n=this.olMap.getPixelFromCoordinate(e);if(n){var r=this.olMap.get("vcs_scale")||1;this.poiLocationWindowCoordsx=n[0]/r,this.poiLocationWindowCoordsy=n[1]/r,this.setBalloonPosition(t,i)}}},{key:"initializeBalloon",value:function(){var e=this.getDomNodes();if(!e)return null;var i=document.getElementById(this.containerId);i.appendChild(e);var n=t.computeOffset(e,this.minTop)-this.viewerTopOffset,r=t.computeOffset(e,this.minLeft),a=document.getElementById(this.balloonId).getElementsByClassName("close-balloon");if(a)for(var s=0;s<a.length;s++)a[s].addEventListener("click",this.closeBalloonClicked.bind(this));return{minTop:n,minLeft:r}}},{key:"initializeForOblique",value:function(){var e=this;if(!this.initialized){var t=this.initializeBalloon(),i=this.framework.getActiveMap();this.olMap=i.olMap;var n=Promise.resolve();this.obliqueCoordinates||(n=Object(Bt["f"])(i.activeLayer.currentImage,[this.longitude,this.latitude,this.relativeToGround?0:this.height],{dataProjection:ol.proj.get("EPSG:4326")}).then(function(t){var i=t.coords;e.obliqueCoordinates=i})),n.then(function(){e.obliqueUnsubscribeKey=e.olMap.on("postrender",e.olPostRenderHandler.bind(e,e.obliqueCoordinates,t.minTop,t.minLeft)),e.initializedFor="oblique",e.initialized=!0,e.olMap.dispatchEvent("postrender")})}}},{key:"close",value:function(){var e=document.getElementById(this.balloonId);e&&(e.parentNode.removeChild(e),"cesium"===this.initializedFor?this.cesiumScene.postRender.removeEventListener(this.cesiumPostRenderBind):"openlayers"===this.initializedFor?ol.Observable.unByKey(this.openlayersUnsubscribeKey):"oblique"===this.initializedFor&&ol.Observable.unByKey(this.obliqueUnsubscribeKey)),this.obliqueImageChangedSubscriptionKey&&this.framework.unsubscribeByKey(this.obliqueImageChangedSubscriptionKey),this.initialized=!1}},{key:"closeBalloonClicked",value:function(){var e=Q.getInstance();e&&this.balloonWidget?e.clearCurrentItem():this.close()}},{key:"show",value:function(e){document.getElementById(this.balloonId).style.display=e?"block":"none"}},{key:"getLink",value:function(e){var t="".concat(this.longitude.toFixed(8),",").concat(this.latitude.toFixed(8),",").concat(this.height.toFixed(2)),i={slLayer:this.layerName,slPos:t,slR2G:this.relativeToGround,slAt:JSON.stringify(this.attributes)};e.addQueryParams(i)}}],[{key:"computeOffset",value:function(e,t){if("number"===typeof t)return t;var i=e.children[0],n=i.offsetHeight,r=i.offsetWidth;function a(e){return/\d+/.test(e)?Number(e.match(/\d+/)[0]):/balloonHeight/.test(e)?n:/balloonWidth/.test(e)?r:0}function s(e,t){return e.reduce(function(e,i){switch(!0){case t.test("+"):return e+i;case t.test("-"):return e-i;case t.test("*"):return e*i;case t.test("/"):return e/i;default:return e+i}})}var o,l=Eo.find(function(e){return e.test(t)});if(l){var c=t.split(l),u=c.map(a);o=s(u,l)}else o=a(t);return Number(o)}}]),t}(A),Do=Io,jo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i._defaultActive=me.CLICK,i.editor=e,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.feature&&e.feature[this.editor.state.featureTypeSymbol]&(nn.EDITING|nn.VERTEX)&&this.editor.editLabel(),Promise.resolve(e)}}]),t}(pe),Po=jo,Yo=Y.getLogger("vcs.vcm.util.editor.PointGeometryEditor"),xo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new So(f(i),i._checkLabel.bind(f(i))),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.feature[i.state.featureTypeSymbol]|=nn.VERTEX,i._removeVertex=new Co(f(i)),i.interactionChain.addInteraction(i._removeVertex),i.isLabel="Label"===i.geometry.get("_vcsGeomType"),i._selectLabel=null,i.isLabel&&(i._selectLabel=new Po(f(i)),i.interactionChain.addInteraction(i._selectLabel)),i._balloon=null,i._textArea=null,i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){var e=this.geometry.getCoordinates();if(!e.every(function(e){return 0===e})){var t=this._createVertex(e);this.vertices.push(t),this.scratchLayer.addFeatures([t])}}},{key:"pushVertex",value:function(e){if(this.vertices.length)return this.state.mode&tn.CREATE&&this.onFinish(),this.vertices[0];var t=this._createVertex(e);return this.vertices.push(t),this.geometry.setCoordinates(e),this.scratchLayer.addFeatures([t]),t}},{key:"_checkLabel",value:function(){!this._balloon&&this.isLabel&&1===this.vertices.length?this.editLabel():Se(b(t.prototype),"_validateOnFinish",this).call(this)}},{key:"_validateOnFinish",value:function(){this.creationActive=!!this.isLabel&&!this._hasLabel(),this.validate()?this.onFinish():this._removeFeature()}},{key:"addLabel",value:function(){this._selectLabel||(this._selectLabel=new Po(this),this.interactionChain.addInteraction(this._selectLabel)),this.isLabel=!0,this.geometry.set("_vcsGeomType","Label",!0),this.feature[ft]||(this.feature[ft]=this.parent.activeLayer.style.clone(),this.feature.setStyle(this.feature[ft].style),this.feature.changed()),this.editLabel()}},{key:"editLabel",value:function(){this._setBalloon(this.feature[ft].label)}},{key:"_setBalloon",value:function(e){this._textArea||(this._textArea=document.createElement("textarea"),this._textArea.rows=1,this._textArea.cols=100,this._textArea.classList.add("balloon"),this._textArea.addEventListener("keydown",this._labelKeyDown.bind(this))),e&&(this._textArea.value=e);var t={balloonContent:this._textArea};if(!this.isOblique){var i=R.mercatorToWgs84(this.geometry.getCoordinates()),n=Object(Ie["a"])(i,3);t.longitude=n[0],t.latitude=n[1],t.height=n[2]}this._balloon=new Do(t),this.isOblique&&(this._balloon.obliqueCoordinates=this.geometry.getCoordinates()),this._balloon.initialize(),this._textArea.focus()}},{key:"stopEditingLabel",value:function(e){this._balloon&&(e&&this._textArea&&(this.feature[ft].label=this._textArea.value,this.feature.changed()),this._balloon.close(),this._balloon=null,this._textArea=null,this.state.mode&tn.CREATE?this._validateOnFinish():this.validate()||this.stopCreation())}},{key:"translateVertex",value:function(e,i,n,r,a){Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,this.vertices[0],a)}},{key:"translateVertexHeight",value:function(e,i,n){Se(b(t.prototype),"translateVertexHeight",this).call(this,e,this.vertices[0],n)}},{key:"_labelKeyDown",value:function(e){e.stopPropagation(),"Escape"===e.key?this.stopEditingLabel():"Enter"===e.key&&this.stopEditingLabel(!0)}},{key:"removeVertex",value:function(e){this.scratchLayer.removeFeaturesById([e.getId()]),this._removeFeature()}},{key:"_hasLabel",value:function(){var e=this.feature[ft]?this.feature[ft].label:null;return e&&e.length}},{key:"stopCreation",value:function(){Se(b(t.prototype),"stopCreation",this).call(this),this.validate()&&this.isLabel&&(this._hasLabel()||this.geometry.unset("_vcsGeomType",!0))}},{key:"validate",value:function(){return!this.creationActive&&!this.geometry.getCoordinates().every(function(e){return 0===e})}},{key:"updateGeometry",value:function(){var e=this.vertices[0].getGeometry().getCoordinates();this.geometry.setCoordinates(e,"XYZ"),this._balloon&&(this.isOblique?this._balloon.obliqueCoordinates.splice(0,2,e[0],e[1]):this._balloon.setPosition(e))}},{key:"setPosition",value:function(e){o(e,[Number]),o(e.length,3),this.vertices.length?(this.vertices[0].getGeometry().setCoordinates(e),this.updateGeometry()):this.pushVertex(e),this.creationActive&&this._validateOnFinish()}},{key:"setMode",value:function(e){Yo.debug("PointGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.state.mode&tn.EDIT?(this._selectLabel&&this._selectLabel.setActive(),this._removeVertex.setActive()):this.state.mode&tn.REMOVEVERTEX&&(this._removeVertex.setActive(!0),this._removeVertex.setModification(de.NONE))}},{key:"handleMapChange",value:function(e){this._balloon&&(this._balloon.close(),this._setBalloon())}},{key:"destroy",value:function(){this._balloon&&(this._balloon.close(),this._balloon=null,this._textArea=null),this.feature[this.state.featureTypeSymbol]^=nn.VERTEX,Se(b(t.prototype),"destroy",this).call(this)}}]),t}(os),Ao=xo;function Fo(){}var No=new ol.style.Style({}),Ho=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.finished=!0,n._lastVertex=null,n.onFinish=i||Fo,n._defaultActive=me.CLICK|me.DBLCLICK|me.MOVE,n.setActive(!1),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return this.finished?Promise.resolve(e):(e.type&me.MOVE&&this.editor.changeVertex(this._lastVertex,e.positionOrPixel,!this.editor.state.transformGeometryOnMove),e.type&me.CLICK&&(this.editor.changeVertex(this._lastVertex,e.positionOrPixel),this._lastVertex.setStyle(null),this._lastVertex=this.editor.reverse?this.editor.unshiftVertex(e.positionOrPixel):this.editor.pushVertex(e.positionOrPixel),this._lastVertex.setStyle(No)),e.type&me.DBLCLICK&&(this.editor.removeVertex(this._lastVertex),this.editor.reverse=!1,this.onFinish(),this.setActive(!1)),Promise.resolve(e))}},{key:"setActive",value:function(e){var i;e?(this.finished=!1,this.editor.vertices.length>0?(i=this.editor.reverse?this.editor.vertices[0]:this.editor.vertices.slice(-1)[0],i=i.getGeometry().getCoordinates()):i=[0,0,0],this._lastVertex=this.editor.reverse?this.editor.unshiftVertex(i):this.editor.pushVertex(i),this._lastVertex.setStyle(No)):this.finished=!0;Se(b(t.prototype),"setActive",this).call(this,e)}}]),t}(pe),Ro=Ho,zo=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.editor=e,n.callback=i,n.timeOut=null,n.clickDuration=xn().clickDuration,n._defaultActive=me.CLICK|me.DBLCLICK,n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!this.editor.state.onlyAllowTranslation){if(e.type&me.DBLCLICK)return this.editor.reverse=!1,clearTimeout(this.timeOut),Promise.resolve(e);if(e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.VERTEX){var t=this.editor.getVertexIndex(e.feature);0===t?(this.editor.reverse=!0,this.doCallback()):t===this.editor.vertices.length-1&&this.doCallback()}}return Promise.resolve(e)}},{key:"doCallback",value:function(){this.timeOut=setTimeout(this.callback,this.clickDuration)}}]),t}(pe),Go=zo,Vo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.editor=e,i._defaultActive=me.CLICK,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return!this.editor.state.onlyAllowTranslation&&e.feature&&e.feature[this.editor.state.featureTypeSymbol]&nn.EDITING&&this.editor.insertVertex(e.positionOrPixel),Promise.resolve(e)}}]),t}(pe),Bo=Vo,Uo=Y.getLogger("vcs.vcm.util.editor.LineGeometryEditor"),Wo=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new Ro(f(i),i._validateOnFinish.bind(f(i))),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.reverse=!1,i._lastVertex=new Go(f(i),function(){i.getRootEditor().setMode(tn.CREATE)}),i.interactionChain.addInteraction(i._lastVertex),i._insertVertex=new Bo(f(i)),i.interactionChain.addInteraction(i._insertVertex),i._removeVertex=new Co(f(i)),i.interactionChain.addInteraction(i._removeVertex),i}return w(t,e),Object(m["a"])(t,[{key:"_createVertices",value:function(){for(var e=this.geometry.getCoordinates(),t=0;t<e.length;t++)this.vertices.push(this._createVertex(e[t]));this.scratchLayer.addFeatures(this.vertices)}},{key:"updateGeometry",value:function(){var e=this;this.isOblique&&(this.geometry[_n.imageGeometryChanged]=!0),this.geometry.setCoordinates(this.vertices.map(function(t){return e.isOblique?t[_n.obliqueGeometry].getCoordinates():t.getGeometry().getCoordinates()}),"XYZ")}},{key:"pushVertex",value:function(e){var t=this._createVertex(e);this.vertices.push(t),this.scratchLayer.addFeatures([t]);var i=this.geometry.getCoordinates();return i.push(e),this.geometry.setCoordinates(i),t}},{key:"insertVertex",value:function(e){var t=this.geometry.getCoordinates(),i=this.geometry.getClosestPoint(e);this.geometry instanceof ol.geom.LinearRing&&t.push(t[0]);var n="clampToGround"===this.feature.get("olcs_altitudeMode")?ri(i,e):ai(i,e);if(n<5){var r=t.length-1,a=0;for(a;a<r;a++){var s="clampToGround"===this.feature.get("olcs_altitudeMode")?oi(t[a],t[a+1],i):si(t[a],t[a+1],i);if(s)break}var o=this._createVertex(e);return this.vertices.splice(a+1,0,o),this.scratchLayer.addFeatures([o]),this.updateGeometry(),o}return null}},{key:"unshiftVertex",value:function(e){var t=this._createVertex(e);this.vertices.unshift(t),this.scratchLayer.addFeatures([t]);var i=this.geometry.getCoordinates();return i.unshift(e),this.geometry.setCoordinates(i),t}},{key:"removeVertex",value:function(e){var t=this.getVertexIndex(e);if(t>-1){var i=this.geometry.getCoordinates();i.splice(t,1),this.geometry.setCoordinates(i),this.vertices.splice(t,1),this.scratchLayer.removeFeaturesById([e.getId()])}}},{key:"stopCreation",value:function(){if(Se(b(t.prototype),"stopCreation",this).call(this),this.creationActive&&this.validate()){var e=this.reverse?this.vertices[0]:this.vertices[this.vertices.length-1];this.removeVertex(e)}}},{key:"setMode",value:function(e){Uo.debug("LineGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.feature.set("olcs_allowPicking",!!(e&tn.EDIT)),this.state.mode&tn.EDIT?(this._lastVertex.setActive(),this._insertVertex.setActive(),this._removeVertex.setActive()):this.state.mode&tn.REMOVEVERTEX&&(this._removeVertex.setActive(!0),this._removeVertex.setModification(de.NONE))}},{key:"validate",value:function(){var e=1;return this.creationActive&&(e+=1),"LinearRing"===this.geometry.getType()&&(e+=1),this.geometry.getCoordinates().length>e}}]),t}(os),qo=Wo,Jo=new ol.Sphere(6378137),Ko=function(e){function t(e){var i;Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i._create=new bo(f(i),i._validateOnFinish.bind(f(i)),2),i.interactionChain.addInteraction(i._create),i.geometry=i.geometry,i.radius=null;var n=i.feature.get("olcs.circle_type");return n&&"sphere"===n||(i._translateVertex.forceZPlane=!0),i.setAltitudeModeToAbsoluteOnClassification=!1,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.geometry.getCenter();e[2]=e[2]||0;var i=this.geometry.getRadius();this.geometry.setCenterAndRadius(e,i,"XYZ"),Se(b(t.prototype),"initialize",this).call(this)}},{key:"_createVertices",value:function(){var e=this.geometry.getFirstCoordinate();if(!e.every(function(e){return 0===e})){this.vertices.push(this._createVertex(e,0));var t=this.geometry.getLastCoordinate();t.length&&this.vertices.push(this._createVertex(t,1)),this.scratchLayer.addFeatures(this.vertices)}}},{key:"updateGeometry",value:function(){2===this.vertices.length&&this.geometry.setCoordinates([this.vertices[0].getGeometry().getCoordinates(),this.vertices[1].getGeometry().getCoordinates()])}},{key:"pushVertex",value:function(e){if(this.vertices.length<2){var t=!1,i=this.vertices.length;1===i&&(this.geometry.setCenter(this.vertices[0].getGeometry().getCoordinates()),this.radius&&(this.geometry.setRadius(this.radius),e[0]+=this.radius,this.radius=null,t=!0));var n=this._createVertex(e,i);return this.vertices.push(n),this.scratchLayer.addFeatures([n]),t&&this.stopCreation(),n}return this.vertices[1]}},{key:"validate",value:function(){return!this.creationActive}},{key:"translateVertex",value:function(e,i,n,r,a){if(0===r[rs])Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,r,!0),a||(this.geometry.setCenter(r.getGeometry().getCoordinates()),this.vertices[1].getGeometry().setCoordinates(this.geometry.getLastCoordinate()));else{var s,o=this.feature.get("olcs.circle_type");if(o&&"sphere"===o?(s=ai,Se(b(t.prototype),"translateVertex",this).call(this,e,i,n,r,!0)):(s=ri,r.getGeometry().translate(e,i)),!a){var l=this.vertices[0].getGeometry().getCoordinates(),c=r.getGeometry().getCoordinates(),u=s(l,c);this.geometry.setRadius(u)}}}},{key:"translateVertexHeight",value:function(e,t,i){var n=2;while(n--){var r=this.vertices[n].getGeometry(),a=r.getCoordinates();a[2]+=e,r.setCoordinates(a)}i||this.geometry.setCenter(this.vertices[0].getGeometry().getCoordinates())}},{key:"setPosition",value:function(e){o(e,[Number]),o(e.length,3),this.geometry.setCenter(e),this._clearVertices(),this._createVertices()}},{key:"setRadius",value:function(e){o(e,Number);var t=this.geometry.getCenter(),i=Jo.offset(R.mercatorToWgs84(t),e,Math.PI/2);i[2]=t[2],this.geometry.setCoordinates([t,R.wgs84ToMercator(i,!0)]),this.vertices.length>1?(this.vertices[1].getGeometry().setCoordinates(this.geometry.getLastCoordinate()),this.creationActive&&this._validateOnFinish()):this.radius=Math.abs(i[0]-t[0])}}]),t}(os),Zo=Ko,Qo=function(e){function t(e,i,n,r){var a;return Object(d["a"])(this,t),a=y(this,b(t).call(this)),a.geometry=e,a.cb=i,a.isEditingGeometry=n,a.featureTypeSymbol=r,a._defaultActive=me.CLICK,a.setActive(),a}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(e.feature&&e.feature[this.featureTypeSymbol]&nn.EDITING&&this.geometry[this.isEditingGeometry]){var t=Kt(this.geometry);if(0===t.length)return this.cb(0),Promise.resolve(e);for(var i=1/0,n=0,r=0;r<t.length;r++){var a=t[r].getClosestPoint(e.positionOrPixel),s=ai(a,e.positionOrPixel);s<i&&(n=r,i=s)}this.cb(n)}return Promise.resolve(e)}}]),t}(pe),Xo=Qo,$o={MultiPolygon:"Polygon",MultiPoint:"Point",MultiLineString:"LineString",Polygon:"LinearRing"},el=Y.getLogger("vcs.vcm.util.editor.MultiGeometryEditor"),tl=Symbol("isEditingGeometry"),il=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.geometry=e.geometry,i.feature=e.feature,i.layer=e.layer,i.editors=[],i.listeners=[],i.isEditingGeometry=Symbol("isEditingGeometry"),i._selectGeometryInteraction=new Xo(i.geometry,i.activateEditor.bind(f(i)),tl,i.state.featureTypeSymbol),i.interactionChain.addInteraction(i._selectGeometryInteraction),i._finishAction=e.onFinish||i.setMode.bind(f(i),tn.EDIT),i.onRemoved=e.onRemoved||function(){},i.activateEditorIndex=null,i._setupGeometries(),i.geometry[tl]=!0,i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.MultiGeometryEditor"}}]),Object(m["a"])(t,[{key:"_setupGeometries",value:function(){var e=Kt(this.geometry);e.forEach(this.addGeometry,this)}},{key:"addGeometry",value:function(e){var t=this,i=e||rl[$o[this.geometry.getType()]](),n=al({parent:this,geometry:i,layer:this.layer,feature:this.feature,onFinish:this._finishAction,onRemoved:this._geometryRemoved.bind(this,this.editors.length)}),r=this.editors.push(n)-1;this.listeners.push(i.on("change",function(){var e=t.geometry.getCoordinates();e[r]=i.getCoordinates(),t.geometry.setCoordinates(e,"XYZ")})),e||(Zt(this.geometry,i),this.state.mode=tn.CREATE,this.activateEditor(r))}},{key:"_geometryRemoved",value:function(e,t){if(e||"Polygon"!==this.geometry.getType()){var i=this.geometry.getCoordinates();if(i.splice(e,1),!i.length)return void this._removeFeature(t);this.geometry.setCoordinates(i,"XYZ"),this.destroy(),this.editors=[],this.listeners=[],this._setupGeometries()}else this._removeFeature(t)}},{key:"_removeFeature",value:function(e){var t=this.parent&&this.parent.className===this.className;if(!t){var i=ne.getInstance().getLayerByName(this.state.layerName);i.removeFeaturesById([this.feature.getId()])}e&&!t||this.onRemoved()}},{key:"setAltitudeMode",value:function(e){null!=this.activateEditorIndex&&this.editors[this.activateEditorIndex].setAltitudeMode(e)}},{key:"activateEditor",value:function(e){if(this.activateEditorIndex!==e){if(null!==this.activateEditorIndex){var t=this.editors[this.activateEditorIndex];t.destroy(),t.geometry[tl]=!1,this.interactionChain.removeInteraction(t.interactionChain)}this.activateEditorIndex=e,this._selectGeometryInteraction.setActive(!1);var i=this.editors[e];i.initialize(),i.geometry[tl]=!0,this.interactionChain.addInteraction(i.interactionChain),this.setMode(this.state.mode)}}},{key:"setMode",value:function(e){el.debug("MultiGeometryEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e})));var i=Kt(this.geometry,null===this.activateEditorIndex?0:this.activateEditorIndex);if(i){var n=e,r=i.getExtent();if((ol.extent.isEmpty(r)||r.every(function(e){return 0===e}))&&(n=tn.CREATE),Se(b(t.prototype),"setMode",this).call(this,n),n^tn.CREATE&&this._selectGeometryInteraction.setActive(),null===this.activateEditorIndex)this.activateEditor(0);else{var a=this.editors[this.activateEditorIndex];a.interactionChain.setActive(!0),a.setMode(n)}}else this.addGeometry()}},{key:"stopCreation",value:function(){null!==this.activateEditorIndex&&(this.editors[this.activateEditorIndex].validate()?this.editors[this.activateEditorIndex].stopCreation():this._geometryRemoved(this.activateEditorIndex,!0))}},{key:"validate",value:function(){return this.editors.some(function(e){return e.validate()})}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),ol.Observable.unByKey(this.listeners);for(var e=0;e<this.editors.length;e++)this.editors[e].destroy();this.activateEditorIndex=null}}]),t}(Za),nl=il,rl={Point:function(){var e=new ol.geom.Point([0,0,0],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e},Label:function(){var e=new ol.geom.Point([0,0,0],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e.set("_vcsGeomType","Label"),e},Circle:function(){var e=new ol.geom.Circle([0,0,0],20,"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e},LineString:function(){return new ol.geom.LineString([],"XYZ")},LinearRing:function(){return new ol.geom.LinearRing([],"XYZ")},Polygon:function(){return new ol.geom.Polygon([[]],"XYZ")},BBox:function(){var e=new ol.geom.Polygon([[]],"XYZ");return e.set("_vcsGeomType","bbox"),e},Rectangle:function(){var e=new ol.geom.Polygon([[]],"XYZ");return e.set("_vcsGeomType","rectangle"),e},MultiLineString:function(){return new ol.geom.MultiLineString([[]],"XYZ")},MultiPolygon:function(){return new ol.geom.MultiPolygon([[[]]],"XYZ")},MultiPoint:function(){var e=new ol.geom.MultiPoint([[0,0,0]],"XYZ");return e[_n.alreadyTransformedToMercator]=!0,e}};function al(e){var t=e.geometry;if(t instanceof ol.geom.Polygon){var i=t.get("_vcsGeomType");return i&&"rectangle"===i?new Mo(e):i&&"bbox"===i?new Mo(Object.assign(e,{isBBox:!0})):new nl(Object.assign(e,{geomType:"LinearRing"}))}if(t instanceof ol.geom.Circle)return new Zo(e);if(t instanceof ol.geom.Point)return new Ao(e);var n=["LineString","Polygon","Point"],r=n.find(function(e){return t instanceof ol.geom["Multi".concat(e)]});return r?new nl(Object.assign(e,{geomType:r})):new qo(e)}var sl=i(668),ll=i.n(sl),cl=Y.getLogger("vcs.vcm.util.editor.GeometryLayerEditor"),ul=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.state.allowedGeometries=i.allowedGeometries||["Point","LineString","Polygon","BBox","Circle","Rectangle","Label"],e.lastFeatureType=null,(null==i.allowEditMode||i.allowEditMode)&&e.state.allowedModes.push(Object.keys(rn).find(function(e){return rn[e]===tn.EDIT})),e.geometryEditor=null,e.defaultMode=rn[i.defaultMode]||tn.CREATE,e.scratchLayer.setStyle(new ol.style.Style({image:new ol.style.Icon({src:ll.a,scale:.45})})),e.state.dedicatedFeatureStyle=i.dedicatedFeatureStyle,e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.GeometryLayerEditor"}}]),Object(m["a"])(t,[{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.isOblique&&(ne.getInstance().getActiveMap().switchEnabled=!0)}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this,e),e&tn.GEOMETRYMODES||this.clearGeometryEditor()}},{key:"setMode",value:function(e){if(cl.debug("GeometryLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.isOblique&&(ne.getInstance().getActiveMap().switchEnabled=!(e&tn.GEOMETRYMODES)||0===this.features.size),e&tn.GEOMETRYMODES)if(this.geometryEditor)this.geometryEditor.validate()?(this.geometryEditor.setMode(e),this.geometryEditor.interactionChain.setActive(!0)):this.clearGeometryEditor();else if(this.features.size){var i=this.features.values().next().value;if(this.features.size>1)return void this.selectFeatureInteraction.selectFeature(i);this.editingFeature=i,this.editingFeature[this.state.featureTypeSymbol]|=nn.EDITING,this.geometryEditor=al({parent:this,layer:this.activeLayer,geometry:this.isOblique?this.editingFeature[_n.obliqueGeometry]:this.editingFeature.getGeometry(),feature:this.editingFeature,onFinish:this._onCreationFinish.bind(this),onRemoved:this._onCreationFinish.bind(this)}),this.geometryEditor.initialize(),this.geometryEditor.setMode(e),this.interactionChain.addInteraction(this.geometryEditor.interactionChain)}}},{key:"setAltitudeMode",value:function(e){var i=this;return e&this.state.altitudeMode?Promise.resolve():Se(b(t.prototype),"setAltitudeMode",this).call(this,e).then(function(){i.geometryEditor&&i.geometryEditor.setAltitudeMode(e)})}},{key:"createFeature",value:function(e,t,i){o(e,Object.keys(rl)),l(t,[String,Number]);var n=i||rl[e](),r=new ol.Feature({geometry:n});if(r[this.state.featureTypeSymbol]=nn.EDITABLE,this.state.altitudeMode!==this.state.defaultAltitudeMode){var a=this.state.altitudeMode!==an.CLAMP&&ne.getInstance().getActiveMap()instanceof Vt?"absolute":"clampToGround";r.set("olcs_altitudeMode",a)}else this.state.defaultAltitudeMode!==an.ABSOLUTE||ne.getInstance().getActiveMap()instanceof Vt||r.set("olcs_altitudeMode","clampToGround");if(this.state.classificationType!==this.state.defaultClassificationType&&r.set("olcs_classificationType",ln[this.state.classificationType]),t&&r.setId(t),this.lastFeatureType=e,this.state.layerName){var s=ne.getInstance().getLayerByName(this.state.layerName);if(s&&s instanceof _n&&(t&&s.removeFeaturesById([t]),this.isOblique&&(n[_n.alreadyTransformedToImage]=!0),s.addFeatures([r]),this.state.dedicatedFeatureStyle||"Label"===e)){var c=s.defaultStyle instanceof gt?s.defaultStyle:vt;r[ft]=c.clone(new gt({name:r.getId().toString()})),r.setStyle(r[ft].style)}}return r}},{key:"setModeAndSelectFeature",value:function(e,t){this.getRootEditor().beforeSetMode(e),this.state.mode=e,this.selectFeatureInteraction.selectFeature(t)}},{key:"clearGeometryEditor",value:function(){if(this.editingFeature&&(this.editingFeature[this.state.featureTypeSymbol]^=nn.EDITING,this.editingFeature=null),this.geometryEditor){var e=this.geometryEditor.feature.getId();this.features.has(e)&&!this.geometryEditor.validate()&&this.selectFeatureInteraction.clearSelectionSet(!0),this.geometryEditor.stopCreation(),this.interactionChain.removeInteraction(this.geometryEditor.interactionChain),this.geometryEditor.destroy(),this.geometryEditor=null}}},{key:"onSelect",value:function(){if(this.clearGeometryEditor(),this.state.active){var e=this.state.mode;this.state.mode&tn.GEOMETRYMODES&&this.features.size>1&&this.parent?(e=tn.SELECT,this.getRootEditor().setMode(e)):e&tn.CREATE&&0===this.features.size?this._onCreationFinish():e&tn.GEOMETRYMODES&&this.getRootEditor().setMode(e)}}},{key:"_onCreationFinish",value:function(){if(this.state.mode===tn.CREATE&&this.defaultMode===tn.CREATE){var e=this.createFeature(this.lastFeatureType);this.setModeAndSelectFeature(this.state.mode,e)}else this.getRootEditor().setMode(this.defaultMode)}},{key:"convertEditingFeatureToPolygon",value:function(){if(this.editingFeature&&1===this.features.size){var e=this.isOblique?this.editingFeature[_n.obliqueGeometry]:this.editingFeature.getGeometry(),t=yi(e);this.isOblique&&(t[_n.alreadyTransformedToImage]=!0),this.editingFeature.setGeometry(t);var i=this.editingFeature;this.selectFeatureInteraction.clearSelectionSet(!0),this.selectFeatureInteraction.selectFeature(i)}}},{key:"setEditingFeatureTypeProperty",value:function(e,t){this.editingFeature&&1===this.features.size&&(this.editingFeature.set(e,t),this.selectFeatureInteraction.clearSelectionSet(!0),this.selectFeatureInteraction.selectFeature(this.editingFeature))}},{key:"handleMapChange",value:function(e){Se(b(t.prototype),"handleMapChange",this).call(this,e)}}]),t}(vs),hl=ul,dl=window.localStorage,ml=Y.getLogger("vcs.vcm.util.storage");function fl(){if(!dl)return!1;try{var e="__storage_test__";return dl.setItem(e,e),dl.removeItem(e),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==dl.length}}var yl=function(){function e(t){Object(d["a"])(this,e),this.namespace=t}return Object(m["a"])(e,[{key:"setItem",value:function(e,t){fl()?dl.setItem("".concat(this.namespace,".").concat(e),t):ml.warning("storage unavailable or full")}},{key:"getItem",value:function(e){return dl?dl.getItem("".concat(this.namespace,".").concat(e)):null}},{key:"removeItem",value:function(e){dl&&dl.removeItem("".concat(this.namespace,".").concat(e))}}]),e}(),gl=yl,vl=Y.getLogger("vcs.vcm.util.editor.StyleLayerEditor"),pl=new gl("StyleLayerEditor"),_l=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(d["a"])(this,t),e=y(this,b(t).call(this,i)),e.icons=i.icons||[],e.customIcons=[],e.allowCustomIcons=i.allowCustomIcons||!1,e.storeCustomIcons=i.storeCustomIcons||!1,e.currentStyleOptions={text:null,fill:null,stroke:null,image:null},e.currentStyleItem=vt.clone(),!i.noDefaultIcons){var n=ne.getInstance().libraryBasePath;e._fetchIcons("".concat(n,"images/editor/defaultIconsCategory.json"))}return i.iconLibraries&&i.iconLibraries.forEach(e._fetchIcons.bind(f(e))),e.allowCustomIcons&&e.storeCustomIcons&&fl()&&e._fetchCustomIcons(),e._syncOptions(vt.getOptions()),e}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.StyleLayerEditor"}}]),Object(m["a"])(t,[{key:"_fetchIcons",value:function(e){var t=this;return ce.a.get(e).then(function(i){var n=i.data,r=e.replace(/\/?[^\/]+$/,"");Array.isArray(n)?n.forEach(function(e){if("string"===typeof e){var i=/^data/.test(e)?e:"".concat(r,"/").concat(e);t.icons.push({src:i})}else e.src="".concat(r,"/").concat(e.src),t.icons.push(e)}):vl.error("could not load icon library, content of ".concat(e," is not a JSONArray"))})}},{key:"_fetchCustomIcons",value:function(){var e=this,t=pl.getItem("customIconIndex");t&&JSON.parse(t).forEach(function(t){var i=pl.getItem("".concat(t));i&&e.customIcons.push({src:i})})}},{key:"readIconFromFile",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.allowCustomIcons?new Promise(function(n,r){var a=new FileReader;a.onloadend=function(){var e=a.result;if(t.customIcons.push(Object.assign(i,{src:e})),t.storeCustomIcons&&fl()){var r=JSON.parse(pl.getItem("customIconIndex")||"[]"),s=Object(u["c"])();r.push(s),pl.setItem("customIconIndex",JSON.stringify(r)),pl.setItem("".concat(s),e)}n()},a.onerror=r,a.readAsDataURL(e)}):(vl.warning("custom icons are not supported at this time"),Promise.resolve())}},{key:"deleteCustomIcon",value:function(e){if(this.storeCustomIcons){var t=JSON.parse(pl.getItem("customIconIndex")||"[]"),i=t.filter(function(t){var i=pl.getItem(t);return i!==e||(pl.removeItem(t),!1)});pl.setItem("customIconIndex",JSON.stringify(i))}var n=this.customIcons.findIndex(function(t){return t.src===e});n>-1&&this.customIcons.splice(n,1)}},{key:"addEditingLayer",value:function(e){Se(b(t.prototype),"addEditingLayer",this).call(this,e),this.onSelect()}},{key:"setMode",value:function(){this.onSelect()}},{key:"onSelect",value:function(){if(this.activeLayer){this.state.isDeclarativeStyle=!1;var e=this.activeLayer.style;if(e instanceof Tt&&(this.state.isDeclarativeStyle=!0,e=null),!this.state.isDeclarativeStyle&&this.features.size){var t=this.features.get(this.state.selectedFeatureId);e=t[ft]||e}this.state.isLayerStyle=this.activeLayer.style===e,e?this.currentStyleItem&&this.currentStyleItem===e||(this.currentStyleItem=e,this._syncOptions(e.getOptions())):(this.currentStyleOptions.text=null,this.currentStyleOptions.fill=null,this.currentStyleOptions.stroke=null,this.currentStyleOptions.image=null,this.currentStyleItem=null)}}},{key:"setLayerStyle",value:function(e){this.activeLayer.setStyle(e||this.activeLayer.defaultStyle),this.onSelect()}},{key:"_syncOptions",value:function(e){e.fill?(this.currentStyleOptions.fill?this.currentStyleOptions.fill.color=e.fill.color:(e.fill.pattern||(e.fill.pattern=null),this.currentStyleOptions.fill=e.fill),e.fill.pattern&&this.currentStyleOptions.fill.pattern?Object.assign(this.currentStyleOptions.fill.pattern,e.fill.pattern):this.currentStyleOptions.fill.pattern={type:0,color:[0,0,0,1],width:1,size:10}):this.currentStyleOptions.fill=null,this.currentStyleOptions.stroke=e.stroke||null,e.text?(this.currentStyleOptions.text=e.text,this.currentStyleOptions.text.font=Ke(e.text.font||"18px sans-serif")):this.currentStyleOptions.text=null,e.image?(this.currentStyleOptions.image=e.image,this.currentStyleOptions.image.currentImage=e.image.radius?this.currentStyleItem.image.getImage(1).toDataURL():e.image.src):this.currentStyleOptions.image=null}},{key:"addDedicatedStyleFromCurrentStyle",value:function(){var e,t=this;!this.state.isDeclarativeStyle&&this.features.size&&(this.features.forEach(function(i){var n=t.currentStyleItem.clone(new gt({id:i.getId()}));e||(e=n),i[ft]=n,i.setStyle(i[ft].style),i.changed()}),this.currentStyleItem=e,this.state.isLayerStyle=!1)}},{key:"cloneCurrentStyleOntoLayer",value:function(){var e=this.currentStyleItem.clone();this.activeLayer.setStyle(e),this.currentStyleItem=e}},{key:"updateFont",value:function(e){this.currentStyleItem.text||(this.currentStyleItem.text=new ol.style.Text);var t=Ze(e);this.currentStyleItem.text.setFont(t),this.currentStyleOptions.text||(this.currentStyleOptions.text={}),this.currentStyleOptions.text.font?Object.assign(this.currentStyleOptions.text.font,e):this.currentStyleOptions.text.font=e}},{key:"setImage",value:function(e){var t,i=Object.assign({},e);t=i.radius?lt(i):new ol.style.Icon(i),this.currentStyleItem.image=t;var n=this.currentStyleItem.getOptions({image:!0});n.image?(this.currentStyleOptions.image=n.image,this.currentStyleOptions.image.currentImage=this.currentStyleOptions.image.src||this.currentStyleItem.image.getImage(1).toDataURL()):this.currentStyleOptions.image=null}},{key:"updateStyle",value:function(e){var t=this;this.features.size&&this.currentStyleItem&&this.features.forEach(function(e){if(!e[ft]||e[ft].name!==t.currentStyleItem.name){var i=e[ft];i?t.currentStyleItem.clone(i):e[ft]=t.currentStyleItem.clone(new gt({id:e.getId()})),e.setStyle(e[ft].style)}e.changed()}),e&&this._syncOptions(this.currentStyleItem.getOptions())}},{key:"updateStyleSection",value:function(e,t){var i=this;o(e,["fill","stroke","text","image"]),this.features.size&&this.currentStyleItem&&this.features.forEach(function(n){n[ft]||(n[ft]=i.activeLayer.style.clone(new gt({id:n.getId()})),n.setStyle(n[ft].style)),n[ft].name!==i.currentStyleItem.name&&("fill"===e?(n[ft].fillColor=i.currentStyleItem.fillColor.slice(),n[ft].pattern=i.currentStyleItem.pattern?Object.assign({},i.currentStyleItem.pattern):void 0):n[ft][e]=i.currentStyleItem[e].clone()),t||n.changed()})}}]),t}(vs),bl=_l,Ll=Y.getLogger("vcs.vcm.util.editor.CompositeLayerEditor"),Ml=function(e){function t(e){var i;if(Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.children=[],e.featureLayerEditor&&i.children.push(new vo(Object.assign(e.featureLayerEditor,{parent:f(i)}))),e.geometryLayerEditor){var n=Object.assign(e.geometryLayerEditor,{parent:f(i)});n.dedicatedFeatureStyle=!(null!=n.dedicatedFeatureStyle||!e.styleLayerEditor),i.children.push(new hl(n))}return e.styleLayerEditor&&i.children.push(new bl(Object.assign(e.styleLayerEditor,{parent:f(i)}))),i}return w(t,e),Object(m["a"])(t,[{key:"className",get:function(){return"vcs.vcm.util.editor.CompositeLayerEditor"}}]),Object(m["a"])(t,[{key:"getFeatureLayerEditor",value:function(){return this.children.find(function(e){return e instanceof vo})}},{key:"getGeometryLayerEditor",value:function(){return this.children.find(function(e){return e instanceof hl})}},{key:"getStyleLayerEditor",value:function(){return this.children.find(function(e){return e instanceof bl})}},{key:"initialize",value:function(){this.interactionChain.initialize(),this.children.forEach(function(e){e.initialize()}),this.selectFeatureInteraction.onCesiumSelect(this.onCesiumSelect.bind(this))}},{key:"activate",value:function(){this.children.forEach(function(e){e.activate()}),Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.children.forEach(function(e){e.deactivate()})}},{key:"beforeSetMode",value:function(e){Se(b(t.prototype),"beforeSetMode",this).call(this),this.children.forEach(function(t){t.beforeSetMode(e)})}},{key:"setMode",value:function(e){Ll.debug("CompositeLayerEditor ".concat(e," ").concat(Object.keys(tn).find(function(t){return tn[t]===e}))),Se(b(t.prototype),"setMode",this).call(this,e),this.children.forEach(function(t){t.setMode(e)})}},{key:"setAltitudeMode",value:function(e){var i=this,n=Promise.resolve();return this.children.forEach(function(t){n=n.then(function(){return t.setAltitudeMode(e)})}),n.then(function(){return Se(b(t.prototype),"setAltitudeMode",i).call(i,e)})}},{key:"addEditingLayer",value:function(e){Se(b(t.prototype),"addEditingLayer",this).call(this,e),this.children.forEach(function(t){t.addEditingLayer(e)})}},{key:"destroy",value:function(){Se(b(t.prototype),"destroy",this).call(this),this.children.forEach(function(e){e.destroy()})}}]),t}(vs),kl=Ml,wl="<div class='balloon' id='myBalloon'>\n  <h1 class='balloon-title'><%= obj.planningName %></h1>\n  <div class='balloon-content'>\n    <%= obj.planningDescription %>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Tl="<div class='balloon' id='myBalloon'>\n  <div class='balloon-content'>\n    <h1 class='balloon-title'> Available Attributes </h1>\n    <% for (var key in obj) { %>\n    <% if (obj[key] instanceof Object){%>\n    <% for (var key2 in obj[key]) { %>\n    <p class='balloon-text'><span class='balloon-street'> <%=key%>.<%=key2%> : <%=obj[key][key2]%></span><br></p>\n    <% } %>\n    <% } else{ %>\n    <p class='balloon-text'><span class='balloon-street'> <strong> <%=key%> </strong> : <%=obj[key]%></span><br></p>\n    <% } %>\n    <% } %>\n  </div>\n  <div class='balloon-close-col'>\n    <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>\n  </div>\n  <div class='dialog-image-balloon'></div>\n  <div class='balloon-left-edge'></div>\n</div>\n",Sl=[{title:{de:"Leerer Balloon",en:"Empty Balloon"},template:""},{title:{de:"Ebenen Name & Beschreibung",en:"Layer Name & Description"},template:wl.trim()},{title:{de:"Alle Attribute",en:"All Properties"},template:Tl.trim()}],Ol=Sl;B.PLANNINGINSTANCES_CHANGED="PLANNINGINSTANCES_CHANGED";var Cl,El,Il,Dl,jl,Pl,Yl=function(e){function t(e){var i,n;(Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.serviceUrl=e.serviceUrl||"https://planning.virtualcityplanner.de",i.scenarioId=e.scenarioId,i.projectId=e.projectId,i.useLocalCRS=Object(u["e"])(e.useLocalCRS,!1),i.showInLegend=Object(u["e"])(e.showInLegend,!0),i.legendTitle=e.legendTitle||{en:"Plannings",de:"Planungen",pl:"Planowanie"},i.loginManager=Ps.getInstance(),i.url=a["a"].parse(i.serviceUrl),i.url.extendPath("planning"),i.loginManager.registerWidget({onLogin:[i.fetchUserPlannings.bind(f(i)),i.fetchUserCreate.bind(f(i))],onLogout:[i.fetchUserPlannings.bind(f(i))],beforeLogout:[i.clear.bind(f(i)),i.setUserMayCreate.bind(f(i),{data:!1})],serviceUrl:i.serviceUrl,projectId:i.projectId,scenarioId:i.scenarioId}).then(function(){i.url=i.loginManager.url.clone(),i.url.extendPath("planning"),i.url.queryParams=i.loginManager.url.queryParams}).catch(function(e){i.logger.warning(e.message),i.logger.warning("could not initialize planning, missing login url")}),i.planningInstances=[],i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i._linkedPlannings=[],i.activePlanningInstance=null,i.userMayCreate={permission:!1},i.fetching=null,i.legendCluster=new ha({title:i.legendTitle}),i.commentIcons=i._setupCommentStyle(e.commentIcons),i.terrainUrl=e.terrainUrl||null,i.useDefaultTerrain=Object(u["e"])(e.useDefaultTerrain,!0),i.allowBalloonEditor=Object(u["e"])(e.allowBalloonEditor,!1),i.predefinedBalloons=Ol,Array.isArray(e.predefinedBalloons))&&(n=i.predefinedBalloons).push.apply(n,Object(T["a"])(e.predefinedBalloons));return i.showStyleSelector=Object(u["e"])(e.showStyleSelector,!1),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Planning"}}]),Object(m["a"])(t,[{key:"_setupCommentStyle",value:function(e){var t;if(this.framework.getStyleByName("planningCommentStyle"))return{};var i=this.framework.libraryBasePath,n=e||(t={},Object(oe["a"])(t,Fs.DEFAULT,"".concat(i,"images/editor/icon-bubble.png")),Object(oe["a"])(t,Fs.WARNING,"".concat(i,"images/editor/icon-bubble-red.png")),Object(oe["a"])(t,Fs.INFO,"".concat(i,"images/editor/icon-bubble-blue.png")),Object(oe["a"])(t,Fs.SUCCESS,"".concat(i,"images/editor/icon-bubble-green.png")),t),r={pointSize:{conditions:[["${selected}===true","1.5"],["true","1"]]}};if("string"===typeof n)r.image='"'.concat(n,'"');else{var a=Object.values(Fs),s=[];Object.entries(n).forEach(function(e){var t=Object(Ie["a"])(e,2),i=t[0],n=t[1];a.includes(i)&&i!==Fs.DEFAULT&&s.push(['${commentType} === "'.concat(i,'"'),'"'.concat(n,'"')])}),n[Fs.DEFAULT]=n[Fs.DEFAULT]||"".concat(i,"images/editor/icon-bubble.png"),s.push(["true",'"'.concat(n[Fs.DEFAULT],'"')]),r.image={conditions:s},a.forEach(function(e){n[e]||(n[e]=n[Fs.DEFAULT])})}var o=new Tt({name:"planningCommentStyle",declarativeStyle:r});return o.cesiumStyle.ready?(this.framework.addStyle(o),"string"===typeof n?{}:n):(this.logger.warning("could not setup custom comment style, using default"),this._setupCommentStyle())}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;if(this.layerEditor=new kl({geometryLayerEditor:{},featureLayerEditor:{},styleLayerEditor:{allowCustomIcons:!0}}),this.layerEditor.initialize(),this.commentsLayerEditor=new kl({geometryLayerEditor:{allowedGeometries:["Point"],defaultMode:"edit"},styleLayerEditor:{}}),this.useDefaultTerrain&&!this.terrainUrl){var i=this.framework.getLayers().find(function(e){return e.activeOnStartup&&e instanceof zt});this.terrainUrl=i?i.url:null}if(this.terrainUrl&&!/https?:/.test(this.terrainUrl)){var n=a["a"].parse(window.location.href);n.queryParams={},n.hashPath=[],/^\//.test(this.terrainUrl)?(n.path=[],this.terrainUrl="".concat(n.toString()).concat(this.terrainUrl)):this.terrainUrl="".concat(n.toString().replace(/\/$/,""),"/").concat(this.terrainUrl.replace(/^\.\//,""))}if(this.fetchUserPlannings(),this.showInLegend&&(this.legendCluster=Ea(),!this.legendCluster)){this.legendCluster=new ha({title:this.legendTitle});var r=this.framework.getWidgetByType("vcs.vcm.widgets.legend.Legend");r&&r.cluster.push(this.legendCluster)}this.initialized=!0,this.initializedFinished()}return!0}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),-1===this.supportedMaps.indexOf(e.className)?this.legendCluster.visible=!1:this.legendCluster.visible=!0,this.planningInstances.forEach(function(t){t.handleMapChange(e)})}},{key:"fetchUserCreate",value:function(){var e=this.url.clone();ce.a.post(e.extendPath("permission").toString(),{mapId:this.scenarioId}).then(this.setUserMayCreate.bind(this))}},{key:"setUserMayCreate",value:function(e){null!==e.data&&(this.userMayCreate.permission=e.data)}},{key:"fetchUserPlannings",value:function(){var e=this,t=this.url.clone();this.fetching=ce.a.post(t.extendPath("list").toString(),{mapId:this.scenarioId}).then(this.setPlannings.bind(this)).catch(function(t){e.logger.error(t)})}},{key:"setPlannings",value:function(e){var t=this;this.clear().then(function(){var i=e.data;i.forEach(t.createPlanningInstance,t),t._linkedPlannings=[],t.fetching=null,t.framework.publish(B.PLANNINGINSTANCES_CHANGED,t.planningInstances)})}},{key:"setActivePlanning",value:function(e){if(o(e,Js),this.activePlanningInstance){if(this.activePlanningInstance._id===e._id)return;this.activePlanningInstance.maintainLockInterval&&this.activePlanningInstance.unlock(),this.activePlanningInstance.unLoad()}this.activePlanningInstance=e,this.activePlanningInstance&&this.activePlanningInstance.load()}},{key:"deactivateActivePlanning",value:function(){this.activePlanningInstance&&(this.activePlanningInstance.maintainLockInterval&&this.activePlanningInstance.unlock(),this.activePlanningInstance.unLoad()),this.activePlanningInstance=null}},{key:"createPlanningInstance",value:function(e){e.url=this.url;var t=new Js(Object.assign(e,{editorId:this.layerEditor.id,commentsEditorId:this.commentsLayerEditor.id,terrainUrl:this.terrainUrl}));return this._linkedPlannings.indexOf(e._id)>-1&&e.public&&t.load(),this.planningInstances.push(t),this.legendCluster.children.push(new Ta({planningInstance:t})),this.legendCluster.visible=!0,t}},{key:"addPlanningInstance",value:function(e,t,i){var n=this;o(e,String),l(t,String),l(i,Object);var r={name:e,description:t,mapId:this.scenarioId};i&&(r.properties=i);var a=this.url.clone();return ce.a.post(a.extendPath("add").toString(),r).then(function(e){var t=e.data,i=n.createPlanningInstance(t);return n.framework.publish(B.PLANNINGINSTANCES_CHANGED,n.planningInstances),i}).catch(function(e){n.logger.warning(e.response.data)})}},{key:"deletePlanning",value:function(e){var t=this;o(e,Js);var i=this.url.clone();return ce.a.post(i.extendPath("remove").toString(),{_id:e._id}).then(function(){var i=t.planningInstances.findIndex(function(t){return t._id===e._id});t.planningInstances.splice(i,1),t.activePlanningInstance&&t.activePlanningInstance._id===e._id&&(t.activePlanningInstance=null);var n=t.legendCluster.children.findIndex(function(t){return t instanceof Ta&&t.planningInstance._id===e._id});return t.legendCluster.children.splice(n,1),e.destroy(),t.framework.publish(B.PLANNINGINSTANCES_CHANGED,t.planningInstances),e._id})}},{key:"clear",value:function(){var e=this,t=this.planningInstances.map(function(t){return t.destroy().then(function(){return Promise.resolve()}).catch(function(){return e.logger.error("could not unlock planning instance".concat(t.name)),Promise.resolve()})});return Promise.all(t).then(function(){return e.planningInstances.splice(0),e.activePlanningInstance=null,e.legendCluster.children.splice(0),e.legendCluster.visible=!1,Promise.resolve()})}},{key:"getConfigObject",value:function(){return{useLocalCRS:this.useLocalCRS}}},{key:"handleURLParameter",value:function(e){var t=this;e.plannings&&Array.isArray(e.plannings)&&this.framework.subscribeOnce("PLANNINGINSTANCES_CHANGED",function(){t.planningInstances.filter(function(t){return e.plannings.includes(t._id)}).forEach(function(e){e.load()})})}},{key:"getLink",value:function(e){var t=this.planningInstances.filter(function(e){return e.public&&e.loaded}).map(function(e){return e._id});e.queryParams.plannings&&delete e.queryParams.plannings,t.length>0&&e.addQueryParams({plannings:JSON.stringify(t)})}}]),t}(ra),xl=Yl,Al=function(){function e(t,i,n){Object(d["a"])(this,e),this.id=t,this.symbol=i,this.openlayersFilter=n}return Object(m["a"])(e,[{key:"getId",value:function(){return this.id}},{key:"getOpenlayersFilter",value:function(){return this.openlayersFilter}}]),e}(),Fl={EQUAL_TO:new Al("EQUAL_TO"," = ",ol.format.filter.EqualTo),NOT_EQUAL_TO:new Al("NOT_EQUAL_TO"," != ",ol.format.filter.NotEqualTo),LESS_THAN:new Al("LESS_THAN"," < ",ol.format.filter.LessThan),GREATER_THAN:new Al("GREATER_THAN"," > ",ol.format.filter.GreaterThan),LESS_THAN_OR_EQUAL_TO:new Al("LESS_THAN_OR_EQUAL_TO"," <= ",ol.format.filter.LessThanOrEqualTo),GREATER_THAN_OR_EQUAL_TO:new Al("GREATER_THAN_OR_EQUAL_TO"," >= ",ol.format.filter.GreaterThanOrEqualTo),LIKE:new Al("LIKE","like",ol.format.filter.IsLike),BETWEEN:new Al("BETWEEN","between",ol.format.filter.IsBetween),BBOX:new Al("BBOX","bbox",ol.format.filter.Bbox),INTERSECTS:new Al("INTERSECTS","intersects",ol.format.filter.Intersects),DWITHIN:new Al("DWITHIN","distance within",ol.format.filter.DWithin),WITHIN:new Al("WITHIN","within",ol.format.filter.Within),AND:new Al("AND","and",ol.format.filter.and),OR:new Al("OR","or",ol.format.filter.or)},Nl=Al,Hl={GEOMETRY:0,ATTRIBUTE:1,GENERICATTRIBUTE:2,GENERICDATEATTRIBUTE:3,DATEATTRIBUTE:4,DATEYEARATTRIBUTE:5,FILTER:6},Rl=function(){function e(t,i,n,r,a,s){Object(d["a"])(this,e),this.id=t,this.type=n,this.allowedComparisons=[],this.prefix=s,this.valueReference=r||"".concat(s,":").concat(this.id);for(var o=0;o<a.length;o++){var l=a[o];i.hasOwnProperty(l)&&this.allowedComparisons.push(i[l])}}return Object(m["a"])(e,[{key:"getPrefix",value:function(){return this.prefix}},{key:"getId",value:function(){return this.id}},{key:"getType",value:function(){return this.type}},{key:"getAllowedComparisons",value:function(){return this.allowedComparisons}},{key:"getValueReference",value:function(){return this.valueReference}}]),e}(),zl={Filter:(Cl={},Object(oe["a"])(Cl,Fl.AND.id,Fl.AND),Object(oe["a"])(Cl,Fl.OR.id,Fl.OR),Cl),Geometry:(El={},Object(oe["a"])(El,Fl.BBOX.id,Fl.BBOX),Object(oe["a"])(El,Fl.INTERSECTS.id,Fl.INTERSECTS),Object(oe["a"])(El,Fl.DWITHIN.id,Fl.DWITHIN),Object(oe["a"])(El,Fl.WITHIN.id,Fl.WITHIN),El),StringAttribute:(Il={},Object(oe["a"])(Il,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Il,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(Il,Fl.LIKE.id,Fl.LIKE),Il),BooleanAttribute:(Dl={},Object(oe["a"])(Dl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Dl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Dl),DateAttribute:(jl={},Object(oe["a"])(jl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(jl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(jl,Fl.LESS_THAN.id,Fl.LESS_THAN),Object(oe["a"])(jl,Fl.GREATER_THAN.id,Fl.GREATER_THAN),Object(oe["a"])(jl,Fl.LESS_THAN_OR_EQUAL_TO.id,Fl.LESS_THAN_OR_EQUAL_TO),Object(oe["a"])(jl,Fl.GREATER_THAN_OR_EQUAL_TO.id,Fl.GREATER_THAN_OR_EQUAL_TO),Object(oe["a"])(jl,Fl.BETWEEN.id,Fl.BETWEEN),jl),NumberAttribute:(Pl={},Object(oe["a"])(Pl,Fl.EQUAL_TO.id,Fl.EQUAL_TO),Object(oe["a"])(Pl,Fl.NOT_EQUAL_TO.id,Fl.NOT_EQUAL_TO),Object(oe["a"])(Pl,Fl.LESS_THAN.id,Fl.LESS_THAN),Object(oe["a"])(Pl,Fl.GREATER_THAN.id,Fl.GREATER_THAN),Object(oe["a"])(Pl,Fl.LESS_THAN_OR_EQUAL_TO.id,Fl.LESS_THAN_OR_EQUAL_TO),Object(oe["a"])(Pl,Fl.GREATER_THAN_OR_EQUAL_TO.id,Fl.GREATER_THAN_OR_EQUAL_TO),Object(oe["a"])(Pl,Fl.BETWEEN.id,Fl.BETWEEN),Pl)},Gl=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"boundedBy",zl.Geometry,Hl.GEOMETRY,"gml:boundedBy",e,"gml"))}return w(t,e),t}(Rl),Vl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"id",zl.StringAttribute,Hl.ATTRIBUTE,"@gml:id",e,"gml"))}return w(t,e),t}(Rl),Bl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"name",zl.StringAttribute,Hl.ATTRIBUTE,"gml:name",e,"gml"))}return w(t,e),t}(Rl),Ul=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"description",zl.StringAttribute,Hl.ATTRIBUTE,"gml:description",e,"gml"))}return w(t,e),t}(Rl),Wl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"lineage",zl.StringAttribute,Hl.ATTRIBUTE,"citydb:lineage",e,"citydb"))}return w(t,e),t}(Rl),ql=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"updatingPerson",zl.StringAttribute,Hl.ATTRIBUTE,"citydb:updatingPerson",e,"citydb"))}return w(t,e),t}(Rl),Jl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"lastModificationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"citydb:lastModificationDate",e,"citydb"))}return w(t,e),t}(Rl),Kl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"reasonForUpdate",zl.DateAttribute,Hl.DATEATTRIBUTE,"citydb:lastModificationDate",e,"citydb"))}return w(t,e),t}(Rl),Zl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"creationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"core:creationDate",e,"core"))}return w(t,e),t}(Rl),Ql=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"terminationDate",zl.DateAttribute,Hl.DATEATTRIBUTE,"core:terminationDate",e,"core"))}return w(t,e),t}(Rl),Xl=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"relativeToTerrain",zl.StringAttribute,Hl.ATTRIBUTE,"core:relativeToTerrain",e,"core"))}return w(t,e),t}(Rl),$l=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"relativeToWater",zl.StringAttribute,Hl.ATTRIBUTE,"core:relativeToWater",e,"core"))}return w(t,e),t}(Rl),ec=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceInformationSystem",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:informationSystem",e,"core"))}return w(t,e),t}(Rl),tc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceName",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:externalObject/core:name",e,"core"))}return w(t,e),t}(Rl),ic=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"externalReferenceUri",zl.StringAttribute,Hl.ATTRIBUTE,"core:externalReference/core:externalObject/core:uri",e,"core"))}return w(t,e),t}(Rl),nc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"stringAttribute",zl.StringAttribute,Hl.GENERICATTRIBUTE,'gen:stringAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),rc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"doubleAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:doubleAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),ac=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"intAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:intAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),sc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"uriAttribute",zl.StringAttribute,Hl.GENERICATTRIBUTE,'gen:uriAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),oc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"dateAttribute",zl.DateAttribute,Hl.GENERICDATEATTRIBUTE,'gen:dateAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),lc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"measureAttribute",zl.NumberAttribute,Hl.GENERICATTRIBUTE,'gen:measureAttribute[@gen:name="token"]/gen:value',e,"gen"))}return w(t,e),t}(Rl),cc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"class",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),uc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"function",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),hc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"usage",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),dc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"yearOfConstruction",zl.DateAttribute,Hl.DATEYEARATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),mc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"yearOfDemolition",zl.DateAttribute,Hl.DATEYEARATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),fc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"roofType",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),yc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"measuredHeight",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),gc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeysAboveGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),vc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeysBelowGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),pc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeyHeightsAboveGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),_c=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"storeyHeightsBelowGround",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),bc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"street",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:street",e,"citydb"))}return w(t,e),t}(Rl),Lc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"houseNumber",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:houseNumber",e,"citydb"))}return w(t,e),t}(Rl),Mc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"poBox",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:poBox",e,"citydb"))}return w(t,e),t}(Rl),kc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"zipCode",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:zipCode",e,"citydb"))}return w(t,e),t}(Rl),wc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"city",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:city",e,"citydb"))}return w(t,e),t}(Rl),Tc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"state",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:state",e,"citydb"))}return w(t,e),t}(Rl),Sc=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,"country",zl.StringAttribute,Hl.ATTRIBUTE,"bldg:Building/bldg:address/core:Address/citydb:country",e,"citydb"))}return w(t,e),t}(Rl),Oc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"isMovable",zl.BooleanAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Cc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"species",zl.StringAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Ec=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"height",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Ic=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"trunkDiameter",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Dc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"crownDiameter",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),jc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"averageHeight",zl.NumberAttribute,Hl.ATTRIBUTE,null,e,i))}return w(t,e),t}(Rl),Pc=Rl,Yc={gml:"http://www.opengis.net/gml",core:"http://www.opengis.net/citygml/2.0",citydb:"http://www.3dcitydb.org/citygml-ade/3.0",tran:"http://www.opengis.net/citygml/transportation/2.0",wtr:"http://www.opengis.net/citygml/waterbody/2.0",grp:"http://www.opengis.net/citygml/cityobjectgroup/2.0",luse:"http://www.opengis.net/citygml/landuse/2.0",frn:"http://www.opengis.net/citygml/cityfurniture/2.0",app:"http://www.opengis.net/citygml/appearance/2.0",tex:"http://www.opengis.net/citygml/texturedsurface/2.0",bldg:"http://www.opengis.net/citygml/building/2.0",xal:"urn:oasis:names:tc:ciq:xsdschema:xAL:2.0",dem:"http://www.opengis.net/citygml/relief/2.0",veg:"http://www.opengis.net/citygml/vegetation/2.0",gen:"http://www.opengis.net/citygml/generics/2.0",brid:"http://www.opengis.net/citygml/bridge/2.0",tun:"http://www.opengis.net/citygml/tunnel/2.0"},xc=["_CityObject","Building","CityFurniture","GenericCityObject","SolitaryVegetationObject","Bridge","Tunnel","CityObjectGroup","LandUse","TransportationComplex","Railway","Road","Square","Track","PlantCover","WaterBody"],Ac=["id","name","creationDate","terminationDate","relativeToTerrain","relativeToWater","externalReferenceInformationSystem","externalReferenceName","externalReferenceUri","stringAttribute","doubleAttribute","intAttribute","uriAttribute","dateAttribute","measureAttribute","class","function","usage","yearOfConstruction","yearOfDemolition","roofType","measuredHeight","storeysAboveGround","storeysBelowGround","storeyHeightsAboveGround","storeyHeightsBelowGround","street","houseNumber","poBox","zipCode","city","state","country","isMovable","species","height","trunkDiameter","crownDiameter","averageHeight","lineage","updatingPerson","lastModificationDate","reasonForUpdate"],Fc=["id","name","relativeToTerrain","relativeToWater","externalReferenceInformationSystem","externalReferenceName","externalReferenceUri","class","function","usage","roofType","measuredHeight","storeysAboveGround","storeysBelowGround","storeyHeightsAboveGround","storeyHeightsBelowGround","street","houseNumber","poBox","zipCode","city","state","country","isMovable","species","height","trunkDiameter","crownDiameter","averageHeight","lineage","updatingPerson"],Nc=["stringAttribute","doubleAttribute","intAttribute","uriAttribute","measureAttribute"],Hc=["creationDate","terminationDate","lastModificationDate","reasonForUpdate"],Rc=["yearOfConstruction","yearOfDemolition"],zc=["genericDateAttribute"],Gc=function(){function e(t,i,n,r,a){Object(d["a"])(this,e),this.featureType=t,this.featureNs=Yc[i],this.featurePrefix=i,this.allowedProperties=[];for(var s=0;s<r.length;s++){var o=r[s];if(n.hasOwnProperty(o)){var l=new n[o](a,i);this.allowedProperties.push(l)}}}return Object(m["a"])(e,[{key:"getFeatureType",value:function(){return this.featureType}},{key:"getFeatureNs",value:function(){return this.featureNs}},{key:"getFeaturePrefix",value:function(){return this.featurePrefix}},{key:"getAllowedProperties",value:function(){return this.allowedProperties}}]),e}(),Vc={boundedBy:Gl,id:Vl,name:Bl,description:Ul,lineage:Wl,updatingPerson:ql,lastModificationDate:Jl,reasonForUpdate:Kl,creationDate:Zl,terminationDate:Ql,relativeToTerrain:Xl,relativeToWater:$l,externalReferenceInformationSystem:ec,externalReferenceName:tc,externalReferenceUri:ic,stringAttribute:nc,doubleAttribute:rc,intAttribute:ac,uriAttribute:sc,dateAttribute:oc,measureAttribute:lc},Bc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"_CityObject","core",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){return Object.assign({},Vc)}}]),t}(Gc),Uc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"GenericCityObject","gen",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Wc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Building","bldg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc,roofType:fc,measuredHeight:yc,storeysAboveGround:gc,storeysBelowGround:vc,storeyHeightsAboveGround:pc,storeyHeightsBelowGround:_c,street:bc,houseNumber:Lc,poBox:Mc,zipCode:kc,city:wc,state:Tc,country:Sc})}}]),t}(Gc),qc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Bridge","brid",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc,isMovable:Oc})}}]),t}(Gc),Jc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Tunnel","tun",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,yearOfConstruction:dc,yearOfDemolition:mc})}}]),t}(Gc),Kc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"CityFurniture","frn",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Zc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"CityObjectGroup","grp",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Qc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"LandUse","luse",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),Xc=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"TransportationComplex","tran",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc),$c=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Railway","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),eu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Road","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),tu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Square","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),iu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"Track","tran",Xc.properties,e,i))}return w(t,e),t}(Gc),nu=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"SolitaryVegetationObject","veg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,species:Cc,height:Ec,trunkDiameter:Ic,crownDiameter:Dc})}}]),t}(Gc),ru=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"PlantCover","veg",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc,averageHeight:jc})}}]),t}(Gc),au=function(e){function t(e,i){return Object(d["a"])(this,t),y(this,b(t).call(this,"WaterBody","wtr",t.properties,e,i))}return w(t,e),Object(m["a"])(t,null,[{key:"properties",get:function(){var e=Object.assign({},Vc);return Object.assign(e,{class:cc,function:uc,usage:hc})}}]),t}(Gc);function su(e,t,i){var n={_CityObject:Bc,GenericCityObject:Uc,Building:Wc,Bridge:qc,Tunnel:Jc,CityFurniture:Kc,CityObjectGroup:Zc,LandUse:Qc,TransportationComplex:Xc,Railway:$c,Road:eu,Track:iu,Square:tu,SolitaryVegetationObject:nu,PlantCover:ru,WaterBody:au};return e.map(function(e){return new n[e](t,i)})}var ou=function(){function e(t){Object(d["a"])(this,e),this.type=t.type,this.id=t.id,this.comparison=t.comparison||null,this.fixedComparison=t.comparison&&t.isPreset,this.property=t.property||null,this.isPreset=t.isPreset||!1}return Object(m["a"])(e,[{key:"getFilter",value:function(){var e=this;o(this.comparison,Nl),o(this.property,Pc);var t=this.property.getAllowedComparisons().findIndex(function(t){return t.getId()===e.comparison.getId()});if(-1===t)throw new Error("Comparison ".concat(this.comparison.getId()," not allowed for ").concat(this.property.getId()));return null}},{key:"destroy",value:function(){}}]),e}(),lu=ou,cu=new Pc("filter",zl.Filter,Hl.FILTER,null,Object.keys(zl.Filter),""),uu=function(e){function t(e){var i;Object(d["a"])(this,t),e.type="combination",e.property=cu,e.comparison=cu.getAllowedComparisons()[0],i=y(this,b(t).call(this,e)),i.filters=e.filters||[],i.level=e.level||0;var n=!e.isPreset&&"all";return i.allowAdditional=e.allowAdditional||n,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.comparison.getOpenlayersFilter();if(0===this.filters.length)throw new Error("Cannot process empty filter");if(1===this.filters.length)return this.filters[0].getFilter();var i=this.filters.map(function(e){return e.getFilter()});return e.apply(void 0,Object(T["a"])(i))}},{key:"removeChild",value:function(e){var t=this.filters.findIndex(function(t){return t.id===e.id});this.filters.splice(t,1)}},{key:"hasChild",value:function(e){return this.filters.some(function(t){return t&&t.id===e.id})}}]),t}(lu),hu=uu;function du(e){var t=R.mercatorToWgs84(e,!0);return[t[1],t[0]]}function mu(e){var t=e.clone();if(t instanceof ol.geom.Polygon){var i=t.getCoordinates().map(function(e){return e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push(e[0].slice()),e.map(du)});t.setCoordinates(i,"XY")}else if(t instanceof ol.geom.Point){var n=t.getCoordinates();t.setCoordinates(du(n),"XY")}else if(t instanceof ol.geom.LineString){var r=t.getCoordinates().map(du);t.setCoordinates(r,"XY")}return t}var fu=function(e){function t(e){var i;Object(d["a"])(this,t),e.type="geometry";var n=e.allowedComparisons||Object.keys(zl.Geometry).map(function(e){return zl.Geometry[e].getId()});return e.property=new Pc("geometry",zl.Geometry,Hl.GEOMETRY,"gml:boundedBy",n,"gml"),i=y(this,b(t).call(this,e)),i.distance=null,i.editorId=e.editorId,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.comparison.getOpenlayersFilter(),i=ne.getInstance().getLayerByName("_queryWidgetGeometryFilterLayer"),n=i.getFeatureById(this.id);if(!n)throw new Error("cannot find drawing for filter");var r=n.getGeometry();if(!r)throw new Error("cannot find drawing for filter");var a=r.clone(),s=a.getCoordinates();ui(a,s).forEach(function(e){var t=e.slice();e[1]=t[0],e[0]=t[1]}),a.setCoordinates(s);var o=mu(r);if(!e)throw new Error("Comparison is not defined");if("DWITHIN"===this.comparison.getId()){if(!this.distance)throw new Error("DWITHIN filter requires a distance");return new e(this.property.getValueReference(),o,this.distance,"m","urn:ogc:def:crs:EPSG::4326")}return"BBOX"===this.comparison.getId()?new e(this.property.getValueReference(),r.getExtent(),"urn:ogc:def:crs:EPSG::4326"):new e(this.property.getValueReference(),o,"urn:ogc:def:crs:EPSG::4326")}},{key:"destroy",value:function(){var e=ne.getInstance().getLayerByName("_queryWidgetGeometryFilterLayer");e.removeFeaturesById([this.id])}}]),t}(lu),yu=fu,gu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type="property",i=y(this,b(t).call(this,e)),i.value=e.value||null,i.fixedValue=e.value&&e.isPreset,i.genericAttributeName=e.genericAttributeName||null,i}return w(t,e),Object(m["a"])(t,[{key:"getFilter",value:function(){Se(b(t.prototype),"getFilter",this).call(this);var e=this.property.getValueReference();this.genericAttributeName&&(e=e.replace("token",this.genericAttributeName));var i=this.comparison.getOpenlayersFilter();return"BETWEEN"===this.comparison.id?(o(this.value,Array),this.value.sort(),this.value[0]instanceof Date?new i(e,this.value[0].toISOString(),this.value[1].toISOString()):new i(e,this.value[0],this.value[1])):this.value instanceof Date?new i(e,this.value.toISOString()):new i(e,this.value)}}]),t}(lu),vu=gu,pu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.url=e.url,i.projection=new R(e.projection),i.maxFeatures=e.maxFeatures||1e4,i.runningRequest=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.wfs.WFSObject"}}]),Object(m["a"])(t,[{key:"getFeatures",value:function(e,t){if(!this.url||""===this.url)return Promise.reject();this.cancelRequest();var i=(new ol.format.WFS2).writeGetFeature({featureNS:e.getFeatureNs(),featurePrefix:e.getFeaturePrefix(),featureTypes:[e.getFeatureType()],propertyNames:["gml:boundedBy"],filter:t,outputFormat:"application/gml+xml; version=3.1",count:this.maxFeatures,allNs:Yc});function n(e){var t;return t=window.ActiveXObject?e.xml:(new XMLSerializer).serializeToString(e),t}var r=n(i);return r=r.replace(/__--__/g,":"),this.runningRequest=ce.a.CancelToken.source(),ce.a.post(this.url,r,{cancelToken:this.runningRequest.token}).then(this.handleResponse.bind(this)).catch(function(e){var t=e.response;return t&&t.data?Promise.reject(new Error(t.data)):Promise.reject(e)})}},{key:"handleResponse",value:function(e){var t=e.data,i=this.framework.getProjection().getProjection();return(new ol.format.WFS2).readFeatures(t,{dataProjection:i})}},{key:"cancelRequest",value:function(){this.runningRequest&&this.runningRequest.cancel(),this.runningRequest=null}}]),t}(A),_u=["EQUAL_TO","NOT_EQUAL_TO","LESS_THAN","GREATER_THAN","LESS_THAN_OR_EQUAL_TO","GREATER_THAN_OR_EQUAL_TO","LIKE"],bu=["BETWEEN"],Lu=["EQUAL_TO","NOT_EQUAL_TO","LESS_THAN","GREATER_THAN","LESS_THAN_OR_EQUAL_TO","GREATER_THAN_OR_EQUAL_TO","LIKE","BETWEEN"],Mu=["INTERSECTS","WITHIN","DWITHIN"],ku=pu,wu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.allFeatureTypes=e.allFeatureTypes||xc,i.allProperties=e.allProperties||Ac,i.allLogicalRelations=e.allLogicalRelations||Lu,i.allSpatialFilters=e.allSpatialFilters||Mu,i.freeQueriesOption="false"!==String(e.freeQueries).toLowerCase(),i.predefinedQueries=e.predefinedQueries||[],i.featureTypes=su(i.allFeatureTypes,i.allProperties,i.allLogicalRelations),i.wfs=new ku(e.wfs?e.wfs:{}),i._filters=[],i._defaultMaxLevel=Object(u["h"])(e.maximumLevel,1),i.maximumLevel=i._defaultMaxLevel,i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.activeQuery={type:null,featureType:null,filter:null,runningRequest:null},i.foundFeatures=[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Query"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.geometryFilterLayer=new _n({name:"_queryWidgetGeometryFilterLayer",projection:R.createMercatorProjection(),altitudeMode:"clampToGround"}),this.framework.addLayer(this.geometryFilterLayer),this.geometryLayerEditor=new hl({allowedGeometries:["Point","LineString","BBox","Polygon"],defaultMode:"edit"}),this.geometryLayerEditor.initialize(),this.geometryLayerEditor.addEditingLayer(this.geometryFilterLayer),this.initialized=!0,this.initializedFinished()}return!0}},{key:"getAllowedProperties",value:function(e){o(e,String);var t=this.featureTypes.find(function(t){return t.getFeatureType()===e});return t?t.getAllowedProperties():[]}},{key:"setPreset",value:function(e){if(o(e,[Object,String]),this.activeQuery.filter&&this.removeFilter(this.activeQuery.filter),this.activeQuery.filter=null,this.activeQuery.featureType=null,this.maximumLevel=this._defaultMaxLevel,"_free"!==e){e=e,this.activeQuery.type=e.name;var t=JSON.parse(JSON.stringify(e));if(this.activeQuery.featureType=t.featureType,t.property){var i=this.getAllowedProperties(this.activeQuery.featureType).find(function(e){return e.getId()===t.property}),n=null;t.valueInput?n=t.valueInput:t.dateInput?n=new Date(t.dateInput.year,t.dateInput.month,t.dateInput.date):t.dateInputLower&&(n=[new Date(t.dateInputLower.year,t.dateInputLower.month,t.dateInputLower.date),new Date(t.dateInputUpper.year,t.dateInputUpper.month,t.dateInputUpper.date)]);var r=null;if(t.comparison){var a=Object.keys(Fl).find(function(e){return Fl[e].id===t.comparison});r=Fl[a]}t.allowAdditional||(this.maximumLevel=0),Number.isFinite(t.maximumLevel)&&(this.maximumLevel=t.maximumLevel),this.addFilter({type:"property",property:i,comparison:r,value:n,isPreset:!0,genericAttributeName:t.genericAttributeName,allowAdditional:t.allowAdditional})}}else this.activeQuery.type="_free"}},{key:"_createFilter",value:function(e){var t;return e.id=Object(u["c"])(),t="geometry"===e.type?new yu(Object.assign(e,{allowedComparisons:this.allSpatialFilters,editorId:this.geometryLayerEditor.id})):"property"===e.type?new vu(e):new hu(e),this._filters.push(t),t}},{key:"addFilter",value:function(e){if(o(e,{type:["geometry","property","combination"]}),this.activeQuery.filter)return this.addFilterToCombination(this.activeQuery.filter,e);"combination"===e.type&&(e.level=1);var t=this._createFilter(e);return this.activeQuery.filter=this._createFilter({type:"combination",filters:[t],isPreset:e.isPreset,allowAdditional:e.allowAdditional}),t.id}},{key:"removeFilter",value:function(e){var t=this;o(e,lu);var i=this._filters.find(function(t){return t instanceof hu&&t.hasChild(e)});if(!i)return this.activeQuery.filter=null,this._filters.forEach(function(e){e.destroy()}),void this._filters.splice(0);e instanceof hu&&e.filters.forEach(function(e){t.removeFilter(e)}),i.removeChild(e),0===i.filters.length&&this.removeFilter(i);var n=this._filters.findIndex(function(t){return t.id===e.id});e.destroy(),this._filters.splice(n,1)}},{key:"addFilterToCombination",value:function(e,t){if(o(t,{type:["geometry","property","combination"]}),o(e,hu),"combination"===t.type){if(e.level===this.maximumLevel)throw new Error("Maximum complexity reached, cannot add another level of depth");t.level=e.level+1}var i=this._createFilter(t);return e.filters.push(i),i.id}},{key:"sendRequest",value:function(){var e=this;this.foundFeatures.splice(0);var t=this.featureTypes.find(function(t){return t.featureType===e.activeQuery.featureType}),i=this.activeQuery.filter.getFilter();if(!t||!i)throw new Error("Could not find active featureType");return this.wfs.getFeatures(t,i).then(this._handleResult.bind(this))}},{key:"cancelRequest",value:function(){this.wfs.cancelRequest()}},{key:"_handleResult",value:function(e){var t=this;e.forEach(function(e){t.foundFeatures.push(e)})}},{key:"addToSelectionSet",value:function(e){l(e,Boolean);var t=this.framework.getSelectBehavior();e&&t.clearSelectionSet();var i=this.foundFeatures.map(function(e){return e.id});t.addToSelectionSet(i)}},{key:"zoomToFeatures",value:function(){if(this.foundFeatures.length>0){var e=ol.extent.createEmpty();this.foundFeatures.forEach(function(t){t.children&&t.children.forEach(function(t){"_3"===t.type&&(e=ol.extent.extend(e,t.attributes.extent))})});var t=ol.proj.getTransform(this.framework.getProjection().getProjection(),ol.proj.get("EPSG:4326"));e=ol.extent.applyTransform(e,t);var i=V.createViewPointFromExtent(e);this.framework.getActiveMap().gotoViewPoint(i)}}},{key:"zoomToFeature",value:function(e){var t=ol.extent.createEmpty();e.children&&e.children.forEach(function(e){"_3"===e.type&&(t=ol.extent.extend(t,e.attributes.extent))});var i=ol.proj.getTransform(this.framework.getProjection().getProjection(),ol.proj.get("EPSG:4326"));t=ol.extent.applyTransform(t,i);var n=V.createViewPointFromExtent(t);this.framework.getActiveMap().gotoViewPoint(n)}},{key:"clear",value:function(){var e=this.framework.getSelectBehavior();e.clearSelectionSet(),this.foundFeatures.splice(0)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.allFeatureTypes=this.allFeatureTypes,e.allProperties=this.allProperties,e.allLogicalRelations=this.allLogicalRelations,e.allSpatialFilters=this.allSpatialFilters,e.freeQueries=this.freeQueriesOption,e.predefinedQueries=this.predefinedQueries,e.maximumLevel=this.maximumLevel,e.wfs={maxFeatures:this.wfs.maxFeatures},e}}]),t}(ra),Tu=wu,Su=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.middleware=e.middleware||[],i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){}},{key:"search",value:function(e,t,i){}}]),t}(A),Ou=Su,Cu=Y.getLogger("vcs.vcm.widgets.search.Nominatim"),Eu=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e));var n=e.url||"https://nominatim.openstreetmap.org/search";return i.url=a["a"].parse(n),i.city=e.city||null,i.state=e.state||null,i.countrycode=e.countrycode||"de",i.extent=e.extent?new Ae(e.extent):null,i.limit=e.limit||20,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Nominatim"}}]),Object(m["a"])(t,[{key:"search",value:function(e,i,n){var r=this.url.clone(),a={q:e,countrycodes:this.countrycode,format:"json",polygon_geojson:1,addressdetails:1,limit:this.limit};this.city&&(a.q+=",".concat(this.city)),this.state&&(a.q+=",".concat(this.state)),this.extent&&(a.viewbox=this.extent.getCoordinatesInProjection(R.createGeographicProjection()).join(","),a.bounded=1),r.addQueryParams(a),ce.a.get(r.toString()).then(function(e){var i=t.handleSearchResults(e);n(i)}).catch(function(){Cu.error("got an error from the server"),n([])})}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return Object.assign({},e,{url:this.url.toString(),city:this.city,state:this.state,countrycode:this.countrycode,extent:this.extent?this.extent.getConfigObject():null,limit:this.limit})}}],[{key:"handleSearchResults",value:function(e){var t=e.data;return t.map(function(e){return e.point=[Number(e.lon),Number(e.lat)],e.geojson?e.type="geojson":e.type="point",e})}}]),t}(Ou),Iu=Eu,Du=(i(340),i(649)),ju=i.n(Du);function Pu(e,t,i,n,r,a,s){try{var o=e[a](s),l=o.value}catch(c){return void i(c)}o.done?t(l):ju.a.resolve(l).then(n,r)}function Yu(e){return function(){var t=this,i=arguments;return new ju.a(function(n,r){var a=e.apply(t,i);function s(e){Pu(a,n,r,s,o,"next",e)}function o(e){Pu(a,n,r,s,o,"throw",e)}s(void 0)})}}var xu,Au,Fu,Nu,Hu,Ru,zu=new gt({fill:{color:[85,110,255,.4]},stroke:{color:[0,0,0,1],width:1.25},image:{fill:{color:[255,255,255,1]},stroke:{color:[0,0,0,1],width:1},radius:5}}),Gu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.vectorLayer=new _n({name:"_locatorVector",altitudeMode:"clampToGround",classificationType:e.classificationType||"both",allowPicking:!1,heightAboveGround:2,projection:{epsg:"EPSG:4326"},style:e.style?zu.assign(new gt(e.style)):zu}),i.tracker=null,i.flatError=0,i.zoomDistance=e.zoomDistance?e.zoomDistance:1e3,i.locatorExtrusion=!1!==e.extrusion&&Object(u["h"])(e.extrusion,80),i.values={locatorVisibility:!1},i._pickingTerrain=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Locator"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;var n=t.testForApi();if(!n)return this.logger.warning("Locator Widget is not supported"),!1;this.framework.addLayer(this.vectorLayer),this.locatorPoint=new ol.Feature({geometry:new ol.geom.Point([0,0,0],"XYZ"),heading:!1}),this.locatorExtrusion&&this.locatorPoint.set("olcs_extrudedHeight",this.locatorExtrusion),this.errorCircle=new ol.Feature({geometry:new ol.geom.Circle([0,0],5e3)}),this.vectorLayer.addFeatures([this.locatorPoint,this.errorCircle]),this.framework.subscribe("MAP_ACTIVATED",function(t){"vcs.vcm.maps.Cesium"===t.className&&e.tracker&&e._placeLocatorOnTerrain()}),this.initialized=!0,this.initializedFinished()}return!0}},{key:"locatorClicked",value:function(){if(null===this.tracker)this.tracker=navigator.geolocation.watchPosition(this.trackLocator.bind(this),this.handleError.bind(this));else if(this.locatorInsideView())this.toggleVisibility(),navigator.geolocation.clearWatch(this.tracker),this.tracker=null;else{var e=this.locatorPoint.getGeometry().getCoordinates(),t=R.mercatorToWgs84(e);this.goToLocator(null,{coords:{longitude:t[0],latitude:t[1]}})}}},{key:"toggleVisibility",value:function(){this.values.locatorVisibility=!this.values.locatorVisibility,this.values.locatorVisibility?this.vectorLayer.activate(!0):this.vectorLayer.activate(!1)}},{key:"goToLocator",value:function(e,t){var i=this.framework.getActiveMap().getViewPoint();i.setAnimate(!0),i.setCameraPosition(null),i.setGroundPosition([t.coords.longitude,t.coords.latitude]),null!=e&&i.setDistance(e),this.framework.getActiveMap().gotoViewPoint(i,1,0)}},{key:"trackLocator",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t){var i,n,r,a,s,o=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!this._pickingTerrain){e.next=2;break}return e.abrupt("return");case 2:if(i=function(e){var t=ol.geom.Polygon.circular(new ol.Sphere(6378137),e,o.flatError,128);t.applyTransform(function(e,t,i){for(var n=e.length,r=0;r<n;r+=i){var a=[e[r],e[r+1]];R.wgs84ToMercator(a,!0),t[r]=a[0],t[r+1]=a[1]}return t}),o.errorCircle.setGeometry(t)},n=[t.coords.longitude,t.coords.latitude],r=t.coords.heading,null!=r?this.locatorPoint.set("heading",r):this.locatorPoint.set("heading",!1),a=this.locatorPoint.getGeometry().getCoordinates(),s=R.mercatorToWgs84(a),0===Math.abs(s[0]-n[0])&&0===Math.abs(s[1]-n[1])){e.next=16;break}return this.locatorPoint.getGeometry().setCoordinates(R.wgs84ToMercator(n)),e.next=12,this._placeLocatorOnTerrain();case 12:this.flatError=t.coords.accuracy,i(n),e.next=17;break;case 16:0!==Math.abs(this.flatError-t.coords.accuracy)&&(this.flatError=t.coords.accuracy,i(n));case 17:this.values.locatorVisibility||(this.goToLocator(this.zoomDistance,t),this.toggleVisibility());case 18:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"_placeLocatorOnTerrain",value:function(){var e=Yu(regeneratorRuntime.mark(function e(){var t,i;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=this.framework.getActiveMap(),"vcs.vcm.maps.Cesium"!==t.className){e.next=8;break}return i=this.locatorPoint.getGeometry().getCoordinates(),this._pickingTerrain=!0,e.next=6,t.getHeightFromTerrain([i]);case 6:this.locatorPoint.getGeometry().setCoordinates(i),this._pickingTerrain=!1;case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"locatorInsideView",value:function(){var e=this.locatorPoint.getGeometry().getCoordinates(),t=R.mercatorToWgs84(e);return this.framework.getActiveMap().pointIsVisible(t)}},{key:"handleError",value:function(e){switch(this.values.locatorVisibility&&this.toggleVisibility(),e.code){case 1:alert("Der Zugriff auf Ihre Position wurde verweigert.");break;case 2:alert("Ihre momentane Position konnte leider nicht erfasst werden.");break;case 3:alert("Wärend dem ermitteln Ihrer Position wurde die Verbindung verloren");break;default:alert("Ihre Position kann leider nicht erfasst werden");break}this.logger.warning("Geolocation could not be verified")}},{key:"setStyle",value:function(e){this.logger.deprecate("setStyle","use the config or set the style via the .vectorLayer property"),this.vectorLayer.setStyle(e);for(var t,i=this.vectorLayer.getFeatures(),n=0;n<i.length;n++)t=i[n],t.setStyle(e)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.zoomDistance=this.zoomDistance,e.style=this.vectorLayer.style.getOptions({fill:!0,stroke:!0,image:!0}),e.locatorExtrusion=this.locatorExtrusion,e.classificationType=this.vectorLayer.classificationType,e}},{key:"isVisible",value:function(){return this.logger.deprecate("isVisible","access values.locatorVisibility directly"),this.values.locatorVisibility}},{key:"getValuesObject",value:function(){return this.logger.deprecate("isVisible","access values directly"),this.values}}],[{key:"getLocation",value:function(){return new Promise(function(e,t){navigator.geolocation.getCurrentPosition(e,t)})}},{key:"testForApi",value:function(){var e=location,t=e.hostname,i=e.protocol,n=!!navigator.geolocation&&!ne.getInstance().isIE11;return"localhost"===t||"127.0.0.1"===t?n:"https:"===i&&n}}]),t}(ra),Vu=Gu,Bu=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.sortByType=e.sortByType||!1,i.location={},i.resultSize=e.resultSize,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Elasticsearch"}}]),Object(m["a"])(t,[{key:"search",value:function(e,t,i){var n=this;this.initSearchQuery(e,t).then(function(r){var a=Dr()(JSON.stringify(r.query)),s=Object.assign(r.values,{userInput:e}),o=a(s);n.middleware.forEach(function(e){o=e.addToQuery(o)});var l=t.endpoints.find(function(e){return e.searchImpl===this.className},n),c=q.getInstance().getLocaleAwareString(l.url);ce.a.post(c,o).then(n.handleSearch.bind(n,i)).catch(n.handleSearch.bind(n,i))})}},{key:"handleSearch",value:function(e,t){if(t instanceof Error)e([]);else{var i=t.data,n=[];this.middleware.forEach(function(e){e.handleResult(i)});try{if(i.hits.hits.length>0){var r=i.hits.hits;n=r.map(function(e){return Object.assign(e._source,{type:e._type})})}}catch(a){}e(n)}}},{key:"parseSearchQuery",value:function(e,t){var i,n={},r=t.hasOwnProperty("filter"),a=t.hasOwnProperty("function")||t.decayByLocation,s=t.hasOwnProperty("rescore");if(t.hasOwnProperty("values")&&Object.assign(n,this.makeTemplateValues(e,t.values)),r&&a){if(t.hasOwnProperty("function")&&t.decayByLocation){var o=this.getDecayByLocation();l=t.functions.concat(o)}else l=t.hasOwnProperty("function")?t.function:this.getDecayByLocation();i={query:{filtered:{query:{function_score:{query:t.query,functions:l}},filter:t.filter}}}}else if(r)i={query:{filtered:{query:t.query,filter:t.filter}}};else if(a){var l;if(t.hasOwnProperty("function")&&t.decayByLocation){o=this.getDecayByLocation();l=t.functions.concat(o)}else l=t.hasOwnProperty("function")?t.function:this.getDecayByLocation();i={query:{function_score:{query:t.query,functions:l}}}}else i={query:t.query};return s&&(i.rescore=t.rescore),this.resultSize&&(i.size=this.resultSize),{query:i,values:n}}},{key:"initSearchQuery",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i){var n,r,a;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!i.decayByLocation){e.next=14;break}if(n=this.location.coords&&Date.now()-this.location.setAt>3e5,r=!this.location.coords&&Vu.testForApi(),!n&&!r){e.next=14;break}return e.prev=4,e.next=7,Vu.getLocation();case 7:a=e.sent,this.location={coords:{lat:a.coords.latitude,lon:a.coords.longitude},setAt:Date.now()},e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](4),this.logger.warning(e.t0.message);case 14:return e.abrupt("return",this.parseSearchQuery(t,i));case 15:case"end":return e.stop()}},e,this,[[4,11]])}));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"getDecayByLocation",value:function(){var e;return e=this.location.hasOwnProperty("coords")?[{gauss:{geoLocation:{origin:this.location.coords,offset:"1km",scale:"2km"}}}]:[],e}},{key:"makeTemplateValues",value:function(e,t){var i={};return Object.values(t).forEach(function(t){var n=new RegExp(t.regex),r=e.match(n)[0];t.hasOwnProperty("replace")&&(r=r.replace(new RegExp(t.replace.regex,"g"),t.replace.value)),i[t.name]=r.trim()}),i}}]),t}(Ou),Uu=Bu,Wu=function(e){function t(e){return Object(d["a"])(this,t),e.url&&(e.url=null),y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.VirtualcityLocationService"}}]),t}(Iu),qu=Wu,Ju=function(){function e(t){Object(d["a"])(this,e)}return Object(m["a"])(e,[{key:"initialize",value:function(){}},{key:"addToQuery",value:function(e){return e}},{key:"addFilter",value:function(e,t){var i=JSON.parse(e);if(i.query.hasOwnProperty("filtered")){var n=i.query.filtered.filter;if(n.hasOwnProperty("bool")){var r=n.bool;if(r.hasOwnProperty("must")){var a=r.must;if(Array.isArray(a))a.push(t);else{var s={};Object.assign(s,a),r.must=[s,t]}}else r.must=t}else{var o={};Object.assign(o,n);var l={bool:{must:[o,t]}};i.query.filtered.filter=l}return JSON.stringify(i)}var c={query:{filtered:{query:i.query,filter:t}}};return JSON.stringify(c)}},{key:"handleResult",value:function(e){}},{key:"clear",value:function(){}}]),e}(),Ku=Ju,Zu=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.className=t.className,i.tags=[],i.activeTags=[],i.doHandle=!0,i.tagOrder=e.tagOrder?e.tagOrder:[],i.combineTagsWithOr=!!e.combineTagsWithOr,i.isActive=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.middleware.Tags"}}]),Object(m["a"])(t,[{key:"addToQuery",value:function(e){var t=this._addTagAggregation(e);return this._filterByTags(t)}},{key:"_addTagAggregation",value:function(e){var t=JSON.parse(e);return t.aggregations?t.aggregations.tagCount={terms:{field:"tags"}}:t.aggregations={tagCount:{terms:{field:"tags"}}},JSON.stringify(t)}},{key:"_filterByTags",value:function(e){if(0===this.activeTags.length)return e;var t={};if(1===this.activeTags.length)t.term={tags:this.activeTags[0].key};else{var i=this.activeTags.map(function(e){return{term:{tags:e.key}}});t=this.combineTagsWithOr?{or:i}:{and:i}}return this.addFilter(e,t)}},{key:"handleResult",value:function(e){if(this.doHandle)if(e.aggregations&&e.aggregations.tagCount){var t=e.aggregations.tagCount.buckets;if(t.length){var i=this.sortTags(t),n=i.filter(function(e){return this.activeTags.find(function(t){return t.key===e.key})},this);this.clear(),i.forEach(function(e){this.tags.push(e)},this),n.forEach(function(e){this.activeTags.push(e)},this)}else this.clear()}else this.clear()}},{key:"setHandle",value:function(e){this.doHandle=e}},{key:"sortTags",value:function(e){var t=this;return e=this.tagOrder.length>0?e.sort(function(e,i){var n=t.tagOrder.indexOf(e.key),r=t.tagOrder.indexOf(i.key);return n=n>-1?n:t.tagOrder.length+1,r=r>-1?r:t.tagOrder.length+1,n-r}):e.sort(function(e,t){return e.key.toLocaleString()<t.key.toLocaleString()?-1:1}),e}},{key:"clear",value:function(){this.tags.splice(0,this.tags.length),this.activeTags.splice(0,this.activeTags.length),this.isActive=!1}}]),t}(Ku),Qu=Zu,Xu=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.className=t.className,i.fillColor=e.fillColor?e.fillColor:"rgba(85,110,255,0.4)",i.searchCenterIcon=e.searchCenterIcon?e.searchCenterIcon:null,i.pointId=null,i.cirleId=null,i.searchCenter=[0,0],i.searchDistance=500,i.isActive=!1,i.title=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.middleware.Near"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e,t=ne.getInstance(),i=new _n({projection:{epsg:4326},altitudeMode:"clampToGround",allowPicking:!1,name:"_".concat(Object(u["c"])())});t.addLayer(i),this.layerName=i.name,e=null!==this.searchCenterIcon?new ol.style.Icon({src:this.searchCenterIcon,scale:.5}):new ol.style.Circle({fill:new ol.style.Fill({color:"#000"}),stroke:new ol.style.Stroke({color:"rgba(1,1,1,0.0)",width:0}),radius:5}),i.setStyle(new ol.style.Style({image:e,fill:new ol.style.Fill({color:this.fillColor}),stroke:new ol.style.Stroke({width:0,color:"rgba(1,1,1,0.0)"})}));var n=new ol.Feature({geometry:new ol.geom.Point([0,0])}),r=new ol.Feature({geometry:new ol.geom.Circle([0,0]),radius:2e5}),a=i.addFeatures([n,r]);this.pointId=a[0],this.circleId=a[1]}},{key:"addToQuery",value:function(e){if(this.isActive){var t={geo_distance:{distance:this.searchDistance,geoLocation:this.searchCenter}};return this.addFilter(e,t)}return e}},{key:"activate",value:function(e,t){this.searchCenter=e,t||(t="".concat(String(Math.round(100*e[1])/100),"N ").concat(String(Math.round(100*e[0])/100),"E")),this.title=t,this.showLayer();var i=ne.getInstance(),n=i.getActiveMap(),r=n.getViewPoint();r.setAnimate(!0);var a=r.getGroundPosition(),s=this.searchCenter.slice();a&&a[2]&&(s[2]=a[2]);var o=r.getPitch();(!o||o>-20)&&r.setPitch(-20),r.setGroundPosition(s),r.setDistance(2e3),r.setCameraPosition(null),n.gotoViewPoint(r),this.isActive=!0}},{key:"setDistance",value:function(e){var t=Number(/^[0-9]+/.exec(e)[0]),i=/\D+$/.exec(e);i&&"m"!==i[0]&&(t*=1e3),this.searchDistance=t,this.isActive&&this.showLayer()}},{key:"getDistance",value:function(){return this.searchDistance}},{key:"showLayer",value:function(){var e=ne.getInstance().getLayerByName(this.layerName);this.searchCenter&&(e.updateGeometryOfFeature(this.pointId,new ol.geom.Point(this.searchCenter)),e.updateGeometryOfFeature(this.circleId,ol.geom.Polygon.circular(new ol.Sphere(6378137),this.searchCenter,this.searchDistance,128)),e.activate(!0))}},{key:"hideLayer",value:function(){if(this.layerName){var e=ne.getInstance().getLayerByName(this.layerName);e.activate(!1)}}},{key:"clear",value:function(){this.hideLayer(),this.isActive=!1,this.title=null}}]),t}(Ku),$u=Xu,eh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo2RUM4Mzk3QUJERDQxMUU1QjJEN0FDNDY2NkM0MTA0RiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3Nzc1MkM2NkRCQTExMUU1QUUwQjhGQjIwQjM0ODRBNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3Nzc1MkM2NURCQTExMUU1QUUwQjhGQjIwQjM0ODRBNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2NjMwYzU0NC03NmE3LWEzNGMtOWQ0OC1jNGU5OTZkMGIxYWMiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpkYmYzYzlmNi1kYmEwLTExZTUtYjFiYi1iMWYzNDcxM2ZjNzQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4hNWn9AAAJk0lEQVR42txafWwUxxV/t3t3Pp8/LtgEG0zBJC20caJijN1CpSYEWqXBFqJNaRAUsI0cJFQI1P2DSoVgKtqmSexQsJQmjogaF5IUU1onsdoGqNQUCjU2Ul1RigOJC8R8nO2zfT77dm/7ZvXGGfbWt3t3Nm4z0mN9y87O++3vzZv33owTxr85UCQUma4S3XMIz2gkERKVrtp4KuIcR0BOEheJW7gnghRBKSQjKGESfk+bbHCyACQVxYOSQve5OARgInOcKVWQYZQQypAAWE3miyfSJAFQGl05U7LAnplpmpmkyBhnkgEcFIBGJhocNz8GJoOAeeiem1hzJfjRNAI5TGAU+nsApZ9AxmWupkpoWnR/h8MhkfLpBMxLgDwkMn928+bNs1esWDF/zpw5n8vKyvqM1+u91+l0pqKkKYoyiDIUDAZv+v3+rsuXL//72LFj7QcOHPhQGE4l8wwR0CABZECHUb+IiX6JgcOOMrHlQ8kkkCnEnA5q9erVOdu2bXusoKDgUQQzPV7aEOz1jo6O47W1tS2HDh3qFkAOEoNMAih9jEXUUbUCB2OB40ImxwDNQnkQpQjlqyhfY1JeXr6+s7Pzj5FIRNHGobH3sPex9/IxaLwiGn8W6eM06Bkfc/g1nMTOFDLFFHqxnJeX5z569OiTRUVF35EkyTXeiyWCDLe2tr65cuXKQ1evXh0hFgPEIDPRHsYq6qrEzRyZGwOSj/IQSgnKUvYlKyoqNvT29l7S7kJj47DxiMGlpMdDpJf+ocdiLparTycT4MCWsQHq6+t3hMPhQe0uNjYejvtDArhMADiL9JTi8aDME84kGy/mwBobG/eoqhrWJqGxcdn4AoPFpN9M0tdhFmEYm4u84j3kIRn1Ul1d3fzKyspdOL+cMAmNLUXoiRfj0tLR0tLSTXoqxJpqttDLJuaYRsDSyIm40ObzampqnpVl2QOT2BjAhQsXLr5+/fr7586dGxCAaUJsqpl5Swd5w2yULA6OeUVcf+p8Pt9n4/J2ff0Q/N0fIPTn0zDS3gFq9y2IBPpBykgHOfdecM8vAM/DXwbviq+DlJkRF8i+vr5LyOLT5EX7aS30o9wmb6oZwXHvOE1gTz5z5sy64uLitfGA6nvhJeh/qRG0oZA1G6keyHhqLfi2V4Hksw/y7NmzjSUlJa8Rc70E8CYt8qrRLFMIEA+tUnAhnbFp06YdFKFYtsE3fw83nqiC0IlTOBsUe1ric8Onz8HAa2+Bc0YOuAvm2eo2ffr0L3R1dZ1sb28fFAJxHo8qInMOYi2HXCtbtCWM+3bk5+cvsbEwQs+u5yHwYkPS8yrz6UqY8sz32QSzfPbKlSsnMH79CQHrodizm0w1IgseMkNgzbNu3boZGzZs2OqwsfT37q6FQN0r4+I0hk+34T8j4HlkkeWz6AfykYDj58+fHyBT5OkSYy/CFU+luXYPiRu9UUVhYeGTlqb4VjPc2viDMVJhGdK++Th4y5aB64G5IE/NAvWWH8L/vAjB5vdg8MjbqI55Ljr1lZ9D2rdLLQG2tbW9sWDBggYC1UtygwXXPIFkjOWSSTJP6cAo/Vepqak5sV6s3rwN14q+oTsRY/MsWQzZL+wC532zxp5uH3wEt7fvxjn61+gQCZ3LjL+/C/K07JjghoaGbmAWspbmnZ9M82NmmjxLdgkZtGPLli2zrYDpLvln9abA0tc/ATlNL8cEphOL/59z5Jf686Ze99l6S+ZQz2lMXyJJxCHxKpVbuAmlpaVftOPyB15vMmes9hl6tZ0qjKw/z/oZG3u/2cczNtR3vuA7RvFw5pxCQQfQA821TC5xgTauYw6XE7Kf36krHF+ZSdb7sf53OGF8PxvHqrGMX1irZV5xE8HxKhVg/DbT6oWhk6ei7nm/9Tg475+dWBkO+7H+dsYxNkFfSajzjIITq1SAE9Ryvo3840I0uOVLk1oGvKXLbI0T1c/rnSaAG622SQbE+m9WzLF6oXq1O+qe3ehirOZ+YK6tcaJYdzq9QjDiEME5Yjw8tkPpH4h231N8SYEz6282jgW40atkVgdUFCVoqUhGerQiPX3J1U1M+kvpaTbCU2VIqH2OXrlZRoTgU3x4bAeXFz0tRzDySKaZ9Zdn5toBFzTZYNEkwy5LhGqIlobufvDz0ctD85+SAmfW32wck5pnt0BSxAhOEZnz+/3/sXqh5+HowDZ45B09pEqkKZ0f6v3tjGNsgr7cAhmeiAiO77QAK3Fbul/MoFmieceiG1b0WBHUODdmMGXyV+/R+xsTWTaOVRP0VYXsICIWV/huCzQ3N7dbOhQMbNPXrIxedDEIvr1tN6uq2gOGH8K/vQaGjr8fHaPi++1k54K+YRFPrKzgdRaUxtTrBmYFCycwKzj7Dsg5Uy2zgszMzO+iU+EJa7+YFYhbR6PsXbhw4YSlx8R0JIvFkmbhGSp8rWQ53KqshuBvWyB86QpEegP6lf1m9699qdQUmB5SPfcjS2BcTwSmCawN8yoYj1QV2i7iNQh3XV3duwcPHlxllYmzhDLccRH6al+Onko4hwZ/87YucZUatlZC2qoyO2V/jenJk3gCFTLWUCQyzcRrKDufg8C+V5OvoWypgCk11XZrKCcxI9hrVUPRhGQvhcC6A4HAB2VlZcstq1+oSOqjXwEXRvahv5wBLTScUOiV/Ys9kPm9clvA2C5QdXX1j9va2hiQIDEWIGBhu3XL9cXFxWsmtm65Bnzbn4q3bvnrkpKSg7HqlnYrzi/6fL77E6o4Yz42WnHGIFivOKOj0CvOjyxKtOLcWVBQsNWq4gwmewWMvftQWOqu76Bu3LixPBwOD2j/A43pwfSBT3Zc55O+mWDYyjLOJR6C8TqEXpdgmw7Z2dn/QjNYQhv/k9LYlvL+/ft37t279yJ5xAGaa33EoBoLnBGgi36nsG2jefPmdbFtpMkAyIAdPnz4p1VVVX8j/foFJ9JLUQlYgQMhU+D1FfY7pamp6aPc3NyLhYWFiyZiH3zsCE0NNjQ01JSXl5+ijy0C66G/7e0df1r2xJM9zbC6qKho1QSdZlBaW1vfmJDTDJ/6cyifBCBxnSBa6vV6c+NlCrOQj3E9fW88TxBNyNkvVrtnJW7h7FeO0+n0sCoVq3eghFhpgJ/9YvnYvn37rM5+8QNuyZ39ihUtwZ2n9tIJ8P/PqT07cS6Yn7d0CbX6eM5bKkI+xk8lBOEun7c0Wyd5JsHNM5GTsuJ+NjfHYZikk7JmTIqMJXvGWU2EqYkCZ3xnvKfTuXmO6+n0/wowALmncfsG1yHoAAAAAElFTkSuQmCC",th=eh,ih=function(){function e(t){Object(d["a"])(this,e),this.className=t.className,this.title=t.title?t.title:null,this.description=t.description?t.description:null,this.initialized=!1}return Object(m["a"])(e,[{key:"initialize",value:function(){return!0}},{key:"isInitialized",value:function(){return this.initialized}},{key:"handleClickEvent",value:function(e){}},{key:"destroy",value:function(){this.initialized=!1}},{key:"getClassName",value:function(){return this.className}}]),e}(),nh=ih,rh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.pointWGS84=e.pointWGS84||null,i.geometry=e.geometry||null,i.balloonContent=e.balloonContent||null,i.result=e.result||{},i.layerName=e.layerName,i.icon=e.icon||th,i.clearLayerOnClick=null==e.clearLayerOnClick||e.clearLayerOnClick,i._featureId=null,i.zoomDistance="number"===typeof e.zoomDistance?e.zoomDistance:2e3,i.initialize(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.FeatureItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=ne.getInstance();if(Se(b(t.prototype),"initialize",this).call(this),!this.initialized){if(!this.pointWGS84&&!this.geometry)return console.log("you need to specify a geometry or a point"),!1;if(!this.pointWGS84){var i=(new ol.format.GeoJSON).readFeature(this.geometry);if(!i)return!1;this.pointWGS84=ol.extent.getCenter(i.getGeometry().getExtent())}var n=this.layerName&&e.getLayerByName(this.layerName)instanceof _n;if(!n)return console.log("could not find the result layer vector layer: ".concat(this.layerName)),!1;this.initialized=!0}return!0}},{key:"handleClickEvent",value:function(){if(this.initialized){var e=ne.getInstance(),t=e.getActiveMap(),i=t.getViewPoint();i.setAnimate(!0);var n=i.getGroundPosition(),r=this.pointWGS84.slice();n&&n[2]&&(r[2]=n[2]),i.setGroundPosition(r),i.setDistance(this.zoomDistance),i.setCameraPosition(null);var a=i.getPitch();(!a||a>-20)&&i.setPitch(-20);var s=e.getLayerByName(this.layerName),o=this.getFeature();this.clearLayerOnClick&&s.removeAllFeatures(),s.addFeatures([o]),s.activate(!0),t.gotoViewPoint(i);var l=Q.getInstance();l.getCurrentItem()&&l.getCurrentItem().id===o.getId()||l.setCurrentItem(o.getId(),o,s)}}},{key:"getFeature",value:function(){if(this.initialized){var e,t=ne.getInstance();if(null!=this._featureId){var i=t.getLayerByName(this.layerName),n=i.getFeatureById(this._featureId);if(n)return n}if(this.geometry){var r=new ol.format.GeoJSON;e=r.readGeometry(this.geometry)}else e=new ol.geom.Point(this.pointWGS84);var a=new ol.Feature(Object.assign({},{geometry:e},this.result));return this._featureId=Object(u["c"])(),a.setId(this._featureId),this.balloonContent&&a.set("balloonContent",this.balloonContent),a}return null}},{key:"getCoords",value:function(){return this.pointWGS84}},{key:"destroy",value:function(){if(Se(b(t.prototype),"destroy",this).call(this),null!=this._featureId){var e=ne.getInstance(),i=e.getLayerByName(this.layerName);i.removeFeaturesById([this._featureId])}this._featureId=null}}]),t}(nh),ah=rh,sh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.slug=e.slug,i.initialize(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.LayerItem"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(Se(b(t.prototype),"initialize",this).call(this),!this.initialized){if(!this.slug)return console.log("Could not find layer for LayerItem"),!1;var e=ne.getInstance().getLayerByName(this.slug);if(!e)return console.log("Could not find layer for LayerItem"),!1;this.initialized=!0}return!0}},{key:"isActive",value:function(){return ne.getInstance().getLayerByName(this.slug).isActive()}},{key:"handleClickEvent",value:function(e){if(this.initialized){var t=ne.getInstance().getLayerByName(this.slug);if(t){var i=t.isActive();t.activate(!i).then(e)}}}}]),t}(nh),oh=sh,lh=(xu={},Object(oe["a"])(xu,Iu.className,Iu),Object(oe["a"])(xu,Uu.className,Uu),Object(oe["a"])(xu,qu.className,qu),xu),ch=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.autocomplete=!!e.autocomplete,i.autocompleteRequest=e.autocompleteRequest?e.autocompleteRequest:null,i.fullAddressRequest=e.fullAddressRequest?e.fullAddressRequest:null,i.extendedSearches=e.extendedSearches?e.extendedSearches:[],i.middleware=[],i.extendedSearches.forEach(function(t){var i;"string"===typeof t?"searchTags"===t?this.middleware.push(new Qu(e)):"searchNear"===t&&this.middleware.push(new $u(e)):("vcs.vcm.widgets.search.middleware.Near"===t.type?i=new $u(t):"vcs.vcm.widgets.search.middleware.Tags"===t.type&&(i=new Qu(t)),i&&i instanceof Ku&&this.middleware.push(i))},f(i)),i.searchImplementations=[];var n=e.searchImplementations?e.searchImplementations:[];if(n)for(var r=0;r<n.length;r++){n[r].middleware=i.middleware;var a=lh[n[r].type];if(a){var s=new a(n[r]);s&&s instanceof Ou&&(s.searchWidget=f(i),i.searchImplementations.push(s))}else i.logger.warning("could not find search implementation with type ".concat(n[r].type))}return i.searchQueries=e.searchQueries?e.searchQueries:[{endpoints:[{searchImpl:"vcs.vcm.widgets.search.Nominatim"}],regex:".*"}],i.searchQueries.reverse(),i.searchResultItems=e.searchResultItems?e.searchResultItems:{address:{zoomTo:!0,pointType:!0,geomProperty:"geometry",title:"",description:"<%= obj.fulladdress %>",balloonContent:["   <div class='balloon-content'>","       <p class='balloon-text'><span class='balloon-street'> <%= obj.fulladdress %></span><br></p>","   </div>"]},point:{pointType:!0,geomProperty:"point",title:"<%= obj.display_name %>",description:"<%= obj.licence %>",balloonContent:["   <h1 class='balloon-title'><%= obj.display_name %></h1>","   <div class='balloon-content'>","       <p class='balloon-text'><%= obj.licence %></p>","   </div>"]},geojson:{zoomTo:!0,pointType:!1,geomProperty:"geojson",pointProperty:"point",title:"<%= obj.display_name %>",description:"<%= obj.licence %>",balloonContent:["   <h1 class='balloon-title'><%= obj.display_name %></h1>","   <div class='balloon-content'>","       <p class='balloon-text'><%= obj.licence %></p>","   </div>"]}},Object.values(i.searchResultItems).forEach(function(e){Object.keys(e).forEach(function(t){if(["title","description","balloonContent"].indexOf(t)>-1){var i=e[t],n=Array.isArray(i)?i.join("\n"):i;e[t]=Dr()(n)}})}),i.resultIcon=e.resultIcon||th,i.currentResults=[],i.justSearched=!1,i.resultLayer=new _n({projection:{epsg:4326},name:"_searchResultVector",zCoordinateEyeOffset:-100,heightAboveGround:10,altitudeMode:"clampToGround"}),i.showAllResults=!!e.showAllResults,i.showSearchResultToolbar=!!e.showSearchResultToolbar,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.Search"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.searchImplementations.forEach(function(e){e.initialize()}),this.middleware.forEach(function(e){e.initialize()}),this.framework.addLayer(this.resultLayer),this.resultLayer.setStyle(new ol.style.Style({image:new ol.style.Icon({src:this.resultIcon,scale:.5}),fill:new ol.style.Fill({color:"rgba(168,192,43,0.6)"}),stroke:new ol.style.Stroke({color:"#a8c02b",width:1.25})})),this.resultLayer.setHighlightStyle(new ol.style.Style({image:new ol.style.Icon({src:this.resultIcon,scale:.8}),fill:new ol.style.Fill({color:"rgba(168, 192, 43, 1)"}),stroke:new ol.style.Stroke({color:"#a8c02b",width:2})})),this.initialized=!0;var i=this.framework.getWidgetByType("vcs.vcm.widgets.BalloonInfo");i&&!i.hasTypeForLayerName("_searchResultVector")&&i.addTypeForLayer("_searchResultVector",["<div class='balloon' id='myBalloon'>","    <%= balloonContent %>","   <div class='balloon-close-col'>","       <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>","   </div>","   <div class='dialog-image-balloon'></div>","   <div class='balloon-left-edge'></div>","</div>"],"balloonHeight + 30","70"),this.initializedFinished()}}},{key:"search",value:function(e){var t=this;return this.clearSearch(),new Promise(function(i){var n=t._handleSearchResults.bind(t,i);t._handleSearch(e,n)})}},{key:"_handleSearch",value:function(e,t,i){var n;if(this.runningRequest&&this.runningRequest.cancel(),this.justSearched=!0,Number.isFinite(i)){if(!(i<this.searchQueries.length-1))return void t([]);n=this.searchQueries.slice(i+1).findIndex(function(t){var i=new RegExp(t.regex);return i.test(e)}),n=n+i+1}else n=this.searchQueries.findIndex(function(t){var i=new RegExp(t.regex);return i.test(e)});var r=this.searchQueries[n],a=this.searchImplementations.filter(function(e){var t=r.endpoints.findIndex(function(t){return t.searchImpl===e.className});return t>-1});if(0!==a.length){var s=this.searchCascade.bind(this,e,r.cascade,n,t);a.forEach(function(t){t.search(e,r,s)})}else t([])}},{key:"searchCascade",value:function(e,t,i,n,r){0===r.length&&t?this._handleSearch(e,n,i):n(r)}},{key:"_handleSearchResults",value:function(e,t){var i=this._getResultItems(t),n=i.map(function(e){return!!(e.isInitialized()&&(this.currentResults.push(e),this.showAllResults&&e instanceof ah))&&e.getFeature()},this).filter(function(e){return e});this.showAllResults&&(this.resultLayer.addFeatures(n),this.resultLayer.activate(!0)),e()}},{key:"_getResultItems",value:function(e){var t;if(0===e.length)return[];var i=[];return e.forEach(function(e){var n,r=this.searchResultItems[e.type];if(!r&&!t)throw new Error("Got undefined result type");if(t)n=e;else if(r.geomProperty){var a,s;if(r.pointType)s=e[r.geomProperty],a=!1;else{a=e[r.geomProperty];var o=new ol.format.GeoJSON,l=o.readGeometry(a);s=r.pointProperty&&e[r.pointProperty]?e[r.pointProperty]:ol.extent.getCenter(l.getExtent())}r.geomProperty&&e[r.geomProperty]&&delete e[r.geomProperty],r.pointProperty&&e[r.pointProperty]&&delete e[r.pointProperty],e.zoomTo=r.zoomTo,n=new ah({geometry:a,result:e,balloonContent:r.balloonContent(e),title:r.title(e),pointWGS84:s,description:r.description(e),layerName:"_searchResultVector",clearLayerOnClick:!this.showAllResults,icon:this.resultIcon,zoomDistance:r.zoomTo})}else"layer"===e.type&&(n=new oh({slug:e.slug,title:r.title(e),description:r.description(e)}));i.push(n)},this),i}},{key:"clearSearch",value:function(){this.runningRequest&&this.runningRequest.cancel(),this.resultLayer.removeAllFeatures(),this.currentResults.splice(0,this.currentResults.length),this.resultLayer.activate(!1)}},{key:"getAutocomplete",value:function(e,t){var i=this,n=JSON.parse(JSON.stringify(this.autocompleteRequest)),r=new RegExp(/\b[0-9]+/g),a=new RegExp(/\b[0-9]{5}\b/);if(r.test(e)&&null!==this.fullAddressRequest){var s=e.match(r);1===s.length&&a.test(e)||(n.query=Object.assign(n.query,this.fullAddressRequest))}var o=Dr()(JSON.stringify(n.query));this.runningRequest&&this.runningRequest.cancel();var l=q.getInstance().getLocaleAwareString(n.endPoint);return this.runningRequest=ce.a.CancelToken.source(),new Promise(function(n,r){ce.a.post(l,o({query:e}),{cancelToken:i.runningRequest.token}).then(function(e){var r=e.data;r=r.suggest||r;var a=[];if(i.justSearched)return t&&(n(a),t(a)),void(i.justSearched=!1);r.fullAddressSuggest&&r.fullAddressSuggest[0].options.length>0&&r.fullAddressSuggest[0].options.forEach(function(e){a.push(e.text)}),0===a.length&&r.nameSuggest[0].options.length>0&&r.nameSuggest[0].options.forEach(function(e){a.push(e.text)}),a=a.filter(function(e,t,i){return i.indexOf(e)===t}),t&&t(a),n(a)}).catch(function(e){t&&t([]),n([])}).then(function(){i.runningRequest=null})})}},{key:"getResultLayer",value:function(){return this.resultLayer}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.autocomplete=this.autocomplete,e.autocompleteRequest=this.autocompleteRequest,e.resultIcon=this.resultIcon!==th?this.resultIcon:null,e.searchImplementations=[],e.extendedSearches=this.extendedSearches,e.showSearchResultToolbar=this.showSearchResultToolbar,e.searchImplementations.push(new Iu({}).getConfigObject()),e}}]),t}(ra),uh=ch,hh=function(e){function t(e,i){var n;return Object(d["a"])(this,t),n=y(this,b(t).call(this)),n.cb=i,n.scratchLayer=e,n._defaultActive=me.CLICK,n.coordinates=[],n.setActive(),n}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!e.position.every(function(e){return 0===e})){var t=e.position.slice();e.feature||2===this.coordinates.length||(t[2]+=1.6),this.coordinates.push(t),2===this.coordinates.length?(this.scratchLayer.addFeatures([new ol.Feature({geometry:new ol.geom.Point(t)}),new ol.Feature({geometry:new ol.geom.LineString(this.coordinates)})]),this.setActive(!1),this.cb(this.coordinates)):this.scratchLayer.addFeatures([new ol.Feature({geometry:new ol.geom.Point(t)})])}return Promise.resolve(e)}}]),t}(pe),dh=hh,mh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.navigationControls=null,i.color=e.color||"#A8C02B",i.featureLayer=new _n({projection:{epsg:3857},name:"_advancedWalkMode",altitudeMode:"none"}),i.supportedMaps=["vcs.vcm.maps.Cesium"],i._removeInteraction=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.AdvancedWalkMode"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished();var i=new ol.style.Fill({color:this.color}),n=new ol.style.Stroke({color:this.color,width:2});this.featureLayer.setStyle(new ol.style.Style({image:new ol.style.Circle({fill:i,stroke:n,radius:5}),fill:i,stroke:n}))}return!0}},{key:"isSupported",value:function(e){return!(!this.navigationControls&&this.framework.isInitialized()&&(this.navigationControls=this.framework.getWidgetByType("vcs.vcm.widgets.NavigationControls"),!this.navigationControls))&&Se(b(t.prototype),"isSupported",this).call(this,e)}},{key:"activate",value:function(){this.featureLayer.activate(!0),this.navigationControls.navigationMode.values.walkmode&&this.navigationControls.navigationMode.activateOverviewMode(),this.active&&this.deactivate();var e=new dh(this.featureLayer,this.calculateViewPoint.bind(this));this._removeInteraction=xn().addExclusiveInteraction(e,this.deactivate.bind(this)),Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){this._removeInteraction&&this._removeInteraction(),this.featureLayer.getSource().clear(),this.featureLayer.activate(!1),Se(b(t.prototype),"deactivate",this).call(this)}},{key:"calculateViewPoint",value:function(e){var t,i,n,r,a=e.map(function(e){return R.mercatorToWgs84(e)}),s=Object(Ie["a"])(a,2),o=s[0],l=s[1],c={};o[2]>l[2]?(c=o.slice(),c[2]=l[2]):(c=l.slice(),c[2]=o[2]),Au=(t=Cesium.Cartesian3).fromDegrees.apply(t,Object(T["a"])(o).concat([Cesium.Ellipsoid.WGS84,Au])),Fu=(i=Cesium.Cartesian3).fromDegrees.apply(i,Object(T["a"])(l).concat([Cesium.Ellipsoid.WGS84,Fu])),Nu=(n=Cesium.Cartesian3).fromDegrees.apply(n,Object(T["a"])(c).concat([Cesium.Ellipsoid.WGS84,Nu])),Fu=Cesium.Cartesian3.subtract(Fu,Au,new Cesium.Cartesian3),Nu=Cesium.Cartesian3.subtract(Nu,Au,new Cesium.Cartesian3),Cesium.Cartesian3.normalize(Fu,Fu),Cesium.Cartesian3.normalize(Nu,Nu),r=o[2]>l[2]?Cesium.Math.toDegrees(Math.acos(Cesium.Cartesian3.dot(Fu,Nu)))-90:Cesium.Math.toDegrees(Math.acos(Cesium.Cartesian3.dot(Fu,Nu)));var u={groundPosition:o,distance:0,animate:!0,heading:Wt(o,l),pitch:r},h=new V(u);this.navigationControls.navigationMode.activateFirstPersonMode(h,null,null,null,!0),setTimeout(this.deactivate.bind(this),1e3)}}]),t}(ra),fh=mh,yh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),e.balloonTypes||(e.balloonTypes=[{template:["<div class='balloon' id='myBalloon'>","   <h1 class='balloon-title'><%= obj.title %></h1>","   <div class='balloon-content'>","       <%= obj.description %>","   </div>","   <div class='balloon-close-col'>","       <button class='close-balloon'><i class='fa fa-times fa-lg'></i></button>","   </div>","   <div class='dialog-image-balloon'></div>","   <div class='balloon-left-edge'></div>","</div>"],minTop:"balloonHeight + 70",minLeft:"70",layerTypes:["vcs.vcm.layer.Vector"],layerNames:[]}]),i.balloonTypes=[],i.layerNamesToBalloonTypes={},i.layerTypesToBalloonTypes={},e.balloonTypes.forEach(function(e,t){var i=e.template;"string"!==typeof e.template&&(i=e.template.join("\n")),this.balloonTypes.push({template:i,minTop:e.minTop?e.minTop:0,minLeft:e.minLeft?e.minLeft:0,layerNames:e.layerNames?e.layerNames:[],layerTypes:e.layerTypes?e.layerTypes:[]}),e.layerTypes&&e.layerTypes.forEach(function(e){this.layerTypesToBalloonTypes[e]=t},this),e.layerNames&&e.layerNames.forEach(function(e){this.layerNamesToBalloonTypes[e]=t},this)},f(i)),i.balloon=null,i.excludedLayerNames=e.excludedLayerNames||[],i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.BalloonInfo"}}]),Object(m["a"])(t,[{key:"createBalloonForGenericFeature",value:function(e){this.clearBalloon();var t,i=e.layerName,n=e.layerClass;if(!this.excludedLayerNames.includes(i)){if(null!=this.layerNamesToBalloonTypes[i])t=this.balloonTypes[this.layerNamesToBalloonTypes[i]];else{if(null==this.layerTypesToBalloonTypes[n])return;t=this.balloonTypes[this.layerTypesToBalloonTypes[n]]}var r,a=e.attributes||e,s={};Object.keys(a).forEach(function(e){/^olcs_/.test(e)||(s[e]=a[e])});try{r=Dr()(t.template)(s)}catch(l){return void this.logger.warning("Could not render the template for layer: ".concat(i,". Please verify that the balloon template is correct"))}var o=Object.assign(e,{balloonWidget:this,minTop:t.minTop,minLeft:t.minLeft,balloonContent:r});this.balloon=new Do(o),this.balloon.initialize()}}},{key:"clearBalloon",value:function(){this.balloon&&(this.balloon.close(),this.balloon=null)}},{key:"hasTypeForLayerName",value:function(e){return o(e,String),null!=this.layerNamesToBalloonTypes[e]}},{key:"addTypeForLayer",value:function(e,t,i,n){Array.isArray(t)&&(t=t.join("")),o(e,String),o(t,String),l(n,String),l(i,String);var r={layerTypes:[],layerNames:[e],template:t,minTop:i||"balloonHeight + 30",minLeft:n||"70"},a=this.balloonTypes.length;this.balloonTypes.push(r),this.layerNamesToBalloonTypes[e]=a}},{key:"getLink",value:function(e){this.balloon&&this.balloon.getLink(e)}},{key:"dispose",value:function(){this.clearBalloon()}},{key:"getBalloon",value:function(){return this.balloon}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.balloonTypes=this.balloonTypes,e.balloonTypes.forEach(function(e){e.template&&(e.template=e.template.split("\n"))}),e.excludedLayerNames=this.excludedLayerNames,e}}]),t}(ra),gh=yh,vh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.data={},i.headerLogoBox=e.headerLogoBox||null,Array.isArray(i.headerLogoBox)&&(i.headerLogoBox=i.headerLogoBox.join("\n")),i.headerTitle=e.headerTitle||null,Array.isArray(i.headerTitle)&&(i.headerTitle=i.headerTitle.join("\n")),i.footerLogoBox=e.footerLogoBox||null,Array.isArray(i.footerLogoBox)&&(i.footerLogoBox=i.footerLogoBox.join("\n")),i.showOverflow=!!e.showOverflow,i.layerItems=[],i.uiOptions={headerLogoBox:i.headerLogoBox,headerTitle:i.headerTitle,footerLogoBox:i.footerLogoBox},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Copyright"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.updateLayers(),this.framework.subscribe(B.MAP_ACTIVATED,this.updateLayers.bind(this)),this.framework.subscribe(B.LAYER_CHANGED,this.layerChanged.bind(this)),this.initialized=!0,this.initializedFinished()}}},{key:"updateLayers",value:function(){var e=this.framework.getLayers(),t=this.framework.getActiveMap();t&&(this.layerItems.splice(0),e.forEach(function(e){if(e.isSupported(t)&&e.isActive()){var i=this.createLayerItem(e);i&&this.layerItems.push(i)}},this))}},{key:"layerChanged",value:function(e){var t=this.layerItems.findIndex(function(t){return t.layerName===e.name});if(e.isActive()){if(-1===t){var i=this.createLayerItem(e);i&&this.layerItems.push(i)}}else t>-1&&this.layerItems.splice(t,1)}},{key:"createLayerItem",value:function(e){var t=e.options.copyright;if(t&&t.provider&&""!==t.provider){t.layerName=e.name;var i="";return e.options.category&&(i+="".concat(e.options.category," - ")),e.options.title?i+=e.options.title:i+=e.name,t.title=i,t}return null}},{key:"handleURLParameter",value:function(e){var t=e.headerTitle;null!=t&&(this.uiOptions.headerTitle=t)}},{key:"getLink",value:function(e){this.headerTitle!==this.uiOptions.headerTitle&&e.addQueryParams({headerTitle:this.uiOptions.headerTitle})}}]),t}(ra),ph=vh,_h=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.CreateLink"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;this.initializedFinished()}}}]),t}(ra),bh=_h,Lh={AMBIENT_OCCLUSION:"ambientOcclusion",BLOOM:"bloom",BLACK_AND_WHITE:"blackAndWhite",BLUR:"blur",BRIGHTNESS:"brightness",DEPTH_OF_FIELD:"depthOfField",EDGE_DETECTION:"edgeDetection",LENS_FLARE:"lensFlare",NIGHT_VISION:"nightVision",SILHOUTTE:"silhouette"},Mh=function(){function e(t,i){var n=this;Object(d["a"])(this,e),this._enabled=t.enabled,this.uniforms={},Object.keys(i).forEach(function(e){"color"===i[e].type?Object.defineProperty(n.uniforms,e,{get:function(){var i=t.uniforms[e].toBytes();return i[3]/=255,i},set:function(i){t.uniforms[e]=Cesium.Color.fromBytes(i[0],i[1],i[2],255*i[3],t.uniforms[e])}}):n.uniforms[e]=t.uniforms[e]}),this.uniformTypes=i,this.update=this._update.bind(this,t),this.setEnabled=this._setEnabled.bind(this,t)}return Object(m["a"])(e,[{key:"_setEnabled",value:function(e){e.enabled=this._enabled}},{key:"_update",value:function(e){var t=this;Object.keys(this.uniforms).forEach(function(i){e.uniforms[i]=t.uniforms[i]})}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this.setEnabled()}}],[{key:"isSupported",value:function(e){return!0}}]),e}(),kh=Mh,wh=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e,{intensity:{type:"number"},bias:{type:"number"},lengthCap:{type:"number"},stepSize:{type:"number",step:.2},frustumLength:{type:"number",step:10},ambientOcclusionOnly:{type:"boolean"}})),i.uniforms.lengthCap=3,i.update(),i}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.AMBIENT_OCCLUSION}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(e)}}]),t}(kh),Th=wh,Sh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{contrast:{type:"number",step:2},brightness:{type:"number"},delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"},glowOnly:{type:"boolean"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLOOM}}]),t}(kh),Oh=Sh,Ch=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{gradations:{type:"number",step:1}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLACK_AND_WHITE}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBlackAndWhiteStage()}}]),t}(kh),Eh=Ch,Ih=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BLUR}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBlurStage()}}]),t}(kh),Dh=Ih,jh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{brightness:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.BRIGHTNESS}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createBrightnessStage()}}]),t}(kh),Ph=jh,Yh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{focalDistance:{type:"number",step:1},delta:{type:"number"},sigma:{type:"number"},stepSize:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.DEPTH_OF_FIELD}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(e)}},{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createDepthOfFieldStage()}}]),t}(kh),xh=Yh,Ah=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{intensity:{type:"number"},distortion:{type:"number",step:1},ghostDispersal:{type:"number"},haloWidth:{type:"number"},earthRadius:{type:"number",step:1e3}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.LENS_FLARE}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createLensFlarStage()}}]),t}(kh),Fh=Ah,Nh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.NIGHT_VISION}}]),Object(m["a"])(t,null,[{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createNightVisionStage()}}]),t}(kh),Hh=Nh,Rh=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e,{color:{type:"color"},length:{type:"number"}}))}return w(t,e),Object(m["a"])(t,null,[{key:"type",get:function(){return Lh.SILHOUTTE}}]),Object(m["a"])(t,null,[{key:"isSupported",value:function(e){return Cesium.PostProcessStageLibrary.isSilhouetteSupported(e)}},{key:"createStage",value:function(){return Cesium.PostProcessStageLibrary.createSilhouetteStage()}}]),t}(kh),zh=Rh,Gh=(Hu={},Object(oe["a"])(Hu,Th.type,Th),Object(oe["a"])(Hu,Oh.type,Oh),Object(oe["a"])(Hu,Eh.type,Eh),Object(oe["a"])(Hu,Dh.type,Dh),Object(oe["a"])(Hu,Ph.type,Ph),Object(oe["a"])(Hu,xh.type,xh),Object(oe["a"])(Hu,Fh.type,Fh),Object(oe["a"])(Hu,Hh.type,Hh),Object(oe["a"])(Hu,zh.type,zh),Hu),Vh=Y.getLogger("vcs.vcm.widets.DisplayQuality"),Bh=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.defaultQualityLevel=e.defaultQualityLevel||"medium",i.defaultMobileQualityLevel=e.defaultMobileQualityLevel||"low",i.viewModel=null;var n={},r=e.low||{};n.low=t.createViewModel({sse:4,fxaa:!1,fog:{enabled:!0,density:9e-4,screenSpaceErrorFactor:6},resolutionScale:.9,layerSSEFactor:2},r);var a=e.medium||{};n.medium=t.createViewModel({sse:2.333,fxaa:!1,fog:{enabled:!0,density:5e-4,screenSpaceErrorFactor:4},resolutionScale:1,layerSSEFactor:1.1},a);var s=e.high||{};n.high=t.createViewModel({sse:4/3,fxaa:!0,fog:{enabled:!1,density:0,screenSpaceErrorFactor:0},resolutionScale:1,layerSSEFactor:.5},s),i.viewModelSettings=n,i.showAdvancedSettings=e.showAdvancedSettings||!1,i.sseLayerTypes=["vcs.vcm.layer.cesium.AbstractCesiumTilesetLayer","vcs.vcm.layer.TiledLayer","vcs.vcm.layer.FeatureStore"],i.supportedMaps=["vcs.vcm.maps.Cesium"],i.cesiumMap=null,i.layers=[],i.activePreset={preset:null},i.postProcessStages={};var o=e.allowedPostRenderStages||[Th.type,Oh.type,Eh.type,Dh.type,Ph.type,xh.type,Hh.type,zh.type];return o.forEach(function(e){i.postProcessStages[e]=null}),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.DisplayQuality"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;this.cesiumMap=this.framework.getMapByType("vcs.vcm.maps.Cesium");var n=this.cesiumMap.getScene(),r=n.postProcessStages;Object.keys(this.postProcessStages).forEach(function(t){Gh[t]&&Gh[t].isSupported(e.cesiumMap.getScene())?r[t]&&(e.postProcessStages[t]=new Gh[t](r[t])):delete e.postProcessStages[t]}),this.viewModel={sse:n.globe.maximumScreenSpaceError,fxaa:r.fxaa.enabled,fog:n.fog,resolutionScale:1},this.initializeLayers(),this.framework.subscribe(B.LAYER_ACTIVATED,this.layerActivated,this),this.framework.isMobile()?this.setPreset(this.defaultMobileQualityLevel):this.setPreset(this.defaultQualityLevel),this.initialized=!0,this.initializedFinished()}return!0}},{key:"addPostProcessingStage",value:function(e){this.postProcessStages[e]&&Vh.warning("trying to add existing stage");var t=Gh[e],i=this.cesiumMap.getScene();if(t&&t.isSupported(i)){var n=t.createStage();i.postProcessStages.add(n),this.postProcessStages[e]=new t(n)}else Vh.error("could not find ".concat(e," or ").concat(e," is not supported"))}},{key:"initializeLayers",value:function(){var e=this;this.framework.getLayers().filter(function(e){return e instanceof Hn||e instanceof Er||e instanceof ta}).forEach(function(t){var i=e.framework.isMobile()?t.screenSpaceErrorMobile:t.screenSpaceError;e.layers.push({layerName:t.name,sse:i,defaultSse:i})})}},{key:"layerActivated",value:function(e){var t=this.layers.find(function(t){return t.layerName===e.name});t&&this.setLayerQuality(e.name)}},{key:"setQuality",value:function(e){if(l(e,Boolean),e||(this.activePreset.preset=null),this.cesiumMap.isInitialized()&&this.viewModel){var t=this.cesiumMap.getViewer();t.scene.globe.maximumScreenSpaceError=this.viewModel.sse,t.scene.postProcessStages.fxaa.enabled=this.viewModel.fxaa,t.resolutionScale=this.viewModel.resolutionScale,t.scene.fog.enabled=this.viewModel.fog.enabled,t.scene.fog.density=this.viewModel.fog.density,t.scene.fog.screenSpaceErrorFactor=this.viewModel.fog.screenSpaceErrorFactor}}},{key:"setPreset",value:function(e){var t=this;o(e,["high","medium","low"]),this.activePreset.preset=e;var i={};"high"===e?Object.assign(i,this.viewModelSettings.high):"medium"===e?Object.assign(i,this.viewModelSettings.medium):Object.assign(i,this.viewModelSettings.low),Object.assign(this.viewModel,i),this.layers.forEach(function(e){e.sse=e.defaultSse*i.layerSSEFactor,t.setLayerQuality(e.layerName)}),this.setQuality(!0)}},{key:"setLayerQuality",value:function(e){o(e,String);var t=this.framework.getLayerByName(e);if(t&&t.isActive()){var i=this.layers.find(function(t){return t.layerName===e});i&&t.setMaximumScreenSpaceError(i.sse)}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.low=this.viewModelSettings.low,e.medium=this.viewModelSettings.medium,e.high=this.viewModelSettings.high,e.defaultQualityLevel=this.defaultQualityLevel,e.showAdvancedSettings=this.showAdvancedSettings,e.allowedPostRenderStages=this.options.allowedPostRenderStages||[Th.type,Oh.type,Eh.type,Dh.type,Ph.type,xh.type,Hh.type,zh.type],e}}],[{key:"createViewModel",value:function(e,t){var i=new Cesium.Fog,n=Object.assign(e.fog,"object"===Object(s["a"])(t.fog)?t.fog:{});i.enabled=!!n.enabled,i.density=Number(n.density),i.screenSpaceErrorFactor=Number(n.screenSpaceErrorFactor);var r=Object.assign(e,t);return{sse:Number(r.sse),fxaa:!!r.fxaa,fog:i,resolutionScale:Number(r.resolutionScale),layerSSEFactor:Number(r.layerSSEFactor)}}}]),t}(ra),Uh=Bh,Wh=new gt({image:{fill:{color:[255,255,255,.4]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:"#3399CC",width:2},fill:{color:[255,255,255,.4]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),qh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers","vcs.vcm.maps.Oblique"],i.allowedGeometries=e.allowedGeometries||["Point","LineString","Polygon","BBox","Circle","Rectangle","Label"],i.allowEditMode=Object(u["e"])(e.allowEditMode,!0),i.allowSelectMode=Object(u["e"])(e.allowSelectMode,!0),i.defaultMode=null!=rn[e.defaultMode]?e.defaultMode:"create",i.editorOptions={hideAltitudeMode:Object(u["e"])(e.hideAltitudeMode,!1),simpleStyleUi:Object(u["e"])(e.simpleStyleUi,!1),hideExport:Object(u["e"])(e.hideExport,!1),hideHelp:Object(u["e"])(e.hideHelp,!1),showFeatureEditorUiInEditMode:!i.allowSelectMode&&i.allowEditMode},("select"===i.defaultMode&&!i.allowSelectMode||"edit"===i.defaultMode&&!i.allowEditMode)&&(i.defaultMode="create"),i.editingLayer=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Drawing"}}]),Object(m["a"])(t,[{key:"activate",value:function(){Se(b(t.prototype),"activate",this).call(this)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.layerEditor.deactivate()}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0;var i=Wh.clone();this.options.style&&i.assign(new gt(this.options.style)),this.editingLayer=new _n({altitudeMode:"clampToGround",projection:R.createMercatorProjection(),style:i,isDynamic:!0}),this.framework.addLayer(this.editingLayer),this.editingLayer.activate(!0),this.layerEditor=new kl({geometryLayerEditor:{allowEditMode:this.allowEditMode,defaultMode:this.defaultMode,allowedGeometries:this.allowedGeometries},featureLayerEditor:{allowSelectMode:this.allowSelectMode},styleLayerEditor:{}}),this.layerEditor.initialize(),this.layerEditor.addEditingLayer(this.editingLayer),this.initializedFinished()}return!0}},{key:"getConfigObject",value:function(){var e=Wh.clone();return this.options.style&&e.assign(new gt(this.options.style)),{allowedGeometries:this.allowedGeometries,allowSelectMode:this.allowSelectMode,allowEditMode:this.allowEditMode,defaultMode:this.defaultMode,simpleStyleUi:this.editorOptions.simpleStyleUi,hideHelp:this.editorOptions.hideHelp,hideExport:this.editorOptions.hideExport,hideAltitudeMode:this.editorOptions.hideAltitudeMode,style:e.getOptions()}}}]),t}(ra),Jh=qh,Kh=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.showFreeFormCrsInput=Object(u["e"])(e.showFreeFormCrsInput,!1),i.dataProjection=e.dataProjection?new R(e.dataProjection):i.framework.projection;var n=i.dataProjection?i.dataProjection.epsg:"";i.coordinateSystem=e.coordinateSystem||n,i.heightMode=e.heightMode||"absolute",i.formatOptions=e.formats||["2D Shape","3D Shape - PolygonZ","3D Shape - Multipatch","CityGML","KMZ","DXF","DWG","3DS","ESRI FGDB","SketchUp","OBJ","3DPDF","VRML","FMEAR"],i.formatsWithTextures=["CityGML","3DS","SketchUp","OBJ","3DPDF","VRML","FMEAR"],i.lodOptions=e.lod||["LoD1","LoD2","LoD3","LoD4","haLoD"],i.citygmlclassesOptions=e.citygmlclasses||["26","7","16","5","21","85","64","45","43","46","8","9","4"],i.appearanceThemesOptions=e.appearanceThemes||["rgbTexture"],i.maxArea=Object(u["h"])(e.maxarea,2e6),i.useTokenSecurity=null==e.useTokenSecurity||e.useTokenSecurity,i.serverUrl=e.serverUrl||"http://fmeserver/fmedatadownload/Repository/workbench.fmw",i.securityToken=e.securityToken&&""!==e.securityToken?e.securityToken:null,i.tokenUrl=e.tokenUrl||"http://fmeserver/fmetoken/service/generate.json",i.token=null,i.fmeuser=e.fmeuser?e.fmeuser:"publicuser",i.fmepassword=e.fmepassword?e.fmepassword:"publicuser";var r=vt.clone();return e.style&&r.assign(new gt(e.style)),i._layerOptions={projection:R.createMercatorProjection(),name:"_exportLayer",classificationType:e.classificationType||"both",altitudeMode:"clampToGround",style:r},i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"],i.singleFeatureId=Object(u["c"])(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Export"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;if(!this.initialized){var i=Se(b(t.prototype),"initialize",this).call(this);if(!i)return!1;this.geometryLayer=new _n(this._layerOptions),this.framework.addLayer(this.geometryLayer),this.layerEditor=new hl({allowedGeometries:["Polygon","BBox"],defaultMode:"edit"}),this.layerEditor.initialize(),this.layerEditor.addEditingLayer(this.geometryLayer),this.fmeAuthenticate().then(function(t){var i=t.data;if(i)try{e.token=i.serviceResponse.token}catch(n){return Promise.reject(n)}return e.initialized=!0,e.initializedFinished(),Promise.resolve()}).catch(function(t){e.logger.warning("Could not authentificate FME : ".concat(t))})}return!0}},{key:"fmeAuthenticate",value:function(){if(this.useTokenSecurity&&null==this.securityToken){this.logger.deprecate("user/password","Use a security token. Future versions of the vcMAP may no longer support this.");var e="".concat(this.tokenUrl,"?user=").concat(this.fmeuser,"&password=").concat(this.fmepassword,"&expiration=1&timeunit=day");return ce.a.get(e)}return null!=this.securityToken?(this.token=this.securityToken,Promise.resolve()):Promise.reject(new Error("Missing security token"))}},{key:"prepareRequestAndSend",value:function(e,t,i){if(this.useTokenSecurity&&!this.token&&!i)throw new Error("i18n_export_authentification_error");if(!e.cityGmlClasses||0===e.cityGmlClasses.length)throw new Error("i18n_export_themclass_error");var n={COORD_SYS:e.crs||(Array.isArray(this.coordinateSystem)?this.coordinateSystem[0]:this.coordinateSystem),HEIGHT_MODE:this.heightMode,TOKEN:i||this.token,OPT_SERVICEMODE:"async"};if(n.EXPORT_FORMAT=e.format,n.THEM_CLASS=e.cityGmlClasses.map(function(e){return e.value}),n.TEXTURE=e.texture?"Yes":"No",n.APP_THEME=e.appearance||"none",n.LOD_SELECTION=e.level,e.useFeatureGeometry){n.SELECTION="Polygon";var r=this.geometryLayer.getFeatureById(this.singleFeatureId);if(!r)throw new Error("i18n_export_geometry_error");var a=r.getGeometry();if(!a||"Polygon"!==a.getType())throw new Error("i18n_export_geometry_error");if(null!=this.maxArea){var s=a.getArea();if(s>this.maxArea)throw new Error("i18n_export_maxArea_error")}a=a.clone(),a.transform(R.createMercatorProjection().proj,this.dataProjection.proj);var o=a.getCoordinates()[0];n.POLYGON=o.map(function(e){var t=Object(Ie["a"])(e,2),i=t[0],n=t[1];return"".concat(i,",").concat(n)}).join(";")}else{var l=this.framework.getSelectBehavior();if(l.getSizeOfSelectionSet()<=0)throw new Error("i18n_export_feature_error");n.SELECTION="Einzelobjekte",n.GMLID=l.getSelectionSet()}if(!Object(u["d"])(e.email))throw new Error("i18n_export_email_error");n.OPT_REQUESTEREMAIL=e.email;var c=Object.keys(n).map(function(e){return"".concat(e,"=").concat(encodeURIComponent(n[e]))}).join("&"),h=t||this.serverUrl;return ce.a.post(h,c,{headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}})}},{key:"getFormatOptions",value:function(){return this.logger.deprecate("getFormatOptions","use .formatOptions instead"),this.formatOptions}},{key:"getLodOptions",value:function(){return this.logger.deprecate("getFormatOptions","use .lodOptions instead"),this.lodOptions}},{key:"getCitygmlClassOptions",value:function(){var e={26:"Building",7:"SolitaryVegetationObjects",5:"GenericCityObject",21:"CityFurniture",16:"ReliefFeature",85:"Tunnel",64:"Bridge",45:"Road",43:"Track",46:"Square",8:"Plant Cover",9:"WaterBody",4:"LandUse"},t={85:!0,64:!0,45:!0,43:!0,46:!0,8:!0,9:!0,4:!0};return this.citygmlclassesOptions.map(function(i){return{value:i,title:e[i],citygmlOnly:t[i]}})}},{key:"getTexturedFormats",value:function(){return this.logger.deprecate("getFormatOptions","use .formatsWithTextures instead"),this.formatsWithTextures}},{key:"getAppearanceThemes",value:function(){return this.logger.deprecate("getFormatOptions","use .appearanceThemesOptions instead"),this.appearanceThemesOptions}},{key:"deactivate",value:function(){this.active&&(Se(b(t.prototype),"deactivate",this).call(this),this.framework.getSelectBehavior().deactivateClickBehavior())}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.formats=this.formatOptions,e.coordinateSystem=this.coordinateSystem,e.heightMode=this.heightMode,e.lod=this.lodOptions,e.citygmlclasses=this.citygmlclassesOptions,e.appearanceThemes=this.appearanceThemesOptions,e.maxarea=this.maxArea,e.useTokenSecurity=this.useTokenSecurity,e.serverUrl=this.serverUrl,e.tokenUrl=this.tokenUrl,e.fmeuser=this.fmeuser,e.fmepassword=this.fmepassword,e.serverUrl=this.serverUrl,e}}]),t}(ra),Zh=Kh,Qh=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.layers=new Set,i._setLayers(e.layerTypes,e.layers,e.excludedLayers),i.headerTemplate=e.headerTemplate?i._makeHeaderTemplate(e.headerTemplate):null,i.itemTemplate=e.itemTemplate||null,i.itemTemplate||(i.itemTemplate=["<div class='ui-listview-list-column-2 ui-listview-list-data-cell'>","<span class='ui-listview-list-data-cell-value'><%= data.feature.properties.name %>","<% if(data.feature.properties.website){ %>","<br><a href='<%= data.feature.properties.website %>' target='_blank'><%= data.feature.properties.website %></a>","<% } %>","</span>","</div>","<div class='ui-listview-list-column-3 ui-listview-list-data-cell'>","<span class='ui-listview-list-data-cell-value'><%= data.feature.properties.street %><br><%= data.feature.properties.zip %> <%= data.feature.properties.city %></span>","</div>"]),Array.isArray(i.itemTemplate)&&(i.itemTemplate=i.itemTemplate.join("")),i.layerTemplateMap={},Array.isArray(e.layerTemplates)&&e.layerTemplates.forEach(i._setLayerTemplates,f(i)),i.queryProperties=e.queryProperties||["name"],i.values={currentHeader:i.headerTemplate,query:!0},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.FeatureList"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;var i=function e(t){t.children?t.children.forEach(e,this):this.layers.has(t.layerName)&&(t.hasFeatureListView=!0)},n=this.framework.getWidgetsByType(Fa.className)[0];n&&n.cluster.forEach(i,this),this.initialized=!0,this.initializedFinished()}}},{key:"_setLayers",value:function(e,t,i){e&&this.framework.getLayers().filter(function(t){return e.includes(t.className)&&!/^_/.test(t.name)}).forEach(function(e){this.layers.add(e.name)},this),t&&t.forEach(function(e){this.layers.add(e)},this),i&&i.forEach(function(e){this.layers.delete(e)},this)}},{key:"_setLayerTemplates",value:function(e){var t=e.layers,i=e.itemTemplate,n=e.headerTemplate;i=Array.isArray(i)?i.join(""):i;var r={item:i,header:n?this._makeHeaderTemplate(n):this.headerTemplate,queryProperties:e.queryProperties||this.queryProperties};t.filter(function(e){return this.layers.has(e)},this).forEach(function(e){this.layerTemplateMap[e]=r},this)}},{key:"_makeHeaderTemplate",value:function(e){return Array.isArray(e)?e.join(""):("object"===Object(s["a"])(e)&&(e=e,Object.keys(e).forEach(function(t){e[t]=Array.isArray(e[t])?e[t].join(""):e[t]})),e)}},{key:"getItems",value:function(e){if(!this.layers.has(e))return this.logger.warning("Could not render listview for layer ".concat(e,". Please check your configuration.")),null;var t=this.framework.getLayerByName(e),i=t.getFeatures(),n=this.layerTemplateMap[e]?this.layerTemplateMap[e]:{item:this.itemTemplate,header:this.headerTemplate,queryProperties:this.queryProperties};this.values.currentHeader=n.header,this.values.query=!!n.queryProperties.length;var r=i.map(function(e){var t=e.getProperties();return delete t[e.getGeometryName()],{id:e.getId(),properties:t,query:n.queryProperties.reduce(function(t,i){var n=e.get(i);return null!=n?t+" "+n.toString():t},"")}});return r.map(function(e,t){return{template:Dr()(n.item)({data:{featureCount:t+1,feature:e}}),id:e.id,query:e.query}})}}]),t}(ra),Xh=Qh,$h={DISTANCE:"distance",AREA:"area",VERTICAL_HEIGHT:"verticalHeight",OBLIQUE_HEIGHT:"obliqueHeight",OBLIQUE_DISTANCE:"obliqueDistance",POINT:"point",CARTESIAN_DISTANCE:"cartesianDistance",CARTESIAN_AREA:"cartesianArea"},ed=function(){function e(t){Object(d["a"])(this,e),this.parent=t.parent,this.decimalPlaces=this.parent.decimalPlaces,this.map=ne.getInstance().getActiveMap(),this.featureIds=[],this.forceMove=null!=t.forceMove?t.forceMove:null,this.values={type:t.type,isValid:!1}}return Object(m["a"])(e,null,[{key:"measurementType",get:function(){return $h.DISTANCE}}]),Object(m["a"])(e,[{key:"_createFeature",value:function(e){if(this.feature=this.parent.geometryEditor.createFeature(e.geometryType),e.isAbsolute?this.feature.set("olcs_altitudeMode","absolute",!0):this.feature.set("olcs_altitudeMode","clampToGround",!0),e.startPosition){var t=this.feature.getGeometry();t instanceof ol.geom.LineString?t.setCoordinates([e.startPosition]):t instanceof ol.geom.Polygon?t.setCoordinates([[e.startPosition]]):t instanceof ol.geom.Point&&t.setCoordinates(e.startPosition)}e.addFeatureStyle&&(this.feature[ft]=this.parent.featureLayer.style.clone(),this.feature.setStyle(this.feature[ft].style)),this.map instanceof Pi?(this.feature[_n.obliqueGeometry].on("change",this.geometryChangedCallback.bind(this)),this.feature[_n.doNotTransform]=!0):this.feature.getGeometry().on("change",this.geometryChangedCallback.bind(this));var i=tn.CREATE;e.startPosition&&"Point"===e.geometryType&&(this.feature.getGeometry().changed(),i=tn.EDIT),this.parent.geometryEditor.setModeAndSelectFeature(i,this.feature),this.id=this.feature.getId().toString(),this.featureIds.push(this.id)}},{key:"geometryChangedCallback",value:function(e){}},{key:"getValue",value:function(e,t){var i=Math.abs(e),n=t?2:1,r=t?"m²":"m",a=Math.pow(1e3,n);return i>a*(t?1:10)&&(i/=a,r="k".concat(r)),"".concat(i.toFixed(this.decimalPlaces)," ").concat(r)}},{key:"addLabel",value:function(){var e=rl.Point(),t=new ol.Feature({geometry:e});return this.map instanceof Pi&&(e[_n.alreadyTransformedToImage]=!0,t[_n.doNotTransform]=!0),t.setStyle(new ol.style.Style({text:this.parent.featureLayer.style.text.clone()})),this.parent.featureLayer.addFeatures([t]),t[this.parent.geometryEditor.state.featureTypeSymbol]=0,this.featureIds.push(t.getId()),t}},{key:"destroy",value:function(){this.parent.featureLayer.removeFeaturesById(this.featureIds)}}],[{key:"setTextOnLabel",value:function(e,t){e.getStyle().getText().setText(t)}}]),e}(),td=ed,id=new ol.Sphere(6378137),nd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=e.type||t.measurementType,i=y(this,b(t).call(this,e)),i.segmentDistance=[],i.values.distance="0",i.values.estimate=!1,i.label=i.addLabel(),i._createFeature({geometryType:"LineString",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.DISTANCE}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=this,i=e.target.getCoordinates(),n=i.length;if(n>1&&(i[0][0]!==i[1][0]||i[0][1]!==i[1][1])){this.values.isValid=this.values.isValid||n>2,this.label.getGeometry().setCoordinates(i[n-1]);var r,a=Promise.resolve([]);if(this.map instanceof Pi){r=new Array(n);var s=i.map(function(e,i){return Object(Bt["e"])(t.map.activeLayer.currentImage,e,{dataProjection:ol.proj.get("EPSG:4326")}).then(function(e){r[i]=e.coords,t.values.estimate=e.estimate})});a=Promise.all(s)}else{for(var o=0;o<n;o++)R.mercatorToWgs84(i[o],!0);r=i}return a.then(function(){var e=t.calculateDistance(r);t.setValueAndLabel(e)})}return this.values.isValid&&this.parent.removeMeasurement(this),null}},{key:"calculateDistance",value:function(e){var t=e.length;this.segmentDistance=new Array(t-1);for(var i=0,n=1;n<t;n++)this.segmentDistance[n-1]=id.haversineDistance(e[n-1],e[n]),i+=this.segmentDistance[n-1];return i}},{key:"setValueAndLabel",value:function(e){this.values.distance=this.getValue(e),td.setTextOnLabel(this.label,this.values.distance),this.label.changed()}}]),t}(td),rd=nd,ad=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.values.area="0",i.values.circumference="0",i.label=i.addLabel(),i._createFeature({geometryType:"Polygon",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.AREA}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates()[0],n=i.length,r=0;if(n>2){this.values.isValid=this.values.isValid||n>3;for(var a=0;a<n;a++)R.mercatorToWgs84(i[a],!0),a&&(r+=id.haversineDistance(i[a-1],i[a])),a===n-1&&(r+=id.haversineDistance(i[a],i[0]));this.values.area=this.getValue(id.geodesicArea(i),!0),this.values.circumference=this.getValue(r),td.setTextOnLabel(this.label,this.values.area),this.label.setGeometry(t.getInteriorPoint())}else this.values.isValid&&this.parent.removeMeasurement(this)}}]),t}(td),sd=ad,od=new Cesium.Cartographic,ld=new Cesium.Cartesian3,cd=[{key:"height",indices:[0,1]},{key:"horizontal",indices:[1,2]},{key:"distance",indices:[0,2]}],ud={horizontal:0,height:0,distance:0},hd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.triangleFeature=new ol.Feature({geometry:rl.LineString(),olcs_altitudeMode:"absolute"}),i.parent.featureLayer.addFeatures([i.triangleFeature]),i.triangleFeature[i.parent.geometryEditor.state.featureTypeSymbol]=0,i.featureIds.push(i.triangleFeature.getId()),i.cartesians=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],i.labels={height:i.addLabel(),horizontal:i.addLabel(),distance:i.addLabel()},i.values.height="0",i.values.horizontal="0",i.values.distance="0",i.values.alpha="0",i.values.beta="0",Object.values(i.labels).forEach(function(e){e.set("olcs_altitudeMode","absolute")}),i._createFeature({geometryType:"LineString",isAbsolute:!0,startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.VERTICAL_HEIGHT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates();if(!this.values.isValid&&i.length>2&&(this.values.isValid=!0),this.values.isValid){if(this.parent.geometryEditor.state.mode===tn.CREATE&&this.parent.geometryEditor.setMode(tn.EDIT),i.length<2)return void this.parent.removeMeasurement(this);var n=i[0][2]<i[1][2]?0:1,r=i[n].slice();r[2]=i[n?0:1][2];var a=[i[n],r,i[n?0:1]];this.triangleFeature.getGeometry().setCoordinates(a);for(var s=0;s<3;s++)R.mercatorToWgs84(a[s],!0),Cesium.Cartesian3.fromDegrees(a[s][0],a[s][1],a[s][2],void 0,this.cartesians[s]);for(var o=0;o<3;o++){var l=cd[o],c=l.key,u=l.indices,h=Cesium.Cartesian3.distance(this.cartesians[u[0]],this.cartesians[u[1]]);ld=Cesium.Cartesian3.lerp(this.cartesians[u[0]],this.cartesians[u[1]],.5,ld),od=Cesium.Cartographic.fromCartesian(ld,void 0,od),ud[c]=h,this.values[c]=this.getValue(h),td.setTextOnLabel(this.labels[c],this.values[c]),this.labels[c].getGeometry().setCoordinates(R.wgs84ToMercator([Cesium.Math.toDegrees(od.longitude),Cesium.Math.toDegrees(od.latitude),od.height]))}var d=Cesium.Math.toDegrees(Math.asin(ud.horizontal/ud.distance)),m=90-d;this.values.alpha="".concat(d.toFixed(this.decimalPlaces),"°"),this.values.beta="".concat(m.toFixed(this.decimalPlaces),"°")}}}]),t}(td),dd=hd,md=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.values.x="0",i.values.y="0",i.values.z="0",i.values.estimate=!1,i.transformer=R.getTransformer(ne.getInstance().getProjection(),R.createMercatorProjection()),i.map instanceof Vt?i._callback=i.setCoords.bind(f(i),!0):i.map instanceof Hi?(i._callback=i.setCoords.bind(f(i),!1),delete i.values.z):i.map instanceof Pi&&(i._callback=i.setFromObliqueCoords.bind(f(i))),i.geometryCreated=!!e.startPosition,i._createFeature({geometryType:"Point",isAbsolute:!0,addFeatureStyle:!0,startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.POINT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){if(this._callback&&this.geometryCreated){var t=e.target.getCoordinates();this.values.isValid=!0,this._callback(t)}else this.geometryCreated=!0}},{key:"setCoords",value:function(e,t){this.transformer(t,t,3),this.values.x=t[0].toFixed(this.decimalPlaces),this.values.y=t[1].toFixed(this.decimalPlaces);var i="".concat(this.values.x,", ").concat(this.values.y);if(e){var n=this.getValue(t[2]);this.values.z=n,i="".concat(i,", ").concat(n)}this.feature[ft].label="(".concat(i,")"),this.feature.changed()}},{key:"setFromObliqueCoords",value:function(e){var t=this;return Object(Bt["e"])(this.map.activeLayer.currentImage,e,{dataProjection:R.createMercatorProjection().getProjection()}).then(function(e){t.values.estimate=e.estimate,t.setCoords(!e.estimate,e.coords)})}}]),t}(td),fd=md,yd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,e.forceMove=!0,i=y(this,b(t).call(this,e)),i.values.height="0",i.values.estimate=!1,i.map=i.map,i.startUndistorted=null,i.startDistorted=null,i.liftedUndistorted=null,i.measureVecGround=new Cesium.Cartesian3,i.measureVecOrientation=new Cesium.Cartesian3,i.set=!1,i.onHold=!1,i.selfCall=!1,i.label=i.addLabel(),i._createFeature({geometryType:"LineString",startPosition:e.startPosition}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.OBLIQUE_HEIGHT}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=this;if(this.selfCall)this.selfCall=!1;else if(!this.onHold){var i=e.target.getCoordinates();if(this.values.isValid){if(this.parent.geometryEditor.state.mode===tn.CREATE)return void this.parent.geometryEditor.setMode(tn.EDIT);if(i.length<2)return void this.parent.removeMeasurement(this)}var n=this.map.activeLayer,r=n.currentImage.camera;if(this.set||2!==i.length){if(this.set){3!==i.length||this.values.isValid||(this.parent.geometryEditor.setMode(tn.EDIT),this.values.isValid=!0);var a=r.radialDistortionCoordinate(i[1],!0),s=[[a[0],a[1]],[a[0]+1,a[1]]],o=Object(Bt["b"])(s,[this.startUndistorted,this.liftedUndistorted]),l=[o.x,o.y],c=r.radialDistortionCoordinate(l,!1),u=new Cesium.Cartesian3(l[0],l[1],0),h=Cesium.Cartesian3.subtract(u,this.measureVecGround,new Cesium.Cartesian3);h=Cesium.Cartesian3.normalize(h,h);var d,m=Cesium.Cartesian3.dot(this.measureVecOrientation,h);if(this.selfCall=!0,m<0||Number.isNaN(m))this.values.height=this.getValue(0),d=[this.startDistorted,this.startDistorted];else{var f=this.findVertical3DPositionRegardingPixel(l,this.startPointRealWorld);this.values.height=this.getValue(ai(this.startPointRealWorld,f)),d=[this.startDistorted,c]}td.setTextOnLabel(this.label,this.values.height),this.label.getGeometry().setCoordinates(d[1]),this.feature.getGeometry().setCoordinates(d),this.parent.geometryEditor.geometryEditor.vertices[0].getGeometry().setCoordinates(d[0]),this.parent.geometryEditor.geometryEditor.vertices[1].getGeometry().setCoordinates(d[1])}}else this.onHold=!0,this.startUndistorted=r.radialDistortionCoordinate(i[0],!0),this.startDistorted=i[0].slice(),this.measureVecGround=Cesium.Cartesian3.fromElements(this.startUndistorted[0],this.startUndistorted[1],0,this.measureVecGround),Object(Bt["e"])(n.currentImage,i[0]).then(function(e){t.startPointRealWorld=e.coords,t.values.estimate=e.estimate;var i=e.coords.slice();return i[2]+=10,Object(Bt["f"])(n.currentImage,i)}).then(function(e){t.liftedUndistorted=r.radialDistortionCoordinate(e.coords,!0);var i=Cesium.Cartesian3.fromElements(t.liftedUndistorted[0],t.liftedUndistorted[1],0);t.onHold=!1,t.set=!0,t.measureVecOrientation=Cesium.Cartesian3.subtract(i,t.measureVecGround,t.measureVecOrientation),t.measureVecOrientation=Cesium.Cartesian3.normalize(t.measureVecOrientation,t.measureVecOrientation),t.selfCall=!0,t.feature.getGeometry().setCoordinates([t.startDistorted,t.startDistorted])})}}},{key:"findVertical3DPositionRegardingPixel",value:function(e,t){var i=this.map.getCurrentImage(),n=new Cesium.Cartesian3(e[0],i.size[1]-e[1],1);n=Cesium.Matrix3.multiplyByVector(i.pToRealworld,n,n);var r=new Cesium.Cartesian3(0,0,1),a=Cesium.Cartesian3.cross(r,n,new Cesium.Cartesian3),s=Cesium.Cartesian3.fromArray(t),o=Cesium.Cartesian3.subtract(i.projectionCenter,s,new Cesium.Cartesian3),l=Cesium.Matrix3.fromRowMajorArray([r.x,n.x,a.x,r.y,n.y,a.y,r.z,n.z,a.z]);l=Cesium.Matrix3.inverse(l,l);var c=Cesium.Matrix3.multiplyByVector(l,o,new Cesium.Cartesian3);return a=Cesium.Cartesian3.multiplyByScalar(a,c.z,a),r=Cesium.Cartesian3.multiplyByScalar(r,c.x,r),r=Cesium.Cartesian3.add(r,a,r),s=Cesium.Cartesian3.add(s,r,s),[s.x,s.y,s.z]}}]),t}(td),gd=yd,vd=function(e){function t(e){return Object(d["a"])(this,t),e.type=t.measurementType,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.OBLIQUE_DISTANCE}}]),t}(rd),pd=vd,_d=new Cesium.Cartesian3,bd=new Cesium.Cartesian3,Ld=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,i=y(this,b(t).call(this,e)),i.segmentDistance=[],i.values.distance="0",i.label=i.addLabel(),i.label.set("olcs_altitudeMode","absolute"),i._createFeature({geometryType:"LineString",startPosition:e.startPosition,isAbsolute:!0}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.CARTESIAN_DISTANCE}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target.getCoordinates(),i=t.length;if(i>1&&(t[0][0]!==t[1][0]||t[0][1]!==t[1][1])){this.values.isValid=this.values.isValid||i>2,this.label.getGeometry().setCoordinates(t[i-1]),this.segmentDistance=new Array(i-1);var n=0;R.mercatorToWgs84(t[0],!0),_d=Cesium.Cartesian3.fromDegrees(t[0][0],t[0][1],t[0][2],void 0,_d);for(var r=1;r<i;r++)R.mercatorToWgs84(t[r],!0),bd=Cesium.Cartesian3.fromDegrees(t[r][0],t[r][1],t[r][2],void 0,bd),this.segmentDistance[r-1]=Cesium.Cartesian3.distance(_d,bd),n+=this.segmentDistance[r-1],_d=bd.clone(_d);this.values.distance=this.getValue(n),td.setTextOnLabel(this.label,this.values.distance),this.label.changed()}else this.values.isValid&&this.parent.removeMeasurement(this)}}]),t}(td),Md=Ld,kd=new Cesium.Cartesian3,wd=new Cesium.Cartesian3,Td=function(e){function t(e){var i;return Object(d["a"])(this,t),e.type=t.measurementType,e.forceMove=!1,i=y(this,b(t).call(this,e)),i.values.area="0",i.values.circumference="0",i.label=i.addLabel(),i.label.set("olcs_altitudeMode","absolute"),i.label.set("olcs_zCoordinateEyeOffset",-10),i._createFeature({geometryType:"Polygon",startPosition:e.startPosition,isAbsolute:!0}),i}return w(t,e),Object(m["a"])(t,null,[{key:"measurementType",get:function(){return $h.CARTESIAN_AREA}}]),Object(m["a"])(t,[{key:"geometryChangedCallback",value:function(e){var t=e.target,i=t.getCoordinates()[0],n=i.length,r=0;if(this.values.isValid&&i.length<3)this.parent.removeMeasurement(this);else if(n>3||this.values.isValid){this.values.isValid=!0;for(var a=new Array(n),s=new Array(n),o=i[0][2],l=0,c=0;c<n;c++)o=i[c][2]>o?i[c][2]:o,R.mercatorToWgs84(i[c],!0),a[c]=Cesium.Cartesian3.fromDegrees(i[c][0],i[c][1],i[c][2]),s[c]=Cesium.Cartesian2.fromCartesian3(a[c]),c&&(l+=Cesium.Cartesian3.distance(a[c-1],a[c]));l+=Cesium.Cartesian3.distance(a[n-1],a[0]);for(var u=Cesium.PolygonPipeline.triangulate(s),h=u.length,d=0;d<h;d+=3){var m=u[d],f=u[d+1],y=u[d+2];kd=Cesium.Cartesian3.subtract(a[m],a[f],kd),wd=Cesium.Cartesian3.subtract(a[m],a[y],wd),kd=Cesium.Cartesian3.cross(kd,wd,kd),r+=Cesium.Cartesian3.magnitude(kd)/2}this.values.area=this.getValue(r,!0),this.values.circumference=this.getValue(l),td.setTextOnLabel(this.label,this.values.area);var g=t.getInteriorPoint().getCoordinates();g[2]=o,this.label.getGeometry().setCoordinates(g)}}}]),t}(td),Sd=Td,Od=(Ru={},Object(oe["a"])(Ru,rd.measurementType,rd),Object(oe["a"])(Ru,sd.measurementType,sd),Object(oe["a"])(Ru,dd.measurementType,dd),Object(oe["a"])(Ru,fd.measurementType,fd),Object(oe["a"])(Ru,gd.measurementType,gd),Object(oe["a"])(Ru,pd.measurementType,pd),Object(oe["a"])(Ru,Md.measurementType,Md),Object(oe["a"])(Ru,Sd.measurementType,Sd),Ru),Cd=["distance","cartesianDistance","cartesianArea","area","point","verticalHeight","obliqueDistance","obliqueHeight"],Ed=new gt({image:{fill:{color:[244,67,54,.8]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:[244,67,54,1],width:3},fill:{color:[244,67,54,.8]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),Id=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=e.className||t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium","vcs.vcm.maps.Openlayers"];var n=Ed.clone();return e.style&&n.assign(new gt(e.style)),i.featureLayer=new _n({style:n,altitudeMode:"clampToGround",zCoordinateEyeOffset:-20}),i.geometryEditor=null,i.decimalPlaces=null!=e.decimalPlaces?e.decimalPlaces:1,i.allowedMeasurements=e.allowedMeasurements||Cd,(i.allowedMeasurements.includes("obliqueDistance")||i.allowedMeasurements.includes("obliqueHeight"))&&i.supportedMaps.push("vcs.vcm.maps.Oblique"),i.supportedMeasurements=[],i.useCartesianIn3D=null!=e.useCartesianIn3D&&e.useCartesianIn3D,i.measurements=new Map,i._defaultTransformOnMove=Q.getInstance().transformGeometryOnMove,i._transformOnMove=i._defaultTransformOnMove,i.obliqueListener=null,i.state=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Measurement"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.geometryEditor=new hl({allowedGeometries:["LineString","Polygon","Point"],defaultMode:"edit",dedicatedFeatureStyle:!1}),this.state={activeMeasurementId:null,editorState:this.geometryEditor.state,measurementsSize:0},this.framework.addLayer(this.featureLayer),this.handleMapChangeEvent(this.framework.getActiveMap()),this.geometryEditor.initialize(),this.geometryEditor.addEditingLayer(this.featureLayer),this._transformOnMove=Q.getInstance().transformGeometryOnMove,this.geometryEditor.selectFeatureInteraction.onSelect(this.onSelect.bind(this)),this.initialized=!0}return!0}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),this.active&&this.geometryEditor.setMode(tn.NONE),this.supportedMeasurements.splice(0),this._transformOnMove=this._defaultTransformOnMove,this.clearMeasurements(),e instanceof Hi?(this.supportedMeasurements.push(rd.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(sd.measurementType)):e instanceof Vt?(this.supportedMeasurements.push(Md.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(Sd.measurementType),this.supportedMeasurements.push(dd.measurementType),this.useCartesianIn3D||(this.supportedMeasurements.push(rd.measurementType),this.supportedMeasurements.push(sd.measurementType))):e instanceof Pi&&(this._transformOnMove=!1,this.obliqueListener||(this.obliqueListener=this.framework.subscribe("OBLIQUE_IMAGE_CHANGED",this.obliqueImageChangeHandler.bind(this))),this.supportedMeasurements.push(pd.measurementType),this.supportedMeasurements.push(fd.measurementType),this.supportedMeasurements.push(gd.measurementType))}},{key:"checkObliqueMeasurementIsSupported",value:function(e,t){if(e.camera&&!this.supportedMeasurements.includes(t))this.supportedMeasurements.push(t);else if(!e.camera&&this.supportedMeasurements.includes(t)){var i=this.supportedMeasurements.indexOf(t);this.supportedMeasurements.splice(i,1)}}},{key:"obliqueImageChangeHandler",value:function(e,t){this.checkObliqueMeasurementIsSupported(t,gd.measurementType),this.checkObliqueMeasurementIsSupported(t,pd.measurementType),this.clearMeasurements()}},{key:"activate",value:function(){return Se(b(t.prototype),"activate",this).call(this),this.geometryEditor.activate(),this.featureLayer.activate(!0)}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.geometryEditor.deactivate()}},{key:"createMeasurement",value:function(e,t){if(this.state.activeMeasurementId){var i=this.measurements.get(this.state.activeMeasurementId);i.values.isValid||this.removeMeasurement(i)}var n=Od[e],r=new n({parent:this,startPosition:t,defaultTransformOnMove:this._transformOnMove});this.measurements.set(r.id,r),this.state.activeMeasurementId=r.id,this.state.measurementsSize=this.measurements.size,this._setTransformOnMove(r)}},{key:"_setTransformOnMove",value:function(e){this.geometryEditor.state.transformGeometryOnMove=e&&null!==e.forceMove?e.forceMove:this._transformOnMove,this.geometryEditor.state.onlyAllowTranslation=e&&(e.values.type===dd.measurementType||e.values.type===gd.measurementType)}},{key:"removeMeasurement",value:function(e){e.destroy(),this.state.activeMeasurementId===e.id&&(this.state.activeMeasurementId=null),this.measurements.delete(e.id),this.state.measurementsSize=this.measurements.size}},{key:"clearMeasurements",value:function(){this.measurements.forEach(function(e){e.destroy()}),this.measurements.clear(),this.state.measurementsSize=this.measurements.size,this.activeMeasurement=null,this.state.activeMeasurementId=null}},{key:"onSelect",value:function(){if(this.geometryEditor.features.size){this.state.activeMeasurementId=this.geometryEditor.state.selectedFeatureId;var e=this.measurements.get(this.state.activeMeasurementId);this._setTransformOnMove(e)}else this.state.activeMeasurementId=null}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.style=this.featureLayer.style.getOptions(),e.decimalPlaces=this.decimalPlaces,this.allowedMeasurements!==Cd&&(e.allowedMeasurements=this.allowedMeasurements),e}}]),t}(ra),Dd=Id,jd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,e.allowedMeasurements=e.allowedMeasurements||["distance","cartesianDistance","verticalHeight","obliqueHeight"],i=y(this,b(t).call(this,e)),i.state=i.state,i.mapClickListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.SingleMeasurement"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.state=this.state,this.state.activeSingleMeasurementType=null}return!0}},{key:"createMeasurement",value:function(e,i){var n=this;this.clearMeasurements(),Se(b(t.prototype),"createMeasurement",this).call(this,e,i),this.state.activeSingleMeasurementType=e,this.mapClickListener&&this.framework.unsubscribeByKey(this.mapClickListener),this.mapClickListener=this.framework.subscribeOnce("CLICKED",function(t){if(n.active){var i=n.framework.getActiveMap()instanceof Pi?t.obliqueParameters.pixel:R.wgs84ToMercator([t.longitude,t.latitude,t.height]);n.createMeasurement(e,i)}})}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.mapClickListener&&(this.framework.unsubscribeByKey(this.mapClickListener),this.mapClickListener=null),this.featureLayer.activate(!1),this.clearMeasurements()}}]),t}(Dd),Pd=jd,Yd={north:"moveForward",south:"moveBackward",west:"moveLeft",east:"moveRight",increaseFOV:"increaseFOV",decreaseFOV:"decreaseFOV",up:"moveUp",down:"moveDown",tiltUp:"tiltUp",tiltDown:"tiltDown",rotateEast:"rotateEast",rotateWest:"rotateWest"},xd=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.zoomFactor=Object(u["g"])(e.zoomFactor,2),i.moveFactor=Object(u["g"])(e.moveFactor,1.5),i.tiltFactor=Object(u["g"])(e.tiltFactor,10),i.walkModeMoveFactor=Object(u["g"])(e.walkModeMoveFactor,1),i.animationDuration=Object(u["g"])(e.animationDuration,.5),i.animation=null==e.animation||e.animation,i.showZoomButtons=null==e.showZoomButtons||e.showZoomButtons,i.showTiltButtons=null==e.showTiltButtons||e.showTiltButtons,i.showCompass=null==e.showCompass||e.showCompass,i.showHomeButton=null==e.showHomeButton||e.showHomeButton,i.pedestrianMode=null==e.pedestrianMode||e.pedestrianMode,i.pedestrianModeReferenceHeight=Object(u["g"])(e.pedestrianModeReferenceHeight,1.6),i.obliqueMoveImage=null==e.obliqueMoveImage||e.obliqueMoveImage,i.obliqueMoveImageDirectionDeviation=Object(u["g"])(e.obliqueMoveImageDirectionDeviation,Math.PI/4),i.rotationPerFrame=Object(u["g"])(e.rotationPerFrame,.5),i.timePerRotation=Object(u["g"])(e.timePerRotation,20),!e.timePerRotation&&e.rotationPerFrame&&(i.timePerRotation=6/i.rotationPerFrame),i.initializedForCesium=!1,i.initializedForOpenlayers=!1,i.initializedForOblique=!1,i.rotationActive=!1,i.tapedTwice=!1,i.navigationMode=Pe.getInstance(),i.navigationMode.setOptions({referenceHeight:i.pedestrianModeReferenceHeight,moveFactor:i.walkModeMoveFactor}),i.mapClickListenerKey=null,i.values={heading:0,walkmode:!1,rotation:!1,pedestrianMode:i.pedestrianMode,referenceHeight:i.pedestrianModeReferenceHeight,active:!1},i.navigationMode.setValues(i.values),i._navigationModeFlags=t.navigationModeFlags,i._obliqueMoving=!1,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.NavigationControls"}},{key:"navigationModeFlags",get:function(){return Yd}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return;document.addEventListener("keydown",this.keyDownListener.bind(this),!1),document.addEventListener("keyup",this.keyUpListener.bind(this),!1),this.mapChangedHandler(this.framework.getActiveMap()),this.framework.subscribe(B.MAP_ACTIVATED,this.mapChangedHandler.bind(this)),this.initialized=!0}}},{key:"keyDownListener",value:function(e){if(!Object(u["b"])(e))switch(e.keyCode){case 38:this.moveButtonPressed("north");break;case 40:this.moveButtonPressed("south");break;case 37:this.moveButtonPressed("west");break;case 39:this.moveButtonPressed("east");break;case 107:this.zoomButtonPressed("zoomIn");break;case 109:this.zoomButtonPressed("zoomOut");break;case 33:this.tiltButtonPressed("tiltUp");break;case 34:this.tiltButtonPressed("tiltDown");break;case 36:this.rotateButtonPressed("rotateEast");break;case 35:this.rotateButtonPressed("rotateWest");break;default:break}}},{key:"keyUpListener",value:function(e){if(!Object(u["b"])(e))switch(e.keyCode){case 38:this.moveButtonUp("north");break;case 40:this.moveButtonUp("south");break;case 37:this.moveButtonUp("west");break;case 39:this.moveButtonUp("east");break;case 107:this.fovButtonUp("zoomIn");break;case 109:this.fovButtonUp("zoomOut");break;case 33:this.tiltButtonUp("tiltUp");break;case 34:this.tiltButtonUp("tiltDown");break;case 36:this.rotateButtonUp("rotateEast");break;case 35:this.rotateButtonUp("rotateWest");break;default:break}}},{key:"mapChangedHandler",value:function(e){e.isInitialized()&&(e instanceof Vt?this.activateForCesium():e instanceof Hi?this.activateForOpenlayers():e instanceof Pi&&this.activateForOblique())}},{key:"activateForCesium",value:function(){if(!this.initializedForCesium){var e=this.framework.getActiveMap();this.cesiumViewer=e.getCesiumWidget(),this.cesiumScene=this.cesiumViewer.scene,this.cesiumCamera=this.cesiumScene.camera,this.cesiumPostRenderBind=this.postRenderHandlerCesium.bind(this),this.cesiumScene.postRender.addEventListener(this.cesiumPostRenderBind),this.initializedForCesium=!0}}},{key:"postRenderHandlerCesium",value:function(){var e=Cesium.Math.toDegrees(this.cesiumCamera.heading);(!this.values.heading||this.values.heading<e-.5||this.values.heading>e+.5)&&(this.values.heading=e)}},{key:"activateForOpenlayers",value:function(){this.initializedForOpenlayers||(this.ol3MapObject=this.framework.getActiveMap(),this.ol3Map=this.ol3MapObject.getOl3Map(),this.ol3Map.on("postrender",this.postRenderHandlerOpenlayers.bind(this)),this.initializedForOpenlayers=!0)}},{key:"postRenderHandlerOpenlayers",value:function(){var e=this.framework.getActiveMap();if(e){var t=e.getViewPoint(!1);t&&(this.values.heading=t.getHeading())}}},{key:"activateForOblique",value:function(){this.initializedForOblique||(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChange,this),this.initializedForOblique=!0);var e=this.framework.getActiveMap(),t=e.activeLayer;t&&t.currentImage&&this.obliqueImageChange(t)}},{key:"obliqueImageChange",value:function(e,t){var i,n=t||e.currentImage,r=(i={},Object(oe["a"])(i,h["a"].NORTH,0),Object(oe["a"])(i,h["a"].EAST,90),Object(oe["a"])(i,h["a"].SOUTH,180),Object(oe["a"])(i,h["a"].WEST,270),i);this.values.heading=n.viewDirectionAngle?90-Cesium.Math.toDegrees(n.viewDirectionAngle):r[n.viewDirection]}},{key:"computeNewGroundPosition",value:function(e,t){var i=t.getGroundPosition(),n=this.calculateBearing(e,t.getHeading()),r=t.getDistance()/this.moveFactor,a=Ut([i[0],i[1]],r,n);return a[2]=i[2],a}},{key:"calculateBearing",value:function(e,t){var i;return i="north"===e?t:"east"===e?t+90:"south"===e?t+180:"west"===e?t+270:t,i%=360,i}},{key:"computeNewCameraPosition",value:function(e,t){var i=t.getCameraPosition(),n=this.calculateBearing(e,t.getHeading()),r=2e3/this.moveFactor,a=Ut([i[0],i[1]],r,n);return a[2]=i[2],a}},{key:"moveButtonPressed",value:function(e){var t=this;if(this.navigationMode.navActive)this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else{var i=this.framework.getActiveMap();if(this.obliqueMoveImage&&i instanceof Pi){if(this._obliqueMoving||!i.activeLayer)return;var n=i.activeLayer.currentDirection;this._obliqueMoving=!0,i.getViewPoint(null,!0).then(function(i){var r=i.getHeading(),a=t.calculateBearing(e,r);return n.getImageIdInDirection(2*Math.PI-(a*Math.PI/180-Math.PI/2),t.obliqueMoveImageDirectionDeviation)}).then(function(e){return e?n.setImageOnMap(e):e}).catch(function(e){t.logger.warning(e.message)}).then(function(){t._obliqueMoving=!1})}else i.getViewPoint(null,!0).then(function(n){n.getGroundPosition()?(n.setGroundPosition(t.computeNewGroundPosition(e,n)),n.setCameraPosition(null)):(n.setCameraPosition(t.computeNewCameraPosition(e,n)),n.setGroundPosition(null)),n.setAnimate(t.animation),i.gotoViewPoint(n,t.animationDuration,0)})}}},{key:"moveButtonUp",value:function(e){this.navigationMode.navActive&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"compassPointerClicked",value:function(e){var t=this;this.navigationMode.navActive?this.navigationMode.setHeading(e):this.framework.getActiveMap().getViewPoint(!0,!0).then(function(i){i.setHeading(e),i.setAnimate(!0),i.setRoll(0),i.getGroundPosition()&&i.setCameraPosition(null),t.framework.getActiveMap().gotoViewPoint(i,1,0)})}},{key:"compassPointerDown",value:function(){var e=this.framework.getActiveMap().getViewPoint();e.setAnimate(!1),e.getGroundPosition()&&e.setCameraPosition(null),this.compassPointerPressedViewpoint=e}},{key:"compassPointerDragged",value:function(e){this.navigationMode.navActive?this.navigationMode.setHeading(e):this.compassPointerPressedViewpoint&&(this.compassPointerPressedViewpoint.setHeading(e),this.framework.getActiveMap().gotoViewPoint(this.compassPointerPressedViewpoint,1,0))}},{key:"fovButtonPressed",value:function(e){this.navigationMode.navActive&&this.navigationMode.setFlag(this._navigationModeFlags[e],!0)}},{key:"fovButtonUp",value:function(e){this.navigationMode.navActive&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"zoomButtonPressed",value:function(e){var t=this;this.navigationMode.navActive||this.framework.getActiveMap().getViewPoint(null,!0).then(function(i){"zoomIn"===e?i.setDistance(i.getDistance()/t.zoomFactor):i.setDistance(i.getDistance()*t.zoomFactor),i.setAnimate(t.animation),i.setCameraPosition(null),t.framework.getActiveMap().gotoViewPoint(i,t.animationDuration,0)})}},{key:"tiltButtonPressed",value:function(e){if(this.navigationMode.navActive)this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else if(this.framework.getActiveMap()instanceof Vt){var t=this.framework.getActiveMap().getViewPoint(),i=t.getPitch(),n=i;if(n="tiltUp"===e?i-this.tiltFactor:i+this.tiltFactor,n>-10&&(n=-10),n<-90&&(n=-90),t.setPitch(n),t.setAnimate(this.animation),!t.getGroundPosition())return;t.setCameraPosition(null),this.framework.getActiveMap().gotoViewPoint(t,this.animationDuration,0)}}},{key:"tiltButtonUp",value:function(e){this.navigationMode.navActive&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"rotateButtonPressed",value:function(e){if(this.navigationMode.navActive)this.navigationMode.setFlag(this._navigationModeFlags[e],!0);else{var t=this.framework.getActiveMap();if(t instanceof Vt||t instanceof Hi&&!t.fixedNorthOrientation){var i=this.framework.getActiveMap().getViewPoint(),n=i.getHeading(),r=n;if("rotateEast"===e?r+=10:r-=10,i.setHeading(r),i.setAnimate(this.animation),!i.getGroundPosition())return;i.setCameraPosition(null),this.framework.getActiveMap().gotoViewPoint(i,this.animationDuration,0)}}}},{key:"rotateButtonUp",value:function(e){this.navigationMode.navActive&&this.navigationMode.setFlag(this._navigationModeFlags[e],!1)}},{key:"rotateCenterClicked",value:function(){var e=this.framework.getActiveMap();e instanceof Vt&&(this.rotationActive?this.navigationMode.navActive?(this.navigationMode.setFlag("rotation",!1),this.rotationActive=!1,this.values.rotation=!1):this.rotateAroundCenterPosition(e,!1):this.navigationMode.navActive?(this.navigationMode.setFlag("rotation",!0),this.rotationActive=!0,this.values.rotation=!0):this.rotateAroundCenterPosition(e,!0))}},{key:"rotateAroundCenterPosition",value:function(e,t){var i=e.getCesiumWidget(),n=i.scene;if(t!==this.rotationActive)if(t){var r=this.framework.getActiveMap().getViewPoint();r.getGroundPosition()&&(this.rotationActive=!0,this.values.rotation=!0,r.setCameraPosition(null),this.cesiumRotateCenterBind=this.rotateCenter.bind(this,r),n.postRender.addEventListener(this.cesiumRotateCenterBind))}else this.cesiumRotateCenterBind&&(n.postRender.removeEventListener(this.cesiumRotateCenterBind),this.cesiumRotateCenterBind=null,this.rotationActive=!1,this.values.rotation=!1)}},{key:"rotateCenter",value:function(e){var t=this.timeLastTick?this.cesiumViewer.clock.currentTime.secondsOfDay-this.timeLastTick.secondsOfDay:1/60;(t<=0||t>1)&&(t=1/60);var i=t/(1/60);this.timeLastTick=this.cesiumViewer.clock.currentTime;var n=360/(60*this.timePerRotation/i);e.setHeading(e.getHeading()+n),this.framework.getActiveMap().gotoViewPoint(e,this.animationDuration,0)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.zoomFactor=this.zoomFactor,e.moveFactor=this.moveFactor,e.tiltFactor=this.tiltFactor,e.animationDuration=this.animationDuration,e.animation=this.animation,e.showZoomButtons=this.showZoomButtons,e.showTiltButtons=this.showTiltButtons,e.showHomeButton=this.showHomeButton,e.pedestrianMode=this.pedestrianMode,e.pedestrianModeReferenceHeight=this.pedestrianModeReferenceHeight,e.showCompass=this.showCompass,e.rotationPerFrame=this.rotationPerFrame,e.walkModeMoveFactor=this.walkModeMoveFactor,e}},{key:"dispose",value:function(){document.removeEventListener("keyup",this.keyUpListener.bind(this),!1),document.removeEventListener("keydown",this.keyDownListener.bind(this),!1)}},{key:"getValuesObject",value:function(){return this.values}},{key:"mapClicked",value:function(e){if(e&&e.longitude&&e.latitude&&e.height){var t=[e.longitude,e.latitude,e.height];t[2]+=Number.parseFloat(this.values.referenceHeight);var i=this.framework.getActiveMap().getViewPoint();i.setAnimate(!0),i.setGroundPosition(t),i.setCameraPosition(null),i.setDistance(0),i.setPitch(0),i.setRoll(0),this.navigationMode.activateFirstPersonMode(i),this.framework.getMapContainer().style.cursor="auto",this.mapClickListenerKey=null}}},{key:"activateNavigationMode",value:function(e){if(e)if(null==this.mapClickListenerKey){var t=function(e){var t=encodeURIComponent(e).replace(/%20/g," ").replace(/%3D/g,"=").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%22/g,"'");return"data:image/svg+xml,".concat(t)},i='<svg width="24" height="24" viewBox="0 0 93.646 93.646" xmlns="http://www.w3.org/2000/svg"><path d="M67.971,49.778l-9.378-10.345c-0.584-0.644-1.121-1.971-1.148-2.841L57.1,25.858v-0.311c0-1.654-1.346-3-3-3h-9.18h-3.648\n\t\tc-1.478,0-3.127,1.047-3.756,2.384l-12.358,26.25c-0.342,0.728-0.376,1.541-0.096,2.292c0.28,0.75,0.84,1.342,1.575,1.666\n\t\tl1.821,0.803c0.388,0.171,0.802,0.258,1.231,0.258h0c1.177,0,2.273-0.669,2.794-1.704l5.789-11.517v11.576\n\t\tc-0.024,0.067-0.059,0.128-0.081,0.196l-9.783,30.638c-0.407,1.276-0.283,2.619,0.35,3.781s1.693,1.994,2.987,2.343l0.654,0.177\n\t\tc0.428,0.116,0.872,0.175,1.318,0.175c2.251,0,4.296-1.481,4.974-3.603l9.141-28.628l3.242,7.941\n\t\tc0.791,1.937,1.645,5.329,1.865,7.409l1.551,14.621c0.249,2.341,2.1,4.04,4.402,4.04c0.377,0,0.76-0.046,1.137-0.137l0.659-0.16\n\t\tc2.624-0.635,4.478-3.331,4.133-6.008l-2.297-17.828c-0.292-2.265-1.269-5.812-2.178-7.907l-3.102-7.144\n\t\tc-0.04-0.093-0.097-0.177-0.143-0.267v-4.841l5.59,5.836c0.556,0.581,1.3,0.901,2.094,0.901c0.803,0,1.553-0.326,2.111-0.918\n\t\tl1.034-1.098C69.036,52.899,69.055,50.973,67.971,49.778z"/>\n\t<path d="M48.52,20.005c5.516,0,10.003-4.487,10.003-10.003C58.523,4.487,54.036,0,48.52,0c-5.515,0-10.001,4.487-10.001,10.002\n\t\tC38.518,15.518,43.005,20.005,48.52,20.005z"/></svg>';this.framework.getMapContainer().style.cursor='url("'.concat(t(i),'"), pointer'),this.mapClickListenerKey=this.framework.subscribeOnceExclusive("MAP_CLICKED",this.mapClicked.bind(this),"walkMode",this.activateNavigationMode.bind(this,!0))}else this.framework.unsubscribeByKey(this.mapClickListenerKey),this.mapClickListenerKey=null,this.framework.getMapContainer().style.cursor="auto";else this.navigationMode.activateOverviewMode()}},{key:"setReferenceHeight",value:function(e){this.values.referenceHeight=e}}]),t}(ra),Ad=xd,Fd=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.initialized=!1,i.mapContainerId=e.containerId||"vcm_overviewmap_container";var n=e.cameraIcon;n&&""!==n||(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA8CAYAAADxJz2MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDphMzhlODgyYy00ZGYzLTZkNGMtYWZhYy1hYTkwOTI3MjRiYjEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEYxRkE1MDlENjRDMTFFNTlGRjhFMzM3RTA3MDJFMDciIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEYxRkE1MDhENjRDMTFFNTlGRjhFMzM3RTA3MDJFMDciIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OGJiODg5ODItZGM0Zi0xNjQyLWEyZDYtODJkZTcxMGNhNjkwIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzY5MTdhNjAtZDYzYy0xMWU1LThjNTgtYTMwNjE0MWQwNTkyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Fn8KKQAABwVJREFUeNrsW0toHVUYPufOvb2madNaa2NS3682BTcKiQqx4qO0i7gKpHFhoCBoG8SVC124ExcW02yCiFCQ4iLgIhWJCE2pYI1J1VitNFhTIz5STdI2D2tucsf/N9/YcTKvM+fMbYT54eu9nTvnzMx3/veZSNu2RSbJJZdRkBGYEZgRmBGYSUZgRmBGYEZgJslkTUZBoEjXpxcsxTz9U0OYIfxFsAi2a5DtOjnpxU09RNS9SEPXiXN8kbCWUCWhgZsIf+Am3WYdh0BpkFipeG3v2LhjdM4pgyPmbMI5aT1hHeECIV+BVVXRLJ17kR6LSnqOl8AbCZNsue4BWzAB/1B0TapLpEyJmDTcR9SCL4C8K4Tf+Jh3wK2EecIsoWDIFE1qSxoExvV9JcQLttAxfC7lPSdNgMQlqKpUuJht6MZ15gsao7OgElxw0NhAGMXvzJHtNzGzfBPILBj2dyY00ZT2qURdJmsr4TxcnCNW0CR1IPJ3RGk74YWTPITU0BTTGYLj92pB3E/e38MusAP5zsUQTayELxIKrkRX04SP39sEDfxGdRLWvPsIUyAyl1LkTMPkpAErYNKugyUOgUzlC20mbIfq5lN4gDiBREfTdYjka9cTRlBkJL7AnZjo54C6OY2bNz2n6mKUEDTOEX7Qzaf4wg+AvMkYzYc0nLkp7Y6zUCVY3gxMV5ggkIPITkw6j6aDCZMySYYJTV9CSVtF+Bi+P1TyEb/brlX5itCI77kKpy3SIKEyQlFY+47HIc+PQOnJ+dzH2ZGOI6iMeVIb1crBpCbqdleky+/dRvgyLGhEERj1nse3SCq3olIpKnYyZMqEJFkIJ1m+hfAL4YyCRVlJzJCDSAs6ErMuf5im9kmFVphqX3ARNS4r0/sgU8ZQpshKJCo/fAor5m46mCidTJmxVLBCrv17YbpOV76cxITjCl9omPAgCuxCism0aZ8oPfkem+4JPJP0IU6C1EWTBLJ8Dad7ByqVotDrLqdR74ZdawFFwhgyDG8skB5XYayD4hbeCniGcJkw55MfphkM4vq+oPZUDSznHfhz6dN1klGmbGLn7GaQ+CNuLFfhiJpEg3mhbye87WpRxQ0cxglkeYjwuLja6r4W3ZW448pwOx8STuo+eN4QgSeRG25Hsl1IITdUMeOg30og77SHPD/ti/R/JjXQWYwXQN6kYvsrKtE1USpyFN2CWv6gx7eFER9KoGXQzPmGfiU8BqdsY/4kyAHu716EjfOex89QTdhIeAtNESNi+UQdHbmI6qQZ3/OuPMrvwXIRsGIej1oMlnsJ7xG+03i+FRzlfXKfuBMFqfanhHsI9/s0HUxFXZXx7PfuJnxuImjoNhPiyhHcNKc4F3w0PY2A4pcLLuIe2CreNfBcdhIfmETYH35P2IXccAmLlcRs44zxmrLTr6xBo+B1wrSG2WoFEWW/ALkMP/gEPi2NQBDlD60A4jll6UGLqhBQ50ZJLsQyZVoa6AjnhLyvynsqU3gIGUKIqrYF/WYjaHxEOKrpnuw02lmqfvYN1M0TCZJ31Y4L+716dFdeEjFb8ybSGFOmLH384Rn0D8vi6iZ9TlMDpc8xgVyPF+tVwqWUePv3WS2DjtWvm+HIJfjBXfiuQlTOExjCxhYQdd8UAa9iGPb3tkkCo87hDeo65IeTrgohqZ+zfPwed1g+EMut+TRK1xX1cSV8oFs7eb+1C4FlIqB/aAv1Xb4y/N55wosJC4DUfWBUqSdjnMf+j3f2Wlz+0PLxa+7PMDh+rwaL83LCOjdxZWQp1MEyomOSi6k1F2HCj4rltroISEOEy8zd//cGEvZ71xMOieUXgVQty5mzrKOBJt4yUDGNczC5HWgvOWSUQQhr0w3ooFThmFNTL7mIZeEdwgGUj0nbYXZCLRWWpk/TiWCfEZ4Uy2+9z2G+WhBWPHDgwK6urq5txWJx8/Dw8ATGrANmMReP5a3VV0KsJKhZauSFJ1lhAr1j7kJQYb+1trW19ZG2traNp06dkvv37y/39vbKwcFBMT09faWurq6qvb3d3rNnzxHkeX+CzOfE8qt3sTaBTEvSPza0E46RPqbMOdv6lpaWnYcPH97Q2NgoSqWS6OvrkwMDA3J+fl6SFlZNTU2J5uZmMTMz87SLvIMgz5m/7NGu1LOMfIUWKuxBjhFaScNK1dXVcm5uTpw9e5axYszs7Kyora2VII1fvz1ucIGveSmnI8fIbB9uaGiob2pqWlMoFMTIyMh/COzo6LBZOzs7Ow8NDQ1xo+DZtOvc/5twRD5KBJ2wbXtkdHS03NPT8w/4Ox1boMDyCbor21bLTctVRmItkuGqffv2Lezdu/d5STI+Pj7V3d1NSjnC25GvieUud0ZgiHC93LR7927enBL9/f2seYOEL1bbjf4twAD8sqEzJ5yLRwAAAABJRU5ErkJggg=="),i.imageStyle=new ol.style.Icon({src:n,anchor:e.anchorPosition||[.5,.5]}),i.singleVectorObliqueResolutionFactor=Object(u["h"])(e.singleVectorObliqueResolutionFactor,2),i.activeOnStartup=e.activeOnStartup||!1,i.showOnlyActiveObliqueTile=!1;var r={fill:{color:"rgba(255,255,255,0.1)"},stroke:{color:"#a8c02b",width:1}},a={fill:{color:"rgba(255,255,255,0.8)"},stroke:{color:"#a8c02b",width:3}};return null!=e.oblique&&(i.showOnlyActiveObliqueTile=e.oblique.showOnlyActiveTile||!1,r=e.oblique.unselectedStyle||r,a=e.oblique.selectedStyle||a),i.unselectedObliqueTileStyle=new ol.style.Style({fill:r.fill?new ol.style.Fill(r.fill):null,stroke:r.stroke?new ol.style.Stroke(r.stroke):null}),i.selectedObliqueTileStyle=new ol.style.Style({fill:a.fill?new ol.style.Fill(a.fill):null,stroke:a.stroke?new ol.style.Stroke(a.stroke):null}),i.featureSet=!1,i.layerName=e.layerName||null,i.selectInteraction=null,i.layer=null,i.vectorSource=new ol.source.Vector({}),i.overviewMap=null,i.activeListener=null,i.oblique=!1,i.values={active:!1},i.initialized=!1,i._cachedViewPoint=null,i.minimumHeight=Object(u["h"])(e.minimumHeight,150),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.OverviewMap"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e||!this.layerName)return!1;this.layer=this.framework.getLayerByName(this.layerName);try{o(this.layer,[Sr,Fr,Hr,wr])}catch(i){return!1}this.mapActivatedSubscribeKey=this.framework.subscribe(B.MAP_ACTIVATED,this.resetOverviewWidget.bind(this)),this.initialized=!0,this.initializedFinished()}return!0}},{key:"resetOverviewWidget",value:function(){this.values.active&&(this.deactivate(),this.activate())}},{key:"createMap",value:function(){var e=this,t=this.layer.getImplementationObject(Hi.className),i=t.getOLLayer(),n=new ol.layer.Vector({source:this.vectorSource});return this.overviewMap=new ol.Map({target:this.mapContainerId,layers:[i,n],controls:[],interactions:[],renderer:"canvas"}),i.setVisible(!0),this.overviewMap.setSize([320,190]),new Promise(function(t){e.overviewMap.once("postrender",t)})}},{key:"updateSize",value:function(){this.overviewMap&&(this.overviewMap.updateSize(),this.oblique||this.addCameraFeature())}},{key:"activate",value:function(){var e=this;this.values.active=!0;var i=this.overviewMap?Promise.resolve():this.createMap();i.then(function(){Se(b(t.prototype),"activate",e).call(e),e.overviewMap.once("postcompose",e.updateSize,e);var i=e.framework.getActiveMap();i instanceof Vt?e.initializeForCesium(i):i instanceof Hi?e.initializeForOpenlayers(i):i instanceof Pi&&e.initializeForOblique(i)})}},{key:"deactivate",value:function(){this.activeListener&&(this.activeListener(),this.activeListener=null),Se(b(t.prototype),"deactivate",this).call(this),this.values.active=!1,this.vectorSource.clear(),this.featureSet=!1}},{key:"initializeForCesium",value:function(e){if(e.isInitialized()){var t=e.getCesiumWidget(),i=t.scene;this.addCameraFeature(),this.activeListener=i.postRender.addEventListener(this.addCameraFeature,this)}}},{key:"initializeForOpenlayers",value:function(e){var t=e.getOl3Map();this.addCameraFeature();var i=t.on("postrender",this.addCameraFeature,this);this.activeListener=function(){ol.Observable.unByKey(i)}}},{key:"initializeForOblique",value:function(e){var t=this;this.vectorSource.clear();var i=[];i.push(new ol.interaction.DragPan),i.push(new ol.interaction.MouseWheelZoom),i.push(new ol.interaction.PinchZoom),i.push(new ol.interaction.DragZoom),this.selectInteraction=new ol.interaction.Select({style:this.selectedObliqueTileStyle}),i.push(this.selectInteraction),i.forEach(function(e){t.overviewMap.addInteraction(e)});var n=this.overviewMap.on("singleclick",function(e){if(t.overviewMap.hasFeatureAtPixel(e.pixel)){var i=0;t.overviewMap.forEachFeatureAtPixel(e.pixel,function(e){if(!(i>=1)){var n=e.getId();t.obliqueDirection.setImageOnMap(n),i+=1}})}else e.stopPropagation()});e.activeLayer&&(this.obliqueDirectionChange(e.activeLayer),this.obliqueImageChange(e.activeLayer));var r=[];r.push(this.framework.subscribe(B.LAYER_ACTIVATED,this.obliqueLayerActivated,this)),r.push(this.framework.subscribe(B.LAYER_DEACTIVATED,this.obliqueLayerDeactivated,this)),r.push(this.framework.subscribe(B.OBLIQUE_DIRECTION_CHANGED,this.obliqueDirectionChange,this)),r.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChange,this)),this.activeListener=function(){t.obliqueDirection&&t.overviewMap.removeLayer(t.obliqueDirection.footPrintsLayer),i.forEach(function(e){t.overviewMap.removeInteraction(e)}),r.forEach(function(e){t.framework.unsubscribeByKey(e)}),ol.Observable.unByKey(n),t.oblique=!1},this.oblique=!0}},{key:"obliqueLayerDeactivated",value:function(e){e instanceof Di&&(this.selectInteraction.getFeatures().clear(),this.obliqueDirection&&this.overviewMap.removeLayer(this.obliqueDirection.footPrintsLayer))}},{key:"obliqueLayerActivated",value:function(e){e instanceof Di&&(this.obliqueDirectionChange(e),this.obliqueImageChange(e))}},{key:"obliqueDirectionChange",value:function(e,t){var i=this;if(this.obliqueDirection&&this.overviewMap.removeLayer(this.obliqueDirection.footPrintsLayer),this.obliqueDirection=t||e.currentDirection,this.obliqueDirection){var n=this.obliqueDirection.footPrintsLayer;this.showOnlyActiveObliqueTile?n.setStyle(function(e){var t=i.obliqueDirection.currentImage;return t&&!e.getId()===t.name?i.unselectedObliqueTileStyle:null}):n.setStyle(this.unselectedObliqueTileStyle),this.overviewMap.addLayer(n)}}},{key:"obliqueImageChange",value:function(e,t){if(this.obliqueDirection){var i=t||e.currentImage,n=this.selectInteraction.getFeatures();n.clear();var r=this.obliqueDirection.footPrintsLayer.getSource().getFeatureById(i.name);if(r){this.selectInteraction.getFeatures().push(r),this.overviewMap.getView().fit(r.getGeometry().getExtent());var a=this.overviewMap.getView().getResolution();this.overviewMap.getView().setResolution(a*this.singleVectorObliqueResolutionFactor)}}}},{key:"_detectChange",value:function(e,t,i){var n=!0;if(this.featureSet&&this._cachedViewPoint){var r=this._cachedViewPoint.position.some(function(t,i){return e[i]!==t});n=r||this._cachedViewPoint.heading!==t||this._cachedViewPoint.distance!==i}return n&&(this._cachedViewPoint={position:e,heading:t,distance:i}),n}},{key:"addCameraFeature",value:function(){var e=this.framework.getActiveMap().getViewPoint();if(e&&e.isValid()){var t=e.getGroundPosition(),i=e.getCameraPosition()||t,n=e.getHeading(),r=e.getDistance();!i[2]||r&&r<4*i[2]||(r=4*i[2]);var a=!this._detectChange(i,n,r);if(!a){var s=Pe.getInstance();if(s.values.walkmode&&(r=s.referenceHeight),r=r>this.minimumHeight?r:this.minimumHeight,null!=n&&null!=r){var o;if(this.featureSet)o=this.vectorSource.getFeatureById("cameraFeature");else{var l=new ol.geom.Point([i[0],i[1]]);o=new ol.Feature({geometry:l}),o.setId("cameraFeature"),o.setStyle(new ol.style.Style({image:this.imageStyle})),this.vectorSource.addFeature(o),this.featureSet=!0}o.getGeometry().setCoordinates(R.wgs84ToMercator(i));var c=e.getHeading(),u=Cesium.Math.toRadians(c);this.imageStyle.setRotation(u),e.setHeading(0),e.setCameraPosition(i),e.setGroundPosition(null),e.setDistance(4*r),Hi.prototype.gotoViewPoint.call({ol3map:this.overviewMap},e)}}}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.layerName=this.layerName,e.iconStyleObject={src:this.imageStyle.getSrc(),anchor:this.imageStyle.getAnchor()},e.minimumHeight=this.minimumHeight,e}},{key:"dispose",value:function(){this.deactivate(),this.framework.unsubscribeByKey(this.mapActivatedSubscribeKey)}}]),t}(ra),Nd=Fd,Hd=i(650),Rd=i.n(Hd);function zd(e,t){return!e.active||e.cesium3DTileset.tilesLoaded?Promise.resolve():new Promise(function(i){var n,r=e.cesium3DTileset.allTilesLoaded.addEventListener(function(){n&&clearTimeout(n),r(),i()});null!=t&&(n=setTimeout(function(){r(),i()},t))})}function Gd(e,t){return e.tilesLoaded?Promise.resolve():new Promise(function(i){var n,r=e.tileLoadProgressEvent.addEventListener(function(e){e<1&&(n&&clearTimeout(n),r(),i())});null!=t&&(n=setTimeout(function(){r(),i()},t))})}function Vd(e){return new Promise(function(t){var i,n=e.getLayers().getArray().filter(function(e){return e instanceof ol.layer.Tile&&e.getVisible()}).map(function(e){return e.getSource()}),r=n.length,a=new Array(3*r),s=-1,o=0,l=null;function c(){o+=1}function u(){s+=1,l&&(clearTimeout(l),l=null),o<=s&&(l=setTimeout(function(){ol.Observable.unByKey(a),t(i)},500))}e.once("postcompose",function(e){if(i=e.context.canvas,0===r)setTimeout(function(){t(i)},500);else{for(var s=0;s<r;s++)a[s]=n[s].on("tileloadstart",c),a[s+1]=n[s].on("tileloadend",u),a[s+2]=n[s].on("tileloaderror",u);u()}}),e.renderSync()})}var Bd=i(669),Ud=i.n(Bd);function Wd(e,t){var i=document.createElement("a");i.download=t,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function qd(e,t){window.navigator.msSaveBlob?window.navigator.msSaveOrOpenBlob(e,t):Wd(URL.createObjectURL(e),t)}function Jd(e,t){window.navigator.msSaveBlob?qd(new Blob([e]),t):Wd("data:text/plain;charset=utf-8, ".concat(encodeURIComponent(e)),t)}function Kd(e,t,i){null!=e.toBlob?e.toBlob(function(e){qd(e,t)},i):window.navigator.msSaveBlob&&qd(e.msToBlob(),t)}var Zd={LANDSCAPE:"landscape",PORTRAIT:"portrait",BOTH:"both"},Qd=Y.getLogger("vcs.vcm.widgets.PDFCreator"),Xd=16777216,$d=4194304;function em(e){var t=e;if(Array.isArray(t)){if(4===t.length)return t;if(2===t.length)return[t[0],t[1],t[0],t[1]];t=t[0]}var i=Object(u["h"])(t,40);return new Array(4).fill(i)}var tm,im,nm=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.libraryPromise=null,i.formatList=e.formatList||["A5","A4","A3","A2"],i.orientationMode=Object(u["f"])(e.orientationMode,Zd,Zd.BOTH);var n=i.orientationMode;return n===Zd.BOTH&&(n=Object(u["f"])(e.defaultOrientation,Zd,Zd.PORTRAIT)),n===Zd.BOTH&&(n=Zd.PORTRAIT),i.defaultOrientation=n,i.title=e.title||null,i.titleImage=e.titleImage||null,i.copyrightText=e.copyrightText||null,i.showTitle=Object(u["e"])(e.showTitle,!0),i.showTitleImage=Object(u["e"])(e.showTitleImage,!0),i.showCopyright=Object(u["e"])(e.showCopyright,!0),i.showComment=Object(u["e"])(e.showComment,!1),i.showTitleInput=Object(u["e"])(e.showTitleInput,!1),i.showBalloons=Object(u["e"])(e.showBalloons,!0),i.showNorthPoint=Object(u["e"])(e.showNorthPoint,!0),i.showHeaderLine=Object(u["e"])(e.showHeaderLine,!0),i.showScreenshotDownload=Object(u["e"])(e.showScreenshotDownload,!1),i.coordinateProjection=e.projection?new R(e.projection):i.framework.projection,i.imageMimetype=e.imageMimetype||"image/png",i.headerText=e.headerText||null,i.subText=e.subText||null,i.aspectRatio={landscape:Object(u["g"])(e.aspectRatioLandscape,2.22222),portrait:Object(u["g"])(e.aspectRatioPortrait,2.22222)},i.titleImageRatio=Object(u["g"])(e.titleImageRatio,.125),i.pageMargins=em(e.pageMargins),i.defaultRenderingWidth={portrait:Object(u["h"])(e.renderingWidthPortrait,1920),landscape:Object(u["h"])(e.renderingWidthLandscape,1920)},i.warningPixelCount=Object(u["h"])(e.warningPixelCount,i.getPixelCount("A4","landscape",300)),i.headerLineColor=e.headerLineColor||null,i.headerLine={table:{widths:["*"],heights:[.1],body:[[{text:"",fillColor:i.headerLineColor,border:[!1,!1,!1,!1]}]]},layout:"noBorders"},i.footer=e.footer||{},i.header=e.header||{},i.info=e.info||{},i.styles={header:{fontSize:9,bold:!0,margin:[0,0,2,0]},subheader:{bold:!0,fontSize:8,margin:[0,10,0,2]},copyright:{fontSize:6,italics:!0,alignment:"right",padding:[10,10,10,10],margin:[0,-7,1.5,0],color:"#000000",background:"#eeeeee"},tableHeader:{bold:!0,fontSize:8,color:"black"},subheaderText:{fontSize:8}},e.styles&&"object"===Object(s["a"])(e.styles)&&Object.assign(i.styles,e.styles),i.northPointImage=e.northPointImage||Ud.a,i.loadedTimeout=Object(u["h"])(e.loadedTimeout,3e4),i.floatPrecision=Object(u["h"])(e.floatPrecision,2),i._cancelled=!1,i._reset=function(){},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.PDFCreator"}}]),Object(m["a"])(t,[{key:"createTemplate",value:function(e,i,n,r,a){if(!Rd.a[e])return Qd.warning("Incorrect format"),{};var o=this.getImagePixel(e,i),l={pageSize:e,pageOrientation:i,content:[],images:{},pageMargins:this.pageMargins,info:this.info},c=this.copyrightText||t.getCopyrightText();if(n.copyright=c,this.headerText){var u,h=t.getJSONFromInput(this.headerText,n);if(Array.isArray(h))(u=l.content).push.apply(u,Object(T["a"])(h));else"object"!==Object(s["a"])(h)&&"string"!==typeof h||l.content.push(h)}else{var d={columns:[]},m=this.title||r;d.columns.push({width:"*",text:this.showTitle?"\n".concat(m):"",style:"header"}),this.showTitleImage&&d.columns.push({width:o[1]*this.titleImageRatio*2+40,image:"titleImage",alignment:"right",margin:[0,0,0,4],fit:[o[1]*this.titleImageRatio*2,o[1]*this.titleImageRatio]}),l.content.push(d)}if(this.showHeaderLine){if(!this.headerLineColor){var f=t.getHeaderBottomColorFromElements();this.headerLine.table.body[0][0].fillColor=f}l.content.push(this.headerLine)}if(l.content.push({image:"screenshot",fit:o}),this.showNorthPoint){var y=o[1]*this.titleImageRatio;l.content.push({image:"northPoint",width:y,absolutePosition:{x:this.pageMargins[0]+o[0]-10-y,y:this.pageMargins[1]+20+y}})}if(this.showCopyright&&c&&l.content.push({text:c,style:"copyright"}),l.content.push("\n"),this.subText){var g,v=this.subText,p=t.getJSONFromInput(v,n);if(Array.isArray(p))(g=l.content).push.apply(g,Object(T["a"])(p));else"object"!==Object(s["a"])(p)&&"string"!==typeof p||l.content.push(p)}return l.images={},this.showTitleImage&&(this.titleImage||a)&&(l.images.titleImage=this.titleImage||a),l.styles=this.styles,l.header=t.getJSONFromInput(this.header,n),l.footer=t.getJSONFromInput(this.footer,n),l}},{key:"collectAdditionalInformation",value:function(e){var i=this,n=ne.getInstance().getActiveMap(),r=new Date;if(e.date="".concat(r.getUTCDate(),".").concat(r.getUTCMonth()+1,".").concat(r.getUTCFullYear()),n){n instanceof Pi&&(e.obliqueImage=n.getCurrentImage());var a=n.getViewPoint(!0,!0);return a.then(function(n){var r=R.createGeographicProjection(),a=n.clone();return a.groundPosition=a.groundPosition?i.coordinateProjection.transformFrom(r,a.groundPosition):a.groundPosition,a.cameraPosition=a.cameraPosition?i.coordinateProjection.transformFrom(r,a.cameraPosition):a.cameraPosition,e.projection=i.coordinateProjection,e.viewpoint=t.viewpointToFixed(n,i.floatPrecision),e.transformedViewpoint=t.viewpointToFixed(a,i.floatPrecision),e})}return Promise.resolve(e)}},{key:"getTitleImage",value:function(){if(this.titleImage)return Promise.resolve(this.titleImage);var e=document.getElementsByClassName("logo-box"),t=e.length>0?e[0]:null;return t?(0===t.clientHeight&&(t.style.height="5.5rem"),window.html2canvas(t,{scale:3}).then(function(e){return e.toDataURL()})):Promise.reject(new Error("Could get Image DOM"))}},{key:"getTitle",value:function(){if(this.title)return Promise.resolve(this.title);var e=document.getElementsByClassName("vcm_copyright_headerTitle"),t=e.length>0?e[0]:null;return t?Promise.resolve(t.textContent):Promise.reject(new Error("Could get Title from DOM"))}},{key:"rotateNorthArrow",value:function(e){var t=this;return this.showNorthPoint?new Promise(function(i,n){var r=t.northPointImage,a=document.createElement("canvas"),s=68,o=68;a.width=s,a.height=o;var l=a.getContext("2d"),c=new Image;c.onload=function(){l.translate(s/2,o/2),l.rotate(-Cesium.Math.toRadians(e)),l.translate(-s/2,-o/2),l.drawImage(c,0,0),i(a.toDataURL())},c.onerror=function(){n(new Error("could not load northArrow"))},c.src=r}):Promise.resolve("")}},{key:"getPixelCount",value:function(e,t,i){var n=this.defaultRenderingWidth[t],r=this.getImageWidth(e,t),a=r/n,s=a*i/72;return n*s*(n/this.aspectRatio[t]*s)}},{key:"getScale",value:function(e,t,i){var n=this.defaultRenderingWidth[t],r=this.getImageWidth(e,t),a=r/n,s=a*i/72,o=n*s*(n/this.aspectRatio[t]*s),l=ne.getInstance().isIE11?$d:Xd;if(o>l){var c=Math.sqrt(l/o);return Math.round(s*c*100)/100}return Math.round(100*s)/100}},{key:"getImageWidth",value:function(e,t){var i=Rd.a[e],n="portrait"===t?i[0]:i[1],r=n-this.pageMargins[0]-this.pageMargins[2];return r}},{key:"getImagePixel",value:function(e,t){var i=this.getImageWidth(e,t);return[i,i/this.aspectRatio[t]]}},{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished()}return!0}},{key:"_cancelCheck",value:function(){if(this._cancelled)throw new Error("cancelled")}},{key:"cancelRunning",value:function(){this._cancelled=!0,this._reset(),this._reset=function(){}}},{key:"createPDF",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n,r){var a,s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._renderImage(t,i,n);case 2:return a=e.sent,s=a.toDataURL(),e.abrupt("return",this.makePDF(s,t,i,r));case 5:case"end":return e.stop()}},e,this)}));function t(t,i,n,r){return e.apply(this,arguments)}return t}()},{key:"createImage",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n){var r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._renderImage(t,i,n);case 2:return r=e.sent,Kd(r,"screenshot.png",this.imageMimetype),e.abrupt("return",!0);case 5:case"end":return e.stop()}},e,this)}));function t(t,i,n){return e.apply(this,arguments)}return t}()},{key:"_renderImage",value:function(){var e=Yu(regeneratorRuntime.mark(function e(i,n,r){var a,s,l,c,u;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return o(i,String),o(n,["landscape","portrait"]),o(r,Number),this._cancelled=!1,this.libraryPromise||(this.libraryPromise=this.framework.loadLibraries(["lib/vcm_pdf_thirdparty.js"])),e.next=7,this.libraryPromise;case 7:if(this._cancelCheck(),a=document.createElement("canvas"),s=this.defaultRenderingWidth[n],l=this.getScale(i,n,r),c=[s,s/this.aspectRatio[n]],a.width=c[0]*l,a.height=c[1]*l,u=this.framework.getActiveMap(),e.prev=15,!(u instanceof Vt)){e.next=23;break}return this._reset=t.prepareCesiumMap(u,c,l),e.next=20,this.getImageFromCesium(u,a);case 20:a=e.sent,e.next=31;break;case 23:if(!(u instanceof Hi||u instanceof Pi)){e.next=30;break}return this._reset=t.prepareOlMap(u,c,l),e.next=27,this.getImageFromOpenlayers(u,a);case 27:a=e.sent,e.next=31;break;case 30:throw new Error("wrong Map");case 31:return this._cancelCheck(),e.next=34,this.copyBalloon(a,c,l);case 34:a=e.sent,this._cancelCheck();case 36:return e.prev=36,this._reset(),this._reset=function(){},e.finish(36);case 40:return e.abrupt("return",a);case 41:case"end":return e.stop()}},e,this,[[15,,36,40]])}));function i(t,i,n){return e.apply(this,arguments)}return i}()},{key:"copyBalloon",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n){var r,a,s,o,l,c,u,h,d,m;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(r=document.getElementById("balloonContainer"),a=Object(Ie["a"])(i,2),s=a[0],o=a[1],!this.showBalloons||!r){e.next=12;break}return e.next=5,window.html2canvas(r,{width:s,height:o,scale:n,backgroundColor:null});case 5:for(l=e.sent,c=t.getContext("2d"),u=c.getImageData(0,0,s*n,o*n),h=l.getContext("2d").getImageData(0,0,s*n,o*n),d=!1,m=0;m<u.data.length;m+=4)0!==h.data[m+3]&&(d=!0,u.data[m]=h.data[m],u.data[m+1]=h.data[m+1],u.data[m+2]=h.data[m+2],u.data[m+3]=h.data[m+3]);d&&c.putImageData(u,0,0);case 12:return e.abrupt("return",t);case 13:case"end":return e.stop()}},e,this)}));function t(t,i,n){return e.apply(this,arguments)}return t}()},{key:"getImageFromCesium",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i){var n,r,a=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return n=t.getCesiumWidget(),n.render(),r=ne.getInstance().getLayers().map(function(e){if(e.active){if(e instanceof Hn)return zd(e,a.loadedTimeout);if(e instanceof Er)return zd(e.getImplementation(t),a.loadedTimeout)}return!1}).filter(function(e){return e}),r.push(Gd(n.scene.globe,this.loadedTimeout)),e.next=6,Promise.all(r);case 6:return this._cancelCheck(),e.abrupt("return",new Promise(function(e,t){var r=n.scene.postRender.addEventListener(function(){if(r(),a._cancelled)t(new Error("cancelled"));else{var s=i.getContext("2d");s.drawImage(n.scene.canvas,0,0),e(i)}})}));case 8:case"end":return e.stop()}},e,this)}));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"getImageFromOpenlayers",value:function(e,t){var i=this,n=e.getolMap();return Vd(n).then(function(e){i._cancelCheck();var n=t.getContext("2d");return n.drawImage(e,0,0),t})}},{key:"makePDF",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t,i,n,r){var a,s,o,l,c,u,h,d;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return a=ne.getInstance().getActiveMap().getViewPoint(!1,!1),s=a.getHeading(),e.next=4,this.getTitle();case 4:return o=e.sent,e.next=7,this.getTitleImage();case 7:return l=e.sent,e.next=10,this.rotateNorthArrow(s);case 10:return c=e.sent,e.next=13,this.collectAdditionalInformation(r);case 13:return u=e.sent,h=r.title||o,u.title=h,d=this.createTemplate(i,n,u,h,l),d.images.screenshot=t,this.showNorthPoint&&(d.images.northPoint=c),this._cancelCheck(),e.abrupt("return",new Promise(function(e){window.pdfMake.createPdf(d).download("map.pdf",e)}));case 21:case"end":return e.stop()}},e,this)}));function t(t,i,n,r){return e.apply(this,arguments)}return t}()}],[{key:"removeMapSpecificContent",value:function(e){var t=ne.getInstance().getActiveMap();Object(u["a"])(e,function(e){e&&(e.oblique||e.cesium||e.openlayers)&&(t instanceof Pi&&!e.oblique?e.text="":t instanceof Vt&&!e.cesium?e.text="":t instanceof Hi&&!e.openlayers&&(e.text=""))})}},{key:"getJSONFromInput",value:function(e,i){var n=e,r=ne.getInstance().getLocale();null!=n[r]&&(n=n[r]);var a=n;if("string"===typeof a)try{a=JSON.parse(n)}catch(o){Qd.warning(o.message)}null!=a[r]&&(a=a[r]);var s=JSON.stringify(a);s=t.replaceTokensInString(s,i);try{a=JSON.parse(s)}catch(o){Qd.warning(o.message),a=[]}return t.removeMapSpecificContent(a),a}},{key:"replaceTokensInString",value:function(e,t){var i=e,n=i.match(/\$\{(.*?)\}/g);return n&&Array.isArray(n)&&n.forEach(function(e){for(var n=e.substring(2,e.length-1),r=n.split("."),a=t,s=0;s<r.length;s++)a=a&&a[r[s]]?a[r[s]]:"";a="".concat(a).replace(/\n/g,"\\n"),i=i.replace(new RegExp("\\$\\{".concat(n,"\\}"),"g"),a)}),i}},{key:"viewpointToFixed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i={heading:e.heading.toFixed(t),pitch:e.pitch.toFixed(t),roll:e.roll.toFixed(t)};return null!=e.distance&&(i.distance=e.distance.toFixed(t)),e.cameraPosition&&(i.cameraPosition=e.cameraPosition.map(function(e){return e.toFixed(t)})),e.groundPosition&&(i.groundPosition=e.groundPosition.map(function(e){return e.toFixed(t)})),i}},{key:"getHeaderBottomColorFromElements",value:function(){var e=document.getElementsByTagName("header"),t=e.length>0?e[0]:null;if(t){var i=window.getComputedStyle(t);if(i){var n=i.getPropertyValue("border-bottom-color");if(n){var r=Be(n);return qe(r)}}}return"#a8c02b"}},{key:"getCopyrightText",value:function(){var e=ne.getInstance().getWidgetByType("vcs.vcm.widgets.Copyright"),t="";if(e){var i=e.layerItems,n={};i.forEach(function(e){var t=n[e.provider];if(t){var i=t.years.indexOf(e.year);-1===i&&(t.years.every(function(t){return Number(t)<Number(e.years)})&&(t.url=e.url),t.years.push(e.year))}else n[e.provider]={years:[e.year],url:e.url}});var r=!0;return Object.keys(n).forEach(function(e){r?r=!1:t+=" | ",t+="© ",t+=e,t+=" ",t+=n[e].years.join(", ")}),t}return""}},{key:"prepareCesiumMap",value:function(e,i,n){var r=e.getCesiumWidget(),a=r.resolutionScale;return t.prepareMapForRender(e,i),r.resolutionScale=n,function(){r.resolutionScale=a,t.prepareMapForRender(e)}}},{key:"prepareOlMap",value:function(e,i,n){t.prepareMapForRender(e,i);var r=Object(Ie["a"])(i,2),a=r[0],s=r[1],o=e.getolMap(),l=o.getSize(),c=o.getView().calculateExtent(l),u=[a*n,s*n];return o.setSize(u),o.getView().fit(c,{size:u,constrainResolution:!1}),o.set("vcs_scale",n,!0),function(){t.prepareMapForRender(e),o.setSize(l),o.getView().fit(c,{size:l,constrainResolution:!1}),o.unset("vcs_scale",!0),o.renderSync()}}},{key:"prepareMapForRender",value:function(e,t){var i,n;if(t){var r=Object(Ie["a"])(t,2);i=r[0],n=r[1],i="".concat(i,"px"),n="".concat(n,"px")}else i="auto",n="auto";e.mapElement.style.width=i,e.mapElement.style.height=n,e.disableMovement(!!t)}}]),t}(ra),rm=nm,am=function(e){function t(e,i,n,r){var a;return Object(d["a"])(this,t),a=y(this,b(t).call(this)),a.position=e,a.positionDecimalPlaces=n,a.targetTransform="EPSG:3857"!==i.epsg?R.getTransformer(i,R.createMercatorProjection()):null,a._defaultActive=r?me.CLICK|me.MOVE:me.CLICK,a.setActive(),a}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){if(!e.position.every(function(e){return 0===e})){var t=e.position;this.targetTransform&&(t=this.targetTransform(e.position,t.slice(),3));var i=3;while(i--)this.position[i]=t[i].toFixed(this.positionDecimalPlaces)}return Promise.resolve(e)}}]),t}(pe),sm=am,om=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.position={0:null,1:null,2:null},i.template=e.template||null,i.obliqueImage={name:null,direction:null},i.interaction=new sm(i.position,new R(e.projection),Object(u["h"])(e.positionDecimalPlaces,2),!!e.onMove),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.PositionDisplay"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return this.initialized||(this.framework.subscribe(B.OBLIQUE_DIRECTION_CHANGED,this.obliqueImageChanged,this),this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,this.obliqueImageChanged,this),this.framework.subscribe(B.LAYER_ACTIVATED,this.obliqueImageChanged,this),this.initialized=!0,xn().addPersistentInteraction(this.interaction),this.initializedFinished()),!0}},{key:"obliqueImageChanged",value:function(e){if(e instanceof Di){var t=e.currentImage;this.obliqueImage.name=t.name,this.obliqueImage.direction=Object(h["b"])(t.viewDirection)}}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.positionDecimalPlaces=this.interaction.positionDecimalPlaces,e.template=this.template,e.projection=this.options.projection,e}}]),t}(ra),lm=om,cm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.currentTime=new Date,i.timezone=e.timezone||null,i.activateShadowsOnStartup=!!e.activateShadowsOnStartup,i.values={active:i.active,date:i.currentTime.getTime()},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Shadow"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.handleMapChangeEvent(this.framework.getActiveMap()),this.activateShadowsOnStartup&&this.toggleShadow(),this.initialized=!0}return!0}},{key:"activate",value:function(){Se(b(t.prototype),"activate",this).call(this),this.map.getScene().shadowMap.enabled=!0,this.setCurrentTimeToMap(),this.values.active=this.active}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.map.getScene().shadowMap.enabled=!1,this.map.setDay(this.map.defaultJDate),this.values.active=this.active}},{key:"handleURLParameter",value:function(e){e.shadowTime&&(this.setDate(new Date(e.shadowTime)),this.activate())}},{key:"getLink",value:function(e){this.values.active&&e.addQueryParams({shadowTime:this.currentTime.getTime()})}},{key:"toggleShadow",value:function(){this.map.getScene().shadowMap.enabled?this.deactivate():this.activate()}},{key:"setMinutesOfDay",value:function(e){o(e,Number),this.currentTime.setHours(Math.floor(e/60)),this.currentTime.setMinutes(e%60),this.setDate(this.currentTime)}},{key:"setDayOfYear",value:function(e){o(e,Number);var t=new Date(this.currentTime.getFullYear(),0,e);this.currentTime.setMonth(t.getMonth()),this.currentTime.setDate(t.getDate()),this.setDate(this.currentTime)}},{key:"setDate",value:function(e){o(e,Date),this.currentTime=e,this.values.date=this.currentTime.getTime(),this.setCurrentTimeToMap()}},{key:"setCurrentTimeToMap",value:function(){var e=Cesium.JulianDate.fromDate(this.currentTime);this.map.setDay(e)}},{key:"handleMapChangeEvent",value:function(e){Se(b(t.prototype),"handleMapChangeEvent",this).call(this,e),e instanceof Vt&&(this.map=e)}},{key:"getConfigObject",value:function(){var e=Se(b(t.prototype),"getConfigObject",this).call(this);return e.activateShadowsOnStartup=this.activateShadowsOnStartup,e.timezone=this.timezone,e}}]),t}(ra),um=cm,hm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.cb=e,i._defaultActive=me.CLICKMOVE,i.paused=!1,i.coordinate=null,i.setActive(),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.MOVE?e.position.every(function(e){return 0===e})||this.cb(e.position):e.type&me.CLICK&&(this.paused?e.feature&&e.feature.id&&"transparentTerrainBox"===e.feature.id._id&&(this.paused=!1,this.setActive(me.CLICKMOVE)):(this.paused=!0,this.setActive(me.CLICK))),Promise.resolve(e)}}]),t}(pe),dm=hm,mm=i(670),fm=i.n(mm),ym=new Cesium.Matrix4,gm=function(e){function t(e){var i,n,r;(Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.boxSize=e.boxSize?Cesium.Cartesian3.fromArray(e.boxSize):new Cesium.Cartesian3(100,100,50),i.boxSize.z=-Math.abs(i.boxSize.z),i.layerNames=e.layerNames||[],i.featureLayer=new Un({name:"_transparentTerrain"}),i.position=new Cesium.Cartesian3,i.scene=null,i.cesium3DTilesetCollection=new Map,i.supportedMaps=["vcs.vcm.maps.Cesium"],i._removeInteraction=null,e.color)?n="string"===typeof e.color?Cesium.Color.fromCssColorString(e.color):(r=Cesium.Color).fromBytes.apply(r,Object(T["a"])(e.color)):n=new Cesium.ImageMaterialProperty({image:fm.a,repeat:new Cesium.Cartesian2(Math.ceil(i.boxSize.x/20),Math.ceil(i.boxSize.y/20))});return i.material=n,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.TransparentTerrainMode"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.scene=this.framework.getActiveMap().getScene(),this.framework.addLayer(this.featureLayer),this.initialized=!0}return!0}},{key:"initClippingPlanes",value:function(){var e=this;this.box=new Cesium.Entity({id:"transparentTerrainBox",position:new Cesium.CallbackProperty(function(){return e.position},!1),box:new Cesium.BoxGraphics({dimensions:this.boxSize,material:this.material})}),this.featureLayer.addEntity(this.box),ym=this.box.computeModelMatrix(Cesium.JulianDate.now());var i=this.boxSize.x/2,n=this.boxSize.y/2,r=Math.abs(this.boxSize.z);this.scene.globe.clippingPlanes=t.createClippingPlane(i,n,r),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes=t.createClippingPlane(i,n,r)})}},{key:"activate",value:function(){this.featureLayer.activate(!0),this.active&&this.deactivate(),Se(b(t.prototype),"activate",this).call(this),this.framework.getLayers().filter(function(e){return e.isActive()&&e instanceof Hn}).forEach(this.setTilesets.bind(this));var e=this.scene.camera.positionCartographic.clone();e.height=0,this.position=Cesium.Cartographic.toCartesian(e,this.scene.globe.ellipsoid,this.position),this.initClippingPlanes();var i=new dm(this.translatePosition.bind(this));this._removeInteraction=xn().addExclusiveInteraction(i,this.deactivate.bind(this)),this.subscribeKey=this.framework.subscribe(B.LAYER_ACTIVATED,this.setTilesets.bind(this)),Q.getInstance().activateClickBehavior()}},{key:"deactivate",value:function(){this.active&&(Se(b(t.prototype),"deactivate",this).call(this),this._removeInteraction&&this._removeInteraction(),this.featureLayer.activate(!1),this.destroyClippingPlanes(),this.framework.unsubscribeByKey(this.subscribeKey),this.subscribeKey=null)}},{key:"setTilesets",value:function(e){if(this.layerNames.includes(e.name)&&e instanceof Hn&&!this.cesium3DTilesetCollection.has(e.name)&&e.cesium3DTileset){this.cesium3DTilesetCollection.set(e.name,e.cesium3DTileset);var i=this.boxSize.x/2,n=this.boxSize.y/2,r=Math.abs(this.boxSize.z);e.cesium3DTileset.clippingPlanes=t.createClippingPlane(i,n,r)}}},{key:"destroyClippingPlanes",value:function(){this.featureLayer.getEntities().removeAll(),this.scene.globe.clippingPlanes&&(this.scene.globe.clippingPlanes.removeAll(),this.scene.globe.clippingPlanes.enabled=!1,this.scene.globe.clippingPlanes=null),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes&&(e.clippingPlanes.removeAll(),e.clippingPlanes.enabled=!1,e.clippingPlanes=null)})}},{key:"translatePosition",value:function(e){var t=R.mercatorToWgs84(e),i=Object(Ie["a"])(t,3),n=i[0],r=i[1],a=i[2];this.position=Cesium.Cartesian3.fromDegrees(n,r,a+this.boxSize.z/2,Cesium.Ellipsoid.WGS84,this.position),this.scene.globe.clippingPlanes.modelMatrix=Cesium.Matrix4.setTranslation(ym,this.position,ym),this.cesium3DTilesetCollection.size>0&&this.cesium3DTilesetCollection.forEach(function(e){e.clippingPlanes.modelMatrix=Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(e._initialClippingPlanesOriginMatrix,e.clippingPlanes.modelMatrix),ym,e.clippingPlanes.modelMatrix)})}}],[{key:"createClippingPlane",value:function(e,t,i){return new Cesium.ClippingPlaneCollection({modelMatrix:ym,planes:[new Cesium.ClippingPlane(new Cesium.Cartesian3(1,0,0),-e),new Cesium.ClippingPlane(new Cesium.Cartesian3(-1,0,0),-e),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,1,0),-t),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,-1,0),-t),new Cesium.ClippingPlane(new Cesium.Cartesian3(0,0,-1),-i)],edgeWidth:1,edgeColor:Cesium.Color.WHITE,enabled:!0})}}]),t}(ra),vm=gm,pm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.flightInstances=i.framework.getFlights(),i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.Flight"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.initialized=!0,this.initializedFinished()}return!0}},{key:"addFlight",value:function(e){this.flightInstances.push(e)}},{key:"deleteFlight",value:function(e){var t=this.flightInstances.indexOf(e);this.flightInstances.splice(t,1)}}]),t}(ra),_m=pm,bm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this)),i.featureTypeSymbol=e.featureTypeSymbol,i.cb=e.cb,i._defaultActive=me.DRAGSTART|me.DRAGEND,i._defaultModificationKey=de.ALT,i.setActive(!1),i}return w(t,e),Object(m["a"])(t,[{key:"pipe",value:function(e){return e.type&me.DRAGSTART&&e.feature&&e.feature[this.featureTypeSymbol]&nn.VERTEX?this._feature=!0:e.type&me.DRAGEND&&this._feature&&(this._feature=!1,this.cb()),Promise.resolve(e)}}]),t}(pe),Lm=bm,Mm=new Cesium.Cartesian3,km=new Cesium.Cartesian3,wm=new Cesium.Cartesian3,Tm=new Cesium.Cartographic,Sm=new Cesium.Cartographic,Om=new Cesium.Cartographic,Cm=new Map,Em=new gt({image:{fill:{color:[168,192,43,.8]},stroke:{color:[0,0,0,1],width:1},radius:5},stroke:{color:[168,192,43,1],width:3},fill:{color:[168,192,43,.8]},text:{font:"bold 18px sans-serif",textBaseline:"bottom",offsetY:-15,offsetX:0,stroke:{color:"#FFFAF0",width:2}}}),Im=function(e){function t(e){var i;Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),e.style&&Em.assign(new gt(e.style)),i.supportedMaps=["vcs.vcm.maps.Cesium"],i.maxNrOfPoints=Object(u["h"])(e.maxNrOfPoints,5e4),i.maxCombinedMemoryUsage=Object(u["h"])(e.maxCombinedMemoryUsage,1024),i._cancelled=!1,i._geometryChangedCB=null;var n=Object(u["g"])(e.defaultResolution,2);return i.values={profilePoints:[],progress:0,running:!1,includeObjects:!0,resolution:n},i.allowSmallExport=Object(u["e"])(e.allowSmallExport,!0),i._cachedProfile=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.heightProfile.HeightProfile"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=Se(b(t.prototype),"initialize",this).call(this);if(!e)return!1;this.featureLayer=new _n({projection:{epsg:3857},name:"_profile",style:Em,altitudeMode:"clampToGround",classificationType:"both"}),this.framework.addLayer(this.featureLayer),this.geometryEditor=new hl({allowedGeometries:["LineString"],defaultMode:"edit",dedicatedFeatureStyle:!1}),this.geometryEditor.initialize(),this.geometryEditor.addEditingLayer(this.featureLayer),this.geometryEditor.selectFeatureInteraction.onSelect(this._onSelect.bind(this)),this.geometryEditor.state.onlyAllowTranslation=!0,this.vertexChangedInteraction=new Lm({cb:this.calculateProfile.bind(this),featureTypeSymbol:this.geometryEditor.state.featureTypeSymbol}),this.initialized=!0,this.initializedFinished()}return!0}},{key:"activate",value:function(){var e=this;Se(b(t.prototype),"activate",this).call(this),this.geometryEditor.activate(),this._cachedProfile&&this.geometryEditor.setMode(tn.EDIT),this.featureLayer.activate(!0);var i=this.framework.getLayers().filter(function(e){return e.active&&(e instanceof Hn||e instanceof Er)});i.length>0&&i.forEach(function(t){var n;if(t instanceof Er){var r=t.getImplementation(e.framework.getActiveMap());n=r.cesium3DTileset}else n=t.cesium3DTileset;Cm.set(n,n.maximumMemoryUsage),n.maximumMemoryUsage=e.maxCombinedMemoryUsage/i.length})}},{key:"deactivate",value:function(){Se(b(t.prototype),"deactivate",this).call(this),this.cancel(),this._geometryChangedCB&&ol.Observable.unByKey(this._geometryChangedCB),this.geometryEditor.state.active&&(this.geometryEditor.interactionChain.removeInteraction(this.vertexChangedInteraction),this.vertexChangedInteraction.setActive(!1),this.geometryEditor.setMode(tn.NONE),this.geometryEditor.deactivate()),this.featureLayer.activate(!1),Cm.forEach(function(e,t){t.maximumMemoryUsage=e})}},{key:"cancel",value:function(){this._cancelled=!0,this._reset(),this._cachedProfile&&this.feature&&this.feature.getGeometry().setCoordinates(this._cachedProfile)}},{key:"_reset",value:function(){this.values.running=!1,this.values.progress=0,this._cachedProfile||this.featureLayer.removeAllFeatures()}},{key:"_onSelect",value:function(){this.geometryEditor.features.size?(this.geometryEditor.interactionChain.chain.includes(this.vertexChangedInteraction)||this.geometryEditor.interactionChain.addInteraction(this.vertexChangedInteraction),this.values.running?this.geometryEditor.selectFeatureInteraction.clearSelectionSet():this.vertexChangedInteraction.setActive()):(this.geometryEditor.interactionChain.removeInteraction(this.vertexChangedInteraction),this.vertexChangedInteraction.setActive(!1))}},{key:"newProfile",value:function(){this._reset(),this.feature=this.geometryEditor.createFeature("LineString","_profileLine"),this.feature.set("olcs_classificationType","both"),this._geometryChangedCB=this.feature.getGeometry().on("change",this.geometryChangedCallback.bind(this)),this.geometryEditor.setModeAndSelectFeature(tn.CREATE,this.feature)}},{key:"geometryChangedCallback",value:function(e){var t=e.target.getCoordinates(),i=t.length;i>2&&(this.geometryEditor.setMode(tn.EDIT),ol.Observable.unByKey(this._geometryChangedCB),this._geometryChangedCB=null,this.calculateProfile())}},{key:"calculateProfile",value:function(){var e=Yu(regeneratorRuntime.mark(function e(){var t,i,n,r,a,s,o,l,c,u,h,d,m=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this._cancelled=!1,this.geometryEditor.selectFeatureInteraction.clearSelectionSet(),this.values.running=!0,this.values.progress=0,t=this.framework.getActiveMap(),i=t.getScene(),n=this.values.includeObjects?i.sampleHeightMostDetailed.bind(i):Cesium.sampleTerrainMostDetailed.bind(null,i.terrainProvider),r=this.feature.getGeometry().getCoordinates(),a=R.mercatorToWgs84(r[0],r[0]),Cesium.Cartographic.fromDegrees(a[0],a[1],null,Tm),s=R.mercatorToWgs84(r[1],r[1]),Cesium.Cartographic.fromDegrees(s[0],s[1],null,Sm),o=new Cesium.EllipsoidGeodesic(Tm,Sm),l=o.surfaceDistance,c=Math.floor(l/this.values.resolution),c>this.maxNrOfPoints&&(c=this.maxNrOfPoints,this.values.resolution=Number((l/this.maxNrOfPoints).toFixed(1))),u=new Array(c),Cesium.Cartographic.toCartesian(Tm,null,Mm),Cesium.Cartographic.toCartesian(Sm,null,km),h=0;case 19:if(!(h<c)){e.next=31;break}return d=void 0,0===h?d=Tm:(Cesium.Cartesian3.lerp(Mm,km,h*this.values.resolution/l,wm),d=Cesium.Cartographic.fromCartesian(wm,null,Om)),e.next=24,n([d]);case 24:if(u[h]=d.height,!this._cancelled){e.next=27;break}return e.abrupt("break",31);case 27:this.values.progress=h/(c-1);case 28:h++,e.next=19;break;case 31:if(!(l/this.values.resolution-c>.01)){e.next=35;break}return e.next=34,n([Sm]);case 34:u.push(Sm.height);case 35:this._cancelled||(this._cachedProfile=this.feature.getGeometry().getCoordinates(),this.values.profilePoints=u.map(function(e,t){return new Cesium.Cartesian2(t*m.values.resolution,e)}),this.values.running=!1,this.values.progress=0);case 36:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"isActiveTerrain",value:function(){var e=this.framework.getLayers(),t=e.find(function(e){return e instanceof zt&&e.active});return!!t}}]),t}(ra),Dm=Im;i(654);function jm(e,t,i){var n=Q.getInstance(),r=e.slLayer;if(r===i.name){var a=e.slId?e.slId.toString():Object(u["c"])(),s=null,o=e.slPos;if(o){var l=o.split(",");s={longitude:parseFloat(l[0]),latitude:parseFloat(l[1]),height:parseFloat(l[2])}}if(i instanceof _n){var c=i.getFeatureById(a);s&&c?(c.set("clickedPosition",s),n.setCurrentItem(a,c,i)):s&&(c=new ol.Feature({}),c.setProperties(e.slAt||{}),c.clickedPosition=s,n.setCurrentItem(a,c,i))}else if(s){var h=e.slAt||{},d={attributes:h,clickedPosition:s};n.setCurrentItem(a,d,i)}else n.setCurrentItem(a,null,i);null!=tm&&t.unsubscribeByKey(tm)}}function Pm(e,t){null!=e.slLayer&&(tm=e.slLayer.startsWith("_searchResultVector")?t.subscribe(B.MAP_ACTIVATED,function(){var i=t.getLayerByName("_searchResultVector");i&&jm(e,t,i)}):t.subscribe(B.LAYER_ACTIVATED,jm.bind(null,e,t)))}function Ym(e,t){var i=a["a"].parse(window.location.href).getQueryParams();if(null!=i.startingmap&&(t.startingmap=i.startingmap),null==i.groundPosition&&null==i.cameraPosition||(t.startViewPoint=V.parseURLparameter(i)),i.verbose&&(Y.enabled=i.verbose),Pm(i,t),null!=i.allowSoftwareRendering){var n=e.maps.find(function(e){return"vcs.vcm.maps.Cesium"===e.type});n&&(n.allowSoftwareRendering=!0)}if(null!=i.layerToActivate){i.layerToActivate=Array.isArray(i.layerToActivate)?i.layerToActivate:[i.layerToActivate];var r=null;i.layerToActivate.forEach(function(e){var i=t.getLayerByName(e);i&&i instanceof Di&&!r&&(r=i,i.isDefaultObliqueLayer=!0)}),r&&t.getLayers().forEach(function(e){e instanceof Di&&e!==r&&(e.isDefaultObliqueLayer=!1)})}return i}function xm(e,t){var i,n,r;if(null!=e.layerToActivate){var a=e.layerToActivate;i=Array.isArray(a)?a:[a];for(var s=0;s<i.length;s++)n=i[s],r=t.getLayerByName(n),!r||r instanceof Di||r.activate(!0)}if(null!=e.layerToDeactivate){var o=e.layerToDeactivate;i=Array.isArray(o)?o:[o];for(var l=0;l<i.length;l++)n=i[l],r=t.getLayerByName(n),!r||r instanceof Di||(r.isCommonLayer()&&r.active&&r.sendLayerEvents(!1,!1),r.activate(!1))}(e["reset-token"]||e["verify-token"])&&Ps.getInstance().handleURLParameter(e),Object.values(t.widgets).forEach(function(t){return t.handleURLParameter(e)}),Object.values(t.maps).forEach(function(t){return t.handleURLParameter(e)}),Object.values(t.layers).forEach(function(t){return t.handleURLParameter(e)}),q.getInstance().handleURLParameter(e),Pe.getInstance().handleURLParameter(e)}function Am(e,t){function i(e,t){Object.keys(t).forEach(function(n){var r=t[n];"object"!==Object(s["a"])(r)||Array.isArray(r)||"object"!==Object(s["a"])(e[n])?e[n]=r:i(e[n],r)})}"object"===Object(s["a"])(e)&&("object"===Object(s["a"])(e.ui)&&i(t.config,{ui:e.ui}),Object.keys(e).filter(function(e){return/^ui_/.test(e)}).forEach(function(n){var r={},a=e[n],s=n.split("_");s.reverse().forEach(function(e,t){var i={};i[e]=t?r:a,r=i}),i(t.config,r)}))}B.FRAMEWORK_INITIALIZED="FRAMEWORK_INITIALIZED";var Fm=(im={},Object(oe["a"])(im,Vt.className,Vt),Object(oe["a"])(im,Hi.className,Hi),Object(oe["a"])(im,Pi.className,Pi),im),Nm=Y.getLogger();function Hm(e){return/maps/.test(e)?Fm[e]:/layer/.test(e)?Object.values(n).find(function(t){return t.className===e}):/widgets/.test(e)?Object.values(r).find(function(t){return t.className===e}):null}function Rm(e){if(!e.type)return Nm.warning("ObjectCreation failed: could not find type in options ".concat(e)),null;var t=Hm(e.type);if(!t)return Nm.warning("ObjectCreation failed: could not find javascript class of type ".concat(e.type)),null;var i=null;try{i=new t(e)}catch(n){Nm.warning("Error: ".concat(n)),i=null}return i||(Nm.warning("ObjectCreation failed: could not create new Object"),null)}function zm(e){var t=ne.getInstance(),i=Rm(e);i&&i instanceof At?(i[ne.configContentSymbol]=!0,t.addLayer(i)&&Nm.info("Loaded layer of type :".concat(e.type," with name: ").concat(e.name))):Nm.warning("Could not load Layer")}function Gm(e){var t=ne.getInstance(),i=Rm(e);i&&i instanceof Ee?t.addMap(i)&&Nm.info("Loaded map of type :".concat(e.type," with name: ").concat(e.name)):Nm.warning("Could not load map")}function Vm(e){var t=ne.getInstance();if(/Oblique\w+Measurement$/.test(e.type)){Nm.warning("Widget of type ".concat(e.type," is deprecated. Use ").concat(Dd.className," or ").concat(Pd.className," instead"));var i="vcs.vcm.widgets.ObliqueHeightMeasurement"===e.type?$h.OBLIQUE_HEIGHT:$h.OBLIQUE_DISTANCE,n=t.getWidgetByType(Dd.className);if(n||(n=t.getWidgetByType(Pd.className)),n)return void(n.allowedMeasurements.includes(i)||n.allowedMeasurements.push(i));e.type=Pd.className,e.allowedMeasurements=[i]}var r=Rm(e);r&&r instanceof ra?t.addWidget(r)&&(Nm.info("Loaded widget of type :".concat(e.type," with name: ").concat(e.name)),r.initialize()):Nm.warning("Could not load widget")}function Bm(e){if(e.name||e.id){var t;if(e.type===Fe.DECLARATIVE||e.declarativeStyle){if(t=new Tt(e),!t.cesiumStyle.ready)return void Nm.warning("declarative style: ".concat(e.name," has errors in the declarative style section and cannot be used"))}else t=new gt(e);t?(t[ne.configContentSymbol]=!0,ne.getInstance().addStyle(t),Nm.info("added ".concat(t.className," with name ").concat(t.name))):Nm.warning("could not create style item: ".concat(e.name))}else Nm.warning("styles need a name. please reconfigure the styles section.")}var Um=["vcs.vcm.widgets.legend.Legend","vcs.vcm.widgets.BalloonInfo","vcs.vcm.widgets.Measurement","vcs.vcm.widgets.SingleMeasurement","vcs.vcm.widgets.Planning"];function Wm(e,t){var i=t.selectBehavior||null;Q.getInstance(i),i=i||{};var n=i.excludedPickPositionEvents;n&&(n=Array.isArray(n)?n:[n]),i.excludedPickPositionEvents=n?n.map(function(e){var t=Object.keys(me).find(function(t){return t===e});return t?me[t]:null}).filter(function(e){return e}).reduce(function(e,t){return e|t},0):0,e.isIE11&&(i.pickTranslucent=i.pickTranslucent||!1,i.excludedPickPositionEvents=i.excludedPickPositionEvents||me.MOVE|me.DRAG),i.excludedPickPositionEvents&&(xn().featureInteraction.excludedPickPositionEvents=i.excludedPickPositionEvents),null!=i.pickTranslucent&&(xn().featureInteraction.pickTranslucent=i.pickTranslucent)}function qm(e){var t=ne.getInstance();if(e.logLevel&&(Y.enabled=e.logLevel),t.projection=new R(e.projection),t.mapcontainer=document.getElementById(e.mapcontainer),t.mapcontainer){for(var i in t.addElementsToMapContainer(),Array.isArray(e.styles)&&e.styles.forEach(Bm),Array.isArray(e.flights)&&e.flights.forEach(function(e){t.addFlight(new Bs(e))}),e.style&&(Nm.deprecate("style","use styles instead."),Array.isArray(e.style)&&e.style.forEach(Bm)),e.layers){var n=e.layers[i];zm(n)}for(var r in e.viewpoints){var a=e.viewpoints[r];t.createViewPointObject(a)}e.startViewPoint&&(t.startViewPoint=t.getViewPointByName(e.startViewPoint)),t.libraryBasePath=e.libraryBasePath||"",t.baseUrl=e.baseUrl||"",e.availableLocales=e.availableLocales||["de","en"],t.config=e,q.getInstance().initialize(e),t.handleUiPlugins(e.ui),Wm(t,e);var s=Ym(e,t);Array.isArray(e.maps)||(Nm.deprecate(".maps Object","Write an array, consistent with the other config keys (layers, widgets etc.)"),e.maps=Object.values(e.maps)),e.maps.forEach(function(e){Gm(e)});var o=t.getMapByName(t.startingmap);if(!o)for(var l in t.maps)t.maps[l].options.startingmap&&(o=t.maps[l]);o&&t.activateMap(o.name,t.startViewPoint);var c=e.widgets?e.widgets.sort(function(e,t){var i=Um,n=i.indexOf(e.type),r=i.indexOf(t.type);return n=n>-1?n:i.length+1,r=r>-1?r:i.length+1,n-r}):[];c.forEach(Vm),xm(s,t),Am(s,t);var u=document.getElementById("vcs_loading");u&&u.parentNode.removeChild(u),xn(),t.publish(B.FRAMEWORK_INITIALIZED),t.setInitialized(!0)}else alert("Could not find Container Element with id ".concat(e.mapcontainer))}function Jm(e){var t=ne.getInstance();t.getLogger().info("Sending request to load JSON config file [".concat(e,"]")),ce.a.get(e).then(function(e){qm(e.data)}).catch(function(e){Nm.log(e)})}function Km(){Yn.destroy(),Q.dispose(),ne.getInstance().dispose()}var Zm=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.commonLayer=e.commonLayer,i.active=!1,i.initialized=!1,i}return w(t,e),Object(m["a"])(t,[{key:"isActive",value:function(){return this.active}},{key:"dispose",value:function(){this.initialized=!1}},{key:"show",value:function(){this.active=!0}},{key:"hide",value:function(){this.active=!1}},{key:"isInitialized",value:function(){return this.initialized}},{key:"mapActivated",value:function(e){return Promise.resolve()}},{key:"mapDeactivated",value:function(e){return Promise.resolve()}},{key:"updateStyle",value:function(e){}}]),t}(A),Qm=Zm,Xm=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.clickListenerActivated=!1,i._removePostRenderHandler=function(){},i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.VectorLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){this.olLayer=new ol.layer.Vector({renderOrder:null,visible:!1,source:this.commonLayer.getSource(),style:this.commonLayer.style.style,name:this.commonLayer.name,zIndex:this.commonLayer.getZIndex(),olcs_altitudeMode:this.commonLayer.altitudeMode,olcs_storeyHeight:this.commonLayer.storeyHeight,olcs_skirt:this.commonLayer.skirt,olcs_heightAboveGround:this.commonLayer.heightAboveGround,olcs_scaleByDistance:this.commonLayer.scaleByDistance,olcs_zCoordinateEyeOffset:this.commonLayer.zCoordinateEyeOffset,olcs_classificationType:this.commonLayer.classificationType,layerName:this.commonLayer.name});var e=this.commonLayer.getMinResolution(),t=this.commonLayer.getMaxResolution();e&&this.olLayer.setMinResolution(e),t&&this.olLayer.setMaxResolution(t),this.initialized=!0}return Promise.resolve()}},{key:"createSynchronization",value:function(e){if(this.commonLayer.visibility&&!this.alreadySynchronized&&e.isInitialized()){e.ol3map;var t=e.getSynchronizer(this);this.counterPart=t.createSingleLayerCounterparts(this.olLayer)[0],t.addCesiumObject(this.counterPart),this.alreadySynchronized=!0}}},{key:"mapActivated",value:function(e){return e instanceof Vt&&this.active&&!this.alreadySynchronized&&this.createSynchronization(e),Promise.resolve()}},{key:"mapDeactivated",value:function(e){if(e instanceof Vt&&this.counterPart&&this.commonLayer.isDynamic){var t=e.getSynchronizer(this);t.destroySingleLayerCounterparts(this.counterPart),this.alreadySynchronized=!1}return Promise.resolve()}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap();this.createSynchronization(e);var i=this.commonLayer.visibility;this.olLayer.setVisible(i),e.initialized&&(this._removePostRenderHandler(),this._removePostRenderHandler=e.getScene().postRender.addEventListener(this.commonLayer.postRenderStyling.bind(this.commonLayer)))}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olLayer.setVisible(!1),this._removePostRenderHandler(),this.commonLayer.FVlastUpdated=0}},{key:"updateStyle",value:function(e){if(this.initialized){if(this.olLayer.setStyle(this.commonLayer.style.style),e)return;var t=this.olLayer.getSource().getFeatures();t.forEach(function(e){e.changed()})}}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}}]),t}(Qm);Ee.registerSpecificLayerImpl(Vt.className,_n.className,Xm),Ee.registerSpecificLayerImpl(Vt.className,ta.className,Xm);var $m=Xm,ef=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.AsyncVectorImplementation"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return Se(b(t.prototype),"initialize",this).call(this).then(this.commonLayer.fetchData.bind(this.commonLayer))}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,xr.className,ef),Ee.registerSpecificLayerImpl(Vt.className,pr.className,ef);var tf=ef,nf=function(e){function t(e){var i;Object(d["a"])(this,t);var n=e.commonLayer.cesiumTilesetLayerOptions,r={className:t.className,name:e.commonLayer.name};return i=y(this,b(t).call(this,Object.assign({},r,n))),i.commonLayer=e.commonLayer,i.style=i.commonLayer.style,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.CesiumTilesetLayerImpl"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){Se(b(t.prototype),"initialize",this).call(this),this.cesium3DTileset[At.vcsLayerNameSymbol]=this.commonLayer.name,this.cesium3DTileset[Or]=!0}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.active=!0}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.active=!1}},{key:"mapActivated",value:function(e){return Promise.resolve()}},{key:"mapDeactivated",value:function(e){return Promise.resolve()}},{key:"updateStyle",value:function(e){this.setStyle(this.commonLayer.style,e)}},{key:"determineHighlightStyle",value:function(){return this.commonLayer.highlightStyle?this.commonLayer.highlightStyle:Q.getInstance()._currentItemHighlightColor}},{key:"objectClickedHandler",value:function(e,i,n){return!!this.commonLayer.allowPicking&&Se(b(t.prototype),"objectClickedHandler",this).call(this,e,i,n||this.commonLayer)}},{key:"getGenericFeatureFromClickedObject",value:function(e){var i=Se(b(t.prototype),"getGenericFeatureFromClickedObject",this).call(this,e);return i.layerName=this.commonLayer.name,i.layerClass=this.commonLayer.className,i}}]),t}(zn);Ee.registerSpecificLayerImpl(Vt.className,Er.className,nf);var rf=nf,af=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.cesiumLayer=null,i}return w(t,e),Object(m["a"])(t,[{key:"show",value:function(){var e=this.framework.getActiveMap();if(e&&e instanceof Vt&&e.isInitialized()&&this.cesiumLayer){Se(b(t.prototype),"show",this).call(this);var i=e.getScene().imageryLayers;if(!i.contains(this.cesiumLayer)){var n=this.commonLayer.index;this.cesiumLayer.VCMLayerIndex=n;for(var r=i.length,a=0;a<i.length;a++){var s=i.get(a),o=s.VCMLayerIndex;if(o&&(!(n>o)&&n<o)){r=a;break}}e.getScene().imageryLayers.add(this.cesiumLayer,r)}this.cesiumLayer.show=!0}}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.cesiumLayer&&(this.cesiumLayer.show=!1)}},{key:"dispose",value:function(){var e=this.framework.getMapByType("vcs.vcm.maps.Cesium");e&&e instanceof Vt&&e.isInitialized()&&e.getScene().imageryLayers.contains(this.cesiumLayer)&&e.getScene().imageryLayers.remove(this.cesiumLayer,!0),this.cesiumLayer=null,this.initialized=!1,this.active=!1}},{key:"updateOpacity",value:function(){this.initialized&&this.cesiumLayer&&(this.cesiumLayer.alpha=this.commonLayer.opacity)}}]),t}(Qm),sf=af,of=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.OpenStreetMapLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){this.cesiumImageryProvider=Cesium.createOpenStreetMapImageryProvider({maximumLevel:19});var e={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(this.cesiumImageryProvider,e),this.initialized=!0}}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,wr.className,of);var lf=of,cf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i.currentExtent=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.singleImageLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||this.updateLayer()}},{key:"mapActivated",value:function(e){var i=this;return Se(b(t.prototype),"mapActivated",this).call(this,e).then(function(){i.currentExtent&&!i.currentExtent.every(function(e,t){return i.commonLayer.imageExtent[t]===e})&&i.updateLayer()})}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={url:this.commonLayer.url,credit:this.commonLayer.credit},i=this.commonLayer.imageExtent;i&&(this.currentExtent=i.slice(),t.rectangle=Cesium.Rectangle.fromDegrees(i[0],i[1],i[2],i[3]));var n=new Cesium.SingleTileImageryProvider(t),r={rectangle:t.rectangle,alpha:this.commonLayer.opacity,defaultAlpha:1};this.cesiumLayer=new Cesium.ImageryLayer(n,r),this.initialized=!0,e&&this.show()}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Mr.className,cf);var uf=cf,hf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.TMSBaseLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e={url:this.commonLayer.getUrl(),fileExtension:this.commonLayer.format,maximumLevel:this.commonLayer.maxLevel,minimumLevel:this.commonLayer.minLevel,show:!1};if(this.commonLayer.extent.isValid()){var t=this.commonLayer.extent.getCoordinatesInProjection(R.createGeographicProjection());e.rectangle=Cesium.Rectangle.fromDegrees(t[0],t[1],t[2],t[3])}"geographic"===this.commonLayer.tilingSchema&&(e.tilingScheme=new Cesium.GeographicTilingScheme);var i=Cesium.createTileMapServiceImageryProvider(e),n={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(i,n),this.initialized=!0}}},{key:"setOpacity",value:function(e){this.cesiumLayer.alpha=e}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Sr.className,hf);var df=hf,mf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.VectorClusterLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return Se(b(t.prototype),"initialize",this).call(this).then(function(){e.olLayer&&e.olLayer.set("olcs_zCoordinateEyeOffset",e.commonLayer.zCoordinateEyeOffset)})}},{key:"createSynchronization",value:function(e){if(!this.alreadySynchronized&&e.isInitialized()){var t=e.clusterSynchronizer,i=t.createSingleLayerCounterparts(this.olLayer)[0];this.clusterDataSource=i.getDataSource(),this.clusterDataSource.clustering.clusterLabels=!1,this.clusterDataSource.clustering.clusterPoints=!1,e.getClusterDatasources().add(this.clusterDataSource);var n=e.getClusterConverter();n.setLayerStyle(this.olLayer,this.commonLayer.cesiumStyleFunction.bind(this.commonLayer)),this.alreadySynchronized=!0}}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,Pr.className,mf);var ff=mf,yf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.WMSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.commonLayer.setCommonSource(),this.updateLayer())}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!0)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!1)}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={url:this.commonLayer.getUrl(),layers:this.commonLayer.layers.join(","),minimumLevel:this.commonLayer.minLevel,maximumLevel:this.commonLayer.maxLevel,show:!1,parameters:this.commonLayer.parameters};if(this.commonLayer.extent&&this.commonLayer.extent.isValid()){var i=this.commonLayer.extent.getCoordinatesInProjection(R.createGeographicProjection());i&&(t.rectangle=Cesium.Rectangle.fromDegrees(i[0],i[1],i[2],i[3]))}"mercator"===this.commonLayer.tilingSchema&&(t.tilingScheme=new Cesium.WebMercatorTilingScheme);var n=new Cesium.WebMapServiceImageryProvider(t),r={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(n,r),this.initialized=!0,e&&this.show()}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Fr.className,yf);var gf=yf,vf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.WMTSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){if(!this.initialized){var e=this.commonLayer.getUrl();e=-1!==e.indexOf("{Layer}")?e.replace("{Layer}",this.commonLayer.layer):e;var t=this.commonLayer.extent.getCoordinatesInProjection(vcs.vcm.util.Projection.createGeographicProjection()),i={url:e,layer:this.commonLayer.layer,style:this.commonLayer.style,format:this.commonLayer.format,tileMatrixSetID:this.commonLayer.tileMatrixSetID,maximumLevel:this.commonLayer.maxLevel,rectangle:Cesium.Rectangle.fromDegrees(t[0],t[1],t[2],t[3])},n={};if((this.commonLayer.numberOfLevelZeroTilesX>1||this.commonLayer.numberOfLevelZeroTilesY>1)&&(n.numberOfLevelZeroTilesX=this.commonLayer.numberOfLevelZeroTilesX,n.numberOfLevelZeroTilesY=this.commonLayer.numberOfLevelZeroTilesY),"geographic"===this.commonLayer.tilingSchema?i.tilingScheme=new Cesium.GeographicTilingScheme(n):i.tilingScheme=new Cesium.WebMercatorTilingScheme(n),this.commonLayer.matrixIds)this.commonLayer.matrixIds.length==this.commonLayer.maxLevel+1?i.tileMatrixLabels=this.commonLayer.matrixIds:this.logger.info("matrixIDs must have the same length as maxZoom");else if(""!==this.commonLayer.tileMatrixPrefix){for(var r=[],a=0;a<this.commonLayer.maxLevel+1;a++)r[a]=String(this.commonLayer.tileMatrixPrefix)+String(a);i.tileMatrixLabels=r}var s=new Cesium.WebMapTileServiceImageryProvider(i),o={alpha:this.commonLayer.opacity};this.cesiumLayer=new Cesium.ImageryLayer(s,o),this.initialized=!0}}}]),t}(sf);Ee.registerSpecificLayerImpl(Vt.className,Hr.className,vf);var pf=vf,_f=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.cesium.Wsv"}}]),t}($m);Ee.registerSpecificLayerImpl(Vt.className,Br.className,_f);var bf=_f,Lf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i.obliqueSource=new ol.source.Vector({}),i.featureListeners={},i.frameworkListeners=[],i.sourceListener=[],i.currentExtent=null,i.fetchedFeaturesForImageName=null,i._postComposeListener=null,i.FVlastUpdated=0,i.featureVisibility=i.commonLayer.featureVisibility,i.globalHider=i.commonLayer.globalHider,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.VectorLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return this.initialized||(this.obliqueMap=this.framework.getActiveMap(),this.initializedPromise=this.obliqueMap.inializedPromise.then(function(){if(e.obliqueMap.initialized){e.olMap=e.obliqueMap.getOl3Map(),e.olLayer=new ol.layer.Vector({renderOrder:null,visible:!1,source:e.obliqueSource,style:e.commonLayer.style.style,name:e.commonLayer.name,zIndex:e.commonLayer.zIndex,altitudeMode:e.commonLayer.getAltitudeMode(),layerName:e.commonLayer.name});var t=e.commonLayer.getMinResolution(),i=e.commonLayer.getMaxResolution();t&&e.olLayer.setMinResolution(t),i&&e.olLayer.setMaxResolution(i),e.initialized=!0}return Promise.resolve()})),this.initializedPromise}},{key:"updateStyle",value:function(){this.initialized&&this.olLayer.setStyle(this.commonLayer.style.style)}},{key:"getFeatureById",value:function(e){return this.obliqueSource.getFeatureById("".concat(e,"_OBLIQUE"))}},{key:"show",value:function(){this.initialized&&(Se(b(t.prototype),"show",this).call(this),this.olLayer.setVisible(this.commonLayer.visibility),this.olMap.addLayer(this.olLayer),null===this._postComposeListener&&(this._postComposeListener=this.olMap.on("postcompose",this.commonLayer.postRenderStyling.bind(this))),this.fetchFeaturesInView())}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}},{key:"addFeature",value:function(e){var i=this;if(this.active||(this.fetchedFeaturesForImageName=null),this.active&&this.currentExtent&&this.framework.getActiveMap()instanceof Pi&&(!e[_n.doNotTransform]||e.getGeometry()[_n.alreadyTransformedToImage]||!e[_n.doNotTransform]&&e.getGeometry().intersectsExtent(this.currentExtent))){var n="".concat(e.getId(),"_OBLIQUE");if(this.obliqueSource.getFeatureById(n))return;var r=new ol.Feature({});r.setId(n),r[_n.originalFeatureSymbol]=e,t.setNewGeometry(e,r),r.setStyle(e.getStyle()),this.featureListeners[n]=new Array(3),this.featureListeners[n][0]=e.on("change:geometry",function(){ol.Observable.unByKey(i.featureListeners[n][2]),t.setNewGeometry(e,r),i.updateGeometry(e,r),i.featureListeners[n][2]=e.getGeometry().on("change",i.updateGeometry.bind(i,e,r))}),this.featureListeners[n][1]=e.on("change",function(){r.setStyle(e.getStyle())}),this.featureListeners[n][2]=e.getGeometry().on("change",this.updateGeometry.bind(this,e,r)),this.updateGeometry(e,r).then(function(){i.obliqueSource.addFeature(r)})}}},{key:"updateGeometry",value:function(e,t){var i=this,n=e.getGeometry();if(!n[_n.alreadyTransformedToImage]){var r=t.getGeometry();return _i(n,r,this.obliqueMap.activeLayer.currentImage).then(function(){i.featureListeners[t.getId()].push(r.once("change",function(){r[_n.imageGeometryChanged]=!0}))})}return t.getGeometry().setCoordinates(e.getGeometry().getCoordinates()),t.getGeometry()[_n.imageGeometryChanged]=!0,Promise.resolve()}},{key:"synchronizeGeometriesAndClearSource",value:function(){var e=this;function t(e){var t=e.getGeometry(),i=t instanceof ol.geom.Circle,n=yi(t);return i&&e.setGeometry(n),n}var i=[];return Object.keys(this.featureListeners).forEach(function(t){ol.Observable.unByKey(e.featureListeners[t]),delete e.featureListeners[t]}),this.obliqueSource.forEachFeature(function(n){var r=n[_n.originalFeatureSymbol];if(!r[_n.doNotTransform]&&n.getGeometry()[_n.imageGeometryChanged]){var a=t(r),s=t(n);i.push(bi(s,a,e.obliqueMap.activeLayer.obliqueCollection.getImageByName(e.fetchedFeaturesForImageName)).then(function(){delete a[_n.alreadyTransformedToImage]}))}}),Promise.all(i).then(function(){e.obliqueSource.clear(!0),e.fetchedFeaturesForImageName=null,e.FVlastUpdated=0})}},{key:"fetchFeaturesInView",value:function(){var e=this;return new Promise(function(t){e.active&&e.fetchedFeaturesForImageName!==e.obliqueMap.getCurrentImage().name&&(e.currentExtent=e.obliqueMap.getExtentOfCurrentImage().getCoordinatesInProjection(R.createMercatorProjection()),e.commonLayer.source.forEachFeatureInExtent(e.currentExtent,function(t){e.addFeature(t)}),e.commonLayer.source.forEachFeature(function(t){t.getGeometry()[_n.alreadyTransformedToImage]&&e.addFeature(t)}),e.fetchedFeaturesForImageName=e.obliqueMap.getCurrentImage().name),t()})}},{key:"removeFeature",value:function(e){var t=this.obliqueSource.getFeatureById("".concat(e.getId(),"_OBLIQUE"));if(t){var i=t.getId(),n=this.featureListeners[i];n&&(ol.Observable.unByKey(n),delete this.featureListeners[i]),this.obliqueSource.removeFeature(t)}}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olMap.removeLayer(this.olLayer),null!=this._postComposeListener&&(ol.Observable.unByKey(this._postComposeListener),this._postComposeListener=null),this.FVlastUpdated=0}},{key:"dispose",value:function(){if(this.olLayer){var e=this.framework.getMapByType("vcs.vcm.maps.Oblique");e.getOl3Map().removeLayer(this.olLayer)}this.olLayer=null,this.initialized=!1,this.active=!1,ol.Observable.unByKey(this.sourceListener),this.sourceListener=[],this.frameworkListeners.forEach(this.framework.unsubscribeByKey,this.framework),this.frameworkListeners=[]}},{key:"mapActivated",value:function(e){var t=this;return this.sourceListener.push(this.commonLayer.source.on("addfeature",function(e){t.addFeature(e.feature)})),this.sourceListener.push(this.commonLayer.source.on("removefeature",function(e){t.removeFeature(e.feature)})),this.sourceListener.push(this.commonLayer.source.on("changefeature",function(e){var i="".concat(e.feature.getId(),"_OBLIQUE");t.featureListeners[i]||t.addFeature(e.feature)})),this.frameworkListeners.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,function(){t.synchronizeGeometriesAndClearSource().then(function(){t.fetchFeaturesInView()})})),this.fetchFeaturesInView()}},{key:"mapDeactivated",value:function(e){return ol.Observable.unByKey(this.sourceListener),this.sourceListener=[],this.frameworkListeners.forEach(this.framework.unsubscribeByKey,this.framework),this.frameworkListeners=[],this.synchronizeGeometriesAndClearSource()}}],[{key:"setNewGeometry",value:function(e,t){var i=e.getGeometry().clone();t.setGeometry(e.getGeometry()[_n.alreadyTransformedToImage]?i:yi(i)),e.getGeometry()[_n.alreadyTransformedToImage]&&t.getGeometry().setProperties(e.getGeometry().getProperties(),!1),e[_n.obliqueGeometry]=t.getGeometry()}}]),t}(Qm);Ee.registerSpecificLayerImpl(Pi.className,_n.className,Lf),Ee.registerSpecificLayerImpl(Pi.className,ta.className,Lf);var Mf=Lf,kf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.oblique.AsyncVectorImplementation"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){return Se(b(t.prototype),"initialize",this).call(this).then(this.commonLayer.fetchData.bind(this.commonLayer))}}]),t}(Mf);Ee.registerSpecificLayerImpl(Pi.className,xr.className,kf),Ee.registerSpecificLayerImpl(Pi.className,pr.className,kf),Ee.registerSpecificLayerImpl(Pi.className,Br.className,kf);var wf=kf,Tf=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.clusterSource=new ol.source.Cluster({source:i.obliqueSource}),i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this;return Se(b(t.prototype),"initialize",this).call(this).then(function(){e.clusterSource.setDistance(e.commonLayer.clusterSource.getDistance()),e.olLayer.setSource(e.clusterSource)})}},{key:"show",value:function(){this.initialized&&(null===this._postComposeListener&&(this._postComposeListener=this.olMap.on("postcompose",this.commonLayer.postRenderStyling.bind(this.commonLayer))),Se(b(t.prototype),"show",this).call(this))}},{key:"mapActivated",value:function(e){var t=this,i=function(){t.synchronizeGeometriesAndClearSource().then(function(){t.fetchFeaturesInView()})};return this.sourceListener.push(this.commonLayer.source.on("change",i)),this.frameworkListeners.push(this.framework.subscribe(B.OBLIQUE_IMAGE_CHANGED,i)),this.fetchFeaturesInView()}}]),t}(Mf);Ee.registerSpecificLayerImpl(Pi.className,Pr.className,Tf);var Sf=Tf,Of=function(e){function t(e){var i;return Object(d["a"])(this,t),i=y(this,b(t).call(this,e)),i.olLayer=null,i}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.olLayer=this.getOLLayer(),this.initialized=!0)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap(),i=null,n=e.getOl3Map().getLayers().getArray(),r=this.commonLayer.index;this.olLayer.VCMLayerIndex=r;for(var a=null,s=0;s<n.length;s++){if(n[s]==this.olLayer){i=n[s];break}var o=n[s].VCMLayerIndex;o&&(r>o||r<o&&null===a&&(a=s))}i||(null===a&&(a=n.length),e.getOl3Map().getLayers().insertAt(a,this.olLayer));var l=!this.commonLayer.isVisible||this.commonLayer.visibility;this.olLayer.setVisible(l)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.olLayer.setVisible(!1)}},{key:"dispose",value:function(){if(this.olLayer){var e=this.framework.getMapByType("vcs.vcm.maps.Openlayers");e.getOl3Map().removeLayer(this.olLayer)}this.olLayer=null,this.initialized=!1,this.active=!1}},{key:"getOLLayer",value:function(){throw new Error}}]),t}(Qm),Cf=Of,Ef=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=e.className?e.className:t.className,i=y(this,b(t).call(this,e)),i._postComposeListener=null,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.VectorLayer"}}]),Object(m["a"])(t,[{key:"updateStyle",value:function(){this.initialized&&this.olLayer.setStyle(this.commonLayer.style.style)}},{key:"getOLLayer",value:function(){var e=new ol.layer.Vector({renderOrder:null,visible:!1,source:this.commonLayer.getSource(),style:this.commonLayer.style.style,zIndex:this.commonLayer.zIndex,name:this.commonLayer.name,altitudeMode:"clampToGround"}),t=this.commonLayer.maxResolution,i=this.commonLayer.minResolution;return t&&e.setMinResolution(t),i&&e.setMaxResolution(i),e}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this);var e=this.framework.getActiveMap();null===this._postComposeListener&&(this._postComposeListener=e.ol3map.on("postcompose",this.commonLayer.postRenderStyling.bind(this.commonLayer)))}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),null!=this._postComposeListener&&(ol.Observable.unByKey(this._postComposeListener),this._postComposeListener=null),this.commonLayer.FVlastUpdated=0}},{key:"setVisibility",value:function(e){this.initialized&&this.olLayer.setVisible(e)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,_n.className,Ef),Ee.registerSpecificLayerImpl(Hi.className,Br.className,Ef),Ee.registerSpecificLayerImpl(Hi.className,ta.className,Ef);var If=Ef,Df=function(e){function t(e){return Object(d["a"])(this,t),y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,[{key:"initialize",value:function(){var e=this.commonLayer.fetchData();return Se(b(t.prototype),"initialize",this).call(this),e}}]),t}(If);Ee.registerSpecificLayerImpl(Hi.className,xr.className,Df),Ee.registerSpecificLayerImpl(Hi.className,pr.className,Df),Ee.registerSpecificLayerImpl(Hi.className,Er.className,Df);var jf=Df,Pf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.OpenStreetMapLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){return new ol.layer.Tile({opacity:this.commonLayer.opacity,source:new ol.source.OSM})}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,wr.className,Pf);var Yf=Pf,xf=function(e){function t(e){var i;return Object(d["a"])(this,t),e.className=t.className,i=y(this,b(t).call(this,e)),i.commonLayer=i.commonLayer,i}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.SingleImageLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||this.updateLayer()}},{key:"getOLLayer",value:function(){return this.initialized||this.initialize(),this.olLayer}},{key:"updateLayer",value:function(){var e=this.isActive();this.initialized&&this.dispose();var t={attributions:this.commonLayer.credit,url:this.commonLayer.url,projection:"EPSG:4326",imageExtent:this.commonLayer.imageExtent};a["a"].hasSameOrigin(this.commonLayer.getUrl())||(t.crossOrigin="anonymous"),this.olLayer=new ol.layer.Image({source:new ol.source.ImageStatic(t),opacity:this.commonLayer.opacity}),this.initialized=!0,e&&this.show()}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Mr.className,xf);var Af=xf,Ff=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.TMSBaseLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){var e={tileUrlFunction:function(e){var t="".concat(Cesium.appendForwardSlash(this.commonLayer.getUrl()),"{z}/{x}/{y}.").concat(this.commonLayer.format),i=(1<<e[0])- -e[2];return t.replace("{z}",e[0].toString()).replace("{x}",e[1].toString()).replace("{y}",i.toString())}.bind(this),tileSize:[this.commonLayer.tileWidth,this.commonLayer.tileHeight],minZoom:this.commonLayer.minLevel,maxZoom:this.commonLayer.maxLevel,wrapx:!1};a["a"].hasSameOrigin(this.commonLayer.getUrl())||(e.crossOrigin="anonymous"),"geographic"===this.commonLayer.tilingSchema&&(e.projection="EPSG:4326");var t={source:new ol.source.XYZ(e),opacity:this.commonLayer.opacity};this.commonLayer.extent.isValid()&&(t.extent=this.commonLayer.extent.getCoordinatesInProjection(R.createMercatorProjection()));var i=new ol.layer.Tile(t);return i}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Sr.className,Ff);var Nf=Ff,Hf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.VectorClusterLayer"}}]),t}(If);Ee.registerSpecificLayerImpl(Hi.className,Pr.className,Hf);var Rf=Hf,zf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.WMSLayer"}}]),Object(m["a"])(t,[{key:"initialize",value:function(){this.initialized||(this.olLayer=this.getOLLayer(),this.initialized=!0)}},{key:"show",value:function(){Se(b(t.prototype),"show",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!0)}},{key:"hide",value:function(){Se(b(t.prototype),"hide",this).call(this),this.commonLayer.getUseFeatureInfo()&&this.commonLayer.activateFeatureInfo(!1)}},{key:"getOLLayer",value:function(){return this.commonLayer.setCommonSource(),new ol.layer.Tile({renderOrder:null,visible:!1,source:this.commonLayer.wmsSource,opacity:this.commonLayer.opacity})}},{key:"updateLayer",value:function(){return!0}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Fr.className,zf);var Gf=zf,Vf=function(e){function t(e){return Object(d["a"])(this,t),e.className=t.className,y(this,b(t).call(this,e))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.layer.openlayers.WMTSLayer"}}]),Object(m["a"])(t,[{key:"getOLLayer",value:function(){var e=R.createMercatorProjection();"geographic"===this.commonLayer.tilingSchema&&(e=R.createGeographicProjection());var t=e.getProjection().getExtent(),i=ol.extent.getWidth(t)/256;this.commonLayer.numberOfLevelZeroTilesX>1&&(i/=this.commonLayer.numberOfLevelZeroTilesX),"geographic"===this.commonLayer.tilingSchema&&(i=ol.extent.getWidth(t)/512);for(var n=this.commonLayer.maxLevel+1,r=new Array(n),s=new Array(n),o=0;o<n;++o)r[o]=i/Math.pow(2,o),s[o]=String(this.commonLayer.tileMatrixPrefix)+String(o);this.commonLayer.matrixIds&&(this.commonLayer.matrixIds.length==n?s=this.commonLayer.matrixIds:this.logger.info("matrixIDs must have the same length as maxZoom"));var l=this.commonLayer.extent.getCoordinatesInProjection(e),c={origin:ol.extent.getTopLeft(t),extent:l,resolutions:r,matrixIds:s,minZoom:this.commonLayer.minLevel};if(this.commonLayer.numberOfLevelZeroTilesX>1||this.commonLayer.numberOfLevelZeroTilesY>1){for(var u=[],h=this.commonLayer.numberOfLevelZeroTilesX,d=this.commonLayer.numberOfLevelZeroTilesY,m=0;m<=n;m++)u.push([h,-d]),h*=2,d*=2;c.sizes=u}var f=new ol.tilegrid.WMTS(c),y=this.commonLayer.getUrl().indexOf("{")>=0?"REST":"KVP",g={tileGrid:f,requestEncoding:y,layer:this.commonLayer.layer,style:this.commonLayer.style,format:this.commonLayer.format,matrixSet:this.commonLayer.tileMatrixSetID,url:this.commonLayer.getUrl()};for(var v in a["a"].hasSameOrigin(this.commonLayer.getUrl())||(g.crossOrigin="anonymous"),"geographic"===this.commonLayer.tilingSchema&&(g.projection="EPSG:4326"),this.commonLayer.olOptions)g[v]=this.commonLayer.olOptions[v];return new ol.layer.Tile({opacity:this.commonLayer.opacity,source:new ol.source.WMTS(g)})}},{key:"updateOpacity",value:function(){this.initialized&&this.olLayer.setOpacity(this.commonLayer.opacity)}}]),t}(Cf);Ee.registerSpecificLayerImpl(Hi.className,Hr.className,Vf);var Bf=Vf;function Uf(e,t){var i=ne.getInstance(),n=i.getActiveMap(),r={};r.startingmap=n.name,r.lang=i.getLocale(),r.layerToActivate=[],r.layerToDeactivate=[],i.getLayers().filter(function(e){return e[ne.configContentSymbol]&&e.isSupported(n)}).forEach(function(e){e.active!==e.activeOnStartup&&(e.active?r.layerToActivate.push(e.name):r.layerToDeactivate.push(e.name))}),r.layerToActivate.length||delete r.layerToActivate,r.layerToDeactivate.length||delete r.layerToDeactivate,delete e.queryParams.epsg,t&&(r.epsg=i.getProjection().epsg.match(/\d+/)[0]),e.addQueryParams(r);var a=i.getSelectBehavior();return a&&a.getLink(e),Pe.getInstance().getLink(e),n.getViewPoint(!0,!0).then(function(t){return t.getLink(e),e.toString()}).catch(function(){return e.toString()})}function Wf(e){var t=ne.getInstance(),i=a["a"].parse(window.location.href);if(t.baseUrl){var n=a["a"].parse(t.baseUrl);i.base=n.base,i.path=n.path}for(var r=t.getWidgets(),s=0;s<r.length;s++)r[s].getLink(i);return Uf(i,e)}i(641);var qf,Jf=Y.getLogger("vcs.vcm.util.flight.FlightPlayer"),Kf=function(){function e(){var t=this;Object(d["a"])(this,e),this.destinationSpline=null,this.quaternionSpline=null,this.values={playing:!1,paused:!1,multiplier:1,activeInstance:null,repeat:!1,valid:!1},this.clock={startTime:0,endTime:0,currentTime:0,times:[],currentSystemTime:null},this._postRenderHandler=null,this._flightInstanceChangeHandler=null,this.screenSpaceCameraController=null,this.readyPromise=Promise.resolve(),ne.getInstance().subscribe("MAP_ACTIVATED",function(){t.stop()})}return Object(m["a"])(e,[{key:"setActiveFlightInstance",value:function(e){var t=this;o(e,Bs),this.values.playing&&this.stop(),this.values.activeInstance=e;var i=Pe.getInstance();return i.values.walkmode&&i.activateOverviewMode(),this.readyPromise=e.ready.then(function(){t.values.activeInstance===e&&(t._flightInstanceChangeHandler&&(t._flightInstanceChangeHandler(),t._flightInstanceChangeHandler=null),t.changeHandler(),t._flightInstanceChangeHandler=e.changed.addEventListener(t.changeHandler.bind(t)))}),this.readyPromise}},{key:"clearActiveFlight",value:function(){this.values.playing&&this.stop(),this._flightInstanceChangeHandler&&(this._flightInstanceChangeHandler(),this._flightInstanceChangeHandler=null),this.values.activeInstance=null}},{key:"play",value:function(){var e=Yu(regeneratorRuntime.mark(function e(t){var i,n,r;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(l(t,Bs),t||this.values.activeInstance){e.next=5;break}throw i="Player cannot play without activeInstance, provide a flightInstance or call setActiveInstance",Jf.error(i),new Error(i);case 5:if(this._postRenderHandler&&(this._postRenderHandler(),this._postRenderHandler=null),!t||this.values.activeInstance===t){e.next=11;break}return e.next=9,this.setActiveFlightInstance(t);case 9:if(this.values.activeInstance===t){e.next=11;break}return e.abrupt("return");case 11:n=ne.getInstance().getActiveMap(),n instanceof Vt&&(r=n.getScene(),this.screenSpaceCameraController=r.screenSpaceCameraController,this._postRenderHandler=r.postRender.addEventListener(this._cesiumPostRender.bind(this))),this.clock.currentSystemTime=null,this.values.playing=!0;case 15:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}()},{key:"_cesiumPostRender",value:function(e){var t=Date.now()/1e3;this.clock.currentSystemTime||(this.clock.currentSystemTime=t);var i=t-this.clock.currentSystemTime;if(this.clock.currentSystemTime=t,this.values.paused)this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!0);else{if(this.clock.currentTime+=i*this.values.multiplier,this.clock.currentTime>this.clock.endTime){if(!this.values.repeat)return void this.stop();this.clock.currentTime=this.clock.currentTime-this.clock.endTime}else if(this.clock.currentTime<this.clock.startTime){if(!this.values.repeat)return void(this.clock.currentTime=this.clock.startTime);this.clock.currentTime=this.clock.endTime+this.clock.currentTime}var n={destination:this.destinationSpline.evaluate(this.clock.currentTime),orientation:Cesium.HeadingPitchRoll.fromQuaternion(this.quaternionSpline.evaluate(this.clock.currentTime))};e.camera.setView(n),this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!1)}}},{key:"stop",value:function(){this._postRenderHandler&&(this._postRenderHandler(),this._postRenderHandler=null),this.screenSpaceCameraController&&(this.screenSpaceCameraController.enableInputs=!0),this.values.playing=!1,this.values.paused=!1,this.clock.currentTime=0,this.clock.currentSystemTime=null}},{key:"goToTime",value:function(e){if(this.values.activeInstance&&this.values.activeInstance.isValid()){if(e>this.clock.endTime)Jf.warning("time: ".concat(e," out of range"));else if(this.clock.currentTime=e,this.clock.currentSystemTime=null,!this.values.playing||this.values.playing&&this.values.paused){var t=ne.getInstance().getActiveMap();if(t instanceof Vt){var i={destination:this.destinationSpline.evaluate(this.clock.currentTime),orientation:Cesium.HeadingPitchRoll.fromQuaternion(this.quaternionSpline.evaluate(this.clock.currentTime))};t.getScene().camera.setView(i)}}}else Jf.warning("cannot go to time on missing or invalid flight")}},{key:"forward",value:function(){var e=this.clock.currentTime,t=this.clock.times.find(function(t){return t>e})||this.clock.times[this.clock.times.length-1];this.goToTime(t)}},{key:"backward",value:function(){var e=this,t=this.clock.currentTime,i=this.clock.times.findIndex(function(e){return e>=t})-1;this.backedBefore&&(i-=1,clearTimeout(this.backedBeforeTimeout)),i<0&&(i=0);var n=this.clock.times[i];this.goToTime(n),this.backedBefore=!0,this.backedBeforeTimeout=setTimeout(function(){e.backedBefore=!1},700)}},{key:"changeHandler",value:function(){this.values.activeInstance&&(this.values.valid=this.values.activeInstance.isValid(),this.values.valid&&this._updateSplines())}},{key:"_updateSplines",value:function(){var e=this.values.activeInstance,t=e.loop,i=e.viewpoints,n=t?i.length+1:i.length,r=new Array(n),a=new Array(n),s=new Array(n);i.forEach(function(e,t){if(r[t]=Cesium.Cartesian3.fromDegrees(e.cameraPosition[0],e.cameraPosition[1],e.cameraPosition[2]),a[t]=Cesium.Quaternion.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(e.heading,e.pitch,e.roll)),t>0){var n=i[t-1];n.duration||(n.duration=Cesium.Cartesian3.distance(r[t-1],r[t])/300||1),s[t]=s[t-1]+n.duration}else s[t]=0}),t&&(r[n-1]=Cesium.Cartesian3.fromDegrees(i[0].cameraPosition[0],i[0].cameraPosition[1],i[0].cameraPosition[2]),a[n-1]=Cesium.Quaternion.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(i[0].heading,i[0].pitch,i[0].roll)),i[n-2].duration||(i[n-2].duration=Cesium.Cartesian3.distance(r[n-2],r[n-1])/300||1),s[n-1]=s[n-2]+i[n-2].duration),this.destinationSpline=this.values.activeInstance.interpolation===Gs.SPLINE?new Cesium.CatmullRomSpline({times:s,points:r}):new Cesium.LinearSpline({times:s,points:r}),this.quaternionSpline=new Cesium.QuaternionSpline({times:s,points:a}),this.clock.endTime=s[n-1],this.clock.times=s,this.values.repeat=t}}]),e}();function Zf(){return qf||(qf=new Kf),qf}var Qf=Y.getLogger("vcs.vcm.util.flight.FlightVisualizer"),Xf=null,$f=new Cesium.Cartographic,ey=function(){function e(){var t=this;Object(d["a"])(this,e),this.extent=ol.extent.createEmpty(),this.flightLayer=new _n({projection:R.createGeographicProjection(),name:"_scratchFlightLayer",style:{declarativeStyle:{labelText:"${title}",image:"false",color:'color("#333333")',strokeWidth:"2"}},altitudeMode:"absolute"}),this._primitives=new Cesium.PrimitiveCollection,this.activeInstance=null,this._flightInstanceChangeHandler=null,this._mapActivatedListener=ne.getInstance().subscribe("MAP_ACTIVATED",function(){t.hide()})}return Object(m["a"])(e,[{key:"_createFeatures",value:function(){var e=this;this.flightLayer.removeAllFeatures();var t=ne.getInstance().getMapByType(Vt.className);if(t){var i=t.getScene();this._primitives.removeAll();var n=this.activeInstance.viewpoints.map(function(t,n){var r=new Cesium.Camera(i);return r.frustum.far=200,r.frustum.near=10,r.setView({destination:Cesium.Cartesian3.fromDegrees(t.cameraPosition[0],t.cameraPosition[1],t.cameraPosition[2]),orientation:Cesium.HeadingPitchRoll.fromDegrees(t.heading,t.pitch,t.roll)}),e._primitives.add(new Cesium.VcsCameraPrimitve({camera:r,allowPicking:!1})),new ol.Feature({geometry:new ol.geom.Point(t.cameraPosition,"XYZ"),title:t.name||"".concat(q.getInstance().getSingleMessage("i18n_viewpointeditor_number")," ").concat(n+1),duration:t.duration})});if(this.activeInstance.isValid()){var r=[],a=Zf();if(a.values.activeInstance===this.activeInstance){if(this.activeInstance.interpolation===Gs.SPLINE){for(var s=function(e){Cesium.Cartographic.fromCartesian(a.destinationSpline.evaluate(e),null,$f),r.push([Cesium.Math.toDegrees($f.longitude),Cesium.Math.toDegrees($f.latitude),$f.height])},o=a.clock.endTime,l=o/.2>500?o/500:.2,c=0;c<o;c+=l)s(c);s(o)}else n.forEach(function(e){r.push(e.getGeometry().getCoordinates())}),this.activeInstance.loop&&r.push(r[0]);var u=new ol.Feature({geometry:new ol.geom.LineString(r),title:"Flight Path"});u.setId("flightPathGeom"),n.push(u)}this.flightLayer.addFeatures(n);var h=this.flightLayer.getSource().getExtent();this.extent=N(h,h,2)}}else Qf.error("could not find a cesium map!")}},{key:"_makeDirty",value:function(){this.flightLayer.active&&this._createFeatures()}},{key:"visualizeFlight",value:function(e){var t=this;o(e,Bs);var i=ne.getInstance().getMapByType(Vt.className);if(!i)return Qf.error("could not find a cesium map!"),Promise.reject(new Error("could not find cesium map"));var n=Zf();return n.values.activeInstance!==e&&n.setActiveFlightInstance(e),n.readyPromise.then(function(){if(n.values.activeInstance===e){t._flightInstanceChangeHandler&&(t._flightInstanceChangeHandler(),t._flightInstanceChangeHandler=null),t._flightInstanceChangeHandler=e.changed.addEventListener(t._makeDirty.bind(t)),t.activeInstance=e,t._createFeatures(),t.flightLayer.activate(!0);var r=i.getScene();t._primitives.show=!0,r.primitives.contains(t._primitives)||r.primitives.add(t._primitives)}})}},{key:"hide",value:function(){this.flightLayer.activate(!1),this._primitives.show=!1}},{key:"dispose",value:function(){ne.getInstance().unsubscribeByKey(this._mapActivatedListener),this.flightLayer.dispose(),this._primitives.destroy(),Xf=null}},{key:"zoomToExtent",value:function(){if(this.activeInstance&&this.activeInstance.isValid()&&!ol.extent.isEmpty(this.extent)){var e=V.createViewPointFromExtent(this.extent),t=ne.getInstance();t.getActiveMap().gotoViewPoint(e)}}}]),e}();function ty(){return Xf||(Xf=new ey),Xf}var iy=Y.getLogger("vcs.vcm.util.style.Icon"),ny=new Map,ry={FAILED:0,IDLE:1,LOADING:2,LOADED:4,TINTED:8},ay=function(){function e(t){Object(d["a"])(this,e),this.src=t,this.image=new Image,this.state=ry.IDLE,this.size=[32,32],this.canvas=document.createElement("canvas"),ny.set(t,this)}return Object(m["a"])(e,[{key:"load",value:function(){var e=this;return this.state===ry.IDLE?(this.state=ry.LOADING,new Promise(function(t,i){e.image.onerror=function(t){e.state=ry.FAILED,i(t)},e.image.onload=function(){e.state=ry.LOADED},e.image.src=e.src})):Promise.resolve()}},{key:"_drawImage",value:function(){var e=this.canvas.getContext("2d");e.drawImage(this.image,0,0,this.size[32],this.size[32])}},{key:"tint",value:function(e){this.state&(ry.LOADED|ry.TINTED)?Qe(this.canvas.getContext("2d"),e,this.size):iy.debug("cannot tint unloaded image")}},{key:"untint",value:function(){this.state===ry.TINTED?(this._drawImage(),this.state=ry.TINTED):iy.debug("trying to untint a non-tinted image")}}]),e}(),sy=ay;function oy(e){return ny.get(e)}var ly=function(e){function t(){return Object(d["a"])(this,t),y(this,b(t).call(this,{className:t.className}))}return w(t,e),Object(m["a"])(t,null,[{key:"className",get:function(){return"vcs.vcm.widgets.search.ErrorItem"}}]),t}(nh),cy=ly;ol.geom.Circle.prototype.getCoordinates=function(){return[this.getCenter(),this.getLastCoordinate()]},ol.geom.Circle.prototype.setCoordinates=function(e,t){o(e,[[Number]]),o(e.length,2);var i=t||this.getLayout(),n=/XYM?/.test(i)?ri:ai;this.setCenterAndRadius(e[0],n.apply(void 0,Object(T["a"])(e)),t)},ol.geom.Circle.prototype.rotate=function(e,t){},ol.geom.GeometryCollection.prototype.getCoordinates=function(){return this.getGeometries().map(function(e){return e.getCoordinates()})},ol.geom.GeometryCollection.prototype.setCoordinates=function(e,t){o(e,Array),o(e.length,this.getGeometries().length),this.setGeometries(this.getGeometries().map(function(i,n){return i.setCoordinates(e[n],t),i}))};i(714),i(715),i(716),i(717);var uy=new Cesium.Cartesian3,hy=new Cesium.Matrix3,dy=new Cesium.Quaternion,my=new Cesium.Color,fy=[1,1e5],yy=function(){function e(t){Object(d["a"])(this,e),this._outlinePrimitives=[],this._planesPrimitives=[],this.show="undefined"===typeof t.show||t.show,this._camera=t.camera,this._color=t.color||Cesium.Color.YELLOW,this.allowPicking="undefined"===typeof t.allowPicking||t.allowPicking,this.id=t.id||{}}return Object(m["a"])(e,[{key:"update",value:function(e){if(this.show){var t,i,n=this._planesPrimitives,r=this._outlinePrimitives;if(0===n.length){var a=this._camera,s=a.frustum,o=s.clone(),l=fy;l[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far;var c=a.positionWC,u=a.directionWC,h=a.upWC,d=a.rightWC;d=Cesium.Cartesian3.negate(d,uy);var m=hy;Cesium.Matrix3.setColumn(m,0,d,m),Cesium.Matrix3.setColumn(m,1,h,m),Cesium.Matrix3.setColumn(m,2,u,m);var f=Cesium.Quaternion.fromRotationMatrix(m,dy);n.length=1,r.length=1,o.near=l[0],o.far=l[1],n[0]=new Cesium.Primitive({allowPicking:this.allowPicking,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:c,orientation:f,frustum:o,_drawNearPlane:!0}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(this._color,.1,my))},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1}),r[0]=new Cesium.Primitive({allowPicking:this.allowPicking,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:c,orientation:f,frustum:o,_drawNearPlane:!0}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}for(i=n.length,t=0;t<i;++t)r[t].update(e),n[t].update(e)}}},{key:"destroy",value:function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return Cesium.destroyObject(this)}}]),e}();Cesium.VcsCameraPrimitve=yy,i.d(t,"vcs",function(){return gy});var gy={};window["vcs"]=gy,gy.Url=a["a"],gy.check=o,gy.checkMaybe=l,gy.deepForEach=u["a"],gy.eventCannotBeFromMap=u["b"],gy.isEmail=u["d"],gy.oblique={},gy.oblique.viewDirectionNames=h["c"],gy.parseBoolean=u["e"],gy.parseEnumValue=u["f"],gy.vcm={},gy.vcm.ExclusiveManager=se,gy.vcm.Framework=ne,gy.vcm.Framework.dispose=Km,gy.vcm.Framework.getObjectFromOptions=Rm,gy.vcm.Framework.init=qm,gy.vcm.Framework.loadConfig=Jm,gy.vcm.NavigationMode=Pe,gy.vcm.SelectBehavior=Q,gy.vcm.cityGML={},gy.vcm.cityGML.AllFeatureTypes=xc,gy.vcm.cityGML.AllProperties=Ac,gy.vcm.cityGML.AllPropertiesDateGeneric=zc,gy.vcm.cityGML.AllPropertiesDateNonGeneric=Hc,gy.vcm.cityGML.AllPropertiesValueGeneric=Nc,gy.vcm.cityGML.AllPropertiesValueNonGeneric=Fc,gy.vcm.cityGML.AllPropertiesYearNonGeneric=Rc,gy.vcm.cityGML.Namespaces=Yc,gy.vcm.event={},gy.vcm.event.EventType=B,gy.vcm.i18n=q,gy.vcm.interaction={},gy.vcm.interaction.AbstractInteraction=pe,gy.vcm.interaction.BitCounter=he,gy.vcm.interaction.EventHandler={},gy.vcm.interaction.EventHandler.getInstance=xn,gy.vcm.interaction.EventType=me,gy.vcm.interaction.ModificationKeyType=de,gy.vcm.interaction.PointerKeyType=fe,gy.vcm.layer={},gy.vcm.layer.AbstractRasterLayer=br,gy.vcm.layer.CommonLayer=$i,gy.vcm.layer.CommonLayerImpl=Qm,gy.vcm.layer.FeatureStore=ta,gy.vcm.layer.FeatureStore.featureStoreState=er,gy.vcm.layer.GeoJSON=pr,gy.vcm.layer.GeoJSON.getEPSGCodeFromGeojson=lr,gy.vcm.layer.GeoJSON.parseGeoJSON=fr,gy.vcm.layer.GeoJSON.updateLegacyFeature=cr,gy.vcm.layer.GeoJSON.writeGeoJSON=gr,gy.vcm.layer.GlobalHider={},gy.vcm.layer.GlobalHider.getInstance=It,gy.vcm.layer.Layer=At,gy.vcm.layer.OpenStreetMap=wr,gy.vcm.layer.SingleImage=Mr,gy.vcm.layer.TMSBase=Sr,gy.vcm.layer.TiledLayer=Er,gy.vcm.layer.Vector=_n,gy.vcm.layer.VectorCluster=Pr,gy.vcm.layer.WFS=xr,gy.vcm.layer.WMTS=Hr,gy.vcm.layer.WSV=Br,gy.vcm.layer.Wms=Fr,gy.vcm.layer.cesium={},gy.vcm.layer.cesium.AbstractCesiumTilesetLayer=Hn,gy.vcm.layer.cesium.AsyncVectorImplementation=tf,gy.vcm.layer.cesium.Buildings=Vn,gy.vcm.layer.cesium.CesiumTilesetLayer=zn,gy.vcm.layer.cesium.CesiumTilesetLayerImpl=rf,gy.vcm.layer.cesium.Czml=qn,gy.vcm.layer.cesium.Entities=Un,gy.vcm.layer.cesium.Gltf=Kn,gy.vcm.layer.cesium.ImageryLayer=sf,gy.vcm.layer.cesium.OpenStreetMapLayer=lf,gy.vcm.layer.cesium.PointCloud=Xn,gy.vcm.layer.cesium.SingleImageLayer=uf,gy.vcm.layer.cesium.TMSBaseLayer=df,gy.vcm.layer.cesium.Terrain=zt,gy.vcm.layer.cesium.VectorClusterLayer=ff,gy.vcm.layer.cesium.VectorLayer=$m,gy.vcm.layer.cesium.WMSLayer=gf,gy.vcm.layer.cesium.WMTSLayer=pf,gy.vcm.layer.cesium.Wsv=bf,gy.vcm.layer.oblique={},gy.vcm.layer.oblique.AsyncVectorImplementation=wf,gy.vcm.layer.oblique.ObliqueLayer=Di,gy.vcm.layer.oblique.VectorClusterLayer=Sf,gy.vcm.layer.oblique.VectorLayer=Mf,gy.vcm.layer.openlayers={},gy.vcm.layer.openlayers.AsyncVectorImplementation=jf,gy.vcm.layer.openlayers.Layer=Cf,gy.vcm.layer.openlayers.OpenStreetMapLayer=Yf,gy.vcm.layer.openlayers.SingleImageLayer=Af,gy.vcm.layer.openlayers.TMSBaseLayer=Nf,gy.vcm.layer.openlayers.VectorClusterLayer=Rf,gy.vcm.layer.openlayers.VectorLayer=If,gy.vcm.layer.openlayers.WMSLayer=Gf,gy.vcm.layer.openlayers.WMTSLayer=Bf,gy.vcm.maps={},gy.vcm.maps.Cesium=Vt,gy.vcm.maps.Oblique=Pi,gy.vcm.maps.Openlayers=Hi,gy.vcm.util={},gy.vcm.util.Balloon=Do,gy.vcm.util.CreateLink={},gy.vcm.util.CreateLink.getLink=Uf,gy.vcm.util.CreateLink.makeLink=Wf,gy.vcm.util.Extent=Ae,gy.vcm.util.IconManager=Gr,gy.vcm.util.Logger=Y,gy.vcm.util.Login=Ps,gy.vcm.util.Projection=R,gy.vcm.util.ViewPoint=V,gy.vcm.util.downloadBlob=qd,gy.vcm.util.downloadCanvas=Kd,gy.vcm.util.downloadText=Jd,gy.vcm.util.editor={},gy.vcm.util.editor.AltitudeModeNames=sn,gy.vcm.util.editor.CircleGeometryEditor=Zo,gy.vcm.util.editor.ClassificationType=on,gy.vcm.util.editor.ClassificationTypeNames=ln,gy.vcm.util.editor.CompositeLayerEditor=kl,gy.vcm.util.editor.FeatureLayerEditor=vo,gy.vcm.util.editor.GeometryLayerEditor=hl,gy.vcm.util.editor.LineGeometryEditor=qo,gy.vcm.util.editor.ModeNames=rn,gy.vcm.util.editor.MultiGeometryEditor=nl,gy.vcm.util.editor.PointGeometryEditor=Ao,gy.vcm.util.editor.RectangleGeometryEditor=Mo,gy.vcm.util.editor.StyleLayerEditor=bl,gy.vcm.util.editor.circleFromCenterRadius=gi,gy.vcm.util.editor.convertGeometryToPolygon=yi,gy.vcm.util.editor.getEditorById=fs,gy.vcm.util.editor.getFeatureHeights=hi,gy.vcm.util.flight={},gy.vcm.util.flight.FlightInstance=Bs,gy.vcm.util.flight.FlightPlayer={},gy.vcm.util.flight.FlightPlayer.getInstance=Zf,gy.vcm.util.flight.FlightVisualizer={},gy.vcm.util.flight.FlightVisualizer.getInstance=ty,gy.vcm.util.flight.exportFlightAsGeoJson=Rs,gy.vcm.util.flight.flightInterpolations=Gs,gy.vcm.util.flight.parseFlightOptionsFromGeoJson=zs,gy.vcm.util.style={},gy.vcm.util.style.DeclarativeStyleItem=Tt,gy.vcm.util.style.Icon=sy,gy.vcm.util.style.Icon.getIconBySrc=oy,gy.vcm.util.style.PatternType=ze,gy.vcm.util.style.StyleItem=He,gy.vcm.util.style.StyleType=Fe,gy.vcm.util.style.VectorStyleItem=gt,gy.vcm.util.style.VectorStyleItem.defaultVectorStyle=vt,gy.vcm.util.style.VectorStyleItem.fromCesiumColor=pt,gy.vcm.util.style.createPattern=We,gy.vcm.util.style.getShapeFromOptions=lt,gy.vcm.util.style.getStringColor=Ue,gy.vcm.util.style.hexToOlColor=Ge,gy.vcm.util.style.olColorToHex=qe,gy.vcm.util.style.parseColor=Be,gy.vcm.util.style.shapeCategory=ut,gy.vcm.util.style.validateHexColor=Je,gy.vcm.util.style.vectorStyleSymbol=ft,gy.vcm.widgets={},gy.vcm.widgets.AdvancedWalkMode=fh,gy.vcm.widgets.BalloonInfo=gh,gy.vcm.widgets.Copyright=ph,gy.vcm.widgets.CreateLink=bh,gy.vcm.widgets.DisplayQuality=Uh,gy.vcm.widgets.Drawing=Jh,gy.vcm.widgets.Drawing.defaultDrawingStyle=Wh,gy.vcm.widgets.Export=Zh,gy.vcm.widgets.FeatureList=Xh,gy.vcm.widgets.Flight=_m,gy.vcm.widgets.Locator=Vu,gy.vcm.widgets.Measurement=Dd,gy.vcm.widgets.Measurement.defaultMeasurementStyle=Ed,gy.vcm.widgets.NavigationControls=Ad,gy.vcm.widgets.OverviewMap=Nd,gy.vcm.widgets.PDFCreator=rm,gy.vcm.widgets.PDFCreator.OrientationMode=Zd,gy.vcm.widgets.PositionDisplay=lm,gy.vcm.widgets.Query=Tu,gy.vcm.widgets.Shadow=um,gy.vcm.widgets.SingleMeasurement=Pd,gy.vcm.widgets.TransparentTerrainMode=vm,gy.vcm.widgets.WFSObject=ku,gy.vcm.widgets.WFSObject.AllLogicalRelations=Lu,gy.vcm.widgets.WFSObject.AllLogicalRelationsDoubleValue=bu,gy.vcm.widgets.WFSObject.AllLogicalRelationsSingleValue=_u,gy.vcm.widgets.WFSObject.AllSpatialFilters=Mu,gy.vcm.widgets.displayQuality={},gy.vcm.widgets.displayQuality.PostProcessStageType=Lh,gy.vcm.widgets.heightProfile={},gy.vcm.widgets.heightProfile.HeightProfile=Dm,gy.vcm.widgets.legend={},gy.vcm.widgets.legend.AbstractGroupItem=ca,gy.vcm.widgets.legend.ClusterItem=ha,gy.vcm.widgets.legend.FlightInstanceItem=ja,gy.vcm.widgets.legend.GroupItem=_a,gy.vcm.widgets.legend.GroupLayerItem=va,gy.vcm.widgets.legend.LayerItem=fa,gy.vcm.widgets.legend.Legend=Fa,gy.vcm.widgets.legend.PlanningClusterItem=Ca,gy.vcm.widgets.legend.PlanningClusterItem.getPlanningClusterItem=Ea,gy.vcm.widgets.legend.PlanningInstanceItem=Ta,gy.vcm.widgets.legend.PluginItem=La,gy.vcm.widgets.legend.TreeItem=oa,gy.vcm.widgets.legend.ViewpointItem=ka,gy.vcm.widgets.measurement={},gy.vcm.widgets.measurement.MeasurementType=$h,gy.vcm.widgets.planning={},gy.vcm.widgets.planning.Planning=xl,gy.vcm.widgets.planning.PlanningComment={},gy.vcm.widgets.planning.PlanningComment.commentTypes=Fs,gy.vcm.widgets.planning.PlanningInstance=Js,gy.vcm.widgets.planning.PlanningObject=za,gy.vcm.widgets.planning.PlanningObject.Status=Ha,gy.vcm.widgets.planning.PlanningObject.Type=Na,gy.vcm.widgets.planning.PlanningObjectDrawing=Ls,gy.vcm.widgets.planning.PlanningObjectFeatureStore=Os,gy.vcm.widgets.planning.PlanningObjectGltf=Va,gy.vcm.widgets.planning.PlanningObjectImage=Ua,gy.vcm.widgets.planning.PlanningObjectProcessing=ws,gy.vcm.widgets.query={},gy.vcm.widgets.query.filter={},gy.vcm.widgets.query.filter.CombinationFilter=hu,gy.vcm.widgets.query.filter.Filter=lu,gy.vcm.widgets.query.filter.GeometryFilter=yu,gy.vcm.widgets.query.filter.PropertyFilter=vu,gy.vcm.widgets.search={},gy.vcm.widgets.search.Elasticsearch=Uu,gy.vcm.widgets.search.ErrorItem=cy,gy.vcm.widgets.search.FeatureItem=ah,gy.vcm.widgets.search.LayerItem=oh,gy.vcm.widgets.search.Nominatim=Iu,gy.vcm.widgets.search.ResultItem=nh,gy.vcm.widgets.search.Search=uh,gy.vcm.widgets.search.VirtualcityLocationService=qu,gy.vcm.widgets.search.middleware={},gy.vcm.widgets.search.middleware.Near=$u,gy.vcm.widgets.search.middleware.Tags=Qu}]);
\ No newline at end of file
diff --git a/vcm/templates/newDevBahn.js b/vcm/templates/newDevBahn.js
index 209227e0c..6be1ec31d 100644
--- a/vcm/templates/newDevBahn.js
+++ b/vcm/templates/newDevBahn.js
@@ -12,20 +12,20 @@ function removebuildings() {
   var layersSTU = frameworkSTU.getLayers();
   for (var i = 0; i< layersSTU.length; i++) {
     var layerst = layersSTU[i];
-    if(layernameStuttgartTotal.indexOf(layerst.getName()) >= 0) {
+    if(layernameStuttgartTotal.indexOf(layerst.name) >= 0) {
       layerIndexStuttgartTotal = i
   }}
   for (var i = 0; i< layersSTU.length; i++) {
     var layerst = layersSTU[i];
-    if(layernameStuttgartBahnhof.indexOf(layerst.getName()) >= 0) {
+    if(layernameStuttgartBahnhof.indexOf(layerst.name) >= 0) {
       layerIndexStuttgartBahnhof = i
   }}
 
 
   var layerBAHN = layersSTU[layerIndexStuttgartBahnhof];
   var layerSTU = layersSTU[layerIndexStuttgartTotal];
-  var tilesetSTU = layerSTU.getCesium3DTileset();
-  var tilesetBAHN = layerBAHN.getCesium3DTileset();
+  var tilesetSTU = layerSTU.cesium3DTileset;
+  var tilesetBAHN = layerBAHN.cesium3DTileset;
   if( tilesetSTU ) {
     tilesetSTU.style = new Cesium.Cesium3DTileStyle({
       color: {
@@ -112,7 +112,7 @@ function oldZust(){
 
     for (var i = 0; i< layers.length; i++) {
     var layer = layers[i];
-    if(layerNamesToDeactivate.indexOf(layer.getName()) >= 0) {
+    if(layerNamesToDeactivate.indexOf(layer.name) >= 0) {
     layer.activate(false);
   }}
 
@@ -121,7 +121,7 @@ function oldZust(){
 
     for (var i = 0; i< layersA.length; i++) {
     var layerA = layersA[i];
-    if(layerNamesToActivate.indexOf(layerA.getName()) >= 0) {
+    if(layerNamesToActivate.indexOf(layerA.name) >= 0) {
     layerA.activate(true);
     }}
 
@@ -136,7 +136,7 @@ function oldZust(){
   // var layersZus = frameworkZus.getLayers();
   // for (var i = 0; i< layersZus.length; i++) {
   //   var layerst = layersZus[i];
-  //   if(layernameStockach.indexOf(layerst.getName()) >= 0) {
+  //   if(layernameStockach.indexOf(layerst.name) >= 0) {
   //   layerIndexStockach = i
   // }}
   // var layerStock = layersZus[layerIndexStockach];
@@ -153,7 +153,7 @@ function oldZust(){
 
     for (var i = 0; i< layers.length; i++) {
     var layer = layers[i];
-    if(layerNamesToActivate.indexOf(layer.getName()) >= 0) {
+    if(layerNamesToActivate.indexOf(layer.name) >= 0) {
     layer.activate(true);
   }}
     var layerNamesToDeactivate = ["StuttgartPart"]
@@ -161,7 +161,7 @@ function oldZust(){
 
     for (var i = 0; i< layersA.length; i++) {
     var layerA = layersA[i];
-    if(layerNamesToDeactivate.indexOf(layerA.getName()) >= 0) {
+    if(layerNamesToDeactivate.indexOf(layerA.name) >= 0) {
     layerA.activate(false);
     }}
 
@@ -175,7 +175,7 @@ function oldZust(){
   // var layersZus = frameworkZus.getLayers();
   // for (var i = 0; i< layersZus.length; i++) {
   //   var layerst = layersZus[i];
-  //   if(layernameStockach.indexOf(layerst.getName()) >= 0) {
+  //   if(layernameStockach.indexOf(layerst.name) >= 0) {
   //   layerIndexStockach = i
   // }}
   // var layerStock = layersZus[layerIndexStockach];
@@ -230,7 +230,7 @@ function oldZust(){
     var layersZus = frameworkZus.getLayers();
     for (var i = 0; i< layersZus.length; i++) {
       var layerst = layersZus[i];
-      if(layernameStockach.indexOf(layerst.getName()) >= 0) {
+      if(layernameStockach.indexOf(layerst.name) >= 0) {
       layerIndexStockach = i
     }}
     highlightBuildings(layerIndexStockach,["DEBW522AA00022dcc", "DEBW522AA0003bf3b","DEBW522AA0000976a","DEBW522AA00001d00"]);
@@ -241,10 +241,10 @@ function oldZust(){
 
     for (var i = 0; i< layers.length; i++) {
     var layer = layers[i];
-    if(layerNamesToActivate.indexOf(layer.getName()) >= 0) {
+    if(layerNamesToActivate.indexOf(layer.name) >= 0) {
     layer.activate(true);
     }
-    if(layerNamesToActivate2.indexOf(layer.getName()) >= 0) {
+    if(layerNamesToActivate2.indexOf(layer.name) >= 0) {
       layer.activate(true);
     }
   }
@@ -266,13 +266,13 @@ function oldZust(){
     var layersZus = frameworkZus.getLayers();
     for (var i = 0; i< layersZus.length; i++) {
       var layerst = layersZus[i];
-      if(layernameRosenstein.indexOf(layerst.getName()) >= 0) {
+      if(layernameRosenstein.indexOf(layerst.name) >= 0) {
       layerIndexRosenstein = i
     }}
 
 
     layer2 = layers[layerIndexRosenstein];
-    var tileset = layer2.getCesium3DTileset();
+    var tileset = layer2.cesium3DTileset;
     if( tileset ) {
       tileset.style = new Cesium.Cesium3DTileStyle({
         color: {
@@ -291,12 +291,12 @@ function oldZust(){
     var layersPart = frameworkPart.getLayers();
     for (var i = 0; i< layersPart.length; i++) {
       var layerPart = layersPart[i];
-      if(layernamePart.indexOf(layerPart.getName()) >= 0) {
+      if(layernamePart.indexOf(layerPart.name) >= 0) {
       layerIndexPart = i
     }}
 
     layer3 = layersPart[layerIndexPart];
-    var tilesetPart = layer3.getCesium3DTileset();
+    var tilesetPart = layer3.cesium3DTileset;
     if (tilesetPart) {
       tilesetPart.style = new Cesium.Cesium3DTileStyle({
           color: {
@@ -326,7 +326,7 @@ function oldZust(){
      var layers = framework.getLayers();
     // for (var i = 0; i< layers.length; i++) {
     //   var layersto = layers[i];
-    //   if(layernameStockach.indexOf(layersto.getName()) >= 0) {
+    //   if(layernameStockach.indexOf(layersto.name) >= 0) {
     //   layerIndexStockach = i
     // }}
     // var layer = layers[layerIndexStockach];
@@ -345,13 +345,13 @@ function oldZust(){
     var layersZus = frameworkZus.getLayers();
     for (var i = 0; i< layersZus.length; i++) {
       var layerst = layersZus[i];
-      if(layernameRosenstein.indexOf(layerst.getName()) >= 0) {
+      if(layernameRosenstein.indexOf(layerst.name) >= 0) {
       layerIndexRosenstein = i
     }}
 
 
     layer2 = layers[layerIndexRosenstein];
-    // var tileset = layer2.getCesium3DTileset();
+    // var tileset = layer2.cesium3DTileset;
     layer2.clearStyle();
 
     var layerIndexPart
@@ -360,13 +360,13 @@ function oldZust(){
     var layersPart = frameworkPart.getLayers();
     for (var i = 0; i< layersPart.length; i++) {
       var layerPart = layersPart[i];
-      if(layernamePart.indexOf(layerPart.getName()) >= 0) {
+      if(layernamePart.indexOf(layerPart.name) >= 0) {
       layerIndexPart = i
     }}
 
 
     layer3 = layersPart[layerIndexPart];
-    // var tilesetPart = layer3.getCesium3DTileset();
+    // var tilesetPart = layer3.cesium3DTileset;
     layer3.clearStyle();
     // tileset.style = new Cesium.Cesium3DTileStyle({
     //   color: {
@@ -382,10 +382,10 @@ function oldZust(){
 
     for (var i = 0; i< layerss.length; i++) {
     var layero = layerss[i];
-    if(layerNamesToActivate.indexOf(layero.getName()) >= 0) {
+    if(layerNamesToActivate.indexOf(layero.name) >= 0) {
     layero.activate(false);
     }
-    if(layerNamesToActivate2.indexOf(layero.getName()) >= 0) {
+    if(layerNamesToActivate2.indexOf(layero.name) >= 0) {
       layero.activate(false);
     }
   }
@@ -405,13 +405,13 @@ function oldZust(){
     var layersZus = frameworkZus.getLayers();
     for (var i = 0; i< layersZus.length; i++) {
       var layerst = layersZus[i];
-      if(layernameRosenstein.indexOf(layerst.getName()) >= 0) {
+      if(layernameRosenstein.indexOf(layerst.name) >= 0) {
       layerIndexRosenstein = i
     }}
 
 
     var layer2 = layersZus[layerIndexRosenstein];
-    var tileset = layer2.getCesium3DTileset();
+    var tileset = layer2.cesium3DTileset;
     if( tileset ) {
       tileset.style = new Cesium.Cesium3DTileStyle({
         color: {
@@ -435,12 +435,12 @@ function oldZust(){
     var layersPart = frameworkPart.getLayers();
     for (var i = 0; i< layersPart.length; i++) {
       var layerPart = layersPart[i];
-      if(layernamePart.indexOf(layerPart.getName()) >= 0) {
+      if(layernamePart.indexOf(layerPart.name) >= 0) {
       layerIndexPart = i
     }}
 
     var layer3 = layersPart[layerIndexPart];
-    var tilesetPart = layer3.getCesium3DTileset();
+    var tilesetPart = layer3.cesium3DTileset;
     if (tilesetPart) {
       tilesetPart.style = new Cesium.Cesium3DTileStyle({
           color: {
-- 
GitLab